src/I18n/Gettext/Utils/HeadersExtractorTrait.php
private static function extractHeaders($headers, Translations $translations)
    {
        $headers = explode("\n", $headers);
        $currentHeader = null;

        foreach ($headers as $line) {
            $line = self::convertString($line);

            if ($line === '') {
                continue;
            }

            if (self::isHeaderDefinition($line)) {
                $header = \array_map('\trim', \explode(':', $line, 2));
                $currentHeader = $header[0];
                $translations->setHeader($currentHeader, $header[1]);
            } else {
                $entry = $translations->getHeader($currentHeader);
                $translations->setHeader($currentHeader, $entry.$line);
            }
        }
    }
private static function extractHeaders($headers, Translations $translations)
    {
        $headers = explode("\n", $headers);
        $currentHeader = null;

        foreach ($headers as $line) {
            $line = self::convertString($line);

            if ($line === '') {
                continue;
            }

            if (self::isHeaderDefinition($line)) {
                $header = \array_map('\trim', \explode(':', $line, 2));
                $currentHeader = $header[0];
                $translations->setHeader($currentHeader, $header[1]);
            } else {
                $entry = $translations->getHeader($currentHeader);
                $translations->setHeader($currentHeader, $entry.$line);
            }
        }
    }
private static function extractHeaders ( $ headers , Translations $ translations ) { $ headers = explode ( "\n" , $ headers ) ; $ currentHeader = null ; foreach ( $ headers as $ line ) { $ line = self :: convertString ( $ line ) ; if ( $ line === '' ) { continue ; } if ( self :: isHeaderDefinition ( $ line ) ) { $ header = \ array_map ( '\trim' , \ explode ( ':' , $ line , 2 ) ) ; $ currentHeader = $ header [ 0 ] ; $ translations -> setHeader ( $ currentHeader , $ header [ 1 ] ) ; } else { $ entry = $ translations -> getHeader ( $ currentHeader ) ; $ translations -> setHeader ( $ currentHeader , $ entry . $ line ) ; } } }
Add the headers found to the translations instance.

@param string       $headers
@param Translations $translations
Add the headers found to the translations instance .