Browse Source

Fix PHPCS errors.

pull/897/head
Alexander O'Neill 2 years ago
parent
commit
a41ecaa754
  1. 5
      src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php

5
src/Plugin/Action/AbstractGenerateDerivativeMediaFile.php

@ -5,6 +5,7 @@ namespace Drupal\islandora\Plugin\Action;
use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url; use Drupal\Core\Url;
/** /**
* Emits a Node for generating derivatives event. * Emits a Node for generating derivatives event.
* *
@ -38,8 +39,8 @@ class AbstractGenerateDerivativeMediaFile extends AbstractGenerateDerivativeBase
*/ */
protected function generateData(EntityInterface $entity) { protected function generateData(EntityInterface $entity) {
$data = parent::generateData($entity); $data = parent::generateData($entity);
if (get_class($entity) != 'Drupal\media\Entity\Media') { if (get_class($entity) != 'Drupal\media\Entity\Media') {
throw new \RuntimeException("Entity {$entity->getEntityTypeId()} {$entity->id()} is not a media", 500); throw new \RuntimeException("Entity {$entity->getEntityTypeId()} {$entity->id()} is not a media", 500);
} }
$source_file = $this->mediaSource->getSourceFile($entity); $source_file = $this->mediaSource->getSourceFile($entity);
if (!$source_file) { if (!$source_file) {

Loading…
Cancel
Save