for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SubjectivePHP\Csv;
use SplFileObject;
/**
* Header strategy which generates a numeric array whose size is the number of columns in the given file.
*/
final class NoHeaderStrategy implements HeaderStrategyInterface
{
public function getHeaders(SplFileObject $fileObject) : array
$firstRow = $fileObject->fgetcsv();
$headers = array_keys($firstRow);
$fileObject->rewind();
return $headers;
}