]> BookStack Code Mirror - bookstack/blobdiff - app/Entities/Tools/SearchOptions.php
Applied StyleCI changes, added php/larastan to attribution
[bookstack] / app / Entities / Tools / SearchOptions.php
index 7913e096979e63174bfe6a36e3e104e31f8c9776..39074fb3862e57ed43d5731c8224dab45954ed12 100644 (file)
@@ -29,10 +29,10 @@ class SearchOptions
     /**
      * Create a new instance from a search string.
      */
-    public static function fromString(string $search): SearchOptions
+    public static function fromString(string $search): self
     {
         $decoded = static::decode($search);
-        $instance = new static();
+        $instance = new SearchOptions();
         foreach ($decoded as $type => $value) {
             $instance->$type = $value;
         }
@@ -45,7 +45,7 @@ class SearchOptions
      * Will look for a classic string term and use that
      * Otherwise we'll use the details from an advanced search form.
      */
-    public static function fromRequest(Request $request): SearchOptions
+    public static function fromRequest(Request $request): self
     {
         if (!$request->has('search') && !$request->has('term')) {
             return static::fromString('');
@@ -55,7 +55,7 @@ class SearchOptions
             return static::fromString($request->get('term'));
         }
 
-        $instance = new static();
+        $instance = new SearchOptions();
         $inputs = $request->only(['search', 'types', 'filters', 'exact', 'tags']);
         $instance->searches = explode(' ', $inputs['search'] ?? []);
         $instance->exacts = array_filter($inputs['exact'] ?? []);