Skip to content
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

PHPStan 2.0: update configuration #325

Merged
merged 1 commit into from
Nov 11, 2024
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: 1 addition & 1 deletion .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
name: "PHPStan"
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main
with:
phpstanVersion: '1.x'
phpstanVersion: '2.x'

remark:
name: 'QA Markdown'
Expand Down
3 changes: 1 addition & 2 deletions Universal/Sniffs/Operators/ConcatPositionSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public function register()
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return int|void Integer stack pointer to skip forward or void to continue
* normal file processing.
* @return void
*/
public function process(File $phpcsFile, $stackPtr)
{
Expand Down
35 changes: 20 additions & 15 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,41 @@ parameters:
# Keep to stay in line with parent class.
-
message: '`^Constructor of class PHPCSExtra\\Universal\\Helpers\\DummyTokenizer has an unused parameter \$content\.$`'
path: Universal\Helpers\DummyTokenizer.php
path: Universal/Helpers/DummyTokenizer.php
count: 1

# Level 4
# PHPStan doesn't seem to like uninitialized properties...
# Ref: https://github.com/phpstan/phpstan/issues/10305
-
message: '`^Property \S+Sniff::\$(phpVersion|tabWidth) \(int\) in isset\(\) is not nullable\.$`'
paths:
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
- Modernize/Sniffs/FunctionCalls/DirnameSniff.php
- Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
- Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php
- Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php
- Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php
- Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
-
message: '`^Strict comparison using === between true and false will always evaluate to false\.$`'
paths:
- Modernize\Sniffs\FunctionCalls\DirnameSniff.php
- Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
- Universal\Sniffs\CodeAnalysis\ConstructorDestructorReturnSniff.php
- Universal\Sniffs\WhiteSpace\CommaSpacingSniff.php
- Universal\Sniffs\WhiteSpace\DisallowInlineTabsSniff.php
- Universal\Sniffs\WhiteSpace\PrecisionAlignmentSniff.php
- Modernize/Sniffs/FunctionCalls/DirnameSniff.php
- Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
- Universal/Sniffs/CodeAnalysis/ConstructorDestructorReturnSniff.php
- Universal/Sniffs/WhiteSpace/CommaSpacingSniff.php
- Universal/Sniffs/WhiteSpace/DisallowInlineTabsSniff.php
- Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
-
message: '`^Property PHPCSExtra\\Universal\\Sniffs\\Arrays\\DuplicateArrayKeySniff\:\:\$currentMaxIntKey[GL]t8 \(int\) in isset\(\) is not nullable\.$`'
path: Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
path: Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
count: 5
-
message: '`^Strict comparison using === between true and true will always evaluate to true\.$`'
path: Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
count: 1
-
message: '`^Result of && is always false\.$`'
path: Universal\Sniffs\Arrays\DuplicateArrayKeySniff.php
path: Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php
count: 1

# Level 5
Expand Down