Step   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
lcom 0
cbo 0
dl 0
loc 97
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 1
A createFromData() 0 12 1
A getNumber() 0 4 1
A getName() 0 4 1
A getAction() 0 4 1
A getLabel() 0 4 1
A getOnchangeClear() 0 4 1
A getDependencies() 0 4 1
A getManagerName() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the PierstovalCharacterManagerBundle package.
7
 *
8
 * (c) Alexandre Rock Ancelet <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Pierstoval\Bundle\CharacterManagerBundle\Model;
15
16
class Step implements StepInterface
17
{
18
    protected $number;
19
    protected $name;
20
    protected $action;
21
    protected $label;
22
    protected $onchangeClear;
23
    protected $dependencies;
24
    protected $managerName;
25
26
    public function __construct(
27
        int $number,
28
        string $name,
29
        string $label,
30
        string $action,
31
        string $managerName,
32
        array $onchangeClear,
33
        array $dependencies
34
    ) {
35
        $this->number = $number;
36
        $this->name = $name;
37
        $this->action = $action;
38
        $this->label = $label;
39
        $this->managerName = $managerName;
40
        $this->onchangeClear = $onchangeClear;
41
        $this->dependencies = $dependencies;
42
    }
43
44
    public static function createFromData(array $data): self
45
    {
46
        return new static(
47
            $data['number'],
48
            $data['name'],
49
            $data['label'],
50
            $data['action'],
51
            $data['manager_name'],
52
            $data['onchange_clear'],
53
            $data['dependencies']
54
        );
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function getNumber(): int
61
    {
62
        return $this->number;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getName(): string
69
    {
70
        return $this->name;
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function getAction(): string
77
    {
78
        return $this->action;
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function getLabel(): string
85
    {
86
        return $this->label;
87
    }
88
89
    /**
90
     * {@inheritdoc}
91
     */
92
    public function getOnchangeClear(): array
93
    {
94
        return $this->onchangeClear;
95
    }
96
97
    /**
98
     * {@inheritdoc}
99
     */
100
    public function getDependencies(): array
101
    {
102
        return $this->dependencies;
103
    }
104
105
    /**
106
     * {@inheritdoc}
107
     */
108
    public function getManagerName(): string
109
    {
110
        return $this->managerName;
111
    }
112
}
113