diff --git a/src/Registry/AppRegistry.php b/src/Registry/AppRegistry.php index a0db806..f88d0ae 100644 --- a/src/Registry/AppRegistry.php +++ b/src/Registry/AppRegistry.php @@ -47,6 +47,11 @@ public function has(string $appName): bool public function get(string $appName): AppInterface { + if(!$this->has($appName)) { + throw new \InvalidArgumentException( + sprintf('App "%s" does not exist', $appName) + ); + } return $this->apps[$appName]; } } diff --git a/src/Registry/ProjectRegistry.php b/src/Registry/ProjectRegistry.php index 3e1b1fa..1b4e9a3 100644 --- a/src/Registry/ProjectRegistry.php +++ b/src/Registry/ProjectRegistry.php @@ -51,6 +51,11 @@ public function has(string $projectName): bool public function get(string $projectName): ProjectInterface { + if(!$this->has($projectName)) { + throw new \InvalidArgumentException( + sprintf('Project "%s" does not exist', $projectName) + ); + } return $this->projects[$projectName]; } }