]> BookStack Code Mirror - bookstack/blobdiff - app/Api/ApiDocsGenerator.php
Standardised laravel validation to be array based
[bookstack] / app / Api / ApiDocsGenerator.php
index 0ed7e6712d3106c93d52478c1b362fa0adbc3cab..3aabfb4cc9fd5eb37770f7c6994f104f508dc97d 100644 (file)
@@ -95,17 +95,13 @@ class ApiDocsGenerator
         }
 
         $rules = $class->getValdationRules()[$methodName] ?? [];
-        foreach ($rules as $param => $ruleString) {
-            $rules[$param] = explode('|', $ruleString);
-        }
-
-        return count($rules) > 0 ? $rules : null;
+        return empty($rules) ? null : $rules;
     }
 
     /**
      * Parse out the description text from a class method comment.
      */
-    protected function parseDescriptionFromMethodComment(string $comment)
+    protected function parseDescriptionFromMethodComment(string $comment): string
     {
         $matches = [];
         preg_match_all('/^\s*?\*\s((?![@\s]).*?)$/m', $comment, $matches);