private static function isHeader(array $entry): bool
    {
        $headerKeys = [
            'Project-Id-Version' => false,
            'PO-Revision-Date'   => false,
            'MIME-Version'       => false,
        ];

        $keys        = \array_keys($headerKeys);
        $headerItems = 0;
        $headers     = \array_map('trim', $entry['msgstr']);

        foreach ($headers as $header) {
            \preg_match_all('/(.*):\s/', $header, $matches, \PREG_SET_ORDER);

            if (isset($matches[0]) && \in_array($matches[0][1], $keys, true)) {
                $headerItems++;

                unset($headerKeys[$matches[0][1]]);

                $keys = \array_keys($headerKeys);
            }
        }

        return $headerItems !== 0;
    }
private static function isHeader(array $entry): bool
    {
        $headerKeys = [
            'Project-Id-Version' => false,
            'PO-Revision-Date'   => false,
            'MIME-Version'       => false,
        ];

        $keys        = \array_keys($headerKeys);
        $headerItems = 0;
        $headers     = \array_map('trim', $entry['msgstr']);

        foreach ($headers as $header) {
            \preg_match_all('/(.*):\s/', $header, $matches, \PREG_SET_ORDER);

            if (isset($matches[0]) && \in_array($matches[0][1], $keys, true)) {
                $headerItems++;

                unset($headerKeys[$matches[0][1]]);

                $keys = \array_keys($headerKeys);
            }
        }

        return $headerItems !== 0;
    }
private static function isHeader ( array $ entry ) : bool { $ headerKeys = [ 'Project-Id-Version' => false , 'PO-Revision-Date' => false , 'MIME-Version' => false , ] ; $ keys = \ array_keys ( $ headerKeys ) ; $ headerItems = 0 ; $ headers = \ array_map ( 'trim' , $ entry [ 'msgstr' ] ) ; foreach ( $ headers as $ header ) { \ preg_match_all ( '/(.*):\s/' , $ header , $ matches , \ PREG_SET_ORDER ) ; if ( isset ( $ matches [ 0 ] ) && \ in_array ( $ matches [ 0 ] [ 1 ] , $ keys , true ) ) { $ headerItems ++ ; unset ( $ headerKeys [ $ matches [ 0 ] [ 1 ] ] ) ; $ keys = \ array_keys ( $ headerKeys ) ; } } return $ headerItems !== 0 ; }
Checks if entry is a header.

@param array $entry

@return bool
Checks if entry is a header .