We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 2 | public function addError($error): self |
|
| 43 | { |
||
| 44 | 2 | if (is_string($error)) { |
|
| 45 | 2 | $error = new UserError($error); |
|
| 46 | 2 | } elseif (!is_object($error) || !$error instanceof \GraphQL\Error\UserError) { |
|
| 47 | 1 | throw new InvalidArgumentException(sprintf('Error must be string or instance of %s.', \GraphQL\Error\UserError::class)); |
|
| 48 | } |
||
| 49 | |||
| 50 | 2 | $this->errors[] = $error; |
|
| 51 | |||
| 52 | 2 | return $this; |
|
| 53 | } |
||
| 63 |