fix: noverify --fix
This commit is contained in:
parent
5aff28d2b8
commit
117640a755
44 changed files with 174 additions and 174 deletions
|
|
@ -54,7 +54,7 @@ class partial {
|
|||
|
||||
function apply() {
|
||||
$params = func_get_args();
|
||||
$result = array();
|
||||
$result = [];
|
||||
$count = count($this->params);
|
||||
for($i = 0, $j = 0; $i < $count; $i++) {
|
||||
if ($this->params[$i] == __) {
|
||||
|
|
@ -92,7 +92,7 @@ class Functions {
|
|||
|
||||
static function partial($_rest) {
|
||||
$closure = new partial(func_get_args());
|
||||
return array($closure, 'apply');
|
||||
return [$closure, 'apply'];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ class Functions {
|
|||
*/
|
||||
static function compose($_rest) {
|
||||
$closure = new compose(func_get_args());
|
||||
return array($closure, 'apply');
|
||||
return [$closure, 'apply'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -113,7 +113,7 @@ class Functions {
|
|||
*/
|
||||
static function rcurry($_rest) {
|
||||
$closure = new right(func_get_args ());
|
||||
return array($closure, 'apply');
|
||||
return [$closure, 'apply'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,7 +123,7 @@ class Functions {
|
|||
*/
|
||||
static function lcurry($_rest) {
|
||||
$closure = new left(func_get_args ());
|
||||
return array($closure, 'apply');
|
||||
return [$closure, 'apply'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -134,8 +134,8 @@ class Functions {
|
|||
* @return mixed
|
||||
*/
|
||||
static function partition($pred, $lst) {
|
||||
$left = array ();
|
||||
$right = array ();
|
||||
$left = [];
|
||||
$right = [];
|
||||
foreach ($lst as $n) {
|
||||
if (call_user_func($pred, $n) !== false) {
|
||||
$left [] = $n;
|
||||
|
|
@ -143,7 +143,7 @@ class Functions {
|
|||
$right [] = $n;
|
||||
}
|
||||
}
|
||||
return array ($left, $right);
|
||||
return [$left, $right];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -191,7 +191,7 @@ class Functions {
|
|||
}
|
||||
|
||||
static function __self($name, $o) {
|
||||
return call_user_func(array($o, $name));
|
||||
return call_user_func([$o, $name]);
|
||||
}
|
||||
|
||||
static function concat(/* $args ...*/) {
|
||||
|
|
@ -225,7 +225,7 @@ class Functions {
|
|||
* @return mixed
|
||||
*/
|
||||
static function key_values($key, $array/*: array|ArrayIterator*/) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
foreach($array as $item) {
|
||||
$result[] = $item[$key];
|
||||
|
|
@ -234,7 +234,7 @@ class Functions {
|
|||
}
|
||||
|
||||
static function key_values_object($key, $array/*: array|ArrayIterator*/) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
foreach($array as $item) {
|
||||
$result[] = $item->{$key};
|
||||
|
|
@ -243,7 +243,7 @@ class Functions {
|
|||
}
|
||||
|
||||
static function assoc_key_values($key, $value, $array) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($array as $item) {
|
||||
$result[$item[$key]] = $item[$value];
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ class Functions {
|
|||
}
|
||||
|
||||
static function assoc_key($key, $array) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($array as $item) {
|
||||
$result[$item[$key]] = $item;
|
||||
}
|
||||
|
|
@ -307,7 +307,7 @@ class Functions {
|
|||
static function span($length, array $array) {
|
||||
assert(is_int($length));
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
$count = count($array);
|
||||
for($i = 0; $i < $count; $i += $length) {
|
||||
$result [] = array_slice($array, $i, $length);
|
||||
|
|
@ -334,7 +334,7 @@ class Functions {
|
|||
*/
|
||||
static function array_usearch($cb, array $hs, $strict = false) {
|
||||
foreach($hs as $key => $value) {
|
||||
if (call_user_func_array($cb, array($value, $key, $strict))) return $key;
|
||||
if (call_user_func_array($cb, [$value, $key, $strict])) return $key;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -350,7 +350,7 @@ class Functions {
|
|||
*/
|
||||
static function key_unique_values ($name, $table) {
|
||||
// Ищем уникальные значения для заданного ключа
|
||||
$keys = array ();
|
||||
$keys = [];
|
||||
foreach ($table as $row) {
|
||||
if (!in_array ($row[$name], $keys))
|
||||
$keys[] = $row[$name];
|
||||
|
|
@ -375,7 +375,7 @@ class Functions {
|
|||
* @return mixed
|
||||
*/
|
||||
static function hash_key ($key_name,$array/*: array */) {
|
||||
$result = array();
|
||||
$result = [];
|
||||
|
||||
foreach($array as $value) {
|
||||
$result[$value[$key_name]] = $value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue