Skip to content

Error with the return of repositories #413

@rgrassian

Description

@rgrassian

Hi,

I just upgraded from 1.3.29 to 1.3.31, and also doctrine/doctrine-bundle from 2.7.0 to 2.8.2
I have now errors with the repository->findOneBy method which returns now object|null instead of the expected entity or null.
I use an objectManagerLoader, I include vendor/phpstan/phpstan-doctrine/extension.neon and vendor/phpstan/phpstan-doctrine/rules.neon. I tried with and without bleedingEdge.

The errors disappear when I downgrade the StubFilesExtensionLoader->getFiles() method and go back to the

return 
[
    $path . '/ORM/QueryBuilder.stub',
    $path . '/EntityRepository.stub',
];

I saw that an other issue was created and solved by 1.3.30 but it's still not ok for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions