AST.php
2 months ago
ASTDefinitionBuilder.php
2 months ago
BreakingChangesFinder.php
2 months ago
BuildClientSchema.php
2 months ago
BuildSchema.php
2 months ago
InterfaceImplementations.php
2 months ago
LazyException.php
2 months ago
LexicalDistance.php
2 months ago
MixedStore.php
2 months ago
PairSet.php
2 months ago
PhpDoc.php
2 months ago
SchemaExtender.php
2 months ago
SchemaPrinter.php
2 months ago
TypeComparators.php
2 months ago
TypeInfo.php
2 months ago
Utils.php
2 months ago
Value.php
2 months ago
InterfaceImplementations.php
43 lines
| 1 | <?php declare(strict_types=1); |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Vendor\GraphQL\Utils; |
| 4 | |
| 5 | use Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\InterfaceType; |
| 6 | use Automattic\WooCommerce\Vendor\GraphQL\Type\Definition\ObjectType; |
| 7 | |
| 8 | /** |
| 9 | * A way to track interface implementations. |
| 10 | * |
| 11 | * Distinguishes between implementations by ObjectTypes and InterfaceTypes. |
| 12 | */ |
| 13 | class InterfaceImplementations |
| 14 | { |
| 15 | /** @var array<int, ObjectType> */ |
| 16 | private $objects; |
| 17 | |
| 18 | /** @var array<int, InterfaceType> */ |
| 19 | private $interfaces; |
| 20 | |
| 21 | /** |
| 22 | * @param array<int, ObjectType> $objects |
| 23 | * @param array<int, InterfaceType> $interfaces |
| 24 | */ |
| 25 | public function __construct(array $objects, array $interfaces) |
| 26 | { |
| 27 | $this->objects = $objects; |
| 28 | $this->interfaces = $interfaces; |
| 29 | } |
| 30 | |
| 31 | /** @return array<int, ObjectType> */ |
| 32 | public function objects(): array |
| 33 | { |
| 34 | return $this->objects; |
| 35 | } |
| 36 | |
| 37 | /** @return array<int, InterfaceType> */ |
| 38 | public function interfaces(): array |
| 39 | { |
| 40 | return $this->interfaces; |
| 41 | } |
| 42 | } |
| 43 |