From ae8994f2fd4e1ad94d28b1f1083634822ed25988 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Wed, 14 Sep 2016 09:43:28 +0000 Subject: [PATCH] Applied fixes from StyleCI --- src/Mpociot/ApiDoc/Generators/AbstractGenerator.php | 3 ++- src/Mpociot/ApiDoc/Generators/DingoGenerator.php | 4 ++-- tests/GenerateDocumentationTest.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Mpociot/ApiDoc/Generators/AbstractGenerator.php b/src/Mpociot/ApiDoc/Generators/AbstractGenerator.php index 9231bea1..94d1bf40 100644 --- a/src/Mpociot/ApiDoc/Generators/AbstractGenerator.php +++ b/src/Mpociot/ApiDoc/Generators/AbstractGenerator.php @@ -70,8 +70,9 @@ protected function getRouteResponse($route, $bindings, $headers = []) $methods = $route->getMethods(); // Split headers into key - value pairs - $headers = collect($headers)->map(function($value) { + $headers = collect($headers)->map(function ($value) { $split = explode(':', $value); + return [trim($split[0]) => trim($split[1])]; })->collapse()->toArray(); diff --git a/src/Mpociot/ApiDoc/Generators/DingoGenerator.php b/src/Mpociot/ApiDoc/Generators/DingoGenerator.php index 4b3a4862..634ed2dd 100644 --- a/src/Mpociot/ApiDoc/Generators/DingoGenerator.php +++ b/src/Mpociot/ApiDoc/Generators/DingoGenerator.php @@ -47,8 +47,8 @@ public function processRoute($route, $bindings = [], $headers = [], $withRespons public function callRoute($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null) { $dispatcher = app('Dingo\Api\Dispatcher')->raw(); - - collect($server)->map(function($key, $value) use ($dispatcher) { + + collect($server)->map(function ($key, $value) use ($dispatcher) { $dispatcher->header($key, $value); }); diff --git a/tests/GenerateDocumentationTest.php b/tests/GenerateDocumentationTest.php index 44b56cb9..737f8337 100644 --- a/tests/GenerateDocumentationTest.php +++ b/tests/GenerateDocumentationTest.php @@ -129,7 +129,7 @@ public function testCanAppendCustomHttpHeaders() '--header' => [ 'Authorization: customAuthToken', 'X-Custom-Header: foobar', - ] + ], ]); $generatedMarkdown = file_get_contents(__DIR__.'/../public/docs/source/index.md');