/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/MetaReader/ImplementsReader.php
42 строки
1 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2018 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\GraphQlSchemaStitching\GraphQlReader\MetaReader; /** * Reads interfaces implementations from the annotation @implements of an AST node */ class ImplementsReader { /** * Read implements annotation for a specific node if exists * * @param \GraphQL\Language\AST\NodeList $directives * @return string[]|null */ public function read(\GraphQL\Language\AST\NodeList $directives) : array { foreach ($directives as $directive) { if ($directive->name->value == 'implements') { foreach ($directive->arguments as $directiveArgument) { if ($directiveArgument->name->value == 'interfaces') { if ($directiveArgument->value->kind == 'ListValue') { $interfacesNames = []; foreach ($directiveArgument->value->values as $stringValue) { $interfacesNames[] = $stringValue->value; } return $interfacesNames; } else { return [$directiveArgument->value->value]; } } } } } return []; } }