for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oliverde8\Component\PhpEtl\ChainOperation\Loader;
use Oliverde8\Component\PhpEtl\ChainOperation\AbstractChainOperation;
use Oliverde8\Component\PhpEtl\ChainOperation\DataChainOperationInterface;
use Oliverde8\Component\PhpEtl\Item\DataItemInterface;
use Oliverde8\Component\PhpEtl\Item\ItemInterface;
use Oliverde8\Component\PhpEtl\Model\File\FileWriterInterface;
/**
* Class FileWriter
*
* @author de Cramer Oliver<[email protected]>
* @copyright 2018 Oliverde8
* @package Oliverde8\Component\PhpEtl\ChainOperation\Loader
*/
class FileWriterOperation extends AbstractChainOperation implements DataChainOperationInterface
{
/** @var FileWriterInterface */
protected $writer;
* FileWriter constructor.
* @param FileWriterInterface $writer
public function __construct(FileWriterInterface $writer)
$this->writer = $writer;
}
public function processData(DataItemInterface $item, array &$context): ItemInterface
$this->writer->write($item->getData());
return $item;