Skip to content

Commit

Permalink
Require promoted properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jan 6, 2022
1 parent a1ce7bc commit db5229b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/rector-downgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
use Rector\DowngradePhp74\Rector\ArrowFunction\ArrowFunctionToAnonymousFunctionRector;
use Rector\DowngradePhp74\Rector\Property\DowngradeTypedPropertyRector;
use Rector\DowngradePhp80\Rector\Catch_\DowngradeNonCapturingCatchesRector;
use Rector\DowngradePhp80\Rector\Class_\DowngradePropertyPromotionRector;
use Rector\DowngradePhp80\Rector\ClassMethod\DowngradeTrailingCommasInParamUseRector;
use Rector\DowngradePhp80\Rector\FunctionLike\DowngradeUnionTypeDeclarationRector;
use Rector\DowngradePhp80\Rector\Property\DowngradeUnionTypeTypedPropertyRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

Expand Down Expand Up @@ -41,6 +43,8 @@
$services->set(DowngradeTrailingCommasInParamUseRector::class);
$services->set(DowngradeNonCapturingCatchesRector::class);
$services->set(DowngradeUnionTypeTypedPropertyRector::class);
$services->set(DowngradePropertyPromotionRector::class);
$services->set(DowngradeUnionTypeDeclarationRector::class);
}

if ($targetPhpVersionId < 70400) {
Expand Down
5 changes: 5 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@
<property name="nullPosition" value="last"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion">
<properties>
<property name="enable" value="true"/>
</properties>
</rule>
<exclude-pattern>tests/*/data</exclude-pattern>
<exclude-pattern>tests/*/Fixture</exclude-pattern>
<exclude-pattern>tests/e2e/resultCache_1.php</exclude-pattern>
Expand Down

0 comments on commit db5229b

Please sign in to comment.