Completed
Pull Request — master (#47)
by Şəhriyar
34:50
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/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.
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.
app/Notifications/ResetPasswordNotification.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     /**
32 32
      * Get the notification's delivery channels.
33 33
      *
34
-     * @return array
34
+     * @return string[]
35 35
      */
36 36
     public function via()
37 37
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Bus\Queueable;
6 6
 use Illuminate\Notifications\Notification;
7
-use Illuminate\Contracts\Queue\ShouldQueue;
8 7
 use Illuminate\Notifications\Messages\MailMessage;
9 8
 
10 9
 class ResetPasswordNotification extends Notification
Please login to merge, or discard this patch.
database/factories/ModelFactory.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
 
14 14
 /** @var \Illuminate\Database\Eloquent\Factory $factory */
15
-$factory->define(App\Models\User::class, function (Faker\Generator $faker) {
15
+$factory->define(App\Models\User::class, function(Faker\Generator $faker) {
16 16
     static $password;
17 17
 
18 18
     return [
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/PasswordController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         $validator = app('validator')->make($request->all(), [
106 106
             'token' => 'required|string',
107 107
             'email' => 'required|email|max:255',
108
-            'password' => 'required|confirmed|min:' . app('config')->get('auth.passwords.users.min_length')
108
+            'password' => 'required|confirmed|min:'.app('config')->get('auth.passwords.users.min_length')
109 109
         ]);
110 110
         if ($validator->fails()) {
111 111
             throw new ValidationException($validator);
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 
116 116
         $passwordBroker = app('auth.password.broker');
117 117
         $response = $passwordBroker->reset(
118
-            $credentials, function (User $user, $password) {
118
+            $credentials, function(User $user, $password) {
119 119
             $user->password = app('hash')->make($password);
120 120
             $user->save();
121 121
             app('auth.driver')->login($user);
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.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
         $validator = app('validator')->make($request->all(), [
44 44
             'name' => 'sometimes|required|max:255',
45 45
             'email' => 'required|email|max:255|unique:users',
46
-            'password' => 'required|confirmed|min:' . config('auth.passwords.users.min_length'),
46
+            'password' => 'required|confirmed|min:'.config('auth.passwords.users.min_length'),
47 47
         ]);
48 48
         if ($validator->fails()) {
49 49
             throw new ValidationException($validator);
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public function __construct()
26 26
     {
27 27
         if (!empty($locale = app('translator')->getLocale()) && $locale != app('config')->get('app.locale')) {
28
-            $this->redirectTo = '/' . $locale . $this->redirectTo;
28
+            $this->redirectTo = '/'.$locale.$this->redirectTo;
29 29
         }
30 30
 
31 31
         $this->middleware('guest', ['except' => 'logout']);
Please login to merge, or discard this patch.