Skip to content

Commit e8ac93f

Browse files
committed
fix: a bunch of copy-paste mistakes
1 parent 41b7230 commit e8ac93f

File tree

6 files changed

+10
-13
lines changed

6 files changed

+10
-13
lines changed

lbplanner/classes/model/reservation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class reservation {
6767
/**
6868
* @var ?DateTimeImmutable $datetime the date this reservation ends at, with time filled in
6969
*/
70-
private ?DateTimeImmutable $datetime;
70+
private ?DateTimeImmutable $datetime_end;
7171

7272
/**
7373
* Constructs a reservation
@@ -124,7 +124,7 @@ public function prepare_for_db(): object {
124124
public function get_datetime(): DateTimeImmutable {
125125
if (is_null($this->datetime)) {
126126
$slot = $this->get_slot();
127-
$this->datetime = slot_helper::amend_date_with_unit_time($this->date, $slot->startunit);
127+
$this->datetime = slot_helper::amend_date_with_unit_time($slot->startunit, $this->date);
128128
}
129129

130130
return $this->datetime;
@@ -138,7 +138,7 @@ public function get_datetime(): DateTimeImmutable {
138138
public function get_datetime_end(): DateTimeImmutable {
139139
if (is_null($this->datetime)) {
140140
$slot = $this->get_slot();
141-
$this->datetime_end = slot_helper::amend_date_with_unit_time($this->date, $slot->startunit + $slot->duration)
141+
$this->datetime_end = slot_helper::amend_date_with_unit_time($slot->startunit + $slot->duration, $this->date);
142142
}
143143

144144
return $this->datetime_end;

lbplanner/services/slots/book_reservation.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@
2828
use local_lbplanner\model\reservation;
2929

3030
/**
31-
* Returns all slots the user can theoretically reserve.
32-
* This does not include times the user has already reserved a slot for.
31+
* Books a reservation for the user
3332
*
3433
* @package local_lbplanner
35-
* @subpackage services_plan
34+
* @subpackage services_slots
3635
* @copyright 2024 necodeIT
3736
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3837
*/

lbplanner/services/slots/get_my_slots.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* This does not include times the user has already reserved a slot for.
2828
*
2929
* @package local_lbplanner
30-
* @subpackage services_plan
30+
* @subpackage services_slots
3131
* @copyright 2024 necodeIT
3232
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3333
*/

lbplanner/services/slots/get_student_slots.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* This does not include times the user has already reserved a slot for.
2929
*
3030
* @package local_lbplanner
31-
* @subpackage services_plan
31+
* @subpackage services_slots
3232
* @copyright 2024 necodeIT
3333
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3434
*/

lbplanner/services/slots/get_supervisor_slots.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* Returns all slots a supervisor can see.
2727
*
2828
* @package local_lbplanner
29-
* @subpackage services_plan
29+
* @subpackage services_slots
3030
* @copyright 2024 necodeIT
3131
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3232
*/

lbplanner/services/slots/unbook_reservation.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424

2525
use local_lbplanner\helpers\slot_helper;
2626
use local_lbplanner\helpers\notifications_helper;
27-
use local_lbplanner\model\reservation;
2827
use local_lbplanner\enums\NOTIF_TRIGGER;
2928

3029
/**
31-
* Returns all slots the user can theoretically reserve.
32-
* This does not include times the user has already reserved a slot for.
30+
* Unbooks reservation
3331
*
3432
* @package local_lbplanner
35-
* @subpackage services_plan
33+
* @subpackage services_slots
3634
* @copyright 2024 necodeIT
3735
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3836
*/

0 commit comments

Comments
 (0)