'isUserDefined' => 'isUserDefined',
'isGenerator' => 'isGenerator',
'isVariadic' => 'isVariadic',
];
/**
* @return array
*/
public static function castClosure(\Closure
$c, array
$a, Stub
$stub, bool
$isNested, int
$filter = 0
) { $prefix = Caster::PREFIX_VIRTUAL;
$c =
new \
ReflectionFunction($c);
$a =
static::
castFunctionAbstract($c,
$a,
$stub,
$isNested,
$filter);
if (!
str_contains($c->name, '{closure}'
)) { $stub->class =
isset($a[$prefix.'class'
]) ?
$a[$prefix.'class'
]->value.'::'.
$c->name :
$c->name;
unset($a[$prefix.'class'
]);
} unset($a[$prefix.'extra'
]);
$stub->class .= self::
getSignature($a);