This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/HttpFoundation
Fabien Potencier 18edda3716 bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito)
This PR was squashed before being merged into the 3.4 branch (closes #26193).

Discussion
----------

Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler

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

Symfony 3.4 emits deprecation warnings for  `TranslationLoader` and `WriteCheckSessionHandler` as soon as these classes are loaded, yet at the same time these classes are part of the default services defined in Symfony 3.4, so if these classes are loaded during container compilation a deprecation warning is emitted, even if these classes are never actually used.

An example would be the following within a compiler pass:

    foreach ($containerBuilder->getDefinitions() as $definition) {
      if (is_subclass_of($definition->getClass(), SomeClass::class)) {
        $definition->addMethodCall('setSomething', [new Reference('someservice')]);
      }
    }

This will load both `TranslationLoader` and `WriteCheckSessionHandler` in order to check their definition.  No instance of the classes are ever used and the classes are not loaded after compilation ever, yet the deprecation notices are shown on every single page. More details are provided in issue #25518 .

By moving the deprecation notices to the class constructors false-positives are avoided while actual usage of the classes should still generate the deprecation warnings.

Commits
-------

1a427b181d Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler
2018-07-19 09:08:28 +02:00
..
Exception [HttpFoundation] refactored Request exceptions 2016-12-16 17:05:39 +01:00
File Merge branch '2.8' into 3.4 2018-05-25 13:07:31 +02:00
Session bug #26193 Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler (iquito) 2018-07-19 09:08:28 +02:00
Tests Merge branch '2.8' into 3.4 2018-07-16 15:57:19 +02:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
AcceptHeader.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
AcceptHeaderItem.php Remove useless docblocks 2017-10-29 10:49:53 +01:00
ApacheRequest.php [HttpFoundation] do not use server variable PATH_INFO because it is already decoded and thus symfony is fragile to double encoding of the path 2013-04-12 17:03:10 +02:00
BinaryFileResponse.php Merge branch '3.3' into 3.4 2017-10-02 08:49:52 +02:00
CHANGELOG.md [HttpFoundation] Make sessions secure and lazy 2017-10-17 00:24:46 +02:00
composer.json [HttpFoundation] Make sessions secure and lazy 2017-10-17 00:24:46 +02:00
Cookie.php [HttpFoundation] Add functional tests for Response::sendHeaders() 2018-04-20 20:41:36 +02:00
ExpressionRequestMatcher.php [HttpFoundation] added ExpressionRequestMatcher 2013-09-19 12:59:11 +02:00
FileBag.php bug #24606 [HttpFoundation] Fix FileBag issue with associative arrays (enumag) 2017-10-25 18:19:06 -07:00
HeaderBag.php Merge branch '2.8' into 3.4 2018-07-16 15:57:19 +02:00
IpUtils.php [HttpFoundation] Support 0 bit netmask in IPv6 () 2017-12-11 13:06:40 -08:00
JsonResponse.php Merge branch '2.7' into 2.8 2018-02-19 17:23:47 +01:00
LICENSE fixed years in copyright 2018-01-03 08:23:28 +01:00
ParameterBag.php fixed some deprecation messages 2017-12-31 06:12:25 +01:00
phpunit.xml.dist fail when detecting risky tests 2017-04-12 09:39:27 +02:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
RedirectResponse.php Merge branch '2.8' into 3.3 2017-10-28 18:47:30 +02:00
Request.php Merge branch '2.8' into 3.4 2018-05-11 17:52:51 +02:00
RequestMatcher.php [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction 2017-09-15 11:46:57 +02:00
RequestMatcherInterface.php [DI] minor docblock fixes 2017-10-24 13:40:19 +02:00
RequestStack.php unified return null usages 2014-04-18 22:38:54 +02:00
Response.php [HttpFoundation] don't encode cookie name for BC 2018-07-07 11:30:05 +02:00
ResponseHeaderBag.php Merge branch '2.8' into 3.4 2018-05-30 06:24:30 +02:00
ServerBag.php [CS][2.7] yoda_style, no_unneeded_curly_braces, no_unneeded_final_method, semicolon_after_instruction 2017-09-15 11:46:57 +02:00
StreamedResponse.php Merge branch '2.8' into 3.4 2018-07-16 15:57:19 +02:00

HttpFoundation Component

The HttpFoundation component defines an object-oriented layer for the HTTP specification.

Resources