]> BookStack Code Mirror - bookstack/commitdiff
Applied StyleCI changes
authorDan Brown <redacted>
Wed, 29 Sep 2021 22:53:11 +0000 (23:53 +0100)
committerDan Brown <redacted>
Wed, 29 Sep 2021 22:53:11 +0000 (23:53 +0100)
app/Actions/ActivityService.php
app/Auth/Permissions/PermissionService.php
tests/AuditLogTest.php

index f8a0825bbd8794b9ae1c89a5986a21219f08fb02..bc7a6b6b7c3353f39384ae73d88eaca284d5ed41 100644 (file)
@@ -11,7 +11,6 @@ use BookStack\Interfaces\Loggable;
 use Illuminate\Database\Eloquent\Builder;
 use Illuminate\Database\Eloquent\Relations\Relation;
 use Illuminate\Support\Facades\Log;
-use Illuminate\Support\Facades\Request;
 
 class ActivityService
 {
@@ -57,6 +56,7 @@ class ActivityService
     protected function newActivityForUser(string $type): Activity
     {
         $ip = request()->ip() ?? '';
+
         return $this->activity->newInstance()->forceFill([
             'type'     => strtolower($type),
             'user_id'  => user()->id,
index 4fcad554b1e24ba853e1e1dd4f842e09f1be7fe5..139725339717edb04175d64a8e849b0226afe41d 100644 (file)
@@ -642,7 +642,7 @@ class PermissionService
                 $query->whereExists(function ($permissionQuery) use (&$tableDetails, $morphClass) {
                     /** @var Builder $permissionQuery */
                     $permissionQuery->select('id')->from('joint_permissions')
-                        ->whereColumn('joint_permissions.entity_id', '=',  $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])
+                        ->whereColumn('joint_permissions.entity_id', '=', $tableDetails['tableName'] . '.' . $tableDetails['entityIdColumn'])
                         ->where('entity_type', '=', $morphClass)
                         ->where('action', '=', 'view')
                         ->whereIn('role_id', $this->getCurrentUserRoles())
index 9f6576a46dadcf6ba0dab8e8f8342f947d3dcc71..8d13670ca95e85a084a1269d178a9dd088a259bc 100644 (file)
@@ -152,13 +152,13 @@ class AuditLogTest extends TestCase
             'name' => 'Updated page',
             'html' => '<p>Updated content</p>',
         ], [
-            'X-Forwarded-For' => '192.123.45.1'
+            'X-Forwarded-For' => '192.123.45.1',
         ])->assertRedirect($page->refresh()->getUrl());
 
         $this->assertDatabaseHas('activities', [
-            'type' => ActivityType::PAGE_UPDATE,
-            'ip' => '192.123.45.1',
-            'user_id' => $editor->id,
+            'type'      => ActivityType::PAGE_UPDATE,
+            'ip'        => '192.123.45.1',
+            'user_id'   => $editor->id,
             'entity_id' => $page->id,
         ]);
 
@@ -179,13 +179,13 @@ class AuditLogTest extends TestCase
             'html' => '<p>Updated content</p>',
         ], [
             'X-Forwarded-For' => '192.123.45.1',
-            'REMOTE_ADDR' => '192.123.45.2',
+            'REMOTE_ADDR'     => '192.123.45.2',
         ])->assertRedirect($page->refresh()->getUrl());
 
         $this->assertDatabaseHas('activities', [
-            'type' => ActivityType::PAGE_UPDATE,
-            'ip' => '127.0.0.1',
-            'user_id' => $editor->id,
+            'type'      => ActivityType::PAGE_UPDATE,
+            'ip'        => '127.0.0.1',
+            'user_id'   => $editor->id,
             'entity_id' => $page->id,
         ]);
     }