Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
0063e79
fix(extgen): count grouped Go parameters individually
alexandre-daubois Aug 7, 2026
060c02c
fix(extgen): keep nullable mixed parameters a single pointer
alexandre-daubois Aug 7, 2026
a33dec0
fix(extgen): initialize generated callable parameters to NULL
alexandre-daubois Aug 7, 2026
b9e0889
fix(extgen): qualify method wrappers with their class name
alexandre-daubois Aug 7, 2026
092ac2e
fix(extgen): type method array and mixed parameters as the C side pas…
alexandre-daubois Aug 7, 2026
658e6ee
fix(extgen): return mixed values from generated functions and methods
alexandre-daubois Aug 7, 2026
35a9c25
fix(extgen): call the Go method actually backing the PHP method
alexandre-daubois Aug 7, 2026
107bab5
refactor(extgen): derive generated Go signatures from the validator
alexandre-daubois Aug 7, 2026
34282f4
fix(extgen): normalize Go-only integer literals for the C output
alexandre-daubois Aug 7, 2026
bcba07f
fix(extgen): re-quote raw string constants
alexandre-daubois Aug 7, 2026
27d3447
fix(extgen): accept typed constant declarations
alexandre-daubois Aug 7, 2026
17aa482
fix(extgen): reject methods targeting an unexported class
alexandre-daubois Aug 7, 2026
0a3e190
refactor(extgen): parse the source once in the class parser
alexandre-daubois Aug 7, 2026
46fcde2
refactor(extgen): route class parser warnings through warnf
alexandre-daubois Aug 7, 2026
6e9564e
refactor(extgen): remove the unused classParser.Parse wrapper
alexandre-daubois Aug 7, 2026
8548a4d
refactor(extgen): drop the dead source analyzer extraction
alexandre-daubois Aug 7, 2026
cdc5ec2
docs: correct the extension type table for mixed and callable
alexandre-daubois Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/cn/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@ echo $processor->process('Hello World', StringProcessor::MODE_UPPERCASE); // "H
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `object` | `struct` | ❌ | _尚未实现_ | _尚未实现_ | ❌ |

> [!NOTE]
>
> 此表尚不详尽,将随着 FrankenPHP 类型 API 变得更加完整而完善。
>
> 特别是对于类方法,目前支持原始类型和数组。对象尚不能用作方法参数或返回类型。
> 特别是对于类方法,目前支持原始类型、数组、`mixed` 和 `callable`。对象尚不能用作方法参数或返回类型。

如果你参考上一节的代码片段,你可以看到助手用于转换第一个参数和返回值。我们的 `repeat_this()` 函数的第二和第三个参数不需要转换,因为底层类型的内存表示对于 C 和 Go 都是相同的。

Expand Down
6 changes: 3 additions & 3 deletions docs/es/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ Esta tabla resume lo que necesitas saber:
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | |
| `object` | `struct` | ❌ | _Aún no implementado_ | _Aún no implementado_ | ❌ |

> [!NOTE]
>
> Esta tabla aún no es exhaustiva y se completará a medida que la API de tipos de FrankenPHP se vuelva más completa.
>
> Para métodos de clase específicamente, los tipos primitivos y los arrays están actualmente soportados. Los objetos aún no pueden usarse como parámetros de métodos o tipos de retorno.
> Para métodos de clase específicamente, los tipos primitivos, los arrays, `mixed` y `callable` están actualmente soportados. Los objetos aún no pueden usarse como parámetros de métodos o tipos de retorno.

Si te refieres al fragmento de código de la sección anterior, puedes ver que se usan helpers para convertir el primer parámetro y el valor de retorno. El segundo y tercer parámetro de nuestra función `repeat_this()` no necesitan ser convertidos ya que la representación en memoria de los tipos subyacentes es la misma para C y Go.

Expand Down
6 changes: 3 additions & 3 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ This table summarizes what you need to know:
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | |
| `object` | `struct` | ❌ | _Not yet implemented_ | _Not yet implemented_ | ❌ |

> [!NOTE]
>
> This table is not exhaustive yet and will be completed as the FrankenPHP types API gets more complete.
>
> For class methods specifically, primitive types and arrays are currently supported. Objects cannot be used as method parameters or return types yet.
> For class methods specifically, primitive types, arrays, `mixed` and `callable` are currently supported. Objects cannot be used as method parameters or return types yet.

If you refer to the code snippet of the previous section, you can see that helpers are used to convert the first parameter and the return value. The second and third parameters of our `repeat_this()` function don't need to be converted, as the memory representation of the underlying types is the same for both C and Go.

Expand Down
5 changes: 3 additions & 2 deletions docs/fr/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@ Bien que certains types de variables aient la même représentation mémoire ent
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | ✅ |
| `object` | `struct` | ❌ | _Pas encore implémenté_ | _Pas encore implémenté_ | ❌ |

> [!NOTE]
> Ce tableau n'est pas encore exhaustif et sera complété au fur et à mesure que l'API de types FrankenPHP deviendra plus complète.
>
> Pour les méthodes de classe spécifiquement, les types primitifs et les tableaux sont supportés. Les objets ne peuvent pas encore être utilisés comme paramètres de méthode ou types de retour.
> Pour les méthodes de classe spécifiquement, les types primitifs, les tableaux, `mixed` et `callable` sont supportés. Les objets ne peuvent pas encore être utilisés comme paramètres de méthode ou types de retour.

Si vous vous référez à l'extrait de code de la section précédente, vous pouvez voir que des assistants sont utilisés pour convertir le premier paramètre et la valeur de retour. Les deuxième et troisième paramètres de notre fonction `repeat_this()` n'ont pas besoin d'être convertis car la représentation mémoire des types sous-jacents est la même pour C et Go.

Expand Down
6 changes: 3 additions & 3 deletions docs/it/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ Questa tabella riassume il necessario:
| `array` | `frankenphp.AssociativeArray` | ❌| `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌| `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌| `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌| `GoValue()` | `PHPValue()` | |
| `callable` | `*C.zval` | ❌| - | frankenphp.CallPHPCallable() | |
| `mixed` | `*C.zval` | ❌| `frankenphp.GoValue()` | `frankenphp.PHPValue()` | |
| `callable` | `*C.zval` | ❌| - | frankenphp.CallPHPCallable() | |
| `object` | `struct` | ❌| _Non ancora implementato_ | _Non ancora implementato_ | ❌|

> [!NOTE]
>
> Questa tabella non è ancora esaustiva e verrà completata man mano che l'API dei tipi FrankenPHP diventerà più completa.
>
> Per i metodi di classe, in particolare, sono attualmente supportati i tipi primitivi e gli array. Gli oggetti non possono ancora essere utilizzati come parametri di metodo o tipi di ritorno.
> Per i metodi di classe, in particolare, sono attualmente supportati i tipi primitivi, gli array, `mixed` e `callable`. Gli oggetti non possono ancora essere utilizzati come parametri di metodo o tipi di ritorno.

Facendo riferimento allo snippet di codice della sezione precedente, si può vedere che gli helper vengono utilizzati per convertire il primo parametro e il valore restituito. Non è necessario convertire il secondo e il terzo parametro della nostra funzione `repeat_this()`, poiché la rappresentazione in memoria dei tipi sottostanti è la stessa sia per C sia per Go.

Expand Down
6 changes: 3 additions & 3 deletions docs/ja/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ C/PHPとGoの間でメモリ表現が同じ変数型もありますが、直接
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `object` | `struct` | ❌ | _未実装_ | _未実装_ | ❌ |

> [!NOTE]
>
> この表はまだ完全ではなく、FrankenPHPの型APIがより完全になるにつれて完成されます。
>
> クラスメソッドについては、現在プリミティブ型と配列がサポートされています。オブジェクトはまだメソッドパラメータや戻り値の型として使用できません。
> クラスメソッドについては、現在プリミティブ型、配列、`mixed`、`callable` がサポートされています。オブジェクトはまだメソッドパラメータや戻り値の型として使用できません。

前のセクションのコードスニペットを参照すると、最初のパラメータと戻り値の変換にヘルパーが使用されていることがわかります。 `repeat_this()`関数の2番目と3番目の引数は、基礎となる型のメモリ表現がCとGoで同じであるため、変換する必要がありません。

Expand Down
8 changes: 4 additions & 4 deletions docs/pt-br/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,20 +139,20 @@ Esta tabela resume o que você precisa saber:
| `?float` | `*float64` | ✅ | - | - | ✅ |
| `bool` | `bool` | ✅ | - | - | ✅ |
| `?bool` | `*bool` | ✅ | - | - | ✅ |
| `?bool` | `*bool` | ✅ | - | - | ✅ |
| `string`/`?string` | `*C.zend_string` | ❌ | `frankenphp.GoString()` | `frankenphp.PHPString()` | ✅ |
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | frankenphp.CallPHPCallable() | ✅ |
| `object` | `struct` | ❌ | _Ainda não implementado_ | _Ainda não implementado_ | ❌ |

> [!NOTE]
> Esta tabela ainda não é exaustiva e será completada à medida que a API de
> tipos do FrankenPHP se tornar mais completa.
>
> Tipos primitivos e arrays são suportados atualmente, especificamente para
> métodos de classe.
> Tipos primitivos, arrays, `mixed` e `callable` são suportados atualmente,
> especificamente para métodos de classe.
> Objetos ainda não podem ser usados como parâmetros de métodos ou tipos de
> retorno.

Expand Down
6 changes: 3 additions & 3 deletions docs/ru/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,15 @@ echo $processor->process('Hello World', StringProcessor::MODE_UPPERCASE); // "H
| `array` | `frankenphp.AssociativeArray` | ❌ | `frankenphp.GoAssociativeArray()` | `frankenphp.PHPAssociativeArray()` | ✅ |
| `array` | `map[string]any` | ❌ | `frankenphp.GoMap()` | `frankenphp.PHPMap()` | ✅ |
| `array` | `[]any` | ❌ | `frankenphp.GoPackedArray()` | `frankenphp.PHPPackedArray()` | ✅ |
| `mixed` | `any` | ❌ | `GoValue()` | `PHPValue()` | ❌ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `mixed` | `*C.zval` | ❌ | `frankenphp.GoValue()` | `frankenphp.PHPValue()` | ✅ |
| `callable` | `*C.zval` | ❌ | - | `frankenphp.CallPHPCallable()` | |
| `object` | `struct` | ❌ | _Пока не реализовано_ | _Пока не реализовано_ | ❌ |

> [!NOTE]
>
> Эта таблица еще не исчерпывающая и будет пополняться по мере доработки API типов FrankenPHP.
>
> Для методов классов, в частности, в настоящее время поддерживаются примитивные типы и массивы. Объекты пока не могут использоваться в качестве параметров методов или возвращаемых типов.
> Для методов классов, в частности, в настоящее время поддерживаются примитивные типы, массивы, `mixed` и `callable`. Объекты пока не могут использоваться в качестве параметров методов или возвращаемых типов.

Если вы обратитесь к фрагменту кода из предыдущего раздела, вы увидите, что для преобразования первого параметра и возвращаемого значения используются вспомогательные функции. Второй и третий параметры нашей функции `repeat_this()` не требуют преобразования, так как представление в памяти базовых типов одинаково как для C, так и для Go.

Expand Down
Loading
Loading