function FFICaster::castFFIFunction
File
-
vendor/
symfony/ var-dumper/ Caster/ FFICaster.php, line 68
Class
- FFICaster
- Casts FFI extension classes to array representation.
Namespace
Symfony\Component\VarDumper\CasterCode
private static function castFFIFunction(Stub $stub, CType $type) : array {
$arguments = [];
for ($i = 0, $count = $type->getFuncParameterCount(); $i < $count; ++$i) {
$param = $type->getFuncParameterType($i);
$arguments[] = $param->getName();
}
$abi = match ($type->getFuncABI()) { CType::ABI_DEFAULT, CType::ABI_CDECL => '[cdecl]',
CType::ABI_FASTCALL => '[fastcall]',
CType::ABI_THISCALL => '[thiscall]',
CType::ABI_STDCALL => '[stdcall]',
CType::ABI_PASCAL => '[pascal]',
CType::ABI_REGISTER => '[register]',
CType::ABI_MS => '[ms]',
CType::ABI_SYSV => '[sysv]',
CType::ABI_VECTORCALL => '[vectorcall]',
default => '[unknown abi]',
};
$returnType = $type->getFuncReturnType();
$stub->class = $abi . ' callable(' . implode(', ', $arguments) . '): ' . $returnType->getName();
return [
Caster::PREFIX_VIRTUAL . 'returnType' => $returnType,
];
}