diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0aa9861..0106bd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/CakePHP/Sniffs/Commenting/TypeHintSniff.php b/CakePHP/Sniffs/Commenting/TypeHintSniff.php index da82ecf..a5d5fc8 100644 --- a/CakePHP/Sniffs/Commenting/TypeHintSniff.php +++ b/CakePHP/Sniffs/Commenting/TypeHintSniff.php @@ -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; } } diff --git a/CakePHP/ruleset.xml b/CakePHP/ruleset.xml index f11b4ab..612d0ac 100644 --- a/CakePHP/ruleset.xml +++ b/CakePHP/ruleset.xml @@ -15,8 +15,6 @@ - -