DefinitionNamespace   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
eloc 9
dl 0
loc 41
c 0
b 0
f 0
ccs 0
cts 15
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getNode() 0 3 1
A getBundle() 0 3 1
A __construct() 0 7 3
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