Skip to content

Commit 65a8561

Browse files
Martin RademacherDerManoMann
authored andcommitted
Use ReflectionParameter::getType() instead of getClass()
`iReflectionParameter::getClass()` is deprecated as of PHP 8 and will trigger a warning.
1 parent 41f77e8 commit 65a8561

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/DocBlock/StandardTagFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ private function getArgumentsForParametersFromWiring(array $parameters, array $l
254254
{
255255
$arguments = [];
256256
foreach ($parameters as $parameter) {
257-
$class = $parameter->getClass();
257+
$type = $parameter->getType();
258258
$typeHint = null;
259-
if ($class !== null) {
260-
$typeHint = $class->getName();
259+
if ($type instanceof \ReflectionNamedType) {
260+
$typeHint = $type->getName();
261261
}
262262

263263
if (isset($locator[$typeHint])) {

0 commit comments

Comments
 (0)