Skip to content

Commit

Permalink
Merge pull request #6 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 02285ce + 02f6a07 commit ecba216
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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,9 +17,9 @@
"cakephp/chronos": "^2"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"friendsofphp/php-cs-fixer": "^3",
"overtrue/phplint": "^2.3",
"phpstan/phpstan": "0.*",
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.5"
},
Expand All @@ -44,7 +44,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 src --level=max -c phpstan.neon --no-progress --ansi",
Expand Down
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#Cannot cast mixed to int.#'
- '#Cannot cast mixed to string.#'
- '#Cannot cast mixed to float.#'
- '#Parameter \#1 \$time of class Cake\\Chronos\\Chronos constructor expects DateTimeInterface\|int\|string\|null, mixed given.#'
- '#Cannot access offset string on mixed.#'

0 comments on commit ecba216

Please sign in to comment.