1 | <?php |
||
14 | class Printer |
||
15 | { |
||
16 | private const RESOLVER_PROPERTY = '__resolver'; |
||
17 | private const UNSET_PROPERTIES_CONST = 'UNSET_PROPERTIES'; |
||
18 | private const RESOLVE_METHOD = '__resolve'; |
||
19 | private const INIT_METHOD = '__init'; |
||
20 | |||
21 | private const DEPENDENCIES = [ |
||
22 | 'orm' => ORMInterface::class, |
||
23 | 'role' => 'string', |
||
24 | 'scope' => 'array' |
||
25 | ]; |
||
26 | |||
27 | private const USE_STMTS = [ |
||
28 | PromiseInterface::class, |
||
29 | PromiseResolver::class, |
||
30 | PromiseException::class, |
||
31 | ORMInterface::class |
||
32 | ]; |
||
33 | |||
34 | private const PROMISE_METHODS = [ |
||
35 | '__loaded' => 'bool', |
||
36 | '__role' => 'string', |
||
37 | '__scope' => 'array', |
||
38 | '__resolve' => null, |
||
39 | ]; |
||
40 | |||
41 | /** @var ConflictResolver */ |
||
42 | private $resolver; |
||
43 | |||
44 | /** @var Traverser */ |
||
45 | private $traverser; |
||
46 | |||
47 | /** @var Declaration\Extractor */ |
||
48 | private $extractor; |
||
49 | |||
50 | /** @var Lexer */ |
||
51 | private $lexer; |
||
52 | |||
53 | /** @var Parser */ |
||
54 | private $parser; |
||
55 | |||
56 | /** @var PrettyPrinterAbstract */ |
||
57 | private $printer; |
||
58 | |||
59 | /** @var Stubs */ |
||
60 | private $stubs; |
||
61 | |||
62 | public function __construct(ConflictResolver $resolver, Traverser $traverser, Declaration\Extractor $extractor, Stubs $stubs) |
||
84 | |||
85 | /** |
||
86 | * @param \ReflectionClass $reflection |
||
87 | * @param Declaration\DeclarationInterface $class |
||
88 | * @param Declaration\DeclarationInterface $parent |
||
89 | * |
||
90 | * @return string |
||
91 | * @throws \Cycle\ORM\Promise\ProxyFactoryException |
||
92 | */ |
||
93 | public function make(\ReflectionClass $reflection, Declaration\DeclarationInterface $class, Declaration\DeclarationInterface $parent): string |
||
141 | |||
142 | public function initMethodName(Declaration\Structure $structure): string |
||
146 | |||
147 | private function resolverPropertyName(Declaration\Structure $structure): string |
||
151 | |||
152 | private function unsetPropertiesConstName(Declaration\Structure $structure): string |
||
156 | |||
157 | private function useStmts(Declaration\DeclarationInterface $class, Declaration\DeclarationInterface $parent): array |
||
166 | |||
167 | private function propertyType(): string |
||
171 | |||
172 | /** |
||
173 | * @return Node\Stmt[] |
||
174 | */ |
||
175 | private function getNodesFromStub(): array |
||
179 | } |