diff --git a/examples/Commands/ArtCommands.php b/examples/Commands/ArtCommands.php index c45d88f214..b1f24145b9 100644 --- a/examples/Commands/ArtCommands.php +++ b/examples/Commands/ArtCommands.php @@ -1,4 +1,5 @@ src examples tests - + 0 + 0 diff --git a/src/.editorconfig b/src/.editorconfig index 64b60abd04..1f11b458d9 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -1,8 +1,8 @@ # This file is for unifying the coding style for different editors and IDEs # editorconfig.org -# PHP PSR-2 Coding Standards -# http://www.php-fig.org/psr/psr-2/ +# PHP PSR-12 Coding Standards +# http://www.php-fig.org/psr/psr-12/ [*.php] charset = utf-8 diff --git a/src/Application.php b/src/Application.php index dea7e9b4db..c54da5ef30 100644 --- a/src/Application.php +++ b/src/Application.php @@ -1,4 +1,5 @@ 'table']): RowsOfFields $application = Drush::getApplication(); $def = $application->getDefinition(); foreach ($def->getOptions() as $key => $value) { - $name = '--'. $key; + $name = '--' . $key; if ($value->getShortcut()) { $name = '-' . $value->getShortcut() . ', ' . $name; } diff --git a/src/Commands/core/DeployCommands.php b/src/Commands/core/DeployCommands.php index ab88271dd5..6029bf88d4 100644 --- a/src/Commands/core/DeployCommands.php +++ b/src/Commands/core/DeployCommands.php @@ -1,4 +1,5 @@ targetEvaluatedPath->fullyQualifiedPath()); $ssh_options = $this->getConfig()->get('ssh.options', ''); - $exec = "rsync -e 'ssh $ssh_options'". ' '. implode(' ', array_filter($parameters)); + $exec = "rsync -e 'ssh $ssh_options'" . ' ' . implode(' ', array_filter($parameters)); $process = $this->processManager()->shell($exec); $process->run($process->showRealtime()); @@ -98,7 +99,7 @@ public function rsyncOptions($options): string } } - $mode = '-'. $options['mode']; + $mode = '-' . $options['mode']; if ($this->output()->isVerbose()) { $mode .= 'v'; $verbose = ' --stats --progress'; diff --git a/src/Commands/core/RunserverCommands.php b/src/Commands/core/RunserverCommands.php index 94d7bba0fb..362cbebbb1 100644 --- a/src/Commands/core/RunserverCommands.php +++ b/src/Commands/core/RunserverCommands.php @@ -1,4 +1,5 @@ true]): void * @filter-default-field type * @return RowsOfFields */ - public function updatedbStatus($options = ['format'=> 'table', 'entity-updates' => true, 'post-updates' => true]) + public function updatedbStatus($options = ['format' => 'table', 'entity-updates' => true, 'post-updates' => true]) { require_once DRUSH_DRUPAL_CORE . '/includes/install.inc'; drupal_load_updates(); @@ -563,7 +564,7 @@ public function getUpdatedbStatus(array $options): array 'module' => $module, 'update_id' => $update_id, 'description' => $description, - 'type'=> 'hook_update_n' + 'type' => 'hook_update_n' ]; } if (isset($updates['start'])) { @@ -574,8 +575,10 @@ public function getUpdatedbStatus(array $options): array // Append row(s) for pending entity definition updates. if ($options['entity-updates']) { - foreach (\Drupal::entityDefinitionUpdateManager() - ->getChangeSummary() as $entity_type_id => $changes) { + foreach ( + \Drupal::entityDefinitionUpdateManager() + ->getChangeSummary() as $entity_type_id => $changes + ) { foreach ($changes as $change) { $return[] = [ 'module' => dt('@type entity type', ['@type' => $entity_type_id]), @@ -671,7 +674,7 @@ public function updateCheckRequirements(): bool if (isset($requirement['severity']) && $requirement['severity'] != REQUIREMENT_OK) { $message = isset($requirement['description']) ? DrupalUtil::drushRender($requirement['description']) : ''; if (isset($requirement['value']) && $requirement['value']) { - $message .= ' (Currently using '. $requirement['title'] .' '. DrupalUtil::drushRender($requirement['value']) .')'; + $message .= ' (Currently using ' . $requirement['title'] . ' ' . DrupalUtil::drushRender($requirement['value']) . ')'; } $log_level = $requirement['severity'] === REQUIREMENT_ERROR ? LogLevel::ERROR : LogLevel::WARNING; $this->logger()->log($log_level, $message); diff --git a/src/Commands/core/XhprofCommands.php b/src/Commands/core/XhprofCommands.php index 80dff899af..af401a3d73 100644 --- a/src/Commands/core/XhprofCommands.php +++ b/src/Commands/core/XhprofCommands.php @@ -23,7 +23,6 @@ */ class XhprofCommands extends DrushCommands { - const XH_PROFILE_MEMORY = false; const XH_PROFILE_CPU = false; const XH_PROFILE_BUILTINS = true; diff --git a/src/Commands/generate/ApplicationFactory.php b/src/Commands/generate/ApplicationFactory.php index f67963ce98..c4ee7a3270 100644 --- a/src/Commands/generate/ApplicationFactory.php +++ b/src/Commands/generate/ApplicationFactory.php @@ -176,7 +176,7 @@ protected function getGenerators(array $classes): array { return array_map( function (string $class): Generator { - return new $class; + return new $class(); }, array_filter($classes, function (string $class): bool { $reflectionClass = new \ReflectionClass($class); diff --git a/src/Commands/generate/GenerateCommands.php b/src/Commands/generate/GenerateCommands.php index db02125df0..412f5ee58b 100644 --- a/src/Commands/generate/GenerateCommands.php +++ b/src/Commands/generate/GenerateCommands.php @@ -13,7 +13,6 @@ */ class GenerateCommands extends DrushCommands implements AutoloaderAwareInterface { - use AutoloaderAwareTrait; /** diff --git a/src/Commands/help/DrushHelpDocument.php b/src/Commands/help/DrushHelpDocument.php index 8bd2fc0a61..dfe51f9216 100644 --- a/src/Commands/help/DrushHelpDocument.php +++ b/src/Commands/help/DrushHelpDocument.php @@ -7,7 +7,6 @@ class DrushHelpDocument extends HelpDocument { - /** * @inheritdoc */ diff --git a/src/Commands/help/HelpCLIFormatter.php b/src/Commands/help/HelpCLIFormatter.php index e272dd9455..3c63fc1e92 100644 --- a/src/Commands/help/HelpCLIFormatter.php +++ b/src/Commands/help/HelpCLIFormatter.php @@ -1,4 +1,5 @@ processManager()->process(['git', 'add', '-A', '.'], $destination_dir); $process->mustRun(); - $comment_file = drush_save_data_to_temp_file($options['message'] ?: 'Exported configuration.'. $preview); + $comment_file = drush_save_data_to_temp_file($options['message'] ?: 'Exported configuration.' . $preview); $process = $this->processManager()->process(['git', 'commit', "--file=$comment_file"], $destination_dir); $process->mustRun(); } diff --git a/src/Drupal/Commands/config/ConfigImportCommands.php b/src/Drupal/Commands/config/ConfigImportCommands.php index f73203230a..3279d4cb54 100644 --- a/src/Drupal/Commands/config/ConfigImportCommands.php +++ b/src/Drupal/Commands/config/ConfigImportCommands.php @@ -1,4 +1,5 @@ getModuleList()), diff --git a/src/Drupal/Commands/core/DrupalCommands.php b/src/Drupal/Commands/core/DrupalCommands.php index a4b615d2a5..d39630cece 100644 --- a/src/Drupal/Commands/core/DrupalCommands.php +++ b/src/Drupal/Commands/core/DrupalCommands.php @@ -1,4 +1,5 @@ 'table', 'severity' => -1, * @option path An internal path. * @version 10.5 */ - public function route($options = ['name' => self::REQ, 'path' =>self::REQ, 'format' => 'yaml']) + public function route($options = ['name' => self::REQ, 'path' => self::REQ, 'format' => 'yaml']) { $route = $items = null; $provider = $this->getRouteProvider(); @@ -182,13 +182,15 @@ public function route($options = ['name' => self::REQ, 'path' =>self::REQ, 'form } return $items; } - + private static function styleRow($content, $format, $severity): ?string { - if (!in_array($format, [ + if ( + !in_array($format, [ 'sections', 'table', - ])) { + ]) + ) { return $content; } diff --git a/src/Drupal/Commands/core/EntityCommands.php b/src/Drupal/Commands/core/EntityCommands.php index 38408d6617..f857e82f01 100644 --- a/src/Drupal/Commands/core/EntityCommands.php +++ b/src/Drupal/Commands/core/EntityCommands.php @@ -12,7 +12,6 @@ class EntityCommands extends DrushCommands { - protected $entityTypeManager; /** diff --git a/src/Drupal/Commands/core/ImageCommands.php b/src/Drupal/Commands/core/ImageCommands.php index c8f764bb65..7593e03717 100644 --- a/src/Drupal/Commands/core/ImageCommands.php +++ b/src/Drupal/Commands/core/ImageCommands.php @@ -10,7 +10,6 @@ class ImageCommands extends DrushCommands { - /** * Flush all derived images for a given style. * diff --git a/src/Drupal/Commands/core/JsonapiCommands.php b/src/Drupal/Commands/core/JsonapiCommands.php index bb6e664932..02ea0efbf4 100644 --- a/src/Drupal/Commands/core/JsonapiCommands.php +++ b/src/Drupal/Commands/core/JsonapiCommands.php @@ -1,4 +1,5 @@ isInstalled() + if ( + !$this->isInstalled() || $input->getOption('field-type') !== 'link' ) { return; @@ -66,7 +67,8 @@ public function hookSetOptions(InputInterface $input): void /** @hook on-event field-create-field-config */ public function hookFieldConfig(array $values, InputInterface $input): array { - if (!$this->isInstalled() + if ( + !$this->isInstalled() || $values['field_type'] !== 'link' ) { return $values; diff --git a/src/Drupal/Commands/core/LocaleCommands.php b/src/Drupal/Commands/core/LocaleCommands.php index a73a282296..6649a30799 100644 --- a/src/Drupal/Commands/core/LocaleCommands.php +++ b/src/Drupal/Commands/core/LocaleCommands.php @@ -17,7 +17,6 @@ class LocaleCommands extends DrushCommands { - protected $languageManager; protected $configFactory; diff --git a/src/Drupal/Commands/core/QueueCommands.php b/src/Drupal/Commands/core/QueueCommands.php index 76a483870f..5761ccc937 100644 --- a/src/Drupal/Commands/core/QueueCommands.php +++ b/src/Drupal/Commands/core/QueueCommands.php @@ -1,4 +1,5 @@ self::REQ, 'ty throw new \Exception(dt('Watchdog message #!wid does not exist.', ['!wid' => $substring])); } } else { - if ((empty($substring))&&(!isset($options['type']))&&(!isset($options['severity']))) { + if ((empty($substring)) && (!isset($options['type'])) && (!isset($options['severity']))) { throw new \Exception(dt('No options provided.')); } $where = $this->where($options['type'], $options['severity'], $substring, 'OR'); @@ -325,7 +325,7 @@ protected function where($type = null, $severity = null, $filter = null, $criter } if ($filter) { $conditions[] = "message LIKE :filter"; - $args[':filter'] = '%'.$filter.'%'; + $args[':filter'] = '%' . $filter . '%'; } $where = implode(" $criteria ", $conditions); diff --git a/src/Drupal/Commands/field/FieldCreateCommands.php b/src/Drupal/Commands/field/FieldCreateCommands.php index 326eedd56d..395b73baad 100644 --- a/src/Drupal/Commands/field/FieldCreateCommands.php +++ b/src/Drupal/Commands/field/FieldCreateCommands.php @@ -607,7 +607,8 @@ protected function getExistingFieldStorageOptions(string $entityType, string $bu ? $fieldTypes[$fieldType]['id'] : $fieldTypes[$fieldType]['label']; - if ($fieldStorage instanceof FieldStorageConfigInterface + if ( + $fieldStorage instanceof FieldStorageConfigInterface && !$fieldStorage->isLocked() && empty($fieldTypes[$fieldType]['no_ui']) && !in_array($bundle, $fieldStorage->getBundles(), true) diff --git a/src/Drupal/Commands/pm/PmCommands.php b/src/Drupal/Commands/pm/PmCommands.php index 051bea0160..1e00ac2087 100644 --- a/src/Drupal/Commands/pm/PmCommands.php +++ b/src/Drupal/Commands/pm/PmCommands.php @@ -1,4 +1,5 @@ 'table', 'type' => 'module,theme' $row = [ 'package' => $extension->info['package'], 'project' => isset($extension->info['project']) ? $extension->info['project'] : '', - 'display_name' => $extension->info['name']. ' ('. $extension->getName(). ')', + 'display_name' => $extension->info['name'] . ' (' . $extension->getName() . ')', 'name' => $extension->getName(), 'type' => $extension->getType(), 'path' => $extension->getPath(), diff --git a/src/Drupal/Commands/pm/ThemeCommands.php b/src/Drupal/Commands/pm/ThemeCommands.php index dc09ea6d9f..55be734b9e 100644 --- a/src/Drupal/Commands/pm/ThemeCommands.php +++ b/src/Drupal/Commands/pm/ThemeCommands.php @@ -1,4 +1,5 @@ '. Escape::shellArg($result_file); + $exec .= ' > ' . Escape::shellArg($result_file); } // In --verbose mode, Process will show the call to mysql/psql/sqlite, @@ -398,7 +397,7 @@ public function drop(array $tables): ?bool { $return = true; if ($tables) { - $sql = 'DROP TABLE '. implode(', ', $tables); + $sql = 'DROP TABLE ' . implode(', ', $tables); $return = $this->query($sql); } return $return; diff --git a/src/Sql/SqlMysql.php b/src/Sql/SqlMysql.php index 61af74a8a9..1cb6964be1 100644 --- a/src/Sql/SqlMysql.php +++ b/src/Sql/SqlMysql.php @@ -6,7 +6,6 @@ class SqlMysql extends SqlBase { - public $queryExtra = '-A'; public function command(): string @@ -186,7 +185,7 @@ public function dumpCmd($table_selection): string $ignores[] = '--ignore-table=' . $dbSpec['database'] . '.' . $table; $parens = true; } - $exec .= ' '. implode(' ', $ignores); + $exec .= ' ' . implode(' ', $ignores); // Run mysqldump again and append output if we need some structure only tables. if (!empty($structure_tables)) { diff --git a/src/Sql/SqlPgsql.php b/src/Sql/SqlPgsql.php index 70ec64b793..89d7c6059f 100644 --- a/src/Sql/SqlPgsql.php +++ b/src/Sql/SqlPgsql.php @@ -8,7 +8,6 @@ class SqlPgsql extends SqlBase { - public $queryExtra = "--no-align --field-separator=\"\t\" --pset tuples_only=on"; public $queryFile = "--file"; @@ -158,7 +157,7 @@ public function dumpCmd($table_selection): string foreach ($skip_tables as $table) { $ignores[] = "--exclude-table=$table"; } - $exec .= ' '. implode(' ', $ignores); + $exec .= ' ' . implode(' ', $ignores); // Run pg_dump again and append output if we need some structure only tables. if (!empty($structure_tables)) { $parens = true; diff --git a/src/Sql/SqlTableSelectionTrait.php b/src/Sql/SqlTableSelectionTrait.php index 19c1224c70..2354ecc889 100644 --- a/src/Sql/SqlTableSelectionTrait.php +++ b/src/Sql/SqlTableSelectionTrait.php @@ -1,4 +1,5 @@ escapeToken($match[2]); + return $match[1] . $this->escapeToken($match[2]); } if ($token && '-' !== $token[0]) { diff --git a/src/Symfony/DrushStyleInjector.php b/src/Symfony/DrushStyleInjector.php index 41c7f3fcab..2f000eef8c 100644 --- a/src/Symfony/DrushStyleInjector.php +++ b/src/Symfony/DrushStyleInjector.php @@ -1,4 +1,5 @@ escapeToken($match[2]); + return $match[1] . $this->escapeToken($match[2]); } if ($token && $token[0] !== '-') { diff --git a/src/TestTraits/CliTestTrait.php b/src/TestTraits/CliTestTrait.php index 95e703afb5..dc3db23d57 100644 --- a/src/TestTraits/CliTestTrait.php +++ b/src/TestTraits/CliTestTrait.php @@ -1,4 +1,5 @@ getArgument('name'); if ($name) { - $text = 'Hello '.$name; + $text = 'Hello ' . $name; } else { $text = 'Hello'; } diff --git a/tests/fixtures/modules/woot/src/Commands/GreetCommand.php b/tests/fixtures/modules/woot/src/Commands/GreetCommand.php index cd52c0ce24..39fca6af0e 100644 --- a/tests/fixtures/modules/woot/src/Commands/GreetCommand.php +++ b/tests/fixtures/modules/woot/src/Commands/GreetCommand.php @@ -1,4 +1,5 @@ getArgument('name'); if ($name) { - $text = 'Hello '.$name; + $text = 'Hello ' . $name; } else { $text = 'Hello'; } diff --git a/tests/fixtures/modules/woot/src/Commands/WootCommands.php b/tests/fixtures/modules/woot/src/Commands/WootCommands.php index 9f8596eb22..feed2432d8 100644 --- a/tests/fixtures/modules/woot/src/Commands/WootCommands.php +++ b/tests/fixtures/modules/woot/src/Commands/WootCommands.php @@ -1,4 +1,5 @@ setUpDrupal(1, true); diff --git a/tests/functional/Commands/TestFixtureCommands.php b/tests/functional/Commands/TestFixtureCommands.php index e35819196f..50a9ec506b 100644 --- a/tests/functional/Commands/TestFixtureCommands.php +++ b/tests/functional/Commands/TestFixtureCommands.php @@ -4,6 +4,7 @@ * @file * Commands which are useful for unit tests. */ + namespace Drush\Commands; use Drupal\Core\DrupalKernel; @@ -14,7 +15,6 @@ class TestFixtureCommands extends DrushCommands implements AutoloaderAwareInterface { - use AutoloaderAwareTrait; // Obsolete: @@ -126,7 +126,7 @@ protected function loadDrupalAutoloader($drupal_root) { static $autoloader = false; - $autoloadFilePath = $drupal_root .'/autoload.php'; + $autoloadFilePath = $drupal_root . '/autoload.php'; if (!$autoloader && file_exists($autoloadFilePath)) { $autoloader = require $autoloadFilePath; } diff --git a/tests/functional/ConfigPullTest.php b/tests/functional/ConfigPullTest.php index efe76609bd..711e70c3e5 100644 --- a/tests/functional/ConfigPullTest.php +++ b/tests/functional/ConfigPullTest.php @@ -1,4 +1,5 @@ setUpDrupal(2, true); diff --git a/tests/functional/ConfigTest.php b/tests/functional/ConfigTest.php index 690a9d3dbe..36520171fe 100644 --- a/tests/functional/ConfigTest.php +++ b/tests/functional/ConfigTest.php @@ -118,7 +118,7 @@ public function testConfigExportImportStatusExistingConfig() $contents = preg_replace('/front: .*/', 'front: unish partial', $contents); $partial_path = self::getSandbox() . '/partial'; $this->mkdir($partial_path); - $contents = file_put_contents($partial_path. '/system.site.yml', $contents); + $contents = file_put_contents($partial_path . '/system.site.yml', $contents); $this->drush('config-import', [], ['partial' => null, 'source' => $partial_path]); $this->drush('config-get', ['system.site', 'page'], ['format' => 'json']); $page = $this->getOutputFromJSON('system.site:page'); @@ -186,6 +186,6 @@ class: Drupal\woot\DependingService protected function getConfigSyncDir() { $this->drush('core:status', [], ['format' => 'json', 'fields' => 'config-sync']); - return $this->webroot().'/'.$this->getOutputFromJSON('config-sync'); + return $this->webroot() . '/' . $this->getOutputFromJSON('config-sync'); } } diff --git a/tests/functional/CoreTest.php b/tests/functional/CoreTest.php index db825c9ed5..80d5f034e8 100644 --- a/tests/functional/CoreTest.php +++ b/tests/functional/CoreTest.php @@ -47,7 +47,8 @@ public function testOptionsUri() 'format' => 'json', 'uri' => 'OMIT', // A special value which causes --uri to not be specified. ]; - foreach ([ + foreach ( + [ 'test.uri' => ['http://test.uri', 'sites/dev'], 'test.uri/' => ['http://test.uri/', 'sites/dev'], 'test.uri/subpath' => ['http://test.uri/subpath', 'sites/stage'], @@ -60,7 +61,8 @@ public function testOptionsUri() 'https://test.uri/' => ['https://test.uri/', 'sites/dev'], 'https://test.uri/subpath' => ['https://test.uri/subpath', 'sites/stage'], 'https://test.uri/subpath/' => ['https://test.uri/subpath/', 'sites/stage'], - ] as $test_uri => $expected) { + ] as $test_uri => $expected + ) { // Put a yml file in the drush folder. $config_options = [ 'options' => [ @@ -84,7 +86,8 @@ public function testOptionsUriRequestUrl() $command_options = [ 'uri' => 'OMIT', // A special value which causes --uri to not be specified. ]; - foreach ([ + foreach ( + [ 'test.uri' => 'http://test.uri', 'test.uri/' => 'http://test.uri', 'test.uri/subpath' => 'http://test.uri/subpath', @@ -97,7 +100,8 @@ public function testOptionsUriRequestUrl() 'https://test.uri/' => 'https://test.uri', 'https://test.uri/subpath' => 'https://test.uri/subpath', 'https://test.uri/subpath/' => 'https://test.uri/subpath', - ] as $test_uri => $expected) { + ] as $test_uri => $expected + ) { // Put a yml file in the drush folder. $config_options = [ 'options' => [ @@ -109,7 +113,7 @@ public function testOptionsUriRequestUrl() unlink($drush_config_file); $output = $this->getOutputRaw(); // Include the test URI, for some context in errors. - $i=10; + $i = 10; $this->assertEquals([$test_uri => $expected], [$test_uri => trim($output)]); } } diff --git a/tests/functional/FieldTest.php b/tests/functional/FieldTest.php index 3274839d6f..80bbc45df3 100644 --- a/tests/functional/FieldTest.php +++ b/tests/functional/FieldTest.php @@ -10,7 +10,6 @@ */ class FieldTest extends CommandUnishTestCase { - public function setup(): void { parent::setup(); diff --git a/tests/functional/PmEnDisUnListInfoTest.php b/tests/functional/PmEnDisUnListInfoTest.php index 59094c37b9..3f772a28ca 100644 --- a/tests/functional/PmEnDisUnListInfoTest.php +++ b/tests/functional/PmEnDisUnListInfoTest.php @@ -15,7 +15,6 @@ */ class EnDisUnListInfoTest extends CommandUnishTestCase { - public function testEnDisUnList() { $sites = $this->setUpDrupal(1, true); diff --git a/tests/functional/PmEnLocaleImportTest.php b/tests/functional/PmEnLocaleImportTest.php index 4d17fa15fb..64c9d38e53 100644 --- a/tests/functional/PmEnLocaleImportTest.php +++ b/tests/functional/PmEnLocaleImportTest.php @@ -13,7 +13,6 @@ */ class PmEnLocaleImportTest extends CommandUnishTestCase { - public function testBatchImportTranslations() { $info_yml = Path::join($this->webroot(), 'modules/unish/drush_empty_module/drush_empty_module.info.yml'); diff --git a/tests/functional/RedispatchTest.php b/tests/functional/RedispatchTest.php index 6b2f22572a..e2ff0796ea 100644 --- a/tests/functional/RedispatchTest.php +++ b/tests/functional/RedispatchTest.php @@ -9,7 +9,6 @@ */ class RedispatchTest extends CommandUnishTestCase { - /** * Covers the following origin responsibilities. * - A remote host is recognized in site specification. diff --git a/tests/functional/RsyncTest.php b/tests/functional/RsyncTest.php index a3ebe2e0ba..abdce97945 100644 --- a/tests/functional/RsyncTest.php +++ b/tests/functional/RsyncTest.php @@ -11,7 +11,6 @@ */ class RsyncTest extends CommandUnishTestCase { - public function setup(): void { if ($this->isWindows()) { diff --git a/tests/functional/SiteInstallTest.php b/tests/functional/SiteInstallTest.php index c7b6ed8847..16894fd727 100644 --- a/tests/functional/SiteInstallTest.php +++ b/tests/functional/SiteInstallTest.php @@ -8,7 +8,6 @@ */ class SiteInstallTest extends CommandUnishTestCase { - /** * Test functionality of site set. */ diff --git a/tests/functional/SiteSetTest.php b/tests/functional/SiteSetTest.php index 0e31941557..6a44f1ee3a 100644 --- a/tests/functional/SiteSetTest.php +++ b/tests/functional/SiteSetTest.php @@ -8,7 +8,6 @@ */ class SiteSetTest extends CommandUnishTestCase { - /** * Test functionality of site set. */ diff --git a/tests/functional/SiteSshTest.php b/tests/functional/SiteSshTest.php index 8e16106bc3..89ef906bc6 100644 --- a/tests/functional/SiteSshTest.php +++ b/tests/functional/SiteSshTest.php @@ -10,7 +10,6 @@ */ class SiteSshTest extends CommandUnishTestCase { - /** * Test drush ssh --simulate. No additional bash passed. */ diff --git a/tests/functional/SqlConnectTest.php b/tests/functional/SqlConnectTest.php index e58fe58d59..1f23fc8111 100644 --- a/tests/functional/SqlConnectTest.php +++ b/tests/functional/SqlConnectTest.php @@ -12,7 +12,6 @@ */ class SqlConnectTest extends CommandUnishTestCase { - public function testSqlConnect() { $this->setUpDrupal(1, true); diff --git a/tests/functional/SqlDumpTest.php b/tests/functional/SqlDumpTest.php index 0cfe24b743..475caadda6 100644 --- a/tests/functional/SqlDumpTest.php +++ b/tests/functional/SqlDumpTest.php @@ -13,7 +13,6 @@ */ class SqlDumpTest extends CommandUnishTestCase { - /** * Test that a dump file is created successfully. */ diff --git a/tests/functional/SqlSyncTest.php b/tests/functional/SqlSyncTest.php index c33c4afcdb..6a0ca77aee 100644 --- a/tests/functional/SqlSyncTest.php +++ b/tests/functional/SqlSyncTest.php @@ -1,4 +1,5 @@ isWindows()) { diff --git a/tests/functional/UserTest.php b/tests/functional/UserTest.php index 3871965fe2..8007394211 100644 --- a/tests/functional/UserTest.php +++ b/tests/functional/UserTest.php @@ -10,7 +10,6 @@ */ class UserTest extends CommandUnishTestCase { - const NAME = 'example'; const MAIL = 'example@example.com'; diff --git a/tests/functional/WatchdogTailTest.php b/tests/functional/WatchdogTailTest.php index 3b973f3039..520058c037 100644 --- a/tests/functional/WatchdogTailTest.php +++ b/tests/functional/WatchdogTailTest.php @@ -11,7 +11,6 @@ */ class WatchdogTailTest extends CommandUnishTestCase { - /** * Test that watchdog tail works. */ diff --git a/tests/integration/CacheCommandTest.php b/tests/integration/CacheCommandTest.php index 7bebfd2573..51bf9c772d 100644 --- a/tests/integration/CacheCommandTest.php +++ b/tests/integration/CacheCommandTest.php @@ -39,7 +39,7 @@ public function testCacheSet() // Test cache-set using all arguments and many options. $expected = ['key' => 'value']; - $stdin = json_encode(['data'=> $expected]); + $stdin = json_encode(['data' => $expected]); $bin = 'default'; $this->drush('cache-set', ['my_cache_id', '-', $bin, 'CACHE_PERMANENT'], ['input-format' => 'json', 'cache-get' => true], self::EXIT_SUCCESS, $stdin); diff --git a/tests/integration/CoreTest.php b/tests/integration/CoreTest.php index 9ac99f00d3..184cb81113 100644 --- a/tests/integration/CoreTest.php +++ b/tests/integration/CoreTest.php @@ -71,7 +71,7 @@ public function testRoute() $json = $this->getOutputFromJSON(); $this->assertArrayHasKey('user.login', $json); $this->assertSame('/user/login', $json['user.login']); - $this->drush('route', [], ['path' =>'/user/login', 'format' => 'json']); + $this->drush('route', [], ['path' => '/user/login', 'format' => 'json']); $json = $this->getOutputFromJSON(); $this->assertSame('/user/login', $json['path']); $this->assertSame('user.login', $json['name']); @@ -79,7 +79,7 @@ public function testRoute() $this->assertSame("FALSE", $json['requirements']['_user_is_logged_in']); $this->assertSame('access_check.user.login_status', $json['options']['_access_checks'][0]); - $this->drush('route', [], ['name' =>'user.login', 'format' => 'json']); + $this->drush('route', [], ['name' => 'user.login', 'format' => 'json']); $json = $this->getOutputFromJSON(); $this->assertSame('/user/login', $json['path']); } diff --git a/tests/integration/DeployTest.php b/tests/integration/DeployTest.php index 6e4674a64f..467c6aaa47 100644 --- a/tests/integration/DeployTest.php +++ b/tests/integration/DeployTest.php @@ -7,7 +7,6 @@ */ class DeployTest extends UnishIntegrationTestCase { - /** * A simple test since all the sub-commands are tested elsewhere. */ @@ -15,7 +14,7 @@ public function testDeploy() { // Prep a config directory that will be imported later. $this->drush('config:export'); - + $this->drush('deploy'); $expecteds = ["Database updates start.", 'Config import start.', 'Deploy hook start.', 'Cache rebuild start.']; foreach ($expecteds as $expected) { diff --git a/tests/integration/SecurityUpdatesTest.php b/tests/integration/SecurityUpdatesTest.php index 0897fa69dd..697de3a010 100644 --- a/tests/integration/SecurityUpdatesTest.php +++ b/tests/integration/SecurityUpdatesTest.php @@ -9,7 +9,6 @@ */ class SecurityUpdatesTest extends UnishIntegrationTestCase { - /** * Test that insecure Drupal packages are correctly identified. */ diff --git a/tests/integration/SiteAliasConvertTest.php b/tests/integration/SiteAliasConvertTest.php index 7f989da093..3cb579a269 100644 --- a/tests/integration/SiteAliasConvertTest.php +++ b/tests/integration/SiteAliasConvertTest.php @@ -10,7 +10,6 @@ */ class SiteAliasConvertTest extends UnishIntegrationTestCase { - /** * Test functionality of site:alias-convert. */ diff --git a/tests/integration/SqlCliTest.php b/tests/integration/SqlCliTest.php index a3da378d08..8ac518eda9 100644 --- a/tests/integration/SqlCliTest.php +++ b/tests/integration/SqlCliTest.php @@ -16,7 +16,6 @@ */ class SqlCliTest extends UnishIntegrationTestCase { - public function testSqlCli() { if ($this->isWindows()) { diff --git a/tests/integration/WatchdogTest.php b/tests/integration/WatchdogTest.php index f9a90b3f53..d6751d07ed 100644 --- a/tests/integration/WatchdogTest.php +++ b/tests/integration/WatchdogTest.php @@ -7,7 +7,6 @@ */ class WatchdogTest extends UnishIntegrationTestCase { - public function testWatchdog() { $this->drush('pm-enable', ['dblog']); diff --git a/tests/integration/resources/Commands/ExampleAttributesCommands.php b/tests/integration/resources/Commands/ExampleAttributesCommands.php index 90631b2561..6bd7528fc6 100644 --- a/tests/integration/resources/Commands/ExampleAttributesCommands.php +++ b/tests/integration/resources/Commands/ExampleAttributesCommands.php @@ -1,4 +1,5 @@ $v) { putenv($k . '=' . $v); // Value must be a string. See \Symfony\Component\Process\Process::getDefaultEnv. - $_SERVER[$k]= (string) $v; + $_SERVER[$k] = (string) $v; } } diff --git a/tests/unish/Utils/FSUtils.php b/tests/unish/Utils/FSUtils.php index 4cef991cdd..eac6df48d3 100644 --- a/tests/unish/Utils/FSUtils.php +++ b/tests/unish/Utils/FSUtils.php @@ -1,4 +1,5 @@ database = $database; diff --git a/tests/unit/XhProfTest.php b/tests/unit/XhProfTest.php index 1eee71ce4a..cd4edea2dd 100644 --- a/tests/unit/XhProfTest.php +++ b/tests/unit/XhProfTest.php @@ -13,7 +13,6 @@ */ class XhProfTest extends TestCase { - /** * Test various combinations of XHProf flag options. *