Skip to content
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

DDC-3941: Compatibility issue with PHP 7.0 on proxy generation. #4802

Closed
doctrinebot opened this issue Oct 7, 2015 · 3 comments
Closed

DDC-3941: Compatibility issue with PHP 7.0 on proxy generation. #4802

doctrinebot opened this issue Oct 7, 2015 · 3 comments
Assignees
Labels
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user naroga:

When using a return typehint on the entity getter/setter, the proxies are not generated with the typehint, which throws an error when called.

Example:

/****
 * @ORM\Table(name="carro_marca")
 * @ORM\Entity
 */
class Marca
{
    /****
     * @ORM\Column(name="marca_id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="NONE")
     */
    private $id;

    /****
     * @return integer
     */
    public function getId() : \int
    {
        return $this->id;
    }
}

Creates the following getId on the Proxy:

class Marca extends \AppBundle\Entity\Carro\Marca implements \Doctrine\ORM\Proxy\Proxy
    {
        ...
        /****
         * {@inheritDoc}
         */
        public function getId()
        {
            ...
        }
}

Which makes my application throw the following error:

{quote}
Compile Error: Declaration of Proxies*CG*\AppBundle\Entity\Carro\Marca::getId() must be compatible with AppBundle\Entity\Carro\Marca::getId(): int
{quote}

@doctrinebot
Copy link
Author

Comment created by naroga:

Apparently, there is already a PR that fixes this for 2.6.0: doctrine/common#376

@doctrinebot
Copy link
Author

Comment created by naroga:

Fixed in doctrine/common#376 (DCOM-294).

@doctrinebot
Copy link
Author

Issue was closed with resolution "Duplicate"

@doctrinebot doctrinebot added this to the 2.6.0 milestone Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants