Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Type/IntegerRangeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions tests/PHPStan/Type/TypeCombinatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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,
Expand Down