diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43d0140..efdf993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,8 +40,8 @@ jobs: matrix: os: [ubuntu-latest] php_version: - - 7.2 - - 7.3 +# - 7.2 +# - 7.3 - 7.4 - 8.0 - 8.1 @@ -93,7 +93,7 @@ jobs: 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 - 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..f464893 100644 --- a/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php +++ b/MO4/Sniffs/Formatting/AlphabeticalUseStatementsSniff.php @@ -292,7 +292,8 @@ private function findNewDestination(File $phpcsFile, int $stackPtr, string $impo { $tokens = $phpcsFile->getTokens(); - $line = $tokens[$stackPtr]['line']; + $line = $tokens[$stackPtr]['line']; + /** @var int|bool $prevLine */ $prevLine = false; $prevPtr = $stackPtr; diff --git a/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php b/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php index 28860e9..3a3fba9 100644 --- a/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php +++ b/MO4/Sniffs/Formatting/UnnecessaryNamespaceUsageSniff.php @@ -381,6 +381,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 7fa6848..68b09d6 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "source": "https://github.com/mayflower/mo4-coding-standard" }, "require": { - "php": "~7.2 || ~8.0", + "php": "~7.4 || ~8.0", "dealerdirect/phpcodesniffer-composer-installer": "~0.7 || ~1.0", "escapestudios/symfony2-coding-standard": "^3.10.0", "slevomat/coding-standard": "^8.14", @@ -36,7 +36,7 @@ "phpstan/phpstan-strict-rules": "^1.6", "phpunit/phpunit": "^7.5.20 || ^8.5.36 || ^9.6.15", "psalm/plugin-phpunit": "^0.18", - "vimeo/psalm": "^4.30" + "vimeo/psalm": "^5.26" }, "config": { "allow-plugins": {