Completed
Push — master ( 70ed4c...f56a68 )
by Ievgen
05:07 queued 03:10
created

AbstractStep   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isSkipped() 0 4 1
A skip() 0 4 1
__invoke() 0 1 ?
1
<?php
2
3
namespace einfach\operation\step;
4
5
abstract class AbstractStep
6
{
7
    /**
8
     * @var callable
9
     */
10
    public $function;
11
    public $signature;
12
    public $track;
13
    /**
14
     * Indicates was this step performed or not
15
     *
16
     * @var bool
17
     */
18
    protected $skipped;
19
20
    public function __construct(callable $callable, string $signature)
21
    {
22
        $this->function = $callable;
23
        $this->signature = $signature;
24
        $this->skipped = false;
25
    }
26
27
    public function isSkipped()
28
    {
29
        return true == $this->skipped;
0 ignored issues
show
Coding Style Best Practice introduced by
It seems like you are loosely comparing two booleans. Considering using the strict comparison === instead.

When comparing two booleans, it is generally considered safer to use the strict comparison operator.

Loading history...
30
    }
31
32
    public function skip()
33
    {
34
        return $this->skipped = true;
35
    }
36
37
    abstract public function __invoke(&$params, string $track);
38
}
39