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) {
*
* 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) {
......
......@@ -12,7 +12,7 @@ use Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager;
*
* @internal
*/
class EntityEmbedBuilder implements EntityEmbedBuilderInterface {
class EntityEmbedBuilder implements EntityEmbedBuilderInterface {
/**
* The module handler service.
......
......@@ -9,7 +9,7 @@ use Drupal\Core\Entity\EntityInterface;
*
* @internal
*/
interface EntityEmbedBuilderInterface {
interface EntityEmbedBuilderInterface {
/**
* Builds the render array for an embedded entity.
......
......@@ -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 {
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayInterface.
*/
namespace Drupal\entity_embed\EntityEmbedDisplay;
use Drupal\Component\Plugin\PluginInspectionInterface;
......
......@@ -58,6 +58,7 @@ class EntityEmbedDisplayManager extends DefaultPluginManager {
* An array of plugin definitions.
*
* @todo At some point convert this to use ContextAwarePluginManagerTrait
*
* @see https://drupal.org/node/2277981
*/
public function getDefinitionsForContexts(array $contexts = array()) {
......
......@@ -14,6 +14,9 @@ use Drupal\Core\TypedData\TypedDataManager;
use Drupal\node\Entity\Node;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
*
*/
abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBase {
use PluginDependencyTrait;
......@@ -234,8 +237,7 @@ abstract class FieldFormatterEntityEmbedDisplayBase extends EntityEmbedDisplayBa
$definition = $this->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;
}
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\EntityNotFoundException.
*/
namespace Drupal\entity_embed\Exception;
/**
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Exception\RecursiveRenderingException.
*/
namespace Drupal\entity_embed\Exception;
/**
......
......@@ -240,7 +240,7 @@ class EntityEmbedDialog extends FormBase {
'#entity_browser' => $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(
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\CKEditorPlugin\DrupalEntity.
*/
namespace Drupal\entity_embed\Plugin\CKEditorPlugin;
use Drupal\editor\Entity\Editor;
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\EmbedType\Entity.
*/
namespace Drupal\entity_embed\Plugin\EmbedType;
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
......@@ -179,7 +174,7 @@ class Entity extends EmbedTypeBase implements ContainerFactoryPluginInterface {
'invisible' => [
':input[name="type_settings[entity_browser]"]' => ['value' => '_none'],
],
]
],
];
$form['entity_browser_settings']['display_review'] = [
'#type' => 'checkbox',
......
......@@ -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);
}
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\EntityReferenceFieldFormatter.
*/
namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay;
use Drupal\entity_embed\EntityEmbedDisplay\FieldFormatterEntityEmbedDisplayBase;
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay\FileFieldFormatter.
*/
namespace Drupal\entity_embed\Plugin\entity_embed\EntityEmbedDisplay;
use Drupal\Core\Form\FormStateInterface;
......
......@@ -110,7 +110,7 @@ class ImageFieldFormatter extends FileFieldFormatter {
if ($entity = $this->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);
......
......@@ -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.');.
}
/**
......
<?php
/**
* @file
* Contains \Drupal\entity_embed\Tests\EntityEmbedEntityBrowserTest.
*/
namespace Drupal\entity_embed\Tests;
use Drupal\entity_browser\Entity\EntityBrowser;
......@@ -14,6 +9,7 @@ use Drupal\embed\Entity\EmbedButton;
* Tests the entity_embed entity_browser integration.
*
* @group entity_embed
*
* @dependencies entity_browser
*/
class EntityEmbedEntityBrowserTest extends EntityEmbedDialogTest {
......
......@@ -16,6 +16,9 @@ class EntityEmbedHooksTest extends EntityEmbedTestBase {
*/
protected $state;
/**
*
*/
protected function setUp() {
parent::setUp();
$this->state = $this->container->get('state');
......
......@@ -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);
......
<?php
/**
* @file
* Contains \Drupal\system\Tests\EntityEmbedTwigTest.
*/
namespace Drupal\entity_embed\Tests;
/**
......@@ -14,6 +9,9 @@ namespace Drupal\entity_embed\Tests;
*/
class EntityEmbedTwigTest extends EntityEmbedTestBase {
/**
*
*/
protected function setUp() {
parent::setUp();
\Drupal::service('theme_handler')->install(array('test_theme'));
......
......@@ -18,6 +18,9 @@ class EntityReferenceFieldFormatterTest extends EntityEmbedTestBase {
*/
protected $menu;
/**
*
*/
protected function setUp() {
parent::setUp();
......
......@@ -26,6 +26,9 @@ class FileFieldFormatterTest extends EntityEmbedTestBase {
*/
protected $file;
/**
*
*/
protected function setUp() {
parent::setUp();
$this->file = $this->getTestFile('text');
......
......@@ -33,6 +33,9 @@ class ImageFieldFormatterTest extends EntityEmbedTestBase {
*/
protected $file;
/**
*
*/
protected function setUp() {
parent::setUp();
$this->image = $this->getTestFile('image');
......
<?php
/**
* @file
*/
use Drupal\Core\Database\Database;
use Drupal\Component\Serialization\Yaml;
......
......@@ -25,7 +25,6 @@ function entity_embed_test_theme($existing, $type, $theme, $path) {
return $items;
}
/**
* Implements hook_entity_embed_display_plugins_alter().
*/
......
<?php
/**
* @file
* Contains \Drupal\entity_embed_test\EntityEmbedTestTwigController.
*/
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