1 | <?php |
||
16 | class ProxyPrinter |
||
17 | { |
||
18 | private const PROPERTY = '__resolver'; |
||
19 | |||
20 | private const DEPENDENCIES = [ |
||
21 | 'orm' => ORMInterface::class, |
||
22 | 'role' => 'string', |
||
23 | 'scope' => 'array' |
||
24 | ]; |
||
25 | |||
26 | /** @var ConflictResolver */ |
||
27 | private $resolver; |
||
28 | |||
29 | /** @var Traverser */ |
||
30 | private $traverser; |
||
31 | |||
32 | /** @var Extractor */ |
||
33 | private $extractor; |
||
34 | |||
35 | /** @var Lexer */ |
||
36 | private $lexer; |
||
37 | |||
38 | /** @var Parser */ |
||
39 | private $parser; |
||
40 | |||
41 | /** @var PrettyPrinterAbstract */ |
||
42 | private $printer; |
||
43 | |||
44 | /** @var Stubs */ |
||
45 | private $stubs; |
||
46 | |||
47 | public function __construct(ConflictResolver $resolver, Traverser $traverser, Extractor $extractor, Stubs $stubs) |
||
69 | |||
70 | /** |
||
71 | * |
||
72 | * @param Declaration $declaration |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function make(Declaration $declaration): string |
||
101 | |||
102 | private function propertyName(Structure $declaration): string |
||
106 | |||
107 | private function useStmts(Declaration $schema): array |
||
115 | |||
116 | private function propertyType(): string |
||
120 | |||
121 | /** |
||
122 | * @return Node\Stmt[]|null |
||
123 | */ |
||
124 | private function getNodesFromStub(): ?array |
||
128 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.