serafim/ffi-ide-helper

This package is abandoned and no longer maintained. The author suggests using the php-ffi/ide-helper-generator package instead.

PHP FFI Helper for IDEA-based IDEs

1.0.0 2020-03-21 23:18 UTC

This package is auto-updated.

Last update: 2023-08-10 23:58:13 UTC


README

!!! This package is deprecated, please use https://github.com/php-ffi/ide-helper-generator instead

FFI IDE Helper

This package provides an extended autocomplete for PHP FFI in a PhpStorm IDE.

Features

Autocomplete by built-in C/C++ types

Automatic type inference

Type inference from pointers

Distinguishes pointers from values

Custom auto-complete by structures

And maybe something else... Offer as PR =))

Pointers Generator

  1. Create Configuration (like ffi-gen-config.php)
// Example C/C++ header declaration:
//
// typedef struct MyExampleStruct { ... } MyExampleStruct;
// extern void foo(MyExampleStruct* a);
// extern void foo(MyExampleStruct** b);
// 

return [
    'out'   => __DIR__ . '/resources/stubs',
    'types' => [
        'MyExampleStruct' => ['pointers' => 2],
    //  ^^^^^^^^^^^^^^^^                   ^ - Number of pointers.
    //  Your Class Name                        Number 2 means that will be created
    //                                         "MyExampleStructPtr" and "MyExampleStructPtrPtr" pointers
    ],
];
  1. Generate
$ vendor/bin/ffi-generator.php ffi-gen-config.php