Skip to content

Commit

Permalink
Merge pull request #98 from mpociot/analysis-zOLpQR
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
mpociot authored Sep 14, 2016
2 parents 82368fb + ae8994f commit 2b98967
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Mpociot/ApiDoc/Generators/AbstractGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/Mpociot/ApiDoc/Generators/DingoGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand Down
2 changes: 1 addition & 1 deletion tests/GenerateDocumentationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function testCanAppendCustomHttpHeaders()
'--header' => [
'Authorization: customAuthToken',
'X-Custom-Header: foobar',
]
],
]);

$generatedMarkdown = file_get_contents(__DIR__.'/../public/docs/source/index.md');
Expand Down

0 comments on commit 2b98967

Please sign in to comment.