Skip to content

Commit ecba216

Browse files
authored
Merge pull request #6 from open-source-contributions/improve_phpstan_phpcsfixer
Upgrade PHPStan and PHP-CS-Fixer
2 parents 02285ce + 02f6a07 commit ecba216

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.cs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'@PSR1' => true,
99
'@PSR2' => true,
1010
'@Symfony' => true,
11-
'psr4' => true,
11+
'psr_autoloading' => true,
1212
// custom rules
1313
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // psr-5
1414
'phpdoc_to_comment' => false,
@@ -21,7 +21,7 @@
2121
'declare_equal_normalize' => ['space' => 'single'],
2222
'increment_style' => ['style' => 'post'],
2323
'list_syntax' => ['syntax' => 'short'],
24-
'no_short_echo_tag' => true,
24+
'echo_tag_syntax' => ['format' => 'long'],
2525
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
2626
'phpdoc_align' => false,
2727
'phpdoc_no_empty_return' => false,

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"cakephp/chronos": "^2"
1818
},
1919
"require-dev": {
20-
"friendsofphp/php-cs-fixer": "^2.16",
20+
"friendsofphp/php-cs-fixer": "^3",
2121
"overtrue/phplint": "^2.3",
22-
"phpstan/phpstan": "0.*",
22+
"phpstan/phpstan": "^1",
2323
"phpunit/phpunit": "^9",
2424
"squizlabs/php_codesniffer": "^3.5"
2525
},
@@ -44,7 +44,7 @@
4444
"@phpstan",
4545
"@test:coverage"
4646
],
47-
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --diff-format=udiff --config=.cs.php",
47+
"cs:check": "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php",
4848
"cs:fix": "php-cs-fixer fix --config=.cs.php",
4949
"lint": "phplint ./ --exclude=vendor --no-interaction --no-cache",
5050
"phpstan": "phpstan analyse src --level=max -c phpstan.neon --no-progress --ansi",

phpstan.neon

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
parameters:
2+
reportUnmatchedIgnoredErrors: false
3+
ignoreErrors:
4+
- '#Cannot cast mixed to int.#'
5+
- '#Cannot cast mixed to string.#'
6+
- '#Cannot cast mixed to float.#'
7+
- '#Parameter \#1 \$time of class Cake\\Chronos\\Chronos constructor expects DateTimeInterface\|int\|string\|null, mixed given.#'
8+
- '#Cannot access offset string on mixed.#'

0 commit comments

Comments
 (0)