public function isAllowed(RequestInterface $uri)
    {
        if (preg_match(sprintf('#^%s$#', $this->regexp), $uri->getUri()->getPath())) {
            if (isset($this->assertion)) {
                $assertion = $this->assertion;

                return $assertion();
            } else {
                return true;
            }
        }

        return true;
    }
public function isAllowed(RequestInterface $uri)
    {
        if (preg_match(sprintf('#^%s$#', $this->regexp), $uri->getUri()->getPath())) {
            if (isset($this->assertion)) {
                $assertion = $this->assertion;

                return $assertion();
            } else {
                return true;
            }
        }

        return true;
    }
public function isAllowed ( RequestInterface $ uri ) { if ( preg_match ( sprintf ( '#^%s$#' , $ this -> regexp ) , $ uri -> getUri ( ) -> getPath ( ) ) ) { if ( isset ( $ this -> assertion ) ) { $ assertion = $ this -> assertion ; return $ assertion ( ) ; } else { return true ; } } return true ; }
Check if the guard applies to the request,
then apply the assigned assertion.

@param  \Zend\Stdlib\RequestInterface $uri
@return bool
Check if the guard applies to the request then apply the assigned assertion .