1 | <?php |
||
12 | final class Factory implements PromiseFactoryInterface, SingletonInterface |
||
13 | { |
||
14 | /** @var ProxyPrinter */ |
||
15 | private $printer; |
||
16 | |||
17 | /** @var MaterializerInterface */ |
||
18 | private $materializer; |
||
19 | |||
20 | /** @var array */ |
||
21 | private $resolved = []; |
||
22 | |||
23 | /** @var Names */ |
||
24 | private $names; |
||
25 | |||
26 | public function __construct(ProxyPrinter $printer, MaterializerInterface $materializer, Names $names) |
||
32 | |||
33 | /** |
||
34 | * @param ORMInterface $orm |
||
35 | * @param string $role |
||
36 | * @param array $scope |
||
37 | * |
||
38 | * @return ReferenceInterface|null |
||
39 | * @throws ProxyFactoryException |
||
40 | */ |
||
41 | public function promise(ORMInterface $orm, string $role, array $scope): ?ReferenceInterface |
||
65 | |||
66 | /** |
||
67 | * @param string $className |
||
68 | * @param \Cycle\ORM\ORMInterface $orm |
||
69 | * @param string $role |
||
70 | * @param array $scope |
||
71 | * |
||
72 | * @return \Cycle\ORM\Promise\PromiseInterface |
||
73 | */ |
||
74 | private function instantiate(string $className, ORMInterface $orm, string $role, array $scope): PromiseInterface |
||
78 | } |