From 3817a8b036345a2797cedba166a5b20ecaaf7149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Terje=20Br=C3=A5ten?= Date: Tue, 17 Sep 2019 22:18:26 +0100 Subject: [PATCH 1/7] Make legacy "wrong" RFC2047 encoding apply only to one header --- .../Mime/Header/ParameterizedHeader.php | 2 +- .../Tests/Header/ParameterizedHeaderTest.php | 29 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Mime/Header/ParameterizedHeader.php b/src/Symfony/Component/Mime/Header/ParameterizedHeader.php index 5813dcf79f..811a969b1b 100644 --- a/src/Symfony/Component/Mime/Header/ParameterizedHeader.php +++ b/src/Symfony/Component/Mime/Header/ParameterizedHeader.php @@ -38,7 +38,7 @@ final class ParameterizedHeader extends UnstructuredHeader $this->setParameter($k, $v); } - if ('content-disposition' === strtolower($name)) { + if ('content-type' !== strtolower($name)) { $this->encoder = new Rfc2231Encoder(); } } diff --git a/src/Symfony/Component/Mime/Tests/Header/ParameterizedHeaderTest.php b/src/Symfony/Component/Mime/Tests/Header/ParameterizedHeaderTest.php index aa8265814b..e41d03857d 100644 --- a/src/Symfony/Component/Mime/Tests/Header/ParameterizedHeaderTest.php +++ b/src/Symfony/Component/Mime/Tests/Header/ParameterizedHeaderTest.php @@ -205,16 +205,25 @@ class ParameterizedHeaderTest extends TestCase $header = new ParameterizedHeader('X-Foo', $value); $header->setCharset('iso-8859-1'); $header->setParameters(['says' => $value]); - $this->assertEquals('X-Foo: =?'.$header->getCharset().'?Q?fo=8Fbar?=; says="=?'.$header->getCharset().'?Q?fo=8Fbar?="', $header->toString()); + $this->assertEquals('X-Foo: =?'.$header->getCharset().'?Q?fo=8Fbar?=; says*='.$header->getCharset()."''fo%8Fbar", $header->toString()); } - public function testParamsAreEncodedWithEncodedWordsIfNoParamEncoderSet() + public function testParamsAreEncodedIfNonAscii() { $value = 'fo'.pack('C', 0x8F).'bar'; $header = new ParameterizedHeader('X-Foo', 'bar'); $header->setCharset('iso-8859-1'); $header->setParameters(['says' => $value]); - $this->assertEquals('X-Foo: bar; says="=?'.$header->getCharset().'?Q?fo=8Fbar?="', $header->toString()); + $this->assertEquals('X-Foo: bar; says*='.$header->getCharset()."''fo%8Fbar", $header->toString()); + } + + public function testParamsAreEncodedWithLegacyEncodingEnabled() + { + $value = 'fo'.pack('C', 0x8F).'bar'; + $header = new ParameterizedHeader('Content-Type', 'bar'); + $header->setCharset('iso-8859-1'); + $header->setParameters(['says' => $value]); + $this->assertEquals('Content-Type: bar; says="=?'.$header->getCharset().'?Q?fo=8Fbar?="', $header->toString()); } public function testLanguageInformationAppearsInEncodedWords() @@ -234,6 +243,18 @@ class ParameterizedHeaderTest extends TestCase tag. For example: From: =?US-ASCII*EN?Q?Keith_Moore?= + + -- RFC 2047, 5. Use of encoded-words in message headers + ... + + An 'encoded-word' MUST NOT be used in parameter of a MIME + Content-Type or Content-Disposition field, or in any structured + field body except within a 'comment' or 'phrase'. + + -- RFC 2047, Appendix - changes since RFC 1522 + ... + + clarify that encoded-words are allowed in '*text' fields in both + RFC822 headers and MIME body part headers, but NOT as parameter + values. */ $value = 'fo'.pack('C', 0x8F).'bar'; @@ -241,7 +262,7 @@ class ParameterizedHeaderTest extends TestCase $header->setCharset('iso-8859-1'); $header->setLanguage('en'); $header->setParameters(['says' => $value]); - $this->assertEquals('X-Foo: =?'.$header->getCharset().'*en?Q?fo=8Fbar?=; says="=?'.$header->getCharset().'*en?Q?fo=8Fbar?="', $header->toString()); + $this->assertEquals('X-Foo: =?'.$header->getCharset().'*en?Q?fo=8Fbar?=; says*='.$header->getCharset()."'en'fo%8Fbar", $header->toString()); } public function testSetBody() From bd132710165c5bcdcd156ec07ee3f50e4db17dc6 Mon Sep 17 00:00:00 2001 From: Teoh Han Hui Date: Mon, 23 Sep 2019 11:00:33 +0200 Subject: [PATCH 2/7] Fix version typo in deprecation notice --- .../Component/Routing/Matcher/Dumper/PhpMatcherDumper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index 2177180f4d..085eee0ee0 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Routing\Matcher\Dumper; -@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.2, use "CompiledUrlMatcherDumper" instead.', PhpMatcherDumper::class), E_USER_DEPRECATED); +@trigger_error(sprintf('The "%s" class is deprecated since Symfony 4.3, use "CompiledUrlMatcherDumper" instead.', PhpMatcherDumper::class), E_USER_DEPRECATED); /** * PhpMatcherDumper creates a PHP class able to match URLs for a given set of routes. From 5c01f0a7e599b136ca68c0ba64e053f50ce7e4da Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Mon, 23 Sep 2019 11:24:06 +0300 Subject: [PATCH 3/7] [Lock] use Predis\ClientInterface instead of Predis\Client --- src/Symfony/Component/Lock/Store/RedisStore.php | 12 ++++++------ src/Symfony/Component/Lock/Store/StoreFactory.php | 4 ++-- .../Lock/Tests/Store/AbstractRedisStoreTest.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Lock/Store/RedisStore.php b/src/Symfony/Component/Lock/Store/RedisStore.php index 6e532f83cf..4e32834026 100644 --- a/src/Symfony/Component/Lock/Store/RedisStore.php +++ b/src/Symfony/Component/Lock/Store/RedisStore.php @@ -31,13 +31,13 @@ class RedisStore implements StoreInterface private $initialTtl; /** - * @param \Redis|\RedisArray|\RedisCluster|\Predis\Client $redisClient - * @param float $initialTtl the expiration delay of locks in seconds + * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface $redisClient + * @param float $initialTtl the expiration delay of locks in seconds */ public function __construct($redisClient, $initialTtl = 300.0) { - if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\Client && !$redisClient instanceof RedisProxy) { - throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient))); + if (!$redisClient instanceof \Redis && !$redisClient instanceof \RedisArray && !$redisClient instanceof \RedisCluster && !$redisClient instanceof \Predis\ClientInterface && !$redisClient instanceof RedisProxy) { + throw new InvalidArgumentException(sprintf('%s() expects parameter 1 to be Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($redisClient) ? \get_class($redisClient) : \gettype($redisClient))); } if ($initialTtl <= 0) { @@ -139,11 +139,11 @@ class RedisStore implements StoreInterface return $this->redis->_instance($this->redis->_target($resource))->eval($script, array_merge([$resource], $args), 1); } - if ($this->redis instanceof \Predis\Client) { + if ($this->redis instanceof \Predis\ClientInterface) { return \call_user_func_array([$this->redis, 'eval'], array_merge([$script, 1, $resource], $args)); } - throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\Client, %s given', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis))); + throw new InvalidArgumentException(sprintf('%s() expects being initialized with a Redis, RedisArray, RedisCluster or Predis\ClientInterface, %s given', __METHOD__, \is_object($this->redis) ? \get_class($this->redis) : \gettype($this->redis))); } /** diff --git a/src/Symfony/Component/Lock/Store/StoreFactory.php b/src/Symfony/Component/Lock/Store/StoreFactory.php index cbbcb685c3..2edcc1d327 100644 --- a/src/Symfony/Component/Lock/Store/StoreFactory.php +++ b/src/Symfony/Component/Lock/Store/StoreFactory.php @@ -22,13 +22,13 @@ use Symfony\Component\Lock\Exception\InvalidArgumentException; class StoreFactory { /** - * @param \Redis|\RedisArray|\RedisCluster|\Predis\Client|\Memcached $connection + * @param \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface|\Memcached $connection * * @return RedisStore|MemcachedStore */ public static function createStore($connection) { - if ($connection instanceof \Redis || $connection instanceof \RedisArray || $connection instanceof \RedisCluster || $connection instanceof \Predis\Client || $connection instanceof RedisProxy) { + if ($connection instanceof \Redis || $connection instanceof \RedisArray || $connection instanceof \RedisCluster || $connection instanceof \Predis\ClientInterface || $connection instanceof RedisProxy) { return new RedisStore($connection); } if ($connection instanceof \Memcached) { diff --git a/src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTest.php b/src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTest.php index 4b9c81bd8e..4d9ca48bf5 100644 --- a/src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTest.php +++ b/src/Symfony/Component/Lock/Tests/Store/AbstractRedisStoreTest.php @@ -31,7 +31,7 @@ abstract class AbstractRedisStoreTest extends AbstractStoreTest /** * Return a RedisConnection. * - * @return \Redis|\RedisArray|\RedisCluster|\Predis\Client + * @return \Redis|\RedisArray|\RedisCluster|\Predis\ClientInterface */ abstract protected function getRedisConnection(); From 8198d93c5beca4f7de71932017b1073eda15bb85 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Sep 2019 21:21:37 +0200 Subject: [PATCH 4/7] [PhpUnit] Fix usleep mock return value --- src/Symfony/Bridge/PhpUnit/ClockMock.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/ClockMock.php b/src/Symfony/Bridge/PhpUnit/ClockMock.php index 07ce9c3a60..bfc7566abd 100644 --- a/src/Symfony/Bridge/PhpUnit/ClockMock.php +++ b/src/Symfony/Bridge/PhpUnit/ClockMock.php @@ -52,12 +52,10 @@ class ClockMock public static function usleep($us) { if (null === self::$now) { - return \usleep($us); + \usleep($us); + } else { + self::$now += $us / 1000000; } - - self::$now += $us / 1000000; - - return null; } public static function microtime($asFloat = false) @@ -108,7 +106,7 @@ function sleep(\$s) function usleep(\$us) { - return \\$self::usleep(\$us); + \\$self::usleep(\$us); } EOPHP From 7596f99a12d421607c8cee51242055fe8221a89a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Sep 2019 21:31:27 +0200 Subject: [PATCH 5/7] Various tweaks 4.3 --- src/Symfony/Component/Console/Tests/Question/QuestionTest.php | 2 +- .../Component/Messenger/Command/FailedMessagesRetryCommand.php | 2 +- src/Symfony/Component/Messenger/Tests/WorkerTest.php | 2 +- .../Component/Security/Http/Firewall/LegacyListenerTrait.php | 1 + .../Security/Http/Tests/Firewall/SwitchUserListenerTest.php | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/Question/QuestionTest.php b/src/Symfony/Component/Console/Tests/Question/QuestionTest.php index 59b714291a..5da76062c6 100644 --- a/src/Symfony/Component/Console/Tests/Question/QuestionTest.php +++ b/src/Symfony/Component/Console/Tests/Question/QuestionTest.php @@ -140,7 +140,7 @@ class QuestionTest extends TestCase { return [ ['Potato'], - [new \stdclass()], + [new \stdClass()], [false], ]; } diff --git a/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php b/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php index 33686e6549..fee4556b05 100644 --- a/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php +++ b/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php @@ -187,7 +187,7 @@ EOF $count = 0; try { - $worker->run([], function (?Envelope $envelope) use ($worker, $io, &$count) { + $worker->run([], function (?Envelope $envelope) use ($worker, &$count) { ++$count; if (null === $envelope) { $worker->stop(); diff --git a/src/Symfony/Component/Messenger/Tests/WorkerTest.php b/src/Symfony/Component/Messenger/Tests/WorkerTest.php index 8c8e54dda9..ad7477253e 100644 --- a/src/Symfony/Component/Messenger/Tests/WorkerTest.php +++ b/src/Symfony/Component/Messenger/Tests/WorkerTest.php @@ -378,7 +378,7 @@ class WorkerTest extends TestCase $worker = new Worker([$receiver], $bus); $workerWithDecorator = new StopWhenMessageCountIsExceededWorker($worker, 2); $processedEnvelopes = []; - $workerWithDecorator->run([], function (?Envelope $envelope) use ($worker, &$processedEnvelopes) { + $workerWithDecorator->run([], function (?Envelope $envelope) use (&$processedEnvelopes) { if (null !== $envelope) { $processedEnvelopes[] = $envelope; } diff --git a/src/Symfony/Component/Security/Http/Firewall/LegacyListenerTrait.php b/src/Symfony/Component/Security/Http/Firewall/LegacyListenerTrait.php index 98933e0f3e..260cb680e0 100644 --- a/src/Symfony/Component/Security/Http/Firewall/LegacyListenerTrait.php +++ b/src/Symfony/Component/Security/Http/Firewall/LegacyListenerTrait.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Security\Http\Firewall; +use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseEvent; use Symfony\Component\HttpKernel\Event\RequestEvent; diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php index e3db00cb00..36842713f8 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php @@ -109,7 +109,7 @@ class SwitchUserListenerTest extends TestCase public function testExitUserBasedOnSwitchUserRoleUpdatesToken() { $originalToken = new UsernamePasswordToken('username', '', 'key', []); - $this->tokenStorage->setToken(new UsernamePasswordToken('username', '', 'key', [new SwitchUserRole('ROLE_PREVIOUS', $originalToken, false)], $originalToken)); + $this->tokenStorage->setToken(new UsernamePasswordToken('username', '', 'key', [new SwitchUserRole('ROLE_PREVIOUS', $originalToken, false)])); $this->request->query->set('_switch_user', SwitchUserListener::EXIT_VALUE); From 47cb83a6ec353bbe90cfb97049aba6891ab09d56 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 23 Sep 2019 21:33:12 +0200 Subject: [PATCH 6/7] Various tweaks 3.4 --- .../Component/Console/Tests/Helper/QuestionHelperTest.php | 2 +- .../Component/Console/Tests/Input/InputDefinitionTest.php | 1 + .../Component/Console/Tests/Tester/CommandTesterTest.php | 2 +- .../Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php | 3 ++- .../Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php | 3 ++- src/Symfony/Component/Routing/Loader/PhpFileLoader.php | 2 +- .../Component/Security/Csrf/Tests/CsrfTokenManagerTest.php | 2 +- .../UsernamePasswordFormAuthenticationListenerTest.php | 2 +- .../UsernamePasswordJsonAuthenticationListenerTest.php | 2 +- src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php | 5 ----- src/Symfony/Component/Templating/Tests/PhpEngineTest.php | 2 +- 11 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php index fc2589097c..02cc6ce7e0 100644 --- a/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php @@ -960,7 +960,7 @@ class QuestionHelperTest extends AbstractQuestionHelperTest $dialog = new QuestionHelper(); $question = new Question('What\'s your name?'); - $question->setValidator(function () { + $question->setValidator(function ($value) { if (!$value) { throw new \Exception('A value is required.'); } diff --git a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php index 086d28a41f..4a881f5955 100644 --- a/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php +++ b/src/Symfony/Component/Console/Tests/Input/InputDefinitionTest.php @@ -20,6 +20,7 @@ class InputDefinitionTest extends TestCase { protected static $fixtures; + protected $multi; protected $foo; protected $bar; protected $foo1; diff --git a/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php b/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php index e13dc15829..1fa8292365 100644 --- a/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php +++ b/src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php @@ -196,7 +196,7 @@ class CommandTesterTest extends TestCase ]; $command = new Command('foo'); - $command->setCode(function ($input, $output) use ($questions, $command) { + $command->setCode(function ($input, $output) use ($questions) { $io = new SymfonyStyle($input, $output); $io->ask($questions[0]); $io->ask($questions[1]); diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php index f5c856f9d5..4a4fcfb0ad 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/AdapterTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Ldap\Tests; +namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap; use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\ExtLdap\Collection; @@ -17,6 +17,7 @@ use Symfony\Component\Ldap\Adapter\ExtLdap\Query; use Symfony\Component\Ldap\Entry; use Symfony\Component\Ldap\Exception\NotBoundException; use Symfony\Component\Ldap\LdapInterface; +use Symfony\Component\Ldap\Tests\LdapTestCase; /** * @requires extension ldap diff --git a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php index 9605932ee0..48719a46b4 100644 --- a/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php +++ b/src/Symfony/Component/Ldap/Tests/Adapter/ExtLdap/LdapManagerTest.php @@ -9,13 +9,14 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Ldap\Tests; +namespace Symfony\Component\Ldap\Tests\Adapter\ExtLdap; use Symfony\Component\Ldap\Adapter\ExtLdap\Adapter; use Symfony\Component\Ldap\Adapter\ExtLdap\Collection; use Symfony\Component\Ldap\Entry; use Symfony\Component\Ldap\Exception\LdapException; use Symfony\Component\Ldap\Exception\NotBoundException; +use Symfony\Component\Ldap\Tests\LdapTestCase; /** * @requires extension ldap diff --git a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php index d9ba59d51e..dee8022f55 100644 --- a/src/Symfony/Component/Routing/Loader/PhpFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/PhpFileLoader.php @@ -40,7 +40,7 @@ class PhpFileLoader extends FileLoader // the closure forbids access to the private scope in the included file $loader = $this; - $load = \Closure::bind(static function ($file) use ($loader) { + $load = \Closure::bind(static function ($file) { return include $file; }, null, ProtectedPhpFileLoader::class); diff --git a/src/Symfony/Component/Security/Csrf/Tests/CsrfTokenManagerTest.php b/src/Symfony/Component/Security/Csrf/Tests/CsrfTokenManagerTest.php index 631c36a0db..fbd8207661 100644 --- a/src/Symfony/Component/Security/Csrf/Tests/CsrfTokenManagerTest.php +++ b/src/Symfony/Component/Security/Csrf/Tests/CsrfTokenManagerTest.php @@ -165,7 +165,7 @@ class CsrfTokenManagerTest extends TestCase $requestStack = new RequestStack(); $requestStack->push(new Request([], [], [], [], [], ['HTTPS' => 'on'])); - $manager = new CsrfTokenManager($generator, $storage, null, $requestStack); + $manager = new CsrfTokenManager($generator, $storage); $token = $manager->getToken('foo'); $this->assertSame('foo', $token->getId()); diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php index c5a23be27c..60685ae263 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Security\Tests\Http\Firewall; +namespace Symfony\Component\Security\Http\Tests\Firewall; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\RedirectResponse; diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordJsonAuthenticationListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordJsonAuthenticationListenerTest.php index 58948ce53b..2a5ffb30e6 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordJsonAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordJsonAuthenticationListenerTest.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\Security\Tests\Http\Firewall; +namespace Symfony\Component\Security\Http\Tests\Firewall; use PHPUnit\Framework\TestCase; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php index da8c04caa4..b8d6d15cd4 100644 --- a/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php +++ b/src/Symfony/Component/Templating/Tests/Loader/LoaderTest.php @@ -37,11 +37,6 @@ class ProjectTemplateLoader4 extends Loader return $this->logger; } - public function getDebugger() - { - return $this->debugger; - } - public function isFresh(TemplateReferenceInterface $template, $time) { return false; diff --git a/src/Symfony/Component/Templating/Tests/PhpEngineTest.php b/src/Symfony/Component/Templating/Tests/PhpEngineTest.php index 4bce834150..5f43cb5f24 100644 --- a/src/Symfony/Component/Templating/Tests/PhpEngineTest.php +++ b/src/Symfony/Component/Templating/Tests/PhpEngineTest.php @@ -93,7 +93,7 @@ class PhpEngineTest extends TestCase public function testExtendRender() { - $engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader, [], [new SlotsHelper()]); + $engine = new ProjectTemplateEngine(new TemplateNameParser(), $this->loader, []); try { $engine->render('name'); $this->fail('->render() throws an InvalidArgumentException if the template does not exist'); From e70057aed44d6ba628851476f07cf5f5c15a7850 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 24 Sep 2019 17:43:44 +0200 Subject: [PATCH 7/7] [Security/Http] fix typo in deprecation message --- src/Symfony/Component/Security/Http/Firewall.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Security/Http/Firewall.php b/src/Symfony/Component/Security/Http/Firewall.php index 7cd51ce21e..08d4873c28 100644 --- a/src/Symfony/Component/Security/Http/Firewall.php +++ b/src/Symfony/Component/Security/Http/Firewall.php @@ -138,7 +138,7 @@ class Firewall implements EventSubscriberInterface if (\is_callable($listener)) { $listener($event); } else { - @trigger_error(sprintf('Calling the "%s::handle()" method from the firewall is deprecated since Symfony 4.3, implement "__invoke()" instead.', \get_class($this)), E_USER_DEPRECATED); + @trigger_error(sprintf('Calling the "%s::handle()" method from the firewall is deprecated since Symfony 4.3, implement "__invoke()" instead.', \get_class($listener)), E_USER_DEPRECATED); $listener->handle($event); }