issue #3305083 by Dharti Patel: PHPCS Coding Standard Issues
Open
requested to merge issue/entity_embed-3305083:3305083-phpcs-coding-standard-issues into 8.x-1.x
Merge request reports
Activity
added 9 commits
-
fe1ff080...c0248621 - 7 commits from branch
project:8.x-1.x
- eec98c50 - issue #3305083 by Dharti Patel: PHPCS Coding Standard Issues
- 2a34f2e1 - Fix phpcs
-
fe1ff080...c0248621 - 7 commits from branch
added 1 commit
- 22f4ca8e - Fix the js files (that had broke the module) and the last PHPCS in entity_embeded.module.
added 8 commits
-
22f4ca8e...f52be693 - 5 commits from branch
project:8.x-1.x
- 567f68b5 - issue #3305083 by Dharti Patel: PHPCS Coding Standard Issues
- 19b558a3 - Fix phpcs
- 6debfebe - Fix the js files (that had broke the module) and the last PHPCS in entity_embeded.module.
Toggle commit list-
22f4ca8e...f52be693 - 5 commits from branch
added 1 commit
3 3 * Drupal Entity embed plugin. 4 4 */ 5 5 6 (function (jQuery, Drupal, CKEDITOR) { 6 (function (jQuery, Drupal, CKEDITOR) { changed this line in version 9 of the diff
6 6 * embed dialog. 7 7 */ 8 8 9 (function ($, Drupal, once) { 9 (function ($, Drupal, once) { changed this line in version 9 of the diff
124 120 125 121 $definition = $this->getFieldDefinition(); 126 122 127 /* @var \Drupal\Core\Field\FieldItemListInterface $items $items */ 123 /** @var \Drupal\Core\Field\FieldItemListInterface $items $items */ changed this line in version 9 of the diff
611 614 } 612 615 if ($entity = $this->entityTypeManager->getStorage($entity_type)->load($id)) { 613 616 if (!$entity->access('view')) { 614 $form_state->setError($element, $this->t('Unable to access @type entity @id.', ['@type' => $entity_type, '@id' => $id])); 617 $form_state->setError( 617 $form_state->setError( 618 $element, $this->t( 619 'Unable to access @type entity @id.', 620 ['@type' => $entity_type, '@id' => $id] 621 ) 622 ); 617 $form_state->setError($element, $this->t('Unable to access @type entity @id.', [ 618 '@type' => $entity_type, 619 '@id' => $id, 620 ])); changed this line in version 10 of the diff
638 652 } 639 653 } 640 654 else { 641 $form_state->setError($element, $this->t('Unable to load @type entity @id.', ['@type' => $entity_type, '@id' => $id])); 655 $form_state->setError( 655 $form_state->setError( 656 $element, 657 $this->t('Unable to load @type entity @id.', 658 ['@type' => $entity_type, '@id' => $id], 659 ) 660 ); 655 $form_state->setError($element, $this->t('Unable to load @type entity @id.', [ 656 '@type' => $entity_type, 657 '@id' => $id, 658 ])); changed this line in version 10 of the diff
613 616 if (!$entity->access('view')) { 614 $form_state->setError($element, $this->t('Unable to access @type entity @id.', ['@type' => $entity_type, '@id' => $id])); 617 $form_state->setError( 618 $element, $this->t( 619 'Unable to access @type entity @id.', 620 ['@type' => $entity_type, '@id' => $id] 621 ) 622 ); 615 623 } 616 624 else { 617 625 if ($uuid = $entity->uuid()) { 618 626 $form_state->setValueForElement($form['attributes']['data-entity-uuid'], $uuid); 619 627 } 620 628 else { 621 $form_state->setError($element, $this->t('Cannot embed @type entity @id because it does not have a UUID.', ['@type' => $entity_type, '@id' => $id])); 629 $form_state->setError( 629 $form_state->setError( 630 $element, 631 $this->t( 632 'Cannot embed @type entity @id because it does not have a UUID.', 633 ['@type' => $entity_type, '@id' => $id] 634 ) 635 ); 629 $form_state->setError($element, $this->t('Cannot embed @type entity @id because it does not have a UUID.', [ 630 '@type' => $entity_type, 631 '@id' => $id, 632 ])); changed this line in version 10 of the diff
35 42 * The module handler service. 36 43 * @param \Drupal\entity_embed\EntityEmbedDisplay\EntityEmbedDisplayManager $display_manager 37 44 * The entity embed display plugin manager. 45 * @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $loggerFactory 46 * The logger factory. 38 47 */ 39 public function __construct(ModuleHandlerInterface $module_handler, EntityEmbedDisplayManager $display_manager) { 48 public function __construct(ModuleHandlerInterface $module_handler, There is no need to split parametrs to several lines.
Edited by Nikolay Shapovalovchanged this line in version 10 of the diff
63 76 // otherwise we'll encounter a fatal error when calling 64 77 // $this->buildEntityEmbedDisplayPlugin() further down the line. 65 78 if (!is_array($context['data-entity-embed-display-settings'])) { 66 \Drupal::logger('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [ 67 '@settings' => $context['data-entity-embed-display-settings'], 68 '@entity_type' => $entity->getEntityTypeId(), 69 '@uuid' => $entity->uuid(), 70 ]); 79 $this->loggerFactory->get('entity_embed')->warning( Suggested message string is wrongly formatted.
79 $this->loggerFactory->get('entity_embed')->warning( 80 'Invalid display settings encountered. 81 Could not process following settings 82 for entity type "@entity_type" with the uuid "@uuid": @settings', 83 [ 79 $this->loggerFactory->get('entity_embed')->warning('Invalid display settings encountered. Could not process following settings for entity type "@entity_type" with the uuid "@uuid": @settings', [ changed this line in version 10 of the diff
83 100 } 84 101 85 102 // Allow modules to alter the entity prior to embed rendering. 86 $this->moduleHandler->alter(["{$context['data-entity-type']}_embed_context", 'entity_embed_context'], $context, $entity); 103 $this->moduleHandler->alter( 104 ["{$context['data-entity-type']}_embed_context", 'entity_embed_context'], changed this line in version 15 of the diff
123 143 $build['#access'] = $entity->access('view', NULL, TRUE); 124 144 125 145 // @todo Should this hook get invoked if $build is an empty array? 126 $this->moduleHandler->alter(["{$context['data-entity-type']}_embed", 'entity_embed'], $build, $entity, $context); 146 $this->moduleHandler->alter( 147 ["{$context['data-entity-type']}_embed", 'entity_embed'], changed this line in version 15 of the diff
1 <?php changed this line in version 9 of the diff
3 3 defaults: 4 4 _controller: '\Drupal\entity_embed_test\EntityEmbedTestTwigController::idRender' 5 5 requirements: 6 # The access is TRUE. changed this line in version 22 of the diff
11 11 */ 12 12 class ViewModeFieldFormatterTest extends EntityEmbedTestBase { 13 13 14 /** 15 * {@inheritdoc} 16 */ 17 protected $defaultTheme = 'classy'; changed this line in version 12 of the diff
Please register or sign in to reply