Fix false-positive deprecation notices for TranslationLoader and WriteCheckSessionHandler

This commit is contained in:
Andreas 2018-02-16 06:32:23 +01:00 committed by Fabien Potencier
parent 9041ec33e3
commit 1a427b181d
2 changed files with 7 additions and 4 deletions

View File

@ -14,13 +14,16 @@ namespace Symfony\Bundle\FrameworkBundle\Translation;
use Symfony\Component\Translation\Reader\TranslationReader; use Symfony\Component\Translation\Reader\TranslationReader;
use Symfony\Component\Translation\MessageCatalogue; use Symfony\Component\Translation\MessageCatalogue;
@trigger_error(sprintf('The class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use "%s" instead. ', TranslationLoader::class, TranslationReader::class), E_USER_DEPRECATED);
/** /**
* @deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Component\Translation\Reader\TranslationReader instead * @deprecated since version 3.4 and will be removed in 4.0. Use Symfony\Component\Translation\Reader\TranslationReader instead
*/ */
class TranslationLoader extends TranslationReader class TranslationLoader extends TranslationReader
{ {
public function __construct()
{
@trigger_error(sprintf('The class "%s" is deprecated since Symfony 3.4 and will be removed in 4.0. Use "%s" instead. ', self::class, TranslationReader::class), E_USER_DEPRECATED);
}
/** /**
* Loads translation messages from a directory to the catalogue. * Loads translation messages from a directory to the catalogue.
* *

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; namespace Symfony\Component\HttpFoundation\Session\Storage\Handler;
@trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Implement `SessionUpdateTimestampHandlerInterface` or extend `AbstractSessionHandler` instead.', WriteCheckSessionHandler::class), E_USER_DEPRECATED);
/** /**
* Wraps another SessionHandlerInterface to only write the session when it has been modified. * Wraps another SessionHandlerInterface to only write the session when it has been modified.
* *
@ -31,6 +29,8 @@ class WriteCheckSessionHandler implements \SessionHandlerInterface
public function __construct(\SessionHandlerInterface $wrappedSessionHandler) public function __construct(\SessionHandlerInterface $wrappedSessionHandler)
{ {
@trigger_error(sprintf('The %s class is deprecated since Symfony 3.4 and will be removed in 4.0. Implement `SessionUpdateTimestampHandlerInterface` or extend `AbstractSessionHandler` instead.', self::class), E_USER_DEPRECATED);
$this->wrappedSessionHandler = $wrappedSessionHandler; $this->wrappedSessionHandler = $wrappedSessionHandler;
} }