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::getNextStep()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 4
cp 0.75
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 2
nop 0
crap 2.0625
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
}