forked from Wavyzz/dolibarr
Fix phan
This commit is contained in:
@@ -11851,6 +11851,25 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)
|
||||
*
|
||||
* @param string $input String to explode
|
||||
* @return array<string> Array of string values
|
||||
*/
|
||||
function dolExplodeKeepIfQuotes($input)
|
||||
{
|
||||
// Use regexp to capture words and section in quotes
|
||||
$matches = array();
|
||||
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
|
||||
|
||||
// Merge result and delete empty values
|
||||
// @phan-suppress-next-line PhanPluginUnknownClosureParamType
|
||||
return array_filter(array_map(function ($a, $b, $c) {
|
||||
return $a ?: ($b ?: $c);
|
||||
}, $matches[1], $matches[2], $matches[3]));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
|
||||
@@ -11881,26 +11900,6 @@ function dol_getmypid()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)
|
||||
*
|
||||
* @param string $input String to explode
|
||||
* @return array<string> Array of string values
|
||||
*/
|
||||
function dolExplodeKeepIfQuotes($input)
|
||||
{
|
||||
// Use regexp to capture words and section in quotes
|
||||
$matches = array();
|
||||
preg_match_all('/"([^"]*)"|\'([^\']*)\'|(\S+)/', $input, $matches);
|
||||
|
||||
// Merge result and delete empty values
|
||||
return array_filter(array_map(function ($a, $b, $c) {
|
||||
// @phan-suppress-current-line PhanPluginUnknownClosureParamType
|
||||
return $a ?: ($b ?: $c);
|
||||
}, $matches[1], $matches[2], $matches[3]));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate natural SQL search string for a criteria (this criteria can be tested on one or several fields)
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user