public function setPattern($pattern)
    {
        if (gettype($pattern) === 'string') {
            $this->pattern = $pattern;
        } else {
            $msg = "The pattern argument must be a string or a variable reference, '" . $pattern . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setPattern($pattern)
    {
        if (gettype($pattern) === 'string') {
            $this->pattern = $pattern;
        } else {
            $msg = "The pattern argument must be a string or a variable reference, '" . $pattern . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
public function setPattern ( $ pattern ) { if ( gettype ( $ pattern ) === 'string' ) { $ this -> pattern = $ pattern ; } else { $ msg = "The pattern argument must be a string or a variable reference, '" . $ pattern . "' given." ; throw new InvalidArgumentException ( $ msg ) ; } }
Set the pattern to match.

@param string $pattern A pattern or a variable reference.
@throws \InvalidArgumentException If $pattern is not a string value.
Set the pattern to match .