public function canAccept(self $arguments): bool
    {
        if ($this->values === null) {
            return true;
        }

        if ($this->equal($arguments)) {
            return true;
        }

        $values = $arguments->getValues();
        if ($values === null) {
            return false;
        }

        if (count($this->values) !== count($values)) {
            return false;
        }

        foreach ($values as $key => $actual) {
            $expected = $this->values[$key];

            if ($expected === $actual) {
                continue;
            }

            if ($expected instanceof MatcherAbstract) {
                if ($expected->match($actual)) {
                    continue;
                }
            }

            # If we couldn't find a match for this argument then give up
            return false;
        }

        return true;
    }
public function canAccept(self $arguments): bool
    {
        if ($this->values === null) {
            return true;
        }

        if ($this->equal($arguments)) {
            return true;
        }

        $values = $arguments->getValues();
        if ($values === null) {
            return false;
        }

        if (count($this->values) !== count($values)) {
            return false;
        }

        foreach ($values as $key => $actual) {
            $expected = $this->values[$key];

            if ($expected === $actual) {
                continue;
            }

            if ($expected instanceof MatcherAbstract) {
                if ($expected->match($actual)) {
                    continue;
                }
            }

            # If we couldn't find a match for this argument then give up
            return false;
        }

        return true;
    }
public function canAccept ( self $ arguments ) : bool { if ( $ this -> values === null ) { return true ; } if ( $ this -> equal ( $ arguments ) ) { return true ; } $ values = $ arguments -> getValues ( ) ; if ( $ values === null ) { return false ; } if ( count ( $ this -> values ) !== count ( $ values ) ) { return false ; } foreach ( $ values as $ key => $ actual ) { $ expected = $ this -> values [ $ key ] ; if ( $ expected === $ actual ) { continue ; } if ( $ expected instanceof MatcherAbstract ) { if ( $ expected -> match ( $ actual ) ) { continue ; } } # If we couldn't find a match for this argument then give up return false ; } return true ; }
Check if the specified arguments are acceptable as a match for the expected arguments.

@param self $arguments The arguments to check

@return bool
Check if the specified arguments are acceptable as a match for the expected arguments .