コード例 #1
0
 public function testFirstWithCallbackAndDefault()
 {
     $data = new Collection(['foo', 'bar']);
     $result = $data->first(function ($key, $value) {
         return $value === 'baz';
     }, 'default');
     $this->assertEquals('default', $result);
 }
コード例 #2
0
ファイル: CollectionStack.php プロジェクト: stillat/common
 /**
  * {@inheritdoc}
  */
 public function top()
 {
     return $this->collection->first();
 }