We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 5 |
Paths | 1 |
Total Lines | 40 |
Code Lines | 28 |
Lines | 0 |
Ratio | 0 % |
Tests | 29 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 15 | public function getDefinition() |
|
19 | { |
||
20 | 15 | $builder = new TreeBuilder(); |
|
21 | 15 | $node = $builder->root('_object_config'); |
|
22 | |||
23 | $node |
||
|
|||
24 | 15 | ->children() |
|
25 | 15 | ->append($this->nameSection()) |
|
26 | 15 | ->append($this->outputFieldsSelection('fields', true)) |
|
27 | 15 | ->append($this->descriptionSection()) |
|
28 | 15 | ->arrayNode('interfaces') |
|
29 | 15 | ->prototype('scalar')->info('One of internal or custom interface types.')->end() |
|
30 | 15 | ->end() |
|
31 | 15 | ->variableNode('isTypeOf')->end() |
|
32 | 15 | ->variableNode('resolveField')->end() |
|
33 | 15 | ->variableNode('fieldsDefaultAccess') |
|
34 | 15 | ->info('Default access control to fields (expression language can be use here)') |
|
35 | 15 | ->end() |
|
36 | 15 | ->end(); |
|
37 | |||
38 | 15 | $node->validate() |
|
39 | ->ifTrue(function ($v) { |
||
40 | |||
41 | 9 | return array_key_exists('fieldsDefaultAccess', $v) && null !== $v['fieldsDefaultAccess']; |
|
42 | 15 | }) |
|
43 | 15 | ->then(function ($v) { |
|
44 | 1 | foreach ($v['fields'] as &$field) { |
|
45 | 1 | if (array_key_exists('access', $field) && null !== $field['access']) { |
|
46 | 1 | continue; |
|
47 | } |
||
48 | |||
49 | 1 | $field['access'] = $v['fieldsDefaultAccess']; |
|
50 | 1 | } |
|
51 | |||
52 | 1 | return $v; |
|
53 | 15 | }) |
|
54 | 15 | ->end(); |
|
55 | |||
56 | 15 | return $node; |
|
57 | } |
||
58 | } |
||
59 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.