Skip to content

Commit

Permalink
Merge pull request #11511 from doctrine/stof-patch-1
Browse files Browse the repository at this point in the history
Add the proper void return type on the __load method of proxies
  • Loading branch information
greg0ire authored Jun 20, 2024
2 parents 41cb5fb + c06f6b9 commit ca3319c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Proxy/ProxyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,18 @@ private function generateUseLazyGhostTrait(ClassMetadata $class): string
$code = substr($code, 7 + (int) strpos($code, "\n{"));
$code = substr($code, 0, (int) strpos($code, "\n}"));
$code = str_replace('LazyGhostTrait;', str_replace("\n ", "\n", 'LazyGhostTrait {
initializeLazyObject as __load;
initializeLazyObject as private;
setLazyObjectAsInitialized as public __setInitialized;
isLazyObjectInitialized as private;
createLazyGhost as private;
resetLazyObject as private;
}'), $code);
}
public function __load(): void
{
$this->initializeLazyObject();
}
'), $code);

return $code;
}
Expand Down

0 comments on commit ca3319c

Please sign in to comment.