AbstractService   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 8
c 1
b 0
f 0
dl 0
loc 24
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getMaxFailures() 0 3 1
A getIdentifier() 0 3 1
A getRetryTimeout() 0 3 1
A __construct() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace HolidayPirates\CircuitBreaker\Service;
4
5
abstract class AbstractService implements ServiceInterface
6
{
7
    private $maxFailures;
8
    private $retryTimeout;
9
10
    public function __construct(int $maxFailures, int $retryTimeout)
11
    {
12
        $this->maxFailures = $maxFailures;
13
        $this->retryTimeout = $retryTimeout;
14
    }
15
16
    public function getIdentifier(): string
17
    {
18
        return static::class;
19
    }
20
21
    public function getMaxFailures(): int
22
    {
23
        return $this->maxFailures;
24
    }
25
26
    public function getRetryTimeout(): int
27
    {
28
        return $this->retryTimeout;
29
    }
30
}
31