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]); $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;
} }
@@ -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 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); return $a ?: ($b ?: $c);
}, $matches[1], $matches[2], $matches[3])); },
$matches[1],
$matches[2],
$matches[3]
));
} }