diff --git a/core/lib/Drupal/Component/Gettext/PoStreamInterface.php b/core/lib/Drupal/Component/Gettext/PoStreamInterface.php index 59992991294713a0651e4147e31e1b08a7e5dbb7..0e2ac8b5a7c54821ac85c0b50825b8bcfdc497d8 100644 --- a/core/lib/Drupal/Component/Gettext/PoStreamInterface.php +++ b/core/lib/Drupal/Component/Gettext/PoStreamInterface.php @@ -31,7 +31,7 @@ public function getURI(); /** * Set the URI of the PO stream that is going to be read or written. * - * @param $uri + * @param string $uri * URI string to set for this stream. */ public function setURI($uri); diff --git a/core/lib/Drupal/Component/Gettext/PoStreamReader.php b/core/lib/Drupal/Component/Gettext/PoStreamReader.php index 0644b25e8647a26de850685ece67b7003c2b1b3a..46a18498aee6680159d432a16871b80d89f877e5 100644 --- a/core/lib/Drupal/Component/Gettext/PoStreamReader.php +++ b/core/lib/Drupal/Component/Gettext/PoStreamReader.php @@ -541,7 +541,7 @@ public function setItemFromArray($value) { /** * Parses a string in quotes. * - * @param $string + * @param string $string * A string specified with enclosing quotes. * * @return bool|string @@ -572,7 +572,7 @@ public function parseQuoted($string) { /** * Generates a short, one-string version of the passed comment array. * - * @param $comment + * @param string[] $comment * An array of strings containing a comment. * * @return string diff --git a/core/lib/Drupal/Component/Gettext/PoWriterInterface.php b/core/lib/Drupal/Component/Gettext/PoWriterInterface.php index f81d567adfedf1e1d466f31fdb1c18326ccf4518..fac4ee8216377b85709f5733b7fc7235bbd0d844 100644 --- a/core/lib/Drupal/Component/Gettext/PoWriterInterface.php +++ b/core/lib/Drupal/Component/Gettext/PoWriterInterface.php @@ -20,7 +20,7 @@ public function writeItem(PoItem $item); * * @param PoReaderInterface $reader * Reader to read PoItems from. - * @param $count + * @param int $count * Amount of items to read from $reader to write. If -1, all items are * read from $reader. */ diff --git a/core/lib/Drupal/Component/Graph/Graph.php b/core/lib/Drupal/Component/Graph/Graph.php index 6fe9cf21b0045461cbc0d095be6d49493d9e4ce6..1242decf647a6de2e0a405a63d5f131a857f7d31 100644 --- a/core/lib/Drupal/Component/Graph/Graph.php +++ b/core/lib/Drupal/Component/Graph/Graph.php @@ -15,7 +15,7 @@ class Graph { /** * Instantiates the depth first search object. * - * @param $graph + * @param array $graph * A three dimensional associated array, with the first keys being the names * of the vertices, these can be strings or numbers. The second key is * 'edges' and the third one are again vertices, each such key representing @@ -87,13 +87,13 @@ public function searchAndSort() { /** * Performs a depth-first search on a graph. * - * @param $state + * @param array $state * An associative array. The key 'last_visit_order' stores a list of the * vertices visited. The key components stores list of vertices belonging * to the same the component. - * @param $start + * @param string|int $start * An arbitrary vertex where we started traversing the graph. - * @param $component + * @param string|int|null $component * The component of the last vertex. * * @see \Drupal\Component\Graph\Graph::searchAndSort() diff --git a/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php b/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php index ca74d602fba3ac23c9178ff818e6ce07507669ec..7c0e45dd19d9993653fde56bf9aa76f5989cd2fa 100644 --- a/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php +++ b/core/lib/Drupal/Component/PhpStorage/FileReadOnlyStorage.php @@ -17,7 +17,7 @@ class FileReadOnlyStorage implements PhpStorageInterface { /** * Constructs this FileStorage object. * - * @param $configuration + * @param string[] $configuration * An associative array, containing at least two keys (the rest are ignored): * - directory: The directory where the files should be stored. * - bin: The storage bin. Multiple storage objects can be instantiated with diff --git a/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php index 1db14568a433c7fc2eae1d7f0d1f95f757287cb4..c304e7736cef1c3cff62c48b48c10f44b45150a0 100644 --- a/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php +++ b/core/lib/Drupal/Component/PhpStorage/MTimeProtectedFastFileStorage.php @@ -217,9 +217,9 @@ protected function getUncachedMTime($directory) { /** * A brute force tempnam implementation supporting streams. * - * @param $directory + * @param string $directory * The directory where the temporary filename will be created. - * @param $prefix + * @param string $prefix * The prefix of the generated temporary filename. * * @return string diff --git a/core/lib/Drupal/Component/Render/HtmlEscapedText.php b/core/lib/Drupal/Component/Render/HtmlEscapedText.php index 6ca9538089e62d688429fb52ac618a2878e0a0a7..be27ba85a3edab0a9cbbfda814f303a57444e32c 100644 --- a/core/lib/Drupal/Component/Render/HtmlEscapedText.php +++ b/core/lib/Drupal/Component/Render/HtmlEscapedText.php @@ -24,7 +24,7 @@ class HtmlEscapedText implements MarkupInterface, \Countable { /** * Constructs an HtmlEscapedText object. * - * @param $string + * @param string $string * The string to escape. This value will be cast to a string. */ public function __construct($string) { diff --git a/core/lib/Drupal/Component/Transliteration/PhpTransliteration.php b/core/lib/Drupal/Component/Transliteration/PhpTransliteration.php index 3bce69b4c4b8362dbafc63a97de6a05da82521b5..ab111e1872e58c196e2f850a0d3e1a2b825bcd56 100644 --- a/core/lib/Drupal/Component/Transliteration/PhpTransliteration.php +++ b/core/lib/Drupal/Component/Transliteration/PhpTransliteration.php @@ -246,7 +246,7 @@ protected function replace($code, $langcode, $unknown_character) { /** * Look up the generic replacement for a UTF-8 character code. * - * @param $code + * @param int $code * The UTF-8 character code. * @param string $unknown_character * (optional) The character to substitute for characters without entries in @@ -277,7 +277,7 @@ protected function lookupReplacement($code, $unknown_character = '?') { * transliterations in this language. The character codes can be for any valid * Unicode character, independent of the number of bytes. * - * @param $langcode + * @param string $langcode * Code for the language to read. */ protected function readLanguageOverrides($langcode) { @@ -304,7 +304,7 @@ protected function readLanguageOverrides($langcode) { * transliterations of these characters into US-ASCII. Note that the maximum * Unicode character that can be encoded in this way is 4 bytes. * - * @param $bank + * @param int $bank * First two bytes of the Unicode character, or 0 for the ASCII range. */ protected function readGenericData($bank) { diff --git a/core/lib/Drupal/Component/Utility/Color.php b/core/lib/Drupal/Component/Utility/Color.php index 49d0aa2560332946b26be9a69e2c1102f4a6da81..fa06da8f7c843e9d213693108f92b405861f0abd 100644 --- a/core/lib/Drupal/Component/Utility/Color.php +++ b/core/lib/Drupal/Component/Utility/Color.php @@ -10,7 +10,7 @@ class Color { /** * Validates whether a hexadecimal color value is syntactically correct. * - * @param $hex + * @param string $hex * The hexadecimal string to validate. May contain a leading '#'. May use * the shorthand notation (e.g., '123' for '112233'). * diff --git a/core/lib/Drupal/Component/Utility/Crypt.php b/core/lib/Drupal/Component/Utility/Crypt.php index f76cd8b8ca3eb59c9d180da9b7f3d1a10193847b..42fde05cd75953e179fb9229fa5c79422dc3ca77 100644 --- a/core/lib/Drupal/Component/Utility/Crypt.php +++ b/core/lib/Drupal/Component/Utility/Crypt.php @@ -54,7 +54,7 @@ public static function hashBase64($data) { /** * Returns a URL-safe, base64 encoded string of highly randomized bytes. * - * @param $count + * @param int $count * The number of random bytes to fetch and base64 encode. * * @return string diff --git a/core/lib/Drupal/Component/Utility/DeprecatedArray.php b/core/lib/Drupal/Component/Utility/DeprecatedArray.php index 6f93c7c68d08eba42d092445dfb6088eb9d226d6..6d7ef5d484c340d4f51ada5c14b50932cc4b9e77 100644 --- a/core/lib/Drupal/Component/Utility/DeprecatedArray.php +++ b/core/lib/Drupal/Component/Utility/DeprecatedArray.php @@ -19,7 +19,7 @@ class DeprecatedArray extends \ArrayObject { * * @param array $values * The array values. - * @param $message + * @param string $message * The deprecation message. */ public function __construct(array $values, $message) { diff --git a/core/lib/Drupal/Component/Utility/Environment.php b/core/lib/Drupal/Component/Utility/Environment.php index 6028183c6f45e6ba559c38524127e1947bd967ae..5fd7441c79c1cb03c4310dabf68bef767a1ba941 100644 --- a/core/lib/Drupal/Component/Utility/Environment.php +++ b/core/lib/Drupal/Component/Utility/Environment.php @@ -14,7 +14,7 @@ class Environment { * The memory required for the operation, expressed as a number of bytes with * optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8bytes, * 9mbytes). - * @param $memory_limit + * @param string|null $memory_limit * (optional) The memory limit for the operation, expressed as a number of * bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, * 6GiB, 8bytes, 9mbytes). If no value is passed, the current PHP diff --git a/core/lib/Drupal/Component/Utility/Timer.php b/core/lib/Drupal/Component/Utility/Timer.php index b086bfbcd34b37862588bf7e78079d4b9547e3f7..19c83922e4cb5b958afb6a65aaba69e58a0fd3ab 100644 --- a/core/lib/Drupal/Component/Utility/Timer.php +++ b/core/lib/Drupal/Component/Utility/Timer.php @@ -17,7 +17,7 @@ class Timer { * If you start and stop the same timer multiple times, the measured intervals * will be accumulated. * - * @param $name + * @param string $name * The name of the timer. */ public static function start($name) { diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 8aa3e883aea7f3839d2b92fffcbf7126b9ebcb93..733c8d5084eaaaa96447d3c900ed569e8e648e31 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -66,14 +66,17 @@ <rule ref="Drupal.Commenting.DocCommentLongArraySyntax"/> <rule ref="Drupal.Commenting.DocCommentStar"/> <rule ref="Drupal.Commenting.FileComment"/> + <rule ref="Drupal.Commenting.FunctionComment"> <exclude name="Drupal.Commenting.FunctionComment.InvalidNoReturn"/> <exclude name="Drupal.Commenting.FunctionComment.Missing"/> - <exclude name="Drupal.Commenting.FunctionComment.MissingParamType"/> <exclude name="Drupal.Commenting.FunctionComment.MissingReturnComment"/> <exclude name="Drupal.Commenting.FunctionComment.ParamCommentFullStop"/> <exclude name="Drupal.Commenting.FunctionComment.TypeHintMissing"/> </rule> + <rule ref="Drupal.Commenting.FunctionComment.MissingParamType"> + <include-pattern>core/lib/Component/*</include-pattern> + </rule> <rule ref="Drupal.Commenting.GenderNeutralComment"/> <rule ref="Drupal.Commenting.HookComment"/> <rule ref="Drupal.Commenting.InlineComment">