We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 7 |
Paths | 10 |
Total Lines | 21 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 7 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 7 | public static function defaultResolveFn($source, $args, ResolveInfo $info) |
|
|
|||
20 | { |
||
21 | 7 | $fieldName = $info->fieldName; |
|
22 | 7 | $property = null; |
|
23 | |||
24 | 7 | $accessor = PropertyAccess::createPropertyAccessor(); |
|
25 | |||
26 | 7 | if (is_array($source) || $source instanceof \ArrayAccess) { |
|
27 | 2 | $index = sprintf('[%s]', $fieldName); |
|
28 | |||
29 | 2 | if ($accessor->isReadable($source, $index)) { |
|
30 | 2 | $property = $accessor->getValue($source, $index); |
|
31 | 2 | } |
|
32 | 7 | } elseif (is_object($source)) { |
|
33 | 4 | if ($accessor->isReadable($source, $fieldName)) { |
|
34 | 3 | $property = $accessor->getValue($source, $fieldName); |
|
35 | 3 | } |
|
36 | 4 | } |
|
37 | |||
38 | 7 | return $property instanceof \Closure ? $property($source) : $property; |
|
39 | } |
||
40 | } |
||
41 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.