fix: change adminOld return type from string to string|array

The closure returned arrays when formData values were arrays (e.g.
jury_promoteur), but the PHP return type annotation was :string.
PHP 8.x enforces this strictly, causing a fatal TypeError in
jury-fieldset.php on add mode.
This commit is contained in:
Pontoporeia
2026-06-15 16:16:02 +02:00
parent d588ae004d
commit a5db81a73d
3 changed files with 14 additions and 7 deletions

View File

@@ -48,7 +48,7 @@ class FormBootstrap
*/
public static function adminOld(array &$formData): callable
{
return function (string $key, string $default = '') use (&$formData): string {
return function (string $key, string $default = '') use (&$formData): string|array {
if (!isset($formData[$key])) return $default;
if (is_array($formData[$key])) return $formData[$key];
if ($formData[$key] === null) return $default;