DefinitionNamespace::getNode()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Definition;
12
13
/**
14
 * DefinitionNamespace
15
 */
16
class DefinitionNamespace
17
{
18
    /**
19
     * @var string
20
     */
21
    protected $bundle;
22
23
    /**
24
     * @var string
25
     */
26
    protected $node;
27
28
    /**
29
     * DefinitionNamespace constructor.
30
     *
31
     * @param string $bundle
32
     * @param string $node
33
     */
34
    public function __construct(?string $bundle, ?string $node)
35
    {
36
        if (!$bundle && !$node) {
37
            throw new \InvalidArgumentException('Must define a bundle or node name to create a valid definition namespace');
38
        }
39
        $this->bundle = $bundle;
40
        $this->node = $node;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getBundle(): ?string
47
    {
48
        return $this->bundle;
49
    }
50
51
    /**
52
     * @return string
53
     */
54
    public function getNode(): ?string
55
    {
56
        return $this->node;
57
    }
58
}
59