FormStep   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNextStep() 0 4 1
A setNextStep() 0 4 1
A nextStep() 0 4 1
A getReservation() 0 4 1
1
<?php
2
/**
3
 * FormStep.php
4
 *
5
 * @author Bram de Leeuw
6
 * Date: 16/03/17
7
 */
8
9
namespace Broarm\EventTickets;
10
11
use Form;
12
use SS_HTTPResponse;
13
14
/**
15
 * Class FormStep
16
 *
17
 * @package Broarm\EventTickets
18
 */
19
abstract class FormStep extends Form
20
{
21
    /**
22
     * @var Reservation
23
     */
24
    protected $reservation;
25
26
    /**
27
     * @var string the next action to go to
28
     */
29
    protected $nextStep;
30
31
    /**
32
     * Get the next step
33
     *
34
     * @return string
35
     */
36
    public function getNextStep()
37
    {
38
        return $this->nextStep;
39
    }
40
41
    /**
42
     * Set the next step
43
     * should this be configurable .. ?
44
     *
45
     * @param $step
46
     */
47
    public function setNextStep($step)
48
    {
49
        $this->nextStep = $step;
50
    }
51
52
    /**
53
     * Continue to the next step
54
     *
55
     * @return SS_HTTPResponse
56
     */
57
    public function nextStep()
58
    {
59
        return $this->getController()->redirect($this->getController()->Link($this->nextStep));
60
    }
61
62
    /**
63
     * Accessor to the reservation
64
     *
65
     * @return Reservation
66
     */
67
    public function getReservation()
68
    {
69
        return $this->reservation;
70
    }
71
}
72