| @@ 23-57 (lines=35) @@ | ||
| 20 | /** |
|
| 21 | * Class ArgumentDefinition |
|
| 22 | */ |
|
| 23 | class ArgumentDefinition extends AbstractDependentTypeDefinition implements ArgumentDefinitionInterface, Verifiable |
|
| 24 | { |
|
| 25 | use HasTypeIndication; |
|
| 26 | use HasDefaultValue; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * ArgumentDefinition constructor. |
|
| 30 | * @param TypeDefinition $parent |
|
| 31 | * @param string $name |
|
| 32 | * @param string $type |
|
| 33 | */ |
|
| 34 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 35 | { |
|
| 36 | parent::__construct($parent, $name); |
|
| 37 | ||
| 38 | $this->withTypeDefinition($type); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 43 | */ |
|
| 44 | public function verify(): void |
|
| 45 | { |
|
| 46 | $this->verifyInputType($this->getDefinition()); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @return TypeInterface |
|
| 51 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 52 | */ |
|
| 53 | public static function getType(): TypeInterface |
|
| 54 | { |
|
| 55 | return Type::of(Type::ARGUMENT); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| @@ 24-58 (lines=35) @@ | ||
| 21 | /** |
|
| 22 | * Class FieldDefinition |
|
| 23 | */ |
|
| 24 | class FieldDefinition extends AbstractDependentTypeDefinition implements FieldDefinitionInterface, Verifiable |
|
| 25 | { |
|
| 26 | use HasTypeIndication; |
|
| 27 | use HasArguments; |
|
| 28 | ||
| 29 | /** |
|
| 30 | * FieldDefinition constructor. |
|
| 31 | * @param TypeDefinition $parent |
|
| 32 | * @param string $name |
|
| 33 | * @param string $type |
|
| 34 | */ |
|
| 35 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 36 | { |
|
| 37 | parent::__construct($parent, $name); |
|
| 38 | ||
| 39 | $this->withTypeDefinition($type); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 44 | */ |
|
| 45 | public function verify(): void |
|
| 46 | { |
|
| 47 | $this->verifyOutputType($this->getDefinition()); |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @return TypeInterface |
|
| 52 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 53 | */ |
|
| 54 | public static function getType(): TypeInterface |
|
| 55 | { |
|
| 56 | return Type::of(Type::FIELD); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 23-57 (lines=35) @@ | ||
| 20 | /** |
|
| 21 | * Class InputFieldDefinition |
|
| 22 | */ |
|
| 23 | class InputFieldDefinition extends AbstractDependentTypeDefinition implements InputFieldDefinitionInterface, Verifiable |
|
| 24 | { |
|
| 25 | use HasTypeIndication; |
|
| 26 | use HasDefaultValue; |
|
| 27 | ||
| 28 | /** |
|
| 29 | * ArgumentDefinition constructor. |
|
| 30 | * @param TypeDefinition $parent |
|
| 31 | * @param string $name |
|
| 32 | * @param string $type |
|
| 33 | */ |
|
| 34 | public function __construct(TypeDefinition $parent, string $name, string $type) |
|
| 35 | { |
|
| 36 | parent::__construct($parent, $name); |
|
| 37 | ||
| 38 | $this->withTypeDefinition($type); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 43 | */ |
|
| 44 | public function verify(): void |
|
| 45 | { |
|
| 46 | $this->verifyInputType($this->getDefinition()); |
|
| 47 | } |
|
| 48 | ||
| 49 | /** |
|
| 50 | * @return TypeInterface |
|
| 51 | * @throws \Railt\Io\Exception\ExternalFileException |
|
| 52 | */ |
|
| 53 | public static function getType(): TypeInterface |
|
| 54 | { |
|
| 55 | return Type::of(Type::INPUT_FIELD_DEFINITION); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||