diff options
Diffstat (limited to 'src/DTS/Errors.php')
| -rw-r--r-- | src/DTS/Errors.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/DTS/Errors.php b/src/DTS/Errors.php new file mode 100644 index 0000000..3c1dd5d --- /dev/null +++ b/src/DTS/Errors.php @@ -0,0 +1,30 @@ +<?php + +declare(strict_types=1); + +namespace DTS; + +class Errors +{ + private $errors = []; + + public function add(string $key, string $value): void + { + $this->errors[$key][] = $value; + } + + public function get(string $key): array + { + return $this->errors[$key]; + } + + public function has(string $key): bool + { + return array_key_exists($key, $this->errors); + } + + public function count(): int + { + return count($this->errors); + } +} |
