Files
frankenphp/internal/extgen/templates/stub.php.tpl
Kévin Dunglas abfd893d88 feat: FrankenPHP extensions (#1651)
* feat: add helpers to create PHP extensions (#1644)

* feat: add helpers to create PHP extensions

* cs

* feat: GoString

* test

* add test for RegisterExtension

* cs

* optimize includes

* fix

* feat(extensions): add the PHP extension generator (#1649)

* feat(extensions): add the PHP extension generator

* unexport many types

* unexport more symbols

* cleanup some tests

* unexport more symbols

* fix

* revert types files

* revert

* add better validation and fix templates

* remove GoStringCopy

* small fixes

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

* try to fix tests

* fix CS

* try some workarounds

* try some workarounds

* ingore TestRegisterExtension

* exclude cgo tests in Docker images

* fix

* workaround...

* race detector

* simplify tests and code

* make linter happy

* feat(gofile): use templates to generate the Go file (#1666)

---------

Co-authored-by: Alexandre Daubois <2144837+alexandre-daubois@users.noreply.github.com>
2025-06-25 10:18:22 +02:00

38 lines
772 B
Smarty

<?php
/** @generate-class-entries */
{{range .Constants}}{{if eq .ClassName ""}}{{if .IsIota}}/**
* @var int
* @cvalue {{.Name}}
*/
const {{.Name}} = UNKNOWN;
{{else}}/**
* @var {{phpType .PhpType}}
*/
const {{.Name}} = {{.Value}};
{{end}}{{end}}{{end}}{{range .Functions}}function {{.Signature}} {}
{{end}}{{range .Classes}}{{$className := .Name}}class {{.Name}} {
{{range $.Constants}}{{if eq .ClassName $className}}{{if .IsIota}} /**
* @var int
* @cvalue {{.Name}}
*/
public const {{.Name}} = UNKNOWN;
{{else}} /**
* @var {{phpType .PhpType}}
*/
public const {{.Name}} = {{.Value}};
{{end}}{{end}}{{end}}
public function __construct() {}
{{range .Methods}}
public function {{.Signature}} {}
{{end}}
}
{{end}}