]> BookStack Code Mirror - bookstack/commitdiff
Applied latest StyleCI changes
authorDan Brown <redacted>
Mon, 25 Apr 2022 17:42:31 +0000 (18:42 +0100)
committerDan Brown <redacted>
Mon, 25 Apr 2022 17:42:31 +0000 (18:42 +0100)
app/Entities/Models/Deletion.php
app/Http/Controllers/Api/RecycleBinApiController.php
database/migrations/2022_04_25_140741_update_polymorphic_types.php
tests/Api/RecycleBinApiTest.php

index 101a138d1ce2185e2623fa03f664299252771f73..25f0ea6db7f84478fe2e7d30fe45c1145ab5c55b 100644 (file)
@@ -10,10 +10,10 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo;
 use Illuminate\Database\Eloquent\Relations\MorphTo;
 
 /**
- * @property int $id
- * @property int $deleted_by
- * @property string $deletable_type
- * @property int $deletable_id
+ * @property int       $id
+ * @property int       $deleted_by
+ * @property string    $deletable_type
+ * @property int       $deletable_id
  * @property Deletable $deletable
  */
 class Deletion extends Model implements Loggable
index bbe19bd86ec383658f28172ded1f29d9fa73b311..f327bae93f4918749a4163132e9320f9e636ad9c 100644 (file)
@@ -71,7 +71,7 @@ class RecycleBinApiController extends ApiController
     protected function listFormatter(Deletion $deletion)
     {
         $deletable = $deletion->deletable;
-        $withTrashedQuery = fn(Builder $query) => $query->withTrashed();
+        $withTrashedQuery = fn (Builder $query) => $query->withTrashed();
 
         if ($deletable instanceof BookChild) {
             $parent = $deletable->getParent();
index 4645ab2dba12a97657d6ff3cef43ac7675d9fbd5..9f312bf75ac3a023aa1a8db0ba102c559c0c9b7a 100644 (file)
@@ -19,15 +19,15 @@ class UpdatePolymorphicTypes extends Migration
      * Mapping of tables and columns that contain polymorphic types.
      */
     protected $columnsByTable = [
-        'activities' => 'entity_type',
-        'comments'   => 'entity_type',
-        'deletions'  => 'deletable_type',
+        'activities'         => 'entity_type',
+        'comments'           => 'entity_type',
+        'deletions'          => 'deletable_type',
         'entity_permissions' => 'restrictable_type',
-        'favourites' => 'favouritable_type',
-        'joint_permissions' => 'entity_type',
-        'search_terms' => 'entity_type',
-        'tags' => 'entity_type',
-        'views' => 'viewable_type',
+        'favourites'         => 'favouritable_type',
+        'joint_permissions'  => 'entity_type',
+        'search_terms'       => 'entity_type',
+        'tags'               => 'entity_type',
+        'views'              => 'viewable_type',
     ];
 
     /**
index 05c896bd9632a47f9da1e9f546e4f79b46cb5321..83cd82480310a137c5e7313c2eab41f6320ca6d2 100644 (file)
@@ -125,9 +125,9 @@ class RecycleBinApiTest extends TestCase
                     'parent' => [
                         'id'   => $page->chapter->id,
                         'name' => $page->chapter->name,
-                        'type' => 'chapter'
-                    ]
-                ]
+                        'type' => 'chapter',
+                    ],
+                ],
             ],
         ];
 
@@ -152,7 +152,7 @@ class RecycleBinApiTest extends TestCase
 
         $resp = $this->putJson($this->baseEndpoint . '/' . $deletion->id);
         $resp->assertJson([
-            'restore_count' => 1
+            'restore_count' => 1,
         ]);
 
         $this->assertDatabaseHas('pages', [
@@ -176,7 +176,7 @@ class RecycleBinApiTest extends TestCase
 
         $resp = $this->deleteJson($this->baseEndpoint . '/' . $deletion->id);
         $resp->assertJson([
-            'delete_count' => 1
+            'delete_count' => 1,
         ]);
 
         $this->assertDatabaseMissing('pages', ['id' => $page->id]);