mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 09:38:23 +01:00
Qual: PHPdoc for anonymous function
This commit is contained in:
@@ -1180,7 +1180,9 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto', $saverestore = '')
|
|||||||
$minute = intval($m[2]);
|
$minute = intval($m[2]);
|
||||||
$second = intval($m[3]);
|
$second = intval($m[3]);
|
||||||
} elseif ($hourTime === 'end') {
|
} elseif ($hourTime === 'end') {
|
||||||
$hour = 23; $minute = 59; $second = 59;
|
$hour = 23;
|
||||||
|
$minute = 59;
|
||||||
|
$second = 59;
|
||||||
} else {
|
} else {
|
||||||
$hour = $minute = $second = 0;
|
$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
|
// 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
|
global $conf, // Read of const is done with getDolGlobalString() but we need $conf->currency for example
|
||||||
$db, $langs, $user, $website, $websitepage,
|
$db, $langs, $user, $website, $websitepage,
|
||||||
$action, $mainmenu, $leftmenu,
|
$action, $mainmenu, $leftmenu,
|
||||||
$mysoc,
|
$mysoc,
|
||||||
$objectoffield, // To allow the use of $objectoffield in computed fields
|
$objectoffield, // To allow the use of $objectoffield in computed fields
|
||||||
|
|
||||||
// Old variables used
|
// Old variables used
|
||||||
$object,
|
$object,
|
||||||
$obj; // To get $obj used into list when dol_eval() is used for computed fields and $obj is not yet $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
|
// PHP < 7.4.0
|
||||||
defined('T_COALESCE_EQUAL') || define('T_COALESCE_EQUAL', PHP_INT_MAX);
|
defined('T_COALESCE_EQUAL') || define('T_COALESCE_EQUAL', PHP_INT_MAX);
|
||||||
@@ -11870,10 +11872,23 @@ function dolExplodeKeepIfQuotes($input)
|
|||||||
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
|
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
|
||||||
|
|
||||||
// Merge result and delete empty values
|
// Merge result and delete empty values
|
||||||
// @phan-suppress-next-line PhanPluginUnknownClosureParamType, PhanPluginUnknownClosureReturnType
|
return array_filter(array_map(
|
||||||
return array_filter(array_map(function ($a, $b, $c) {
|
/**
|
||||||
return $a ?: ($b ?: $c);
|
* Return first non-empty item, or empty string
|
||||||
}, $matches[1], $matches[2], $matches[3]));
|
*
|
||||||
|
* @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]
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user