Remove hack to access class scope inside closures
This is possible since 5.4
This commit is contained in:
parent
7dfc97be9f
commit
f84c71b582
@ -192,11 +192,9 @@ class ProgressIndicator
|
||||
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];
|
||||
|
@ -843,10 +843,8 @@ class HttpCacheTest extends HttpCacheTestCase
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user