-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations with \ do not get parsed correctly #1480
Comments
I think this issue is linked with this one: |
@hander Maybe, but I've been able to parse annotations with arrays using Phalcon when I am doing it stand-alone and now with the Mvc\Router\Annotations implementation. |
@stanlemon do you have a test case or sample code that fails? |
Sure, so the code below for example will yield "ORM" and "Routing" for annotation when what is desired is "ORM\Table" and "Routing\Route" because those map to concrete classes I was to use as annotations. <?php
/**
* @ORM\Table("test", ["id", "name", "created"])
* @Routing\Route("/foo/bar")
*/
class Test {
public function fooBar()
{
}
}
$reader = new \Phalcon\Annotations\Adapter\Memory();
//Reflect the annotations in the class Example
$reflector = $reader->get('Test');
//Read the annotations in the class' docblock
$annotations = $reflector->getClassAnnotations();
//Traverse the annotations
foreach ($annotations as $annotation) {
//Print the annotation name
echo $annotation->getName(), PHP_EOL;
//Print the number of arguments
echo $annotation->numberArguments(), PHP_EOL;
//Print the arguments
print_r($annotation->getArguments());
} |
The bug seems to be in Before:
After:
|
This is fixed in both 1.2.5 and 1.3.0, could you please check now? |
1.2.5 looks good, but it does not appear fixed with 1.3.0. |
Thanks btw - this is a pretty awesome improvement! |
Please build 1.3.0 from ext/, not from build/ cd ext
phpize && ./configure && make && sudo make install |
Hmm... I am not able to build that way on OS X so I am not able to confirm. FWIW... This is what I get:
|
Could you please paste the full build log? Also, what version of PHO do you use? |
Here is PHP:
And the full build log: |
Thanks, fix submitted. |
For example... @Orm\Column just yields "ORM" - this makes it virtually impossible to use annotations that map to fully qualified class names.
The text was updated successfully, but these errors were encountered: