Allow empty arrays in annotations #270

Closed
wants to merge 1 commit into
from

4 participants

@kitsunet

an empty array so far is impossible as it either results in a parse error if you just do the obvious {} or if you try {""} it will create an empty entry which in turn will cause errors depending on the annotation.

@kitsunet kitsunet Allow empty arrays in annotations
an empty array so far is impossible as it either results in a parse error if you just do the obvious {} or if you try {""} it will create an empty entry which in turn will cause errors depending on the annotation.
ea57779
@doctrinebot

Hello,

thank you for positing this Pull Request. I have automatically opened an issue on our Jira Bug Tracker for you with the details of this Pull-Request. See the Link:

http://doctrine-project.org/jira/browse/DCOM-187

@doctrinebot

Oh btw, I just (automatically) realized that you are not creating this pull request against the master branch.

Unless there are good reasons for this, i would suggest to close and rebase the Pull Request against master and then create it again. Sorry!

@Ocramius
Doctrine member

@kitsunet can you add a test for this logic? Also, please rebase onto master.

@FabioBatSilva FabioBatSilva commented on the diff Mar 29, 2013
lib/Doctrine/Common/Annotations/DocParser.php
@@ -929,6 +929,10 @@ private function Arrayx()
$array = $values = array();
$this->match(DocLexer::T_OPEN_CURLY_BRACES);
+ if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
+ $this->match(DocLexer::T_CLOSE_CURLY_BRACES);
+ return $array;
@FabioBatSilva
Doctrine member
FabioBatSilva added a line comment Mar 29, 2013

Missing line before return statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@FabioBatSilva FabioBatSilva commented on the diff Mar 29, 2013
lib/Doctrine/Common/Annotations/DocParser.php
@@ -929,6 +929,10 @@ private function Arrayx()
$array = $values = array();
$this->match(DocLexer::T_OPEN_CURLY_BRACES);
+ if ($this->lexer->isNextToken(DocLexer::T_CLOSE_CURLY_BRACES)) {
@FabioBatSilva
Doctrine member
FabioBatSilva added a line comment Mar 29, 2013

Missing line before conditional statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@beberlei
Doctrine member

@Ocramius common doesnt have annotations in master anymore, this is just for cross reference the bugfix with annotations,where the patch is also a PR.

@Ocramius
Doctrine member

Whoops! Didn't notice that, sorry!

@beberlei
Doctrine member

This was fixed.

@beberlei beberlei closed this Aug 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment