AbstractDelayedRetryStrategy   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 34
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDelay() 0 4 1
A setDelay() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Http Adapter package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\HttpAdapter\Event\Retry\Strategy;
13
14
/**
15
 * @author GeLo <[email protected]>
16
 */
17
abstract class AbstractDelayedRetryStrategy extends AbstractRetryStrategyChain
18
{
19
    /**
20
     * @var float
21
     */
22
    private $delay;
23
24
    /**
25
     * @param float                            $delay
26
     * @param RetryStrategyChainInterface|null $next
27
     */
28 108
    public function __construct($delay = 5.0, RetryStrategyChainInterface $next = null)
29
    {
30 108
        parent::__construct($next);
31
32 108
        $this->setDelay($delay);
33 108
    }
34
35
    /**
36
     * @return float
37
     */
38 90
    public function getDelay()
39
    {
40 90
        return $this->delay;
41
    }
42
43
    /**
44
     * @param float $delay
45
     */
46 108
    public function setDelay($delay)
47
    {
48 108
        $this->delay = $delay;
49 108
    }
50
}
51