diff --git a/php/src/ContainerDefinitionFetcher.php b/php/src/ContainerDefinitionFetcher.php index 60e92305..7ec5a47a 100644 --- a/php/src/ContainerDefinitionFetcher.php +++ b/php/src/ContainerDefinitionFetcher.php @@ -27,7 +27,7 @@ class ContainerDefinitionFetcher $this->container = $container; } - public function GetContainerById(string $id): ?Container + public function GetContainerById(string $id): Container { $containers = $this->FetchDefinition(); @@ -36,8 +36,7 @@ class ContainerDefinitionFetcher return $container; } } - - return null; + throw new Exception("The provided id " . $id . " was not found in the container definition."); } /**