Get headers for the current file extension.

@param string $content

@return array
543660
public function getHeaders(string $content): array
    {
        \preg_match_all('/(?<=["\'])[^="\']*\.css(\.gzi?p?)?(\?\d*)?(?=["\'])/', $content, $cssFiles);
        $paths = $this->streamlineFilePaths((array)$cssFiles[0]);

        return $this->mapPathsWithType($paths, 'style');
    }
1153918
private function guessContentType($content)
    {
        $fileInfo = new \finfo(FILEINFO_MIME_TYPE);

        if (is_resource($content)) {
            return $fileInfo->file(stream_get_meta_data($content)['uri']);
        }

        return $fileInfo->buffer($content);
    }
372083
public function doShortcode($content)
    {
        if (false === strpos($content, '[')) {
            return $content;
        }

        if (empty($this->_shortcodes) || !is_array($this->_shortcodes))
            return $content;

        /**
         * Clear content from ignore blocks
         */
        $pattern = $this->getIgnorePattern();
        $content = preg_replace_callback("~$pattern~isu", ['self', '_stack'], $content);

        /**
         * parse nested
         */
        $content = $this->parseContent($content);

        /**
         * Replase shorcodes in content
         */
        $content = strtr($content, self::_stack());

        return $content;
    }
1347549
protected function _parseHelpersInContent($content) {
		preg_match_all('/\$this-\>([A-Z][A-Za-z]+)-\>/', $content, $matches);
		if (empty($matches[1])) {
			return [];
		}

		$helpers = array_unique($matches[1]);

		return $helpers;
	}
1149853
static public function getFileExt($content)
    {
        $types = array(
            255216 => 'jpg', 7173 => 'gif', 6677 => 'bmp', 13780 => 'png',
            7368   => 'mp3', 4838 => 'wma', 7784 => 'mid', 6063 => 'xml',
        );
        $typeInfo = @unpack("C2chars", substr($content, 0, 2));
        $typeCode = intval($typeInfo['chars1'] . $typeInfo['chars2']);
        return isset($types[$typeCode]) ? $types[$typeCode] : 'mp4';
    }
1254407
protected function formatContent($content)
    {
        $searches = array(
            '{{filename}}',
            '{{namespace}}',
            '{{className}}',
        );

        $replaces = array(
            $this->data['filename'],
            $this->data['namespace'],
            $this->data['className'],
        );

        return str_replace($searches, $replaces, $content);
    }
1294633
public static function get_content_value($content) {
        $arr = explode('##', $content->content);

        $strvalue = '';
        foreach ($arr as $a) {
            $strvalue .= $a . ' ';
        }

        return trim($strvalue, "\r\n ");
    }
564785
public function getSerializedContent($content)
    {
        $serializationContext = clone $this->serializationContext;

        return $this->serializer->serialize(
            $content,
            'json',
            $serializationContext
        );
    }
562168
public function getFilename($content)
    {
        $doc = $this->reader->parseToDocument($content);
        $this->reader->loadXpathFromDoc($doc);

        $nameType = $doc->documentElement->localName;
        $ruc = $this->getRuc($nameType);
        $document = $this->reader->getValue('cbc:ID');

        $type = $this->getTypeFromDoc($nameType);
        if (empty($type)) {
            return $ruc.self::CONCAT_CHR.$document;
        }

        return implode(self::CONCAT_CHR, [$ruc, $type, $document]);
    }
1259385
private function parseResponse($content) {
        
        list ( $headerStr, $body ) = explode("\r\n\r\n", $content, 2);
        
        $header = array ();
        
        $headerPart = explode("\r\n", $headerStr);
        
        list ( $httpProtocol, $statusCode, $statStr ) = explode(' ', array_shift($headerPart), 3);
        
        foreach ( $headerPart as $item ) {
            list ( $key, $value ) = explode(':', $item);
            $header [$key] = $value;
        }
        
        $result = array (
            'protocol' => $httpProtocol,
            'status' => intval($statusCode),
            'statusMsg' => $statStr,
            'header' => $header,
            'content' => $body, 
        );
        
        return $result;
    }
161481
private function buildHeader(string $content): string
    {
        $header = "POST " . static::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
        $header .= "Host: " . static::FLEEP_HOST . "\r\n";
        $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
        $header .= "Content-Length: " . strlen($content) . "\r\n";
        $header .= "\r\n";

        return $header;
    }
993341
public static function extractImports($content)
    {
        $imports = array();
        static::filterImports($content, function($matches) use(& $imports) {
            $imports[] = $matches['url'];
        });

        return array_unique($imports);
    }
619785
private function getTokenisedContent(string $content)
    {

        $tokens = token_get_all($content);


        $tokenised_content = array();
        $tokenised_content = $this->addToken($tokenised_content, $tokens, $content);

        return $tokenised_content;

    }
211764
public function append_modules_content( string $content ) : string {

		global $more, $post;
		$flexible_content = '';

		// Remove current filter to avoid recursive loop.
		remove_filter( 'the_content', [ $this, 'append_modules_content' ], $this->_the_content_priority );

		if ( $this->is_current_post_flexible( $post, $more ) ) {
			$flexible_content = $this->get_modules_content( $post );
		}

		// Re-add filter after parsing content.
		add_filter( 'the_content', [ $this, 'append_modules_content' ], $this->_the_content_priority, 1 );

		return $content . $flexible_content;
	}
314315
private function parseContent($content = '')
    {

        list($time, $content) = explode("#", $content);
        return [
            $time, gzuncompress($content)
        ];

    }
254833
public function parseNoTemplate($content) {
        $this->_content = $content;
        $this->_parseDebugStart();
        $this->_parseExtend();
        $this->_parseInclude();
        $this->_parsePath();
        $this->_parseGravatar();
        $this->_parseAsset();
        $this->_parseUrl();
        $this->_parsePhp();
        $this->_parseLang();
        $this->_parseForeach();
        $this->_parseFor();
        $this->_parseVar();
        $this->_parseVarFunc();
        $this->_parseCondition();
        $this->_parseFunction();
        $this->_parseException();
        $this->_parseMinify();
        $this->_parseDebugEnd();

        return $this->_content;
    }
861071
public function tokenize(string $content) : array
    {
        $tokens   = $this->getGrammar()->getTokens();
        $numerals = array_flip($tokens);

        $length   = strlen($content);
        $position = 0;
        $result   = [];

        while ($position < $length) {
            $current = $content[$position];

            if (! isset($numerals[$current])) {
                $exception = new Exception(
                    sprintf('Unknown token "%s" at position %d', $current, $position),
                    Exception::UNKNOWN_TOKEN
                );

                $exception
                    ->setToken($current)
                    ->setPosition($position);

                throw $exception;
            }

            $result[] = $current;
            $position = $position + 1;
        }

        return $result;
    }