LoginError   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 46
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A getDescription() 0 4 1
A __toString() 0 4 1
1
<?php
2
3
namespace Happyr\LinkedIn\Exception;
4
5
/**
6
 * Class LoginError.
7
 *
8
 * @author Tobias Nyholm
9
 */
10
class LoginError
11
{
12
    /**
13
     * @var string name
14
     */
15
    protected $name;
16
17
    /**
18
     * @var string description
19
     */
20
    protected $description;
21
22
    /**
23
     * @param string $name
24
     * @param string $description
25
     */
26 3
    public function __construct($name, $description)
27
    {
28 3
        $this->name = $name;
29 3
        $this->description = $description;
30 3
    }
31
32
    /**
33
     * @return string
34
     */
35 3
    public function getName()
36
    {
37 3
        return $this->name;
38
    }
39
40
    /**
41
     * @return string
42
     */
43 3
    public function getDescription()
44
    {
45 3
        return $this->description;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function __toString()
52
    {
53
        return sprintf('Name: %s, Description: %s', $this->getName(), $this->getDescription());
54
    }
55
}
56