src/Matcher/MatcherFactory.php
public function adapt($value): Matchable
    {
        if ($value instanceof Matchable) {
            return $value;
        }

        if (is_object($value)) {
            foreach ($this->driverIndex as $className => $driver) {
                if (is_a($value, $className)) {
                    return $driver->wrapMatcher($value);
                }
            }
        }

        if ('*' === $value) {
            return $this->wildcardAnyMatcher;
        }

        if ('~' === $value) {
            return $this->anyMatcher;
        }

        return new EqualToMatcher($value, true, $this->exporter);
    }
public function adapt($value): Matchable
    {
        if ($value instanceof Matchable) {
            return $value;
        }

        if (is_object($value)) {
            foreach ($this->driverIndex as $className => $driver) {
                if (is_a($value, $className)) {
                    return $driver->wrapMatcher($value);
                }
            }
        }

        if ('*' === $value) {
            return $this->wildcardAnyMatcher;
        }

        if ('~' === $value) {
            return $this->anyMatcher;
        }

        return new EqualToMatcher($value, true, $this->exporter);
    }
public function adapt ( $ value ) : Matchable { if ( $ value instanceof Matchable ) { return $ value ; } if ( is_object ( $ value ) ) { foreach ( $ this -> driverIndex as $ className => $ driver ) { if ( is_a ( $ value , $ className ) ) { return $ driver -> wrapMatcher ( $ value ) ; } } } if ( '*' === $ value ) { return $ this -> wildcardAnyMatcher ; } if ( '~' === $ value ) { return $ this -> anyMatcher ; } return new EqualToMatcher ( $ value , true , $ this -> exporter ) ; }
Create a new matcher for the supplied value.

@param mixed $value The value to create a matcher for.

@return Matchable The newly created matcher.
Create a new matcher for the supplied value .