1 | <?php |
||
12 | 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 | public function __construct(ProxyPrinter $printer, MaterializerInterface $materializer) |
||
28 | |||
29 | /** |
||
30 | * @param ORMInterface $orm |
||
31 | * @param string $role |
||
32 | * @param array $scope |
||
33 | * |
||
34 | * @return ReferenceInterface|null |
||
35 | * @throws ProxyFactoryException |
||
36 | */ |
||
37 | public function promise(ORMInterface $orm, string $role, array $scope): ?ReferenceInterface |
||
61 | |||
62 | /** |
||
63 | * @param string $className |
||
64 | * @param \Cycle\ORM\ORMInterface $orm |
||
65 | * @param string $role |
||
66 | * @param array $scope |
||
67 | * |
||
68 | * @return \Cycle\ORM\Promise\PromiseInterface |
||
69 | */ |
||
70 | private function instantiate(string $className, ORMInterface $orm, string $role, array $scope): PromiseInterface |
||
74 | |||
75 | private function createName(\ReflectionClass $reflection): string |
||
79 | } |