Skip to content

Commit 4440c29

Browse files
ondrejmirtesclaude
andcommitted
Register ArenaCache by its generated signatures
ArenaCache's static methods spelled their arginfo by hand without the twin's return types; they register by the generated sig:: declarations now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018Fdg8n3eEi4ZoXa4dA2k4A
1 parent d5aa43a commit 4440c29

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

‎turbo-ext/src/ArenaCache.cpp‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
#include "support.h"
5252
#include "generated/ArenaCache.h"
53+
54+
namespace sigs = ptdecl::ArenaCache::sig;
5355
#include "reg.h"
5456
#include "zv.h"
5557

@@ -1177,60 +1179,60 @@ void pt_register_arena_cache()
11771179
ptdecl::ArenaCache::declareClass(cls);
11781180
ptdecl::ArenaCache::declareProperties(cls);
11791181

1180-
cls.method("create", reg::PublicStatic, 1, { reg::stringArg("runId") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1182+
cls.method(sigs::create, [](INTERNAL_FUNCTION_PARAMETERS) {
11811183
zend_string *runId;
11821184
if (!zp::parse<zp::Str>(execute_data, runId)) RETURN_THROWS();
11831185
phpstanturbo::ArenaCache::create(runId, return_value);
11841186
});
11851187

1186-
cls.method("attach", reg::PublicStatic, 1, { reg::stringArg("name") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1188+
cls.method(sigs::attach, [](INTERNAL_FUNCTION_PARAMETERS) {
11871189
zend_string *name;
11881190
if (!zp::parse<zp::Str>(execute_data, name)) RETURN_THROWS();
11891191
RETURN_BOOL(phpstanturbo::ArenaCache::attach(name));
11901192
});
11911193

1192-
cls.method("unlinkName", reg::PublicStatic, 0, {}, [](INTERNAL_FUNCTION_PARAMETERS) {
1194+
cls.method(sigs::unlinkName, [](INTERNAL_FUNCTION_PARAMETERS) {
11931195
ZEND_PARSE_PARAMETERS_NONE();
11941196
phpstanturbo::ArenaCache::unlinkName();
11951197
});
11961198

1197-
cls.method("destroy", reg::PublicStatic, 0, {}, [](INTERNAL_FUNCTION_PARAMETERS) {
1199+
cls.method(sigs::destroy, [](INTERNAL_FUNCTION_PARAMETERS) {
11981200
ZEND_PARSE_PARAMETERS_NONE();
11991201
phpstanturbo::ArenaCache::destroy();
12001202
});
12011203

1202-
cls.method("hasRecord", reg::PublicStatic, 1, { reg::stringArg("key") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1204+
cls.method(sigs::hasRecord, [](INTERNAL_FUNCTION_PARAMETERS) {
12031205
zend_string *key;
12041206
if (!zp::parse<zp::Str>(execute_data, key)) RETURN_THROWS();
12051207
RETURN_BOOL(phpstanturbo::ArenaCache::hasRecord(key));
12061208
});
12071209

1208-
cls.method("lookup", reg::PublicStatic, 1, { reg::stringArg("key") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1210+
cls.method(sigs::lookup, [](INTERNAL_FUNCTION_PARAMETERS) {
12091211
zend_string *key;
12101212
if (!zp::parse<zp::Str>(execute_data, key)) RETURN_THROWS();
12111213
phpstanturbo::ArenaCache::lookup(key, return_value);
12121214
});
12131215

1214-
cls.method("publish", reg::PublicStatic, 2, { reg::stringArg("key"), reg::any("value") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1216+
cls.method(sigs::publish, [](INTERNAL_FUNCTION_PARAMETERS) {
12151217
zend_string *key;
12161218
zval *value;
12171219
if (!zp::parse<zp::Str, zp::Zval>(execute_data, key, value)) RETURN_THROWS();
12181220
phpstanturbo::ArenaCache::publish(key, value);
12191221
});
12201222

1221-
cls.method("lookupHash", reg::PublicStatic, 2, { reg::stringArg("recordKey"), reg::stringArg("entryKey") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1223+
cls.method(sigs::lookupHash, [](INTERNAL_FUNCTION_PARAMETERS) {
12221224
zend_string *recordKey, *entryKey;
12231225
if (!zp::parse<zp::Str, zp::Str>(execute_data, recordKey, entryKey)) RETURN_THROWS();
12241226
phpstanturbo::ArenaCache::lookupHash(recordKey, entryKey, return_value);
12251227
});
12261228

1227-
cls.method("lookupHashAll", reg::PublicStatic, 1, { reg::stringArg("recordKey") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1229+
cls.method(sigs::lookupHashAll, [](INTERNAL_FUNCTION_PARAMETERS) {
12281230
zend_string *recordKey;
12291231
if (!zp::parse<zp::Str>(execute_data, recordKey)) RETURN_THROWS();
12301232
phpstanturbo::ArenaCache::lookupHashAll(recordKey, return_value);
12311233
});
12321234

1233-
cls.method("publishHash", reg::PublicStatic, 2, { reg::stringArg("recordKey"), reg::arrayArg("entries") }, [](INTERNAL_FUNCTION_PARAMETERS) {
1235+
cls.method(sigs::publishHash, [](INTERNAL_FUNCTION_PARAMETERS) {
12341236
zend_string *recordKey;
12351237
HashTable *entries;
12361238
if (!zp::parse<zp::Str, zp::Ht>(execute_data, recordKey, entries)) RETURN_THROWS();

‎turbo-ext/tests/signature-parity.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
'PhpParser\\NodeTraverser' => 'pending',
3838
'PHPStan\\Analyser\\ExpressionResultStorage' => 'pending',
3939
'PHPStan\\Analyser\\VariableLivenessResolver' => 'pending',
40-
'PHPStan\\Cache\\ArenaCache' => 'pending',
4140
'PHPStan\\Reflection\\BetterReflection\\SourceLocator\\PhpFileCleaner' => 'pending',
4241
'PHPStan\\Reflection\\BetterReflection\\SourceLocator\\SymbolFinderInFiles' => 'pending',
4342
'PHPStan\\Reflection\\Php\\PhpClassReflectionExtension' => 'pending',

0 commit comments

Comments
 (0)