Skip to content

Unattached quotes cause undefined array key spam #8

@reedy

Description

@reedy

When reading a file with a comment not attached to a translation block, there logs get spammy

foo.po

# Foo
msgid "Foo"
msgstr "Fop"

# foo

comments.php

<?php

require_once 'vendor/autoload.php';

$parser = new PoParser\Parser();
$parser->read("foo.po");
$ php comments.php 
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Parser.php on line 340
PHP Warning:  Undefined array key "msgid" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Entry.php on line 70
PHP Warning:  Undefined array key "msgstr" in /tmp/poparser/vendor/maxakawizard/po-parser/src/Entry.php on line 75

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions