Skip to content

Commit fff85f3

Browse files
committed
CompoundTypeHelper is deprecated
1 parent 1b48f43 commit fff85f3

20 files changed

+22
-26
lines changed

src/Type/Accessory/AccessoryLiteralStringType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\BooleanType;
77
use PHPStan\Type\CompoundType;
8-
use PHPStan\Type\CompoundTypeHelper;
98
use PHPStan\Type\Constant\ConstantArrayType;
109
use PHPStan\Type\Constant\ConstantIntegerType;
1110
use PHPStan\Type\ErrorType;
@@ -47,7 +46,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
4746
return TrinaryLogic::createNo();
4847
}
4948
if ($type instanceof CompoundType) {
50-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
49+
return $type->isAcceptedBy($this, $strictTypes);
5150
}
5251

5352
return $type->isLiteralString();

src/Type/Accessory/AccessoryNonEmptyStringType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\CompoundType;
7-
use PHPStan\Type\CompoundTypeHelper;
87
use PHPStan\Type\Constant\ConstantArrayType;
98
use PHPStan\Type\Constant\ConstantIntegerType;
109
use PHPStan\Type\ErrorType;
@@ -44,7 +43,7 @@ public function getReferencedClasses(): array
4443
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
4544
{
4645
if ($type instanceof CompoundType) {
47-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
46+
return $type->isAcceptedBy($this, $strictTypes);
4847
}
4948

5049
return $type->isNonEmptyString();

src/Type/Accessory/AccessoryNumericStringType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\CompoundType;
7-
use PHPStan\Type\CompoundTypeHelper;
87
use PHPStan\Type\Constant\ConstantArrayType;
98
use PHPStan\Type\Constant\ConstantIntegerType;
109
use PHPStan\Type\ErrorType;
@@ -44,7 +43,7 @@ public function getReferencedClasses(): array
4443
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
4544
{
4645
if ($type instanceof CompoundType) {
47-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
46+
return $type->isAcceptedBy($this, $strictTypes);
4847
}
4948

5049
return $type->isNumericString();

src/Type/Accessory/HasOffsetType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\CompoundType;
7-
use PHPStan\Type\CompoundTypeHelper;
87
use PHPStan\Type\ConstantScalarType;
98
use PHPStan\Type\ErrorType;
109
use PHPStan\Type\IntersectionType;
@@ -49,7 +48,7 @@ public function getReferencedClasses(): array
4948
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
5049
{
5150
if ($type instanceof CompoundType) {
52-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
51+
return $type->isAcceptedBy($this, $strictTypes);
5352
}
5453

5554
return $type->isOffsetAccessible()

src/Type/Accessory/NonEmptyArrayType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\CompoundType;
7-
use PHPStan\Type\CompoundTypeHelper;
87
use PHPStan\Type\Constant\ConstantFloatType;
98
use PHPStan\Type\Constant\ConstantIntegerType;
109
use PHPStan\Type\ErrorType;
@@ -40,7 +39,7 @@ public function getReferencedClasses(): array
4039
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
4140
{
4241
if ($type instanceof CompoundType) {
43-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
42+
return $type->isAcceptedBy($this, $strictTypes);
4443
}
4544

4645
return $type->isArray()

src/Type/ArrayType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getReferencedClasses(): array
6666
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
6767
{
6868
if ($type instanceof CompoundType) {
69-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
69+
return $type->isAcceptedBy($this, $strictTypes);
7070
}
7171

7272
if ($type instanceof ConstantArrayType) {

src/Type/CallableType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function getReferencedClasses(): array
7171
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
7272
{
7373
if ($type instanceof CompoundType && !$type instanceof self) {
74-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
74+
return $type->isAcceptedBy($this, $strictTypes);
7575
}
7676

7777
return $this->isSuperTypeOfInternal($type, true);

src/Type/ClosureType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getReferencedClasses(): array
8989
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
9090
{
9191
if ($type instanceof CompoundType) {
92-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
92+
return $type->isAcceptedBy($this, $strictTypes);
9393
}
9494

9595
if (!$type instanceof ClosureType) {

src/Type/CompoundTypeHelper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use PHPStan\TrinaryLogic;
66

7+
/**
8+
* @deprecated
9+
*/
710
class CompoundTypeHelper
811
{
912

src/Type/Generic/TemplateTypeParameterStrategy.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use PHPStan\TrinaryLogic;
66
use PHPStan\Type\CompoundType;
7-
use PHPStan\Type\CompoundTypeHelper;
87
use PHPStan\Type\Type;
98

109
/**
@@ -16,7 +15,7 @@ class TemplateTypeParameterStrategy implements TemplateTypeStrategy
1615
public function accepts(TemplateType $left, Type $right, bool $strictTypes): TrinaryLogic
1716
{
1817
if ($right instanceof CompoundType) {
19-
return CompoundTypeHelper::accepts($right, $left, $strictTypes);
18+
return $right->isAcceptedBy($left, $strictTypes);
2019
}
2120

2221
return $left->getBound()->accepts($right, $strictTypes);

0 commit comments

Comments
 (0)