From 2ecd3df86d79776be4d5439913e456beac64f97f Mon Sep 17 00:00:00 2001 From: Klaus Purer Date: Sun, 4 Aug 2024 11:40:48 +0200 Subject: [PATCH] phpcs fixes --- .../Sniffs/CSS/ClassDefinitionNameSpacingSniff.php | 4 ++-- .../Drupal/Sniffs/CSS/ColourDefinitionSniff.php | 2 +- .../Drupal/Sniffs/Commenting/ClassCommentSniff.php | 6 +++--- .../Drupal/Sniffs/Commenting/DeprecatedSniff.php | 2 +- .../Drupal/Sniffs/Commenting/DocCommentSniff.php | 4 ++-- .../Drupal/Sniffs/Commenting/FileCommentSniff.php | 4 ++-- .../Sniffs/Commenting/FunctionCommentSniff.php | 4 ++-- .../Drupal/Sniffs/Files/FileEncodingSniff.php | 12 ++++++------ .../Sniffs/Formatting/MultiLineAssignmentSniff.php | 6 +++--- .../Sniffs/Functions/DiscouragedFunctionsSniff.php | 4 ++-- .../Drupal/Sniffs/InfoFiles/ClassFilesSniff.php | 2 +- .../Sniffs/NamingConventions/ValidClassNameSniff.php | 12 ++++++------ .../Drupal/Sniffs/Semantics/FunctionAliasSniff.php | 2 +- .../Sniffs/Strings/UnnecessaryStringConcatSniff.php | 12 ++++++------ .../Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php | 12 ++++++------ .../DrupalPractice/Sniffs/General/OptionsTSniff.php | 2 +- 16 files changed, 45 insertions(+), 45 deletions(-) diff --git a/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php index 8386ec73..44749f7d 100644 --- a/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php +++ b/coder_sniffer/Drupal/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php @@ -98,8 +98,8 @@ public function process(File $phpcsFile, $stackPtr) && in_array($tokens[($i - 1)]['code'], [T_WHITESPACE, T_COMMA]) === false ) { $error = 'Selectors must be on a single line'; - // cspell:ignore SeletorSingleLine - $fix = $phpcsFile->addFixableError($error, $i, 'SeletorSingleLine'); + // Cspell:ignore SeletorSingleLine . + $fix = $phpcsFile->addFixableError($error, $i, 'SeletorSingleLine'); if ($fix === true) { $phpcsFile->fixer->replaceToken($i, str_replace($phpcsFile->eolChar, ' ', $tokens[$i]['content'])); } diff --git a/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php b/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php index 386c4e2e..884ddc4a 100644 --- a/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php +++ b/coder_sniffer/Drupal/Sniffs/CSS/ColourDefinitionSniff.php @@ -56,7 +56,7 @@ public function register() public function process(File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - $color = $tokens[$stackPtr]['content']; + $color = $tokens[$stackPtr]['content']; $expected = strtolower($color); if ($color !== $expected) { diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/ClassCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/ClassCommentSniff.php index a263fac2..a0c6bb6c 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/ClassCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/ClassCommentSniff.php @@ -17,9 +17,9 @@ * Checks that comment doc blocks exist on classes, interfaces and traits. Largely * copied from PHP_CodeSniffer\Standards\Squiz\Sniffs\Commenting\ClassCommentSniff. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class ClassCommentSniff implements Sniff { diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php index 4628c7e9..025293fa 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/DeprecatedSniff.php @@ -124,7 +124,7 @@ public function process(File $phpcsFile, $stackPtr) // automatic fixes for Drupal core, and if the project is missing we are // assuming it is Drupal core. Deprecations for contrib projects are much // less frequent and faults can be corrected manually. - // cspell:ignore xdev + // Cspell:ignore xdev . preg_match('/^(.*)(as of|in) (drupal|)( |:|)+([\d\.\-xdev\?]+)(,| |. |)(.*)(removed|removal)([ |from|before|in|the]*) (drupal|)( |:|)([\d\-\.xdev]+)( |,|$)+(?:release|)(?:[\.,])*(.*)$/i', $text1, $matchesFix); if (count($matchesFix) >= 12) { diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php index f0d11296..7fa10776 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/DocCommentSniff.php @@ -382,8 +382,8 @@ public function process(File $phpcsFile, $stackPtr) // Break out the tags into groups and check alignment within each. // A tag group is one where there are no blank lines between tags. // The param tag group is special as it requires all @param tags to be inside. - $tagGroups = []; - // cspell:ignore groupid + $tagGroups = []; + // Cspell:ignore groupid . $groupid = 0; $paramGroupid = null; $currentTag = null; diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php index e1190583..fd08919f 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/FileCommentSniff.php @@ -225,8 +225,8 @@ public function process(File $phpcsFile, $stackPtr) && $tokens[$next]['code'] === T_CLOSE_TAG ) { $error = 'There must be no blank line after the file comment in a template'; - // cspell:ignore TeamplateSpacingAfterComment - $fix = $phpcsFile->addFixableError($error, $commentEnd, 'TeamplateSpacingAfterComment'); + // Cspell:ignore TeamplateSpacingAfterComment . + $fix = $phpcsFile->addFixableError($error, $commentEnd, 'TeamplateSpacingAfterComment'); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); $uselessLine = ($commentEnd + 1); diff --git a/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php b/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php index 686ead92..d34891bf 100644 --- a/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Commenting/FunctionCommentSniff.php @@ -27,7 +27,7 @@ class FunctionCommentSniff implements Sniff /** * A map of invalid data types to valid ones for param and return documentation. * - * cspell:ignore TRUEFALSE + * Cspell:ignore TRUEFALSE * * @var array */ @@ -442,7 +442,7 @@ protected function processThrows(File $phpcsFile, $stackPtr, $commentStart) $comment .= ' '.$tokens[$i]['content']; if ($indent < 3) { $error = 'Throws comment indentation must be 3 spaces, found %s spaces'; - // cspell:ignore TrhowsCommentIndentation + // Cspell:ignore TrhowsCommentIndentation . $phpcsFile->addError($error, $i, 'TrhowsCommentIndentation', [$indent]); } } diff --git a/coder_sniffer/Drupal/Sniffs/Files/FileEncodingSniff.php b/coder_sniffer/Drupal/Sniffs/Files/FileEncodingSniff.php index 45e5f0fa..dd3a8747 100644 --- a/coder_sniffer/Drupal/Sniffs/Files/FileEncodingSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Files/FileEncodingSniff.php @@ -2,9 +2,9 @@ /** * \Drupal\Sniffs\Files\FileEncodingSniff. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ namespace Drupal\Sniffs\Files; @@ -17,9 +17,9 @@ * * Validates the encoding of a file against a white list of allowed encodings. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class FileEncodingSniff implements Sniff { diff --git a/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php b/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php index 886134f6..8a02a790 100644 --- a/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Formatting/MultiLineAssignmentSniff.php @@ -17,9 +17,9 @@ * * If an assignment goes over two lines, ensure the equal sign is indented. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class MultiLineAssignmentSniff implements Sniff { diff --git a/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php b/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php index 167a3150..d47fdb90 100644 --- a/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Functions/DiscouragedFunctionsSniff.php @@ -27,7 +27,7 @@ class DiscouragedFunctionsSniff extends ForbiddenFunctionsSniff * The value is NULL if no alternative exists, i.e., the function should * just not be used. * - * cSpell:disable + * cspell:disable * * @var array */ @@ -59,7 +59,7 @@ class DiscouragedFunctionsSniff extends ForbiddenFunctionsSniff 'fnmatch' => null, // Functions which are a security risk. 'eval' => null, - // cSpell:enable + // Cspell:enable . ]; /** diff --git a/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php b/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php index 4da942ac..0d1c4426 100644 --- a/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php +++ b/coder_sniffer/Drupal/Sniffs/InfoFiles/ClassFilesSniff.php @@ -80,7 +80,7 @@ public function process(File $phpcsFile, $stackPtr) $ptr = self::getPtr('files[]', $file, $phpcsFile); $error = "It's only necessary to declare files[] if they declare a class or interface."; - // cspell:ignore UnecessaryFileDeclaration + // Cspell:ignore UnecessaryFileDeclaration . $phpcsFile->addError($error, $ptr, 'UnecessaryFileDeclaration'); }//end foreach }//end if diff --git a/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php index 5f4bf6de..11ae5f89 100644 --- a/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php +++ b/coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php @@ -2,9 +2,9 @@ /** * \Drupal\Sniffs\NamingConventions\ValidClassNameSniff. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ namespace Drupal\Sniffs\NamingConventions; @@ -18,9 +18,9 @@ * Ensures class and interface names start with a capital letter * and do not use _ separators. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class ValidClassNameSniff implements Sniff { diff --git a/coder_sniffer/Drupal/Sniffs/Semantics/FunctionAliasSniff.php b/coder_sniffer/Drupal/Sniffs/Semantics/FunctionAliasSniff.php index 463182c3..58993c1d 100644 --- a/coder_sniffer/Drupal/Sniffs/Semantics/FunctionAliasSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Semantics/FunctionAliasSniff.php @@ -167,7 +167,7 @@ class FunctionAliasSniff extends FunctionCall /** * Returns an array of function names this test wants to listen for. * - * cSpell:enable + * Cspell:enable * * @return array */ diff --git a/coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php b/coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php index 5194a4b6..8603d9f4 100644 --- a/coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php +++ b/coder_sniffer/Drupal/Sniffs/Strings/UnnecessaryStringConcatSniff.php @@ -2,9 +2,9 @@ /** * \Drupal\Sniffs\Strings\UnnecessaryStringConcatSniff. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ namespace Drupal\Sniffs\Strings; @@ -17,9 +17,9 @@ /** * Checks that two strings are not concatenated together; suggests using one string instead. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class UnnecessaryStringConcatSniff extends GenericUnnecessaryStringConcatSniff { diff --git a/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php index 53048f24..3ca059df 100644 --- a/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php +++ b/coder_sniffer/Drupal/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php @@ -2,9 +2,9 @@ /** * \Drupal\Sniffs\WhiteSpace\ObjectOperatorIndentSniff. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ namespace Drupal\Sniffs\WhiteSpace; @@ -19,9 +19,9 @@ * Checks that object operators are indented 2 spaces if they are the first * thing on a line. * - * @category PHP - * @package PHP_CodeSniffer - * @link http://pear.php.net/package/PHP_CodeSniffer + * @category PHP + * @package PHP_CodeSniffer + * @link http://pear.php.net/package/PHP_CodeSniffer */ class ObjectOperatorIndentSniff implements Sniff { diff --git a/coder_sniffer/DrupalPractice/Sniffs/General/OptionsTSniff.php b/coder_sniffer/DrupalPractice/Sniffs/General/OptionsTSniff.php index 3dd881a9..6138d04b 100644 --- a/coder_sniffer/DrupalPractice/Sniffs/General/OptionsTSniff.php +++ b/coder_sniffer/DrupalPractice/Sniffs/General/OptionsTSniff.php @@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr) $afterValue = $phpcsFile->findNext(T_WHITESPACE, ($arrayValue + 1), $statementEnd, true); if ($tokens[$afterValue]['code'] === T_COMMA || $tokens[$afterValue]['code'] === T_CLOSE_PARENTHESIS) { $warning = '#options values usually have to run through t() for translation'; - // cspell:ignore TforValue + // Cspell:ignore TforValue . $phpcsFile->addWarning($warning, $arrayValue, 'TforValue'); } }