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.
Completed
Push — master ( 0e5400...185e23 )
by Iakov
03:50
created

AbstractStrategy   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 26
ccs 10
cts 12
cp 0.8333
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addStep() 0 5 1
A __construct() 0 5 2
A getNextStep() 0 7 2
1
<?php
2
3
4
namespace Kami\Component\RequestProcessor;
5
6
7
use Kami\Component\RequestProcessor\Step\StepInterface;
8
9
abstract class AbstractStrategy implements StrategyInterface
10
{
11
    protected $steps;
12
13 2
    public function __construct()
14
    {
15 2
        $this->steps = new \SplQueue();
16 2
        foreach ($this->getSteps() as $step) {
17
            $this->addStep($step);
18
        }
19 2
    }
20
21 2
    public function getNextStep(): ?StepInterface
22
    {
23 2
        if ($this->steps->count() == 0) {
24
            return null;
25
        }
26
27 2
        return $this->steps->dequeue();
28
    }
29
30 2
    public function addStep(StepInterface $step): StrategyInterface
31
    {
32 2
        $this->steps->enqueue($step);
33
34 2
        return $this;
35
    }
36
}