Commit 1bc7daad authored by slashrsm's avatar slashrsm

CodeSnifer auto fixes.

parent bd6c1bdd
...@@ -54,7 +54,9 @@ function taxonomy_entity_embed_display_plugins_alter(array &$plugins) { ...@@ -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 * The 'Rendered entity' formatter can not be used for files unless the
* file_entity module is available. * file_entity module is available.
*
* @see https://www.drupal.org/node/2468387 * @see https://www.drupal.org/node/2468387
*
* @todo Remove when https://www.drupal.org/node/2567919 is fixed in core. * @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) { function entity_embed_entity_embed_display_plugins_for_context_alter(array &$definitions, array $context) {
......
...@@ -12,7 +12,7 @@ use Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager; ...@@ -12,7 +12,7 @@ use Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager;
* *
* @internal * @internal
*/ */
class EntityEmbedBuilder implements EntityEmbedBuilderInterface { class EntityEmbedBuilder implements EntityEmbedBuilderInterface {
/** /**
* The module handler service. * The module handler service.
......
...@@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityInterface; ...@@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityInterface;
* *
* @internal * @internal
*/ */
interface EntityEmbedBuilderInterface { interface EntityEmbedBuilderInterface {
/** /**
* Builds the render array for an embedded entity. * Builds the render array for an embedded entity.
......
...@@ -11,7 +11,6 @@ use Drupal\Core\Language\LanguageManagerInterface; ...@@ -11,7 +11,6 @@ use Drupal\Core\Language\LanguageManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase; use Drupal\Core\Plugin\PluginBase;
use Drupal\Core\Session\AccountInterface; use Drupal\Core\Session\AccountInterface;
use Drupal\entity_embed\EntityEmbedHelperTrait;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/** /**
...@@ -22,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; ...@@ -22,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
* @see \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager * @see \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager
* @see plugin_api * @see plugin_api
* *
* @ingroup entity_embed_api * @ingroup entity_embed_api
*/ */
abstract class EntityEmbedDisplayBase extends PluginBase implements ContainerFactoryPluginInterface, EntityEmbedDisplayInterface { abstract class EntityEmbedDisplayBase extends PluginBase implements ContainerFactoryPluginInterface, EntityEmbedDisplayInterface {
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayInterface.
*/
namespace Drupal\entity_embed\EntityEmbedDisplay; namespace Drupal\entity_embed\EntityEmbedDisplay;
use Drupal\Component\Plugin\PluginInspectionInterface; use Drupal\Component\Plugin\PluginInspectionInterface;
......
...@@ -58,6 +58,7 @@ class EntityEmbedDisplayManager extends DefaultPluginManager { ...@@ -58,6 +58,7 @@ class EntityEmbedDisplayManager extends DefaultPluginManager {
* An array of plugin definitions. * An array of plugin definitions.
* *
* @todo At some point convert this to use ContextAwarePluginManagerTrait * @todo At some point convert this to use ContextAwarePluginManagerTrait
*
* @see https://drupal.org/node/2277981 * @see https://drupal.org/node/2277981
*/ */
public function getDefinitionsForContexts(array $contexts = array()) { public function getDefinitionsForContexts(array $contexts = array()) {
......
...@@ -14,6 +14,9 @@ use Drupal\Core\TypedData\TypedDataManager; ...@@ -14,6 +14,9 @@ use Drupal\Core\TypedData\TypedDataManager;
use Drupal\node\Entity\Node; use Drupal\node\Entity\Node;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
/**
*
*/
abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBase { abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBase {
use PluginDependencyTrait; use PluginDependencyTrait;
...@@ -234,8 +237,7 @@ abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBa ...@@ -234,8 +237,7 @@ abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBa
$definition = $this->formatterPluginManager->getDefinition($this->getFieldFormatterId()); $definition = $this->formatterPluginManager->getDefinition($this->getFieldFormatterId());
$this->addDependency('module', $definition['provider']); $this->addDependency('module', $definition['provider']);
// @todo Investigate why this does not work currently. // @todo Investigate why this does not work currently.
//$this->calculatePluginDependencies($this->getFieldFormatter()); // $this->calculatePluginDependencies($this->getFieldFormatter());
return $this->dependencies; return $this->dependencies;
} }
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\EntityNotFoundException.
*/
namespace Drupal\entity_embed\Exception; namespace Drupal\entity_embed\Exception;
/** /**
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Exception\RecursiveRenderingException.
*/
namespace Drupal\entity_embed\Exception; namespace Drupal\entity_embed\Exception;
/** /**
......
...@@ -240,7 +240,7 @@ class EntityEmbedDialog extends FormBase { ...@@ -240,7 +240,7 @@ class EntityEmbedDialog extends FormBase {
'#entity_browser' => $this->entityBrowser->id(), '#entity_browser' => $this->entityBrowser->id(),
'#cardinality' => 1, '#cardinality' => 1,
'#entity_browser_validators' => [ '#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 { ...@@ -304,7 +304,7 @@ class EntityEmbedDialog extends FormBase {
$form['#title'] = $this->t('Review selected @type', array('@type' => $entity->getEntityType()->getLowercaseLabel())); $form['#title'] = $this->t('Review selected @type', array('@type' => $entity->getEntityType()->getLowercaseLabel()));
$form['selection'] = [ $form['selection'] = [
'#markup' => $entity->label() '#markup' => $entity->label(),
]; ];
$form['actions'] = array( $form['actions'] = array(
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\CKEditorPlugin\DrupalEntity.
*/
namespace Drupal\entity_embed\Plugin\CKEditorPlugin; namespace Drupal\entity_embed\Plugin\CKEditorPlugin;
use Drupal\editor\Entity\Editor; use Drupal\editor\Entity\Editor;
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\EmbedType\Entity.
*/
namespace Drupal\entity_embed\Plugin\EmbedType; namespace Drupal\entity_embed\Plugin\EmbedType;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface; use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
...@@ -179,7 +174,7 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface { ...@@ -179,7 +174,7 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface {
'invisible' => [ 'invisible' => [
':input[name="type_settings[entity_browser]"]' => ['value' => '_none'], ':input[name="type_settings[entity_browser]"]' => ['value' => '_none'],
], ],
] ],
]; ];
$form['entity_browser_settings']['display_review'] = [ $form['entity_browser_settings']['display_review'] = [
'#type' => 'checkbox', '#type' => 'checkbox',
......
...@@ -13,8 +13,6 @@ use Drupal\entity_embed\Exception\EntityNotFoundException; ...@@ -13,8 +13,6 @@ use Drupal\entity_embed\Exception\EntityNotFoundException;
use Drupal\entity_embed\Exception\RecursiveRenderingException; use Drupal\entity_embed\Exception\RecursiveRenderingException;
use Drupal\filter\FilterProcessResult; use Drupal\filter\FilterProcessResult;
use Drupal\filter\Plugin\FilterBase; use Drupal\filter\Plugin\FilterBase;
use RecursiveArrayIterator;
use RecursiveIteratorIterator;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\embed\DomHelperTrait; use Drupal\embed\DomHelperTrait;
...@@ -163,7 +161,7 @@ class EntityEmbedFilter extends FilterBase implements ContainerFactoryPluginInte ...@@ -163,7 +161,7 @@ class EntityEmbedFilter extends FilterBase implements ContainerFactoryPluginInte
throw new EntityNotFoundException(sprintf('Unable to load embedded %s entity %s.', $entity_type, $id)); 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); watchdog_exception('entity_embed', $e);
} }
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\EntityReferenceFieldFormatter.
*/
namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay; namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay;
use Drupal\entity_embed\EntityEmbedDisplay\FieldFormatterEntityEmbedDisplayBase; use Drupal\entity_embed\EntityEmbedDisplay\FieldFormatterEntityEmbedDisplayBase;
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\FileFieldFormatter.
*/
namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay; namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay;
use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormStateInterface;
......
...@@ -110,7 +110,7 @@ class ImageFieldFormatter extends FileFieldFormatter { ...@@ -110,7 +110,7 @@ class ImageFieldFormatter extends FileFieldFormatter {
if ($entity = $this->getEntityFromContext()) { if ($entity = $this->getEntityFromContext()) {
// Loading large files is slow, make sure it is an image mime type before // Loading large files is slow, make sure it is an image mime type before
// doing that. // 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()) $access = AccessResult::allowedIf($type == 'image' && $this->imageFactory->get($entity->getFileUri())->isValid())
// See the above @todo, this is the best we can do for now. // See the above @todo, this is the best we can do for now.
->addCacheableDependency($entity); ->addCacheableDependency($entity);
......
...@@ -59,7 +59,7 @@ class EntityEmbedDialogTest extends EntityEmbedTestBase { ...@@ -59,7 +59,7 @@ class EntityEmbedDialogTest extends EntityEmbedTestBase {
// $edit = ['attributes[data-entity-id]' => $this->node->id()]; // $edit = ['attributes[data-entity-id]' => $this->node->id()];
// $this->drupalPostAjaxForm(NULL, $edit, 'op'); // $this->drupalPostAjaxForm(NULL, $edit, 'op');
// Ensure form structure of the 'embed' step and submit form. // 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.');.
} }
/** /**
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed\Tests\EntityEmbedEntityBrowserTest.
*/
namespace Drupal\entity_embed\Tests; namespace Drupal\entity_embed\Tests;
use Drupal\entity_browser\Entity\EntityBrowser; use Drupal\entity_browser\Entity\EntityBrowser;
...@@ -14,6 +9,7 @@ use Drupal\embed\Entity\EmbedButton; ...@@ -14,6 +9,7 @@ use Drupal\embed\Entity\EmbedButton;
* Tests the entity_embed entity_browser integration. * Tests the entity_embed entity_browser integration.
* *
* @group entity_embed * @group entity_embed
*
* @dependencies entity_browser * @dependencies entity_browser
*/ */
class EntityEmbedEntityBrowserTest extends EntityEmbedDialogTest { class EntityEmbedEntityBrowserTest extends EntityEmbedDialogTest {
......
...@@ -16,6 +16,9 @@ class EntityEmbedHooksTest extends EntityEmbedTestBase { ...@@ -16,6 +16,9 @@ class EntityEmbedHooksTest extends EntityEmbedTestBase {
*/ */
protected $state; protected $state;
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->state = $this->container->get('state'); $this->state = $this->container->get('state');
......
...@@ -34,6 +34,9 @@ abstract class EntityEmbedTestBase extends WebTestBase { ...@@ -34,6 +34,9 @@ abstract class EntityEmbedTestBase extends WebTestBase {
*/ */
protected $node; protected $node;
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -103,6 +106,9 @@ abstract class EntityEmbedTestBase extends WebTestBase { ...@@ -103,6 +106,9 @@ abstract class EntityEmbedTestBase extends WebTestBase {
return $file; return $file;
} }
/**
*
*/
public function assertAvailableDisplayPlugins(EntityInterface $entity, array $expected_plugins, $message = '') { public function assertAvailableDisplayPlugins(EntityInterface $entity, array $expected_plugins, $message = '') {
$plugin_options = $this->container->get('plugin.manager.entity_embed.display') $plugin_options = $this->container->get('plugin.manager.entity_embed.display')
->getDefinitionOptionsForEntity($entity); ->getDefinitionOptionsForEntity($entity);
......
<?php <?php
/**
* @file
* Contains \Drupal\system\Tests\EntityEmbedTwigTest.
*/
namespace Drupal\entity_embed\Tests; namespace Drupal\entity_embed\Tests;
/** /**
...@@ -14,6 +9,9 @@ namespace Drupal\entity_embed\Tests; ...@@ -14,6 +9,9 @@ namespace Drupal\entity_embed\Tests;
*/ */
class EntityEmbedTwigTest extends EntityEmbedTestBase { class EntityEmbedTwigTest extends EntityEmbedTestBase {
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
\Drupal::service('theme_handler')->install(array('test_theme')); \Drupal::service('theme_handler')->install(array('test_theme'));
......
...@@ -18,6 +18,9 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase { ...@@ -18,6 +18,9 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase {
*/ */
protected $menu; protected $menu;
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
......
...@@ -26,6 +26,9 @@ class FileFieldFormatterTest extends EntityEmbedTestBase { ...@@ -26,6 +26,9 @@ class FileFieldFormatterTest extends EntityEmbedTestBase {
*/ */
protected $file; protected $file;
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->file = $this->getTestFile('text'); $this->file = $this->getTestFile('text');
......
...@@ -33,6 +33,9 @@ class ImageFieldFormatterTest extends EntityEmbedTestBase { ...@@ -33,6 +33,9 @@ class ImageFieldFormatterTest extends EntityEmbedTestBase {
*/ */
protected $file; protected $file;
/**
*
*/
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
$this->image = $this->getTestFile('image'); $this->image = $this->getTestFile('image');
......
<?php <?php
/**
* @file
*/
use Drupal\Core\Database\Database; use Drupal\Core\Database\Database;
use Drupal\Component\Serialization\Yaml; use Drupal\Component\Serialization\Yaml;
......
...@@ -25,7 +25,6 @@ function entity_embed_test_theme($existing, $type, $theme, $path) { ...@@ -25,7 +25,6 @@ function entity_embed_test_theme($existing, $type, $theme, $path) {
return $items; return $items;
} }
/** /**
* Implements hook_entity_embed_display_plugins_alter(). * Implements hook_entity_embed_display_plugins_alter().
*/ */
......
<?php <?php
/**
* @file
* Contains \Drupal\entity_embed_test\EntityEmbedTestTwigController.
*/
namespace Drupal\entity_embed_test; namespace Drupal\entity_embed_test;
/** /**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment