Skip to content

Commit

Permalink
fix: sanity check on addResource
Browse files Browse the repository at this point in the history
  • Loading branch information
joostfaassen committed Jan 3, 2020
1 parent 86a562d commit 797f5e2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public function hasResource(string $typeName, string $name): bool

public function addResource(ResourceInterface $resource): void
{
if (!isset($this->typeClassMap[$resource->getTypeName()])) {
throw new Exception\UnknownResourceTypeException($resource->getTypeName());
}
$this->resources[$resource->getTypeName()][$resource->getName()] = $resource;
}

Expand Down

0 comments on commit 797f5e2

Please sign in to comment.