| @@ 14-69 (lines=56) @@ | ||
| 11 | use Youshido\GraphQL\Parser\Ast\Interfaces\ValueInterface; | |
| 12 | use Youshido\GraphQL\Parser\Location; | |
| 13 | ||
| 14 | class Argument extends AbstractAst | |
| 15 | { | |
| 16 | ||
| 17 | /** @var string */ | |
| 18 | private $name; | |
| 19 | ||
| 20 | /** @var ValueInterface */ | |
| 21 | private $value; | |
| 22 | ||
| 23 | /** | |
| 24 | * @param string $name | |
| 25 | * @param ValueInterface $value | |
| 26 | * @param Location $location | |
| 27 | */ | |
| 28 | public function __construct($name, ValueInterface $value, Location $location) | |
| 29 |     { | |
| 30 | parent::__construct($location); | |
| 31 | ||
| 32 | $this->name = $name; | |
| 33 | $this->value = $value; | |
| 34 | } | |
| 35 | ||
| 36 | /** | |
| 37 | * @return mixed | |
| 38 | */ | |
| 39 | public function getName() | |
| 40 |     { | |
| 41 | return $this->name; | |
| 42 | } | |
| 43 | ||
| 44 | /** | |
| 45 | * @param mixed $name | |
| 46 | */ | |
| 47 | public function setName($name) | |
| 48 |     { | |
| 49 | $this->name = $name; | |
| 50 | } | |
| 51 | ||
| 52 | /** | |
| 53 | * @return \Youshido\GraphQL\Parser\Ast\Interfaces\ValueInterface | |
| 54 | */ | |
| 55 | public function getValue() | |
| 56 |     { | |
| 57 | return $this->value; | |
| 58 | } | |
| 59 | ||
| 60 | /** | |
| 61 | * @param mixed $value | |
| 62 | */ | |
| 63 | public function setValue($value) | |
| 64 |     { | |
| 65 | $this->value = $value; | |
| 66 | } | |
| 67 | ||
| 68 | ||
| 69 | } | |
| @@ 15-62 (lines=48) @@ | ||
| 12 | use Youshido\GraphQL\Parser\Ast\Interfaces\ValueInterface; | |
| 13 | use Youshido\GraphQL\Parser\Location; | |
| 14 | ||
| 15 | class VariableReference extends AbstractAst implements ValueInterface | |
| 16 | { | |
| 17 | ||
| 18 | /** @var string */ | |
| 19 | private $name; | |
| 20 | ||
| 21 | /** @var Variable */ | |
| 22 | private $variable; | |
| 23 | ||
| 24 | /** @var mixed */ | |
| 25 | private $value; | |
| 26 | ||
| 27 | /** | |
| 28 | * @param string $name | |
| 29 | * @param Variable|null $variable | |
| 30 | * @param Location $location | |
| 31 | */ | |
| 32 | public function __construct($name, Variable $variable = null, Location $location) | |
| 33 |     { | |
| 34 | parent::__construct($location); | |
| 35 | ||
| 36 | $this->name = $name; | |
| 37 | $this->variable = $variable; | |
| 38 | } | |
| 39 | ||
| 40 | public function getVariable() | |
| 41 |     { | |
| 42 | return $this->variable; | |
| 43 | } | |
| 44 | ||
| 45 | public function getValue() | |
| 46 |     { | |
| 47 | return $this->value; | |
| 48 | } | |
| 49 | ||
| 50 | public function setValue($value) | |
| 51 |     { | |
| 52 | $this->value = $value; | |
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * @return string | |
| 57 | */ | |
| 58 | public function getName() | |
| 59 |     { | |
| 60 | return $this->name; | |
| 61 | } | |
| 62 | } | |
| 63 | ||
| @@ 14-71 (lines=58) @@ | ||
| 11 | use Youshido\GraphQL\Parser\Ast\Interfaces\FragmentInterface; | |
| 12 | use Youshido\GraphQL\Parser\Location; | |
| 13 | ||
| 14 | class TypedFragmentReference extends AbstractAst implements FragmentInterface | |
| 15 | { | |
| 16 | use AstDirectivesTrait; | |
| 17 | ||
| 18 | /** @var Field[]|Query[] */ | |
| 19 | protected $fields; | |
| 20 | ||
| 21 | /** @var string */ | |
| 22 | protected $typeName; | |
| 23 | ||
| 24 | /** | |
| 25 | * @param string $typeName | |
| 26 | * @param Field[]|Query[] $fields | |
| 27 | * @param Directive[] $directives | |
| 28 | * @param Location $location | |
| 29 | */ | |
| 30 | public function __construct($typeName, array $fields, array $directives, Location $location) | |
| 31 |     { | |
| 32 | parent::__construct($location); | |
| 33 | ||
| 34 | $this->typeName = $typeName; | |
| 35 | $this->fields = $fields; | |
| 36 | $this->setDirectives($directives); | |
| 37 | } | |
| 38 | ||
| 39 | /** | |
| 40 | * @return Field[]|Query[] | |
| 41 | */ | |
| 42 | public function getFields() | |
| 43 |     { | |
| 44 | return $this->fields; | |
| 45 | } | |
| 46 | ||
| 47 | /** | |
| 48 | * @param Field[]|Query[] $fields | |
| 49 | */ | |
| 50 | public function setFields($fields) | |
| 51 |     { | |
| 52 | $this->fields = $fields; | |
| 53 | } | |
| 54 | ||
| 55 | /** | |
| 56 | * @return string | |
| 57 | */ | |
| 58 | public function getTypeName() | |
| 59 |     { | |
| 60 | return $this->typeName; | |
| 61 | } | |
| 62 | ||
| 63 | /** | |
| 64 | * @param string $typeName | |
| 65 | */ | |
| 66 | public function setTypeName($typeName) | |
| 67 |     { | |
| 68 | $this->typeName = $typeName; | |
| 69 | } | |
| 70 | ||
| 71 | } | |