Skip to content

Commit 239db41

Browse files
committed
[BCB] Remove TypeUtils::containsCallable()
1 parent 7088d79 commit 239db41

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

UPGRADING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,3 +259,4 @@ Instead of `PHPStanTestCase::createBroker()`, call `PHPStanTestCase::createRefle
259259
* Remove `TypeUtils::getDirectClassNames()`, use [`Type::getObjectClassNames()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getObjectClassNames) instead
260260
* Remove `TypeUtils::getConstantScalars()`, use [`Type::isConstantScalarValue()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_isConstantScalarValue) or [`Type::getConstantScalarTypes()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getConstantScalarTypes) instead
261261
* Remove `TypeUtils::getEnumCaseObjects()`, use [`Type::getEnumCases()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_getEnumCases) instead
262+
* Remove `TypeUtils::containsCallable()`, use [`Type::isCallable()`](https://apiref.phpstan.org/2.0.x/PHPStan.Type.Type.html#_isCallable) instead

src/Type/TypeUtils.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -198,24 +198,6 @@ public static function getAccessoryTypes(Type $type): array
198198
return self::map(AccessoryType::class, $type, true, false);
199199
}
200200

201-
/** @deprecated Use PHPStan\Type\Type::isCallable() instead. */
202-
public static function containsCallable(Type $type): bool
203-
{
204-
if ($type->isCallable()->yes()) {
205-
return true;
206-
}
207-
208-
if ($type instanceof UnionType) {
209-
foreach ($type->getTypes() as $innerType) {
210-
if ($innerType->isCallable()->yes()) {
211-
return true;
212-
}
213-
}
214-
}
215-
216-
return false;
217-
}
218-
219201
public static function containsTemplateType(Type $type): bool
220202
{
221203
$containsTemplateType = false;

0 commit comments

Comments
 (0)