GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Node   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 100
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 0
dl 0
loc 100
rs 10
c 0
b 0
f 0

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A setName() 0 6 1
A getFullName() 0 10 2
A getParent() 0 4 1
A setParent() 0 6 1
A hasParent() 0 4 1
1
<?php
2
namespace Naneau\FileGen;
3
4
/**
5
 * A node to be created
6
 */
7
class Node
8
{
9
    /**
10
     * Name of the node
11
     *
12
     * @var string
13
     **/
14
    private $name;
15
16
    /**
17
     * Parent node
18
     *
19
     * @var Node
20
     **/
21
    private $parent;
22
23
    /**
24
     * Constructor
25
     *
26
     * @param  string $name
27
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
28
     **/
29
    public function __construct($name)
30
    {
31
        $this->setName($name);
32
    }
33
34
    /**
35
     * Get the name of the node
36
     *
37
     * @return string
38
     */
39
    public function getName()
40
    {
41
        return $this->name;
42
    }
43
44
    /**
45
     * Set the name of the node
46
     *
47
     * @param  string $name
48
     * @return Node
49
     */
50
    public function setName($name)
51
    {
52
        $this->name = $name;
53
54
        return $this;
55
    }
56
57
    /**
58
     * Get the name including that of the parent's
59
     *
60
     * @param  string $separator
61
     * @return string
62
     **/
63
    public function getFullName($separator = DIRECTORY_SEPARATOR)
64
    {
65
        if ($this->hasParent()) {
66
            return $this->getParent()->getFullName($separator)
67
                . $separator
68
                . $this->getName();
69
        }
70
71
        return $this->getName();
72
    }
73
74
    /**
75
     * Get the parent node
76
     *
77
     * @return Node
78
     */
79
    public function getParent()
80
    {
81
        return $this->parent;
82
    }
83
84
    /**
85
     * Set the parent node
86
     *
87
     * @param  Node $parent
88
     * @return Node
89
     */
90
    public function setParent(Node $parent)
91
    {
92
        $this->parent = $parent;
93
94
        return $this;
95
    }
96
97
    /**
98
     * Does this node have a parent?
99
     *
100
     * @return bool
101
     **/
102
    public function hasParent()
103
    {
104
        return !empty($this->parent);
105
    }
106
}
107