Turn Laravel style ":link" into vue-i18n style "{link}" or vuex-i18n style ":::".

@param string $s
@return string
973597
private function adjustString($s)
    {
        if (!is_string($s)) {
            return $s;
        }

        if ($this->config['i18nLib'] === self::VUEX_I18N) {
            $searchPipePattern = '/(\s)*(\|)(\s)*/';
            $threeColons = ' ::: ';
            $s = preg_replace($searchPipePattern, $threeColons, $s);
        }

        return preg_replace_callback(
            '/(?<!mailto|tel):\w+/',
            function ($matches) {
                return '{' . mb_substr($matches[0], 1) . '}';
            },
            $s
        );
    }
223455
public function decode_uhex($s)
	{
		preg_match_all('/\\\u([0-9a-f]{4})/i', $s, $matches);
		$matches = $matches[count($matches) - 1];
		$map = array();

		foreach ($matches as $match)
		{
			if (!isset($map[$match]))
			{
				$map['\u' . $match] = html_entity_decode('&#' . hexdec($match) . ';', ENT_NOQUOTES, 'UTF-8');
			}
		}

		return str_replace(array_keys($map), $map, $s);
	}
681393
public static function strict($s)
	{
		if (! ReflectionTypeHint::isValid()) return false;
		if (is_null($s)) return $s;
		return preg_replace('/[\x00-\x08\x0B\x0C\x0E-\x1F]+/sSX', '', $s);
	}
707451
public function escapeCss($css)
    {
        $css = $this->toUtf8($css);

        if ($css === '' || ctype_digit($css)) {
            return $css;
        }

        $result = preg_replace_callback('/[^a-z0-9]/iSu', $this->cssMatcher, $css);

        return $this->fromUtf8($result);
    }
728308
public function buildStringLen($s)
    {
        if ($s === NULL) {
            // \xFB (251)
            return "\xFB";
        }

        $l = \strlen($s);

        if ($l <= 250) {
            // this is the only path that is currently used in fact.
            return $this->buildInt1($l) . $s;
        }

        if ($l <= 0xFFFF) {
            // max 2^16: \xFC (252)
            return "\xFC" . $this->buildInt2($l) . $s;
        }

        if ($l <= 0xFFFFFF) {
            // max 2^24: \xFD (253)
            return "\xFD" . $this->buildInt3($l) . $s;
        }

        // max 2^64: \xFE (254)
        return "\xFE" . $this->buildInt8($l) . $s;
    }
1292568
private function transliteratePolish($s)
    {
        $table = array(
        'ą' => 'a',
        'ę' => 'e',
        'ó' => 'o',
        'ć' => 'c',
        'ł' => 'l',
        'ń' => 'n',
        'ś' => 's',
        'ż' => 'z',
        'ź' => 'z',
        'Ó' => 'O',
        'Ć' => 'C',
        'Ł' => 'L',
        'Ś' => 'S',
        'Ż' => 'Z',
        'Ź' => 'Z'
        );
        return strtr($s, $table);
    }
1072550
public static function helpLink($topic): string
    {
        return
            '<a href="#" data-toggle="modal" data-target="#wt-ajax-modal" data-href="' . e(route('help-text', ['topic' => $topic])) . '" title="' . I18N::translate('Help') . '">' .
            view('icons/help') .
            '<span class="sr-only">' . I18N::translate('Help') . '</span>' .
            '</a>';
    }
321812
private function quoteApplicationVersion($s)
    {
        $quotedString = preg_replace('/ {2,}|\s/', ' ', $s);
        $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
        $quotedString = preg_replace('/\\(/', '\\(', $quotedString);
        return $quotedString;
    }
724582
private function formatString($s)
    {
        static $last_tag = null;

        if ($this->m_stack->count() > 0
            && $this->m_stack->top()->isOfType(self::TAG_PRE)
        ) {
            // Do not format text inside of TAG_PRE tags

            return $s;
        }

        /*
         * TODO Replace double-quotes alternately with nice left and right
         * quotes
         */

        if ($last_tag !== null) {
            #echo $last_tag->getName();
        }

        #echo '|' . $s . '|';

        // opening quote
        if ($last_tag !== null && $last_tag->isOfType(self::TAG_INLINE)) {
            $s = preg_replace('/([\s])&quot;/', '\1&raquo;', $s);

            #echo 'without';
        } else {
            $s = preg_replace('/([\s]|^)&quot;/', '\1&raquo;', $s);
        }

        // [X][X] will always be rendered as [S][S], not as [S][E]
        $s = preg_replace('/(&raquo;)&quot;/', '\1&raquo;', $s);

        #echo '<br />';

        // everything else is closing quote
        $s = str_replace('&quot;', '&laquo;', $s);

        $s = str_replace('--', '&ndash;', $s);

        if ($this->m_stack->count() > 0) {
            $last_tag = $this->m_stack->top();
        } else {
            $last_tag = null;
        }

        $e = function ($s) { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); };

        return $e($s);
    }
715449
protected function pathView($s)
    {
        $s = strtolower($s);
        $s = preg_replace('#([.-])(?=[a-z])#', '$1 ', $s);
        $s = ucwords($s);
        $s = str_replace('. ', ':', $s);
        $s = str_replace('- ', '', $s);

        return $s;
    }
665687
public static function base64UrlSafeDecode($s)
    {
        $s = str_replace('_', '/', $s);
        $s = str_replace('-', '+', $s);
        $s = base64_decode($s);
        return ($s);
    }
920530
private function toLowerChars($s)
    {
        $lowerFilter = new \Zend\Filter\StringToLower;
        $lowerFilter->setEncoding('utf-8');
        return $lowerFilter->filter($s);
    }
836302
public static function onlyCharCollection(string $s, string $v) : string
    {
        $pattern = "/[^" . preg_quote($v, "/") . "]/";
        return preg_replace($pattern, "", $s);
    }
588205
public function getUri( $locales = null )
    {
        if ( empty( $locales ) )
        {
            $locales = $this->getMapper()
                            ->getLocale();
        }

        $locales = (array) $locales;
        $uri     = $this->getUriStructure( $locales );

        if ( empty( $uri ) )
        {
            $locale = null;
            $maxQ   = -1;

            foreach ( (array) $locales as $l => $q )
            {
                if ( is_numeric( $l ) )
                {
                    $l = $q;
                    $q = 1;
                }

                if ( $q > $maxQ )
                {
                    $maxQ   = $q;
                    $locale = $l;
                }
            }

            return '/app/' . $locale . '/paragraph/render/' . $this->id;
        }

        return '/' . $uri->safeUri;
    }
1022957
private function action2path($s)
	{
		$s = preg_replace('#(.)(?=[A-Z])#', '$1-', $s);
		$s = strtolower($s);
		$s = rawurlencode($s);
		return $s;
	}
935852
private function quoteApplicationVersion($s) {
	    $quotedString = $this->collapseWhitespace($s);
	    $quotedString = preg_replace('/\\\\/', '\\\\\\\\', $quotedString);
	    $quotedString = preg_replace('/\\(/', '\\(', $quotedString);
	
	    return $quotedString;
    }
783822
public static function convertToInlineCss($strText, $strCssText = null)
    {
        // apply the css inliner
        $objCssInliner = new \TijsVerkoyen\CssToInlineStyles\CssToInlineStyles();

        return $objCssInliner->convert($strText, $strCssText);
    }