diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75cc169..4a98bd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,14 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.1', '8.2'] + php-version: ['8.1', '8.2', '8.3'] dependencies: ['highest'] include: - php-version: '8.1' dependencies: 'lowest' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,10 +31,9 @@ jobs: coverage: none - name: Composer install - uses: ramsey/composer-install@v2 + uses: ramsey/composer-install@v3 with: dependency-versions: ${{ matrix.dependencies }} - composer-options: --ignore-platform-reqs - name: Run PHPUnit run: composer phpunit @@ -54,9 +53,7 @@ jobs: coverage: none - name: Composer install - uses: ramsey/composer-install@v2 - with: - composer-options: --ignore-platform-reqs + uses: ramsey/composer-install@v3 - name: Run PHP CodeSniffer run: vendor/bin/phpcs --report=checkstyle | cs2pr diff --git a/CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php b/CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php index 9f1764c..52ea811 100644 --- a/CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php +++ b/CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php @@ -58,7 +58,7 @@ public function process(File $phpcsFile, $stackPtr) // We skip for interface methods if (empty($tokens[$stackPtr]['scope_opener']) || empty($tokens[$stackPtr]['scope_closer'])) { - return []; + return; } $returnTokenCode = $tokens[$startIndex]['code']; diff --git a/CakePHP/Tests/Classes/ReturnTypeHintUnitTestinc.fixed b/CakePHP/Tests/Classes/ReturnTypeHintUnitTest.inc.fixed similarity index 85% rename from CakePHP/Tests/Classes/ReturnTypeHintUnitTestinc.fixed rename to CakePHP/Tests/Classes/ReturnTypeHintUnitTest.inc.fixed index e433764..bbdd97a 100644 --- a/CakePHP/Tests/Classes/ReturnTypeHintUnitTestinc.fixed +++ b/CakePHP/Tests/Classes/ReturnTypeHintUnitTest.inc.fixed @@ -1,9 +1,6 @@ + diff --git a/composer.json b/composer.json index e05c98e..1347fc2 100644 --- a/composer.json +++ b/composer.json @@ -20,11 +20,11 @@ "require": { "php": ">=8.1.0", "phpstan/phpdoc-parser": "^1.4.5", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.7.1" + "slevomat/coding-standard": "^8.15", + "squizlabs/php_codesniffer": "^3.9" }, "require-dev": { - "phpunit/phpunit": "^7.1" + "phpunit/phpunit": "^9.3.4" }, "autoload": { "psr-4": { diff --git a/docs/README.md b/docs/README.md index aba42c7..ade369b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # CakePHP ruleset -The CakePHP standard contains 143 sniffs +The CakePHP standard contains 144 sniffs CakePHP (20 sniffs) ------------------- @@ -54,7 +54,7 @@ Generic (25 sniffs) - Generic.WhiteSpace.ScopeIndent PEAR (1 sniff) ---------------- +-------------- - PEAR.Functions.ValidDefaultValue PSR1 (3 sniffs) @@ -63,6 +63,18 @@ PSR1 (3 sniffs) - PSR1.Files.SideEffects - PSR1.Methods.CamelCapsMethodName +PSR2 (9 sniffs) +--------------- +- PSR2.Classes.ClassDeclaration +- PSR2.Classes.PropertyDeclaration +- PSR2.ControlStructures.ElseIfDeclaration +- PSR2.ControlStructures.SwitchDeclaration +- PSR2.Files.ClosingTag +- PSR2.Files.EndFileNewline +- PSR2.Methods.FunctionCallSignature +- PSR2.Methods.FunctionClosingBrace +- PSR2.Methods.MethodDeclaration + PSR12 (17 sniffs) ----------------- - PSR12.Classes.AnonClassDeclaration @@ -83,19 +95,7 @@ PSR12 (17 sniffs) - PSR12.Properties.ConstantVisibility - PSR12.Traits.UseDeclaration -PSR2 (9 sniffs) ---------------- -- PSR2.Classes.ClassDeclaration -- PSR2.Classes.PropertyDeclaration -- PSR2.ControlStructures.ElseIfDeclaration -- PSR2.ControlStructures.SwitchDeclaration -- PSR2.Files.ClosingTag -- PSR2.Files.EndFileNewline -- PSR2.Methods.FunctionCallSignature -- PSR2.Methods.FunctionClosingBrace -- PSR2.Methods.MethodDeclaration - -SlevomatCodingStandard (39 sniffs) +SlevomatCodingStandard (40 sniffs) ---------------------------------- - SlevomatCodingStandard.Arrays.TrailingArrayComma - SlevomatCodingStandard.Classes.ClassConstantVisibility @@ -113,6 +113,7 @@ SlevomatCodingStandard (39 sniffs) - SlevomatCodingStandard.ControlStructures.NewWithParentheses - SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator - SlevomatCodingStandard.Exceptions.DeadCatch +- SlevomatCodingStandard.Functions.ArrowFunctionDeclaration - SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses - SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation - SlevomatCodingStandard.Namespaces.NamespaceDeclaration @@ -169,5 +170,5 @@ Squiz (28 sniffs) - Squiz.WhiteSpace.SuperfluousWhitespace Zend (1 sniff) ---------------- +-------------- - Zend.NamingConventions.ValidVariableName \ No newline at end of file