Aggiornato Composer
This commit is contained in:
@@ -42,7 +42,7 @@ class ReflectionCaster
|
||||
|
||||
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
||||
|
||||
if (!str_contains($c->name, '{closure}')) {
|
||||
if (!str_contains($c->name, '{closure')) {
|
||||
$stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name;
|
||||
unset($a[$prefix.'class']);
|
||||
}
|
||||
@@ -116,10 +116,16 @@ class ReflectionCaster
|
||||
|
||||
public static function castAttribute(\ReflectionAttribute $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
self::addMap($a, $c, [
|
||||
$map = [
|
||||
'name' => 'getName',
|
||||
'arguments' => 'getArguments',
|
||||
]);
|
||||
];
|
||||
|
||||
if (\PHP_VERSION_ID >= 80400) {
|
||||
unset($map['name']);
|
||||
}
|
||||
|
||||
self::addMap($a, $c, $map);
|
||||
|
||||
return $a;
|
||||
}
|
||||
@@ -197,7 +203,7 @@ class ReflectionCaster
|
||||
self::addMap($a, $c, [
|
||||
'returnsReference' => 'returnsReference',
|
||||
'returnType' => 'getReturnType',
|
||||
'class' => 'getClosureScopeClass',
|
||||
'class' => \PHP_VERSION_ID >= 80111 ? 'getClosureCalledClass' : 'getClosureScopeClass',
|
||||
'this' => 'getClosureThis',
|
||||
]);
|
||||
|
||||
@@ -292,7 +298,7 @@ class ReflectionCaster
|
||||
if ($c->isOptional()) {
|
||||
try {
|
||||
$a[$prefix.'default'] = $v = $c->getDefaultValue();
|
||||
if ($c->isDefaultValueConstant()) {
|
||||
if ($c->isDefaultValueConstant() && !\is_object($v)) {
|
||||
$a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
|
||||
}
|
||||
if (null === $v) {
|
||||
@@ -362,7 +368,7 @@ class ReflectionCaster
|
||||
if (!$type instanceof \ReflectionNamedType) {
|
||||
$signature .= $type.' ';
|
||||
} else {
|
||||
if (!$param->isOptional() && $param->allowsNull() && 'mixed' !== $type->getName()) {
|
||||
if ($param->allowsNull() && 'mixed' !== $type->getName()) {
|
||||
$signature .= '?';
|
||||
}
|
||||
$signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' ';
|
||||
|
||||
Reference in New Issue
Block a user