Completed
Push — master ( a315a1...6807e8 )
by claudio
06:17
created
app/Console/Commands/Optimise/OptimiseException.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: Claudio Cardinale <[email protected]>
5
- * Date: 07/12/15
6
- * Time: 21.24
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version 2
10
- * of the License, or (at your option) any later version.
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
- */
3
+     * Created by PhpStorm.
4
+     * User: Claudio Cardinale <[email protected]>
5
+     * Date: 07/12/15
6
+     * Time: 21.24
7
+     * This program is free software; you can redistribute it and/or
8
+     * modify it under the terms of the GNU General Public License
9
+     * as published by the Free Software Foundation; either version 2
10
+     * of the License, or (at your option) any later version.
11
+     * This program is distributed in the hope that it will be useful,
12
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+     * GNU General Public License for more details.
15
+     * You should have received a copy of the GNU General Public License
16
+     * along with this program; if not, write to the Free Software
17
+     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
+     */
19 19
 
20 20
 namespace plunner\Console\Commands\Optimise;
21 21
 
Please login to merge, or discard this patch.
app/Events/Optimise/OkEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
      */
40 40
     public function broadcastOn()
41 41
     {
42
-        return [];
42
+        return [ ];
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
app/Events/Optimise/ErrorEvent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,6 +39,6 @@
 block discarded – undo
39 39
      */
40 40
     public function broadcastOn()
41 41
     {
42
-        return [];
42
+        return [ ];
43 43
     }
44 44
 }
Please login to merge, or discard this patch.
app/Console/Commands/Optimise/Path.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: Claudio Cardinale <[email protected]>
5
- * Date: 18/12/15
6
- * Time: 15.20
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version 2
10
- * of the License, or (at your option) any later version.
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
- */
3
+     * Created by PhpStorm.
4
+     * User: Claudio Cardinale <[email protected]>
5
+     * Date: 18/12/15
6
+     * Time: 15.20
7
+     * This program is free software; you can redistribute it and/or
8
+     * modify it under the terms of the GNU General Public License
9
+     * as published by the Free Software Foundation; either version 2
10
+     * of the License, or (at your option) any later version.
11
+     * This program is distributed in the hope that it will be useful,
12
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+     * GNU General Public License for more details.
15
+     * You should have received a copy of the GNU General Public License
16
+     * along with this program; if not, write to the Free Software
17
+     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
+     */
19 19
 
20 20
 namespace plunner\Console\Commands\Optimise;
21 21
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         if (file_exists($path->getPath()))
54 54
             throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
55 55
         if (!@mkdir($path->getPath()))
56
-            throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');;
56
+            throw new OptimiseException('problem during creation of tmp dir (mkdir problem)'); ;
57 57
         if (!is_dir($path->getPath()))
58 58
             throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
59 59
         return $path;
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function getModelPath()
106 106
     {
107
-        return $this->path . '/model.mod';
107
+        return $this->path.'/model.mod';
108 108
     }
109 109
 
110 110
     /**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function getUsersPath()
114 114
     {
115
-        return $this->path . '/Users.csv';
115
+        return $this->path.'/Users.csv';
116 116
     }
117 117
 
118 118
     /**
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      */
121 121
     public function getMeetingsPath()
122 122
     {
123
-        return $this->path . '/Meeting.csv';
123
+        return $this->path.'/Meeting.csv';
124 124
     }
125 125
 
126 126
     /**
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function getMeetingsDurationPath()
130 130
     {
131
-        return $this->path . '/MeetingsDuration.csv';
131
+        return $this->path.'/MeetingsDuration.csv';
132 132
     }
133 133
 
134 134
     /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function getMeetingsAvailabilityPath()
138 138
     {
139
-        return $this->path . '/MeetingsAvailability.csv';
139
+        return $this->path.'/MeetingsAvailability.csv';
140 140
     }
141 141
 
142 142
     /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function getUsersAvailabilityPath()
146 146
     {
147
-        return $this->path . '/UsersAvailability.csv';
147
+        return $this->path.'/UsersAvailability.csv';
148 148
     }
149 149
 
150 150
     /**
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     public function getUsersMeetingsPath()
154 154
     {
155
-        return $this->path . '/UsersMeetings.csv';
155
+        return $this->path.'/UsersMeetings.csv';
156 156
     }
157 157
 
158 158
     /**
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function getXPath()
162 162
     {
163
-        return $this->path . '/x.csv';
163
+        return $this->path.'/x.csv';
164 164
     }
165 165
 
166 166
     /**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function getYPath()
170 170
     {
171
-        return $this->path . '/y.csv';
171
+        return $this->path.'/y.csv';
172 172
     }
173 173
 
174 174
     /**
@@ -176,6 +176,6 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function getOutputPath()
178 178
     {
179
-        return $this->path . '/out.txt';
179
+        return $this->path.'/out.txt';
180 180
     }
181 181
 }
182 182
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,12 +50,16 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $path = new Path(tempnam(sys_get_temp_dir(), 'OPT')); //TODO check the return in case of errors this return false on failure
52 52
         unlink($path->getPath()); //remove file to create a dir
53
-        if (file_exists($path->getPath()))
54
-            throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
55
-        if (!@mkdir($path->getPath()))
56
-            throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');;
57
-        if (!is_dir($path->getPath()))
58
-            throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
53
+        if (file_exists($path->getPath())) {
54
+                    throw new OptimiseException('problem during creation of tmp dir (the directory already exists)');
55
+        }
56
+        if (!@mkdir($path->getPath())) {
57
+                    throw new OptimiseException('problem during creation of tmp dir (mkdir problem)');
58
+        }
59
+        ;
60
+        if (!is_dir($path->getPath())) {
61
+                    throw new OptimiseException('problem during creation of tmp dir (it is not possible to create directory)');
62
+        }
59 63
         return $path;
60 64
     }
61 65
 
@@ -80,8 +84,9 @@  discard block
 block discarded – undo
80 84
      */
81 85
     public function __destruct()
82 86
     {
83
-        if ($this->path && is_dir($this->path) && !self::delTree($this->path))
84
-            throw new OptimiseException('problems during removing of path directory');
87
+        if ($this->path && is_dir($this->path) && !self::delTree($this->path)) {
88
+                    throw new OptimiseException('problems during removing of path directory');
89
+        }
85 90
     }
86 91
 
87 92
     /**
Please login to merge, or discard this patch.
app/Http/Middleware/GetUserAndRefresh.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,21 +1,21 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Created by PhpStorm.
4
- * User: Claudio Cardinale <[email protected]>
5
- * Date: 24/12/15
6
- * Time: 22.53
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version 2
10
- * of the License, or (at your option) any later version.
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- * You should have received a copy of the GNU General Public License
16
- * along with this program; if not, write to the Free Software
17
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
- */
3
+     * Created by PhpStorm.
4
+     * User: Claudio Cardinale <[email protected]>
5
+     * Date: 24/12/15
6
+     * Time: 22.53
7
+     * This program is free software; you can redistribute it and/or
8
+     * modify it under the terms of the GNU General Public License
9
+     * as published by the Free Software Foundation; either version 2
10
+     * of the License, or (at your option) any later version.
11
+     * This program is distributed in the hope that it will be useful,
12
+     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
+     * GNU General Public License for more details.
15
+     * You should have received a copy of the GNU General Public License
16
+     * along with this program; if not, write to the Free Software
17
+     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
+     */
19 19
 
20 20
 namespace plunner\Http\Middleware;
21 21
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         //this to add the remember me mode field in the new token, but we have the custom check that is an useless
36 36
         //overhead
37
-        $custom = $custom . ';remember-' . $remember == 'true' ? 'true' : 'false';
37
+        $custom = $custom.';remember-'.$remember == 'true' ? 'true' : 'false';
38 38
         return parent::handle($request, $next, $custom);
39 39
     }
40 40
 
Please login to merge, or discard this patch.
app/Http/Controllers/Companies/Company/CompanyController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function __construct()
12 12
     {
13
-        config(['auth.model' => \plunner\Company::class]);
14
-        config(['jwt.user' => \plunner\Company::class]);
13
+        config([ 'auth.model' => \plunner\Company::class ]);
14
+        config([ 'jwt.user' => \plunner\Company::class ]);
15 15
         $this->middleware('jwt.authandrefresh:mode-cn');
16 16
     }
17 17
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function update(CompanyRequest $request)
37 37
     {
38 38
         $company = \Auth::user();
39
-        $input = $request->only(['name', 'password']);
39
+        $input = $request->only([ 'name', 'password' ]);
40 40
         $company->update($input);
41 41
         return $company;
42 42
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Employee/EmployeeController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function __construct()
12 12
     {
13
-        config(['auth.model' => \plunner\Employee::class]);
14
-        config(['jwt.user' => \plunner\Employee::class]);
13
+        config([ 'auth.model' => \plunner\Employee::class ]);
14
+        config([ 'jwt.user' => \plunner\Employee::class ]);
15 15
         $this->middleware('jwt.authandrefresh:mode-en');
16 16
     }
17 17
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function update(EmployeeRequest $request)
37 37
     {
38 38
         $employee = \Auth::user();
39
-        $input = $request->only(['name', 'password']);
39
+        $input = $request->only([ 'name', 'password' ]);
40 40
         $employee->update($input);
41 41
         return $employee;
42 42
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Employees/Planners/MeetingTimeslotsController.php 3 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public function __construct()
22 22
     {
23
-        config(['auth.model' => \plunner\Planner::class]);
24
-        config(['jwt.user' => \plunner\Planner::class]);
23
+        config([ 'auth.model' => \plunner\Planner::class ]);
24
+        config([ 'jwt.user' => \plunner\Planner::class ]);
25 25
         $this->middleware('jwt.authandrefresh:mode-en');
26 26
     }
27 27
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 
40 40
         if ($meeting->group_id == $groupId)
41 41
             return $meeting->timeslots;
42
-        return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
42
+        return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403);
43 43
     }
44 44
 
45 45
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId)
63 63
             return $timeslot;
64
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
64
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
65 65
     }
66 66
 
67 67
     /**
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $timeslot = $meeting->timeslots()->create($input);
84 84
             return $timeslot;
85 85
         }
86
-        return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
86
+        return Response::json([ 'error' => 'meeting->group_id <> groupId' ], 403);
87 87
     }
88 88
 
89 89
     /**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             $timeslot->update($input);
108 108
             return $timeslot;
109 109
         }
110
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
110
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
111 111
     }
112 112
 
113 113
     /**
@@ -131,6 +131,6 @@  discard block
 block discarded – undo
131 131
             $timeslot->delete();
132 132
             return $timeslot;
133 133
         }
134
-        return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
134
+        return Response::json([ 'error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId' ], 403);
135 135
     }
136 136
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
         $meeting = Meeting::findOrFail($meetingId);
38 38
         $this->authorize($meeting);
39 39
 
40
-        if ($meeting->group_id == $groupId)
41
-            return $meeting->timeslots;
40
+        if ($meeting->group_id == $groupId) {
41
+                    return $meeting->timeslots;
42
+        }
42 43
         return Response::json(['error' => 'meeting->group_id <> groupId'], 403);
43 44
     }
44 45
 
@@ -59,8 +60,9 @@  discard block
 block discarded – undo
59 60
         $timeslot = MeetingTimeslot::findOrFail($timeslotId);
60 61
         $this->authorize($timeslot);
61 62
 
62
-        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId)
63
-            return $timeslot;
63
+        if ($meeting->group_id == $groupId && $timeslot->meeting_id == $meetingId) {
64
+                    return $timeslot;
65
+        }
64 66
         return Response::json(['error' => 'meeting->group_id <> groupId || timeslot->meeting_id <> meetingId'], 403);
65 67
     }
66 68
 
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -2,11 +2,9 @@
 block discarded – undo
2 2
 
3 3
 namespace plunner\Http\Controllers\Employees\Planners;
4 4
 
5
-use Illuminate\Http\Request;
6 5
 use Illuminate\Support\Facades\Response;
7 6
 use plunner\Group;
8 7
 use plunner\Http\Controllers\Controller;
9
-use plunner\Http\Requests;
10 8
 use plunner\Http\Requests\Employees\Meeting\MeetingTimeslotRequest;
11 9
 use plunner\Meeting;
12 10
 use plunner\MeetingTimeslot;
Please login to merge, or discard this patch.
app/MeetingTimeslot.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,14 +32,14 @@
 block discarded – undo
32 32
      *
33 33
      * @var array
34 34
      */
35
-    protected $fillable = ['time_start', 'time_end'];
35
+    protected $fillable = [ 'time_start', 'time_end' ];
36 36
 
37 37
     /**
38 38
      * The attributes excluded from the model's JSON form.
39 39
      *
40 40
      * @var array
41 41
      */
42
-    protected $hidden = ['pivot', 'meeting'];
42
+    protected $hidden = [ 'pivot', 'meeting' ];
43 43
 
44 44
     /**
45 45
      * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
Please login to merge, or discard this patch.