Change has to isSet

This commit is contained in:
brabli
2025-11-27 15:17:14 +00:00
parent 376aede1ba
commit 3ad1d91c68
3 changed files with 7 additions and 7 deletions

View File

@@ -30,6 +30,6 @@ interface MetadataInterface
*
* @return bool `true` if the key is set (regardless of what the value is), otherwise `false`.
*/
public function has(string $key): bool;
public function isSet(string $key): bool;
}

View File

@@ -21,7 +21,7 @@ final class Metadata implements MetadataInterface
public function get(string $key): mixed
{
if (!$this->has($key)) {
if (!$this->isSet($key)) {
throw new MissingKeyException($key);
}
@@ -35,7 +35,7 @@ final class Metadata implements MetadataInterface
return $this;
}
public function has(string $key): bool
public function isSet(string $key): bool
{
return array_key_exists($key, $this->metadata);
}