diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4cfe9ea..268c9e4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,21 +4,21 @@ on: push: branches: - master - - '5.0' + - '5.x' pull_request: branches: - '*' jobs: testsuite: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - php-version: ['7.2', '7.4', '8.0'] + php-version: ['7.4', '8.0'] prefer-lowest: [''] include: - - php-version: '7.2' + - php-version: '7.4' prefer-lowest: 'prefer-lowest' steps: @@ -78,7 +78,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.2' + php-version: '7.4' extensions: mbstring, intl tools: cs2pr coverage: none diff --git a/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php b/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php index ab2c63dd..5a139e9b 100644 --- a/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php +++ b/CakePHP/Sniffs/Commenting/FunctionCommentSniff.php @@ -42,6 +42,7 @@ class FunctionCommentSniff implements Sniff * Returns an array of tokens this test wants to listen for. * * @return array + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint */ public function register() { @@ -49,11 +50,7 @@ public function register() } /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @return void + * @inheritDoc */ public function process(File $phpcsFile, $stackPtr) { @@ -115,7 +112,7 @@ public function process(File $phpcsFile, $stackPtr) * @param int $stackPtr The position of the current token in the stack passed in $tokens. * @return void */ - protected function processTagSpacing(File $phpcsFile, int $stackPtr, int $commentStart) + protected function processTagSpacing(File $phpcsFile, int $stackPtr, int $commentStart): void { $tokens = $phpcsFile->getTokens(); $tags = $tokens[$commentStart]['comment_tags']; @@ -142,7 +139,7 @@ protected function processTagSpacing(File $phpcsFile, int $stackPtr, int $commen * @param int $commentStart The position in the stack where the comment started. * @return void */ - protected function processThrows(File $phpcsFile, int $stackPtr, int $commentStart) + protected function processThrows(File $phpcsFile, int $stackPtr, int $commentStart): void { $tokens = $phpcsFile->getTokens(); diff --git a/CakePHP/Sniffs/Commenting/TypeHintSniff.php b/CakePHP/Sniffs/Commenting/TypeHintSniff.php index 9a7d5b4d..726d2fcf 100644 --- a/CakePHP/Sniffs/Commenting/TypeHintSniff.php +++ b/CakePHP/Sniffs/Commenting/TypeHintSniff.php @@ -41,12 +41,12 @@ class TypeHintSniff implements Sniff /** * @var bool */ - public $convertArraysToGenerics = true; + public bool $convertArraysToGenerics = true; /** * @var array */ - protected static $typeHintTags = [ + protected static array $typeHintTags = [ '@var', '@psalm-var', '@phpstan-var', @@ -62,6 +62,7 @@ class TypeHintSniff implements Sniff * Returns an array of tokens this test wants to listen for. * * @return array + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint */ public function register() { @@ -69,11 +70,7 @@ public function register() } /** - * Processes this test, when one of its tokens is encountered. - * - * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the current token in the stack passed in $tokens. - * @return void + * @inheritDoc */ public function process(File $phpcsFile, $stackPtr) { @@ -233,7 +230,7 @@ protected function getSortedTypeHint(array $types): string } $sorted = []; - array_walk($sortable, function ($types) use (&$sorted) { + array_walk($sortable, function ($types) use (&$sorted): void { $sorted = array_merge($sorted, $types); }); @@ -258,7 +255,7 @@ protected function renderUnionTypes(array $typeNodes): string * @param string $tagComment tag comment * @return \PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagValueNode */ - protected static function getValueNode(string $tagName, $tagComment): PhpDocTagValueNode + protected static function getValueNode(string $tagName, string $tagComment): PhpDocTagValueNode { static $phpDocParser; if (!$phpDocParser) { diff --git a/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php b/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php index 1eb9faed..b75fedf5 100644 --- a/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php +++ b/CakePHP/Sniffs/Formatting/BlankLineBeforeReturnSniff.php @@ -27,16 +27,6 @@ */ class BlankLineBeforeReturnSniff implements Sniff { - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - ]; - /** * @inheritDoc */ diff --git a/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php b/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php index 7212f25d..f8daa2ad 100644 --- a/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php +++ b/CakePHP/Sniffs/NamingConventions/ValidFunctionNameSniff.php @@ -29,7 +29,7 @@ class ValidFunctionNameSniff extends AbstractScopeSniff * * @var array */ - protected $_magicMethods = [ + protected array $_magicMethods = [ 'construct', 'destruct', 'call', diff --git a/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php b/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php index f1fbab20..a67aa0ce 100644 --- a/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php +++ b/CakePHP/Sniffs/PHP/DisallowShortOpenTagSniff.php @@ -32,6 +32,7 @@ class DisallowShortOpenTagSniff implements Sniff * So include T_INLINE_HTML which is what "getTokens(); @@ -123,7 +123,7 @@ protected function assertNewLineAtTheEnd(File $phpCsFile, $closingBraceIndex, $n * @param int $stackPointer Stack pointer * @return void */ - protected function assertNewLineAtTheBeginning(File $phpCsFile, $stackPointer) + protected function assertNewLineAtTheBeginning(File $phpCsFile, int $stackPointer): void { $tokens = $phpCsFile->getTokens(); diff --git a/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php b/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php index 6d977d58..7873e5d8 100644 --- a/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php +++ b/CakePHP/Sniffs/WhiteSpace/TabAndSpaceSniff.php @@ -24,17 +24,6 @@ class TabAndSpaceSniff implements Sniff { - /** - * A list of tokenizers this sniff supports. - * - * @var array - */ - public $supportedTokenizers = [ - 'PHP', - 'JS', - 'CSS', - ]; - /** * @inheritDoc */ diff --git a/CakePHP/ruleset.xml b/CakePHP/ruleset.xml index 651922e0..895fdac1 100644 --- a/CakePHP/ruleset.xml +++ b/CakePHP/ruleset.xml @@ -177,7 +177,6 @@ - */tests/* @@ -189,7 +188,6 @@ - */tests/* @@ -200,7 +198,6 @@ - */tests/*