ZF\Console\Route::match PHP Method

match() public method

If matched, set the matches in the route
public match ( array $params ) : array | null
$params array
return array | null
    public function match($params)
    {
        $matches = parent::match($params);
        if (is_array($matches)) {
            $this->matches = $matches;
        }
        return $matches;
    }

Usage Example

Exemplo n.º 1
0
 public function testGetMatchedParamReturnsDefaultValueIfParameterIsNotMatched()
 {
     $route = new Route('foo', 'foo [<bar>]');
     $matches = $route->match(['foo']);
     $this->assertNull($route->getMatchedParam('bar'));
 }