We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
1 | <?php |
||
18 | class ArgumentsTransformer |
||
19 | { |
||
20 | /** |
||
21 | * @var ValidatorInterface |
||
22 | */ |
||
23 | protected $validator; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $classesMap; |
||
29 | |||
30 | /** |
||
31 | * @var PropertyAccessor |
||
32 | */ |
||
33 | protected $accessor; |
||
34 | |||
35 | 1 | public function __construct(ValidatorInterface $validator, $classesMap = []) |
|
41 | |||
42 | /** |
||
43 | * Get the PHP class for a given type. |
||
44 | * |
||
45 | * @param string $type |
||
46 | * |
||
47 | * @return object|false |
||
48 | */ |
||
49 | 1 | private function getTypeClassInstance(string $type) |
|
55 | |||
56 | /** |
||
57 | * Extract given type from Resolve Info. |
||
58 | * |
||
59 | * @param string $type |
||
60 | * @param ResolveInfo $info |
||
61 | * |
||
62 | * @return Type |
||
63 | */ |
||
64 | 1 | private function getType(string $type, ResolveInfo $info): Type |
|
68 | |||
69 | /** |
||
70 | * Populate an object based on type with given data. |
||
71 | * |
||
72 | * @param Type $type |
||
73 | * @param mixed $data |
||
74 | * @param bool $multiple |
||
75 | * @param ResolveInfo $info |
||
76 | * |
||
77 | * @return mixed |
||
78 | */ |
||
79 | 1 | private function populateObject(Type $type, $data, $multiple = false, ResolveInfo $info) |
|
125 | |||
126 | /** |
||
127 | * Given a GraphQL type and an array of data, populate corresponding object recursively |
||
128 | * using annoted classes. |
||
129 | * |
||
130 | * @param string $argType |
||
131 | * @param mixed $data |
||
132 | * @param ResolveInfo $info |
||
133 | * |
||
134 | * @return mixed |
||
135 | */ |
||
136 | 1 | public function getInstanceAndValidate(string $argType, $data, ResolveInfo $info, string $argName) |
|
155 | |||
156 | /** |
||
157 | * Transform a list of arguments into their corresponding php class and validate them. |
||
158 | * |
||
159 | * @param array $mapping |
||
160 | * @param mixed $data |
||
161 | * @param ResolveInfo $info |
||
162 | * |
||
163 | * @return array |
||
164 | */ |
||
165 | 1 | public function getArguments(array $mapping, $data, ResolveInfo $info) |
|
185 | } |
||
186 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.