Skip to content

Commit

Permalink
add exception if app or project not found
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasfinsight committed Oct 9, 2020
1 parent 2725942 commit 5f1f05f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Registry/AppRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
5 changes: 5 additions & 0 deletions src/Registry/ProjectRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}

0 comments on commit 5f1f05f

Please sign in to comment.