Completed
Pull Request — master (#28)
by claudio
05:35
created
app/Group.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@
 block discarded – undo
51 51
 
52 52
     public function getPlannerNameAttribute()
53 53
     {
54
-        if(is_object($this->planner) && $this->planner->exists)
55
-            return $this->planner->name;
54
+        if(is_object($this->planner) && $this->planner->exists) {
55
+                    return $this->planner->name;
56
+        }
56 57
     }
57 58
 
58 59
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/Companies/Groups/EmployeesController.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,9 @@
 block discarded – undo
71 71
         $employee = Employee::findOrFail($employeeId);
72 72
         $this->authorize($employee);
73 73
         $group = Group::findOrFail($groupId);
74
-        if(!$employee->belongsToGroup($group))
75
-            return Response::json(['error' => 'employId <> groupId'],404);
74
+        if(!$employee->belongsToGroup($group)) {
75
+                    return Response::json(['error' => 'employId <> groupId'],404);
76
+        }
76 77
         $employee->groups()->detach($groupId);
77 78
         return $group->employees;
78 79
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Companies/Employees/EmployeesController.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
         //
54 54
         $company = \Auth::user();
55 55
         $input = $request->all();
56
-        if(isset($input['password']))
57
-            $input['password'] = bcrypt($input['password']);
56
+        if(isset($input['password'])) {
57
+                    $input['password'] = bcrypt($input['password']);
58
+        }
58 59
         $employee = $company->employees()->create($input);
59 60
         return $employee;
60 61
     }
@@ -86,8 +87,9 @@  discard block
 block discarded – undo
86 87
         $employee = Employee::findOrFail($id);
87 88
         $this->authorize($employee);
88 89
         $input = $request->all();
89
-        if(isset($input['password']))
90
-            $input['password'] = bcrypt($input['password']);
90
+        if(isset($input['password'])) {
91
+                    $input['password'] = bcrypt($input['password']);
92
+        }
91 93
         $employee->update($input);
92 94
         return $employee;
93 95
     }
Please login to merge, or discard this patch.
app/Employee.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -109,14 +109,16 @@  discard block
 block discarded – undo
109 109
     public function getEmailForPasswordReset()
110 110
     {
111 111
         list(, $caller) = debug_backtrace(false);
112
-        if(isset($caller['class']))
113
-            $caller = explode('\\', $caller['class']);
114
-        else
115
-            $caller = '';
112
+        if(isset($caller['class'])) {
113
+                    $caller = explode('\\', $caller['class']);
114
+        } else {
115
+                    $caller = '';
116
+        }
116 117
 
117 118
         //check if this function is called by email sender
118
-        if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == ''))
119
-            return $this->email;
119
+        if ((count($caller) && $caller[count($caller) - 1] == 'PasswordBroker') || (defined('HHVM_VERSION') && $caller == '')) {
120
+                    return $this->email;
121
+        }
120 122
         //return unique identify for token repository
121 123
         return $this->email . $this->company->id;
122 124
     }
@@ -128,8 +130,9 @@  discard block
 block discarded – undo
128 130
     public function belongsToGroup(Group $group)
129 131
     {
130 132
         $group = $this->groups()->where('id', $group->id)->first();
131
-        if(is_object($group) && $group->exists)
132
-            return true;
133
+        if(is_object($group) && $group->exists) {
134
+                    return true;
135
+        }
133 136
         return false;
134 137
     }
135 138
 
Please login to merge, or discard this patch.
app/Console/Commands/SyncCaldav/SyncCaldav.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,10 +53,11 @@  discard block
 block discarded – undo
53 53
     {
54 54
         //
55 55
         $calendarId = $this->argument('calendarId');
56
-        if(is_numeric($calendarId))
57
-            $this->makeForeground(Caldav::findOrFail($calendarId));
58
-        else
59
-            $this->syncAll();
56
+        if(is_numeric($calendarId)) {
57
+                    $this->makeForeground(Caldav::findOrFail($calendarId));
58
+        } else {
59
+                    $this->syncAll();
60
+        }
60 61
     }
61 62
 
62 63
     private function syncAll()
@@ -65,13 +66,15 @@  discard block
 block discarded – undo
65 66
         if($this->option('background')) {
66 67
             \Log::debug(self::BACKGROUND_MOD_MEX);
67 68
             $this->info(self::BACKGROUND_MOD_MEX);
68
-            foreach ($calendars as $calendar)
69
-                $this->makeBackground($calendar);
69
+            foreach ($calendars as $calendar) {
70
+                            $this->makeBackground($calendar);
71
+            }
70 72
             \Log::debug(self::BACKGROUND_COMPLETED_MEX);
71 73
             $this->info(self::BACKGROUND_COMPLETED_MEX);
72
-        }else
73
-            foreach($calendars as $calendar)
74
+        } else {
75
+                    foreach($calendars as $calendar)
74 76
                 $this->makeForeground($calendar);
77
+        }
75 78
     }
76 79
 
77 80
     /**
@@ -81,8 +84,9 @@  discard block
 block discarded – undo
81 84
     private function makeBackground(Caldav $calendar)
82 85
     {
83 86
         $event = $this->schedule->command('sync:caldav '.$calendar->calendar_id)->withoutOverlapping();
84
-        if($event->isDue($this->laravel))
85
-             $event->run($this->laravel);
87
+        if($event->isDue($this->laravel)) {
88
+                     $event->run($this->laravel);
89
+        }
86 90
     }
87 91
 
88 92
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Calendars/CalendarsController.php 1 patch
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,8 +66,9 @@  discard block
 block discarded – undo
66 66
         $employee = \Auth::user();
67 67
         $input = $request->all();
68 68
         $calendar = $employee->calendars()->create($input);
69
-        if(isset($input['password']))
70
-            $input['password'] = \Crypt::encrypt($input['password']);
69
+        if(isset($input['password'])) {
70
+                    $input['password'] = \Crypt::encrypt($input['password']);
71
+        }
71 72
         $calendar->caldav()->create($input);
72 73
         //TODO test
73 74
         //TODO validator
@@ -107,15 +108,17 @@  discard block
 block discarded – undo
107 108
         if($caldav){
108 109
             $this->validateCaldav($request);
109 110
         }
110
-        if(isset($input['password']))
111
-            $input['password'] = \Crypt::encrypt($input['password']);
111
+        if(isset($input['password'])) {
112
+                    $input['password'] = \Crypt::encrypt($input['password']);
113
+        }
112 114
         $calendar->update($input);
113 115
         //TODO test
114 116
         //TODO validator
115 117
         //TODO check if caldav exists?
116 118
 
117
-        if($caldav)
118
-            $caldav->update($input);
119
+        if($caldav) {
120
+                    $caldav->update($input);
121
+        }
119 122
         return $calendar;
120 123
     }
121 124
 
@@ -148,7 +151,7 @@  discard block
 block discarded – undo
148 151
             $caldavClient->connect($request->input('url'), $request->input('username'), $request->input('password'));
149 152
             $calendars = $caldavClient->findCalendars();
150 153
             return array_keys($calendars);
151
-        }catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
154
+        } catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
152 155
         {
153 156
             return Response::json(['error' => $e->getMessage()],422);
154 157
         }
Please login to merge, or discard this patch.
app/Console/Commands/SyncCaldav/Sync.php 1 patch
Braces   +21 added lines, -17 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
         try
92 92
         {
93 93
             $events = $this->getEvents();
94
-        }catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
94
+        } catch (\it\thecsea\caldav_client_adapter\CaldavException $e)
95 95
         {
96 96
             \Event::fire(new ErrorEvent($this->calendar, $e->getMessage()));
97 97
             return ;
98
-        }catch(\Illuminate\Contracts\Encryption\DecryptException $e){
98
+        } catch(\Illuminate\Contracts\Encryption\DecryptException $e){
99 99
             \Event::fire(new ErrorEvent($this->calendar, $e->getMessage()));
100 100
             return ;
101 101
         }
@@ -110,10 +110,11 @@  discard block
 block discarded – undo
110 110
 
111 111
         //insert new timeslots
112 112
         foreach($events as $event){
113
-            if(!($event = $this->parseEvent($event)))
114
-                \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event'));
115
-            else
116
-                $calendarMain->timeslots()->create($event);
113
+            if(!($event = $this->parseEvent($event))) {
114
+                            \Event::fire(new ErrorEvent($this->calendar, 'problem during the parsing an event'));
115
+            } else {
116
+                            $calendarMain->timeslots()->create($event);
117
+            }
117 118
         }
118 119
         \Event::fire(new OkEvent($this->calendar));
119 120
     }
@@ -126,17 +127,20 @@  discard block
 block discarded – undo
126 127
     {
127 128
         $pattern = "/^((DTSTART;)|(DTEND;))(.*)\$/m";
128 129
         if(preg_match_all($pattern, $event->getData(), $matches)){
129
-            if(!isset($matches[4]) || count($matches[4]) != 2)
130
-                return null;
130
+            if(!isset($matches[4]) || count($matches[4]) != 2) {
131
+                            return null;
132
+            }
131 133
             $ret = [];
132
-            if($tmp = $this->parseDate($matches[4][0]))
133
-                $ret['time_start'] = $tmp;
134
-            else
135
-                return null;
136
-            if($tmp = $this->parseDate($matches[4][1]))
137
-                $ret['time_end'] = $tmp;
138
-            else
139
-                return null;
134
+            if($tmp = $this->parseDate($matches[4][0])) {
135
+                            $ret['time_start'] = $tmp;
136
+            } else {
137
+                            return null;
138
+            }
139
+            if($tmp = $this->parseDate($matches[4][1])) {
140
+                            $ret['time_end'] = $tmp;
141
+            } else {
142
+                            return null;
143
+            }
140 144
             return $ret;
141 145
         }
142 146
         return null;
@@ -153,7 +157,7 @@  discard block
 block discarded – undo
153 157
             if($matches[1][0] == 'TZID=')
154 158
             {
155 159
                 return \DateTime::createFromFormat('Ymd\THis', $matches[5][0], new \DateTimeZone($matches[4][0]));
156
-            }else if($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE')
160
+            } else if($matches[1][0] == 'VALUE=' && $matches[4][0] == 'DATE')
157 161
             {
158 162
                 return \DateTime::createFromFormat('Ymd\THis', $matches[5][0].'T000000');
159 163
             }
Please login to merge, or discard this patch.
app/Console/Commands/Optimise/OptimiseCommand.php 1 patch
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,10 +62,11 @@  discard block
 block discarded – undo
62 62
 
63 63
         //TODO try...catch with destruct
64 64
         $companyId = $this->argument('companyId');
65
-        if(is_numeric($companyId))
66
-            $this->makeForeground(Company::findOrFail($companyId));
67
-        else
68
-            $this->syncAll();
65
+        if(is_numeric($companyId)) {
66
+                    $this->makeForeground(Company::findOrFail($companyId));
67
+        } else {
68
+                    $this->syncAll();
69
+        }
69 70
     }
70 71
 
71 72
     private function syncAll()
@@ -74,13 +75,15 @@  discard block
 block discarded – undo
74 75
         if($this->option('background')) {
75 76
             \Log::debug(self::BACKGROUND_MOD_MEX);
76 77
             $this->info(self::BACKGROUND_MOD_MEX);
77
-            foreach ($calendars as $calendar)
78
-                $this->makeBackground($calendar);
78
+            foreach ($calendars as $calendar) {
79
+                            $this->makeBackground($calendar);
80
+            }
79 81
             \Log::debug(self::BACKGROUND_COMPLETED_MEX);
80 82
             $this->info(self::BACKGROUND_COMPLETED_MEX);
81
-        }else
82
-            foreach($calendars as $calendar)
83
+        } else {
84
+                    foreach($calendars as $calendar)
83 85
                 $this->makeForeground($calendar);
86
+        }
84 87
     }
85 88
 
86 89
     /**
@@ -90,8 +93,9 @@  discard block
 block discarded – undo
90 93
     private function makeBackground(Company $company)
91 94
     {
92 95
         $event = $this->schedule->command('optimise:meetings '.$company->id)->withoutOverlapping();
93
-        if($event->isDue($this->laravel))
94
-            $event->run($this->laravel);
96
+        if($event->isDue($this->laravel)) {
97
+                    $event->run($this->laravel);
98
+        }
95 99
     }
96 100
 
97 101
     /**
Please login to merge, or discard this patch.
app/Console/Commands/Optimise/Solver.php 1 patch
Braces   +73 added lines, -48 removed lines patch added patch discarded remove patch
@@ -104,8 +104,9 @@  discard block
 block discarded – undo
104 104
      */
105 105
     function __destruct()
106 106
     {
107
-        if ($this->path && is_dir($this->path) && !self::delTree($this->path))
108
-            throw new OptimiseException('problems during removing of path directory');
107
+        if ($this->path && is_dir($this->path) && !self::delTree($this->path)) {
108
+                    throw new OptimiseException('problems during removing of path directory');
109
+        }
109 110
     }
110 111
 
111 112
     /**
@@ -113,8 +114,9 @@  discard block
 block discarded – undo
113 114
      */
114 115
     static private function checkGlpsol()
115 116
     {
116
-        if(!(`which glpsol`))
117
-            throw new OptimiseException('glpsol is not installed');
117
+        if(!(`which glpsol`)) {
118
+                    throw new OptimiseException('glpsol is not installed');
119
+        }
118 120
     }
119 121
 
120 122
     /**
@@ -138,12 +140,16 @@  discard block
 block discarded – undo
138 140
     {
139 141
         $this->path = tempnam(sys_get_temp_dir(), 'OPT'); //TODO check the return in case of errors this return false on failure
140 142
         unlink($this->path); //remove file to create a dir
141
-        if(file_exists($this->path))
142
-            throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
143
-        if(!@mkdir($this->path))
144
-            throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');;
145
-        if(! is_dir($this->path))
146
-            throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
143
+        if(file_exists($this->path)) {
144
+                    throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
145
+        }
146
+        if(!@mkdir($this->path)) {
147
+                    throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');
148
+        }
149
+        ;
150
+        if(! is_dir($this->path)) {
151
+                    throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
152
+        }
147 153
     }
148 154
 
149 155
     /**
@@ -223,8 +229,9 @@  discard block
 block discarded – undo
223 229
      */
224 230
     public function setTimeSlots($timeSlots)
225 231
     {
226
-        if(!is_int($timeSlots) || $timeSlots <=0)
227
-            throw new OptimiseException('$timeSlots is not integer or it is not >0');
232
+        if(!is_int($timeSlots) || $timeSlots <=0) {
233
+                    throw new OptimiseException('$timeSlots is not integer or it is not >0');
234
+        }
228 235
 
229 236
         $this->timeSlots = $timeSlots;
230 237
         return $this;
@@ -245,8 +252,9 @@  discard block
 block discarded – undo
245 252
      */
246 253
     public function setMaxTimeSlots($maxTimeSlots)
247 254
     {
248
-        if(!is_int($maxTimeSlots) || $maxTimeSlots <=0)
249
-            throw new OptimiseException('$maxTimeSlots is not integer or it is not >0');
255
+        if(!is_int($maxTimeSlots) || $maxTimeSlots <=0) {
256
+                    throw new OptimiseException('$maxTimeSlots is not integer or it is not >0');
257
+        }
250 258
 
251 259
         $this->maxTimeSlots = $maxTimeSlots;
252 260
         return $this;
@@ -268,12 +276,14 @@  discard block
 block discarded – undo
268 276
     public function setMeetingsAvailability($meetingsAvailability)
269 277
     {
270 278
         $meetings = array_keys($meetingsAvailability);
271
-        if(array_diff($meetings, $this->meetings))
272
-            throw new OptimiseException('meetings different from meetings set');
279
+        if(array_diff($meetings, $this->meetings)) {
280
+                    throw new OptimiseException('meetings different from meetings set');
281
+        }
273 282
         foreach($meetingsAvailability as $key=>$meetingsAvailabilityS) {
274 283
             $timeSlots = array_keys($meetingsAvailabilityS);
275
-            if(count($timeSlots) != $this->timeSlots)
276
-                throw new OptimiseException('timeSlots different from timeSlots set');
284
+            if(count($timeSlots) != $this->timeSlots) {
285
+                            throw new OptimiseException('timeSlots different from timeSlots set');
286
+            }
277 287
             $meetingsAvailability[$key] = self::arrayPad($meetingsAvailabilityS, $this->timeSlots + $this->maxTimeSlots, 0);
278 288
         }
279 289
 
@@ -303,8 +313,9 @@  discard block
 block discarded – undo
303 313
         }
304 314
         foreach($meetingsDuration as $duration) {
305 315
             $duration = (int) $duration; //TODO fix this (fix for optimise)
306
-            if(!is_int($duration) || $duration <=0)
307
-                throw new OptimiseException('duration is not integer or it is not >0');
316
+            if(!is_int($duration) || $duration <=0) {
317
+                            throw new OptimiseException('duration is not integer or it is not >0');
318
+            }
308 319
         }
309 320
 
310 321
         $this->meetingsDuration = $meetingsDuration;
@@ -327,12 +338,14 @@  discard block
 block discarded – undo
327 338
     public function setUsersAvailability($usersAvailability)
328 339
     {
329 340
         $users = array_keys($usersAvailability);
330
-        if(array_diff($users, $this->users))
331
-            throw new OptimiseException('users different from users set');
341
+        if(array_diff($users, $this->users)) {
342
+                    throw new OptimiseException('users different from users set');
343
+        }
332 344
         foreach($usersAvailability as $key=>$usersAvailabilityS) {
333 345
             $timeSlots = array_keys($usersAvailabilityS);
334
-            if(count($timeSlots) != $this->timeSlots)
335
-                throw new OptimiseException('timeSlots different from timeSlots set');
346
+            if(count($timeSlots) != $this->timeSlots) {
347
+                            throw new OptimiseException('timeSlots different from timeSlots set');
348
+            }
336 349
 
337 350
             $usersAvailability[$key] = self::arrayPad($usersAvailabilityS, $this->timeSlots + $this->maxTimeSlots, 0);
338 351
         }
@@ -357,12 +370,14 @@  discard block
 block discarded – undo
357 370
     public function setUsersMeetings($usersMeetings)
358 371
     {
359 372
         $users = array_keys($usersMeetings);
360
-        if(array_diff($users, $this->users))
361
-            throw new OptimiseException('users different from users set');
373
+        if(array_diff($users, $this->users)) {
374
+                    throw new OptimiseException('users different from users set');
375
+        }
362 376
         foreach($usersMeetings as $usersMeetingsS) {
363 377
             $meetings = array_keys($usersMeetingsS);
364
-            if(array_diff($meetings, $this->meetings))
365
-                throw new OptimiseException('meetings different from meetings set');
378
+            if(array_diff($meetings, $this->meetings)) {
379
+                            throw new OptimiseException('meetings different from meetings set');
380
+            }
366 381
         }
367 382
 
368 383
         $this->usersMeetings = $usersMeetings;
@@ -460,8 +475,9 @@  discard block
 block discarded – undo
460 475
     {
461 476
         $f = function ($fp, $data){
462 477
             foreach ($data as $key=>$field) {
463
-                foreach ($field as $key2=>$field2)
464
-                    fputcsv($fp, [$key, $key2, $field2]);
478
+                foreach ($field as $key2=>$field2) {
479
+                                    fputcsv($fp, [$key, $key2, $field2]);
480
+                }
465 481
             }
466 482
         };
467 483
 
@@ -478,8 +494,9 @@  discard block
 block discarded – undo
478 494
     static private function writeCSV($file, $data, $heading, \Closure $writer)
479 495
     {
480 496
         $fp = @fopen($file, 'w');
481
-        if(!$fp)
482
-            throw new OptimiseException('problem during creation of a file');
497
+        if(!$fp) {
498
+                    throw new OptimiseException('problem during creation of a file');
499
+        }
483 500
 
484 501
         fputcsv($fp, $heading);
485 502
 
@@ -499,8 +516,9 @@  discard block
 block discarded – undo
499 516
         $this->writeData();
500 517
         $this->writeModelFile();
501 518
         $event = $this->schedule->exec('glpsol --math '.$this->getModelPath())->sendOutputTo($this->getOutputPath())->after(function () { }); //this just to execute in foreground
502
-        if($event->isDue($this->laravel))
503
-            $event->run($this->laravel);
519
+        if($event->isDue($this->laravel)) {
520
+                    $event->run($this->laravel);
521
+        }
504 522
         //TODO catch glpsol errors
505 523
         return $this;
506 524
     }
@@ -513,8 +531,9 @@  discard block
 block discarded – undo
513 531
         $strReplaceS = array('{USERS_PATH}', '{MEETINGS_PATH}', '{USER_AVAILABILITY_PATH}', '{MEETINGS_AVAILABILITY_PATH}', '{USER_MEETINGS_PATH}', '{MEETINGS_DURATION_PATH}', '{TIME_SLOTS}', '{MAX_TIME_SLOTS}', '{X_OUT_PATH}', '{Y_OUT_PATH}');
514 532
         $strReplaceR = array($this->getUsersPath(), $this->getMeetingsPath(), $this->getUsersAvailabilityPath(), $this->getMeetingsAvailabilityPath(), $this->getUsersMeetingsPath(), $this->getMeetingsDurationPath(), $this->timeSlots, $this->maxTimeSlots, $this->getXPath(), $this->getYPath());
515 533
         $f = @fopen($this->getModelPath(), "w");
516
-        if(!$f)
517
-            throw new OptimiseException('problem during creation of a file');
534
+        if(!$f) {
535
+                    throw new OptimiseException('problem during creation of a file');
536
+        }
518 537
         fwrite($f, str_replace($strReplaceS, $strReplaceR, file_get_contents(__DIR__ . "/model.stub")));
519 538
         fclose($f);
520 539
     }
@@ -543,8 +562,9 @@  discard block
 block discarded – undo
543 562
      */
544 563
     public function getOutput()
545 564
     {
546
-        if(!($data = file_get_contents($this->getOutputPath())))
547
-            throw new OptimiseException('problems during reading the file');
565
+        if(!($data = file_get_contents($this->getOutputPath()))) {
566
+                    throw new OptimiseException('problems during reading the file');
567
+        }
548 568
         return $data;
549 569
     }
550 570
 
@@ -555,12 +575,14 @@  discard block
 block discarded – undo
555 575
      */
556 576
     static private function readCSVFile($file)
557 577
     {
558
-        if(!file_exists($file) || !filesize($file))
559
-            throw new OptimiseException('no results file');
578
+        if(!file_exists($file) || !filesize($file)) {
579
+                    throw new OptimiseException('no results file');
580
+        }
560 581
 
561 582
         $handle = @fopen($file,"r");
562
-        if(!$handle)
563
-            throw new OptimiseException('problems during reading the file');
583
+        if(!$handle) {
584
+                    throw new OptimiseException('problems during reading the file');
585
+        }
564 586
 
565 587
         $ret = [];
566 588
         fgetcsv($handle); //skip head
@@ -687,9 +709,10 @@  discard block
 block discarded – undo
687 709
      */
688 710
     private function checkArrayProprieties($proprieties)
689 711
     {
690
-        foreach($proprieties as $propriety)
691
-            if(count($this->$propriety)==0)
712
+        foreach($proprieties as $propriety) {
713
+                    if(count($this->$propriety)==0)
692 714
                 throw new OptimiseException($propriety.' is not set correctly');
715
+        }
693 716
     }
694 717
 
695 718
     /**
@@ -698,9 +721,10 @@  discard block
 block discarded – undo
698 721
      */
699 722
     private function checkIntProprieties($proprieties)
700 723
     {
701
-        foreach($proprieties as $propriety)
702
-            if(!is_int($this->$propriety) || $this->$propriety <= 0)
724
+        foreach($proprieties as $propriety) {
725
+                    if(!is_int($this->$propriety) || $this->$propriety <= 0)
703 726
                 throw new OptimiseException($propriety.' is not set correctly');
727
+        }
704 728
     }
705 729
 
706 730
     /**
@@ -712,8 +736,9 @@  discard block
 block discarded – undo
712 736
     static private function arrayPad(array $array, $len, $pad)
713 737
     {
714 738
         $len = $len - count($array);
715
-        for($i = 0; $i<$len; $i++)
716
-            $array[] = $pad;
739
+        for($i = 0; $i<$len; $i++) {
740
+                    $array[] = $pad;
741
+        }
717 742
         return $array;
718 743
     }
719 744
 }
720 745
\ No newline at end of file
Please login to merge, or discard this patch.