Code Duplication    Length = 22-22 lines in 2 locations

src/Query/Document.php 1 location

@@ 5-26 (lines=22) @@
2
3
namespace HansOtt\GraphQL\Query;
4
5
final class Document extends NodeBase
6
{
7
    public $definitions;
8
9
    /**
10
     * @param Definition[] $definitions
11
     */
12
    public function __construct(array $definitions = array())
13
    {
14
        $location = null;
15
        if (empty($definitions) === false) {
16
            $location = $definitions[0]->getLocation();
17
        }
18
        parent::__construct($location);
19
        $this->definitions = $definitions;
20
    }
21
22
    public function getChildren()
23
    {
24
        return $this->definitions;
25
    }
26
}
27

src/Schema/Schema.php 1 location

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