NamespaceBlock   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 46
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
1
<?php
2
/**
3
 * This file is part of the Composite Utils package.
4
 *
5
 * (c) Emily Shepherd <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the
8
 * LICENSE.md file that was distributed with this source code.
9
 *
10
 * @package spaark/composite-utils
11
 * @author Emily Shepherd <[email protected]>
12
 * @license MIT
13
 */
14
15
namespace Spaark\CompositeUtils\Model\Reflection;
16
17
use Spaark\CompositeUtils\Model\Collection\ListCollection\FlexibleList;
18
use Spaark\CompositeUtils\Model\Collection\Map\HashMap;
19
20
/**
21
 * Represents a namespace declaration within a file
22
 *
23
 * @property-read FlexibleList $definitions
24
 * @property-read string $namespace
25
 * @property-read ReflectionFile $file
26
 * @property-read HashMap $useStatements
27
 */
28
class NamespaceBlock extends Reflector
29
{
30
    /**
31
     * Currently unused
32
     *
33
     * @var FlexibleList
34
     * @readable
35
     */
36
    protected $definitions;
37
38
    /**
39
     * The name of this namespace
40
     *
41
     * @var string
42
     * @readable
43
     */
44
    protected $namespace;
45
46
    /**
47
     * The file this namespace is declared in
48
     *
49
     * @var ReflectionFile
50
     * @readable
51
     */
52
    protected $file;
53
54
    /**
55
     * Set of use statements in this namespace block
56
     *
57
     * @var HashMap
58
     * @readable
59
     */
60
    protected $useStatements;
61
62
    /**
63
     * Creates a new NamespaceBlock with the given name
64
     *
65
     * @param string $namespace The name of the namespace
66
     */
67 23
    public function __construct(string $namespace)
68
    {
69 23
        $this->definitions = new FlexibleList();
70 23
        $this->useStatements = new HashMap();
71 23
        $this->namespace = $namespace;
72 23
    }
73
}
74