Released Rector 0.13 with Scope Refresh and StmtsAwareInterface
New Features 🎉
- [Php82] Add ReadOnlyClassRector (#2296), Thanks @samsonasik!
- [Order] Add a-z ordering feature to OrderAttributesRector (#2243), Thanks @Lenny4!
- [Symfony] Add CommandPropertyToAttributeRector (#163), Thanks @stephanvierkant
- [Experimental] Add refactorWithScope() method to get typed Scope easily and required (#2227)
- Add Scope refresh for changed or new nodes (#2292)
From YAML routes to Annotations 🚀
- [Symfony] Add new rule to add annotations from router configuration to symfony controllers (#169), Thanks @malteschlueter
-foo_baz:
- path: /foo/{baz}
- defaults: { _controller: FooBundle:Bar:baz, _format: json }
- methods: [ GET, POST ]
+/**
+ * @Route(name="foo_baz", path="/foo/{baz}", methods={"GET","POST"}, defaults={_format="json"})
+ */
public function bazAction(string $baz)
New StmtsAwareInterface
node
- [DX] Add StmtsAwareInterface to catch node by type (#2269)
Do you need to iterface all rules with stmts in them? Hook in one node type:
/**
* @return array<class-string<Node>>
*/
public function getNodeTypes(): array
{
return [StmtsAwareInterface::class];
}
Bugfixes 🐛
- [CodeQuality] Skip CallableThisArrayToAnonymousFunctionRector when inside of Attribute (#2212), #6910, Thanks @samsonasik!
- Added new functions to NullToStrictStringFuncCallArgRector (#2217), Thanks @FlorinProfeanu!
- [Parallel] Fix --debug not working in parallel (#2307), Thanks @samsonasik!
- [DowngradePhp80] Handle match inside ArrowFunction on DowngradeMatchToSwitchRector (#2330), Thanks @samsonasik!
- [DowngradePhp80] Add in arrow function in return support on DowngradeMatchToSwitchRector (#2331), Thanks @samsonasik!
- [DowngradePhp80] Apply PHPStan 1.7.x-dev compatible for PhpParameterReflection (#2336), Thanks @samsonasik!
- [DeadCode] Skip used in Closure use on RemoveUnusedConstructorParamRector (#2341), Thanks @samsonasik!
- [Naming] Move collecting param names method to FunctionLikeManipulator (#2347), Thanks @samsonasik!
- [Naming] Handle Grouped use import on UseImportsResolver (#2348), Thanks @samsonasik!