71 Commits

Author SHA1 Message Date
Tomas Votruba
cffd7ea0ac
[CodingStyle] Move PHPStormVarAnnotationRector (#4985)
* [CodingStyle] Move PHPStormVarAnnotationRector

* [ci-review] Rector Rectify

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)

* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>

* [ci-review] Rector Rectify

* cleanup docs

* static fixes

* [ci-review] Rector Rectify

* remove duplicated

* multi use case

* misc

* [ci-review] Rector Rectify

* fixes

* remove order set, slow

* move UseMessageVariableForSprintfInSymfonyStyleRector from solid set to coding-style

* make unique-named variables to prevent accidental override and improve readability

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 13:20:13 +00:00
Tomas Votruba
61b72a8d7c
[DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here (#4984)
* [DeadDocBlock] Move RemoveNonExistingVarAnnotationRector here

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 00:56:59 +00:00
Tomas Votruba
d465ec83e2
[DeadCode] Move RecastingRemovalRector from PHPStan set (#4983)
* [DeadCode] Move RecastingRemovalRector from PHPStan set

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-25 00:22:45 +00:00
Abdul Malik Ikhsan
ca0b4cfdc7
[EarlyReturn] Register ChangeOrIfReturnToEarlyReturnRector to early-return set (#4975)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-24 17:28:56 +01:00
Tomas Votruba
f6900e687c
[PHP 8.0] Skip exception in match, must be expr (#4971)
* [PHP 8.0] Skip exception in match, must be expr

* add test case for var strings

* [ci-review] Rector Rectify

* skip universal

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-23 23:44:16 +00:00
Abdul Malik Ikhsan
9e6365cc58
[CodeQuality] Register SwitchNegatedTernaryRector to code-quality config set (#4947)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-22 22:01:19 +01:00
Abdul Malik Ikhsan
24e17588c1
[Utils] Run validate-fixture-namespace/classname to rules/ directories (#4935) 2020-12-22 18:12:20 +01:00
Tomas Votruba
37b3cecda3
Upgrade to php-parser 4.10.4 and PHPStan 0.12.63 (#4926)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-20 22:05:48 +01:00
Tomas Votruba
574c7cd174
[static] Narrow param types, remove duplicated methods (#4921)
* narrow types and other static fixes

* duplicates static fixes

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-20 13:50:55 +01:00
Abdul Malik Ikhsan
c196e46328
[PHP 8.0] Fixes #4852 Fixes crash on get_class() without parameter on ClassOnObjectRector (#4910) 2020-12-17 14:47:54 +01:00
Tomas Votruba
2ea430b0ec
[PHP 8.0] Fix used variable rename in propperty promotion (#4841)
* [PHP 8.0] Add test case for used variable

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-09 23:40:38 +00:00
Tomas Votruba
d131d804d9
Bump min PHP version to 7.3 (#4838)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-09 23:25:53 +01:00
Tomas Votruba
e157da77f9
[PHP 8.0] Skip void type in union (#4835) 2020-12-09 19:38:45 +01:00
Tomas Votruba
eac130e705
[PHP 8.0] Make Attribute silent keys explicit, with named args (#4834)
* decouple TagName class

* remove attribute aware from data provider tag value node, as unique class

* add RequiredTagValueNode

* make Attributes explicit, to avoid confusiong
2020-12-09 17:16:36 +00:00
Tomas Votruba
18fdd3313a
[PHP 8.0] get_parent_class() cannot be called on non-existing classes anymore (#4798)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-05 23:16:54 +01:00
Tomas Votruba
8bfb36d0b2
[Downgrade] [PHP 7.3] Downgrade trailing commas in function calls (#4796)
Co-authored-by: Tommy Quissens <tommy.quissens@storefront.be>
Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-05 22:40:10 +01:00
Krystian Marcisz
41ab37165c
[PHP 8.0] Add FinalPrivateToPrivateVisibilityRector (#4794) 2020-12-05 22:33:30 +01:00
TomasVotruba
25908c27f8 fix cs 2020-12-05 22:19:10 +01:00
Krystian Marcisz
49dceea41a
[PHP 8.0] Add SetStateToStaticRector (#4792) 2020-12-05 21:38:33 +01:00
Tomas Votruba
0b9c72ea9a
[PHP 8.0] Fix property removal in property promotion, if they have doctrine annotations (#4752)
* [PHP 8.0] Keep doctrine proeprty with annotations on property promotion

* [ci-review] Rector Rectify

Co-authored-by: rector-bot <tomas@getrector.org>
2020-12-02 14:26:14 +00:00
Tomas Votruba
499d452f99
Various improvements (#4717) 2020-11-27 21:39:42 +01:00
Tomas Votruba
a7705ed0a5
[Symplify 9] First update + switch to RuleDocGenerator (#4616)
* [composer] bump to Symplify 9

* [Symplify 9] Update phpstan rules

* bump to Symplify 9 BETA2

* update AbstractKernel from Tests to Testing namespace

* decoupling removing node trait

* remove fluent calls

* removing variadic

* [CodingStyle] Improve AnnotateThrowablesRector

* bump deps

* Make use of RuleDocGenerator

* first short

* [DocumentationGenerator] Drop deprecated package, RuleSetGenerator now handles it

* import namespace

* update docs
2020-11-16 17:50:38 +00:00
Abdul Malik Ikhsan
db18c7de19
[PHP 8.0] Improve NullsafeOperatorRector : Check against !== null (#4572)
* [PHP 8.0] Improve NullsafeOperatorRector : Check against !== null

* [ci-review] Apply coding standards

* [ci-review] Rector Rectify

* phpstan

* try process next only

* not identical process only direct if after assign

* phpstan

* [ci-review] Rector Rectify

* not identical with non-null check

* not identical with non-null check

* add yoda condition

* phpstan

* [ci-review] Apply coding standards

* move check if cond using assign identical/not identical to IfManipulator service

* cs fix

* [ci-review] Rector Rectify

* [ci-review] Apply coding standards

* move NullSafe process to NullsafeManipulator service

* phpstan

* [ci-review] Apply coding standards

* use instanceof check

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-11 11:48:47 +00:00
Abdul Malik Ikhsan
ef442dca03
[PHP 8.0] Improve NullsafeOperatorRector : No need ?-> on very first call (#4571)
* [PHP 8.0] Improve NullsafeOperatorRector : No need ?-> on very first call

* use bool check is start if

* phpstan

* phpstan and code example update

* [ci-review] Generate Rector & Nodes documentation

* [ci-review] Apply coding standards

* using $isStartIf = true default

* clean up

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-10 10:09:39 +00:00
Abdul Malik Ikhsan
b4fd52021d
[PHP 8.0] Improve NullsafeOperatorRector : Skip no direct usage after if in next statement at last (#4565)
* [PHP 8.0] Improve NullsafeOperatorRector : Skip no direct usage after if

* [ci-review] Apply coding standards

Co-authored-by: rector-bot <tomas@getrector.org>
2020-11-09 13:14:57 +00:00
Ronny López
531275df5b
Fix StrStartsWithRector to allow strpos not identical operation (#4562) 2020-11-08 23:35:05 +01:00
Abdul Malik Ikhsan
660f51019a
[PHP 8.0] Fixes #4527 Add NullsafeOperatorRector (#4557)
Co-authored-by: rector-bot <tomas@getrector.org>
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
2020-11-08 23:15:16 +01:00
Tomas Votruba
0513315056
Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node (#4522)
* Change file system approach of MultipleClassFileToPsr4ClassesRector to file without namespace node

* update DecoupleClassMethodToOwnClassRector

* [ci] add rebase jobp

* disable fail fast for unit tests

* misc
2020-10-31 12:59:40 +00:00
Tomas Votruba
0f2e6d407e
[DoctrineAnnotaitonGenerated] Update to doctrine/annotations 1.11 + fix static (#4479) 2020-10-25 14:43:05 +01:00
Tomas Votruba
6c51f3fb4f
[Restoration] Add InferParamFromClassMethodReturnRector (#4471)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-21 23:06:24 +02:00
Tomas Votruba
01514ab9a8
[SimplePhpDocParser] Add README + getParam*() helper methods (#4393) 2020-10-11 16:17:43 +02:00
Tomas Votruba
8191dca722
add fixture with property @required annotation to attribute (#4353) 2020-10-04 14:33:08 +00:00
Tomas Votruba
5597e57e12
[PHP 8.0] Add importing of Route, fix name to Annotation\Route one (#4352) 2020-10-04 14:24:49 +00:00
Tomas Votruba
08cce4f9d3
[PHP 8.0] Add @route to #[Route] attribute in Symfony 5.2 (#4350)
* move regex link to annotaiton

* improve configs

* [PHP 8.0] Add @Route to #[Route] attribute in Symfony 5.2

* add fully class attribute option

* [rector] add fully class attribute option

* [cs] add fully class attribute option

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-04 12:53:01 +00:00
Tomas Votruba
d0f65ef609
[PHP 8.0] @Required to #[Required] attribute from Symfony 5.2 (#4348)
* move ClassNodeAnalyzer to core

* README: add daily work focus

* spaces

* [PHP 8.0] Add #[Required] Symfony attribute migration

* add RFC links

* [rector] add RFC links

* [cs] add RFC links

Co-authored-by: rector-bot <tomas@getrector.org>
2020-10-04 11:12:41 +00:00
Tomas Votruba
8ae3868a57
[Restoration] Add RestoreFullyQualifiedNameRector (#4336)
* [Restoration] Add RestoreFullyQualifiedNameRector

* update docs

* use service aware test case for PHPStan rules

* improve FullyQualifiedNameMatcher

* cs fixes

* add return doc resolution

* composer: bump to symfony 4.4/5.1
2020-10-01 19:45:29 +00:00
Alister Bulman
8371ecca86
Update example to new-style php80 Attributes Fixes #4306 (#4307)
from the `<<>>` interim style.
2020-09-28 13:36:27 +02:00
Tomas Votruba
5a35553a2f
[PHP 8.0] Add Annotation to Attribute rule based on php-parser (#4292)
* monorepob-builder: add v prefix

* monorepob-builder: add v prefix

* [PHP 8.0] Add Annotation to Attribute rule based on php-parser

* [rector] [PHP 8.0] Add Annotation to Attribute rule based on php-parser

* [cs] [PHP 8.0] Add Annotation to Attribute rule based on php-parser

Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-25 08:17:36 +00:00
Igor
f2ecdeb0b1
[Naming] Foreach over "data", renames to "datum" (#4221)
Co-authored-by: rector-bot <tomas@getrector.org>
2020-09-15 10:23:13 +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
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
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
e7429d96a4
make use of constant (#3875) 2020-08-02 13:17:33 +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
dc14ddd0b9 [PHP 8.0] Add ChangeSwitchToMatchRector 2020-07-30 18:19:53 +02:00
TomasVotruba
99db894192 restore types 2020-07-27 10:44:51 +02:00
dobryy
f37cd4cac3 [Order] Apply rule 2020-07-26 15:11:41 +02:00
TomasVotruba
dec0975c22 [PHP 8.0] Add ClassPropertyAssignToConstructorPromotionRector 2020-07-26 11:42:14 +02:00
TomasVotruba
7ed4cb19c4 simplify config globs 2020-07-25 20:14:28 +02:00