diff --git a/src/Symfony/Component/Console/Helper/ProgressIndicator.php b/src/Symfony/Component/Console/Helper/ProgressIndicator.php index 301be27ea431..9a0163739178 100644 --- a/src/Symfony/Component/Console/Helper/ProgressIndicator.php +++ b/src/Symfony/Component/Console/Helper/ProgressIndicator.php @@ -192,11 +192,9 @@ private function display() return; } - $self = $this; - - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) use ($self) { - if ($formatter = $self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($self); + $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { + if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { + return $formatter($this); } return $matches[0]; diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index 309e8aaaec77..c5016184ccb1 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -843,10 +843,8 @@ public function testValidatesCachedResponsesWithLastModifiedAndNoFreshnessInform public function testValidatesCachedResponsesUseSameHttpMethod() { - $test = $this; - - $this->setNextResponse(200, [], 'Hello World', function ($request, $response) use ($test) { - $test->assertSame('OPTIONS', $request->getMethod()); + $this->setNextResponse(200, [], 'Hello World', function ($request, $response) { + $this->assertSame('OPTIONS', $request->getMethod()); }); // build initial request