for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mdiyakov\DoctrineSolrBundle\EventListener;
use Doctrine\ORM\Event\LifecycleEventArgs;
use Mdiyakov\DoctrineSolrBundle\Manager\IndexProcessManager;
class DoctrineEntityListener
{
/**
* @var IndexProcessManager
*/
private $indexProcessManager;
* @param IndexProcessManager $indexProcessManager
public function __construct(IndexProcessManager $indexProcessManager)
$this->indexProcessManager = $indexProcessManager;
}
* @param $entity
* @param LifecycleEventArgs $event
public function postUpdate($entity, LifecycleEventArgs $event)
$event
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function postUpdate($entity, /** @scrutinizer ignore-unused */ LifecycleEventArgs $event)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$this->reindexEntity($entity);
public function preRemove($entity, LifecycleEventArgs $event)
public function preRemove($entity, /** @scrutinizer ignore-unused */ LifecycleEventArgs $event)
$this->removeEntity($entity);
public function postPersist($entity, LifecycleEventArgs $event)
public function postPersist($entity, /** @scrutinizer ignore-unused */ LifecycleEventArgs $event)
private function reindexEntity($entity)
$this->indexProcessManager->reindex($entity);
private function removeEntity($entity)
$this->indexProcessManager->remove($entity);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.