8000 [ProxyManager] fix tests · symfony/symfony@c5904be · GitHub
[go: up one dir, main page]

Skip to content

Commit c5904be

Browse files
[ProxyManager] fix tests
1 parent 604c689 commit c5904be

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/LazyLoadingValueHolderGenerator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function generate(\ReflectionClass $originalClass, ClassGenerator $classG
4141
$method->getBody()
4242
);
4343
$body = str_replace('(new \ReflectionClass(get_class()))', '$reflection', $body);
44+
$body = str_replace('$reflection = $reflection ?: ', '$reflection = $reflection ?? ', $body);
45+
$body = str_replace('$reflection ?? $reflection = ', '$reflection ?? ', $body);
4446

4547
if ($originalClass->isInterface()) {
4648
$body = str_replace('get_parent_class($this)', var_export($originalClass->name, true), $body);

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-implem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function staticProxyConstructor($initializer)
4848
{
4949
static $reflection;
5050

51-
$reflection = $reflection ?? $reflection = new \ReflectionClass(__CLASS__);
51+
$reflection = $reflection ?? new \ReflectionClass(__CLASS__);
5252
$instance = $reflection->newInstanceWithoutConstructor();
5353

5454
$instance->initializer1eff735 = $initializer;

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ protected function createProxy(\$class, \Closure \$factory)
156156
$implem = preg_replace('#\n /\*\*.*?\*/#s', '', $implem);
157157
$implem = str_replace('getWrappedValueHolderValue() : ?object', 'getWrappedValueHolderValue()', $implem);
158158
$implem = str_replace("array(\n \n );", "[\n \n ];", $implem);
159-
$implem = str_replace('$reflection ?: $reflection', '$reflection ?? $reflection', $implem);
160159
$this->assertStringEqualsFile(__DIR__.'/Fixtures/proxy-implem.php', $implem);
161160
$this->assertStringEqualsFile(__DIR__.'/Fixtures/proxy-factory.php', $factory);
162161

0 commit comments

Comments
 (0)
0