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

Getting TranslationLoader deprecation when container.dumper.inline_class_loader is set to true #24959

Closed
ogizanagi opened this issue Nov 13, 2017 · 1 comment

Comments

@ogizanagi
Copy link
Member

ogizanagi commented Nov 13, 2017

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.0-BETA4

Steps to reproduce:

  1. symfony new reproducer 3.4 && cd reproducer
  2. Uncomment the translator: { fallbacks: ['%locale%'] } line in app/config/config.yml
  3. composer up
  4. bin/console c:c -vvv

You'll get the following deprecation logged:

INFO      [php] User Deprecated: The class "Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader" is deprecated since version 3.4 and will be removed in 4.0. Use "Symfony\Component\Translation\Reader\TranslationReader" instead. 
[
  "exception" => ErrorException {
    #message: "User Deprecated: The class "Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader" is deprecated since version 3.4 and will be removed in 4.0. Use "Symfony\Component\Translation\Reader\TranslationReader" instead. "
    #code: 0
    #file: "./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php"
    #line: 17
    #severity: E_USER_DEPRECATED
    trace: {
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php:17 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:143 { …}
      Symfony\Component\Debug\DebugClassLoader->loadClass() {}
      spl_autoload_call() {}
      ./vendor/symfony/symfony/src/Symfony/Component/Config/Resource/ClassExistenceResource.php:78 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:351 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:344 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:279 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:799 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:851 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php:190 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:816 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:634 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:137 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:154 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:180 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:161 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php:117 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:252 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:942 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:225 { …}
      ./vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:71 { …}
      ./vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:129 { …}
      ./bin/console:27 {
        › $application = new Application($kernel);
        › $application->run($input);
        › 
      }
    }
  }
]

It seems the ContainerBuilder::getReflectionClass() method is called with the TranslationLoader as $class argument when collecting lineages, triggering autoloading and the deprecation through ClassExistenceResource::isFresh().

It does not happen when setting container.dumper.inline_class_loader to false.

@nicolas-grekas
Copy link
Member

See #25037

fabpot added a commit that referenced this issue Nov 20, 2017
…ass might also be (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[DI] Skip hot_path tag for deprecated services as their class might also be

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24959
| License       | MIT
| Doc PR        | -

Commits
-------

1775bba [DI] Skip hot_path tag for deprecated services as their class might also be
@fabpot fabpot closed this as completed Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants