mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Fix #896 - improve ReflectionParameter::getType return
This commit is contained in:
parent
0fa7cbeb02
commit
9a9adf897d
@ -9543,7 +9543,7 @@ return [
|
||||
'ReflectionParameter::getDefaultValueConstantName' => ['string'],
|
||||
'ReflectionParameter::getName' => ['string'],
|
||||
'ReflectionParameter::getPosition' => ['int'],
|
||||
'ReflectionParameter::getType' => ['ReflectionType'],
|
||||
'ReflectionParameter::getType' => ['ReflectionType|null'],
|
||||
'ReflectionParameter::hasType' => ['bool'],
|
||||
'ReflectionParameter::isArray' => ['bool'],
|
||||
'ReflectionParameter::isCallable' => ['bool'],
|
||||
|
@ -166,6 +166,18 @@ class MethodCallTest extends TestCase
|
||||
return $b->getAttribute("bat");
|
||||
}',
|
||||
],
|
||||
'reflectionParameter' => [
|
||||
'<?php
|
||||
function getTypeName(ReflectionParameter $parameter): string {
|
||||
$type = $parameter->getType();
|
||||
|
||||
if ($type === null) {
|
||||
return "mixed";
|
||||
}
|
||||
|
||||
return $type->getName();
|
||||
}'
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user