Add set() Method
This commit is contained in:
@@ -8,4 +8,5 @@ abstract class AbstractAware implements AwareInterface
|
||||
{
|
||||
abstract public function get(string $key): mixed;
|
||||
abstract public function has(string $key): bool;
|
||||
abstract protected function set(string $key, mixed $value): mixed;
|
||||
}
|
||||
|
||||
@@ -17,4 +17,9 @@ trait AwareTrait
|
||||
{
|
||||
return array_key_exists($key, $this->aware);
|
||||
}
|
||||
|
||||
final protected function set(string $key, mixed $value): mixed
|
||||
{
|
||||
return $this->aware[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user