private function addHeaderToOutput(array $data, string $output): array
    {
        if (isset($data['headers']) && \count($data['headers']) !== 0) {
            $output .= 'msgid ""' . $this->eol;
            $output .= 'msgstr ""' . $this->eol;

            foreach ($data['headers'] as $key => $value) {
                if (\is_array($value)) {
                    $first = true;

                    foreach ($value as $h) {
                        if ($first) {
                            $first = false;
                            $output .= \sprintf('"%s: %s"', $key, $h) . $this->eol;
                        } else {
                            $output .= \sprintf('"%s\n"', $h) . $this->eol;
                        }
                    }
                } else {
                    $output .= \sprintf('"%s: %s\n"', $key, $value) . $this->eol;
                }
            }

            unset($data['headers']);

            $output .= $this->eol;
        }

        return [$data, $output];
    }
private function addHeaderToOutput(array $data, string $output): array
    {
        if (isset($data['headers']) && \count($data['headers']) !== 0) {
            $output .= 'msgid ""' . $this->eol;
            $output .= 'msgstr ""' . $this->eol;

            foreach ($data['headers'] as $key => $value) {
                if (\is_array($value)) {
                    $first = true;

                    foreach ($value as $h) {
                        if ($first) {
                            $first = false;
                            $output .= \sprintf('"%s: %s"', $key, $h) . $this->eol;
                        } else {
                            $output .= \sprintf('"%s\n"', $h) . $this->eol;
                        }
                    }
                } else {
                    $output .= \sprintf('"%s: %s\n"', $key, $value) . $this->eol;
                }
            }

            unset($data['headers']);

            $output .= $this->eol;
        }

        return [$data, $output];
    }
private function addHeaderToOutput ( array $ data , string $ output ) : array { if ( isset ( $ data [ 'headers' ] ) && \ count ( $ data [ 'headers' ] ) !== 0 ) { $ output .= 'msgid ""' . $ this -> eol ; $ output .= 'msgstr ""' . $ this -> eol ; foreach ( $ data [ 'headers' ] as $ key => $ value ) { if ( \ is_array ( $ value ) ) { $ first = true ; foreach ( $ value as $ h ) { if ( $ first ) { $ first = false ; $ output .= \ sprintf ( '"%s: %s"' , $ key , $ h ) . $ this -> eol ; } else { $ output .= \ sprintf ( '"%s\n"' , $ h ) . $ this -> eol ; } } } else { $ output .= \ sprintf ( '"%s: %s\n"' , $ key , $ value ) . $ this -> eol ; } } unset ( $ data [ 'headers' ] ) ; $ output .= $ this -> eol ; } return [ $ data , $ output ] ; }
Adds a header to the output.

@param array  $data
@param string $output

@throws \Viserio\Component\Contract\Parser\Exception\DumpException

@return array
Adds a header to the output .