public function testFirstWithCallbackAndDefault()
 {
     $data = new Collection(['foo', 'bar']);
     $result = $data->first(function ($key, $value) {
         return $value === 'baz';
     }, 'default');
     $this->assertEquals('default', $result);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function top()
 {
     return $this->collection->first();
 }