kahlan\Arg::match PHP Метод

match() публичный Метод

Check if $actual matches the matcher.
public match ( $actual ) : boolean
Результат boolean Returns `true` on success and `false` otherwise.
    public function match($actual)
    {
        $matcher = null;
        foreach ($this->_matchers as $target => $value) {
            if (!$target) {
                $matcher = $value;
                continue;
            }
            if ($actual instanceof $target) {
                $matcher = $value;
            }
        }
        if (!$matcher) {
            throw new Exception("Unexisting matcher attached to `'{$this->_name}'` for `{$target}`.");
        }
        $args = $this->_args;
        array_unshift($args, $actual);
        $boolean = call_user_func_array($matcher . '::match', $args);
        return $this->_not ? !$boolean : $boolean;
    }