src/Webiny/Hrc/Hrc.php
public function getMatchedRule($cacheRule = null)
    {
        $request = $this->getRequest();

        if (!empty($cacheRule)) {
            if (isset($this->cacheRules[$cacheRule])) {
                $cr = $this->cacheRules[$cacheRule];
                $cacheKey = $cr->match($request);

                return new MatchedRule(clone $cr, $cacheKey);
            }
        } else {
            foreach ($this->cacheRules as $cr) {
                if (($cacheKey = $cr->match($request))) {
                    return new MatchedRule(clone $cr, $cacheKey);
                }
            }
        }


        return false;
    }
public function getMatchedRule($cacheRule = null)
    {
        $request = $this->getRequest();

        if (!empty($cacheRule)) {
            if (isset($this->cacheRules[$cacheRule])) {
                $cr = $this->cacheRules[$cacheRule];
                $cacheKey = $cr->match($request);

                return new MatchedRule(clone $cr, $cacheKey);
            }
        } else {
            foreach ($this->cacheRules as $cr) {
                if (($cacheKey = $cr->match($request))) {
                    return new MatchedRule(clone $cr, $cacheKey);
                }
            }
        }


        return false;
    }
public function getMatchedRule ( $ cacheRule = null ) { $ request = $ this -> getRequest ( ) ; if ( ! empty ( $ cacheRule ) ) { if ( isset ( $ this -> cacheRules [ $ cacheRule ] ) ) { $ cr = $ this -> cacheRules [ $ cacheRule ] ; $ cacheKey = $ cr -> match ( $ request ) ; return new MatchedRule ( clone $ cr , $ cacheKey ) ; } } else { foreach ( $ this -> cacheRules as $ cr ) { if ( ( $ cacheKey = $ cr -> match ( $ request ) ) ) { return new MatchedRule ( clone $ cr , $ cacheKey ) ; } } } return false ; }
Returns a MatchedRule instance of the matched cache rule.

@return bool|MatchedRule MatchedRule instance. or false if no cache rule matched the request.
Returns a MatchedRule instance of the matched cache rule .