Skip to content

Commit 6ee2cf6

Browse files
committed
Avoided the warning.
1 parent f367c4d commit 6ee2cf6

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/Php/PhpClass.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,28 +165,24 @@ private function getMethodInfo(ClassMethod $method): PhpMethod
165165
public function getExtends(): array
166166
{
167167
$extends = [];
168-
if (!empty($this->syntax->extends)) {
169-
$Name = $this->syntax->extends;
170-
if (is_array($this->syntax->extends)) {
171-
$Name = $this->syntax->extends[0];
172-
}
173-
if ($Name instanceof FullyQualified) {
168+
if (property_exists($this->syntax, 'extends')) {
169+
$extend = $this->syntax->{'extends'};
170+
if ($extend instanceof FullyQualified) {
174171
$extends[] = new PhpType(
175-
array_slice($Name->parts, 0, count($Name->parts) - 1),
172+
array_slice($extend->parts, 0, count($extend->parts) - 1),
176173
'',
177-
end($Name->parts)
174+
end($extend->parts)
178175
);
179176
}
180177
}
181178

182-
if (!empty($this->syntax->implements)) {
183-
foreach ($this->syntax->implements as $Name) {
184-
// $parts = $i->parts;
185-
if ($Name instanceof FullyQualified) {
179+
if (property_exists($this->syntax, 'implements')) {
180+
foreach ($this->syntax->{'implements'} as $implement) {
181+
if ($implement instanceof FullyQualified) {
186182
$extends[] = new PhpType(
187-
array_slice($Name->parts, 0, count($Name->parts) - 1),
183+
array_slice($implement->parts, 0, count($implement->parts) - 1),
188184
'',
189-
end($Name->parts)
185+
end($implement->parts)
190186
);
191187
}
192188
}

0 commit comments

Comments
 (0)