From 58161b8eec59d82c398c4afa0b999cd67a02199e Mon Sep 17 00:00:00 2001 From: Thomas Calvet Date: Tue, 29 Oct 2019 19:32:45 +0100 Subject: [PATCH] [4.3] Remove unused local variables --- .../Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php | 3 --- src/Symfony/Bridge/Twig/Node/TransNode.php | 2 -- .../DependencyInjection/FrameworkExtension.php | 2 -- .../Bundle/FrameworkBundle/Routing/DelegatingLoader.php | 5 ----- .../FrameworkBundle/Tests/Functional/ContainerDumpTest.php | 4 ++-- .../Tests/DataCollector/SecurityDataCollectorTest.php | 1 - .../Component/Cache/Tests/Adapter/AdapterTestCase.php | 4 ++-- .../Component/Cache/Tests/Adapter/NullAdapterTest.php | 2 +- .../Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php | 2 -- src/Symfony/Component/Config/ResourceCheckerConfigCache.php | 1 - .../Console/Tests/Output/ConsoleSectionOutputTest.php | 4 ++-- src/Symfony/Component/HttpClient/Response/ResponseTrait.php | 1 - .../Storage/Handler/NativeFileSessionHandlerTest.php | 2 +- .../RegisterControllerArgumentLocatorsPassTest.php | 2 +- src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php | 4 ++-- .../Component/Messenger/Transport/RedisExt/Connection.php | 1 - .../Messenger/Transport/Serialization/PhpSerializer.php | 1 - src/Symfony/Component/Mime/CharacterStream.php | 1 - src/Symfony/Component/Mime/Tests/EmailTest.php | 4 +--- src/Symfony/Component/Mime/Tests/Header/HeadersTest.php | 4 ---- .../Mime/Tests/Header/IdentificationHeaderTest.php | 6 +++--- src/Symfony/Component/Mime/Tests/Header/PathHeaderTest.php | 2 +- .../Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php | 2 +- .../Component/Routing/Tests/Annotation/RouteTest.php | 2 +- .../Generator/Dumper/CompiledUrlGeneratorDumperTest.php | 2 +- src/Symfony/Component/Security/Http/Tests/FirewallTest.php | 3 --- .../Component/Serializer/Normalizer/AbstractNormalizer.php | 1 - .../Component/Validator/Tests/ConstraintViolationTest.php | 5 ++--- src/Symfony/Component/Yaml/Parser.php | 1 - 29 files changed, 21 insertions(+), 53 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php index 03696c69f0..ed84eedf4a 100644 --- a/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php +++ b/src/Symfony/Bridge/PhpUnit/Legacy/SymfonyTestsListenerTrait.php @@ -257,14 +257,11 @@ class SymfonyTestsListenerTrait if (class_exists('PHPUnit_Util_Blacklist', false)) { $Test = 'PHPUnit_Util_Test'; $BaseTestRunner = 'PHPUnit_Runner_BaseTestRunner'; - $Warning = 'PHPUnit_Framework_Warning'; } else { $Test = 'PHPUnit\Util\Test'; $BaseTestRunner = 'PHPUnit\Runner\BaseTestRunner'; - $Warning = 'PHPUnit\Framework\Warning'; } $className = \get_class($test); - $classGroups = $Test::getGroups($className); $groups = $Test::getGroups($className, $test->getName(false)); if (null !== $this->reportUselessTests) { diff --git a/src/Symfony/Bridge/Twig/Node/TransNode.php b/src/Symfony/Bridge/Twig/Node/TransNode.php index cedc6b740e..e844801a5f 100644 --- a/src/Symfony/Bridge/Twig/Node/TransNode.php +++ b/src/Symfony/Bridge/Twig/Node/TransNode.php @@ -57,8 +57,6 @@ class TransNode extends Node } list($msg, $defaults) = $this->compileString($this->getNode('body'), $defaults, (bool) $vars); - $method = !$this->hasNode('count') ? 'trans' : 'transChoice'; - $compiler ->write('echo $this->env->getExtension(\'Symfony\Bridge\Twig\Extension\TranslationExtension\')->trans(') ->subcompile($msg) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 8b64507d0a..a913f4f93d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -997,8 +997,6 @@ class FrameworkExtension extends Extension { $loader->load('assets.xml'); - $defaultVersion = null; - if ($config['version_strategy']) { $defaultVersion = new Reference($config['version_strategy']); } else { diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php b/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php index 1e6b90a9bf..03b87fd6eb 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/DelegatingLoader.php @@ -98,11 +98,6 @@ class DelegatingLoader extends BaseDelegatingLoader } } - if (1 === substr_count($controller, ':')) { - $nonDeprecatedNotation = str_replace(':', '::', $controller); - // TODO deprecate this in 5.1 - } - $route->setDefault('_controller', $controller); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php index 8f82671478..f543058440 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDumpTest.php @@ -18,14 +18,14 @@ class ContainerDumpTest extends AbstractWebTestCase { public function testContainerCompilationInDebug() { - $client = $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml']); + $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml']); $this->assertTrue(static::$container->has('serializer')); } public function testContainerCompilation() { - $client = $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml', 'debug' => false]); + $this->createClient(['test_case' => 'ContainerDump', 'root_config' => 'config.yml', 'debug' => false]); $this->assertTrue(static::$container->has('serializer')); } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php index 7e583facf7..450cb68ab1 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php @@ -258,7 +258,6 @@ class SecurityDataCollectorTest extends TestCase $eventDispatcher = $this->getMockBuilder(EventDispatcherInterface::class)->getMockForAbstractClass(); $decoratedVoter1 = new TraceableVoter($voter1, $eventDispatcher); - $decoratedVoter2 = new TraceableVoter($voter2, $eventDispatcher); yield [ AccessDecisionManager::STRATEGY_AFFIRMATIVE, diff --git a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php index 63a7f39e53..a6132ebca2 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php @@ -87,8 +87,8 @@ abstract class AdapterTestCase extends CachePoolTest $cache = $this->createCachePool(0, __FUNCTION__); $v = $cache->get('k1', function () use (&$counter, $cache) { - $v = $cache->get('k2', function () use (&$counter) { return ++$counter; }); - $v = $cache->get('k2', function () use (&$counter) { return ++$counter; }); + $cache->get('k2', function () use (&$counter) { return ++$counter; }); + $v = $cache->get('k2', function () use (&$counter) { return ++$counter; }); // ensure the callback is called once return $v; }); diff --git a/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php index 6c5710a7e4..ae3de76dc1 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/NullAdapterTest.php @@ -39,7 +39,7 @@ class NullAdapterTest extends TestCase $adapter = $this->createCachePool(); $fetched = []; - $item = $adapter->get('myKey', function ($item) use (&$fetched) { $fetched[] = $item; }); + $adapter->get('myKey', function ($item) use (&$fetched) { $fetched[] = $item; }); $this->assertCount(1, $fetched); $item = $fetched[0]; $this->assertFalse($item->isHit()); diff --git a/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php b/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php index 573a1b1d01..d4071baedb 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/PdoDbalAdapterTest.php @@ -31,8 +31,6 @@ class PdoDbalAdapterTest extends AdapterTestCase } self::$dbFile = tempnam(sys_get_temp_dir(), 'sf_sqlite_cache'); - - $pool = new PdoAdapter(DriverManager::getConnection(['driver' => 'pdo_sqlite', 'path' => self::$dbFile])); } public static function tearDownAfterClass(): void diff --git a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php index 34dc35d5f5..c30686721a 100644 --- a/src/Symfony/Component/Config/ResourceCheckerConfigCache.php +++ b/src/Symfony/Component/Config/ResourceCheckerConfigCache.php @@ -154,7 +154,6 @@ class ResourceCheckerConfigCache implements ConfigCacheInterface private function safelyUnserialize($file) { - $e = null; $meta = false; $content = file_get_contents($file); $signalingException = new \UnexpectedValueException(); diff --git a/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php b/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php index e8d9a8b492..e8c65f9b21 100644 --- a/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php +++ b/src/Symfony/Component/Console/Tests/Output/ConsoleSectionOutputTest.php @@ -118,8 +118,8 @@ class ConsoleSectionOutputTest extends TestCase public function testAddingMultipleSections() { $sections = []; - $output1 = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter()); - $output2 = new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter()); + new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter()); + new ConsoleSectionOutput($this->stream, $sections, OutputInterface::VERBOSITY_NORMAL, true, new OutputFormatter()); $this->assertCount(2, $sections); } diff --git a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php index 8a1d9a9077..df511e90e5 100644 --- a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php +++ b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php @@ -104,7 +104,6 @@ trait ResponseTrait if (null === $this->content) { $content = null; - $chunk = null; foreach (self::stream([$this]) as $chunk) { if (!$chunk->isLast()) { diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php index 347619e962..368af6a3e3 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/NativeFileSessionHandlerTest.php @@ -27,7 +27,7 @@ class NativeFileSessionHandlerTest extends TestCase { public function testConstruct() { - $storage = new NativeSessionStorage(['name' => 'TESTING'], new NativeFileSessionHandler(sys_get_temp_dir())); + new NativeSessionStorage(['name' => 'TESTING'], new NativeFileSessionHandler(sys_get_temp_dir())); $this->assertEquals('user', ini_get('session.save_handler')); diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php index 1200472bb1..624658f727 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterControllerArgumentLocatorsPassTest.php @@ -364,7 +364,7 @@ class RegisterControllerArgumentLocatorsPassTest extends TestCase public function testNotTaggedControllerServiceReceivesLocatorArgument() { $container = new ContainerBuilder(); - $resolver = $container->register('argument_resolver.not_tagged_controller')->addArgument([]); + $container->register('argument_resolver.not_tagged_controller')->addArgument([]); $pass = new RegisterControllerArgumentLocatorsPass(); $pass->process($container); diff --git a/src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php b/src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php index f963a5a0f4..edb8b97cab 100644 --- a/src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php +++ b/src/Symfony/Component/Mailer/Tests/SmtpEnvelopeTest.php @@ -41,13 +41,13 @@ class SmtpEnvelopeTest extends TestCase public function testConstructorWithNoRecipients() { $this->expectException(\InvalidArgumentException::class); - $e = new SmtpEnvelope(new Address('fabien@symfony.com'), []); + new SmtpEnvelope(new Address('fabien@symfony.com'), []); } public function testConstructorWithWrongRecipients() { $this->expectException(\InvalidArgumentException::class); - $e = new SmtpEnvelope(new Address('fabien@symfony.com'), ['lucas@symfony.com']); + new SmtpEnvelope(new Address('fabien@symfony.com'), ['lucas@symfony.com']); } public function testSenderFromHeaders() diff --git a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php index 6864cd1b9c..6ded724ca5 100644 --- a/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php +++ b/src/Symfony/Component/Messenger/Transport/RedisExt/Connection.php @@ -106,7 +106,6 @@ class Connection $messageId = '0'; // will receive consumers pending messages } - $e = null; try { $messages = $this->connection->xreadgroup( $this->group, diff --git a/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php b/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php index 793da4a448..9a42bcc699 100644 --- a/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php +++ b/src/Symfony/Component/Messenger/Transport/Serialization/PhpSerializer.php @@ -52,7 +52,6 @@ class PhpSerializer implements SerializerInterface private function safelyUnserialize($contents) { - $e = null; $signalingException = new MessageDecodingFailedException(sprintf('Could not decode message using PHP serialization: %s.', $contents)); $prevUnserializeHandler = ini_set('unserialize_callback_func', self::class.'::handleUnserializeCallback'); $prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler, $signalingException) { diff --git a/src/Symfony/Component/Mime/CharacterStream.php b/src/Symfony/Component/Mime/CharacterStream.php index 9b80b2efa4..045b477093 100644 --- a/src/Symfony/Component/Mime/CharacterStream.php +++ b/src/Symfony/Component/Mime/CharacterStream.php @@ -116,7 +116,6 @@ final class CharacterStream if ($this->currentPos >= $this->charCount) { return null; } - $ret = null; $length = ($this->currentPos + $length > $this->charCount) ? $this->charCount - $this->currentPos : $length; if ($this->fixedWidth > 0) { $len = $length * $this->fixedWidth; diff --git a/src/Symfony/Component/Mime/Tests/EmailTest.php b/src/Symfony/Component/Mime/Tests/EmailTest.php index 764f66b079..1822da12aa 100644 --- a/src/Symfony/Component/Mime/Tests/EmailTest.php +++ b/src/Symfony/Component/Mime/Tests/EmailTest.php @@ -320,8 +320,6 @@ class EmailTest extends TestCase $e->text('text content'); $e->attach($file); $e->attach($image, 'test.gif'); - $fullhtml = new TextPart($content, 'utf-8', 'html'); - $inlinedimg = (new DataPart($image, 'test.gif'))->asInline(); $body = $e->getBody(); $this->assertInstanceOf(MixedPart::class, $body); $this->assertCount(2, $related = $body->getParts()); @@ -378,7 +376,7 @@ class EmailTest extends TestCase $e->from('fabien@symfony.com'); $e->text($r); $e->html($r); - $contents = file_get_contents($name = __DIR__.'/Fixtures/mimetypes/test', 'r'); + $name = __DIR__.'/Fixtures/mimetypes/test'; $file = fopen($name, 'r'); $e->attach($file, 'test'); $expected = clone $e; diff --git a/src/Symfony/Component/Mime/Tests/Header/HeadersTest.php b/src/Symfony/Component/Mime/Tests/Header/HeadersTest.php index 3568c9a6e4..e2eb75a697 100644 --- a/src/Symfony/Component/Mime/Tests/Header/HeadersTest.php +++ b/src/Symfony/Component/Mime/Tests/Header/HeadersTest.php @@ -173,8 +173,6 @@ class HeadersTest extends TestCase public function testRemoveRemovesAllHeadersWithName() { - $header0 = new UnstructuredHeader('X-Test', 'some@id'); - $header1 = new UnstructuredHeader('X-Test', 'other@id'); $headers = new Headers(); $headers->addIdHeader('X-Test', 'some@id'); $headers->addIdHeader('X-Test', 'other@id'); @@ -185,7 +183,6 @@ class HeadersTest extends TestCase public function testHasIsNotCaseSensitive() { - $header = new IdentificationHeader('Message-ID', 'some@id'); $headers = new Headers(); $headers->addIdHeader('Message-ID', 'some@id'); $this->assertTrue($headers->has('message-id')); @@ -209,7 +206,6 @@ class HeadersTest extends TestCase public function testRemoveIsNotCaseSensitive() { - $header = new IdentificationHeader('Message-ID', 'some@id'); $headers = new Headers(); $headers->addIdHeader('Message-ID', 'some@id'); $headers->remove('message-id'); diff --git a/src/Symfony/Component/Mime/Tests/Header/IdentificationHeaderTest.php b/src/Symfony/Component/Mime/Tests/Header/IdentificationHeaderTest.php index b7f0095d3a..7d274ab162 100644 --- a/src/Symfony/Component/Mime/Tests/Header/IdentificationHeaderTest.php +++ b/src/Symfony/Component/Mime/Tests/Header/IdentificationHeaderTest.php @@ -103,7 +103,7 @@ class IdentificationHeaderTest extends TestCase { $this->expectException('Exception'); $this->expectExceptionMessage('Email "a b c@d" does not comply with addr-spec of RFC 2822.'); - $header = new IdentificationHeader('References', 'a b c@d'); + new IdentificationHeader('References', 'a b c@d'); } public function testIdRightCanBeDotAtom() @@ -139,7 +139,7 @@ class IdentificationHeaderTest extends TestCase { $this->expectException('Exception'); $this->expectExceptionMessage('Email "a@b c d" does not comply with addr-spec of RFC 2822.'); - $header = new IdentificationHeader('References', 'a@b c d'); + new IdentificationHeader('References', 'a@b c d'); } public function testMissingAtSignThrowsException() @@ -149,7 +149,7 @@ class IdentificationHeaderTest extends TestCase /* -- RFC 2822, 3.6.4. msg-id = [CFWS] "<" id-left "@" id-right ">" [CFWS] */ - $header = new IdentificationHeader('References', 'abc'); + new IdentificationHeader('References', 'abc'); } public function testSetBody() diff --git a/src/Symfony/Component/Mime/Tests/Header/PathHeaderTest.php b/src/Symfony/Component/Mime/Tests/Header/PathHeaderTest.php index 6bc029aee4..a8386f8946 100644 --- a/src/Symfony/Component/Mime/Tests/Header/PathHeaderTest.php +++ b/src/Symfony/Component/Mime/Tests/Header/PathHeaderTest.php @@ -26,7 +26,7 @@ class PathHeaderTest extends TestCase public function testAddressMustComplyWithRfc2822() { $this->expectException('Exception'); - $header = new PathHeader('Return-Path', new Address('chr is@swiftmailer.org')); + new PathHeader('Return-Path', new Address('chr is@swiftmailer.org')); } public function testValueIsAngleAddrWithValidAddress() diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php index ab67e6885a..b3a9388679 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/CompiledUrlMatcherDumper.php @@ -121,7 +121,7 @@ EOF; } } EOF; - $compiledRoutes[4] = $forDump ? $checkConditionCode .= ",\n" : eval('return '.$checkConditionCode.';'); + $compiledRoutes[4] = $forDump ? $checkConditionCode.",\n" : eval('return '.$checkConditionCode.';'); } else { $compiledRoutes[4] = $forDump ? " null, // \$checkCondition\n" : null; } diff --git a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php index c0a8589c98..2c193a8a09 100644 --- a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php @@ -25,7 +25,7 @@ class RouteTest extends TestCase public function testTryingToSetLocalesDirectly() { $this->expectException('BadMethodCallException'); - $route = new Route(['locales' => ['nl' => 'bar']]); + new Route(['locales' => ['nl' => 'bar']]); } /** diff --git a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php index 513e1c80e1..521f0f126c 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/Dumper/CompiledUrlGeneratorDumperTest.php @@ -194,7 +194,7 @@ class CompiledUrlGeneratorDumperTest extends TestCase file_put_contents($this->testTmpFilepath, $this->generatorDumper->dump()); $projectUrlGenerator = new CompiledUrlGenerator(require $this->testTmpFilepath, new RequestContext()); - $url = $projectUrlGenerator->generate('NonExisting', []); + $projectUrlGenerator->generate('NonExisting', []); } public function testDumpForRouteWithDefaults() diff --git a/src/Symfony/Component/Security/Http/Tests/FirewallTest.php b/src/Symfony/Component/Security/Http/Tests/FirewallTest.php index bb81bc36a7..e3e04d8f15 100644 --- a/src/Symfony/Component/Security/Http/Tests/FirewallTest.php +++ b/src/Symfony/Component/Security/Http/Tests/FirewallTest.php @@ -14,7 +14,6 @@ namespace Symfony\Component\Security\Http\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\RequestEvent; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\Security\Http\Firewall; @@ -52,8 +51,6 @@ class FirewallTest extends TestCase public function testOnKernelRequestStopsWhenThereIsAResponse() { - $response = new Response(); - $called = []; $first = function () use (&$called) { diff --git a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php index 5f165b56ac..056744fa4b 100644 --- a/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php @@ -552,7 +552,6 @@ abstract class AbstractNormalizer implements NormalizerInterface, DenormalizerIn { if (\func_num_args() < 3) { @trigger_error(sprintf('Method "%s::%s()" will have a third "?string $format" argument in version 5.0; not defining it is deprecated since Symfony 4.3.', \get_class($this), __FUNCTION__), E_USER_DEPRECATED); - $format = null; } if (isset($parentContext[self::ATTRIBUTES][$attribute])) { $parentContext[self::ATTRIBUTES] = $parentContext[self::ATTRIBUTES][$attribute]; diff --git a/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php b/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php index 698d95d913..f8dc69efc1 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintViolationTest.php @@ -14,7 +14,6 @@ namespace Symfony\Component\Validator\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\Validator\ConstraintViolation; use Symfony\Component\Validator\Tests\Fixtures\CustomArrayObject; -use Symfony\Component\Validator\Tests\Fixtures\ToString; class ConstraintViolationTest extends TestCase { @@ -114,7 +113,7 @@ EOF; public function testMessageCannotBeArray() { $this->expectException(\TypeError::class); - $violation = new ConstraintViolation( + new ConstraintViolation( ['cannot be an array'], '', [], @@ -127,7 +126,7 @@ EOF; public function testMessageObjectMustBeStringable() { $this->expectException(\TypeError::class); - $violation = new ConstraintViolation( + new ConstraintViolation( new CustomArrayObject(), '', [], diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index d4e94a5ee3..6ad165ad4e 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -85,7 +85,6 @@ class Parser $this->refs = []; $mbEncoding = null; - $data = null; if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { $mbEncoding = mb_internal_encoding();