Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
add few phpstan extensions
  • Loading branch information
TomasVotruba committed Dec 13, 2024
commit 9e648ec6cbb1f4c6574fb5eda1d3ae40fc1c3350
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ How to keep **cognitive complexity on 1**? Read [Keep Cognitive Complexity Low w
composer require tomasvotruba/cognitive-complexity --dev
```

The package is available on PHP 7.4-8.1 versions in tagged releases.
The package is available on PHP 7.4+.

<br>

Expand All @@ -47,7 +47,7 @@ With [PHPStan extension installer](https://github.com/phpstan/extension-installe

Enable each item on their own with simple configuration:

```neon
```yaml
# phpstan.neon
parameters:
cognitive_complexity:
Expand Down
17 changes: 10 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@
"require": {
"php": "^8.2",
"phpstan/phpstan": "^2.0",
"nikic/php-parser": "^5"
"nikic/php-parser": "^5.3"
},
"require-dev": {
"phpstan/extension-installer": "^1.3",
"phpunit/phpunit": "^10.3",
"symplify/easy-coding-standard": "^12.0",
"rector/rector": "^2",
"tracy/tracy": "^2.9",
"php-parallel-lint/php-parallel-lint": "^1.3"
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpunit/phpunit": "^11.5",
"symplify/easy-coding-standard": "^12.5",
"rector/rector": "^2.0",
"tracy/tracy": "^2.10",
"php-parallel-lint/php-parallel-lint": "^1.4",
"tomasvotruba/type-coverage": "^2.0",
"tomasvotruba/unused-public": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ parameters:
class: 50
function: 8

unused_public:
methods: true
properties: true
constants: true

level: 8

paths:
Expand All @@ -22,3 +27,6 @@ parameters:

# skip as always string
- '#Parameter \#1 \$currentWorkingDirectory of class PHPStan\\DependencyInjection\\ContainerFactory constructor expects string, string\|false given#'

# used in tests
- '#Public constant "TomasVotruba\\CognitiveComplexity\\Rules\\(.*?)::ERROR_MESSAGE" is never used#'