Compare commits
3 Commits
5fa1832928
...
6f05915e06
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f05915e06 | |||
| 865f50ad9b | |||
| e91a72117a |
@@ -3,7 +3,9 @@
|
||||
"type": "library",
|
||||
"require": {
|
||||
"php": "^8.4",
|
||||
"potter/cloneable": "dev-main"
|
||||
"potter/cloneable": "dev-main",
|
||||
"potter/throwable": "dev-main",
|
||||
"psr/container": "^2.0@dev"
|
||||
},
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
|
||||
@@ -14,7 +14,10 @@ trait AwareTrait
|
||||
|
||||
final public function get(string $key): mixed
|
||||
{
|
||||
return $this->aware[$key];
|
||||
if ($this->has($key)) {
|
||||
return $this->aware[$key];
|
||||
}
|
||||
throw new NotFoundException;
|
||||
}
|
||||
|
||||
final public function has(string $key): bool
|
||||
|
||||
13
src/Potter/Aware/NotFoundException.php
Normal file
13
src/Potter/Aware/NotFoundException.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Potter\Aware;
|
||||
|
||||
use \Psr\Container\NotFoundExceptionInterface;
|
||||
use \Potter\Throwable\Throwable;
|
||||
|
||||
final class NotFoundException extends Throwable implements NotFoundExceptionInterface
|
||||
{
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user