public static function prepare(string $string, $quotes = '/') : string
    {
        $string = $quotes ? preg_quote($string, $quotes) : $string;

        return str_replace(
            array_keys(self::REGEX_CHARS_REPLACEMENT),
            array_values(self::REGEX_CHARS_REPLACEMENT),
            $string
        );
    }
public static function prepare(string $string, $quotes = '/') : string
    {
        $string = $quotes ? preg_quote($string, $quotes) : $string;

        return str_replace(
            array_keys(self::REGEX_CHARS_REPLACEMENT),
            array_values(self::REGEX_CHARS_REPLACEMENT),
            $string
        );
    }
public static function prepare ( string $ string , $ quotes = '/' ) : string { $ string = $ quotes ? preg_quote ( $ string , $ quotes ) : $ string ; return str_replace ( array_keys ( self :: REGEX_CHARS_REPLACEMENT ) , array_values ( self :: REGEX_CHARS_REPLACEMENT ) , $ string ) ; }
Prepare string to be safety used in regex

@param string $string
@param string $quotes

@return string
Prepare string to be safety used in regex