Skip to content

Commit

Permalink
refactor: Locator::add()
Browse files Browse the repository at this point in the history
  • Loading branch information
Chemaclass committed Dec 23, 2023
1 parent 2178502 commit 92b36fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion gacela
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ if (!class_exists(Application::class)) {
Gacela::bootstrap($cwd);

$bootstrap = new ConsoleBootstrap();
$bootstrap->run();
try {
$bootstrap->run();
} catch (Exception $e) {
echo "gacela script failed. Error: " . $e->getMessage() . PHP_EOL;
}
4 changes: 1 addition & 3 deletions src/Framework/Container/Locator.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ public function get(string $className)
* @param class-string<T> $key
* @param T|null $value
*/
private function add(string $key, mixed $value = null): self
private function add(string $key, mixed $value = null): void
{
$this->instanceCache[$key] = $value;

return $this;
}
}

0 comments on commit 92b36fc

Please sign in to comment.