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 | 6 |
CRAP Score | 4.0466 |
Changes | 0 |
1 | <?php |
||
45 | 1 | public function addError($error) |
|
46 | { |
||
47 | 1 | if (is_string($error)) { |
|
48 | 1 | $error = new UserError($error); |
|
49 | 1 | } elseif (!is_object($error) || !$error instanceof UserError) { |
|
50 | throw new \InvalidArgumentException(sprintf('Error must be string or instance of %s.', UserError::class)); |
||
51 | } |
||
52 | |||
53 | 1 | $this->errors[] = $error; |
|
54 | |||
55 | 1 | return $this; |
|
56 | } |
||
57 | |||
66 |