diff --git a/entity_embed.module b/entity_embed.module index c41c2d54104d60e6495005f2b9ed6202311153a3..fbdd99434e5d9694a35bf3d6930f13becf2ba9ca 100644 --- a/entity_embed.module +++ b/entity_embed.module @@ -54,7 +54,9 @@ function taxonomy_entity_embed_display_plugins_alter(array &$plugins) { * * The 'Rendered entity' formatter can not be used for files unless the * file_entity module is available. + * * @see https://www.drupal.org/node/2468387 + * * @todo Remove when https://www.drupal.org/node/2567919 is fixed in core. */ function entity_embed_entity_embed_display_plugins_for_context_alter(array &$definitions, array $context) { diff --git a/src/EntityEmbedBuilder.php b/src/EntityEmbedBuilder.php index e25097c33b87251efba6e5079d16e9d7a4d3c1b2..24e716afbbdccf568c06f1c38fa363fea1ea91e1 100644 --- a/src/EntityEmbedBuilder.php +++ b/src/EntityEmbedBuilder.php @@ -12,7 +12,7 @@ use Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager; * * @internal */ -class EntityEmbedBuilder implements EntityEmbedBuilderInterface { +class EntityEmbedBuilder implements EntityEmbedBuilderInterface { /** * The module handler service. diff --git a/src/EntityEmbedBuilderInterface.php b/src/EntityEmbedBuilderInterface.php index 3bd532e8be8a201d06c961cc229a01bf06d2a582..e87c2c62965b224c7f23e81ead0ef6bf3a41835f 100644 --- a/src/EntityEmbedBuilderInterface.php +++ b/src/EntityEmbedBuilderInterface.php @@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityInterface; * * @internal */ -interface EntityEmbedBuilderInterface { +interface EntityEmbedBuilderInterface { /** * Builds the render array for an embedded entity. diff --git a/src/EntityEmbedDisplay/EntityEmbedDisplayBase.php b/src/EntityEmbedDisplay/EntityEmbedDisplayBase.php index fce4964bbb8d0e007f2b10a8afc4889eeeca9c4f..ca0a41277c9eaf5f1a77347950b2ad6b4520925a 100644 --- a/src/EntityEmbedDisplay/EntityEmbedDisplayBase.php +++ b/src/EntityEmbedDisplay/EntityEmbedDisplayBase.php @@ -11,7 +11,6 @@ use Drupal\Core\Language\LanguageManagerInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\PluginBase; use Drupal\Core\Session\AccountInterface; -use Drupal\entity_embed\EntityEmbedHelperTrait; use Symfony\Component\DependencyInjection\ContainerInterface; /** @@ -22,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * @see \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager * @see plugin_api * - * @ingroup entity_embed_api + * @ingroup entity_embed_api */ abstract class EntityEmbedDisplayBase extends PluginBase implements ContainerFactoryPluginInterface, EntityEmbedDisplayInterface { diff --git a/src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php b/src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php index 6e9e6af169abe8952f4056cf69fba917ee6275ac..3d97fac2cd67e2c02b32a8007326054f912e431c 100644 --- a/src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php +++ b/src/EntityEmbedDisplay/EntityEmbedDisplayInterface.php @@ -1,10 +1,5 @@ formatterPluginManager->getDefinition($this->getFieldFormatterId()); $this->addDependency('module', $definition['provider']); // @todo Investigate why this does not work currently. - //$this->calculatePluginDependencies($this->getFieldFormatter()); - + // $this->calculatePluginDependencies($this->getFieldFormatter()); return $this->dependencies; } diff --git a/src/Exception/EntityNotFoundException.php b/src/Exception/EntityNotFoundException.php index 29f628953da25aca529e90cbf8854f78473199e0..06d52adeba615e2ab41d76fe63b3d7de143ac939 100644 --- a/src/Exception/EntityNotFoundException.php +++ b/src/Exception/EntityNotFoundException.php @@ -1,10 +1,5 @@ $this->entityBrowser->id(), '#cardinality' => 1, '#entity_browser_validators' => [ - 'entity_type' => ['type' => $entity_element['data-entity-type']] + 'entity_type' => ['type' => $entity_element['data-entity-type']], ], ]; } @@ -304,7 +304,7 @@ class EntityEmbedDialog extends FormBase { $form['#title'] = $this->t('Review selected @type', array('@type' => $entity->getEntityType()->getLowercaseLabel())); $form['selection'] = [ - '#markup' => $entity->label() + '#markup' => $entity->label(), ]; $form['actions'] = array( diff --git a/src/Plugin/CKEditorPlugin/DrupalEntity.php b/src/Plugin/CKEditorPlugin/DrupalEntity.php index 6de184833c23ab8e9692874fef6b53fe77bc3619..2a6fa14b95db68b2fc3c5760383569e2bcd32cec 100644 --- a/src/Plugin/CKEditorPlugin/DrupalEntity.php +++ b/src/Plugin/CKEditorPlugin/DrupalEntity.php @@ -1,10 +1,5 @@ [ ':input[name="type_settings[entity_browser]"]' => ['value' => '_none'], ], - ] + ], ]; $form['entity_browser_settings']['display_review'] = [ '#type' => 'checkbox', diff --git a/src/Plugin/Filter/EntityEmbedFilter.php b/src/Plugin/Filter/EntityEmbedFilter.php index e0377d35f6111a2935768d23a60b87e7c6148e35..b230b570c27affb7a2edf74723583cea1e9725e0 100644 --- a/src/Plugin/Filter/EntityEmbedFilter.php +++ b/src/Plugin/Filter/EntityEmbedFilter.php @@ -13,8 +13,6 @@ use Drupal\entity_embed\Exception\EntityNotFoundException; use Drupal\entity_embed\Exception\RecursiveRenderingException; use Drupal\filter\FilterProcessResult; use Drupal\filter\Plugin\FilterBase; -use RecursiveArrayIterator; -use RecursiveIteratorIterator; use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\embed\DomHelperTrait; @@ -163,7 +161,7 @@ class EntityEmbedFilter extends FilterBase implements ContainerFactoryPluginInte throw new EntityNotFoundException(sprintf('Unable to load embedded %s entity %s.', $entity_type, $id)); } } - catch(\Exception $e) { + catch (\Exception $e) { watchdog_exception('entity_embed', $e); } diff --git a/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php b/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php index 852688b6e62895b53c8390b96a7f92bfca8b228a..318635a51b12e85cf6c163d5f4bf379854fda1dd 100644 --- a/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php +++ b/src/Plugin/entity_embed/EntityEmbedDisplay/EntityReferenceFieldFormatter.php @@ -1,10 +1,5 @@ getEntityFromContext()) { // Loading large files is slow, make sure it is an image mime type before // doing that. - list($type, ) = explode('/', $entity->getMimeType(), 2); + list($type,) = explode('/', $entity->getMimeType(), 2); $access = AccessResult::allowedIf($type == 'image' && $this->imageFactory->get($entity->getFileUri())->isValid()) // See the above @todo, this is the best we can do for now. ->addCacheableDependency($entity); diff --git a/src/Tests/EntityEmbedDialogTest.php b/src/Tests/EntityEmbedDialogTest.php index 62f1474cc0ff2915098c560aa9de824525f483a0..b7d84d9b8768d73c22fb4dd1446e79403ca4cf4a 100644 --- a/src/Tests/EntityEmbedDialogTest.php +++ b/src/Tests/EntityEmbedDialogTest.php @@ -59,7 +59,7 @@ class EntityEmbedDialogTest extends EntityEmbedTestBase { // $edit = ['attributes[data-entity-id]' => $this->node->id()]; // $this->drupalPostAjaxForm(NULL, $edit, 'op'); // Ensure form structure of the 'embed' step and submit form. - // $this->assertFieldByName('attributes[data-entity-embed-display]', 'Entity Embed Display plugin field is present.'); + // $this->assertFieldByName('attributes[data-entity-embed-display]', 'Entity Embed Display plugin field is present.');. } /** diff --git a/src/Tests/EntityEmbedEntityBrowserTest.php b/src/Tests/EntityEmbedEntityBrowserTest.php index 81bc3861fa345c41a22811857bf1828b361b47b1..60367956e2b33bb0833897ac3d64bfd9e060f2a9 100644 --- a/src/Tests/EntityEmbedEntityBrowserTest.php +++ b/src/Tests/EntityEmbedEntityBrowserTest.php @@ -1,10 +1,5 @@ state = $this->container->get('state'); diff --git a/src/Tests/EntityEmbedTestBase.php b/src/Tests/EntityEmbedTestBase.php index b4c93ca7c547c3b6b5f200aea756ddce176bc01d..4833947083fb026e9976a08a6056cc9cdf48d1d0 100644 --- a/src/Tests/EntityEmbedTestBase.php +++ b/src/Tests/EntityEmbedTestBase.php @@ -34,6 +34,9 @@ abstract class EntityEmbedTestBase extends WebTestBase { */ protected $node; + /** + * + */ protected function setUp() { parent::setUp(); @@ -103,6 +106,9 @@ abstract class EntityEmbedTestBase extends WebTestBase { return $file; } + /** + * + */ public function assertAvailableDisplayPlugins(EntityInterface $entity, array $expected_plugins, $message = '') { $plugin_options = $this->container->get('plugin.manager.entity_embed.display') ->getDefinitionOptionsForEntity($entity); diff --git a/src/Tests/EntityEmbedTwigTest.php b/src/Tests/EntityEmbedTwigTest.php index 291dc472db29bb2a1c63f588fb1c1f07a2877467..6ea1c13dc62851f979423c20431f237ce1a0f6e3 100644 --- a/src/Tests/EntityEmbedTwigTest.php +++ b/src/Tests/EntityEmbedTwigTest.php @@ -1,10 +1,5 @@ install(array('test_theme')); diff --git a/src/Tests/EntityReferenceFieldFormatterTest.php b/src/Tests/EntityReferenceFieldFormatterTest.php index 6bac98ad759b49449844814231fc8b45bd074516..916578798a14b4eba7e029ce5a7861dd743dab79 100644 --- a/src/Tests/EntityReferenceFieldFormatterTest.php +++ b/src/Tests/EntityReferenceFieldFormatterTest.php @@ -18,6 +18,9 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase { */ protected $menu; + /** + * + */ protected function setUp() { parent::setUp(); diff --git a/src/Tests/FileFieldFormatterTest.php b/src/Tests/FileFieldFormatterTest.php index 51076da500ecb04c4c49d906b52b51bd73c1d109..ba566c6b68d9463093f8b553a3520d93b8206cb6 100644 --- a/src/Tests/FileFieldFormatterTest.php +++ b/src/Tests/FileFieldFormatterTest.php @@ -26,6 +26,9 @@ class FileFieldFormatterTest extends EntityEmbedTestBase { */ protected $file; + /** + * + */ protected function setUp() { parent::setUp(); $this->file = $this->getTestFile('text'); diff --git a/src/Tests/ImageFieldFormatterTest.php b/src/Tests/ImageFieldFormatterTest.php index 6f385983d9438cc1a1758dbdbb58fdddd6f440c1..19398c098771d920d11e44a31af9ffa97453fee7 100644 --- a/src/Tests/ImageFieldFormatterTest.php +++ b/src/Tests/ImageFieldFormatterTest.php @@ -33,6 +33,9 @@ class ImageFieldFormatterTest extends EntityEmbedTestBase { */ protected $file; + /** + * + */ protected function setUp() { parent::setUp(); $this->image = $this->getTestFile('image'); diff --git a/tests/fixtures/update/entity_embed.update-hook-test.php b/tests/fixtures/update/entity_embed.update-hook-test.php index c0bb8ab3ab49941bc0bbd69736222a863e8b203b..e847f5294b92e6906bc1907d6c1fd7b2bde9dbea 100644 --- a/tests/fixtures/update/entity_embed.update-hook-test.php +++ b/tests/fixtures/update/entity_embed.update-hook-test.php @@ -1,5 +1,9 @@