Completed
Push — master ( b1c4b6...a05019 )
by Şəhriyar
19s
created
app/Models/NestedEntity.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
         # Fetch reference entity
51 51
         $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first();
52 52
         if (is_null($referenceEntity)) {
53
-            throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!");
53
+            throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!");
54 54
         }
55 55
 
56 56
         \DB::transaction(
57
-            function () use ($newEntityName, $referenceEntity) {
57
+            function() use ($newEntityName, $referenceEntity) {
58 58
                 # Create new entity
59 59
                 $newEntity = \DB::table($this->table);
60 60
 
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
         # Fetch reference entity
92 92
         $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first();
93 93
         if (is_null($referenceEntity)) {
94
-            throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!");
94
+            throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!");
95 95
         }
96 96
 
97 97
         \DB::transaction(
98
-            function () use ($newEntityName, $referenceEntity) {
98
+            function() use ($newEntityName, $referenceEntity) {
99 99
                 # Create new entity
100 100
                 $newEntity = \DB::table($this->table);
101 101
 
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
         # Fetch reference entity
148 148
         $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first();
149 149
         if (is_null($referenceEntity)) {
150
-            throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!");
150
+            throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!");
151 151
         }
152 152
 
153 153
         \DB::transaction(
154
-            function () use ($newEntityName, $referenceEntity) {
154
+            function() use ($newEntityName, $referenceEntity) {
155 155
                 # Create new entity
156 156
                 $newEntity = \DB::table($this->table);
157 157
 
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
         # Fetch reference entity
189 189
         $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first();
190 190
         if (is_null($referenceEntity)) {
191
-            throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!");
191
+            throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!");
192 192
         }
193 193
 
194 194
         \DB::transaction(
195
-            function () use ($newEntityName, $referenceEntity) {
195
+            function() use ($newEntityName, $referenceEntity) {
196 196
                 # Create new entity
197 197
                 $newEntity = \DB::table($this->table);
198 198
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         # Round up delete-ables
223 223
         $referenceEntity = \DB::table($this->table)->select('left_range', 'right_range', \DB::raw('right_range - left_range + 1 as range_width'))->where('id', $id)->first();
224 224
         if (is_null($referenceEntity)) {
225
-            throw new \InvalidArgumentException("Reference entity with id: " . $id . " not found!");
225
+            throw new \InvalidArgumentException("Reference entity with id: ".$id." not found!");
226 226
         }
227 227
         $completeListOfEntitiesToDeleteIncludingOrphans = \DB::table($this->table)
228 228
             ->where('left_range', '>=', $referenceEntity->left_range)
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
         # Perform either a soft-delete or hard-delete
232 232
         return \DB::transaction(
233
-            function () use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) {
233
+            function() use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) {
234 234
                 if ($doSoftDelete) {
235 235
                     # Soft delete
236 236
                     $removeResult = $completeListOfEntitiesToDeleteIncludingOrphans->update(['deleted_at' => Carbon::now()]);
@@ -241,10 +241,10 @@  discard block
 block discarded – undo
241 241
                     # Update ranges
242 242
                     \DB::table($this->table)
243 243
                         ->where('right_range', '>', $referenceEntity->right_range)
244
-                        ->update(['right_range' => \DB::raw('right_range - ' . $referenceEntity->range_width)]);
244
+                        ->update(['right_range' => \DB::raw('right_range - '.$referenceEntity->range_width)]);
245 245
                     \DB::table($this->table)
246 246
                         ->where('left_range', '>', $referenceEntity->right_range)
247
-                        ->update(['left_range' => \DB::raw('left_range - ' . $referenceEntity->range_width)]);
247
+                        ->update(['left_range' => \DB::raw('left_range - '.$referenceEntity->range_width)]);
248 248
                 }
249 249
 
250 250
                 return $removeResult;
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
 
275 275
         # Prelim
276 276
         empty($id) && $id = 1;
277
-        $nestedEntities = \DB::table($this->table . ' as node')
277
+        $nestedEntities = \DB::table($this->table.' as node')
278 278
             ->select('node.id', 'node.name')
279 279
             ->leftJoin(
280
-                $this->table . ' as parent',
281
-                function (JoinClause $join) {
280
+                $this->table.' as parent',
281
+                function(JoinClause $join) {
282 282
                     $join->on('node.left_range', '<=', 'parent.right_range')
283 283
                         ->on('node.left_range', '>=', 'parent.left_range');
284 284
                 });
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         // Non-localized, generic routes (such as those for admin panel etc).
47 47
         //-----------------------------------------------------------------------
48 48
 
49
-        $router->group(compact('namespace', 'middleware'), function (Router $router) {
49
+        $router->group(compact('namespace', 'middleware'), function(Router $router) {
50 50
             $router->get('/oauth/{provider}', 'Users\AuthController@getOAuth');
51 51
         });
52 52
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             }
63 63
 
64 64
             // Set localized routers.
65
-            $router->group(compact('namespace', 'middleware', 'prefix'), function (Router $router) use ($prefix) {
65
+            $router->group(compact('namespace', 'middleware', 'prefix'), function(Router $router) use ($prefix) {
66 66
                 $this->localizedRoutes($router, $prefix);
67 67
             });
68 68
         }
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
         //------------------------------------------------
73 73
 
74 74
         app('translator')->setLocale($defaultLocale);
75
-        $router->group(compact('namespace', 'middleware'), function (Router $router) use ($defaultLocale) {
75
+        $router->group(compact('namespace', 'middleware'), function(Router $router) use ($defaultLocale) {
76 76
             $this->localizedRoutes($router, $defaultLocale);
77 77
         });
78 78
     }
79 79
 
80 80
     protected function localizedRoutes(Router $router, $prefix)
81 81
     {
82
-        $router->get('login/{provider?}', ['uses' => 'Users\AuthController@getLogin', 'as' => $prefix . '.login']);
82
+        $router->get('login/{provider?}', ['uses' => 'Users\AuthController@getLogin', 'as' => $prefix.'.login']);
83 83
         $router->post('login/{provider?}', 'Users\AuthController@postLogin');
84
-        $router->get('logout', ['uses' => 'Users\AuthController@getLogout', 'as' => $prefix . '.logout']);
85
-        $router->get('register', ['uses' => 'UsersController@create', 'as' => $prefix . '.register']);
84
+        $router->get('logout', ['uses' => 'Users\AuthController@getLogout', 'as' => $prefix.'.logout']);
85
+        $router->get('register', ['uses' => 'UsersController@create', 'as' => $prefix.'.register']);
86 86
         $router->post('register', 'UsersController@store');
87 87
 
88 88
         $router->resource('users', 'UsersController');
Please login to merge, or discard this patch.
config/database.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     'connections' => [
44 44
         'sqlite' => [
45 45
             'driver' => 'sqlite',
46
-            'database' => storage_path() . '/database.sqlite',
46
+            'database' => storage_path().'/database.sqlite',
47 47
             'prefix' => '',
48 48
         ],
49 49
         'mysql' => [
Please login to merge, or discard this patch.
app/Http/Controllers/Users/ActivationController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 use App\Events\Users\RequestedActivationLink;
5 5
 use App\Exceptions\Common\NotImplementedException;
6 6
 use App\Exceptions\Users\UserAlreadyActivatedException;
7
-use App\Exceptions\Users\UserNotFoundException;
8 7
 use App\Http\Controllers\Controller;
9 8
 use App\Models\User;
10 9
 use App\Traits\Users\Activates;
Please login to merge, or discard this patch.
app/Services/Registrar.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $validator = app('validator')->make($this->request->all(), [
45 45
             'name' => 'sometimes|required|max:255',
46 46
             'email' => 'required|email|max:255|unique:users',
47
-            'password' => 'required|confirmed|min:' . config('auth.passwords.users.min_length'),
47
+            'password' => 'required|confirmed|min:'.config('auth.passwords.users.min_length'),
48 48
         ]);
49 49
         if ($validator->fails()) {
50 50
             throw new ValidationException($validator);
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     public function delete($id)
131 131
     {
132 132
         $validator = app('validator')->make($this->request->all(), [
133
-            'password' => 'required|min:' . config('auth.passwords.users.min_length'),
133
+            'password' => 'required|min:'.config('auth.passwords.users.min_length'),
134 134
         ]);
135 135
         if ($validator->fails()) {
136 136
             throw new ValidationException($validator);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             throw new PasswordNotValidException;
142 142
         }
143 143
 
144
-        return (bool)User::destroy($id);
144
+        return (bool) User::destroy($id);
145 145
     }
146 146
 
147 147
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
         $validator = app('validator')->make($this->request->all(), [
173 173
             'name' => 'sometimes|required|max:255',
174
-            'email' => 'required|email|max:255|unique:users,email,' . $id
174
+            'email' => 'required|email|max:255|unique:users,email,'.$id
175 175
         ]);
176 176
         if ($validator->fails()) {
177 177
             throw new ValidationException($validator);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $validator = app('validator')->make($this->request->all(), [
282 282
             'token' => 'required|string',
283 283
             'email' => 'required|email|max:255',
284
-            'password' => 'required|confirmed|min:' . app('config')->get('auth.passwords.users.min_length')
284
+            'password' => 'required|confirmed|min:'.app('config')->get('auth.passwords.users.min_length')
285 285
         ]);
286 286
         if ($validator->fails()) {
287 287
             throw new ValidationException($validator);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
         $passwordBroker = app('auth.password.broker');
293 293
         $response = $passwordBroker->reset(
294
-            $credentials, function (User $user, $password) {
294
+            $credentials, function(User $user, $password) {
295 295
             $user->password = app('hash')->make($password);
296 296
             $user->save();
297 297
             app('auth.driver')->login($user);
Please login to merge, or discard this patch.
app/Models/UserActivation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      */
39 39
     public function getCompleted($completed)
40 40
     {
41
-        return (bool)$completed;
41
+        return (bool) $completed;
42 42
     }
43 43
 
44 44
     /**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function setCompleted($completed)
50 50
     {
51
-        $this->attributes['completed'] = (bool)$completed;
51
+        $this->attributes['completed'] = (bool) $completed;
52 52
     }
53 53
 
54 54
     public function getCode()
Please login to merge, or discard this patch.
app/Listeners/Users/SendResetPasswordLinkViaEmail.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
         $broker = isset($this->broker) ? $this->broker : null;
14 14
         app('auth.password')->broker($broker)->sendResetLink(
15
-            ['email' => $user->email], function (Message $message) {
15
+            ['email' => $user->email], function(Message $message) {
16 16
                 $message->subject($this->getPasswordResetEmailSubject());
17 17
             }
18 18
         );
Please login to merge, or discard this patch.
database/migrations/2014_10_12_000100_create_password_resets_table.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('password_resets', function (Blueprint $table) {
15
+        Schema::create('password_resets', function(Blueprint $table) {
16 16
             $table->string('email')->index();
17 17
             $table->string('token')->index();
18 18
             $table->timestamp('created_at');
Please login to merge, or discard this patch.
database/migrations/2016_04_18_092935_create_users_activation_table.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('users_activations', function (Blueprint $table) {
15
+        Schema::create('users_activations', function(Blueprint $table) {
16 16
             $table->engine = 'InnoDB';
17 17
             $table->increments('id');
18 18
             $table->unsignedInteger('user_id');
Please login to merge, or discard this patch.