Skip to content

Proxy Autoloader: autoloader assumes $notFoundCallback always creates the proxy file #870

Open
@alcaeus

Description

@alcaeus

I saw this while trying to figure out doctrine/DoctrineBundle#848. In this case, the autoloader was called to load a proxy for a mapped superclass. Since the file didn't exist, the $notFoundCallback was called to generate a proxy class. However, the ProxyFactory in ORM will skip over mapped superclasses and didn't create a class, but neither threw an exception.

This causes an error because the autoloader wrongly assumes that the file will be present, at least after invoking the $notFoundCallback: https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Proxy/Autoloader.php#L74. However, this assumption is wrong and should probably be checked, with an exception being thrown if no file was generated/found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions