2020use Cycle \ORM \Schema ;
2121use Doctrine \Instantiator \Exception \ExceptionInterface ;
2222use Doctrine \Instantiator \Instantiator ;
23+ use Doctrine \Instantiator \InstantiatorInterface ;
2324use ReflectionClass ;
2425use ReflectionException ;
2526use Spiral \Core \Container \SingletonInterface ;
@@ -38,7 +39,7 @@ final class ProxyFactory implements PromiseFactoryInterface, SingletonInterface
3839 /** @var Names */
3940 private $ names ;
4041
41- /** @var Instantiator */
42+ /** @var InstantiatorInterface */
4243 private $ instantiator ;
4344
4445 /** @var array */
@@ -50,20 +51,20 @@ final class ProxyFactory implements PromiseFactoryInterface, SingletonInterface
5051 /**
5152 * @param Extractor $extractor
5253 * @param Printer $printer
53- * @param Instantiator |null $instantiator
54+ * @param InstantiatorInterface |null $instantiator
5455 * @param MaterializerInterface|null $materializer
5556 * @param Names|null $names
5657 */
5758 public function __construct (
5859 Extractor $ extractor ,
5960 Printer $ printer ,
60- ?Instantiator $ instantiator = null ,
61+ ?InstantiatorInterface $ instantiator = null ,
6162 ?MaterializerInterface $ materializer = null ,
6263 ?Names $ names = null
6364 ) {
6465 $ this ->extractor = $ extractor ;
6566 $ this ->printer = $ printer ;
66- $ this ->instantiator = $ instantiator ;
67+ $ this ->instantiator = $ instantiator ?? new Instantiator () ;
6768 $ this ->materializer = $ materializer ?? new EvalMaterializer ();
6869 $ this ->names = $ names ?? new Names ();
6970 }
0 commit comments