Skip to content

Commit a6f4524

Browse files
authored
[JsonEncoder] remove some unnecessary recomputations in LazyInstantiator
1 parent 2d54786 commit a6f4524

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Symfony/Component/JsonEncoder/Decode/LazyInstantiator.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Instantiates a new $className lazy ghost {@see \Symfony\Component\VarExporter\LazyGhostTrait}.
2020
*
21-
* The $className class must not final.
21+
* The $className class must not be final.
2222
*
2323
* A property must be a callable that returns the actual value when being called.
2424
*
@@ -82,12 +82,10 @@ public function instantiate(string $className, array $propertiesCallables): obje
8282
$this->fs->mkdir($this->lazyGhostsDir);
8383
}
8484

85-
$lazyClassName = \sprintf('%sGhost', preg_replace('/\\\\/', '', $className));
86-
8785
file_put_contents($path, \sprintf('<?php class %s%s', $lazyClassName, ProxyHelper::generateLazyGhost($classReflection)));
8886
}
8987

90-
require_once \sprintf('%s%s%s.php', $this->lazyGhostsDir, \DIRECTORY_SEPARATOR, hash('xxh128', $className));
88+
require_once $path;
9189

9290
self::$lazyClassesLoaded[$className] = true;
9391

0 commit comments

Comments
 (0)