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.

ClassConstantExpression   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 11
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 69
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getName() 0 4 1
A traverse() 0 4 1
A update() 0 10 3
A updateClassValue() 0 4 1
A compileMember() 0 4 1
A dataToSerialize() 0 4 1
A unserializeData() 0 4 1
A __clone() 0 4 1
1
<?php
2
3
namespace Pinq\Expressions;
4
5
/**
6
 * <code>
7
 * Class:constant
8
 * </code>
9
 *
10
 * @author Elliot Levin <[email protected]>
11
 */
12
class ClassConstantExpression extends StaticClassExpression
13
{
14
    /**
15
     * @var string
16
     */
17
    private $name;
18
19
    public function __construct(Expression $class, $name)
20
    {
21
        parent::__construct($class);
22
23
        $this->name = $name;
24
    }
25
26
    /**
27
     * @return string
28
     */
29
    public function getName()
30
    {
31
        return $this->name;
32
    }
33
34
    public function traverse(ExpressionWalker $walker)
35
    {
36
        return $walker->walkClassConstant($this);
37
    }
38
39
    /**
40
     * @param Expression $class
41
     * @param string     $name
42
     *
43
     * @return self
44
     */
45
    public function update(Expression $class, $name)
46
    {
47
        if ($this->class === $class
48
                && $this->name === $name
49
        ) {
50
            return $this;
51
        }
52
53
        return new self($class, $name);
54
    }
55
56
    protected function updateClassValue(Expression $class)
57
    {
58
        return new self($class, $this->name);
59
    }
60
61
    protected function compileMember(&$code)
62
    {
63
        $code .= $this->name;
64
    }
65
66
    protected function dataToSerialize()
67
    {
68
        return $this->name;
69
    }
70
71
    protected function unserializeData($data)
72
    {
73
        $this->name = $data;
74
    }
75
76
    public function __clone()
77
    {
78
        $this->class = clone $this->class;
79
    }
80
}
81