Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:

- name: Install PHP tools with phive.
run: "phive install --trust-gpg-keys 'CF1A108D0E7AE720,51C67305FFC2E5C0,12CE0F1D262429A5'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run PHP CodeSniffer
run: vendor/bin/phpcs --report=checkstyle | cs2pr
Expand Down
7 changes: 5 additions & 2 deletions CakePHP/Sniffs/Commenting/TypeHintSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,11 @@ protected function getSortedTypeHint(array $types): string
} elseif ($type instanceof ArrayShapeNode) {
$sortName = 'array';
} elseif ($type instanceof GenericTypeNode) {
if (in_array($type->type->name, $shouldSort)) {
$sortName = $type->type->name;
$genericName = $type->type instanceof IdentifierTypeNode
? $type->type->name
: $type->type->toString();
if (in_array($genericName, $shouldSort, true)) {
$sortName = $genericName;
}
}

Expand Down
2 changes: 0 additions & 2 deletions CakePHP/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
<exclude name="PSR12.Files.FileHeader.SpacingAfterTagBlock"/>
<exclude name="PSR12.Files.FileHeader.SpacingAfterDocblockBlock"/>
<exclude name="PSR12.Files.FileHeader.IncorrectOrder"/>
<exclude name="PSR12.Files.FileHeader.SpacingAfterUseBlock"/>
<exclude name="PSR12.Files.FileHeader.SpacingAfterUseFunctionBlock"/>
<!--
We use our own CakePHP.NamingConventions.ValidFunctionName sniff which allows
Entity accessor/mutator pattern (_getField, _setField) while enforcing PSR naming elsewhere.
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"require": {
"php": ">=8.4",
"dealerdirect/phpcodesniffer-composer-installer": "^1.1.2",
"phpstan/phpdoc-parser": "^2.1",
"phpstan/phpdoc-parser": "^2.4",
"slevomat/coding-standard": "^8.23",
"squizlabs/php_codesniffer": "^4.0.2"
},
Expand Down
Loading