Completed
Push — master ( cf2713...aee5ae )
by Sherif
02:07
created
Database/Migrations/2016_06_01_000002_create_oauth_access_tokens_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_access_tokens', function (Blueprint $table) {
16
+        Schema::create('oauth_access_tokens', function(Blueprint $table) {
17 17
             $table->string('id', 100)->primary();
18 18
             $table->unsignedInteger('user_id')->nullable();
19 19
             $table->unsignedInteger('client_id');
Please login to merge, or discard this patch.
Migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('oauth_personal_access_clients', function (Blueprint $table) {
16
+        Schema::create('oauth_personal_access_clients', function(Blueprint $table) {
17 17
             $table->increments('id');
18 18
             $table->unsignedInteger('client_id');
19 19
             $table->timestamps();
Please login to merge, or discard this patch.
src/Modules/Users/ModelObservers/AclUserObserver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public function updated($model)
37 37
     {
38 38
         if ($model->isDirty('blocked') && $model->blocked) {
39
-            $model->tokens()->each(function ($token) {
39
+            $model->tokens()->each(function($token) {
40 40
 
41 41
                 \Core::oauthClients()->revokeAccessToken($token);
42 42
             });
Please login to merge, or discard this patch.
src/Modules/Users/Routes/api.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 |
14 14
 */
15 15
 
16
-Route::group(['prefix' => 'users'], function () {
16
+Route::group(['prefix' => 'users'], function() {
17 17
 
18 18
     Route::get('/', 'UserController@index');
19 19
     Route::get('/{id}', 'UserController@find');
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     Route::get('unblock/{id}', 'UserController@unblock');
27 27
     Route::post('assign/roles', 'UserController@assignRoles');
28 28
 
29
-    Route::group(['prefix' => 'account'], function () {
29
+    Route::group(['prefix' => 'account'], function() {
30 30
 
31 31
         Route::get('my', 'UserController@account');
32 32
         Route::get('logout', 'UserController@logout');
Please login to merge, or discard this patch.
src/Modules/Users/Database/Seeds/UsersTableSeeder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
          */
21 21
         $role = Role::updateOrInsert([
22 22
             'name' => 'Admin',
23
-        ],[
23
+        ], [
24 24
             'created_at' => \DB::raw('NOW()'),
25 25
             'updated_at' => \DB::raw('NOW()')
26 26
         ]);
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
          */
31 31
         AclUser::updateOrInsert([
32 32
             'email' => '[email protected]',
33
-        ],[
33
+        ], [
34 34
             'name'       => 'Admin',
35 35
             'password'   => \Hash::make('123456'),
36 36
             'confirmed'  => 1,
Please login to merge, or discard this patch.
src/Modules/Users/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['user'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('permission_role')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.
src/Modules/Users/Http/Controllers/UserController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@
 block discarded – undo
199 199
      */
200 200
     public function changePassword(ChangePassword $request)
201 201
     {
202
-        return new GeneralResource($this->service->changePassword($request->get('password') , $request->get('old_password')));
202
+        return new GeneralResource($this->service->changePassword($request->get('password'), $request->get('old_password')));
203 203
     }
204 204
 
205 205
     /**
Please login to merge, or discard this patch.
src/Modules/Users/Services/UserService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $permissions = [];
75 75
         $user        = $this->repo->find(\Auth::id(), $relations);
76 76
         foreach ($user->roles as $role) {
77
-            $role->permissions->each(function ($permission) use (&$permissions) {
77
+            $role->permissions->each(function($permission) use (&$permissions) {
78 78
                 $permissions[$permission->repo][$permission->id] = $permission->name;
79 79
             });
80 80
         }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     public function assignRoles($userId, $roleIds)
138 138
     {
139 139
         $user = false;
140
-        \DB::transaction(function () use ($userId, $permissionIds, &$user) {
140
+        \DB::transaction(function() use ($userId, $permissionIds, &$user) {
141 141
             $user = $this->repo->find($userId);
142 142
             $this->repo->detachPermissions($userId);
143 143
             $this->repo->attachPermissions($userId, $roleIds);
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function login($email, $password, $adminLogin = false)
158 158
     {
159
-        if (! $user = $this->repo->first(['email' => $email])) {
159
+        if ( ! $user = $this->repo->first(['email' => $email])) {
160 160
             \ErrorHandler::loginFailed();
161 161
         } elseif ($adminLogin && ! $this->hasRoles(['Admin'], $user)) {
162 162
             \ErrorHandler::loginFailed();
163
-        } elseif (! $adminLogin && $this->hasRoles(['Admin'], $user)) {
163
+        } elseif ( ! $adminLogin && $this->hasRoles(['Admin'], $user)) {
164 164
             \ErrorHandler::loginFailed();
165 165
         } elseif ($user->blocked) {
166 166
             \ErrorHandler::userIsBlocked();
167
-        } elseif (! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
167
+        } elseif ( ! config('skeleton.disable_confirm_email') && ! $user->confirmed) {
168 168
             \ErrorHandler::emailNotConfirmed();
169 169
         }
170 170
 
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
         $access_token = $authCode ? Arr::get(\Socialite::driver($type)->getAccessTokenResponse($authCode), 'access_token') : $accessToken;
185 185
         $user         = \Socialite::driver($type)->userFromToken($access_token);
186 186
 
187
-        if (! $user->email) {
187
+        if ( ! $user->email) {
188 188
             \ErrorHandler::noSocialEmail();
189 189
         }
190 190
 
191
-        if (! $this->repo->first(['email' => $user->email])) {
191
+        if ( ! $this->repo->first(['email' => $user->email])) {
192 192
             $this->register(['email' => $user->email, 'password' => ''], true);
193 193
         }
194 194
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             'confirmed' => $skipConfirmEmail
214 214
         ]);
215 215
 
216
-        if (! $skipConfirmEmail && ! config('skeleton.disable_confirm_email')) {
216
+        if ( ! $skipConfirmEmail && ! config('skeleton.disable_confirm_email')) {
217 217
             $this->sendConfirmationEmail($user->email);
218 218
         }
219 219
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
      */
255 255
     public function sendReset($email)
256 256
     {
257
-        if (! $user = $this->repo->first(['email' => $email])) {
257
+        if ( ! $user = $this->repo->first(['email' => $email])) {
258 258
             \ErrorHandler::notFound('email');
259 259
         }
260 260
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
             'password'              => $password, 
279 279
             'password_confirmation' => $passwordConfirmation, 
280 280
             'token'                 => $token
281
-        ], function ($user, $password) {
281
+        ], function($user, $password) {
282 282
             $this->repo->save(['id' => $user->id, 'password' => $password]);
283 283
         });
284 284
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     public function changePassword($password, $oldPassword)
316 316
     {
317 317
         $user = \Auth::user();
318
-        if (! \Hash::check($oldPassword, $user->password)) {
318
+        if ( ! \Hash::check($oldPassword, $user->password)) {
319 319
             \ErrorHandler::invalidOldPassword();
320 320
         }
321 321
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     public function confirmEmail($confirmationCode)
332 332
     {
333
-        if (! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) {
333
+        if ( ! $user = $this->repo->first(['confirmation_code' => $confirmationCode])) {
334 334
             \ErrorHandler::invalidConfirmationCode();
335 335
         }
336 336
 
Please login to merge, or discard this patch.
Modules/PushNotificationDevices/Database/Seeds/AssignRelationsSeeder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         /**
19 19
          * Assign the permissions to the admin role.
20 20
          */
21
-        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['pushNotificationDevice'])->each(function ($permission) use ($adminRoleId) {
21
+        \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['pushNotificationDevice'])->each(function($permission) use ($adminRoleId) {
22 22
             \DB::table('permission_role')->insert(
23 23
                 [
24 24
                 'permission_id' => $permission->id,
Please login to merge, or discard this patch.