This check compares the return type specified in the @return annotation of a function
or method doc comment with the types returned by the function and raises an issue if they
mismatch.
Loading history...
28
*/
29
public static function get()
30
{
31
return Reservation::get()->byID(
32
Session::get(self::KEY)
33
);
34
}
35
36
/**
37
* Set the session variable
38
*
39
* @param Reservation $reservation
40
*/
41
public static function set(Reservation $reservation)
42
{
43
Session::set(self::KEY, $reservation->ID);
44
}
45
46
/**
47
* Start the ticket session
48
*
49
* @param CalendarEvent $event
50
*
51
* @return Reservation
52
*/
53
public static function start(CalendarEvent $event)
54
{
55
$reservation = Reservation::create();
56
$reservation->EventID = $event->ID;
57
$reservation->write();
58
self::set($reservation);
59
return $reservation;
60
}
61
62
/**
63
* End the Ticket session
64
*/
65
public static function end()
66
{
67
// If the session is ended while in cart or pending state, remove the reservation.
68
// The session is only ended in these states when iffy business is going on.
69
if (in_array(self::get()->Status, array('CART', 'PENDING'))) {
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.