You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version of the annotation-parser does not tell between a single JSON-array and multiple simple annotations. But it should!
$parser = new \Minime\Annotations\Parser;
$this->assertNotSame(
$parser->parse('@foo 1 @foo 2 @foo 3'),
$parser->parse('@foo [1, 2, 3]')
); // FAIL. Parser errorneously gives the same result for both strings
$this->assertSame(
['foo' => [1, 2, 3]],
$parser->parse('@foo 1 @foo 2 @foo 3')
); // PASS. Parser works correctly on this
$this->assertSame(
['foo' => [[1, 2, 3]]],
$parser->parse('@foo [1, 2, 3]')
); // FAIL. Parser fails to preserve the array annotated with @foo
The text was updated successfully, but these errors were encountered:
marcioAlmada
changed the title
Parser does not handle JSON-arrays correctly
Parser does not distinguish between annotated arrays and repeated annotations
Apr 20, 2017
That was actually intentional from the very beginning to consider, by default, that repeated annotations form an array of values and arrays are merged if identified with the same identifier.
It's totally possible to introduce a new Parser featuring the distinction, or even add an optional parameter into the existing default parser.
The current version of the annotation-parser does not tell between a single JSON-array and multiple simple annotations. But it should!
The text was updated successfully, but these errors were encountered: