mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-15 19:33:57 +09:00
Updates to vendors etc
This commit is contained in:
@@ -22,6 +22,7 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
{
|
||||
$arguments = [];
|
||||
$reflector ??= new \ReflectionFunction($controller(...));
|
||||
$controllerName = $this->getPrettyName($reflector);
|
||||
|
||||
foreach ($reflector->getParameters() as $param) {
|
||||
$attributes = [];
|
||||
@@ -31,7 +32,7 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
}
|
||||
}
|
||||
|
||||
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $param->isVariadic(), $param->isDefaultValueAvailable(), $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, $param->allowsNull(), $attributes);
|
||||
$arguments[] = new ArgumentMetadata($param->getName(), $this->getType($param), $param->isVariadic(), $param->isDefaultValueAvailable(), $param->isDefaultValueAvailable() ? $param->getDefaultValue() : null, $param->allowsNull(), $attributes, $controllerName);
|
||||
}
|
||||
|
||||
return $arguments;
|
||||
@@ -53,4 +54,19 @@ final class ArgumentMetadataFactory implements ArgumentMetadataFactoryInterface
|
||||
default => $name,
|
||||
};
|
||||
}
|
||||
|
||||
private function getPrettyName(\ReflectionFunctionAbstract $r): string
|
||||
{
|
||||
$name = $r->name;
|
||||
|
||||
if ($r instanceof \ReflectionMethod) {
|
||||
return $r->class.'::'.$name;
|
||||
}
|
||||
|
||||
if ($r->isAnonymous() || !$class = $r->getClosureCalledClass()) {
|
||||
return $name;
|
||||
}
|
||||
|
||||
return $class->name.'::'.$name;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user