Compare commits
3 Commits
5fa1832928
...
6f05915e06
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f05915e06 | |||
| 865f50ad9b | |||
| e91a72117a |
@@ -3,7 +3,9 @@
|
|||||||
"type": "library",
|
"type": "library",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.4",
|
"php": "^8.4",
|
||||||
"potter/cloneable": "dev-main"
|
"potter/cloneable": "dev-main",
|
||||||
|
"potter/throwable": "dev-main",
|
||||||
|
"psr/container": "^2.0@dev"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
|||||||
@@ -14,8 +14,11 @@ trait AwareTrait
|
|||||||
|
|
||||||
final public function get(string $key): mixed
|
final public function get(string $key): mixed
|
||||||
{
|
{
|
||||||
|
if ($this->has($key)) {
|
||||||
return $this->aware[$key];
|
return $this->aware[$key];
|
||||||
}
|
}
|
||||||
|
throw new NotFoundException;
|
||||||
|
}
|
||||||
|
|
||||||
final public function has(string $key): bool
|
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