Skip to content

Commit

Permalink
fixup! migrate code to PHPStan 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Dec 8, 2019
1 parent 4fa5b91 commit d82c443
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ public function refactor(Node $node): ?Node
}
}

// @see https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters
if ($this->isAtLeastPhpVersion('7.4') && $isSubtype) {
if ($this->isAtLeastPhpVersion(PhpVersionFeature::COVARIANT_RETURN) && $isSubtype) {
$node->returnType = $inferredReturnNode;
} elseif (! $isSubtype) { // type override
$node->returnType = $inferredReturnNode;
Expand Down
6 changes: 6 additions & 0 deletions src/ValueObject/PhpVersionFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ final class PhpVersionFeature
*/
public const BEFORE_UNION_TYPES = '7.4';

/**
* @see https://wiki.php.net/rfc/covariant-returns-and-contravariant-parameters
* @var string
*/
public const COVARIANT_RETURN = '7.4';

/**
* @var string
*/
Expand Down

0 comments on commit d82c443

Please sign in to comment.