src/Matcher.php
public function matches(string $string, string $pattern): bool
    {
        if ($string === $pattern) {
            return true;
        }
        if (!$this->isPattern($pattern)) {
            return false;
        }
        return (bool)preg_match($this->getRegex($pattern), $string);
    }
public function matches(string $string, string $pattern): bool
    {
        if ($string === $pattern) {
            return true;
        }
        if (!$this->isPattern($pattern)) {
            return false;
        }
        return (bool)preg_match($this->getRegex($pattern), $string);
    }
public function matches ( string $ string , string $ pattern ) : bool { if ( $ string === $ pattern ) { return true ; } if ( ! $ this -> isPattern ( $ pattern ) ) { return false ; } return ( bool ) preg_match ( $ this -> getRegex ( $ pattern ) , $ string ) ; }
Checks if string matches given pattent.

@param string $string
@param string $pattern

@return bool
Checks if string matches given pattent .