Skip to content

Commit 57bcbd6

Browse files
committed
simplify
1 parent 14199be commit 57bcbd6

1 file changed

Lines changed: 1 addition & 17 deletions

File tree

‎src/Analyser/NodeScopeResolver.php‎

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,22 +3300,6 @@ private function processParamNode(
33003300
$this->callNodeCallback($nodeCallback, new UsedAsStringNode($param->default), $scope, $storage);
33013301
}
33023302

3303-
/**
3304-
* Whether the native type is a string slot: a plain `string` or a union that
3305-
* contains a `string` member (e.g. `string|int`). Plain `mixed` is not a string
3306-
* slot, so arguments to untyped parameters do not fire.
3307-
*/
3308-
private function isStringSlotType(Type $type): bool
3309-
{
3310-
foreach (TypeUtils::flattenTypes($type) as $slotMemberType) {
3311-
if ($slotMemberType->isString()->yes()) {
3312-
return true;
3313-
}
3314-
}
3315-
3316-
return false;
3317-
}
3318-
33193303
/**
33203304
* @param AttributeGroup[] $attrGroups
33213305
* @param callable(Node $node, Scope $scope): void $nodeCallback
@@ -3759,7 +3743,7 @@ public function processArgs(
37593743
$argStringSlotType = $parameterNativeType ?? ($parameter instanceof NativeParameterReflection ? $parameter->getType() : null);
37603744
if (
37613745
$argStringSlotType !== null
3762-
&& $this->isStringSlotType($argStringSlotType)
3746+
&& !$argStringSlotType->isString()->no()
37633747
&& !ExprUsedAsStringVisitor::isAlreadyUsedAsStringSite($arg->value)
37643748
) {
37653749
$this->callNodeCallback($nodeCallback, new UsedAsStringNode($arg->value), $scopeToPass, $storage);

0 commit comments

Comments
 (0)