Conditions | 4 |
Paths | 4 |
Total Lines | 33 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
53 | public function getUseStmtAliasAndType(): array |
||
54 | { |
||
55 | $use = ParentNodeAppender::getParent($this->name); |
||
56 | |||
57 | if (!($use instanceof UseUse)) { |
||
58 | throw new UnexpectedValueException( |
||
59 | sprintf( |
||
60 | 'Unexpected use statement name parent "%s"', |
||
61 | get_class($use), |
||
62 | ), |
||
63 | ); |
||
64 | } |
||
65 | |||
66 | $useParent = ParentNodeAppender::getParent($use); |
||
67 | |||
68 | if (!($useParent instanceof Use_)) { |
||
69 | throw new UnexpectedValueException( |
||
70 | sprintf( |
||
71 | 'Unexpected UseUse parent "%s"', |
||
72 | get_class($useParent), |
||
73 | ), |
||
74 | ); |
||
75 | } |
||
76 | |||
77 | $alias = $use->alias; |
||
78 | |||
79 | if (null !== $alias) { |
||
80 | $alias = (string) $alias; |
||
81 | } |
||
82 | |||
83 | return [ |
||
84 | $alias, |
||
85 | $useParent->type, |
||
86 | ]; |
||
89 |