Add space between if and ‘(‘
[MAILPOET-1791]
This commit is contained in:
@ -11,21 +11,21 @@ function array_column($input = null, $column_key = null, $index_key = null) {
|
||||
$argc = func_num_args();
|
||||
$params = func_get_args();
|
||||
|
||||
if(!empty(\array_column([['id' => '4']], 'id'))) {
|
||||
if (!empty(\array_column([['id' => '4']], 'id'))) {
|
||||
return \array_column($input, $column_key, $index_key);
|
||||
}
|
||||
if($argc < 2) {
|
||||
if ($argc < 2) {
|
||||
trigger_error("array_column() expects at least 2 parameters, {$argc} given", E_USER_WARNING);
|
||||
return null;
|
||||
}
|
||||
if(!is_array($params[0])) {
|
||||
if (!is_array($params[0])) {
|
||||
trigger_error(
|
||||
'array_column() expects parameter 1 to be array, ' . gettype($params[0]) . ' given',
|
||||
E_USER_WARNING
|
||||
);
|
||||
return null;
|
||||
}
|
||||
if(!is_int($params[1])
|
||||
if (!is_int($params[1])
|
||||
&& !is_float($params[1])
|
||||
&& !is_string($params[1])
|
||||
&& $params[1] !== null
|
||||
@ -34,7 +34,7 @@ function array_column($input = null, $column_key = null, $index_key = null) {
|
||||
trigger_error('array_column(): The column key should be either a string or an integer', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
if(isset($params[2])
|
||||
if (isset($params[2])
|
||||
&& !is_int($params[2])
|
||||
&& !is_float($params[2])
|
||||
&& !is_string($params[2])
|
||||
@ -46,8 +46,8 @@ function array_column($input = null, $column_key = null, $index_key = null) {
|
||||
$params_input = $params[0];
|
||||
$params_column_key = ($params[1] !== null) ? (string)$params[1] : null;
|
||||
$params_index_key = null;
|
||||
if(isset($params[2])) {
|
||||
if(is_float($params[2]) || is_int($params[2])) {
|
||||
if (isset($params[2])) {
|
||||
if (is_float($params[2]) || is_int($params[2])) {
|
||||
$params_index_key = (int)$params[2];
|
||||
} else {
|
||||
$params_index_key = (string)$params[2];
|
||||
@ -57,19 +57,19 @@ function array_column($input = null, $column_key = null, $index_key = null) {
|
||||
foreach ($params_input as $row) {
|
||||
$key = $value = null;
|
||||
$key_set = $value_set = false;
|
||||
if($params_index_key !== null && array_key_exists($params_index_key, $row)) {
|
||||
if ($params_index_key !== null && array_key_exists($params_index_key, $row)) {
|
||||
$key_set = true;
|
||||
$key = (string)$row[$params_index_key];
|
||||
}
|
||||
if($params_column_key === null) {
|
||||
if ($params_column_key === null) {
|
||||
$value_set = true;
|
||||
$value = $row;
|
||||
} elseif (is_array($row) && array_key_exists($params_column_key, $row)) {
|
||||
$value_set = true;
|
||||
$value = $row[$params_column_key];
|
||||
}
|
||||
if($value_set) {
|
||||
if($key_set) {
|
||||
if ($value_set) {
|
||||
if ($key_set) {
|
||||
$result_array[$key] = $value;
|
||||
} else {
|
||||
$result_array[] = $value;
|
||||
|
Reference in New Issue
Block a user