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.

Service   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 58
ccs 16
cts 16
cp 1
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setName() 0 8 2
A getName() 0 4 1
A getMaxFailures() 0 4 1
A getRetryTimeout() 0 4 1
1
<?php
2
3
namespace Cmp\CircuitBreaker;
4
5
/**
6
 * Class Service
7
 *
8
 * @package Cmp\CircuitBreaker
9
 */
10
class Service
11
{
12
    protected $name;
13
14
    protected $maxFailures;
15
16
    protected $retryTimeout;
17
18
    /**
19
     * Service constructor.
20
     *
21
     * @param string $name         Name of the service
22
     * @param int    $maxFailures  Maximum numbers of allowed failures
23
     * @param int    $retryTimeout Timeout to retry the service
24
     */
25 1
    public function __construct($name, $maxFailures = 20, $retryTimeout = 60)
26
    {
27 1
        $this->setName($name);
28 1
        $this->maxFailures  = $maxFailures;
29 1
        $this->retryTimeout = $retryTimeout;
30 1
    }
31
32
    /**
33
     * @param string $name Name of the service
34
     */
35 1
    protected function setName($name)
36
    {
37 1
        if ($name == '') {
38 1
            throw new \InvalidArgumentException('Service name can\'t be empty');
39
        }
40
41 1
        $this->name = $name;
42 1
    }
43
44
    /**
45
     * @return string
46
     */
47 1
    public function getName()
48
    {
49 1
        return $this->name;
50
    }
51
52
    /**
53
     * @return int
54
     */
55 1
    public function getMaxFailures()
56
    {
57 1
        return $this->maxFailures;
58
    }
59
60
    /**
61
     * @return int
62
     */
63 1
    public function getRetryTimeout()
64
    {
65 1
        return $this->retryTimeout;
66
    }
67
}
68