We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 5 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 14 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 16 | protected function getFieldsWithDefaults($fields, array $defaultFields, $forceArray = true) |
||
| 17 | { |
||
| 18 | 18 | $callback = function () use ($fields, $defaultFields) { |
|
| 19 | 18 | if (empty($fields)) { |
|
| 20 | 14 | return $defaultFields; |
|
| 21 | } |
||
| 22 | |||
| 23 | 17 | if (is_callable($fields)) { |
|
| 24 | 2 | $fields = $fields(); |
|
|
|
|||
| 25 | 2 | } |
|
| 26 | |||
| 27 | 17 | if (!is_array($fields)) { |
|
| 28 | 1 | $fields = (array) $fields; |
|
| 29 | 1 | } |
|
| 30 | |||
| 31 | 17 | return array_merge($fields, $defaultFields); |
|
| 32 | 18 | }; |
|
| 33 | |||
| 34 | 18 | if ($forceArray) { |
|
| 35 | 17 | return $callback(); |
|
| 36 | } else { |
||
| 37 | 1 | return $callback; |
|
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
It seems like you are assigning to a variable which was imported through a
usestatement which was not imported by reference.For clarity, we suggest to use a different name or import by reference depending on whether you would like to have the change visibile in outer-scope.
Change not visible in outer-scope
Change visible in outer-scope