Skip to content

Commit

Permalink
zfcampus#65 Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
tasselchof committed Feb 20, 2018
1 parent 26cf4e0 commit ce2428d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/View/AgAcceptHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ class AgAcceptHeaders extends AbstractHelper
*/
public function __invoke(Service $service)
{
$requestAcceptTypes = $service->getRequestAcceptTypes();
if (empty($requestAcceptTypes)) {
$requestAcceptTypes = [];
}

$view = $this->getView();
$types = array_map(function ($type) use ($view) {
return sprintf('<div class="list-group-item">%s</div>', $view->escapeHtml($type));
}, $service->getRequestAcceptTypes());
}, $requestAcceptTypes);
return implode("\n", $types);
}
}
7 changes: 6 additions & 1 deletion src/View/AgContentTypeHeaders.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ class AgContentTypeHeaders extends AbstractHelper
*/
public function __invoke(Service $service)
{
$requestContentTypes = [];
if (!empty($service->getRequestContentTypes())) {
$requestContentTypes = $service->getRequestContentTypes();
}

$view = $this->getView();
$types = array_map(function ($type) use ($view) {
return sprintf('<div class="list-group-item">%s</div>', $view->escapeHtml($type));
}, $service->getRequestContentTypes());
}, $requestContentTypes);
return implode("\n", $types);
}
}

0 comments on commit ce2428d

Please sign in to comment.