| 1: | <?php declare(strict_types = 1); |
| 2: | |
| 3: | namespace PHPStan\Php; |
| 4: | |
| 5: | use PHPStan\TrinaryLogic; |
| 6: | use PHPStan\Type\IntegerRangeType; |
| 7: | use PHPStan\Type\Type; |
| 8: | |
| 9: | |
| 10: | |
| 11: | |
| 12: | final class PhpVersions |
| 13: | { |
| 14: | |
| 15: | public function __construct( |
| 16: | private Type $phpVersions, |
| 17: | ) |
| 18: | { |
| 19: | } |
| 20: | |
| 21: | public function getType(): Type |
| 22: | { |
| 23: | return $this->phpVersions; |
| 24: | } |
| 25: | |
| 26: | public function supportsNoncapturingCatches(): TrinaryLogic |
| 27: | { |
| 28: | return IntegerRangeType::fromInterval(80000, null)->isSuperTypeOf($this->phpVersions)->result; |
| 29: | } |
| 30: | |
| 31: | public function producesWarningForFinalPrivateMethods(): TrinaryLogic |
| 32: | { |
| 33: | return IntegerRangeType::fromInterval(80000, null)->isSuperTypeOf($this->phpVersions)->result; |
| 34: | } |
| 35: | |
| 36: | public function supportsNamedArguments(): TrinaryLogic |
| 37: | { |
| 38: | return IntegerRangeType::fromInterval(80000, null)->isSuperTypeOf($this->phpVersions)->result; |
| 39: | } |
| 40: | |
| 41: | public function supportsNamedArgumentAfterUnpackedArgument(): TrinaryLogic |
| 42: | { |
| 43: | return IntegerRangeType::fromInterval(80100, null)->isSuperTypeOf($this->phpVersions)->result; |
| 44: | } |
| 45: | |
| 46: | public function supportsTrueAndFalseStandaloneType(): TrinaryLogic |
| 47: | { |
| 48: | return IntegerRangeType::fromInterval(80200, null)->isSuperTypeOf($this->phpVersions)->result; |
| 49: | } |
| 50: | |
| 51: | } |
| 52: | |