New Features 🎉
- Added
@changelog
annotation above rule to explain why the rule does what it does in the output https://github.com/rectorphp/rector/pull/6073 - thanks @sabbelasichon
Just add it to your Rector rule:
/**
* @changelog https://wiki.php.net/rfc/typed_properties_v2#proposal
*/
final class TypedPropertyRector extends AbstractRector
{
}
Run Rector:
vendor/bin/rector ...
And if this rule changed the code, it will show the link too:
Applied Rectors:
* TypedPropertyRector - https://wiki.php.net/rfc/typed_properties_v2#proposal
- NEW PACKAGE Rector Installer for easier extension installing - https://github.com/rectorphp/rector/issues/6129 - thanks @sabbelasichon
- NEW PACKAGE Rector PHPStan Rules for rule developers - https://github.com/rectorphp/rector-phpstan-rules
- [DeadCode] Added
RemoveUnusedPrivateMethodParameterRector
- https://github.com/rectorphp/rector/pull/6168
- Refactored file processors to make use of
File
object (similar toScope
concept from PHPStan) https://github.com/rectorphp/rector/pull/6085
- Added
dump_node()
helper function to see what node you have https://github.com/rectorphp/rector/pull/6229 - thanks @ullique for inspiration
dump_node($string);
// change 2nd to increase depth
dump_node($string, 3);
New Downgrade Rules
- Added
DowngradeStrictTypeDeclarationRector
https://github.com/rectorphp/rector/pull/6107 - thanks @samsonasik
- Added
DowngradeArrayKeyFirstLastRector
- https://github.com/rectorphp/rector/pull/6137
- Added
DowngradeAnonymousClassRector
- https://github.com/rectorphp/rector/pull/6122 - thanks @samsonasik
- Added
DowngradeNullCoalesceRector
- https://github.com/rectorphp/rector/pull/6208 - thanks @samsonasik
Bugfixes 🐛
- Fixed invalid doc block tag crashing https://github.com/rectorphp/rector/pull/6068
- Fixed
parent
,self
,static
prefixing on class name change https://github.com/rectorphp/rector/pull/6159
- Fixed use of
AbstractRectorTestCase
in tests while usingrector/rector-prefixed
- https://github.com/rectorphp/rector/commit/f801c763a46ab2270543f1de7e6aeb8c97bf3d4e
- Fixed
AUTOLOAD_PATHS
andBOOTSTRAP_FILES
parameters in tests - https://github.com/rectorphp/rector/pull/6239
- Fixed displayed Rector version in
rector/rector-prefixed
https://github.com/rectorphp/rector/commit/26d6fff51d6dbf5030a140cd3705ef73c99bf4b1
- Fixed code conflicts with different php-parser version in
rector/rector-prefixed
- https://github.com/rectorphp/rector/commit/f15648eb057eab040e36804d860f1713d532a007, thanks @phpstan for inspiration