src/Headzoo/Core/ConfigurableCallable.php
protected function matchesCondition($return, $exception = null)
    {
        $matched  = false;
        foreach($this->conditions as $expression) {
            if ("isExceptionOf" === $expression["compare"]) {
                $matched = Comparator::isInstanceOf($exception, $expression["value"]);
            } else {
                $matched = Comparator::$expression["compare"]($return, $expression["value"]);
            }
            if ($matched) {
                $matched = $expression["action"];
                break;
            }
        }
        
        return $matched;
    }
protected function matchesCondition($return, $exception = null)
    {
        $matched  = false;
        foreach($this->conditions as $expression) {
            if ("isExceptionOf" === $expression["compare"]) {
                $matched = Comparator::isInstanceOf($exception, $expression["value"]);
            } else {
                $matched = Comparator::$expression["compare"]($return, $expression["value"]);
            }
            if ($matched) {
                $matched = $expression["action"];
                break;
            }
        }
        
        return $matched;
    }
protected function matchesCondition ( $ return , $ exception = null ) { $ matched = false ; foreach ( $ this -> conditions as $ expression ) { if ( "isExceptionOf" === $ expression [ "compare" ] ) { $ matched = Comparator :: isInstanceOf ( $ exception , $ expression [ "value" ] ) ; } else { $ matched = Comparator :: $ expression [ "compare" ] ( $ return , $ expression [ "value" ] ) ; } if ( $ matched ) { $ matched = $ expression [ "action" ] ; break ; } } return $ matched ; }
Returns which condition the value matches

@param  mixed     $return    The callable return value or thrown exception
@param  Exception $exception Any exception that was thrown

@return null|string
Returns which condition the value matches