diff --git a/src/Type/IntegerRangeType.php b/src/Type/IntegerRangeType.php index 25beeaef4c..3acf6fe213 100644 --- a/src/Type/IntegerRangeType.php +++ b/src/Type/IntegerRangeType.php @@ -20,9 +20,8 @@ class IntegerRangeType extends IntegerType implements CompoundType { - public function __construct(private ?int $min, private ?int $max) + private function __construct(private ?int $min, private ?int $max) { - // this constructor can be made private when PHP 7.2 is the minimum parent::__construct(); assert($min === null || $max === null || $min <= $max); assert($min !== null || $max !== null); diff --git a/tests/PHPStan/Type/TypeCombinatorTest.php b/tests/PHPStan/Type/TypeCombinatorTest.php index e4db183ed0..d0278a60a6 100644 --- a/tests/PHPStan/Type/TypeCombinatorTest.php +++ b/tests/PHPStan/Type/TypeCombinatorTest.php @@ -2101,8 +2101,8 @@ public function dataUnion(): iterable ]; yield [ [ - new MixedType(false, new IntegerRangeType(17, null)), - new IntegerRangeType(19, null), + new MixedType(false, IntegerRangeType::fromInterval(17, null)), + IntegerRangeType::fromInterval(19, null), ], MixedType::class, 'mixed~int<17, 18>=implicit', @@ -3603,7 +3603,7 @@ public function dataIntersect(): iterable ]; yield [ [ - new MixedType(false, new IntegerRangeType(17, null)), + new MixedType(false, IntegerRangeType::fromInterval(17, null)), new MixedType(), ], MixedType::class,