Collection::first PHP Method

first() public method

Returns the first element from the array
public first ( ) : mixed
return mixed
    public function first()
    {
        $array = $this->data;
        return array_shift($array);
    }

Usage Example

 /**
  * @test Collection::first()
  */
 public function testFirst()
 {
     $this->buildEnvironment();
     $result = $this->collection->first();
     $expect = $this->source['a1'];
     $this->assertEquals($expect, $result);
 }
All Usage Examples Of Collection::first