ソースを参照

Merge pull request #577 from mpociot/analysis-86yg6o

Apply fixes from StyleCI
Marcel Pociot 5 年 前
コミット
44bdabe19e

+ 1 - 1
src/Tools/Generator.php

@@ -175,7 +175,7 @@ class Generator
 
     /**
      * For each array notation parameter (eg user.*, item.*.name, object.*.*, user[])
-     * generate concrete sample (user.0, item.0.name, object.0.0, user.0) with example as value
+     * generate concrete sample (user.0, item.0.name, object.0.0, user.0) with example as value.
      *
      * @param string $paramName
      * @param mixed $paramExample

+ 2 - 1
src/Tools/RouteDocBlocker.php

@@ -13,8 +13,9 @@ class RouteDocBlocker
     /**
      * @param Route $route
      *
-     * @return array<string, DocBlock> Method and class docblocks
      * @throws \ReflectionException
+     *
+     * @return array<string, DocBlock> Method and class docblocks
      */
     public static function getDocBlocksFromRoute(Route $route): array
     {

+ 2 - 5
src/Tools/Traits/DocBlockParamHelpers.php

@@ -2,9 +2,6 @@
 
 namespace Mpociot\ApiDoc\Tools\Traits;
 
-use Faker\Factory;
-use Illuminate\Support\Arr;
-use Illuminate\Support\Str;
 use Mpociot\Reflection\DocBlock\Tag;
 
 trait DocBlockParamHelpers
@@ -19,7 +16,7 @@ trait DocBlockParamHelpers
      *
      * @return bool Whether no example should be generated
      */
-    protected  function shouldExcludeExample(Tag $tag)
+    protected function shouldExcludeExample(Tag $tag)
     {
         return strpos($tag->getContent(), ' No-example') !== false;
     }
@@ -33,7 +30,7 @@ trait DocBlockParamHelpers
      *
      * @return array The description and included example.
      */
-    protected  function parseParamDescription(string $description, string $type)
+    protected function parseParamDescription(string $description, string $type)
     {
         $example = null;
         if (preg_match('/(.*)\s+Example:\s*(.*)\s*/', $description, $content)) {

+ 2 - 2
src/Tools/Traits/ParamHelpers.php

@@ -6,7 +6,7 @@ use Faker\Factory;
 
 trait ParamHelpers
 {
-    protected  function generateDummyValue(string $type)
+    protected function generateDummyValue(string $type)
     {
         $faker = Factory::create();
         if ($this->config->get('faker_seed')) {
@@ -49,7 +49,7 @@ trait ParamHelpers
      *
      * @return mixed
      */
-    protected  function castToType(string $value, string $type)
+    protected function castToType(string $value, string $type)
     {
         $casts = [
             'integer' => 'intval',