1
|
|
|
<?php |
2
|
|
|
/******************************************************************************* |
3
|
|
|
* This file is part of the GraphQL Bundle package. |
4
|
|
|
* |
5
|
|
|
* (c) YnloUltratech <[email protected]> |
6
|
|
|
* |
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
8
|
|
|
* file that was distributed with this source code. |
9
|
|
|
******************************************************************************/ |
10
|
|
|
|
11
|
|
|
namespace Ynlo\GraphQLBundle\Definition; |
12
|
|
|
|
13
|
|
|
use Ynlo\GraphQLBundle\Definition\Traits\ClassAwareDefinitionTrait; |
14
|
|
|
use Ynlo\GraphQLBundle\Definition\Traits\DefinitionTrait; |
15
|
|
|
use Ynlo\GraphQLBundle\Definition\Traits\ExtensionsAwareTrait; |
16
|
|
|
use Ynlo\GraphQLBundle\Definition\Traits\FieldsAwareDefinitionTrait; |
17
|
|
|
use Ynlo\GraphQLBundle\Definition\Traits\ObjectDefinitionTrait; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Class InterfaceDefinition |
21
|
|
|
*/ |
22
|
|
|
class InterfaceDefinition implements ObjectDefinitionInterface, HasExtensionsInterface |
23
|
|
|
{ |
24
|
|
|
use DefinitionTrait; |
25
|
|
|
use FieldsAwareDefinitionTrait; |
26
|
|
|
use ClassAwareDefinitionTrait; |
27
|
|
|
use ObjectDefinitionTrait; |
28
|
|
|
use ExtensionsAwareTrait; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @var string[] |
32
|
|
|
*/ |
33
|
|
|
protected $implementors = []; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @return \string[] |
37
|
|
|
*/ |
38
|
22 |
|
public function getImplementors(): array |
39
|
|
|
{ |
40
|
22 |
|
return $this->implementors; |
|
|
|
|
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param string $type |
45
|
|
|
*/ |
46
|
1 |
|
public function addImplementor($type) |
47
|
|
|
{ |
48
|
1 |
|
$this->implementors[$type] = $type; |
49
|
1 |
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @param string $type |
53
|
|
|
* |
54
|
|
|
* @return $this |
55
|
|
|
*/ |
56
|
|
|
public function removeImplementor($type) |
57
|
|
|
{ |
58
|
|
|
if (isset($this->implementors[$type])) { |
59
|
|
|
unset($this->implementors[$type]); |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
return $this; |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|