Skip to content

Commit

Permalink
Update AccessPropertiesRule.php
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Dec 12, 2022
1 parent 75b7020 commit 50c106c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Rules/Properties/AccessPropertiesRule.php
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/Type/Php/DateTimeZoneConstructorThrowTypeExtension.php
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions src/Type/Php/StrSplitFunctionReturnTypeExtension.php
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 50c106c

Please sign in to comment.