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.

AbstractActionInspector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 23
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isStateAllowed() 0 9 2
1
<?php
2
3
namespace Scheduler\ActionInspector;
4
5
use Scheduler\Action\ActionInterface;
6
7
/**
8
 * Class AbstractActionInspector
9
 *
10
 * @package Scheduler\ActionInspector
11
 * @author Aleh Hutnikau, <[email protected]>
12
 */
13
abstract class AbstractActionInspector implements ActionInspectorInterface
14
{
15
    protected $statesFlow = [
16
        ActionInterface::STATE_INITIAL => [ActionInterface::STATE_IN_PROGRESS, ActionInterface::STATE_FINISHED],
17
        ActionInterface::STATE_IN_PROGRESS => [ActionInterface::STATE_FINISHED],
18
        ActionInterface::STATE_FINISHED => [],
19
    ];
20
21
    /**
22
     * @param ActionInterface $action
23
     * @param $prevState
24
     * @return boolean
25
     */
26 3
    protected function isStateAllowed(ActionInterface $action, $prevState)
27
    {
28 3
        if ($prevState === null) {
29 3
            $result = true;
30 3
        } else {
31 3
            $result = in_array($action->getState(), $this->statesFlow[$prevState]);
32
        }
33 3
        return $result;
34
    }
35
}