| @@ 22-47 (lines=26) @@ | ||
| 19 | /** |
|
| 20 | * Class ArgumentDefinition |
|
| 21 | */ |
|
| 22 | class ArgumentDefinition extends AbstractDependentTypeDefinition implements ArgumentDefinitionInterface |
|
| 23 | { |
|
| 24 | use HasTypeIndication; |
|
| 25 | use HasDefaultValue; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * ArgumentDefinition constructor. |
|
| 29 | * @param TypeDefinition $parent |
|
| 30 | * @param string $name |
|
| 31 | * @param string $type |
|
| 32 | */ |
|
| 33 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 34 | { |
|
| 35 | parent::__construct($parent, $name); |
|
| 36 | ||
| 37 | $this->withTypeDefinition($type); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return TypeInterface |
|
| 42 | */ |
|
| 43 | public static function getType(): TypeInterface |
|
| 44 | { |
|
| 45 | return Type::of(Type::ARGUMENT); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 22-47 (lines=26) @@ | ||
| 19 | /** |
|
| 20 | * Class FieldDefinition |
|
| 21 | */ |
|
| 22 | class FieldDefinition extends AbstractDependentTypeDefinition implements FieldDefinitionInterface |
|
| 23 | { |
|
| 24 | use HasTypeIndication; |
|
| 25 | use HasArguments; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * FieldDefinition constructor. |
|
| 29 | * @param TypeDefinition $parent |
|
| 30 | * @param string $name |
|
| 31 | * @param string $type |
|
| 32 | */ |
|
| 33 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 34 | { |
|
| 35 | parent::__construct($parent, $name); |
|
| 36 | ||
| 37 | $this->withTypeDefinition($type); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return TypeInterface |
|
| 42 | */ |
|
| 43 | public static function getType(): TypeInterface |
|
| 44 | { |
|
| 45 | return Type::of(Type::FIELD); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 22-47 (lines=26) @@ | ||
| 19 | /** |
|
| 20 | * Class InputFieldDefinition |
|
| 21 | */ |
|
| 22 | class InputFieldDefinition extends AbstractDependentTypeDefinition implements InputFieldDefinitionInterface |
|
| 23 | { |
|
| 24 | use HasTypeIndication; |
|
| 25 | use HasDefaultValue; |
|
| 26 | ||
| 27 | /** |
|
| 28 | * ArgumentDefinition constructor. |
|
| 29 | * @param TypeDefinition $parent |
|
| 30 | * @param string $name |
|
| 31 | * @param string $type |
|
| 32 | */ |
|
| 33 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 34 | { |
|
| 35 | parent::__construct($parent, $name); |
|
| 36 | ||
| 37 | $this->withTypeDefinition($type); |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @return TypeInterface |
|
| 42 | */ |
|
| 43 | public static function getType(): TypeInterface |
|
| 44 | { |
|
| 45 | return Type::of(Type::INPUT_FIELD_DEFINITION); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||