public function testEndPointsParams() { $data = ['a' => 1, 'b' => 'some']; $this->route->getEndPoint()->setArgs($data); $params = $this->route->getEndPoint()->getArgs(); self::assertEquals($data, $params); }
/** * @param RequestInterface $request * @param Route $route * @return mixed */ public function __invoke(RequestInterface $request, Route $route) { $args = array_filter($route->getMatches(), function ($name) { return strpos($name, '_') !== 0; }, \ARRAY_FILTER_USE_KEY); $route->getEndPoint()->setArgs($args); return $route($request); }