Skip to content

Commit e9800f0

Browse files
committed
[+]: "PHPParameter" -> revert: workaround for missing default value from constants
1 parent b70d914 commit e9800f0

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/voku/SimplePhpParser/Model/PHPParameter.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,7 @@ public function readObjectFromBetterReflection($parameter): self
163163
$this->type = '\\' . \ltrim($this->type, '\\');
164164
}
165165

166-
if ($type instanceof ReflectionParameter) {
167-
// fix for this issue: https://github.com/Roave/BetterReflection/pull/678
168-
if ($type->isDefaultValueConstant()) {
169-
$constNameTmp = $type->getDefaultValueConstantName();
170-
if (defined($constNameTmp)) {
171-
$defaultTmp = constant($constNameTmp);
172-
if ($defaultTmp === null) {
173-
if ($this->type && $this->type !== 'null') {
174-
$this->type = 'null|' . $this->type;
175-
} else {
176-
$this->type = 'null|mixed';
177-
}
178-
}
179-
}
180-
}
181-
} else if ($type->allowsNull()) {
166+
if ($type->allowsNull()) {
182167
if ($this->type && $this->type !== 'null') {
183168
$this->type = 'null|' . $this->type;
184169
} else {

0 commit comments

Comments
 (0)