Skip to content

Commit 7a9baf5

Browse files
feat(extgen): add support for arrays as parameters and return types
1 parent 50b438f commit 7a9baf5

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

internal/extgen/validator_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,30 @@ func TestValidateFunction(t *testing.T) {
6060
},
6161
expectError: false,
6262
},
63+
{
64+
name: "valid function with array parameter",
65+
function: phpFunction{
66+
Name: "arrayFunction",
67+
ReturnType: "array",
68+
Params: []phpParameter{
69+
{Name: "items", PhpType: "array"},
70+
{Name: "filter", PhpType: "string"},
71+
},
72+
},
73+
expectError: false,
74+
},
75+
{
76+
name: "valid function with nullable array parameter",
77+
function: phpFunction{
78+
Name: "nullableArrayFunction",
79+
ReturnType: "string",
80+
Params: []phpParameter{
81+
{Name: "items", PhpType: "array", IsNullable: true},
82+
{Name: "name", PhpType: "string"},
83+
},
84+
},
85+
expectError: false,
86+
},
6387
{
6488
name: "empty function name",
6589
function: phpFunction{

0 commit comments

Comments
 (0)