This is first release note list, so we included changes from the last month.
- See full diff: v0.8.7...0.8.28
New Features 🎉
Do you want to run Rector only on changed files?
# rector.php
use Rector\Core\Configuration\Option;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
$parameters->set(Option::ENABLE_CACHE, true);
};
- [#4311] Add
init
command, so you can createrector.php
config
vendor/bin/rector init
# "rector.php" created
- [#4336] [Restoration] Add
RestoreFullyQualifiedNameRector
to restore accidentaly shortened class names
-public \SomeClass $someProperty;
+public \App\Full\SomeClass $someProperty;
- [#4341] [Symfony] Add
AutoWireWithClassNameSuffixForMethodWithRequiredAnnotationRector
for class method names with@require
annotation, Thanks @samsonasik
- [#4348] [PHP 8.0] Add @required annotation to #[Required] attribute from Symfony 5.2
- [#4350] [PHP 8.0] Add @route annotation to #[Route] attribute in Symfony 5.2
- [#4391] [SimplePhpDocParser] Decoupled first split package - https://github.com/rectorphp/simple-php-doc-parser, can be installed as
composer require rector/simple-php-doc-parser
class SomeClass
{
public function canDrive(Car $car)
{
- if ($car->hasWheels && $car->hasFuel) {
- return true;
+ if (!$car->hasWheels) {
+ return false;
}
- return false;
+ if (!$car->hasFuel) {
+ return false;
+ }
+
+ return true;
}
}