Add has() Method

This commit is contained in:
2025-10-25 11:30:19 -04:00
parent 46b092f7df
commit 6fe0bfc36d
3 changed files with 7 additions and 0 deletions

View File

@@ -7,4 +7,5 @@ namespace Potter\Aware;
abstract class AbstractAware implements AwareInterface
{
abstract public function get(string $key): mixed;
abstract public function has(string $key): bool;
}

View File

@@ -7,4 +7,5 @@ namespace Potter\Aware;
interface AwareInterface
{
public function get(string $key): mixed;
public function has(string $key): bool;
}

View File

@@ -12,4 +12,9 @@ trait AwareTrait
{
return $this->aware[$key];
}
final public function has(string $key): bool
{
return array_key_exists($key, $array);
}
}