for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Smart\EtlBundle\Extractor;
/**
* Nicolas Bastien <[email protected]>
*/
class CsvEntityExtractor extends AbstractFolderExtrator implements ExtractorInterface
{
use EntityExtractorTrait;
* @inheritDoc
protected function getFileExtension()
return 'csv';
}
protected function extractFileContent($filepath)
$file = new \SplFileObject($filepath);
//csv file have to be formatted with headers on the first line
$headers = $file->fgetcsv();
$data = [];
while (!$file->eof()) {
$data[] = array_combine($headers, $file->fgetcsv());
return $data;