Implement Aware

This commit is contained in:
2025-10-25 16:23:25 -04:00
parent 2a1edb96c8
commit 69305db69a
3 changed files with 13 additions and 3 deletions

View File

@@ -2,7 +2,8 @@
"name": "potter/nameable", "name": "potter/nameable",
"type": "library", "type": "library",
"require": { "require": {
"php": "^8.4" "php": "^8.4",
"potter/aware": "dev-main"
}, },
"license": "MIT", "license": "MIT",
"autoload": { "autoload": {

View File

@@ -4,7 +4,9 @@ declare(strict_types=1);
namespace Potter\Nameable; namespace Potter\Nameable;
interface NameableInterface use \Potter\Aware\AwareInterface;
interface NameableInterface extends AwareInterface
{ {
} }

View File

@@ -4,7 +4,14 @@ declare(strict_types=1);
namespace Potter\Nameable; namespace Potter\Nameable;
use \Potter\Aware\AwareInterface;
trait NameableTrait trait NameableTrait
{ {
abstract public function get(string $key): mixed;
abstract public function has(string $key): bool;
abstract protected function set(string $key, mixed $value): mixed;
abstract protected function unset(string $key): void;
abstract public function with(string $key, mixed $value): AwareInterface;
abstract public function without(string $key): AwareInterface;
} }