From 36e0695d7a84b09c937d15c14eccfbdae6ea4902 Mon Sep 17 00:00:00 2001 From: willzyx Date: Wed, 10 Apr 2019 01:34:22 +0200 Subject: [PATCH] Coding standard --- devel_generate/devel_generate.module | 2 +- devel_generate/drush/devel_generate.drush8.inc | 6 +++--- devel_generate/src/Commands/DevelGenerateCommands.php | 2 +- devel_generate/src/DevelGenerateBase.php | 2 +- src/Render/FilteredMarkup.php | 2 +- src/Routing/RouteSubscriber.php | 4 ++-- src/Twig/Extension/Debug.php | 4 ++-- tests/src/Functional/DevelContainerInfoTest.php | 8 ++++---- tests/src/Functional/DevelElementInfoTest.php | 2 +- tests/src/Functional/DevelEntityTypeInfoTest.php | 9 +++++---- tests/src/Functional/DevelEventInfoTest.php | 6 +++--- tests/src/Functional/DevelLayoutInfoTest.php | 2 +- tests/src/Functional/DevelRouteInfoTest.php | 4 ++-- tests/src/Kernel/DevelEnforcedDependenciesTest.php | 2 +- tests/src/Kernel/DevelTwigExtensionTest.php | 6 +++--- 15 files changed, 31 insertions(+), 30 deletions(-) diff --git a/devel_generate/devel_generate.module b/devel_generate/devel_generate.module index e0fb054..026ad0f 100644 --- a/devel_generate/devel_generate.module +++ b/devel_generate/devel_generate.module @@ -35,7 +35,7 @@ function devel_generate_entity_insert(EntityInterface $entity) { if ($entity->getEntityTypeId() != 'node' || !isset($entity->devel_generate)) { return; } - /** @var \Drupal\node\NodeInterface $entity */ + /* @var \Drupal\node\NodeInterface $entity */ $results = $entity->devel_generate; if (!empty($results['max_comments'])) { diff --git a/devel_generate/drush/devel_generate.drush8.inc b/devel_generate/drush/devel_generate.drush8.inc index e28226d..810b6d9 100644 --- a/devel_generate/drush/devel_generate.drush8.inc +++ b/devel_generate/drush/devel_generate.drush8.inc @@ -165,10 +165,10 @@ function _drush_plugin_validate($params) { if (!isset($instance_and_values[$plugin_id])) { - /** @var DevelGeneratePluginManager $manager */ + /* @var DevelGeneratePluginManager $manager */ $manager = \Drupal::service('plugin.manager.develgenerate'); - /** @var DevelGenerateBaseInterface $instance */ + /* @var DevelGenerateBaseInterface $instance */ $instance = $manager->createInstance($plugin_id, array()); //Plugin instance suit params in order to fit for generateElements @@ -188,7 +188,7 @@ function drush_devel_generate() { $plugin_id = array_shift($params); $instance_and_values = drupal_static('drush_devel_generate_generate_validate'); - /** @var DevelGenerateBaseInterface $instance */ + /* @var DevelGenerateBaseInterface $instance */ $instance = $instance_and_values[$plugin_id]['instance']; $values = $instance_and_values[$plugin_id]['values']; $instance->generate($values); diff --git a/devel_generate/src/Commands/DevelGenerateCommands.php b/devel_generate/src/Commands/DevelGenerateCommands.php index 493023f..ad68f84 100644 --- a/devel_generate/src/Commands/DevelGenerateCommands.php +++ b/devel_generate/src/Commands/DevelGenerateCommands.php @@ -177,7 +177,7 @@ class DevelGenerateCommands extends DrushCommands { $manager = $this->getManager(); $args = $commandData->input()->getArguments(); $commandName = array_shift($args); - /** @var DevelGenerateBaseInterface $instance */ + /* @var DevelGenerateBaseInterface $instance */ $instance = $manager->createInstance($commandData->annotationData()->get('pluginId'), array()); $this->setPluginInstance($instance); $parameters = $instance->validateDrushParams($args, $commandData->input()->getOptions()); diff --git a/devel_generate/src/DevelGenerateBase.php b/devel_generate/src/DevelGenerateBase.php index 1d38a35..73ecc9c 100644 --- a/devel_generate/src/DevelGenerateBase.php +++ b/devel_generate/src/DevelGenerateBase.php @@ -92,7 +92,7 @@ abstract class DevelGenerateBase extends PluginBase implements DevelGenerateBase * The entity to be enriched with sample field values. */ public static function populateFields(EntityInterface $entity) { - /** @var \Drupal\field\FieldConfigInterface[] $instances */ + /* @var \Drupal\field\FieldConfigInterface[] $instances */ $instances = entity_load_multiple_by_properties('field_config', array('entity_type' => $entity->getEntityType()->id(), 'bundle' => $entity->bundle())); if ($skips = function_exists('drush_get_option') ? drush_get_option('skip-fields', '') : @$_REQUEST['skip-fields']) { diff --git a/src/Render/FilteredMarkup.php b/src/Render/FilteredMarkup.php index d43c0d5..2d144a0 100644 --- a/src/Render/FilteredMarkup.php +++ b/src/Render/FilteredMarkup.php @@ -20,4 +20,4 @@ use Drupal\Component\Render\MarkupTrait; final class FilteredMarkup implements MarkupInterface, \Countable { use MarkupTrait; -} \ No newline at end of file +} diff --git a/src/Routing/RouteSubscriber.php b/src/Routing/RouteSubscriber.php index e8ea49b..b0da4ce 100644 --- a/src/Routing/RouteSubscriber.php +++ b/src/Routing/RouteSubscriber.php @@ -101,7 +101,7 @@ class RouteSubscriber extends RouteSubscriberBase { '_title' => 'Devel Render', ]) ->addRequirements([ - '_permission' => 'access devel information' + '_permission' => 'access devel information', ]) ->setOption('_admin_route', TRUE) ->setOption('_devel_entity_type_id', $entity_type_id) @@ -132,7 +132,7 @@ class RouteSubscriber extends RouteSubscriberBase { '_title' => 'Entity type definition', ]) ->addRequirements([ - '_permission' => 'access devel information' + '_permission' => 'access devel information', ]) ->setOption('_admin_route', TRUE) ->setOption('_devel_entity_type_id', $entity_type_id) diff --git a/src/Twig/Extension/Debug.php b/src/Twig/Extension/Debug.php index d6d655f..45076e0 100644 --- a/src/Twig/Extension/Debug.php +++ b/src/Twig/Extension/Debug.php @@ -181,10 +181,10 @@ class Debug extends \Twig_Extension { * Filters the Twig context variable. * * @param array $context - * The Twig context. + * The Twig context. * * @return array - * An array Twig context variables. + * An array Twig context variables. */ protected function getContextVariables(array $context) { $context_variables = []; diff --git a/tests/src/Functional/DevelContainerInfoTest.php b/tests/src/Functional/DevelContainerInfoTest.php index c47d773..818cc6a 100644 --- a/tests/src/Functional/DevelContainerInfoTest.php +++ b/tests/src/Functional/DevelContainerInfoTest.php @@ -69,7 +69,7 @@ class DevelContainerInfoTest extends BrowserTestBase { $this->assertNotNull($table); // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ + /* @var $headers \Behat\Mink\Element\NodeElement[] */ $headers = $table->findAll('css', 'thead th'); $this->assertEquals(4, count($headers)); @@ -105,7 +105,7 @@ class DevelContainerInfoTest extends BrowserTestBase { $row = $table->find('css', sprintf('tbody tr:contains("%s")', $service_id)); $this->assertNotNull($row); - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $row->findAll('css', 'td'); $this->assertEquals(4, count($cells)); @@ -174,7 +174,7 @@ class DevelContainerInfoTest extends BrowserTestBase { $this->assertNotNull($table); // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ + /* @var $headers \Behat\Mink\Element\NodeElement[] */ $headers = $table->findAll('css', 'thead th'); $this->assertEquals(2, count($headers)); @@ -202,7 +202,7 @@ class DevelContainerInfoTest extends BrowserTestBase { $row = $table->find('css', sprintf('tbody tr:contains("%s")', $parameter_name)); $this->assertNotNull($row); - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $row->findAll('css', 'td'); $this->assertEquals(2, count($cells)); diff --git a/tests/src/Functional/DevelElementInfoTest.php b/tests/src/Functional/DevelElementInfoTest.php index 2698e24..fd1c74d 100644 --- a/tests/src/Functional/DevelElementInfoTest.php +++ b/tests/src/Functional/DevelElementInfoTest.php @@ -96,7 +96,7 @@ class DevelElementInfoTest extends BrowserTestBase { $row = $table->find('css', sprintf('tbody tr:contains("%s")', $element_name)); $this->assertNotNull($row); - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $row->findAll('css', 'td'); $this->assertEquals(4, count($cells)); diff --git a/tests/src/Functional/DevelEntityTypeInfoTest.php b/tests/src/Functional/DevelEntityTypeInfoTest.php index 3a708e5..ed12b4d 100644 --- a/tests/src/Functional/DevelEntityTypeInfoTest.php +++ b/tests/src/Functional/DevelEntityTypeInfoTest.php @@ -43,8 +43,8 @@ class DevelEntityTypeInfoTest extends BrowserTestBase { */ public function testEntityInfoMenuLink() { $this->drupalPlaceBlock('system_menu_block:devel'); - // Ensures that the entity type info link is present on the devel menu and that - // it points to the correct page. + // Ensures that the entity type info link is present on the devel menu and + // that it points to the correct page. $this->drupalGet(''); $this->clickLink('Entity Info'); $this->assertSession()->statusCodeEquals(200); @@ -76,7 +76,8 @@ class DevelEntityTypeInfoTest extends BrowserTestBase { }, $headers); $this->assertSame($expected_headers, $actual_headers); - // Tests the presence of some (arbitrarily chosen) entity types in the table. + // Tests the presence of some (arbitrarily chosen) entity types in the + // table. $expected_types = [ 'date_format' => [ 'name' => 'Date format', @@ -99,7 +100,7 @@ class DevelEntityTypeInfoTest extends BrowserTestBase { $row = $table->find('css', sprintf('tbody tr:contains("%s")', $entity_type_id)); $this->assertNotNull($row); - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $row->findAll('css', 'td'); $this->assertEquals(5, count($cells)); diff --git a/tests/src/Functional/DevelEventInfoTest.php b/tests/src/Functional/DevelEventInfoTest.php index d33458b..6b1b3e0 100644 --- a/tests/src/Functional/DevelEventInfoTest.php +++ b/tests/src/Functional/DevelEventInfoTest.php @@ -67,7 +67,7 @@ class DevelEventInfoTest extends BrowserTestBase { $this->assertNotNull($table); // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ + /* @var $headers \Behat\Mink\Element\NodeElement[] */ $headers = $table->findAll('css', 'thead th'); $this->assertEquals(3, count($headers)); @@ -100,14 +100,14 @@ class DevelEventInfoTest extends BrowserTestBase { $this->assertEquals(1, count($event_header_row)); // Ensures that all the event listener are listed in the table. - /** @var $event_rows \Behat\Mink\Element\NodeElement[] */ + /* @var $event_rows \Behat\Mink\Element\NodeElement[] */ $event_rows = $table->findAll('css', sprintf('tbody tr:contains("%s")', $event_name)); // Remove the header row. array_shift($event_rows); $this->assertEquals(count($listeners), count($event_rows)); foreach ($listeners as $index => $listener) { - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $event_rows[$index]->findAll('css', 'td'); $this->assertEquals(3, count($cells)); diff --git a/tests/src/Functional/DevelLayoutInfoTest.php b/tests/src/Functional/DevelLayoutInfoTest.php index 6277de1..307247b 100644 --- a/tests/src/Functional/DevelLayoutInfoTest.php +++ b/tests/src/Functional/DevelLayoutInfoTest.php @@ -70,7 +70,7 @@ class DevelLayoutInfoTest extends BrowserTestBase { $this->assertNotNull($table); // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ + /* @var $headers \Behat\Mink\Element\NodeElement[] */ $headers = $table->findAll('css', 'thead th'); $this->assertEquals(6, count($headers)); diff --git a/tests/src/Functional/DevelRouteInfoTest.php b/tests/src/Functional/DevelRouteInfoTest.php index bdd1d11..5905235 100644 --- a/tests/src/Functional/DevelRouteInfoTest.php +++ b/tests/src/Functional/DevelRouteInfoTest.php @@ -52,7 +52,7 @@ class DevelRouteInfoTest extends BrowserTestBase { $page = $this->getSession()->getPage(); // Ensures that the expected table headers are found. - /** @var $headers \Behat\Mink\Element\NodeElement[] */ + /* @var $headers \Behat\Mink\Element\NodeElement[] */ $headers = $page->findAll('css', 'table.devel-route-list thead th'); $this->assertEquals(4, count($headers)); @@ -94,7 +94,7 @@ class DevelRouteInfoTest extends BrowserTestBase { $row = $page->find('css', sprintf('table.devel-route-list tbody tr:contains("%s")', $route_name)); $this->assertNotNull($row); - /** @var $cells \Behat\Mink\Element\NodeElement[] */ + /* @var $cells \Behat\Mink\Element\NodeElement[] */ $cells = $row->findAll('css', 'td'); $this->assertEquals(4, count($cells)); diff --git a/tests/src/Kernel/DevelEnforcedDependenciesTest.php b/tests/src/Kernel/DevelEnforcedDependenciesTest.php index b67965b..2c2f3b0 100644 --- a/tests/src/Kernel/DevelEnforcedDependenciesTest.php +++ b/tests/src/Kernel/DevelEnforcedDependenciesTest.php @@ -36,7 +36,7 @@ class DevelEnforcedDependenciesTest extends KernelTestBase { * Tests devel menu enforced dependencies. */ public function testMenuEnforcedDependencies() { - /** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */ + /* @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */ $config_manager = $this->container->get('config.manager'); // Ensure that the Devel menu has explicit enforced dependencies on devel diff --git a/tests/src/Kernel/DevelTwigExtensionTest.php b/tests/src/Kernel/DevelTwigExtensionTest.php index 349ab09..c1cc2ac 100644 --- a/tests/src/Kernel/DevelTwigExtensionTest.php +++ b/tests/src/Kernel/DevelTwigExtensionTest.php @@ -78,7 +78,7 @@ class DevelTwigExtensionTest extends KernelTestBase { * Tests that the Twig dump functions are registered properly. */ public function testDumpFunctionsRegistered() { - /** @var \Twig_SimpleFunction[] $functions */ + /* @var \Twig_SimpleFunction[] $functions */ $functions = \Drupal::service('twig')->getFunctions(); $dump_functions = ['devel_dump', 'kpr']; @@ -107,7 +107,7 @@ class DevelTwigExtensionTest extends KernelTestBase { * Tests that the Twig function for XDebug integration is registered properly. */ public function testXDebugIntegrationFunctionsRegistered() { - /** @var \Twig_SimpleFunction $function */ + /* @var \Twig_SimpleFunction $function */ $function = \Drupal::service('twig')->getFunction('devel_breakpoint'); $this->assertTrue($function instanceof \Twig_SimpleFunction); $this->assertEquals($function->getName(), 'devel_breakpoint'); @@ -134,7 +134,7 @@ class DevelTwigExtensionTest extends KernelTestBase { 'twig_object' => new \stdClass(), ]; - /** @var \Drupal\Core\Template\TwigEnvironment $environment */ + /* @var \Drupal\Core\Template\TwigEnvironment $environment */ $environment = \Drupal::service('twig'); // Ensures that the twig extension does nothing if the current -- 2.22.2