MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / php_group_array_prefix

Function php_group_array_prefix

internal/cbm/extract_calls.c:1850–1868  ·  view source on GitHub ↗

The literal 'prefix' of an attribute-array group (#1146): * Route::group(['prefix' => 'v1/autocomplete', 'as' => ...], function () {...}), * the form Firefly III's whole API is written in. */

Source from the content-addressed store, hash-verified

1848 * Route::group(['prefix' => 'v1/autocomplete', 'as' => ...], function () {...}),
1849 * the form Firefly III's whole API is written in. */
1850static const char *php_group_array_prefix(CBMArena *a, TSNode group_call, const char *source) {
1851 TSNode attrs = php_first_arg_value(group_call);
1852 if (ts_node_is_null(attrs) || strcmp(ts_node_type(attrs), "array_creation_expression") != 0) {
1853 return NULL;
1854 }
1855 uint32_t nc = ts_node_named_child_count(attrs);
1856 for (uint32_t i = 0; i < nc; i++) {
1857 TSNode el = ts_node_named_child(attrs, i);
1858 if (strcmp(ts_node_type(el), "array_element_initializer") != 0 ||
1859 ts_node_named_child_count(el) != PAIR_LEN) {
1860 continue;
1861 }
1862 const char *key = php_plain_string_value(a, ts_node_named_child(el, 0), source);
1863 if (key && strcmp(key, "prefix") == 0) {
1864 return php_plain_string_value(a, ts_node_named_child(el, SKIP_ONE), source);
1865 }
1866 }
1867 return NULL;
1868}
1869
1870static const char *php_group_prefix_for_call(CBMArena *a, TSNode node, const char *source) {
1871 const char *parts[PHP_PREFIX_PARTS_MAX] = {NULL};

Callers 1

Calls 2

php_first_arg_valueFunction · 0.85
php_plain_string_valueFunction · 0.85

Tested by

no test coverage detected