Skip to content

Commit 8c1c4d0

Browse files
committed
fix(phpstan): incompatibility with recent updates
1 parent 6c5e6e6 commit 8c1c4d0

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"require": {
77
"flarum/testing": "^2.0",
88
"phpstan/phpstan": "^1.10.0",
9-
"larastan/larastan": "2.9.12"
9+
"larastan/larastan": "2.9.14"
1010
},
1111
"autoload": {
1212
"psr-4": {

larastan-extension.neon

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,6 @@ services:
289289
tags:
290290
- phpstan.broker.dynamicMethodReturnTypeExtension
291291

292-
-
293-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicMethodReturnTypeExtension
294-
tags:
295-
- phpstan.broker.dynamicMethodReturnTypeExtension
296-
297292
-
298293
class: Larastan\Larastan\ReturnTypes\NewModelQueryDynamicMethodReturnTypeExtension
299294
tags:
@@ -304,11 +299,6 @@ services:
304299
tags:
305300
- phpstan.broker.dynamicMethodReturnTypeExtension
306301

307-
-
308-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicStaticMethodReturnTypeExtension
309-
tags:
310-
- phpstan.broker.dynamicStaticMethodReturnTypeExtension
311-
312302
-
313303
class: Larastan\Larastan\Types\AbortIfFunctionTypeSpecifyingExtension
314304
tags:

phpstan-baseline.neon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ parameters:
1515
reportUnmatched: false
1616

1717
# We ignore this because resolve can either take a class name as the generic return type or just a binding name.
18-
- message: "#Template type T of function resolve[()]{2} is not referenced in a parameter.#"
18+
- message: "#Template type T of function resolve[\\(\\)]{2} is not referenced in a parameter.#"
1919
reportUnmatched: false
2020

2121
# We ignore new static errors because we want extensibility.
2222
# @TODO: needs discussion.
23-
- message: "#^Unsafe usage of new static[()]{2}.$#"
23+
- message: "#^Unsafe usage of new static[\\(\\)]{2}.$#"
2424
reportUnmatched: false
2525
- message: "#^Static access to instance property .*#"
2626
reportUnmatched: false
@@ -34,11 +34,11 @@ parameters:
3434
# and the implementation only accepts two of them, PHPStan complains.
3535
# At the time of adding this error, there are no configuration values to make it
3636
# ignore this error, so we have to ignore it globally.
37-
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of method Flarum\Extend\[A-z0-9_:\\()]+ expects \(?callable\([A-z0-9_,|\\: ()-]+\)\)?, (callable|Closure)\([A-z0-9_,|\\: ()-]+\) given\.$#'
37+
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of method Flarum\Extend\[A-z0-9_:\\\\(\\)]+ expects \(?callable\([A-z0-9_,|\\: \\(\\)-]+\)\)?, (callable|Closure)\([A-z0-9_,|\\: \\(\\)-]+\) given\.$#'
3838
reportUnmatched: false
3939

4040
# PHPStan suddenly doesn't recognize callables can be function names?
41-
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of function [A-z0-9_:\\()]+ expects \(?callable\([A-z0-9_,|\\: ()-]+, ''[A-z0-9_:\\()]+'' given\.$#'
41+
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of function [A-z0-9_:\\\\(\\)]+ expects \(?callable\([A-z0-9_,|\\: \\(\\)-]+, ''[A-z0-9_:\\\\(\\)]+'' given\.$#'
4242
reportUnmatched: false
4343

4444
# Not if we're using our own static make method.

0 commit comments

Comments
 (0)