We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 8 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class UserErrors extends RuntimeException |
||
| 15 | { |
||
| 16 | /** @var UserError[] */ |
||
| 17 | private array $errors = []; |
||
| 18 | |||
| 19 | 2 | public function __construct( |
|
| 27 | 1 | } |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @param UserError[]|string[] $errors |
||
| 31 | */ |
||
| 32 | 2 | public function setErrors(array $errors): void |
|
| 33 | { |
||
| 34 | 2 | foreach ($errors as $error) { |
|
| 35 | 2 | $this->addError($error); |
|
| 36 | } |
||
| 37 | 1 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * @param string|\GraphQL\Error\UserError $error |
||
| 41 | */ |
||
| 42 | 2 | public function addError($error): self |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @return UserError[] |
||
| 57 | */ |
||
| 58 | 1 | public function getErrors(): array |
|
| 61 | } |
||
| 62 | } |
||
| 63 |