rexstan icon indicating copy to clipboard operation
rexstan copied to clipboard

Support rex superglobals array types

Open staabm opened this issue 2 years ago • 2 comments

$form = rex_post('form', 'array[string]', []); should be detected as array<string> etc.

staabm avatar Aug 07 '23 16:08 staabm

array[string] scheint mir unterstützt zu werden: https://github.com/FriendsOfREDAXO/rexstan/blob/e4d1213b6fc04e845cce3d9708c1407e7880eff5/lib/extension/RexFunctionsDynamicReturnTypeExtension.php#L142-L153

Was mir aber zu fehlen scheint (nicht getestet), sind Array-Shapes, die in rex so notiert werden:

$form = rex_post('form', [
    ['foo', 'int', 1],
    ['kitchen', 'array[string]'],
]);

Für das psalm-Plugin habe ich es hier umgesetzt (keine Ahnung ob hilfreich): https://github.com/redaxo/psalm-plugin/blob/main/src/Provider/RexTypeReturnProvider.php#L138

gharlan avatar Aug 07 '23 16:08 gharlan

In 5.17 kam noch eine weitere Array-Variante hinzu: https://github.com/redaxo/redaxo/pull/6031

gharlan avatar Mar 13 '24 21:03 gharlan