Skip to content
Snippets Groups Projects
Commit 56e3bcd1 authored by Sahil Goyal's avatar Sahil Goyal Committed by Nikolay Lobachev
Browse files

Issue #3342229 by sahil.goyal, LOBsTerr: Fix the issues reported by phpcs

parent 9aeb1caa
No related branches found
No related tags found
No related merge requests found
......@@ -179,7 +179,7 @@ function groupmedia_group_content_create_access(AccountInterface $account, array
/**
* Implements hook_form_FORM_ID_alter().
*/
function groupmedia_form_views_exposed_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state) {
function groupmedia_form_views_exposed_form_alter(&$form, FormStateInterface $form_state) {
$view = $form_state->getStorage()['view'] ?? NULL;
if (!empty($view) && $view->id() == 'group_media') {
$group_id = $view->args[0] ?? NULL;
......
......@@ -3,10 +3,10 @@
namespace Drupal\groupmedia_vbo\Plugin\Action;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginFormInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\groupmedia\AttachMediaToGroup;
use Drupal\media\MediaInterface;
use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
......
......@@ -3,10 +3,10 @@
namespace Drupal\groupmedia_vbo\Plugin\Action;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginFormInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\groupmedia\AttachMediaToGroup;
use Drupal\media\MediaInterface;
use Drupal\views_bulk_operations\Action\ViewsBulkOperationsActionBase;
......
......@@ -207,7 +207,7 @@ class AttachMediaToGroup {
*/
public function getMediaFromEntity(EntityInterface $entity) {
$items = [];
foreach ($this->mediaFinder->getDefinitions() as $plugin_id => $definition) {
foreach (array_keys($this->mediaFinder->getDefinitions()) as $plugin_id) {
/** @var \Drupal\groupmedia\MediaFinderInterface $plugin_instance */
$plugin_instance = $this->mediaFinder->createInstance($plugin_id);
if ($plugin_instance && $plugin_instance->applies($entity)) {
......
......@@ -57,8 +57,8 @@ class GroupMediaController extends GroupContentController {
// Display the bundles in alpha order by label.
if (is_array($build['#bundles'])) {
uasort($build['#bundles'], function ($a, $b) {
return strnatcmp($a['label'], $b['label']);
uasort($build['#bundles'], function ($item_a, $item_b) {
return strnatcmp($item_a['label'], $item_b['label']);
});
}
......
......@@ -4,9 +4,9 @@ namespace Drupal\groupmedia\Plugin\Action;
use Drupal\Core\Action\ConfigurableActionBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\groupmedia\AttachMediaToGroup;
use Drupal\media\MediaInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -4,9 +4,9 @@ namespace Drupal\groupmedia\Plugin\Action;
use Drupal\Core\Action\ConfigurableActionBase;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\groupmedia\AttachMediaToGroup;
use Drupal\media\MediaInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -2,11 +2,11 @@
namespace Drupal\groupmedia\Plugin\GroupContentEnabler;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
use Drupal\group\Entity\GroupInterface;
use Drupal\group\Plugin\GroupContentEnablerBase;
use Drupal\media\Entity\MediaType;
use Drupal\Core\Url;
use Drupal\Core\Form\FormStateInterface;
/**
* Provides a content enabler for nodes.
......
......@@ -2,9 +2,9 @@
namespace Drupal\groupmedia\Plugin\GroupContentEnabler;
use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\media\Entity\MediaType;
use Drupal\Component\Plugin\Derivative\DeriverBase;
/**
* Class Group Media Deriver.
......
......@@ -63,6 +63,7 @@ class EntityOperationsTest extends GroupEntityOperationsTest {
* {@inheritdoc}
*/
public function provideEntityOperationScenarios() {
$scenarios = [];
$scenarios['withoutAccess'] = [
[],
['group/1/media' => 'Media'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment