Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ImplementsReader.php
Go to the documentation of this file.
1 <?php
6 declare(strict_types=1);
7 
9 
14 {
21  public function read(\GraphQL\Language\AST\NodeList $directives) : array
22  {
23  foreach ($directives as $directive) {
24  if ($directive->name->value == 'implements') {
25  foreach ($directive->arguments as $directiveArgument) {
26  if ($directiveArgument->name->value == 'interfaces') {
27  if ($directiveArgument->value->kind == 'ListValue') {
28  $interfacesNames = [];
29  foreach ($directiveArgument->value->values as $stringValue) {
30  $interfacesNames[] = $stringValue->value;
31  }
32  return $interfacesNames;
33  } else {
34  return [$directiveArgument->value->value];
35  }
36  }
37  }
38  }
39  }
40  return [];
41  }
42 }