Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
1eec9f21
Commit
1eec9f21
authored
Oct 30, 2009
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Fixed DDC-77 - Prevent PHP Warning on certain annotation constallations
parent
49bcc69f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
Parser.php
lib/Doctrine/Common/Annotations/Parser.php
+3
-2
ParserTest.php
tests/Doctrine/Tests/Common/Annotations/ParserTest.php
+16
-5
No files found.
lib/Doctrine/Common/Annotations/Parser.php
View file @
1eec9f21
...
...
@@ -235,9 +235,10 @@ class Parser
// If it really an annotation class?
if
(
!
$this
->
_isNestedAnnotation
&&
$this
->
_lexer
->
lookahead
!=
null
&&
(
!
$this
->
_isNestedAnnotation
&&
$this
->
_lexer
->
lookahead
!=
null
&&
!
$this
->
_lexer
->
isNextToken
(
'('
)
&&
!
$this
->
_lexer
->
isNextToken
(
'@'
)
||
!
$this
->
_lexer
->
isNextToken
(
'@'
))
||
!
class_exists
(
$name
)
||
!
is_subclass_of
(
$name
,
'Doctrine\Common\Annotations\Annotation'
)
)
{
$this
->
_lexer
->
skipUntil
(
'@'
);
...
...
tests/Doctrine/Tests/Common/Annotations/ParserTest.php
View file @
1eec9f21
...
...
@@ -73,11 +73,22 @@ DOCBLOCK;
*/
DOCBLOCK;
$result
=
$parser
->
parse
(
$docblock
);
$this
->
assertEquals
(
1
,
count
(
$result
));
$annot
=
$result
[
'Doctrine\Tests\Common\Annotations\Name'
];
$this
->
assertTrue
(
$annot
instanceof
Name
);
$this
->
assertEquals
(
"bar"
,
$annot
->
foo
);
$result
=
$parser
->
parse
(
$docblock
);
$this
->
assertEquals
(
1
,
count
(
$result
));
$annot
=
$result
[
'Doctrine\Tests\Common\Annotations\Name'
];
$this
->
assertTrue
(
$annot
instanceof
Name
);
$this
->
assertEquals
(
"bar"
,
$annot
->
foo
);
}
/**
* @group DDC-77
*/
public
function
testAnnotationWithoutClassIsIgnoredWithoutWarning
()
{
$parser
=
new
Parser
();
$result
=
$parser
->
parse
(
"@param"
);
$this
->
assertEquals
(
0
,
count
(
$result
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment