Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Qualification of deprecations as direct or indirect is wrong for autoloading ones #36036

Copy link
Copy link
Closed
@stof

Description

@stof
Issue body actions

Symfony version(s) affected: Symfony 4.4.5, PHPUnit Bridge 5.0.5

Description
For deprecations triggered by the DebugClassLoader (when extending a deprecated class for instance), the qualification of the deprecation as direct or indirect in the PHPUnit Bridge seems to be based on the place triggering the autoload call, rather than on the file containing the class definition for which the deprecation is triggered

How to reproduce

  • composer require xabbuh/panda-bundle 1.4.1 (which contains event classes which have not been migrated to the new base class in contracts, but any other vendor extending a deprecated class would do it)
  • write some code in the project using one of its event classes (in my case, it is the getSubscribedEvents() method of an event subscriber accessing the constant with the event name)
  • run tests with the PHPUnit bridge
  • The deprecation The "Xabbuh\PandaBundle\Event\EncodingCompleteEvent" class extends "Symfony\Component\EventDispatcher\Event" that is deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead. is reported as a direct deprecation while it should be invalid.

On the other hand, my own event classes (being in the same case as I haven't migrated them yet) are reported as indirect deprecations because the autoloading is triggered by Symfony itself when loading all classes defined in src.

Possible Solution
DebugClassLoader should have a way to force the source of the deprecation to be in the file rather than being in the autoloader IMO. But I don't know yet how to achieve it (/cc @nicolas-grekas)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.