Twitter_Autolink::_addLinksToCashtags PHP Метод

_addLinksToCashtags() защищенный Метод

Callback used by the method that adds links to cashtags.
См. также: addLinksToCashtags()
protected _addLinksToCashtags ( array $matches ) : string
$matches array The regular expression matches.
Результат string The link-wrapped cashtag.
    protected function _addLinksToCashtags($matches)
    {
        list($all, $before, $cash, $tag, $after) = array_pad($matches, 5, '');
        if (preg_match(self::$patterns['end_cashtag_match'], $after) || !preg_match('!\\A["\']!', $before) && preg_match('!\\A["\']!', $after) || preg_match('!\\A</!', $after)) {
            return $all;
        }
        $replacement = $before;
        $element = $cash . $tag;
        $url = $this->url_base_cash . $tag;
        $replacement .= $this->wrapHash($url, $this->class_cash, $element);
        return $replacement;
    }