Skip to content

Commit 55f5dc3

Browse files
committed
TASK: Make $parentScope in ComponentScope constructor mandatory
1 parent d2b5c9b commit 55f5dc3

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/TypeSystem/Scope/ComponentScope/ComponentScope.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class ComponentScope implements ScopeInterface
3434
{
3535
public function __construct(
3636
private readonly ComponentDeclarationNode $componentDeclarationNode,
37-
private readonly ?ScopeInterface $parentScope
37+
private readonly ScopeInterface $parentScope
3838
) {
3939
}
4040

@@ -46,15 +46,11 @@ public function lookupTypeFor(string $name): ?TypeInterface
4646
return $this->resolveTypeReference($typeReferenceNode);
4747
}
4848

49-
return $this->parentScope?->lookupTypeFor($name) ?? null;
49+
return $this->parentScope->lookupTypeFor($name);
5050
}
5151

5252
public function resolveTypeReference(TypeReferenceNode $typeReferenceNode): TypeInterface
5353
{
54-
if ($this->parentScope) {
55-
return $this->parentScope->resolveTypeReference($typeReferenceNode);
56-
}
57-
58-
throw new \Exception('@TODO: Unknown Type ' . $typeReferenceNode->name);
54+
return $this->parentScope->resolveTypeReference($typeReferenceNode);
5955
}
6056
}

0 commit comments

Comments
 (0)