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 | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 2 | public function addError($error) |
|
| 35 | { |
||
| 36 | 2 | if (is_string($error)) { |
|
| 37 | 2 | $error = new UserError($error); |
|
| 38 | 2 | } elseif (!is_object($error) || !$error instanceof UserError) { |
|
| 39 | 1 | throw new \InvalidArgumentException(sprintf('Error must be string or instance of %s.', UserError::class)); |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | $this->errors[] = $error; |
|
| 43 | |||
| 44 | 2 | return $this; |
|
| 45 | } |
||
| 46 | |||
| 55 |