Add get() Method
This commit is contained in:
@@ -6,5 +6,5 @@ namespace Potter\Aware;
|
||||
|
||||
abstract class AbstractAware implements AwareInterface
|
||||
{
|
||||
|
||||
abstract public function get(string $key): mixed;
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ namespace Potter\Aware;
|
||||
|
||||
interface AwareInterface
|
||||
{
|
||||
|
||||
public function get(string $key): mixed;
|
||||
}
|
||||
|
||||
@@ -6,5 +6,10 @@ namespace Potter\Aware;
|
||||
|
||||
trait AwareTrait
|
||||
{
|
||||
|
||||
private array $aware = [];
|
||||
|
||||
final public function get(string $key): mixed
|
||||
{
|
||||
return $this->aware[$key];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user