Qual: PHPdoc for anonymous function

This commit is contained in:
MDW
2025-02-24 16:12:19 +01:00
parent 8bec32aff2
commit d7c926a08b

View File

@@ -1180,7 +1180,9 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto', $saverestore = '')
$minute = intval($m[2]);
$second = intval($m[3]);
} elseif ($hourTime === 'end') {
$hour = 23; $minute = 59; $second = 59;
$hour = 23;
$minute = 59;
$second = 59;
} else {
$hour = $minute = $second = 0;
}
@@ -10674,14 +10676,14 @@ function dol_eval_new($s)
{
// Only this global variables can be read by eval function and returned to caller
global $conf, // Read of const is done with getDolGlobalString() but we need $conf->currency for example
$db, $langs, $user, $website, $websitepage,
$action, $mainmenu, $leftmenu,
$mysoc,
$objectoffield, // To allow the use of $objectoffield in computed fields
$db, $langs, $user, $website, $websitepage,
$action, $mainmenu, $leftmenu,
$mysoc,
$objectoffield, // To allow the use of $objectoffield in computed fields
// Old variables used
$object,
$obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object
// Old variables used
$object,
$obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $object
// PHP < 7.4.0
defined('T_COALESCE_EQUAL') || define('T_COALESCE_EQUAL', PHP_INT_MAX);
@@ -11870,10 +11872,23 @@ function dolExplodeKeepIfQuotes($input)
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
// Merge result and delete empty values
// @phan-suppress-next-line PhanPluginUnknownClosureParamType, PhanPluginUnknownClosureReturnType
return array_filter(array_map(function ($a, $b, $c) {
return $a ?: ($b ?: $c);
}, $matches[1], $matches[2], $matches[3]));
return array_filter(array_map(
/**
* Return first non-empty item, or empty string
*
* @param string $a Possibly empty item - match ""
* @param string $b Possibly empty item - match ''
* @param string $c Non empty string if $a and $b are empty
*
* @return string
*/
static function ($a, $b, $c) {
return $a ?: ($b ?: $c);
},
$matches[1],
$matches[2],
$matches[3]
));
}