]> BookStack Code Mirror - bookstack/commitdiff
Applied latest StyleCI changes
authorDan Brown <redacted>
Wed, 15 Dec 2021 13:49:20 +0000 (13:49 +0000)
committerDan Brown <redacted>
Wed, 15 Dec 2021 13:49:20 +0000 (13:49 +0000)
app/Http/Controllers/Api/SearchApiController.php
app/Http/Controllers/UserSearchController.php
tests/Api/SearchApiTest.php
tests/User/UserSearchTest.php

index d1c99e21855bd12e70405eb46e7d133e78932fc8..5c4112f743fe76bce24fbb4bfa61110f3445e14a 100644 (file)
@@ -61,7 +61,7 @@ class SearchApiController extends ApiController
             $result->setAttribute('type', $result->getType());
             $result->setAttribute('url', $result->getUrl());
             $result->setAttribute('preview_html', [
-                'name' => (string) $result->getAttribute('preview_name'),
+                'name'    => (string) $result->getAttribute('preview_name'),
                 'content' => (string) $result->getAttribute('preview_content'),
             ]);
         }
index 1a37ca491dc00bbaf6cff29befa2792dc3c1bdbe..df234347c5cfd2151c50df84eb49af1385fdc232 100644 (file)
@@ -14,7 +14,7 @@ class UserSearchController extends Controller
     public function forSelect(Request $request)
     {
         $hasPermission = signedInUser() && (
-                   userCan('users-manage')
+            userCan('users-manage')
                 || userCan('restrictions-manage-own')
                 || userCan('restrictions-manage-all')
         );
index eb323fdd92a0e7267c68179d2dba235814f7a800..1f38c7fd98441b17371273730598e2877c5c98be 100644 (file)
@@ -46,7 +46,7 @@ class SearchApiTest extends TestCase
         $resp = $this->actingAsApiAdmin()->getJson($this->baseEndpoint . '?query=superuniquevalue');
         $resp->assertJsonFragment([
             'type' => 'page',
-            'url' => $page->getUrl(),
+            'url'  => $page->getUrl(),
         ]);
     }
 
@@ -59,12 +59,12 @@ class SearchApiTest extends TestCase
 
         $resp = $this->actingAsApiAdmin()->getJson($this->baseEndpoint . '?query=superuniquevalue');
         $resp->assertJsonFragment([
-            'type' => 'book',
-            'url' => $book->getUrl(),
+            'type'         => 'book',
+            'url'          => $book->getUrl(),
             'preview_html' => [
-                'name' => 'name with <strong>superuniquevalue</strong> within',
+                'name'    => 'name with <strong>superuniquevalue</strong> within',
                 'content' => 'Description with <strong>superuniquevalue</strong> within',
-            ]
+            ],
         ]);
     }
 
index 1bf3f2d296bca3f3bfa5dd1bfb4fa2600a07e8cd..243af1186a2be9e2f5b1e7aceffbc66a475c918a 100644 (file)
@@ -7,7 +7,6 @@ use Tests\TestCase;
 
 class UserSearchTest extends TestCase
 {
-
     public function test_select_search_matches_by_name()
     {
         $viewer = $this->getViewer();
@@ -64,5 +63,4 @@ class UserSearchTest extends TestCase
         $resp = $this->get('/search/users/select?search=a');
         $this->assertPermissionError($resp);
     }
-
-}
\ No newline at end of file
+}