Skip to content

Commit

Permalink
Merge pull request #3 from open-source-contributions/improve_phpstan_…
Browse files Browse the repository at this point in the history
…phpcsfixer

Upgrade PHPStan and PHP-CS-Fixer
  • Loading branch information
odan authored Dec 15, 2021
2 parents 805d82d + 9e216ae commit 74158d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'@PSR1' => true,
'@PSR2' => true,
'@Symfony' => true,
'psr4' => true,
'psr_autoloading' => true,
// custom rules
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
'phpdoc_to_comment' => false,
Expand All @@ -21,7 +21,7 @@
'declare_equal_normalize' => ['space' => 'single'],
'increment_style' => ['style' => 'post'],
'list_syntax' => ['syntax' => 'short'],
'no_short_echo_tag' => true,
'echo_tag_syntax' => ['format' => 'long'],
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_align' => false,
'phpdoc_no_empty_return' => false,
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
"psr/http-server-middleware": "^1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2",
"friendsofphp/php-cs-fixer": "^3",
"middlewares/utils": "^3",
"overtrue/phplint": "^2",
"phpstan/phpstan": "0.*",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^8 || ^9",
"slim/psr7": "^1",
"squizlabs/php_codesniffer": "^3"
Expand All @@ -33,7 +33,7 @@
"@phpstan",
"@test:coverage"
],
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php",
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
"cs:fix": "php-cs-fixer fix --config=.cs.php",
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
"phpstan": "phpstan analyse -c phpstan.neon --no-progress --ansi",
Expand Down
5 changes: 4 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ parameters:
level: max
paths:
- src
- tests
- tests
ignoreErrors:
- '#Cannot cast mixed to string.#'
- '#Parameter \#2 ...\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given.#'

0 comments on commit 74158d2

Please sign in to comment.