Passed
Push — master ( 27da09...b75ff6 )
by Einar-Johan
02:43
created
src/HasNestedSets.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -137,14 +137,14 @@  discard block
 block discarded – undo
137 137
     abstract public function isDirty($attributes = null);
138 138
 
139 139
     /**
140
-    * Define an inverse one-to-one or many relationship.
141
-    *
142
-    * @param  string  $related
143
-    * @param  string|null  $foreignKey
144
-    * @param  string|null  $ownerKey
145
-    * @param  string|null  $relation
146
-    * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
147
-    */
140
+     * Define an inverse one-to-one or many relationship.
141
+     *
142
+     * @param  string  $related
143
+     * @param  string|null  $foreignKey
144
+     * @param  string|null  $ownerKey
145
+     * @param  string|null  $relation
146
+     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
147
+     */
148 148
     abstract public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null);
149 149
 
150 150
     /**
@@ -189,30 +189,30 @@  discard block
 block discarded – undo
189 189
 
190 190
 
191 191
     /**
192
-    * Get the parent column name.
193
-    *
194
-    * @return string
195
-    */
192
+     * Get the parent column name.
193
+     *
194
+     * @return string
195
+     */
196 196
     public function getParentColumnName(): string
197 197
     {
198 198
         return $this->parentColumn;
199 199
     }
200 200
 
201 201
     /**
202
-    * Get the table qualified parent column name.
203
-    *
204
-    * @return string
205
-    */
202
+     * Get the table qualified parent column name.
203
+     *
204
+     * @return string
205
+     */
206 206
     public function getQualifiedParentColumnName(): string
207 207
     {
208 208
         return $this->getTable().'.'.$this->getParentColumnName();
209 209
     }
210 210
 
211 211
     /**
212
-    * Get the value of the models "parent_id" field.
213
-    *
214
-    * @return int|string
215
-    */
212
+     * Get the value of the models "parent_id" field.
213
+     *
214
+     * @return int|string
215
+     */
216 216
     public function getParentId()
217 217
     {
218 218
         return $this->getAttribute($this->getparentColumnName());
@@ -378,20 +378,20 @@  discard block
 block discarded – undo
378 378
     }
379 379
 
380 380
     /**
381
-    * Parent relation (self-referential) 1-1.
382
-    *
383
-    * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
384
-    */
381
+     * Parent relation (self-referential) 1-1.
382
+     *
383
+     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
384
+     */
385 385
     public function parent(): BelongsTo
386 386
     {
387 387
         return $this->belongsTo(get_class($this), $this->getParentColumnName());
388 388
     }
389 389
 
390 390
     /**
391
-    * Children relation (self-referential) 1-N.
392
-    *
393
-    * @return \Illuminate\Database\Eloquent\Relations\HasMany
394
-    */
391
+     * Children relation (self-referential) 1-N.
392
+     *
393
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
394
+     */
395 395
     public function children(): HasMany
396 396
     {
397 397
         return $this->hasMany(get_class($this), $this->getParentColumnName())
@@ -905,11 +905,11 @@  discard block
 block discarded – undo
905 905
     }
906 906
 
907 907
     /**
908
-    * Returns the level of this node in the tree.
909
-    * Root level is 0.
910
-    *
911
-    * @return int
912
-    */
908
+     * Returns the level of this node in the tree.
909
+     * Root level is 0.
910
+     *
911
+     * @return int
912
+     */
913 913
     public function getLevel(): int
914 914
     {
915 915
         if (is_null($this->getParentId())) {
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
     public function isDescendantOf($other): bool
929 929
     {
930 930
         return (
931
-      $this->getLeft() > $other->getLeft() &&
931
+        $this->getLeft() > $other->getLeft() &&
932 932
       $this->getLeft() < $other->getRight() &&
933 933
       $this->inSameScope($other)
934 934
     );
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
     public function isSelfOrDescendantOf($other): bool
944 944
     {
945 945
         return (
946
-      $this->getLeft() >= $other->getLeft() &&
946
+        $this->getLeft() >= $other->getLeft() &&
947 947
       $this->getLeft() < $other->getRight() &&
948 948
       $this->inSameScope($other)
949 949
     );
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
     public function isAncestorOf($other): bool
959 959
     {
960 960
         return (
961
-      $this->getLeft() < $other->getLeft() &&
961
+        $this->getLeft() < $other->getLeft() &&
962 962
       $this->getRight() > $other->getLeft() &&
963 963
       $this->inSameScope($other)
964 964
     );
@@ -973,7 +973,7 @@  discard block
 block discarded – undo
973 973
     public function isSelfOrAncestorOf($other): bool
974 974
     {
975 975
         return (
976
-      $this->getLeft() <= $other->getLeft() &&
976
+        $this->getLeft() <= $other->getLeft() &&
977 977
       $this->getRight() > $other->getLeft() &&
978 978
       $this->inSameScope($other)
979 979
     );
@@ -1345,8 +1345,8 @@  discard block
 block discarded – undo
1345 1345
         ->where($self->getLeftColumnName(), '>', $self->getLeft())
1346 1346
         ->where($self->getRightColumnName(), '<', $self->getRight())
1347 1347
         ->update([
1348
-          $self->getDeletedAtColumn() => null,
1349
-          $self->getUpdatedAtColumn() => $self->{$self->getUpdatedAtColumn()},
1348
+            $self->getDeletedAtColumn() => null,
1349
+            $self->getUpdatedAtColumn() => $self->{$self->getUpdatedAtColumn()},
1350 1350
         ]);
1351 1351
         });
1352 1352
     }
Please login to merge, or discard this patch.