Neos\Eel\Helper\ArrayHelper::first PHP Method

first() public method

Get the first element of an array
public first ( array $array ) : mixed
$array array The array
return mixed
    public function first(array $array)
    {
        return reset($array);
    }

Usage Example

 /**
  * @test
  * @dataProvider firstExamples
  */
 public function firstWorks($array, $expected)
 {
     $helper = new ArrayHelper();
     $result = $helper->first($array);
     $this->assertEquals($expected, $result);
 }