Eloquent\Phony\Matcher\MatcherFactory::adapt PHP Метод

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

Create a new matcher for the supplied value.
public adapt ( mixed $value ) : Eloquent\Phony\Matcher\Matcher
$value mixed The value to create a matcher for.
Результат Eloquent\Phony\Matcher\Matcher The newly created matcher.
    public function adapt($value)
    {
        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);
    }