Code Duplication    Length = 17-25 lines in 5 locations

src/Schema/DeclarationInputObject.php 1 location

@@ 5-26 (lines=22) @@
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class DeclarationInputObject extends NodeBase implements Declaration
6
{
7
    public $name;
8
    public $fields;
9
10
    /**
11
     * @param string $name
12
     * @param array $fields
13
     * @param Location|null $location
14
     */
15
    public function __construct($name, array $fields, Location $location = null)
16
    {
17
        parent::__construct($location);
18
        $this->name = $name;
19
        $this->fields = $fields;
20
    }
21
22
    public function getChildren()
23
    {
24
        return $this->fields;
25
    }
26
}
27

src/Schema/DeclarationInterface.php 1 location

@@ 5-26 (lines=22) @@
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class DeclarationInterface extends NodeBase implements Declaration
6
{
7
    public $name;
8
    public $fields;
9
10
    /**
11
     * @param string $name
12
     * @param Field[] $fields
13
     * @param Location|null $location
14
     */
15
    public function __construct($name, array $fields, Location $location = null)
16
    {
17
        parent::__construct($location);
18
        $this->name = (string) $name;
19
        $this->fields = $fields;
20
    }
21
22
    public function getChildren()
23
    {
24
        return $this->fields;
25
    }
26
}
27

src/Schema/DeclarationObject.php 1 location

@@ 5-29 (lines=25) @@
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class DeclarationObject extends NodeBase implements Declaration
6
{
7
    public $name;
8
    public $fields;
9
    public $interface;
10
11
    /**
12
     * @param string $name
13
     * @param Field[] $fields
14
     * @param string $interface
15
     * @param Location|null $location
16
     */
17
    public function __construct($name, array $fields, $interface = null, Location $location = null)
18
    {
19
        parent::__construct($location);
20
        $this->name = (string) $name;
21
        $this->fields = $fields;
22
        $this->interface = $interface;
23
    }
24
25
    public function getChildren()
26
    {
27
        return $this->fields;
28
    }
29
}
30

src/Schema/DeclarationUnion.php 1 location

@@ 5-21 (lines=17) @@
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class DeclarationUnion extends NodeBase implements Declaration
6
{
7
    public $name;
8
    public $members;
9
10
    /**
11
     * @param string $name
12
     * @param string[] $members
13
     * @param Location|null $location
14
     */
15
    public function __construct($name, array $members, Location $location = null)
16
    {
17
        parent::__construct($location);
18
        $this->name = (string) $name;
19
        $this->members = $members;
20
    }
21
}
22

src/Schema/Argument.php 1 location

@@ 5-29 (lines=25) @@
2
3
namespace HansOtt\GraphQL\Schema;
4
5
final class Argument extends NodeBase
6
{
7
    public $name;
8
    public $type;
9
    public $defaultValue;
10
11
    /**
12
     * @param string $name
13
     * @param Type $type
14
     * @param Value|null $defaultValue
15
     * @param Location|null $location
16
     */
17
    public function __construct($name, Type $type, Value $defaultValue = null, Location $location = null)
18
    {
19
        parent::__construct($location);
20
        $this->name = (string) $name;
21
        $this->type = $type;
22
        $this->defaultValue = $defaultValue;
23
    }
24
25
    public function getChildren()
26
    {
27
        return array($this->type, $this->defaultValue);
28
    }
29
}
30