Completed
Push — master ( 2d22de...e2d103 )
by Sherif
02:14
created
files/Handler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
                 return \Response::json(['errors' => [$errors]], $exception->getStatusCode());
64 64
             } elseif ($exception instanceof \Illuminate\Validation\ValidationException) {
65 65
                 return \Response::json(['errors' => $exception->errors()], 422);
66
-            } elseif (! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
66
+            } elseif ( ! $exception instanceof \Symfony\Component\ErrorHandler\Error\FatalError) {
67 67
                 return parent::render($request, $exception);
68 68
             }
69 69
         }
Please login to merge, or discard this patch.
src/Modules/Notifications/Routes/api.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
 |
12 12
 */
13 13
 
14
-Route::group(['prefix' => 'notifications'], function () {
14
+Route::group(['prefix' => 'notifications'], function() {
15 15
 
16
-    Route::group(['prefix' => 'notifications'], function () {
16
+    Route::group(['prefix' => 'notifications'], function() {
17 17
         
18 18
         Route::get('list/{perPage?}', 'NotificationsController@list');
19 19
         Route::get('unread/{perPage?}', 'NotificationsController@unread');
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
         Route::get('markAllAsRead', 'NotificationsController@markAllAsRead');
22 22
     });
23 23
 
24
-    Route::group(['prefix' => 'push_notification_devices'], function () {
24
+    Route::group(['prefix' => 'push_notification_devices'], function() {
25 25
         
26 26
         Route::get('list/{sortBy?}/{desc?}', 'PushNotificationDevicesController@index');
27 27
         Route::get('find/{id}', 'PushNotificationDevicesController@find');
Please login to merge, or discard this patch.
Database/Migrations/2016_01_24_111942_push_notification_devices.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('push_notification_devices', function (Blueprint $table) {
15
+        Schema::create('push_notification_devices', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('device_token');
18 18
             $table->integer('user_id');
Please login to merge, or discard this patch.
src/Modules/Core/Http/Controllers/BaseApiController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         \Auth::shouldUse('api');
220 220
         $this->middleware('auth:api', ['except' => $this->skipLoginCheck]);
221 221
         
222
-        if (! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) {
222
+        if ( ! in_array($permission, $this->skipLoginCheck) && $user = \Auth::user()) {
223 223
             $user             = \Auth::user();
224 224
             $permission       = $permission !== 'index' ? $permission : 'list';
225 225
             $isPasswordClient = $user->token()->client->password_client;
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             }
231 231
 
232 232
             if ($isPasswordClient && (in_array($permission, $this->skipPermissionCheck) || \Core::users()->can($permission, $this->modelName))) {
233
-            } elseif (! $isPasswordClient && $user->tokenCan($this->modelName.'-'.$permission)) {
233
+            } elseif ( ! $isPasswordClient && $user->tokenCan($this->modelName.'-'.$permission)) {
234 234
             } else {
235 235
                 \ErrorHandler::noPermissions();
236 236
             }
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         if ($timezone && $timezone !== $user->timezone) {
303 303
             $user->timezone = $timezone;
304
-            $update       = true;
304
+            $update = true;
305 305
         }
306 306
 
307 307
         if ($update) {
Please login to merge, or discard this patch.
src/Modules/Acl/Repositories/UserRepository.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         $permissions = [];
29 29
         $user        = \Core::users()->find(\Auth::id(), $relations);
30 30
         foreach ($user->groups()->get() as $group) {
31
-            $group->permissions->each(function ($permission) use (&$permissions) {
31
+            $group->permissions->each(function($permission) use (&$permissions) {
32 32
                 $permissions[$permission->model][$permission->id] = $permission->name;
33 33
             });
34 34
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $user        = $user ?: $this->find(\Auth::id(), ['groups.permissions']);
52 52
         $permissions = [];
53 53
 
54
-        $user->groups->pluck('permissions')->each(function ($permission) use (&$permissions, $model) {
54
+        $user->groups->pluck('permissions')->each(function($permission) use (&$permissions, $model) {
55 55
             $permissions = array_merge($permissions, $permission->where('model', $model)->pluck('name')->toArray());
56 56
         });
57 57
         
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function assignGroups($userId, $groupIds)
82 82
     {
83
-        \DB::transaction(function () use ($userId, $groupIds) {
83
+        \DB::transaction(function() use ($userId, $groupIds) {
84 84
             $user = $this->find($userId);
85 85
             $user->groups()->detach();
86 86
             $user->groups()->attach($groupIds);
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function login($credentials, $adminLogin = false)
101 101
     {
102
-        if (! $user = $this->first(['email' => $credentials['email']])) {
102
+        if ( ! $user = $this->first(['email' => $credentials['email']])) {
103 103
             \ErrorHandler::loginFailed();
104 104
         } elseif ($adminLogin && ! $user->groups->whereIn('name', ['Admin'])->count()) {
105 105
             \ErrorHandler::loginFailed();
106
-        } elseif (! $adminLogin && $user->groups->whereIn('name', ['Admin'])->count()) {
106
+        } elseif ( ! $adminLogin && $user->groups->whereIn('name', ['Admin'])->count()) {
107 107
             \ErrorHandler::loginFailed();
108 108
         } elseif ($user->blocked) {
109 109
             \ErrorHandler::userIsBlocked();
110
-        } elseif (! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
110
+        } elseif ( ! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
111 111
             \ErrorHandler::emailNotConfirmed();
112 112
         }
113 113
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         $access_token = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken;
128 128
         $user         = \Socialite::driver($type)->userFromToken($access_token);
129 129
 
130
-        if (! $user->email) {
130
+        if ( ! $user->email) {
131 131
             \ErrorHandler::noSocialEmail();
132 132
         }
133 133
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         if ($skipConfirmEmail) {
154 154
             $user->confirmed = 1;
155 155
             $user->save();
156
-        } elseif (! config('skeleton.disable_confirm_email')) {
156
+        } elseif ( ! config('skeleton.disable_confirm_email')) {
157 157
             $this->sendConfirmationEmail($user->email);
158 158
         }
159 159
 
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function block($userId)
170 170
     {
171
-        if (! $user = $this->find($userId)) {
171
+        if ( ! $user = $this->find($userId)) {
172 172
             \ErrorHandler::notFound('user');
173 173
         }
174
-        if (! $this->hasGroup(['Admin'])) {
174
+        if ( ! $this->hasGroup(['Admin'])) {
175 175
             \ErrorHandler::noPermissions();
176 176
         } elseif (\Auth::id() == $userId) {
177 177
             \ErrorHandler::noPermissions();
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     public function unblock($userId)
195 195
     {
196
-        if (! $this->hasGroup(['Admin'])) {
196
+        if ( ! $this->hasGroup(['Admin'])) {
197 197
             \ErrorHandler::noPermissions();
198 198
         }
199 199
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function sendReset($email)
214 214
     {
215
-        if (! $user = $this->model->where('email', $email)->first()) {
215
+        if ( ! $user = $this->model->where('email', $email)->first()) {
216 216
             \ErrorHandler::notFound('email');
217 217
         }
218 218
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     public function resetPassword($credentials)
230 230
     {
231
-        $response = \Password::reset($credentials, function ($user, $password) {
231
+        $response = \Password::reset($credentials, function($user, $password) {
232 232
             $user->password = $password;
233 233
             $user->save();
234 234
         });
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     public function changePassword($credentials)
264 264
     {
265 265
         $user = \Auth::user();
266
-        if (! \Hash::check($credentials['old_password'], $user->password)) {
266
+        if ( ! \Hash::check($credentials['old_password'], $user->password)) {
267 267
             \ErrorHandler::invalidOldPassword();
268 268
         }
269 269
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
      */
280 280
     public function confirmEmail($confirmationCode)
281 281
     {
282
-        if (! $user = $this->first(['confirmation_code' => $confirmationCode])) {
282
+        if ( ! $user = $this->first(['confirmation_code' => $confirmationCode])) {
283 283
             \ErrorHandler::invalidConfirmationCode();
284 284
         }
285 285
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         $sort       = $desc ? 'desc' : 'asc';
325 325
         $model      = call_user_func_array("{$this->getModel()}::with", array($relations));
326 326
 
327
-        $model->whereHas('groups', function ($q) use ($groupName) {
327
+        $model->whereHas('groups', function($q) use ($groupName) {
328 328
             $q->where('name', $groupName);
329 329
         });
330 330
 
Please login to merge, or discard this patch.