ReservationController::ReservationForm()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Importance

Changes 0
Metric Value
dl 6
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * ReservationController.php
4
 *
5
 * @author Bram de Leeuw
6
 * Date: 14/03/17
7
 */
8
9
namespace Broarm\EventTickets;
10
11
/**
12
 * Class ReservationController
13
 *
14
 * @package Broarm\EventTickets
15
 */
16 View Code Duplication
class ReservationController extends CheckoutStepController
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    private static $allowed_actions = array(
19
        'ReservationForm'
20
    );
21
22
    protected $step = 'register';
23
24
    /**
25
     * Get the reservation form
26
     *
27
     * @return ReservationForm
28
     */
29
    public function ReservationForm()
30
    {
31
        $reservationForm = new ReservationForm($this, 'ReservationForm', ReservationSession::get());
0 ignored issues
show
Bug introduced by
It seems like \Broarm\EventTickets\ReservationSession::get() targeting Broarm\EventTickets\ReservationSession::get() can also be of type object<DataObject>; however, Broarm\EventTickets\ReservationForm::__construct() does only seem to accept null|object<Broarm\EventTickets\Reservation>, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
32
        $reservationForm->setNextStep(CheckoutSteps::nextStep($this->step));
33
        return $reservationForm;
34
    }
35
}
36