Completed
Push — middleware-wip ( 846df6...f76eb7 )
by Romain
05:21
created

Substeps   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 52
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFirstSubstepDefinition() 0 4 1
A getEntries() 0 4 1
A getEntry() 0 8 2
A hasEntry() 0 4 1
1
<?php
2
/*
3
 * 2017 Romain CANON <[email protected]>
4
 *
5
 * This file is part of the TYPO3 FormZ project.
6
 * It is free software; you can redistribute it and/or modify it
7
 * under the terms of the GNU General Public License, either
8
 * version 3 of the License, or any later version.
9
 *
10
 * For the full copyright and license information, see:
11
 * http://www.gnu.org/licenses/gpl-3.0.html
12
 */
13
14
namespace Romm\Formz\Form\Definition\Step\Step\Substep;
15
16
use Romm\Formz\Exceptions\EntryNotFoundException;
17
use Romm\Formz\Form\Definition\AbstractFormDefinition;
18
19
class Substeps extends AbstractFormDefinition
20
{
21
    /**
22
     * @var \Romm\Formz\Form\Definition\Step\Step\Substep\Substep[]
23
     */
24
    protected $entries;
25
26
    /**
27
     * @var \Romm\Formz\Form\Definition\Step\Step\Substep\SubstepDefinition
28
     * @validate NotEmpty
29
     */
30
    protected $firstSubstep;
31
32
    /**
33
     * @return SubstepDefinition
34
     */
35
    public function getFirstSubstepDefinition()
36
    {
37
        return $this->firstSubstep;
38
    }
39
40
    /**
41
     * @return Substep[]
42
     */
43
    public function getEntries()
44
    {
45
        return $this->entries;
46
    }
47
48
    /**
49
     * @param string $name
50
     * @return Substep
51
     * @throws EntryNotFoundException
52
     */
53
    public function getEntry($name)
54
    {
55
        if (false === $this->hasEntry($name)) {
56
            throw new \Exception('todo'); // @todo
57
        }
58
59
        return $this->entries[$name];
60
    }
61
62
    /**
63
     * @param string $name
64
     * @return bool
65
     */
66
    public function hasEntry($name)
67
    {
68
        return isset($this->entries[$name]);
69
    }
70
}
71