@@ -77,33 +77,33 @@ |
||
77 | 77 | $openingTime = Carbon::parse(Config::get('scheduler.opening_time'))->setDateFrom($today); |
78 | 78 | $closingTime = Carbon::parse(Config::get('scheduler.closing_time'))->setDateFrom($today); |
79 | 79 | |
80 | - $livres = []; |
|
80 | + $livres = [ ]; |
|
81 | 81 | $today = Carbon::parse($today->toDateString()); |
82 | - while($openingTime <= $closingTime) |
|
82 | + while ($openingTime <= $closingTime) |
|
83 | 83 | { |
84 | 84 | $add = true; |
85 | 85 | |
86 | 86 | foreach (Schedule::orderBy('start_at', 'DESC')->cursor() as $schedule) { |
87 | - if($schedule->model_type != $model_type) |
|
87 | + if ($schedule->model_type != $model_type) |
|
88 | 88 | continue; |
89 | 89 | |
90 | 90 | $start = Carbon::parse($schedule->start_at); |
91 | 91 | $begin = Carbon::parse($start->toDateString()); |
92 | 92 | |
93 | - if($begin->greaterThan($today)) |
|
93 | + if ($begin->greaterThan($today)) |
|
94 | 94 | break; |
95 | 95 | |
96 | - if($begin->notEqualTo($today)) |
|
96 | + if ($begin->notEqualTo($today)) |
|
97 | 97 | continue; |
98 | 98 | |
99 | 99 | $end = Carbon::parse($schedule->end_at); |
100 | - if($start <= Carbon::parse($openingTime->toDateTimeString()) |
|
100 | + if ($start <= Carbon::parse($openingTime->toDateTimeString()) |
|
101 | 101 | && $end >= Carbon::parse($openingTime->toDateTimeString())->addMinutes($durationMinutes)) |
102 | 102 | $add = false; |
103 | 103 | } |
104 | 104 | |
105 | - if($add) |
|
106 | - $livres[] = [ |
|
105 | + if ($add) |
|
106 | + $livres[ ] = [ |
|
107 | 107 | 'start_at' => Carbon::parse($openingTime->toDateTimeString()), |
108 | 108 | 'end_at' => Carbon::parse($openingTime->toDateTimeString())->addMinutes($durationMinutes) |
109 | 109 | ]; |
@@ -52,15 +52,15 @@ |
||
52 | 52 | */ |
53 | 53 | public function parseStatusKey($key) |
54 | 54 | { |
55 | - if(is_int($key)) |
|
56 | - return ['status' => $key]; |
|
55 | + if (is_int($key)) |
|
56 | + return [ 'status' => $key ]; |
|
57 | 57 | |
58 | 58 | $status = ScheduleStatus::where('name', $key)->first(); |
59 | 59 | |
60 | - if(is_null($status)) |
|
60 | + if (is_null($status)) |
|
61 | 61 | throw (new ModelNotFound)->setValues(ScheduleStatus::class); |
62 | 62 | |
63 | - return ['status' => $status->id]; |
|
63 | + return [ 'status' => $status->id ]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |