From 38e34374cd02083c87bc4dc901556fb4ce69f40b Mon Sep 17 00:00:00 2001 From: Lee Rowlands Date: Mon, 4 Nov 2024 07:35:14 +1000 Subject: [PATCH] Issue #3478185 by quietone, larowlan: Fix MissingParamType for tests (cherry picked from commit 7a8cfc7aa158cec4d38a0569a107a11764acf468) --- .../ConfigTranslationUiTestBase.php | 6 +++--- ...ontentTranslationFieldSyncRevisionTest.php | 2 +- .../tests/src/Functional/FieldTestBase.php | 10 +++++----- .../field/tests/src/Kernel/BulkDeleteTest.php | 4 ++-- .../tests/src/Kernel/FieldKernelTestBase.php | 10 +++++----- .../src/Functional/FileFieldTestBase.php | 4 ++-- .../src/Functional/ImageFieldTestBase.php | 8 ++++---- .../tests/src/Functional/LinkFieldUITest.php | 2 +- .../tests/src/Kernel/MigrateTestBase.php | 2 +- .../Unit/destination/EntityRevisionTest.php | 2 +- .../tests/src/Unit/process/FileCopyTest.php | 4 ++-- .../tests/src/Unit/process/FormatDateTest.php | 6 +++--- .../NodeAccessLanguageFallbackTest.php | 2 +- .../src/Functional/NodeRevisionsTest.php | 2 +- .../EntityResource/EntityResourceTestBase.php | 4 ++-- .../ContentEntityNormalizerTest.php | 2 +- .../src/Functional/Batch/ProcessingTest.php | 2 +- .../src/Functional/Cache/CacheTestBase.php | 20 +++++++++---------- .../Functional/Menu/AssertBreadcrumbTrait.php | 2 +- .../src/Functional/Module/ModuleTestBase.php | 18 ++++++++--------- .../Functional/Session/SessionHttpsTest.php | 4 ++-- .../tests/src/Kernel/Common/UrlTest.php | 6 +++--- .../src/Kernel/Form/ProgrammaticTest.php | 4 ++-- .../src/Kernel/Migrate/d7/MigrateMenuTest.php | 4 ++-- .../tests/src/Unit/Mail/HtmlToTextTest.php | 2 +- .../Migrate/d7/MigrateTaxonomyTermTest.php | 6 +++--- .../d7/MigrateTaxonomyVocabularyTest.php | 6 +++--- .../tests/src/Functional/UpdateTestBase.php | 4 ++-- .../tests/src/Functional/DefaultViewsTest.php | 4 ++-- .../BuildTests/Framework/BuildTestBase.php | 2 +- .../FunctionalJavascriptTests/JSWebAssert.php | 2 +- .../Cache/EndOfTransactionQueriesTest.php | 2 +- .../Core/Entity/EntityCrudHookTest.php | 2 +- .../KernelTests/Core/File/FileTestBase.php | 18 ++++++++--------- .../Tests/Component/Graph/GraphTest.php | 6 +++--- .../Component/Render/PlainTextOutputTest.php | 4 ++-- .../Compiler/BackendCompilerPassTest.php | 6 +++--- .../Menu/LocalTaskIntegrationTestBase.php | 4 ++-- .../Drupal/Tests/TestFileCreationTrait.php | 4 ++-- 39 files changed, 101 insertions(+), 101 deletions(-) diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTestBase.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTestBase.php index 627ff292e9c..1d017a01cca 100644 --- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTestBase.php +++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTestBase.php @@ -123,11 +123,11 @@ abstract class ConfigTranslationUiTestBase extends BrowserTestBase { /** * Gets translation from locale storage. * - * @param $config_name + * @param string $config_name * Configuration object. - * @param $key + * @param string $key * Translation configuration field key. - * @param $langcode + * @param string $langcode * String language code to load translation. * * @return bool|mixed diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php index 0be086e36bf..2e9ed9e2661 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationFieldSyncRevisionTest.php @@ -551,7 +551,7 @@ class ContentTranslationFieldSyncRevisionTest extends EntityKernelTestBase { /** * Asserts that the latest revision has the expected field values. * - * @param $entity_id + * @param string $entity_id * The entity ID. * @param array $expected_values * An array of expected values in the following order: diff --git a/core/modules/field/tests/src/Functional/FieldTestBase.php b/core/modules/field/tests/src/Functional/FieldTestBase.php index c419578a73b..112cbb827a1 100644 --- a/core/modules/field/tests/src/Functional/FieldTestBase.php +++ b/core/modules/field/tests/src/Functional/FieldTestBase.php @@ -16,7 +16,7 @@ abstract class FieldTestBase extends BrowserTestBase { /** * Generate random values for a field_test field. * - * @param $cardinality + * @param int $cardinality * Number of values to generate. * * @return array @@ -38,14 +38,14 @@ abstract class FieldTestBase extends BrowserTestBase { * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to test. - * @param $field_name + * @param string $field_name * The name of the field to test - * @param $expected_values + * @param array $expected_values * The array of expected values. - * @param $langcode + * @param string $langcode * (Optional) The language code for the values. Defaults to * \Drupal\Core\Language\LanguageInterface::LANGCODE_DEFAULT. - * @param $column + * @param string $column * (Optional) The name of the column to check. Defaults to 'value'. */ public function assertFieldValues(EntityInterface $entity, $field_name, $expected_values, $langcode = LanguageInterface::LANGCODE_DEFAULT, $column = 'value') { diff --git a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php index 599ad85290d..c31906ee266 100644 --- a/core/modules/field/tests/src/Kernel/BulkDeleteTest.php +++ b/core/modules/field/tests/src/Kernel/BulkDeleteTest.php @@ -54,11 +54,11 @@ class BulkDeleteTest extends FieldKernelTestBase { /** * Tests that the expected hooks have been invoked on the expected entities. * - * @param $expected_hooks + * @param string[] $expected_hooks * An array keyed by hook name, with one entry per expected invocation. * Each entry is the value of the "$entity" parameter the hook is expected * to have been passed. - * @param $actual_hooks + * @param array $actual_hooks * The array of actual hook invocations recorded by field_test_memorize(). */ public function checkHooksInvocations($expected_hooks, $actual_hooks): void { diff --git a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php index 28c8d85b768..5e2b060e7b4 100644 --- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php +++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php @@ -165,7 +165,7 @@ abstract class FieldKernelTestBase extends KernelTestBase { /** * Generate random values for a field_test field. * - * @param $cardinality + * @param int $cardinality * Number of values to generate. * * @return array @@ -187,14 +187,14 @@ abstract class FieldKernelTestBase extends KernelTestBase { * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity to test. - * @param $field_name + * @param string $field_name * The name of the field to test - * @param $expected_values + * @param array $expected_values * The array of expected values. - * @param $langcode + * @param string $langcode * (Optional) The language code for the values. Defaults to * \Drupal\Core\Language\LanguageInterface::LANGCODE_NOT_SPECIFIED. - * @param $column + * @param string $column * (Optional) The name of the column to check. Defaults to 'value'. */ protected function assertFieldValues(EntityInterface $entity, $field_name, $expected_values, $langcode = LanguageInterface::LANGCODE_NOT_SPECIFIED, $column = 'value') { diff --git a/core/modules/file/tests/src/Functional/FileFieldTestBase.php b/core/modules/file/tests/src/Functional/FileFieldTestBase.php index 8d930fea9ca..d6e1b28a019 100644 --- a/core/modules/file/tests/src/Functional/FileFieldTestBase.php +++ b/core/modules/file/tests/src/Functional/FileFieldTestBase.php @@ -104,7 +104,7 @@ abstract class FileFieldTestBase extends BrowserTestBase { * The File to be uploaded. * @param string $field_name * The name of the field on which the files should be saved. - * @param $nid_or_type + * @param int|string $nid_or_type * A numeric node id to upload files to an existing node, or a string * indicating the desired bundle for a new node. * @param bool $new_revision @@ -126,7 +126,7 @@ abstract class FileFieldTestBase extends BrowserTestBase { * The files to be uploaded. * @param string $field_name * The name of the field on which the files should be saved. - * @param $nid_or_type + * @param int|string $nid_or_type * A numeric node id to upload files to an existing node, or a string * indicating the desired bundle for a new node. * @param bool $new_revision diff --git a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php index da98d02866a..f2b1f52fa67 100644 --- a/core/modules/image/tests/src/Functional/ImageFieldTestBase.php +++ b/core/modules/image/tests/src/Functional/ImageFieldTestBase.php @@ -94,13 +94,13 @@ abstract class ImageFieldTestBase extends BrowserTestBase { /** * Upload an image to a node. * - * @param $image + * @param \stdClass $image * A file object representing the image to upload. - * @param $field_name + * @param string $field_name * Name of the image field the image should be attached to. - * @param $type + * @param string $type * The type of node to create. - * @param $alt + * @param string $alt * The alt text for the image. Use if the field settings require alt text. */ public function uploadNodeImage($image, $field_name, $type, $alt = '') { diff --git a/core/modules/link/tests/src/Functional/LinkFieldUITest.php b/core/modules/link/tests/src/Functional/LinkFieldUITest.php index 56367d8b9ac..694fb6b3677 100644 --- a/core/modules/link/tests/src/Functional/LinkFieldUITest.php +++ b/core/modules/link/tests/src/Functional/LinkFieldUITest.php @@ -243,7 +243,7 @@ class LinkFieldUITest extends BrowserTestBase { /** * Returns the raw HTML for the given field. * - * @param $field_name + * @param string $field_name * The name of the field for which to return the HTML. * * @return string diff --git a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php index f4234aa900b..e3bc8fe2898 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php @@ -251,7 +251,7 @@ abstract class MigrateTestBase extends KernelTestBase implements MigrateMessageI /** * Gets the migration plugin. * - * @param $plugin_id + * @param string $plugin_id * The plugin ID of the migration to get. * * @return \Drupal\migrate\Plugin\Migration diff --git a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php index 3885c1cb798..9dc36ebc10b 100644 --- a/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/EntityRevisionTest.php @@ -181,7 +181,7 @@ class EntityRevisionTest extends UnitTestCase { * * @see \Drupal\Tests\migrate\Unit\Destination\EntityRevision * - * @param $configuration + * @param array $configuration * Configuration for the destination. * @param string $plugin_id * The plugin id. diff --git a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php index b23b6026b69..830edec70fc 100644 --- a/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php +++ b/core/modules/migrate/tests/src/Unit/process/FileCopyTest.php @@ -26,10 +26,10 @@ class FileCopyTest extends MigrateProcessTestCase { * * @param array $configuration * The plugin configuration. - * @param $expected + * @param \Drupal\Core\File\FileExists $expected * The expected value of the plugin configuration. */ - public function testFileProcessBaseConstructor($configuration, $expected): void { + public function testFileProcessBaseConstructor(array $configuration, FileExists $expected): void { $this->assertPlugin($configuration, $expected); } diff --git a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php index 0f0408aaa50..23d0dfb494d 100644 --- a/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php +++ b/core/modules/migrate/tests/src/Unit/process/FormatDateTest.php @@ -83,11 +83,11 @@ class FormatDateTest extends MigrateProcessTestCase { * * @dataProvider datesDataProvider * - * @param $configuration + * @param array $configuration * The configuration of the migration process plugin. - * @param $value + * @param string $value * The source value for the migration process plugin. - * @param $expected + * @param string $expected * The expected value of the migration process plugin. */ public function testTransform($configuration, $value, $expected): void { diff --git a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php index db6977df8df..933a328f8d9 100644 --- a/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php +++ b/core/modules/node/tests/src/Functional/NodeAccessLanguageFallbackTest.php @@ -120,7 +120,7 @@ class NodeAccessLanguageFallbackTest extends NodeTestBase { * @param int $count * The number of rows expected by the query (equal to the translation * count). - * @param $langcode + * @param string $langcode * The expected language code set as the fallback property. */ public function checkRecords($count, $langcode = 'hu'): void { diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php index 6ed7ffda85e..f4059ceb874 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php @@ -467,7 +467,7 @@ class NodeRevisionsTest extends NodeTestBase { * * @param \Drupal\node\NodeInterface $node * The node object. - * @param $count + * @param int $count * The number of revisions to be created. */ protected function createRevisions(NodeInterface $node, $count): void { diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 9e9f7bb8991..bb717da2a69 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -1445,9 +1445,9 @@ abstract class EntityResourceTestBase extends ResourceTestBase { * A response may include more properties, we only need to ensure that all * items in the request exist in the response. * - * @param $expected + * @param array $expected * An array of expected values, may contain further nested arrays. - * @param $actual + * @param array $actual * The object to test. */ protected function assertEntityArraySubset($expected, $actual) { diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php index 819d91383be..3e8da705c83 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/ContentEntityNormalizerTest.php @@ -122,7 +122,7 @@ class ContentEntityNormalizerTest extends UnitTestCase { /** * Creates a mock content entity. * - * @param $definitions + * @param array $definitions * The properties the will be returned. * * @return \PHPUnit\Framework\MockObject\MockObject diff --git a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php index 405dada8ff0..2c09e1ef0a4 100644 --- a/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php +++ b/core/modules/system/tests/src/Functional/Batch/ProcessingTest.php @@ -220,7 +220,7 @@ class ProcessingTest extends BrowserTestBase { /** * Triggers a pass if the texts were found in order in the raw content. * - * @param $texts + * @param array $texts * Array of raw strings to look for. * * @internal diff --git a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php index e09f4677196..56ceaae71af 100644 --- a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php +++ b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php @@ -18,11 +18,11 @@ abstract class CacheTestBase extends BrowserTestBase { /** * Checks whether or not a cache entry exists. * - * @param $cid + * @param string $cid * The cache id. - * @param $var + * @param mixed $var * The variable the cache should contain. - * @param $bin + * @param string|null $bin * The bin the cache item was stored in. * * @return bool @@ -41,13 +41,13 @@ abstract class CacheTestBase extends BrowserTestBase { /** * Asserts that a cache entry exists. * - * @param $message + * @param string $message * Message to display. - * @param $var + * @param string|null $var * The variable the cache should contain. - * @param $cid + * @param string|null $cid * The cache id. - * @param $bin + * @param string|null $bin * The bin the cache item was stored in. */ protected function assertCacheExists($message, $var = NULL, $cid = NULL, $bin = NULL) { @@ -67,11 +67,11 @@ abstract class CacheTestBase extends BrowserTestBase { /** * Asserts that a cache entry has been removed. * - * @param $message + * @param string $message * Message to display. - * @param $cid + * @param string|null $cid * The cache id. - * @param $bin + * @param string|null $bin * The bin the cache item was stored in. */ public function assertCacheRemoved($message, $cid = NULL, $bin = NULL) { diff --git a/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php b/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php index 1039c86f46d..553292a8d31 100644 --- a/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php +++ b/core/modules/system/tests/src/Functional/Menu/AssertBreadcrumbTrait.php @@ -31,7 +31,7 @@ trait AssertBreadcrumbTrait { * (optional) An associative array whose keys are link paths and whose * values are link titles (not sanitized) of an expected active trail in a * menu tree output on the page. - * @param $last_active + * @param bool $last_active * (optional) Whether the last link in $tree is expected to be active (TRUE) * or just to be in the active trail (FALSE). * @param string $active_trail_class diff --git a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php index d73c75f7e8d..a5a34cc2630 100644 --- a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php +++ b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php @@ -39,7 +39,7 @@ abstract class ModuleTestBase extends BrowserTestBase { /** * Assert that all tables defined in a module's hook_schema() exist. * - * @param $module + * @param string $module * The name of the module. */ public function assertModuleTablesExist($module) { @@ -57,7 +57,7 @@ abstract class ModuleTestBase extends BrowserTestBase { /** * Assert that none of the tables defined in a module's hook_schema() exist. * - * @param $module + * @param string $module * The name of the module. */ public function assertModuleTablesDoNotExist($module) { @@ -127,9 +127,9 @@ abstract class ModuleTestBase extends BrowserTestBase { /** * Assert the list of modules are enabled or disabled. * - * @param $modules + * @param array $modules * Module list to check. - * @param $enabled + * @param bool $enabled * Expected module state. */ public function assertModules(array $modules, $enabled) { @@ -148,21 +148,21 @@ abstract class ModuleTestBase extends BrowserTestBase { /** * Verify a log entry was entered for a module's status change. * - * @param $type + * @param string $type * The category to which this message belongs. - * @param $message + * @param string $message * The message to store in the log. Keep $message translatable * by not concatenating dynamic values into it! Variables in the * message should be added by using placeholder strings alongside * the variables argument to declare the value of the placeholders. * See t() for documentation on how $message and $variables interact. - * @param $variables + * @param array $variables * Array of variables to replace in the message on display or * NULL if message is already translated or not possible to * translate. - * @param $severity + * @param int $severity * The severity of the message, as per RFC 3164. - * @param $link + * @param string $link * A link to associate with the message. */ public function assertLogMessage($type, $message, $variables = [], $severity = RfcLogLevel::NOTICE, $link = '') { diff --git a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php index cc7052344d0..f3fe2c10cdd 100644 --- a/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php +++ b/core/modules/system/tests/src/Functional/Session/SessionHttpsTest.php @@ -268,7 +268,7 @@ class SessionHttpsTest extends BrowserTestBase { /** * Builds a URL for submitting a mock HTTPS request to HTTP test environments. * - * @param $url + * @param string $url * A Drupal path such as 'user/login'. * * @return string @@ -281,7 +281,7 @@ class SessionHttpsTest extends BrowserTestBase { /** * Builds a URL for submitting a mock HTTP request to HTTPS test environments. * - * @param $url + * @param string $url * A Drupal path such as 'user/login'. * * @return string diff --git a/core/modules/system/tests/src/Kernel/Common/UrlTest.php b/core/modules/system/tests/src/Kernel/Common/UrlTest.php index f58f4f6eea4..3d7dacc4027 100644 --- a/core/modules/system/tests/src/Kernel/Common/UrlTest.php +++ b/core/modules/system/tests/src/Kernel/Common/UrlTest.php @@ -168,11 +168,11 @@ class UrlTest extends KernelTestBase { /** * Checks for class existence in link. * - * @param $attribute + * @param string $attribute * Attribute to be checked. - * @param $link + * @param string $link * URL to search. - * @param $class + * @param string $class * Element class to search for. * * @return bool diff --git a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php index 3f049a2b24b..a300066cc48 100644 --- a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php +++ b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php @@ -58,9 +58,9 @@ class ProgrammaticTest extends KernelTestBase { /** * Programmatically submits the form_test.module form with the given values. * - * @param $values + * @param array $values * An array of field values to be submitted. - * @param $valid_input + * @param bool $valid_input * A boolean indicating whether or not the form submission is expected to * be valid. */ diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php index 2fa4229480a..a60cff4d797 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateMenuTest.php @@ -30,9 +30,9 @@ class MigrateMenuTest extends MigrateDrupal7TestBase { * The menu ID. * @param string $language * The menu language. - * @param $label + * @param string $label * The menu label. - * @param $description + * @param string $description * The menu description. * * @internal diff --git a/core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php b/core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php index ed3dce647b3..02c6e11d087 100644 --- a/core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php +++ b/core/modules/system/tests/src/Unit/Mail/HtmlToTextTest.php @@ -28,7 +28,7 @@ class HtmlToTextTest extends UnitTestCase { /** * Converts a string to its PHP source equivalent for display in test messages. * - * @param $text + * @param string $text * The text string to convert. * * @return string diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php index 8f458a4bcfb..f4c4d0b1d5e 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyTermTest.php @@ -65,9 +65,9 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase { * Entity ID to load and check. * @param string $expected_language * The language code for this term. - * @param $expected_label + * @param string $expected_label * The label the migrated entity should have. - * @param $expected_vid + * @param string $expected_vid * The parent vocabulary the migrated entity should have. * @param string|null $expected_description * The description the migrated entity should have. @@ -204,7 +204,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupal7TestBase { /** * Retrieves the parent term IDs for a given term. * - * @param $tid + * @param int $tid * ID of the term to check. * * @return array diff --git a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php index 3cde0fb5485..e56fe67c481 100644 --- a/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php +++ b/core/modules/taxonomy/tests/src/Kernel/Migrate/d7/MigrateTaxonomyVocabularyTest.php @@ -33,11 +33,11 @@ class MigrateTaxonomyVocabularyTest extends MigrateDrupal7TestBase { * * @param string $id * Entity ID to load and check. - * @param $expected_label + * @param string $expected_label * The label the migrated entity should have. - * @param $expected_description + * @param string $expected_description * The description the migrated entity should have. - * @param $expected_weight + * @param string $expected_weight * The weight the migrated entity should have. * * @internal diff --git a/core/modules/update/tests/src/Functional/UpdateTestBase.php b/core/modules/update/tests/src/Functional/UpdateTestBase.php index f9afb144f00..67848f65001 100644 --- a/core/modules/update/tests/src/Functional/UpdateTestBase.php +++ b/core/modules/update/tests/src/Functional/UpdateTestBase.php @@ -64,10 +64,10 @@ abstract class UpdateTestBase extends BrowserTestBase { /** * Refreshes the update status based on the desired available update scenario. * - * @param $xml_map + * @param array $xml_map * Array that maps project names to availability scenarios to fetch. The key * '#all' is used if a project-specific mapping is not defined. - * @param $url + * @param string $url * (optional) A string containing the URL to fetch update data from. * Defaults to 'update-test'. * diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php index 9daa58d9760..cdaa10c90d3 100644 --- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php +++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php @@ -211,9 +211,9 @@ class DefaultViewsTest extends UITestBase { * various views listing pages, and they might have tokens in them. So we * need special code to find the correct one to click. * - * @param $label + * @param string $label * Text between the anchor tags of the desired link. - * @param $unique_href_part + * @param string $unique_href_part * A unique string that is expected to occur within the href of the desired * link. For example, if the link URL is expected to look like * "admin/structure/views/view/glossary/*", then "/glossary/" could be diff --git a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php index fa2981eb03f..b1fea7d324a 100644 --- a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php +++ b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php @@ -498,7 +498,7 @@ abstract class BuildTestBase extends TestCase { /** * Checks whether a port is available. * - * @param $port + * @param int $port * A number between 1024 and 65536. * * @return bool diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php index d3f77f05f8d..7e6001aa16f 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/JSWebAssert.php @@ -528,7 +528,7 @@ JS; * quotes respectively therefore we can not escape them when testing for * escaped HTML. * - * @param $raw + * @param string $raw * The raw string to escape. * * @return string diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php index 9ff9b1d488c..b74d470822d 100644 --- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php +++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php @@ -154,7 +154,7 @@ class EndOfTransactionQueriesTest extends KernelTestBase { * * @param string[] $statements * A list of query statements. - * @param $table_name + * @param string $table_name * The name of the table to filter by. * * @return string[] diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php index 4d151aa0eca..3c98668c9c2 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityCrudHookTest.php @@ -72,7 +72,7 @@ class EntityCrudHookTest extends EntityKernelTestBase { * Module entity_crud_hook_test implements all core entity CRUD hooks and * stores a message for each in $GLOBALS['entity_crud_hook_test']. * - * @param array $messages + * @param string[] $messages * An array of plain-text messages in the order they should appear. * * @internal diff --git a/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php index 5308ea355f0..d41860c72f9 100644 --- a/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/File/FileTestBase.php @@ -79,11 +79,11 @@ abstract class FileTestBase extends KernelTestBase { /** * Helper function to test the permissions of a file. * - * @param $filepath + * @param string $filepath * String file path. - * @param $expected_mode + * @param int $expected_mode * Octal integer like 0664 or 0777. - * @param $message + * @param string|null $message * Optional message. */ public function assertFilePermissions($filepath, $expected_mode, $message = NULL) { @@ -114,11 +114,11 @@ abstract class FileTestBase extends KernelTestBase { /** * Helper function to test the permissions of a directory. * - * @param $directory + * @param string $directory * String directory path. - * @param $expected_mode + * @param int $expected_mode * Octal integer like 0664 or 0777. - * @param $message + * @param string|null $message * Optional message. */ public function assertDirectoryPermissions($directory, $expected_mode, $message = NULL) { @@ -170,13 +170,13 @@ abstract class FileTestBase extends KernelTestBase { /** * Create a file and return the URI of it. * - * @param $filepath + * @param string|null $filepath * Optional string specifying the file path. If none is provided then a * randomly named file will be created in the site's files directory. - * @param $contents + * @param string|null $contents * Optional contents to save into the file. If a NULL value is provided an * arbitrary string will be used. - * @param $scheme + * @param string|null $scheme * Optional string indicating the stream scheme to use. Drupal core includes * public, private, and temporary. The public wrapper is the default. * diff --git a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php index ab600c4a6f0..81810093dd0 100644 --- a/core/tests/Drupal/Tests/Component/Graph/GraphTest.php +++ b/core/tests/Drupal/Tests/Component/Graph/GraphTest.php @@ -84,7 +84,7 @@ class GraphTest extends TestCase { /** * Normalizes a graph. * - * @param $graph + * @param array $graph * A graph array processed by \Drupal\Component\Graph\Graph::searchAndSort() * * @return array @@ -186,9 +186,9 @@ class GraphTest extends TestCase { /** * Helper function to output vertices as comma-separated list. * - * @param $paths + * @param array $paths * An array containing a list of vertices. - * @param $keys + * @param bool $keys * (optional) Whether to output the keys of $paths instead of the values. */ protected function displayArray($paths, $keys = FALSE): string { diff --git a/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php b/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php index 23ddfea0119..21e8830fa89 100644 --- a/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php +++ b/core/tests/Drupal/Tests/Component/Render/PlainTextOutputTest.php @@ -19,9 +19,9 @@ class PlainTextOutputTest extends TestCase { /** * Tests ::renderFromHtml(). * - * @param $expected + * @param string $expected * The expected formatted value. - * @param $string + * @param string $string * A string to be formatted. * @param array $args * (optional) An associative array of replacements to make. Defaults to diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php index c8994334657..0d8727710d3 100644 --- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php +++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php @@ -100,7 +100,7 @@ class BackendCompilerPassTest extends UnitTestCase { * This is necessary because the container clone does not clone the parameter * bag so the setParameter() call effects the parent container as well. * - * @param $service + * @param \Symfony\Component\DependencyInjection\Definition $service * The service definition. * * @return \Symfony\Component\DependencyInjection\ContainerBuilder @@ -120,7 +120,7 @@ class BackendCompilerPassTest extends UnitTestCase { * This is necessary because the container clone does not clone the parameter * bag so the setParameter() call effects the parent container as well. * - * @param $service + * @param \Symfony\Component\DependencyInjection\Definition $service * The service definition. * * @return \Symfony\Component\DependencyInjection\ContainerBuilder @@ -138,7 +138,7 @@ class BackendCompilerPassTest extends UnitTestCase { * This is necessary because the container clone does not clone the parameter * bag so the setParameter() call effects the parent container as well. * - * @param $service + * @param \Symfony\Component\DependencyInjection\Definition $service * The service definition. * * @return \Symfony\Component\DependencyInjection\ContainerBuilder diff --git a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php index 62175ac657c..fd2ddc5acf4 100644 --- a/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php +++ b/core/tests/Drupal/Tests/Core/Menu/LocalTaskIntegrationTestBase.php @@ -117,9 +117,9 @@ abstract class LocalTaskIntegrationTestBase extends UnitTestCase { /** * Tests integration for local tasks. * - * @param $route_name + * @param string $route_name * Route name to base task building on. - * @param $expected_tasks + * @param array $expected_tasks * A list of tasks groups by level expected at the given route * @param array $route_params * (optional) A list of route parameters used to resolve tasks. diff --git a/core/tests/Drupal/Tests/TestFileCreationTrait.php b/core/tests/Drupal/Tests/TestFileCreationTrait.php index ef8437c2f89..43357296ded 100644 --- a/core/tests/Drupal/Tests/TestFileCreationTrait.php +++ b/core/tests/Drupal/Tests/TestFileCreationTrait.php @@ -43,10 +43,10 @@ trait TestFileCreationTrait { * is prefixed with one of the above types, it will get returned as well, even * on subsequent calls. * - * @param $type + * @param string $type * File type, possible values: 'binary', 'html', 'image', 'javascript', * 'php', 'sql', 'text'. - * @param $size + * @param int|null $size * (optional) File size in bytes to match. Defaults to NULL, which will not * filter the returned list by size. *