示例#1
0
 /**
  * Sort the array using the given Closure.
  *
  * @param  array     $array
  * @param  \Closure  $callback
  * @return array
  */
 public static function sort($array, Closure $callback)
 {
     return Collection::make($array)->sortBy($callback)->all();
 }
示例#2
0
 public function test_construct_make_from_object()
 {
     $object = new stdClass();
     $object->foo = 'bar';
     $collection = Collection::make($object);
     $this->assertEquals(array('foo' => 'bar'), $collection->all());
 }