Skip to content

fix error with change in slevomat/coding-standard 8.19.0 #419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 10 additions & 40 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['7.2', '7.4', '8.0']
prefer-lowest: ['']
php-version: ['7.2', '7.4']
dependencies: [highest]
include:
- php-version: '7.2'
prefer-lowest: 'prefer-lowest'
dependencies: 'lowest'
- php-version: '8.0'
composer-options: "--ignore-platform-reqs"

steps:
- uses: actions/checkout@v2
Expand All @@ -30,29 +32,11 @@ jobs:
extensions: mbstring, intl
coverage: pcov

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v1
- name: Composer install
uses: ramsey/composer-install@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}

- name: Composer Install
run: |
if [[ ${{ matrix.php-version }} == '8.0' ]]; then
composer install --ignore-platform-reqs
elif ${{ matrix.prefer-lowest == 'prefer-lowest' }}; then
composer update --prefer-lowest --prefer-stable
else
composer install
fi
dependency-versions: ${{ matrix.dependencies }}
composer-options: "${{ matrix.composer-options }}"

- name: Setup problem matchers for PHPUnit
if: matrix.php-version == '7.4'
Expand Down Expand Up @@ -82,22 +66,8 @@ jobs:
tools: cs2pr
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Get date part for cache key
id: key-date
run: echo "::set-output name=date::$(date +'%Y-%m')"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ steps.key-date.outputs.date }}-${{ hashFiles('composer.json') }}-${{ matrix.prefer-lowest }}

- name: Composer install
run: composer install
uses: ramsey/composer-install@v3

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --report=checkstyle CakePHP/ | cs2pr
2 changes: 1 addition & 1 deletion CakePHP/Sniffs/Classes/ReturnTypeHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ protected function getClassNameWithNamespace(File $phpCsFile): ?string

return ClassHelper::getFullyQualifiedName(
$phpCsFile,
$phpCsFile->findPrevious(TokenHelper::$typeKeywordTokenCodes, $lastToken)
$phpCsFile->findPrevious([T_CLASS, T_TRAIT, T_INTERFACE, T_ENUM], $lastToken)
);
}
}
8 changes: 6 additions & 2 deletions CakePHP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,15 @@
</properties>
<exclude-pattern>*/tests/*</exclude-pattern>
</rule>
<rule ref="Generic.Formatting.NoSpaceAfterCast"/>
<rule ref="Generic.Formatting.SpaceAfterCast">
<properties>
<property name="spacing" value="0"/>
</properties>
</rule>
<rule ref="Generic.PHP.DeprecatedFunctions"/>
<rule ref="Generic.PHP.ForbiddenFunctions"/>
<rule ref="Generic.PHP.NoSilencedErrors"/>
<rule ref="Generic.WhiteSpace.LanguageConstructSpacing"/>

<!-- Relax CakePHP rules -->
<rule ref="CakePHP.Commenting.FunctionComment">
Expand All @@ -81,7 +86,6 @@
<rule ref="Squiz.Scope.MemberVarScope"/>
<rule ref="Squiz.Scope.StaticThisUsage"/>
<rule ref="Squiz.WhiteSpace.CastSpacing"/>
<rule ref="Squiz.WhiteSpace.LanguageConstructSpacing"/>
<rule ref="Squiz.WhiteSpace.LogicalOperatorSpacing"/>
<rule ref="Squiz.WhiteSpace.ScopeClosingBrace"/>
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy