Skip to content

Commit dfd9a74

Browse files
committed
Unit test fixes
1 parent f18c7a9 commit dfd9a74

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Analyser/MutatingScope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5701,7 +5701,7 @@ public function getConstantReflection(Type $typeWithConstant, string $constantNa
57015701
return $typeWithConstant->getConstant($constantName);
57025702
}
57035703

5704-
public function getConstantExplicitTypeFromConfig(string $constantName, Type $constantType): ?Type
5704+
public function getConstantExplicitTypeFromConfig(string $constantName, Type $constantType): Type
57055705
{
57065706
return $this->constantResolver->resolveConstantType($constantName, $constantType);
57075707
}

src/Analyser/Scope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getMethodReflection(Type $typeWithMethod, string $methodName): ?
8080

8181
public function getConstantReflection(Type $typeWithConstant, string $constantName): ?ClassConstantReflection;
8282

83-
public function getConstantExplicitTypeFromConfig(string $constantName, Type $constantType): ?Type;
83+
public function getConstantExplicitTypeFromConfig(string $constantName, Type $constantType): Type;
8484

8585
public function getIterableKeyType(Type $iteratee): Type;
8686

src/Type/Php/DefineConstantTypeSpecifyingExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ public function specifyTypes(
5050
return new SpecifiedTypes([], []);
5151
}
5252

53-
$finalType = $scope->getConstantExplicitTypeFromConfig(
53+
$valueType = $scope->getType($node->getArgs()[1]->value);
54+
$finalType = ($valueType === null) ? null : $scope->getConstantExplicitTypeFromConfig(
5455
$constantName->getValue(),
55-
$scope->getType($node->getArgs()[1]->value),
56+
$valueType,
5657
);
5758

5859
return $this->typeSpecifier->create(

0 commit comments

Comments
 (0)