Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FFICaster.php

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\Caster

Code

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,
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal