mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 21:48:45 +02:00
⬆️ N°4770 Update to latest Symfony 3.4
This commit is contained in:
@@ -39,26 +39,36 @@ class ProxyHelper
|
||||
if (!$type) {
|
||||
return null;
|
||||
}
|
||||
if (!\is_string($type)) {
|
||||
$name = $type instanceof \ReflectionNamedType ? $type->getName() : $type->__toString();
|
||||
|
||||
if ($type->isBuiltin()) {
|
||||
return $noBuiltin ? null : $name;
|
||||
$types = [];
|
||||
|
||||
foreach ($type instanceof \ReflectionUnionType ? $type->getTypes() : [$type] as $type) {
|
||||
$name = $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type;
|
||||
|
||||
if (!\is_string($type) && $type->isBuiltin()) {
|
||||
if (!$noBuiltin) {
|
||||
$types[] = $name;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$lcName = strtolower($name);
|
||||
$prefix = $noBuiltin ? '' : '\\';
|
||||
|
||||
if ('self' !== $lcName && 'parent' !== $lcName) {
|
||||
$types[] = '' !== $prefix ? $prefix.$name : $name;
|
||||
continue;
|
||||
}
|
||||
if (!$r instanceof \ReflectionMethod) {
|
||||
continue;
|
||||
}
|
||||
if ('self' === $lcName) {
|
||||
$types[] = $prefix.$r->getDeclaringClass()->name;
|
||||
} else {
|
||||
$types[] = ($parent = $r->getDeclaringClass()->getParentClass()) ? $prefix.$parent->name : null;
|
||||
}
|
||||
}
|
||||
$lcName = strtolower($name);
|
||||
$prefix = $noBuiltin ? '' : '\\';
|
||||
|
||||
if ('self' !== $lcName && 'parent' !== $lcName) {
|
||||
return $prefix.$name;
|
||||
}
|
||||
if (!$r instanceof \ReflectionMethod) {
|
||||
return null;
|
||||
}
|
||||
if ('self' === $lcName) {
|
||||
return $prefix.$r->getDeclaringClass()->name;
|
||||
}
|
||||
|
||||
return ($parent = $r->getDeclaringClass()->getParentClass()) ? $prefix.$parent->name : null;
|
||||
return $types ? implode('|', $types) : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user