diff --git a/tests/behat/bootstrap/FeatureContext.php b/tests/behat/bootstrap/FeatureContext.php index e74877da08..7b349ab1e3 100644 --- a/tests/behat/bootstrap/FeatureContext.php +++ b/tests/behat/bootstrap/FeatureContext.php @@ -253,7 +253,7 @@ public function iScrollToElementWithId(string $id): void { * * @todo Remove with next behat-steps release. */ - public function linkAssertTextHrefNotExists(string $text, string $href, string $locator = NULL): void { + public function linkAssertTextHrefNotExists(string $text, string $href, ?string $locator = NULL): void { /** @var \Behat\Mink\Element\DocumentElement $page */ $page = $this->getSession()->getPage(); @@ -357,7 +357,7 @@ public function setThemeAsDefault(string $name): void { * * @SuppressWarnings(PHPMD.StaticAccess) */ - public function themeVisitSettings(string $name = NULL): void { + public function themeVisitSettings(?string $name = NULL): void { if (!$name || $name === 'current') { $name = \Drupal::theme()->getActiveTheme()->getName(); } diff --git a/tests/phpunit/ScriptUnitTestBase.php b/tests/phpunit/ScriptUnitTestBase.php index 24373e0ada..1bb585bfe8 100644 --- a/tests/phpunit/ScriptUnitTestBase.php +++ b/tests/phpunit/ScriptUnitTestBase.php @@ -104,7 +104,7 @@ protected function fixtureFile(string $filename): string { /** * Path to a temporary file. */ - protected function toTmpPath(string $filename, string $prefix = NULL): string { + protected function toTmpPath(string $filename, ?string $prefix = NULL): string { return $prefix ? $this->tmpDir . DIRECTORY_SEPARATOR . $prefix . DIRECTORY_SEPARATOR . $filename : $this->tmpDir . DIRECTORY_SEPARATOR . $filename; } @@ -122,7 +122,7 @@ protected function printTempDir(): void { /** * Create a random unique temporary directory. */ - protected function tempdir(string $dir = NULL, string $prefix = 'tmp_', int $mode = 0700, int $max_attempts = 1000): string { + protected function tempdir(?string $dir = NULL, string $prefix = 'tmp_', int $mode = 0700, int $max_attempts = 1000): string { if (is_null($dir)) { $dir = sys_get_temp_dir(); } @@ -180,7 +180,7 @@ protected function arrayReplaceValue(array $array, callable|array $cb): array { * - key: (string) Source path (the key from $file_structure). * - value: (string) Path to a fixture file to use. */ - protected function createTmpFilesFromFixtures(array $fixture_map, string $prefix = NULL): array { + protected function createTmpFilesFromFixtures(array $fixture_map, ?string $prefix = NULL): array { $files = []; foreach ($fixture_map as $path => $fixture_file) { $tmp_path = $this->toTmpPath($path, $prefix); @@ -229,7 +229,7 @@ protected function createTmpFilesFromFixtures(array $fixture_map, string $prefix * * @SuppressWarnings(PHPMD.ElseExpression) */ - protected function replaceFixturePaths(array $fixture_map, string $prefix = NULL): array { + protected function replaceFixturePaths(array $fixture_map, ?string $prefix = NULL): array { foreach ($fixture_map as $k => $v) { if (is_array($v)) { $fixture_map[$k] = $this->replaceFixturePaths($v, $prefix); diff --git a/web/modules/custom/civictheme_content/civictheme_content.install b/web/modules/custom/civictheme_content/civictheme_content.install index 7034275144..e4aae1d1f2 100644 --- a/web/modules/custom/civictheme_content/civictheme_content.install +++ b/web/modules/custom/civictheme_content/civictheme_content.install @@ -19,9 +19,9 @@ declare(strict_types=1); +use Drupal\Core\Installer\Exception\InstallerException; use Drupal\civictheme\CivicthemeConfigImporter; use Drupal\civictheme_content\Helper; -use Drupal\Core\Installer\Exception\InstallerException; /** * Implements hook_install(). diff --git a/web/modules/custom/civictheme_content/modules/civictheme_content_corporate/civictheme_content_corporate.post_update.php b/web/modules/custom/civictheme_content/modules/civictheme_content_corporate/civictheme_content_corporate.post_update.php index 96d4ee42dc..6f7ad4f059 100644 --- a/web/modules/custom/civictheme_content/modules/civictheme_content_corporate/civictheme_content_corporate.post_update.php +++ b/web/modules/custom/civictheme_content/modules/civictheme_content_corporate/civictheme_content_corporate.post_update.php @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\civictheme_content\Helper; use Drupal\Core\Utility\UpdateException; +use Drupal\civictheme_content\Helper; /** * Common updates. diff --git a/web/modules/custom/civictheme_content/modules/civictheme_content_default/civictheme_content_default.post_update.php b/web/modules/custom/civictheme_content/modules/civictheme_content_default/civictheme_content_default.post_update.php index b2c19088da..5ee4d8b4c1 100644 --- a/web/modules/custom/civictheme_content/modules/civictheme_content_default/civictheme_content_default.post_update.php +++ b/web/modules/custom/civictheme_content/modules/civictheme_content_default/civictheme_content_default.post_update.php @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\civictheme_content\Helper; use Drupal\Core\Utility\UpdateException; +use Drupal\civictheme_content\Helper; /** * Common updates. diff --git a/web/modules/custom/civictheme_content/modules/civictheme_content_government/civictheme_content_government.post_update.php b/web/modules/custom/civictheme_content/modules/civictheme_content_government/civictheme_content_government.post_update.php index 262253b56b..0170e614e6 100644 --- a/web/modules/custom/civictheme_content/modules/civictheme_content_government/civictheme_content_government.post_update.php +++ b/web/modules/custom/civictheme_content/modules/civictheme_content_government/civictheme_content_government.post_update.php @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\civictheme_content\Helper; use Drupal\Core\Utility\UpdateException; +use Drupal\civictheme_content\Helper; /** * Common updates. diff --git a/web/modules/custom/civictheme_content/modules/civictheme_content_highereducation/civictheme_content_highereducation.post_update.php b/web/modules/custom/civictheme_content/modules/civictheme_content_highereducation/civictheme_content_highereducation.post_update.php index e6b30836ec..ee96650405 100644 --- a/web/modules/custom/civictheme_content/modules/civictheme_content_highereducation/civictheme_content_highereducation.post_update.php +++ b/web/modules/custom/civictheme_content/modules/civictheme_content_highereducation/civictheme_content_highereducation.post_update.php @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\civictheme_content\Helper; use Drupal\Core\Utility\UpdateException; +use Drupal\civictheme_content\Helper; /** * Common updates. diff --git a/web/modules/custom/civictheme_content/src/Helper.php b/web/modules/custom/civictheme_content/src/Helper.php index e64a4f3696..ef6b313b11 100644 --- a/web/modules/custom/civictheme_content/src/Helper.php +++ b/web/modules/custom/civictheme_content/src/Helper.php @@ -57,7 +57,7 @@ public static function log(string|\Stringable $message): void { * * @SuppressWarnings(PHPMD.StaticAccess) */ - public static function loadNodeByTitle(string $title, string $type = NULL): ?Node { + public static function loadNodeByTitle(string $title, ?string $type = NULL): ?Node { $query = \Drupal::entityQuery('node')->accessCheck(FALSE); $query->condition('title', $title); if ($type) { diff --git a/web/modules/custom/civictheme_dev/civictheme_dev.module b/web/modules/custom/civictheme_dev/civictheme_dev.module index 95a30f7cde..cfb3940578 100644 --- a/web/modules/custom/civictheme_dev/civictheme_dev.module +++ b/web/modules/custom/civictheme_dev/civictheme_dev.module @@ -7,9 +7,9 @@ declare(strict_types=1); +use Drupal\Core\Site\Settings; use Drupal\civictheme\CivicthemeConstants; use Drupal\civictheme\CivicthemeVersionManager; -use Drupal\Core\Site\Settings; use Drupal\views\ViewExecutable; require_once __DIR__ . '/styleguide.inc'; diff --git a/web/modules/custom/civictheme_dev/civictheme_dev.post_update.php b/web/modules/custom/civictheme_dev/civictheme_dev.post_update.php index e2cdc255a3..814e33ce54 100644 --- a/web/modules/custom/civictheme_dev/civictheme_dev.post_update.php +++ b/web/modules/custom/civictheme_dev/civictheme_dev.post_update.php @@ -7,8 +7,8 @@ declare(strict_types=1); -use Drupal\block\Entity\Block; use Drupal\Core\Utility\UpdateException; +use Drupal\block\Entity\Block; use Drupal\redirect\Entity\Redirect; use Drupal\user\Entity\User; diff --git a/web/modules/custom/civictheme_dev/src/EventSubscriber/CivicthemeDevConfigDevelSubscriber.php b/web/modules/custom/civictheme_dev/src/EventSubscriber/CivicthemeDevConfigDevelSubscriber.php index e748cf16e1..fc1d8af8e2 100644 --- a/web/modules/custom/civictheme_dev/src/EventSubscriber/CivicthemeDevConfigDevelSubscriber.php +++ b/web/modules/custom/civictheme_dev/src/EventSubscriber/CivicthemeDevConfigDevelSubscriber.php @@ -4,12 +4,12 @@ namespace Drupal\civictheme_dev\EventSubscriber; +use Drupal\Core\Config\ConfigFactoryInterface; +use Drupal\Core\Config\ConfigManagerInterface; use Drupal\config_devel\Event\ConfigDevelEvents; use Drupal\config_devel\Event\ConfigDevelSaveEvent; use Drupal\config_devel\EventSubscriber\ConfigDevelSubscriberBase; use Drupal\config_filter\Plugin\ConfigFilterPluginManager; -use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Config\ConfigManagerInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** diff --git a/web/modules/custom/cs_generated_content/src/CsGeneratedContentCivicthemeTrait.php b/web/modules/custom/cs_generated_content/src/CsGeneratedContentCivicthemeTrait.php index c13bb3fc79..b685ce0617 100644 --- a/web/modules/custom/cs_generated_content/src/CsGeneratedContentCivicthemeTrait.php +++ b/web/modules/custom/cs_generated_content/src/CsGeneratedContentCivicthemeTrait.php @@ -215,7 +215,7 @@ public static function civicthemeSizeLarge(): string { * @return array * Array of topics. */ - public static function civicthemeStaticTopics(int $count = NULL): array { + public static function civicthemeStaticTopics(?int $count = NULL): array { return static::staticTerms('civictheme_topics', $count); } @@ -257,7 +257,7 @@ public static function civicThemeExposeMultipleFilters(): array { * @return array * Array of site sections. */ - public static function civicthemeStaticSiteSections(int $count = NULL): array { + public static function civicthemeStaticSiteSections(?int $count = NULL): array { return static::staticTerms('civictheme_site_sections', $count); } diff --git a/web/modules/custom/cs_generated_content/src/CsGeneratedContentHelper.php b/web/modules/custom/cs_generated_content/src/CsGeneratedContentHelper.php index 758d1d5a87..d98fd2ba54 100644 --- a/web/modules/custom/cs_generated_content/src/CsGeneratedContentHelper.php +++ b/web/modules/custom/cs_generated_content/src/CsGeneratedContentHelper.php @@ -39,7 +39,7 @@ public static function randomRealWebform(): ?EntityInterface { * @return string * URL with a path. */ - public static function staticUrl(string $domain = NULL): string { + public static function staticUrl(?string $domain = NULL): string { $parts = []; $parts[] = 'https://'; $parts[] = $domain ? rtrim($domain, '/') : 'www.example.com';