Skip to content

Commit 3a5c2d3

Browse files
Merge branch '7.3' into 7.4
* 7.3: [Messenger] Fix unreachable catch [DependencyInjection] Fix PHPDoc syntax for InstantiatorInterface [MonologBundle] Accept HttpExceptionInterface in HttpCodeActivationStrategy
2 parents f0b2499 + 98af8bb commit 3a5c2d3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

LazyProxy/Instantiator/InstantiatorInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ interface InstantiatorInterface
2525
/**
2626
* Instantiates a proxy object.
2727
*
28-
* @param string $id Identifier of the requested service
29-
* @param callable(object=) $realInstantiator A callback that is capable of producing the real service instance
28+
* @param string $id Identifier of the requested service
29+
* @param (callable(): object)|(callable(object): void) $realInstantiator A callback that creates or initializes the real service instance:
30+
* - For direct instantiation or value-holder proxies: Called without arguments and returns the service object.
31+
* - For ghost object proxies (using PHP's lazy objects): Called with the proxy as argument, initializes it in place and returns void.
3032
*/
3133
public function instantiateProxy(ContainerInterface $container, Definition $definition, string $id, callable $realInstantiator): object;
3234
}

LazyProxy/Instantiator/RealServiceInstantiator.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
*/
2222
class RealServiceInstantiator implements InstantiatorInterface
2323
{
24+
/**
25+
* @return object The real service instance
26+
*/
2427
public function instantiateProxy(ContainerInterface $container, Definition $definition, string $id, callable $realInstantiator): object
2528
{
2629
return $realInstantiator();

0 commit comments

Comments
 (0)