{"issue":{"created_at":"2011-11-29T08:18:19Z","state":"closed","updated_at":"2011-12-01T07:41:42Z","comments":1,"user":{"gravatar_id":"47a8fe9ed227e9c56cd5dba93c2c9118","id":626664,"url":"https://api.github.com/users/jonathaningram","avatar_url":"https://secure.gravatar.com/avatar/47a8fe9ed227e9c56cd5dba93c2c9118?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jonathaningram"},"body":"`[Semantical Error] The annotation \"@ORM\\Entity\" in class Jbi\\CompanyBundle\\Wizard\\Form\\Model\\ProjectFormModel was never imported. Did you maybe forget to add a \"use\" statement for this annotation?`\r\n\r\nThe class looks like this:\r\n\r\n```php\r\n<?php\r\n\r\nnamespace Jbi\\CompanyBundle\\Wizard\\Form\\Model;\r\n\r\nuse Symfony\\Component\\Validator\\Constraints as Assert;\r\n\r\nuse Jbi\\CoreBundle\\Model\\ProjectInterface;\r\nuse Jbi\\CoreBundle\\Model\\CompanyInterface;\r\nuse Jbi\\CoreBundle\\Model\\SiteInterface;\r\n\r\nclass ProjectFormModel\r\n{\r\n    /**\r\n     * @var string $name\r\n     *\r\n     * @Assert\\NotBlank(groups={\"flow_jbi_company_wizard_new_project_step1\"})\r\n\t * @Assert\\MaxLength(limit=20, groups={\"flow_jbi_company_wizard_new_project_step1\"})\r\n     */\r\n    private $name;\r\n    \r\n    /**\r\n     * @var \\Jbi\\CoreBundle\\Model\\CompanyInterface $company\r\n     *\r\n     * @Assert\\NotNull(groups={\"flow_jbi_company_wizard_new_project_step1\"})\r\n     * @Assert\\Type(type=\"Jbi\\CoreBundle\\Entity\\Company\", groups={\"flow_jbi_company_wizard_new_project_step1\"})\r\n     */\r\n    private $company;\r\n    \r\n    /**\r\n     * @var string $deploymentType\r\n     * \r\n     * @Assert\\NotBlank(groups={\"flow_jbi_company_wizard_new_project_step3\"})\r\n     */\r\n    private $deploymentType = ProjectInterface::DEFAULT_DEPLOYMENT_TYPE;\r\n    \r\n    /**\r\n     * This is only relevant if the project deployment type is \r\n     * \\Jbi\\CoreBundle\\Model\\DeploymentTypeInterface::HOSTED_SUBDOMAIN\r\n     * \r\n     * @var string $hostedSubdomain\r\n     *\r\n     * @Assert\\Regex(\r\n     *     groups={\"flow_jbi_company_wizard_new_project_step3\"},\r\n     *     pattern=\"~^\r\n                (\r\n                    ([\\pL\\pN\\pS-]+\\.)+[\\pL]+                    # a domain name\r\n                        |                                       #  or\r\n                    \\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}          # a IP address\r\n                        |                                       #  or\r\n                    \\[\r\n                        (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))\r\n                    \\]  # a IPv6 address\r\n                )\r\n                (:[0-9]+)?                                      # a port (optional)\r\n                (/?|/\\S+)                                       # a /, nothing or a / with something\r\n            $~ixu\",\r\n     *     message=\"jbi.core.model.project.hosted_subdomain.regex.message\"\r\n     * )\r\n     */\r\n    private $hostedSubdomain = ProjectInterface::DEFAULT_HOSTED_SUBDOMAIN;\r\n\r\n    /**\r\n     * This is only relevant if the project deployment type is \r\n     * \\Jbi\\CoreBundle\\Model\\DeploymentTypeInterface::DOWNLOAD\r\n     * \r\n     * @var string $downloadPath\r\n     *\r\n     * @Assert\\Regex(\r\n     *     groups={\"flow_jbi_company_wizard_new_project_step3\"},\r\n     *     pattern=\"~^\r\n                (\r\n                    ([\\pL\\pN\\pS-]+\\.)+[\\pL]+                    # a domain name\r\n                        |                                       #  or\r\n                    \\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}          # a IP address\r\n                        |                                       #  or\r\n                    \\[\r\n                        (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::))))\r\n                    \\]  # a IPv6 address\r\n                )\r\n                (:[0-9]+)?                                      # a port (optional)\r\n                (/?|/\\S+)                                       # a /, nothing or a / with something\r\n            $~ixu\",\r\n     *     message=\"jbi.core.model.project.download_path.regex.message\"\r\n     * )\r\n     */\r\n    private $downloadPath = ProjectInterface::DEFAULT_DOWNLOAD_PATH;\r\n    \r\n    /**\r\n     * @var \\Traversable $sites\r\n     */\r\n    private $sites = array();\r\n   \r\n    public function setCompany(CompanyInterface $company)\r\n    {\r\n        $this->company = $company;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getCompany()\r\n    {\r\n        return $this->company;\r\n    }\r\n    \r\n    public function addSite(SiteInterface $site)\r\n    {\r\n        $this->sites[] = $site;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getSites()\r\n    {\r\n        return $this->sites;\r\n    }\r\n    \r\n    public function setName($name)\r\n    {\r\n        $this->name = $name;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getName()\r\n    {\r\n        return $this->name;\r\n    }\r\n    \r\n    public function setDeploymentType($deploymentType)\r\n    {\r\n        $this->deploymentType = $deploymentType;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getDeploymentType()\r\n    {\r\n        return $this->deploymentType;\r\n    }\r\n    \r\n    public function setHostedSubdomain($hostedSubdomain)\r\n    {\r\n        $this->hostedSubdomain = $hostedSubdomain;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getHostedSubdomain()\r\n    {\r\n        return $this->hostedSubdomain;\r\n    }\r\n\r\n    public function setDownloadPath($downloadPath)\r\n    {\r\n        $this->downloadPath = $downloadPath;\r\n        \r\n        return $this;\r\n    }\r\n\r\n    public function getDownloadPath()\r\n    {\r\n        return $this->downloadPath;\r\n    }\r\n}\r\n```\r\n\r\nAs you can see, there is no `@ORM` in there. Worse yet, in the stack trace is this:\r\n\r\n```\r\nat DocParser ->parse ('/** * @ORM\\Entity * @ORM\\Table(name=\"rule\") */', 'class Jbi\\CompanyBundle\\Wizard\\Form\\Model\\ProjectFormModel') \r\nin /var/www/site.com/shared/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationReader.php at line 149\r\n```\r\n\r\nThe important part in that is `name=\"rule\"`. I have a `Rule` entity with such a class annotation, but that's located at `Jbi\\CoreBundle\\Entity\\Rule`, so I cannot see any relation here except that the validator guesser thinks my class is an Entity (no idea why it would pick rule though when there is a `Project` entity too).\r\n\r\nNote: originally I called my class `Jbi\\CompanyBundle\\Wizard\\Form\\Model\\Project`, but thought the name `Project` might conflict with the entity, so I changed it to `ProjectFormModel` and it still fails.","assignee":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"id":2380459,"number":2745,"labels":[],"title":"[Validator] when guessing type, obtains weird annotation data.","html_url":"https://github.com/symfony/symfony/issues/2745","closed_at":"2011-12-01T07:41:42Z","url":"https://api.github.com/repos/symfony/symfony/issues/2745","milestone":null},"action":"closed"}