for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Oliverde8\PhpEtlBundle\Etl\Operation\Cleanup;
use Oliverde8\Component\PhpEtl\ChainOperation\AbstractChainOperation;
use Oliverde8\Component\PhpEtl\Item\GroupedItem;
use Oliverde8\Component\PhpEtl\Item\ItemInterface;
use Oliverde8\PhpEtlBundle\Repository\EtlExecutionRepository;
class FindOldExecutionsOperation extends AbstractChainOperation
{
protected EtlExecutionRepository $etlExecutionRepository;
protected \DateTime $minKeep;
protected $endProcess = false;
/**
* FindOldExecutions constructor.
* @param EtlExecutionRepository $etlExecutionRepository
* @param string $minKeep
*/
public function __construct(EtlExecutionRepository $etlExecutionRepository, \DateTime $minKeep)
$this->etlExecutionRepository = $etlExecutionRepository;
$this->minKeep = $minKeep;
}
protected function processStop(ItemInterface $item, array &$context)
$context
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
protected function processStop(ItemInterface $item, /** @scrutinizer ignore-unused */ array &$context)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
if ($this->endProcess) {
return $item;
$this->endProcess = true;
$iterator = $this->etlExecutionRepository->getOldExecutions($this->minKeep);
return new GroupedItem($iterator);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.