Skip to content
Permalink
Browse files

Try to get travis to pass again.

  • Loading branch information...
markstory committed May 31, 2018
1 parent 9e230cb commit 37d4e37f4cdbb3720412b6a6e66fd1e29f4ce769
@@ -257,7 +257,7 @@ public function extract($matcher);
* @see \Cake\Collection\CollectionIterface::sortBy()
* @return mixed The value of the top element in the collection
*/
public function max($callback, $type = SORT_NUMERIC);
public function max($callback, $type = \SORT_NUMERIC);
/**
* Returns the bottom element in this collection after being sorted by a property.
@@ -283,7 +283,7 @@ public function max($callback, $type = SORT_NUMERIC);
* @see \Cake\Collection\CollectionInterface::sortBy()
* @return mixed The value of the bottom element in the collection
*/
public function min($callback, $type = SORT_NUMERIC);
public function min($callback, $type = \SORT_NUMERIC);
/**
* Returns the average of all the values extracted with $matcher
@@ -378,7 +378,7 @@ public function median($matcher = null);
* SORT_NUMERIC or SORT_NATURAL
* @return \Cake\Collection\CollectionInterface
*/
public function sortBy($callback, $dir = SORT_DESC, $type = SORT_NUMERIC);
public function sortBy($callback, $dir = SORT_DESC, $type = \SORT_NUMERIC);
/**
* Splits a collection into sets, grouped by the result of running each value
@@ -177,17 +177,17 @@ public function extract($matcher)
/**
* {@inheritDoc}
*/
public function max($callback, $type = SORT_NUMERIC)
public function max($callback, $type = \SORT_NUMERIC)
{
return (new SortIterator($this->unwrap(), $callback, SORT_DESC, $type))->first();
return (new SortIterator($this->unwrap(), $callback, \SORT_DESC, $type))->first();
}
/**
* {@inheritDoc}
*/
public function min($callback, $type = SORT_NUMERIC)
public function min($callback, $type = \SORT_NUMERIC)
{
return (new SortIterator($this->unwrap(), $callback, SORT_ASC, $type))->first();
return (new SortIterator($this->unwrap(), $callback, \SORT_ASC, $type))->first();
}
/**
@@ -242,7 +242,7 @@ public function median($matcher = null)
/**
* {@inheritDoc}
*/
public function sortBy($callback, $dir = SORT_DESC, $type = SORT_NUMERIC)
public function sortBy($callback, $dir = \SORT_DESC, $type = \SORT_NUMERIC)
{
return new SortIterator($this->unwrap(), $callback, $dir, $type);
}
@@ -57,7 +57,7 @@ class SortIterator extends Collection
* @param int $type the type of comparison to perform, either SORT_STRING
* SORT_NUMERIC or SORT_NATURAL
*/
public function __construct($items, $callback, $dir = SORT_DESC, $type = SORT_NUMERIC)
public function __construct($items, $callback, $dir = \SORT_DESC, $type = \SORT_NUMERIC)
{
if (!is_array($items)) {
$items = iterator_to_array((new Collection($items))->unwrap(), false);
@@ -67,7 +67,7 @@ public function __construct($items, $callback, $dir = SORT_DESC, $type = SORT_NU
$results = [];
foreach ($items as $key => $val) {
$val = $callback($val);
if ($val instanceof DateTimeInterface && $type === SORT_NUMERIC) {
if ($val instanceof DateTimeInterface && $type === \SORT_NUMERIC) {
$val = $val->format('U');
}
$results[$key] = $val;
@@ -1002,15 +1002,15 @@ public static function sort(array $data, $path, $dir = 'asc', $type = 'regular')
$dir = SORT_DESC;
}
if ($type === 'numeric') {
$type = SORT_NUMERIC;
$type = \SORT_NUMERIC;
} elseif ($type === 'string') {
$type = SORT_STRING;
$type = \SORT_STRING;
} elseif ($type === 'natural') {
$type = SORT_NATURAL;
$type = \SORT_NATURAL;
} elseif ($type === 'locale') {
$type = SORT_LOCALE_STRING;
$type = \SORT_LOCALE_STRING;
} else {
$type = SORT_REGULAR;
$type = \SORT_REGULAR;
}
if ($ignoreCase) {
$values = array_map('mb_strtolower', $values);
@@ -80,7 +80,7 @@ public function testSortComplexNumeric()
$callback = function ($a) {
return $a['foo'];
};
$sorted = new SortIterator($items, $callback, SORT_DESC, SORT_NUMERIC);
$sorted = new SortIterator($items, $callback, \SORT_DESC, \SORT_NUMERIC);
$expected = [
['foo' => 13, 'bar' => 'a'],
['foo' => 10, 'bar' => 'a'],
@@ -89,7 +89,7 @@ public function testSortComplexNumeric()
];
$this->assertEquals($expected, $sorted->toList());
$sorted = new SortIterator($items, $callback, SORT_ASC, SORT_NUMERIC);
$sorted = new SortIterator($items, $callback, \SORT_ASC, \SORT_NUMERIC);
$expected = [
['foo' => 1, 'bar' => 'a'],
['foo' => 2, 'bar' => 'a'],

0 comments on commit 37d4e37

Please sign in to comment.
You can’t perform that action at this time.