zendframework / zend-expressive-hal

Hypertext Application Language implementation for PHP and PSR-7
BSD 3-Clause "New" or "Revised" License
37 stars 22 forks source link

Bad return type for RouteBasedResourceMetadata::setRouteParams() #14

Closed achevillard closed 6 years ago

achevillard commented 7 years ago

Bad return type for Zend\Expressive\Hal\Metadata\RouteBasedResourceMetadata::setRouteParams() method.

Code to reproduce the issue

$metadataMap  = $this->resourceGenerator->getMetadataMap();
$metadata     = $metadataMap->get(Item::class);
$routesParams = array_merge($metadata->getRouteParams(), ['categoryId' => $categoryId]);
$metadata->setRouteParams($routesParams);

Expected results

No error

Actual results

throws TypeError :

Return value of Zend\\Expressive\\Hal\\Metadata\\RouteBasedResourceMetadata::setRouteParams() must be of the type array, none returned
achevillard commented 7 years ago

Hello @weierophinney is it possible to fix this issue? Thanks.