96 Commits

Author SHA1 Message Date
Chun-Sheng, Li
471e820d4e
Add self call fixtures for AssertResourceToClosed (#4103) 2020-09-02 11:53:55 +02:00
Tomas Votruba
7ac228c638
[CI] Add type-declaration set (#4089)
* [CI] Add type-declaration set

* [rector] [CI] Add type-declaration set

* [cs] [CI] Add type-declaration set

* skip nullable void

* add anonymous parent/interface support

* refactor MultiExceptionCatchRector to use Catch_ over integers

* type fixes

* fix unoin array type override

* remove unused test cases

* drop overcomplicated InlineValidationRulesToArrayDefinitionRector

* skip assign on var

* [rector] skip assign on var

* [cs] skip assign on var

* [rector] [cs] skip assign on var

* skip assign on var

* fixes

* [rector] fixes

* [cs] fixes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-01 17:56:30 +00:00
Chun-Sheng, Li
020c7b82b0
[PHPUnit] Add self call fixtures for AssertEqualsToSame rule (#4098) 2020-09-01 18:11:30 +02:00
Tomas Votruba
b281fb1260
StaticCall to MethodCall (#4085)
* drop MessageAsArrayRector, as only rule in guzzle

* [Transform] Move StaticCallToMethodCallRector to Transform

* merge FacadeStaticCallToConstructorInjectionRector to StaticCallToMethodCallRector

* add ArrayArgumentToDataProvider

* [Transform] Move PropertyAssignToMethodCallRector to Transform
2020-08-31 08:48:14 +00:00
Chun-Sheng, Li
0a589f9f68
Add AssertResourceToClosedResourceRector rule (#4037)
* Add AssertResourceToClosedResourceRector rule

* Using @source and @see comment annotations
2020-08-28 07:01:40 +02:00
Tomas Votruba
650dcc8ef0
beware reference (#4039) 2020-08-27 12:19:22 +02:00
Tomas Votruba
c1653070f5
[phpstan] Add rule for complex config (#4015)
* [phpstan] Add ForbiddenComplexArrayConfigInSetRule

* add MethodCallRename value object

* [SymfonyPhpConfig] Add array to value object configuration rule

* apply first MethodCallRename value object
2020-08-24 22:26:14 +00:00
Tomas Votruba
26e9163a10
[phpstan] add rule to prevent array with string keys (#4012)
* [phpstan] Add ForbiddenArrayWithStringKeysRule

* [compiler] use SmartFileSystem
2020-08-23 13:39:26 +00:00
Tomas Votruba
41b679cb2a
[DX] Replacing arrays with objects (#4008)
* [phpstan] Add forbidden array destruct to prevent array mess

* use ArrayCallable value object

* add OpeningAndClosingSpace

* drop ConstructorInjectionToActionInjectionRector, antipattern

* use value objects

* [rector] use value objects

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-23 09:39:09 +00:00
Tomas Votruba
9164d46a3b
[Naming] Add MakeGetterClassMethodNameStartWithGetRector (#4003)
* [Naming] Add MakeGetterClassMethodNameStartWithGetRector

* [rector] [Naming] Add MakeGetterClassMethodNameStartWithGetRector

* [cs] [Naming] Add MakeGetterClassMethodNameStartWithGetRector

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-22 15:46:09 +00:00
dobryy
2e7bdca4e2
[DX] Rename namespaces respect node type (#3973) 2020-08-18 17:57:30 +02:00
Mark Sch
2d7469efb8
Add AssertEqualsToSameRector (#3958) 2020-08-15 19:35:07 +02:00
Tomas Votruba
1c4b510513
PHPStan: require iterable types (#3936)
* phpstan: require iterable types

* add link on relative path and line

* fix missing class type

* typed array in Rector code + add data provide support resolver

* remove duplicated set

* drop unused yaml ecs config

* add out-of-the-box directory for 3rd party packages

* static fixes

* [rector] static fixes

* [cs] static fixes

* [rector] [cs] static fixes

* generic types

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-11 10:59:04 +00:00
dobryy
e4af8cc721
[Order] Order constants by visibility (#3934)
* [Order] Order constants by visibility

* phpstan iterable types fixes

* Fix PHPStan issue (unrelated to PR)

* Doc Update
2020-08-10 21:59:40 +00:00
Tomas Votruba
172653b606
drop EnsureDataProviderInDocBlockRector, job for coding standards (#3938) 2020-08-10 10:40:22 +02:00
dobryy
411d76f9a9
[Order] Make OrderPrivateMethodsByUseRector process file in one run u… (#3889)
* [Order] Make OrderPrivateMethodsByUseRector process file in one run using while loop

* [Order] Enable rule in CI

* [rector] [Order] Enable rule in CI

* [cs] [Order] Enable rule in CI

* [Order] Use constant for number of max attempts and throw exception when exceeded.

* [rector] [Order] Use constant for number of max attempts and throw exception when exceeded.

* [cs] [Order] Use constant for number of max attempts and throw exception when exceeded.

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-05 22:45:36 +02:00
Tomas Votruba
3ddf965146
FunctionTo* correction renames, add PHPStan rule to check correct category of rule (#3896)
* rename Function* to Func* rector rule

* [Utils] Add RequireRectorCategoryByGetNodeTypesRule

* [PHPUnit] Rename SpecificMethod to MethodCall category to respect subscriberd nodes

* [rector] [PHPUnit] Rename SpecificMethod to MethodCall category to respect subscriberd nodes

Co-authored-by: rector-bot <tomas@getrector.org>
2020-08-04 10:02:17 +00:00
Tomas Votruba
55acb3578a
[MagicDisclosure] Add SetterOnSetterMethodCallToStandaloneAssignRector (#3860)
* [MagicDisclosure] Add MethodCallOnSetterMethodCallToStandaloneAssignRector

* merge ChainMethodCallManipulator to ChainMethodCallNodeAnalyzer for better DX

* [MagicDisclosure] Add in arg defluent

* rebase
2020-08-01 11:41:16 +00:00
dobryy
3aa2fc8727
[Order] Order properties and constants with respect of complexity and position (#3826)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-07-31 22:20:45 +02:00
TomasVotruba
fe72e003ed use constants in configs 2020-07-30 13:53:53 +02:00
TomasVotruba
743e9c75a3 [Nette 3.0] Add container builder extends to helpers 2020-07-29 01:21:59 +02:00
dobryy
f37cd4cac3 [Order] Apply rule 2020-07-26 15:11:41 +02:00
TomasVotruba
7ed4cb19c4 simplify config globs 2020-07-25 20:14:28 +02:00
TomasVotruba
dc60a96ff6 [Nette] add support for new instance type 2020-07-24 18:32:31 +02:00
TomasVotruba
0188d802d2 use SmartFileSystem over Nette FileSystem 2020-07-24 14:39:10 +02:00
TomasVotruba
c2c1066374 [rector] apply on rules 2020-07-19 20:52:42 +02:00
TomasVotruba
0944b75f7e correct namespace in configs 2020-07-18 11:58:17 +02:00
TomasVotruba
0c816d60f8 [config] switch rules config from YAML to PHP 2020-07-16 12:48:54 +02:00
TomasVotruba
ee291d1fdc use strings over ::class in type detection, as they ge tprifexed by phar builder 2020-07-12 16:38:04 +02:00
TomasVotruba
3c3c3a9530 remove func call from methods calls 2020-07-06 01:59:41 +02:00
TomasVotruba
86a88bffb6 remove unused file 2020-07-01 23:22:24 +02:00
TomasVotruba
78a97fb8bf typos, skip empty class 2020-07-01 22:28:58 +02:00
TomasVotruba
b0250a558c cover return new case 2020-06-30 20:21:24 +02:00
TomasVotruba
2758fd5339 re-use hasPhpDocTagValueNode() 2020-06-30 02:20:09 +02:00
TomasVotruba
a8a6e7bcad rename file to fileInfo 2020-06-30 01:45:05 +02:00
TomasVotruba
547e15099d use explicit xBuilder classes to prevent typos and PHPStan and PHPStorm confussion 2020-06-30 01:34:19 +02:00
TomasVotruba
0cb82c2a6f apply new Naming_ 2020-06-30 00:57:38 +02:00
TomasVotruba
7f49658112 change test(string ) to test(SmartFileInfo ) in tests 2020-06-25 20:02:36 +02:00
TomasVotruba
c504062ec2 add typed property if on PHP 7.4 2020-06-24 15:09:50 +02:00
TomasVotruba
407fb91e99 Simplify ExplicitPhpErrorApiRector 2020-06-13 12:45:38 +02:00
TomasVotruba
2a7b506db3 add segfault prevention 2020-06-10 22:19:18 +02:00
TomasVotruba
e16559faf7 Fix AddDoesNotPerformAssertionToNonAssertingTestRector for mockery 2020-06-10 21:47:21 +02:00
TomasVotruba
c4595c7b69 update to php-parser 4.5 2020-06-03 11:39:18 +02:00
TomasVotruba
f5c9450478 correct ExceptionAnnotationRector description 2020-06-03 00:07:15 +02:00
TomasVotruba
b1ab674690 cleanup 2020-05-31 12:17:49 +02:00
TomasVotruba
3b3951aa3a update to phpstan/phpstan-phpunit 0.12.10 2020-05-31 12:13:37 +02:00
TomasVotruba
6446fe5e22 update to phpstan/phpstan-phpunit 0.12.9 2020-05-31 01:32:13 +02:00
TomasVotruba
e3463b1073 add comments constant to prevent typos 2020-05-25 17:03:48 +02:00
rector-bot
f107ee1bf3 fixup! fixup! [Legacy] Add FunctionToStaticMethodRector 2020-05-13 13:55:36 +00:00
rector-bot
16da4594f4 fixup! [Legacy] Add FunctionToStaticMethodRector 2020-05-13 13:54:39 +00:00