mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user