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