1 | <?php |
||
13 | class ProxyCreator |
||
14 | { |
||
15 | private const PROPERTY = '__resolver'; |
||
16 | |||
17 | private const DEPENDENCIES = [ |
||
18 | 'orm' => ORMInterface::class, |
||
19 | 'target' => 'string', |
||
20 | 'scope' => 'array' |
||
21 | ]; |
||
22 | |||
23 | /** @var ConflictResolver */ |
||
24 | private $resolver; |
||
25 | |||
26 | /** @var Traverser */ |
||
27 | private $traverser; |
||
28 | |||
29 | /** @var Declaration\Extractor */ |
||
30 | private $extractor; |
||
31 | |||
32 | /** @var Lexer */ |
||
33 | private $lexer; |
||
34 | |||
35 | /** @var Parser */ |
||
36 | private $parser; |
||
37 | |||
38 | /** @var PrettyPrinterAbstract */ |
||
39 | private $printer; |
||
40 | |||
41 | public function __construct(ConflictResolver $resolver, Traverser $traverser, Declaration\Extractor $extractor) |
||
62 | |||
63 | /** |
||
64 | * |
||
65 | * @param string $class |
||
66 | * @param string $as |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public function make(string $class, string $as): string |
||
96 | |||
97 | private function propertyName(Declaration\Declaration $declaration): string |
||
101 | |||
102 | private function useStmts(Declaration\Schema $schema): array |
||
110 | |||
111 | private function propertyType(): string |
||
115 | |||
116 | private function getNodesFromStub() |
||
120 | |||
121 | private function getStubFilename(): string |
||
125 | } |
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.