1 | <?php |
||
13 | trait GraphQLTemplateTrait { |
||
14 | |||
15 | /** |
||
16 | * @return bool |
||
17 | */ |
||
18 | abstract public static function hasGraphQLOperations(); |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | abstract public static function rawGraphQLQuery(); |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | abstract public static function rawGraphQLParent(); |
||
29 | |||
30 | /** |
||
31 | * @return string[] |
||
32 | */ |
||
33 | abstract public static function rawGraphQLIncludes(); |
||
34 | |||
35 | /** |
||
36 | * @return string[] |
||
37 | */ |
||
38 | abstract public static function rawGraphQLArguments(); |
||
39 | |||
40 | /** |
||
41 | * The GraphQL query processor. |
||
42 | * |
||
43 | * @var \Drupal\graphql\GraphQL\Execution\QueryProcessor |
||
44 | */ |
||
45 | protected $queryProcessor; |
||
46 | |||
47 | /** |
||
48 | * Debug mode flag. |
||
49 | * |
||
50 | * @var bool |
||
51 | */ |
||
52 | protected $debug = FALSE; |
||
53 | |||
54 | /** |
||
55 | * Inject the query processor. |
||
56 | * |
||
57 | * @param \Drupal\graphql\GraphQL\Execution\QueryProcessor $queryProcessor |
||
58 | * The query processor instance. |
||
59 | */ |
||
60 | public function setQueryProcessor(QueryProcessor $queryProcessor) { |
||
63 | |||
64 | /** |
||
65 | * Set debug mode for this template. |
||
66 | * |
||
67 | * @param bool $debug |
||
68 | * Boolean flag for debug mode. |
||
69 | */ |
||
70 | public function setDebug($debug) { |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function display(array $context, array $blocks = array()) { |
||
141 | |||
142 | /** |
||
143 | * Recursively build the GraphQL query. |
||
144 | * |
||
145 | * Builds the templates GraphQL query by iterating through all included or |
||
146 | * embedded templates recursively. |
||
147 | */ |
||
148 | public function getGraphQLQuery() { |
||
174 | |||
175 | /** |
||
176 | * Get the files parent template. |
||
177 | * |
||
178 | * @return \Twig_Template|null |
||
179 | * The parent template or null. |
||
180 | */ |
||
181 | protected function getGraphQLParent() { |
||
184 | |||
185 | /** |
||
186 | * Retrieve the files graphql fragment. |
||
187 | * |
||
188 | * @return string |
||
189 | * The GraphQL fragment. |
||
190 | */ |
||
191 | public function getGraphQLFragment() { |
||
199 | |||
200 | /** |
||
201 | * Retrieve a list of all direct or indirect included templates. |
||
202 | * |
||
203 | * @param string[] $recursed |
||
204 | * The list of templates already recursed into. Used internally. |
||
205 | * |
||
206 | * @return string[] |
||
207 | * The list of included templates. |
||
208 | */ |
||
209 | public function getGraphQLIncludes(&$recursed = []) { |
||
225 | } |
||
226 |
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.