Open roelvanduijnhoven opened 6 years ago
Excuse me; I think this bug was not recently introduced. But matches existing behaviour.
As this will be deprecated; feel free to close.
I'll roll my own wildcard implementation for now that simply consumes the remainder of the path.
Reference for anybody looking for something like what I described:
class MatchEverything implements RouteInterface
{
/** @var array */
private $defaults;
public function __construct(array $defaults)
{
$this->defaults = $defaults;
}
public function getAssembledParams()
{
return [];
}
public static function factory($options = [])
{
return new self($options['defaults'] ?? []);
}
public function match(Request $request, $pathOffset = null)
{
if (!method_exists($request, 'getUri')) {
return null;
}
$remainder = substr($request->getUri()->getPath(), $pathOffset);
return new RouteMatch($this->defaults, strlen($remainder));
}
public function assemble(array $params = [], array $options = [])
{
return '';
}
}
This repository has been closed and moved to laminas/laminas-router; a new issue has been opened at https://github.com/laminas/laminas-router/issues/4.
One can reproduce this using:
Was introduced in https://github.com/zendframework/zend-router/pull/47 by @weierophinney