Commit Graph

996 Commits

Author SHA1 Message Date
Tomas Votruba
49fc61c1ff
Bump to Symplify 11 (#2489)
* Bump to Symplify 11

* remove ContainerConfigurator from prefixed classes

* static fixes
2022-06-14 01:03:30 +02:00
Tomas Votruba
797cb38b88
Clean PHPStan errors (#2475) 2022-06-10 14:43:16 +00:00
kenjis
368dbb048c
docs: fix instruction in CONTRIBUTING.md (#2470)
* docs: fix instruction

bash-3.2$ composer check-platform-reqs
No vendor dir present, checking platform requirements from the lock file

In Locker.php line 331:

  [LogicException]
  No lockfile found. Unable to read locked packages

* phpstan

Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2022-06-10 07:49:18 +02:00
Abdul Malik Ikhsan
4f07a4f30f
[Php74] Remove ReservedFnFunctionRector (#2447)
* [Php74] Remove ReservedFnFunctionRector

* unregister rule

* phpstan
2022-06-07 08:34:00 +02:00
Tomas Votruba
0eba231b07
[PHP 8.1] Move ConstantListClassToEnumRector to PHP 8.1 (#2444) 2022-06-06 15:48:45 +00:00
Tomas Votruba
70261b71b7
[DeadCode] Fix known array type in empty if foreach (#2432) 2022-06-04 13:12:01 +00:00
Tomas Votruba
6b9984175f
[Naming] Fix PseudoNamespaceToNamespaceRector reporting on change (#2426)
* fix PseudoNamespaceToNamespaceRector reporting on change

* remove overly abstraction with visitor factories

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-06-04 08:09:40 +00:00
Tomas Votruba
c3581f9d33
Skip used in new ctor (#2425) 2022-06-04 07:37:23 +00:00
Tomas Votruba
c5f35e4a1d
[DeadCode] Add RemoveJustPropertyFetchForAssignRector (#2423) 2022-06-03 10:05:24 +00:00
Tomas Votruba
7722a57d80
[PHP 8.0] Add return type support to ConstantListClassToEnumRector (#2420)
* add return type support

* lock to last stable phpstan

* [ci-review] Rector Rectify

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-06-03 09:15:40 +02:00
Tomas Votruba
340f5b999c
[DowngradePhp80] Add DowngradeEnumToConstantListClassRector (#2416) 2022-06-02 13:56:11 +02:00
Tomas Votruba
e6ebae365b
[PHP 8.0] Add ConstantListClassToEnumRector (#2404)
* [PHP 8.0] Add ConstantListClassToEnumRector

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-06-01 15:16:02 +02:00
Tomas Votruba
01fc91e575
[CodeQuality] Add empty array support to InlineArrayReturnAssignRector (#2397) 2022-05-31 07:42:03 +00:00
Tomas Votruba
db57fbaae4
Remove myclabs/php-enum dependency (#2388)
* next

* use TypeKind in PHPStan enum type check

* turn ObjectReference into constant enumlike

* prefer selt/this to constant enum
2022-05-29 22:33:23 +00:00
Tomas Votruba
a9dd89b1cc
[DX] Remove CommandNaming magic, check rector class exists in RectorConfig (#2372) 2022-05-27 16:58:29 +02:00
Tomas Votruba
45eef47f27
[DX] Various config merge, improve RectorConfig methods (#2371) 2022-05-27 15:30:05 +02:00
Tomas Votruba
7adde5807c
[DX] Move configure to direct call in RectorConfig (#2367) 2022-05-27 10:52:46 +00:00
Tomas Votruba
d2456936e9 clear phpstan.neon 2022-05-27 12:42:31 +02:00
Abdul Malik Ikhsan
e33bcf19be
[Core] Override pModifiers() method to set final and abstract modifiers early on BetterStandardPrinter (#2328)
Co-authored-by: GitHub Action <action@github.com>
2022-05-18 12:41:43 +02:00
Abdul Malik Ikhsan
0686f438cc
[PHPStan] Enable symplify-rules.neon (#2318)
Co-authored-by: Tomas Votruba <tomas.vot@gmail.com>
Co-authored-by: GitHub Action <action@github.com>
2022-05-15 11:44:09 +00:00
Tomas Votruba
96400215b5
[automated] Re-Generate Nodes/Rectors Documentation (#2314)
* [automated] Re-Generate Nodes/Rectors Documentation

* use option 2

Co-authored-by: TomasVotruba <TomasVotruba@users.noreply.github.com>
Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
2022-05-15 09:35:22 +00:00
Tomas Votruba
28dc9cebb2
Prepare NamedToUnnamedArgs for PhpParameterReflection change in PHPStan 1.7 (#2305) 2022-05-13 11:21:30 +02:00
Tomas Votruba
33cd52e703
Fix position of class after non-reachable stmts (#2299)
* class cannot be under non-reachable stmts

* static fixes in bin/rector.php
2022-05-12 09:05:03 +00:00
Tomas Votruba
3d499125b8
Add Scope refresh for changed or new nodes (#2292) 2022-05-12 08:33:27 +02:00
Tomas Votruba
39e552c4c9
Various little improvement (#2297) 2022-05-12 08:07:50 +02:00
Tomas Votruba
2ccb53592e
Improve indent types (#2294) 2022-05-11 22:46:44 +00:00
Tomas Votruba
55be345ca9
Various improvements (#2291)
* add value object cache

* exact return type

* exact variable naming

* use stmts aware

* add known stmt aware

* re-use create array

* add cache closure

* misc
2022-05-11 17:47:37 +00:00
Tomas Votruba
17d200dfa6
[DX] Skip extra comment, add RectorConfig->rules() (#2290) 2022-05-11 16:45:25 +00:00
Abdul Malik Ikhsan
b8ff9ab25c
Use ReflectionResolver when possible, use AbstractRector when scope not needed (#2288) 2022-05-11 14:38:55 +00:00
Tomas Votruba
1dd739aab6
Update RemoveAlwaysTrueConditionSetInConstructorRector to return stmts (#2280)
* add check for string keys in RenameClassRector

* update RemoveAlwaysTrueConditionSetInConstructorRector to return stmts
2022-05-10 18:28:10 +02:00
Tomas Votruba
fa073d4408
[CodeQuality] Add SimplifyIfExactValueReturnValueRector (#2278) 2022-05-10 18:08:30 +02:00
Tomas Votruba
3c41b72a6b
cleanup phpstan.neon (#2273) 2022-05-09 11:26:27 +00:00
Tomas Votruba
a99574d6c5
Mini optimizations (#2272) 2022-05-09 11:10:34 +00:00
Lenny4
4468743419
[FEAT] refacto OrderAttributesRector (#2243)
* [FEAT] refacto OrderAttributesRector to allow strategy instead of specific array

* [DOC] update doc OrderAttributesRector

* [FIX] add option default value

* [REFACTO] create SpecificOrder folder

* [TU] add tu AlphabeticallOrder

* [FIX] use isAlphabetically instead of duplicate function logic

* [FIX] fix phpstan errors

* [FIX] fix NoNestedFuncCallRule ignore rule for OrderAttributesRector
2022-05-09 12:44:14 +02:00
Abdul Malik Ikhsan
60708d4501
[Core] Clean up repetitive is_file and manual register stub on BootstrapFilesIncluder (#2264)
* [Core] Clean up repetitive is_file on BootstrapFilesIncluder when try load stub

* phpstan

* clean up

* phpstan

* updated to use FilesFinder

* final touch: comment

* final touch: line

* final touch: using explicit ->getRealpath()
2022-05-09 06:09:43 +07:00
Tomas Votruba
975fdf113f
[DX] Add StmtsAwareInterface to catch node by type (#2269)
* add StmtsAwareInterface to catch node by type

* update build-preload

* use StmtsAwareInterface in InlineArrayReturnAssignRector
2022-05-08 20:50:37 +00:00
Tomas Votruba
88c9b8e20d
Make ChangeArrayPushToArrayAssignRector use stmts (#2265) 2022-05-08 10:46:35 +00:00
Tomas Votruba
333933b2d3
Change RemovePhpVersionIdCheckRector to work with direct If_ (#2259)
Co-authored-by: GitHub Action <action@github.com>
2022-05-07 20:12:58 +02:00
Tomas Votruba
c2ade0583c
[DX] Refactor ChangeNestedIfsToEarlyReturnRector to direct return (#2250) 2022-05-07 09:20:29 +00:00
Tomas Votruba
176d6d7e2a
Refactor ChangeAndIfToEarlyReturnRector to work with stmts (#2244) 2022-05-06 22:25:30 +00:00
Tomas Votruba
561e3963e1
Use refactorWithScope() in MakeInheritedMethodVisibilitySameAsParentRector (#2236)
* make MakeInheritedMethodVisibilitySameAsParentRector work with scope and Class_ node

* use scope aware rule in ForeachItemsAssignToEmptyArrayToAssignRector

* use Scope aware method in ParamTypeDeclarationRector

* make DowngradeNonCapturingCatchesRector use of scope aware

* make RemoveDeadInstanceOfRector use of scope awre

* misc

* make ChangeMethodVisibilityRector use the scope aware

* make ParamTypeByParentCallTypeRector use of abstract scope aware

* make Php4ConstructorRector scope aware

* use Scope aware in AddClosureReturnTypeRector

* make DowngradeParentTypeDeclarationRector use of scope aware

* move up the loop

* cleanup static method check, not used
2022-05-05 19:36:21 +02:00
Tomas Votruba
d8c523625c
Various property + class context improvements (#2234)
* improve read property detector

* pass class to acompany the prpoerty changed to have the main node in the context

* add IncDecParentNodeReadAnalyzer
2022-05-05 09:30:58 +00:00
Tomas Votruba
3184d55477
[DX] Use direct return of multi nodes instead of 2 addNode before/after node (#2232)
Co-authored-by: GitHub Action <action@github.com>
2022-05-05 10:25:46 +02:00
Abdul Malik Ikhsan
dd178deaa6
[DeadCode] Do not remove unused param in middle on RemoveUnusedConstructorParamRector (#2231)
* [DeadCode] Do not remove unused param in middle on RemoveUnusedConstructorParamRector

* more fixture

* Fixed 🎉

* Fixed 🎉
2022-05-05 14:39:19 +07:00
Tomas Votruba
0175838a0c
[DX] Cleanup ComplexNodeRemover (#2230)
* misc

* final

* cleanup

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-05-05 08:04:15 +02:00
Tomas Votruba
2d16736414
[DX] Remove poorly designed NodeToReplacePostRector, return changed nodes directly in the current rule (#2229) 2022-05-05 00:16:25 +02:00
Tomas Votruba
767e7692e1
[Experimental] Add refactorWithScope() method to get typed Scope easily and required (#2227) 2022-05-04 17:14:19 +02:00
Tomas Votruba
08bb10de6b
[CodeQuality] Add InlineArrayReturnAssignRector (#2183)
* [CodeQuality] Add InlineArrayReturnAssignRector

* enable rule in code-quality

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-04-28 14:46:43 +00:00
Tomas Votruba
ba29e3fd5f
Re-use name scope (#2171)
* re-use name scope

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
2022-04-26 12:55:06 +00:00
Tomas Votruba
19284802ae
Decouple aliased object type specifier + updgrade to PHPStan 1.6 (#2170)
* make of use array

* shorten instanceof

* update rules tests union order

* fix array index order

* update anonymous class references

* [skip ci] bump phpstan to 1.6 min
2022-04-26 11:42:01 +02:00