51 Commits

Author SHA1 Message Date
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
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
f113d3d103 fix php80 set 2020-07-01 23:35:40 +02:00
TomasVotruba
a8a6e7bcad rename file to fileInfo 2020-06-30 01:45:05 +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
641016f129 [PHP 8.0] Add RemoveUnusedVariableInCatchRector 2020-06-03 09:31:06 +02:00
TomasVotruba
56e2449918 [PHP 8.0] Add TokenGetAllToObjectRector 2020-06-02 18:12:19 +02:00
Guilliam Xavier
b118a18642
Fix typo in StrStartsWithRector code sample 2020-05-23 15:54:59 +02:00
TomasVotruba
ab4fe09dc3 [cs] update variable names 2020-05-03 13:38:00 +02:00
TomasVotruba
993550c9e9 [PHP 8.0] Add get_debug_type 2020-04-29 23:36:13 +02:00
TomasVotruba
a6b85af2cb [Php80] Add ClassOnObjectRector 2020-04-29 22:02:09 +02:00
TomasVotruba
1612ef2165 [PHP 8.0] Add attributes v2 2020-04-29 00:25:45 +02:00
TomasVotruba
1bf62ac1c7 [cs] sort private methods by call order and property by complexity 2020-04-26 02:57:47 +02:00
TomasVotruba
93dffbea56 [PHP 8.0] Add Stringable 2020-04-24 14:09:25 +02:00
TomasVotruba
833435037a [PHP 8] Add str_ends_with 2020-04-24 00:54:57 +02:00
TomasVotruba
55a122d205 StrStartWith refactoring 2020-04-24 00:22:46 +02:00
TomasVotruba
8082b3a2f2 [PHP 8.0] Add str_starts_with 2020-04-23 23:06:36 +02:00
TomasVotruba
8f1208d18b drop preg_match support from StrContains, too vague 2020-03-27 15:20:20 +01:00
TomasVotruba
3c3aa39f14 [PHP 80] Add StrContainsRector 2020-03-26 23:57:53 +01:00