Skip to content

Commit

Permalink
require PHP 7.4 for typed properties
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Mar 22, 2024
1 parent bbc48cc commit b3da143
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
use Rector\NodeManipulator\ClassDependencyManipulator;
use Rector\Rector\AbstractRector;
use Rector\TypeDeclaration\AlreadyAssignDetector\ConstructorAssignDetector;
use Rector\ValueObject\PhpVersionFeature;
use Rector\VersionBonding\Contract\MinPhpVersionInterface;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;

Expand All @@ -21,7 +23,7 @@
*
* @changelog https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/best-practices.html#initialize-collections-in-the-constructor
*/
final class ExplicitRelationCollectionRector extends AbstractRector
final class ExplicitRelationCollectionRector extends AbstractRector implements MinPhpVersionInterface
{
public function __construct(
private readonly AttrinationFinder $attrinationFinder,
Expand Down Expand Up @@ -126,4 +128,9 @@ public function refactor(Node $node): ?Node

return $node;
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::TYPED_PROPERTIES;
}
}

0 comments on commit b3da143

Please sign in to comment.