Passed
Push — master ( 117e72...a20c82 )
by Vinicius Lourenço
03:37
created
src/Scheduler/Scheduler.php 1 patch
Braces   +18 added lines, -12 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function hasScheduleBetween($model_type, $start_at, $end_at)
45 45
     {
46
-        if(!Config::get('scheduler.enable_schedule_conflict'))
47
-            return false;
46
+        if(!Config::get('scheduler.enable_schedule_conflict')) {
47
+                    return false;
48
+        }
48 49
 
49 50
         return !is_null(
50 51
             Schedule::latest()
@@ -96,29 +97,34 @@  discard block
 block discarded – undo
96 97
             $closing = Carbon::parse($openingTime->toDateTimeString())->addMinutes($durationMinutes);
97 98
 
98 99
             foreach (Schedule::orderBy('start_at', 'DESC')->cursor() as $schedule) {
99
-            	if($schedule->model_type != $model_type)
100
-            		continue;
100
+            	if($schedule->model_type != $model_type) {
101
+            	            		continue;
102
+            	}
101 103
 
102 104
                 $start = Carbon::parse($schedule->start_at);
103 105
                 $begin = Carbon::parse($start->toDateString());
104 106
 
105
-                if($begin->greaterThan($today))
106
-                    break;
107
+                if($begin->greaterThan($today)) {
108
+                                    break;
109
+                }
107 110
 
108
-                if($begin->notEqualTo($today))
109
-                    continue;
111
+                if($begin->notEqualTo($today)) {
112
+                                    continue;
113
+                }
110 114
 
111 115
                 $end = Carbon::parse($schedule->end_at);
112 116
 
113
-                if($this->isShouldntAdd($opening, $closing, $start, $end))
114
-                    $add = false;
117
+                if($this->isShouldntAdd($opening, $closing, $start, $end)) {
118
+                                    $add = false;
119
+                }
115 120
             }
116 121
 
117
-            if($add && $closing->lessThanOrEqualTo($closingTime))
118
-                $livres[] = [
122
+            if($add && $closing->lessThanOrEqualTo($closingTime)) {
123
+                            $livres[] = [
119 124
                     'start_at' => $opening,
120 125
                     'end_at' => $closing
121 126
                 ];
127
+            }
122 128
 
123 129
             $openingTime->addMinutes($durationMinutes);
124 130
         }
Please login to merge, or discard this patch.