diff --git a/src/Rules/Properties/AccessPropertiesRule.php b/src/Rules/Properties/AccessPropertiesRule.php index 97bad6168ce..fdc27f0cd05 100644 --- a/src/Rules/Properties/AccessPropertiesRule.php +++ b/src/Rules/Properties/AccessPropertiesRule.php @@ -16,6 +16,7 @@ use PHPStan\Type\Constant\ConstantStringType; use PHPStan\Type\ErrorType; use PHPStan\Type\Type; +use PHPStan\Type\TypeUtils; use PHPStan\Type\VerbosityLevel; use function array_map; use function array_merge; diff --git a/src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php b/src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php index 4240b2b85f8..3715cc43292 100644 --- a/src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php +++ b/src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php @@ -10,7 +10,6 @@ use PHPStan\Type\NeverType; use PHPStan\Type\Type; use PHPStan\Type\TypeCombinator; -use PHPStan\Type\TypeUtils; use function count; class DateTimeZoneConstructorThrowTypeExtension implements DynamicStaticMethodThrowTypeExtension @@ -28,7 +27,7 @@ public function getThrowTypeFromStaticMethodCall(MethodReflection $methodReflect } $valueType = $scope->getType($methodCall->getArgs()[0]->value); - $constantStrings = TypeUtils::getConstantStrings($valueType); + $constantStrings = $valueType->getConstantStrings(); foreach ($constantStrings as $constantString) { try { diff --git a/src/Type/Php/StrSplitFunctionReturnTypeExtension.php b/src/Type/Php/StrSplitFunctionReturnTypeExtension.php index 6396da0099b..2cc1b3a98bf 100644 --- a/src/Type/Php/StrSplitFunctionReturnTypeExtension.php +++ b/src/Type/Php/StrSplitFunctionReturnTypeExtension.php @@ -20,7 +20,6 @@ use PHPStan\Type\StringType; use PHPStan\Type\Type; use PHPStan\Type\TypeCombinator; -use PHPStan\Type\TypeUtils; use function array_map; use function array_unique; use function count; @@ -88,7 +87,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, $stringType = $scope->getType($functionCall->getArgs()[0]->value); - $constantStrings = TypeUtils::getConstantStrings($stringType); + $constantStrings = $stringType->getConstantStrings(); if (count($constantStrings) > 0) { $results = []; foreach ($constantStrings as $constantString) {