Completed
Push — include-lib ( fd24a6...4173d3 )
by Arnaud
13:24
created

AbstractStep   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 47
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A init() 0 4 1
A runProcess() 0 6 2
process() 0 1 ?
1
<?php
2
/*
3
 * Copyright (c) Arnaud Ligny <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Cecil\Step;
10
11
use Cecil\Builder;
12
use Cecil\Config;
13
14
abstract class AbstractStep implements StepInterface
15
{
16
    /**
17
     * @var Builder
18
     */
19
    protected $builder;
20
    /**
21
     * @var Config
22
     */
23
    protected $config;
24
    /**
25
     * @var bool
26
     */
27
    protected $process = false;
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function __construct(Builder $builder)
33
    {
34
        $this->builder = $builder;
35
        $this->config = $builder->getConfig();
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function init($options)
42
    {
43
        $this->process = true;
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public function runProcess()
50
    {
51
        if ($this->process) {
52
            $this->process();
53
        }
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    abstract public function process();
60
}
61