diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed09edb..105ee7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,8 +88,7 @@ jobs: - name: Run PHPStan run: vendor/bin/phpstan analyse --no-progress - name: Run psalm - if: ${{ matrix.os != 'windows-latest' }} - run: vendor/bin/psalm --show-info=true + run: vendor/bin/psalm --show-info=false - name: Run phan if: ${{ matrix.os != 'windows-latest' }} run: vendor/bin/phan diff --git a/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php b/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php index 86f00e2..96fe0d8 100644 --- a/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php +++ b/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php @@ -301,6 +301,7 @@ private function findNewDestination(File $phpcsFile, int $stackPtr, string $impo // Use $line for the first iteration. if (false !== $prevLine) { + /** @psalm-suppress NoValue */ $line = $prevLine; } diff --git a/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php b/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php index 18b9d0f..df06976 100644 --- a/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php +++ b/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php @@ -376,6 +376,7 @@ private function checkShorthandPossible(File $phpcsFile, array $useStatements, s if (true === $isDocBlock) { $tokens = $phpcsFile->getTokens(); $oldContent = $tokens[$startPtr]['content']; + /** @var string $newContent */ $newContent = \str_replace($className, $replacement, $oldContent); $phpcsFile->fixer->replaceToken($startPtr, $newContent); } else { diff --git a/composer.json b/composer.json index 86bd72a..4ad1624 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "phpstan/phpstan-strict-rules": "^1.0", "phpunit/phpunit": "^9.0", "psalm/plugin-phpunit": "^0.18", - "vimeo/psalm": "^4.30" + "vimeo/psalm": "^5.17" }, "config": { "allow-plugins": { diff --git a/psalm.xml b/psalm.xml index f4813e5..0079020 100644 --- a/psalm.xml +++ b/psalm.xml @@ -5,6 +5,8 @@ xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" autoloader="tests/bootstrap.php" + findUnusedBaselineEntry="true" + findUnusedCode="false" >