|
|
@ -7,6 +7,7 @@ use Drupal\Core\Queue\QueueWorkerBase; |
|
|
|
use Drupal\dgi_fixity\FixityCheckServiceInterface; |
|
|
|
use Drupal\dgi_fixity\FixityCheckServiceInterface; |
|
|
|
use Drupal\dgi_fixity\FixityCheckInterface; |
|
|
|
use Drupal\dgi_fixity\FixityCheckInterface; |
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface; |
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface; |
|
|
|
|
|
|
|
use function PHPUnit\Framework\isEmpty; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Performs a fixity check. |
|
|
|
* Performs a fixity check. |
|
|
@ -60,6 +61,10 @@ class FixityCheckWorker extends QueueWorkerBase implements ContainerFactoryPlugi |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function processItem($data) { |
|
|
|
public function processItem($data) { |
|
|
|
if ($data instanceof FixityCheckInterface) { |
|
|
|
if ($data instanceof FixityCheckInterface) { |
|
|
|
|
|
|
|
if (isEmpty($data->getFile())) { |
|
|
|
|
|
|
|
$data->delete(); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
/** @var \Drupal\dgi_fixity\FixityCheckInterface $data */ |
|
|
|
/** @var \Drupal\dgi_fixity\FixityCheckInterface $data */ |
|
|
|
$this->fixity->check($data->getFile()); |
|
|
|
$this->fixity->check($data->getFile()); |
|
|
|
} |
|
|
|
} |
|
|
|