From b70dfff449a278e2248f42dc5bd6623093c41e0e Mon Sep 17 00:00:00 2001 From: xjm <xjm@65776.no-reply.drupal.org> Date: Sat, 9 Dec 2023 08:40:55 -0600 Subject: [PATCH] Issue #3401994 by mstrelan, dww, xjm, smustgrave, nicxvan: Add declare(strict_types=1) to all test traits --- .../basic_auth/tests/src/Traits/BasicAuthTestTrait.php | 2 ++ core/modules/block/tests/src/Traits/BlockCreationTrait.php | 2 ++ .../ckeditor5/tests/src/Traits/CKEditor5TestTrait.php | 2 ++ .../tests/src/Traits/PrivateMethodUnitTestTrait.php | 2 ++ .../tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php | 2 ++ .../tests/src/Traits/AssertConfigEntityImportTrait.php | 2 ++ .../tests/src/Traits/ContentModerationTestTrait.php | 2 ++ .../tests/src/Traits/EntityReferenceFieldCreationTrait.php | 2 ++ .../field/tests/src/Traits/EntityReferenceTestTrait.php | 2 ++ .../field_ui/tests/src/Traits/FieldUiJSTestTrait.php | 2 ++ core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php | 2 ++ .../CommonCollectionFilterAccessTestPatternsTrait.php | 2 ++ .../media/tests/src/Traits/MediaTypeCreationTrait.php | 2 ++ core/modules/media/tests/src/Traits/OEmbedTestTrait.php | 2 ++ core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php | 2 ++ .../tests/src/Traits/CreateMigrationsTrait.php | 2 ++ .../tests/src/Traits/CreateTestContentEntitiesTrait.php | 2 ++ .../tests/src/Traits/FieldDiscoveryTestTrait.php | 2 ++ .../tests/src/Traits/NodeMigrateTypeTestTrait.php | 2 ++ .../tests/src/Traits/ValidateMigrationStateTestTrait.php | 2 ++ .../node/tests/src/Traits/ContentTypeCreationTrait.php | 2 ++ core/modules/node/tests/src/Traits/NodeCreationTrait.php | 2 ++ core/modules/system/tests/src/Traits/OffCanvasTestTrait.php | 2 ++ core/modules/system/tests/src/Traits/TestTrait.php | 2 ++ .../modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php | 2 ++ core/modules/user/tests/src/Traits/UserCreationTrait.php | 2 ++ .../modules/views/tests/src/Traits/ViewsLoggerTestTrait.php | 2 ++ core/phpcs.xml.dist | 6 ++++++ core/tests/Drupal/Tests/ApiRequestTrait.php | 2 ++ core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php | 2 ++ .../Drupal/Tests/Composer/ComposerIntegrationTrait.php | 2 ++ .../Tests/Composer/Plugin/Scaffold/AssertUtilsTrait.php | 2 ++ .../Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php | 2 ++ core/tests/Drupal/Tests/ConfigTestTrait.php | 2 ++ .../Tests/Core/Database/SchemaIntrospectionTestTrait.php | 2 ++ core/tests/Drupal/Tests/EntityViewTrait.php | 2 ++ core/tests/Drupal/Tests/ExtensionListTestTrait.php | 2 ++ core/tests/Drupal/Tests/PerformanceTestTrait.php | 2 +- core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php | 2 ++ core/tests/Drupal/Tests/RandomGeneratorTrait.php | 2 ++ core/tests/Drupal/Tests/RequirementsPageTrait.php | 2 ++ core/tests/Drupal/Tests/SchemaCheckTestTrait.php | 2 ++ core/tests/Drupal/Tests/SessionTestTrait.php | 2 ++ core/tests/Drupal/Tests/TestFileCreationTrait.php | 2 ++ core/tests/Drupal/Tests/TestRequirementsTrait.php | 2 ++ .../Traits/Core/Config/SchemaConfigListenerTestTrait.php | 2 ++ core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php | 2 ++ .../Drupal/Tests/Traits/Core/GeneratePermutationsTrait.php | 2 ++ .../Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php | 2 ++ core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php | 2 ++ core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php | 2 ++ core/tests/Drupal/Tests/UiHelperTrait.php | 2 ++ core/tests/Drupal/Tests/UpdatePathTestTrait.php | 2 ++ core/tests/Drupal/Tests/WaitTerminateTestTrait.php | 2 ++ core/tests/Drupal/Tests/XdebugRequestTrait.php | 2 ++ 55 files changed, 113 insertions(+), 1 deletion(-) diff --git a/core/modules/basic_auth/tests/src/Traits/BasicAuthTestTrait.php b/core/modules/basic_auth/tests/src/Traits/BasicAuthTestTrait.php index 15de6407d5b3..c7494b46137f 100644 --- a/core/modules/basic_auth/tests/src/Traits/BasicAuthTestTrait.php +++ b/core/modules/basic_auth/tests/src/Traits/BasicAuthTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\basic_auth\Traits; /** diff --git a/core/modules/block/tests/src/Traits/BlockCreationTrait.php b/core/modules/block/tests/src/Traits/BlockCreationTrait.php index 440f34c10da8..e94767409893 100644 --- a/core/modules/block/tests/src/Traits/BlockCreationTrait.php +++ b/core/modules/block/tests/src/Traits/BlockCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\block\Traits; use Drupal\block\Entity\Block; diff --git a/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php b/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php index 1556312b6824..ab08838ccfe0 100644 --- a/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php +++ b/core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\ckeditor5\Traits; use Behat\Mink\Element\NodeElement; diff --git a/core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php b/core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php index 9a2a2c7210f8..5a28ea8b7581 100644 --- a/core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php +++ b/core/modules/ckeditor5/tests/src/Traits/PrivateMethodUnitTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\ckeditor5\Traits; /** diff --git a/core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php b/core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php index 11d5d1f14b87..2ec5308000dd 100644 --- a/core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php +++ b/core/modules/ckeditor5/tests/src/Traits/SynchronizeCsrfTokenSeedTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\ckeditor5\Traits; use Drupal\Core\Session\AccountInterface; diff --git a/core/modules/config/tests/src/Traits/AssertConfigEntityImportTrait.php b/core/modules/config/tests/src/Traits/AssertConfigEntityImportTrait.php index 7cae45f0240a..f6f83454de4d 100644 --- a/core/modules/config/tests/src/Traits/AssertConfigEntityImportTrait.php +++ b/core/modules/config/tests/src/Traits/AssertConfigEntityImportTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\config\Traits; use Drupal\Core\Config\Entity\ConfigEntityInterface; diff --git a/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php b/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php index 2b2014373edb..9c5d9ccf5d19 100644 --- a/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php +++ b/core/modules/content_moderation/tests/src/Traits/ContentModerationTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\content_moderation\Traits; use Drupal\workflows\Entity\Workflow; diff --git a/core/modules/field/tests/src/Traits/EntityReferenceFieldCreationTrait.php b/core/modules/field/tests/src/Traits/EntityReferenceFieldCreationTrait.php index 42edf6a34169..d0049fbcfe44 100644 --- a/core/modules/field/tests/src/Traits/EntityReferenceFieldCreationTrait.php +++ b/core/modules/field/tests/src/Traits/EntityReferenceFieldCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\field\Traits; use Drupal\field\Entity\FieldConfig; diff --git a/core/modules/field/tests/src/Traits/EntityReferenceTestTrait.php b/core/modules/field/tests/src/Traits/EntityReferenceTestTrait.php index 1820a738d801..50a8a3126d56 100644 --- a/core/modules/field/tests/src/Traits/EntityReferenceTestTrait.php +++ b/core/modules/field/tests/src/Traits/EntityReferenceTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\field\Traits; @trigger_error('The ' . __NAMESPACE__ . '\EntityReferenceTestTrait is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Instead, use \Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait. See https://www.drupal.org/node/3401941', E_USER_DEPRECATED); diff --git a/core/modules/field_ui/tests/src/Traits/FieldUiJSTestTrait.php b/core/modules/field_ui/tests/src/Traits/FieldUiJSTestTrait.php index 2630b36815b7..cba90a5bb4bb 100644 --- a/core/modules/field_ui/tests/src/Traits/FieldUiJSTestTrait.php +++ b/core/modules/field_ui/tests/src/Traits/FieldUiJSTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\field_ui\Traits; /** diff --git a/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php b/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php index a381c4ac6858..87e835f7cead 100644 --- a/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php +++ b/core/modules/field_ui/tests/src/Traits/FieldUiTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\field_ui\Traits; use Behat\Mink\Exception\ElementNotFoundException; diff --git a/core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php b/core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php index 60266a44b95b..35f84c346cd7 100644 --- a/core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php +++ b/core/modules/jsonapi/tests/src/Traits/CommonCollectionFilterAccessTestPatternsTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\jsonapi\Traits; use Drupal\Component\Serialization\Json; diff --git a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php index 0e87a6ec8e6c..8059c9ca9c5e 100644 --- a/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php +++ b/core/modules/media/tests/src/Traits/MediaTypeCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\media\Traits; use Drupal\media\Entity\MediaType; diff --git a/core/modules/media/tests/src/Traits/OEmbedTestTrait.php b/core/modules/media/tests/src/Traits/OEmbedTestTrait.php index 8744bffef12d..0219be2007fc 100644 --- a/core/modules/media/tests/src/Traits/OEmbedTestTrait.php +++ b/core/modules/media/tests/src/Traits/OEmbedTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\media\Traits; use Drupal\Component\Serialization\Json; diff --git a/core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php b/core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php index d9eaa78c67f9..6c41d7bf79fd 100644 --- a/core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php +++ b/core/modules/menu_ui/tests/src/Traits/MenuUiTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\menu_ui\Traits; /** diff --git a/core/modules/migrate_drupal/tests/src/Traits/CreateMigrationsTrait.php b/core/modules/migrate_drupal/tests/src/Traits/CreateMigrationsTrait.php index 9b316de2ae87..25a6ea4237d6 100644 --- a/core/modules/migrate_drupal/tests/src/Traits/CreateMigrationsTrait.php +++ b/core/modules/migrate_drupal/tests/src/Traits/CreateMigrationsTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\migrate_drupal\Traits; trait CreateMigrationsTrait { diff --git a/core/modules/migrate_drupal/tests/src/Traits/CreateTestContentEntitiesTrait.php b/core/modules/migrate_drupal/tests/src/Traits/CreateTestContentEntitiesTrait.php index 05da0215f9ec..1f792f450e7f 100644 --- a/core/modules/migrate_drupal/tests/src/Traits/CreateTestContentEntitiesTrait.php +++ b/core/modules/migrate_drupal/tests/src/Traits/CreateTestContentEntitiesTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\migrate_drupal\Traits; /** diff --git a/core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php b/core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php index 34a16ad85ea7..b51fe785ae43 100644 --- a/core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php +++ b/core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\migrate_drupal\Traits; use Drupal\field_discovery_test\FieldDiscoveryTestClass; diff --git a/core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php b/core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php index 19b59068ba01..b8939fda87b5 100644 --- a/core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php +++ b/core/modules/migrate_drupal/tests/src/Traits/NodeMigrateTypeTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\migrate_drupal\Traits; use Drupal\migrate_drupal\NodeMigrateType; diff --git a/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php b/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php index 61ab00d86232..a7378e5a7e72 100644 --- a/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php +++ b/core/modules/migrate_drupal/tests/src/Traits/ValidateMigrationStateTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\migrate_drupal\Traits; use Drupal\Component\Discovery\YamlDiscovery; diff --git a/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php b/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php index 127207894e81..5f87bcc35bcd 100644 --- a/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php +++ b/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\node\Traits; use Drupal\Component\Render\FormattableMarkup; diff --git a/core/modules/node/tests/src/Traits/NodeCreationTrait.php b/core/modules/node/tests/src/Traits/NodeCreationTrait.php index 7ec87f54c92b..8f811064421f 100644 --- a/core/modules/node/tests/src/Traits/NodeCreationTrait.php +++ b/core/modules/node/tests/src/Traits/NodeCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\node\Traits; use Drupal\node\Entity\Node; diff --git a/core/modules/system/tests/src/Traits/OffCanvasTestTrait.php b/core/modules/system/tests/src/Traits/OffCanvasTestTrait.php index a406c6f44ae5..428ffdf7990c 100644 --- a/core/modules/system/tests/src/Traits/OffCanvasTestTrait.php +++ b/core/modules/system/tests/src/Traits/OffCanvasTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\system\Traits; /** diff --git a/core/modules/system/tests/src/Traits/TestTrait.php b/core/modules/system/tests/src/Traits/TestTrait.php index 02ef094bc1d2..c35f499c6c67 100644 --- a/core/modules/system/tests/src/Traits/TestTrait.php +++ b/core/modules/system/tests/src/Traits/TestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\system\Traits; /** diff --git a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php index 4df0f1a29335..e0a858b36726 100644 --- a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php +++ b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\taxonomy\Traits; use Drupal\Core\Language\LanguageInterface; diff --git a/core/modules/user/tests/src/Traits/UserCreationTrait.php b/core/modules/user/tests/src/Traits/UserCreationTrait.php index d51bc4bd1170..510d722ebd55 100644 --- a/core/modules/user/tests/src/Traits/UserCreationTrait.php +++ b/core/modules/user/tests/src/Traits/UserCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\user\Traits; use Drupal\Core\Database\DatabaseExceptionWrapper; diff --git a/core/modules/views/tests/src/Traits/ViewsLoggerTestTrait.php b/core/modules/views/tests/src/Traits/ViewsLoggerTestTrait.php index bea149498d45..734e702f418b 100644 --- a/core/modules/views/tests/src/Traits/ViewsLoggerTestTrait.php +++ b/core/modules/views/tests/src/Traits/ViewsLoggerTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\views\Traits; use Drupal\Core\Logger\LoggerChannelFactoryInterface; diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 015d8633e3bb..74776964a318 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -272,7 +272,13 @@ <properties> <property name="spacesCountAroundEqualsSign" value="0" /> </properties> + <!-- @todo Broaden this in https://www.drupal.org/project/drupal/issues/3400434 --> + <!-- <include-pattern>*/tests/*</include-pattern> --> <include-pattern>./tests/Drupal/BuildTests/*</include-pattern> + <include-pattern>*/tests/src/Traits/*</include-pattern> + <include-pattern>./tests/Drupal/Tests/*Trait.php</include-pattern> + <include-pattern>./tests/Drupal/Tests/Traits/*</include-pattern> + <exclude-pattern>./tests/Drupal/Tests/Listeners/*</exclude-pattern> </rule> <!-- Squiz sniffs --> diff --git a/core/tests/Drupal/Tests/ApiRequestTrait.php b/core/tests/Drupal/Tests/ApiRequestTrait.php index 83888277415b..12db34c52b55 100644 --- a/core/tests/Drupal/Tests/ApiRequestTrait.php +++ b/core/tests/Drupal/Tests/ApiRequestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Behat\Mink\Driver\BrowserKitDriver; diff --git a/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php b/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php index 64c9566a6529..0ce61082fd18 100644 --- a/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php +++ b/core/tests/Drupal/Tests/BrowserHtmlDebugTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Component\Utility\Html; diff --git a/core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php b/core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php index 9cebb60551d2..595e4bef877f 100644 --- a/core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php +++ b/core/tests/Drupal/Tests/Composer/ComposerIntegrationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Composer; use Symfony\Component\Finder\Finder; diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/AssertUtilsTrait.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/AssertUtilsTrait.php index ecbd4f83c123..a2257158b2c5 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/AssertUtilsTrait.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/AssertUtilsTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Composer\Plugin\Scaffold; use Drupal\Tests\Traits\PhpUnitWarnings; diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php index be29f84561ca..976005a31ffc 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ExecTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Composer\Plugin\Scaffold; use Symfony\Component\Process\Process; diff --git a/core/tests/Drupal/Tests/ConfigTestTrait.php b/core/tests/Drupal/Tests/ConfigTestTrait.php index 7ecc541772a6..31d010dd9427 100644 --- a/core/tests/Drupal/Tests/ConfigTestTrait.php +++ b/core/tests/Drupal/Tests/ConfigTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Config\ConfigImporter; diff --git a/core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php b/core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php index 5e89de4ca572..b9e4068c2789 100644 --- a/core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php +++ b/core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Core\Database; /** diff --git a/core/tests/Drupal/Tests/EntityViewTrait.php b/core/tests/Drupal/Tests/EntityViewTrait.php index 6f7fad294675..a1568119f8b6 100644 --- a/core/tests/Drupal/Tests/EntityViewTrait.php +++ b/core/tests/Drupal/Tests/EntityViewTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Entity\EntityInterface; diff --git a/core/tests/Drupal/Tests/ExtensionListTestTrait.php b/core/tests/Drupal/Tests/ExtensionListTestTrait.php index 088237893bb7..04f88bf2610e 100644 --- a/core/tests/Drupal/Tests/ExtensionListTestTrait.php +++ b/core/tests/Drupal/Tests/ExtensionListTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; /** diff --git a/core/tests/Drupal/Tests/PerformanceTestTrait.php b/core/tests/Drupal/Tests/PerformanceTestTrait.php index 9f910d338775..332ae4540953 100644 --- a/core/tests/Drupal/Tests/PerformanceTestTrait.php +++ b/core/tests/Drupal/Tests/PerformanceTestTrait.php @@ -1,6 +1,6 @@ <?php -declare(strict_types = 1); +declare(strict_types=1); namespace Drupal\Tests; diff --git a/core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php b/core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php index 1192c2e246cc..3bba95e3a761 100644 --- a/core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php +++ b/core/tests/Drupal/Tests/PhpUnitCompatibilityTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\TestTools\PhpUnitCompatibility\RunnerVersion; diff --git a/core/tests/Drupal/Tests/RandomGeneratorTrait.php b/core/tests/Drupal/Tests/RandomGeneratorTrait.php index eccac674f1b4..380b38d73849 100644 --- a/core/tests/Drupal/Tests/RandomGeneratorTrait.php +++ b/core/tests/Drupal/Tests/RandomGeneratorTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\TestTools\Random; diff --git a/core/tests/Drupal/Tests/RequirementsPageTrait.php b/core/tests/Drupal/Tests/RequirementsPageTrait.php index 6bc47909c77d..c10e5676079d 100644 --- a/core/tests/Drupal/Tests/RequirementsPageTrait.php +++ b/core/tests/Drupal/Tests/RequirementsPageTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Utility\PhpRequirements; diff --git a/core/tests/Drupal/Tests/SchemaCheckTestTrait.php b/core/tests/Drupal/Tests/SchemaCheckTestTrait.php index 73f8dc5c8c6c..26f97c482b4c 100644 --- a/core/tests/Drupal/Tests/SchemaCheckTestTrait.php +++ b/core/tests/Drupal/Tests/SchemaCheckTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Config\TypedConfigManagerInterface; diff --git a/core/tests/Drupal/Tests/SessionTestTrait.php b/core/tests/Drupal/Tests/SessionTestTrait.php index e71fdf256bdb..d06f6af7a78c 100644 --- a/core/tests/Drupal/Tests/SessionTestTrait.php +++ b/core/tests/Drupal/Tests/SessionTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Symfony\Component\HttpFoundation\Request; diff --git a/core/tests/Drupal/Tests/TestFileCreationTrait.php b/core/tests/Drupal/Tests/TestFileCreationTrait.php index 5f401975dce0..f7445584add3 100644 --- a/core/tests/Drupal/Tests/TestFileCreationTrait.php +++ b/core/tests/Drupal/Tests/TestFileCreationTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\StreamWrapper\PublicStream; diff --git a/core/tests/Drupal/Tests/TestRequirementsTrait.php b/core/tests/Drupal/Tests/TestRequirementsTrait.php index e7a9548fee39..8dae05cf3789 100644 --- a/core/tests/Drupal/Tests/TestRequirementsTrait.php +++ b/core/tests/Drupal/Tests/TestRequirementsTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Extension\ExtensionDiscovery; diff --git a/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php b/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php index 62552d4dc2d1..89493d5ef4aa 100644 --- a/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/Config/SchemaConfigListenerTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits\Core\Config; use Drupal\Core\Config\Schema\SchemaIncompleteException; diff --git a/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php index 17ca9fcdb6f1..02f271edebc8 100644 --- a/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/CronRunTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits\Core; /** diff --git a/core/tests/Drupal/Tests/Traits/Core/GeneratePermutationsTrait.php b/core/tests/Drupal/Tests/Traits/Core/GeneratePermutationsTrait.php index 6e222cb65632..6bd903633a0f 100644 --- a/core/tests/Drupal/Tests/Traits/Core/GeneratePermutationsTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/GeneratePermutationsTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits\Core; /** diff --git a/core/tests/Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php b/core/tests/Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php index 45f9ca781632..d7b03ccba683 100644 --- a/core/tests/Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/Image/ToolkitTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits\Core\Image; use Drupal\Core\Image\ImageInterface; diff --git a/core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php b/core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php index 2167d43716ad..6d1cfb163a85 100644 --- a/core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php +++ b/core/tests/Drupal/Tests/Traits/Core/PathAliasTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits\Core; use Drupal\Core\Language\LanguageInterface; diff --git a/core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php b/core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php index ba78874c4efa..180179a8a67a 100644 --- a/core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php +++ b/core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests\Traits; /** diff --git a/core/tests/Drupal/Tests/UiHelperTrait.php b/core/tests/Drupal/Tests/UiHelperTrait.php index e811de7edef6..449cf2a78ecb 100644 --- a/core/tests/Drupal/Tests/UiHelperTrait.php +++ b/core/tests/Drupal/Tests/UiHelperTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Behat\Mink\Driver\BrowserKitDriver; diff --git a/core/tests/Drupal/Tests/UpdatePathTestTrait.php b/core/tests/Drupal/Tests/UpdatePathTestTrait.php index 0abf1cc477d1..ccd930eaa8fb 100644 --- a/core/tests/Drupal/Tests/UpdatePathTestTrait.php +++ b/core/tests/Drupal/Tests/UpdatePathTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Drupal\Core\Database\Database; diff --git a/core/tests/Drupal/Tests/WaitTerminateTestTrait.php b/core/tests/Drupal/Tests/WaitTerminateTestTrait.php index 008b15550128..2423af83f9dd 100644 --- a/core/tests/Drupal/Tests/WaitTerminateTestTrait.php +++ b/core/tests/Drupal/Tests/WaitTerminateTestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; /** diff --git a/core/tests/Drupal/Tests/XdebugRequestTrait.php b/core/tests/Drupal/Tests/XdebugRequestTrait.php index cfcf4702cd85..555140b947c1 100644 --- a/core/tests/Drupal/Tests/XdebugRequestTrait.php +++ b/core/tests/Drupal/Tests/XdebugRequestTrait.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace Drupal\Tests; use Symfony\Component\HttpFoundation\Request; -- GitLab