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);

src/Type/IntegerRangeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
202202
}
203203

204204
if ($type instanceof CompoundType) {
205-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
205+
return $type->isAcceptedBy($this, $strictTypes);
206206
}
207207

208208
return TrinaryLogic::createNo();

src/Type/IterableType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
7070
}
7171

7272
if ($type instanceof CompoundType) {
73-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
73+
return $type->isAcceptedBy($this, $strictTypes);
7474
}
7575

7676
return TrinaryLogic::createNo();

src/Type/JustNullableTypeTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
2222
}
2323

2424
if ($type instanceof CompoundType) {
25-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
25+
return $type->isAcceptedBy($this, $strictTypes);
2626
}
2727

2828
return TrinaryLogic::createNo();

src/Type/NullType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
5757
}
5858

5959
if ($type instanceof CompoundType) {
60-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
60+
return $type->isAcceptedBy($this, $strictTypes);
6161
}
6262

6363
return TrinaryLogic::createNo();

src/Type/ObjectType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
204204
}
205205

206206
if ($type instanceof CompoundType) {
207-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
207+
return $type->isAcceptedBy($this, $strictTypes);
208208
}
209209

210210
if ($type instanceof ClosureType) {

src/Type/ObjectWithoutClassType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function getReferencedClasses(): array
4040
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
4141
{
4242
if ($type instanceof CompoundType) {
43-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
43+
return $type->isAcceptedBy($this, $strictTypes);
4444
}
4545

4646
return TrinaryLogic::createFromBoolean(

src/Type/StaticType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function getBaseClass(): string
110110
public function accepts(Type $type, bool $strictTypes): TrinaryLogic
111111
{
112112
if ($type instanceof CompoundType) {
113-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
113+
return $type->isAcceptedBy($this, $strictTypes);
114114
}
115115

116116
if (!$type instanceof static) {

src/Type/StringType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
7979
}
8080

8181
if ($type instanceof CompoundType) {
82-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
82+
return $type->isAcceptedBy($this, $strictTypes);
8383
}
8484

8585
if ($type instanceof TypeWithClassName && !$strictTypes) {

src/Type/Traits/ConstantScalarTypeTrait.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\GeneralizePrecision;
109
use PHPStan\Type\Type;
@@ -19,7 +18,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
1918
}
2019

2120
if ($type instanceof CompoundType) {
22-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
21+
return $type->isAcceptedBy($this, $strictTypes);
2322
}
2423

2524
return TrinaryLogic::createNo();

src/Type/UnionType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function accepts(Type $type, bool $strictTypes): TrinaryLogic
8585
}
8686

8787
if ($type instanceof CompoundType && !$type instanceof CallableType) {
88-
return CompoundTypeHelper::accepts($type, $this, $strictTypes);
88+
return $type->isAcceptedBy($this, $strictTypes);
8989
}
9090

9191
$results = [];

0 commit comments

Comments
 (0)