Skip to content

Commit bd971db

Browse files
herndlmondrejmirtes
authored andcommitted
Make IntegerRangeType constructor private
1 parent 4add218 commit bd971db

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Type/IntegerRangeType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
class IntegerRangeType extends IntegerType implements CompoundType
2121
{
2222

23-
public function __construct(private ?int $min, private ?int $max)
23+
private function __construct(private ?int $min, private ?int $max)
2424
{
25-
// this constructor can be made private when PHP 7.2 is the minimum
2625
parent::__construct();
2726
assert($min === null || $max === null || $min <= $max);
2827
assert($min !== null || $max !== null);

tests/PHPStan/Type/TypeCombinatorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2101,8 +2101,8 @@ public function dataUnion(): iterable
21012101
];
21022102
yield [
21032103
[
2104-
new MixedType(false, new IntegerRangeType(17, null)),
2105-
new IntegerRangeType(19, null),
2104+
new MixedType(false, IntegerRangeType::fromInterval(17, null)),
2105+
IntegerRangeType::fromInterval(19, null),
21062106
],
21072107
MixedType::class,
21082108
'mixed~int<17, 18>=implicit',
@@ -3603,7 +3603,7 @@ public function dataIntersect(): iterable
36033603
];
36043604
yield [
36053605
[
3606-
new MixedType(false, new IntegerRangeType(17, null)),
3606+
new MixedType(false, IntegerRangeType::fromInterval(17, null)),
36073607
new MixedType(),
36083608
],
36093609
MixedType::class,

0 commit comments

Comments
 (0)