public function check($controller, array $arguments = [])
    {
        if ($this->controller !== $controller) {
            return false;
        }

        foreach ($this->requirements as $key => $regex) {
            $value = isset($arguments[$key]) ? $arguments[$key] : null;

            if (!preg_match('/^' . $regex . '$/i', $value)) {
                return false;
            }
        }

        return true;
    }
public function check($controller, array $arguments = [])
    {
        if ($this->controller !== $controller) {
            return false;
        }

        foreach ($this->requirements as $key => $regex) {
            $value = isset($arguments[$key]) ? $arguments[$key] : null;

            if (!preg_match('/^' . $regex . '$/i', $value)) {
                return false;
            }
        }

        return true;
    }
public function check ( $ controller , array $ arguments = [ ] ) { if ( $ this -> controller !== $ controller ) { return false ; } foreach ( $ this -> requirements as $ key => $ regex ) { $ value = isset ( $ arguments [ $ key ] ) ? $ arguments [ $ key ] : null ; if ( ! preg_match ( '/^' . $ regex . '$/i' , $ value ) ) { return false ; } } return true ; }
Check if route should be used to make url

@param string $controller
@param array  $arguments

@return bool
Check if route should be used to make url