Skip to content

[#DCOM-164] ignoring @type phpdoc annotations #2

Closed
wants to merge 1 commit into from

5 participants

@mnapoli
mnapoli commented Jan 22, 2013

Issue DCOM-164

phpDocumentor guys wrote their own PSR to define how to use phpdoc properly (https://github.com/phpDocumentor/phpDocumentor2/blob/develop/docs/PSR.md).
They deprecate the @var annotation and recommend using @type instead.

The @type (phpdoc) annotation is not blacklisted/ignored by the AnnotationReader. Code that uses this annotation raises errors with Doctrine/Annotations.

@type should be blacklisted/ignored, but may that create BC breaks for users?

This PR contains test + fix

@mnapoli mnapoli referenced this pull request in PHP-DI/PHP-DI Jan 22, 2013
Closed

Support @type annotation like @var annotation #33

@beberlei
Doctrine member

This breaks BC, the MongoDB ODM for examples uses @Type - can you confirm @jwage or @jmikola ?

@jmikola
Doctrine member
jmikola commented Jan 22, 2013

Fields may have a type property, but we don't seem to have a Type annotation: https://github.com/doctrine/mongodb-odm/tree/master/lib/Doctrine/ODM/MongoDB/Mapping/Annotations

@beberlei
Doctrine member

Ok weird, CouchDB copied MongoDB @Type - it seems it doesnt exist in MongoDB anymore.

@mnapoli
mnapoli commented Jan 23, 2013

@beberlei either way (merging or not this PR) there will be a problem right?
Either @type phpdoc will mess Doctrine's annotations up in the future (I don't know if people already use it), either there's a risk of breaking BC.

@oleg-andreyev

Having similar issue with @TODO/@FIX tags

AnnotationException: [Semantical Error] The annotation "@FIX" in method Vendor\VendorBundle\Controller\DummyController::dummyAction() was never imported. Did you maybe forget to add a "use" statement for this annotation?
@mnapoli mnapoli referenced this pull request in phpDocumentor/fig-standards Sep 16, 2013
Closed

@type and compatibility with Doctrine's annotations #21

@guilhermeblanco
Doctrine member

Not valid anymore. phpDoc does not rely on type, and still uses var.
PSR-5 is considering type, but until this gets approved... no work on our side.

@mnapoli mnapoli deleted the unknown repository branch May 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.