1
0
mirror of https://github.com/flarum/core.git synced 2025-08-03 15:07:53 +02:00

fix(phpstan): incompatibility with recent updates

This commit is contained in:
Sami Mazouz
2025-02-14 09:59:54 +01:00
parent d02a924bb8
commit 1b9ff2b6fa
4 changed files with 6 additions and 16 deletions

View File

@@ -171,7 +171,7 @@
"mockery/mockery": "^1.5",
"phpunit/phpunit": "^11.0",
"phpstan/phpstan": "^1.10.0",
"larastan/larastan": "2.9.12",
"larastan/larastan": "2.9.14",
"symfony/var-dumper": "^7.0",
"flarum/testing-tests": "*@dev"
},

View File

@@ -6,7 +6,7 @@
"require": {
"flarum/testing": "^2.0",
"phpstan/phpstan": "^1.10.0",
"larastan/larastan": "2.9.12"
"larastan/larastan": "2.9.14"
},
"autoload": {
"psr-4": {

View File

@@ -289,11 +289,6 @@ services:
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicMethodReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
class: Larastan\Larastan\ReturnTypes\NewModelQueryDynamicMethodReturnTypeExtension
tags:
@@ -304,11 +299,6 @@ services:
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
-
class: Larastan\Larastan\ReturnTypes\EnumerableGenericStaticMethodDynamicStaticMethodReturnTypeExtension
tags:
- phpstan.broker.dynamicStaticMethodReturnTypeExtension
-
class: Larastan\Larastan\Types\AbortIfFunctionTypeSpecifyingExtension
tags:

View File

@@ -15,12 +15,12 @@ parameters:
reportUnmatched: false
# We ignore this because resolve can either take a class name as the generic return type or just a binding name.
- message: "#Template type T of function resolve[()]{2} is not referenced in a parameter.#"
- message: "#Template type T of function resolve[\\(\\)]{2} is not referenced in a parameter.#"
reportUnmatched: false
# We ignore new static errors because we want extensibility.
# @TODO: needs discussion.
- message: "#^Unsafe usage of new static[()]{2}.$#"
- message: "#^Unsafe usage of new static[\\(\\)]{2}.$#"
reportUnmatched: false
- message: "#^Static access to instance property .*#"
reportUnmatched: false
@@ -34,11 +34,11 @@ parameters:
# and the implementation only accepts two of them, PHPStan complains.
# At the time of adding this error, there are no configuration values to make it
# ignore this error, so we have to ignore it globally.
- 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\.$#'
- 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\.$#'
reportUnmatched: false
# PHPStan suddenly doesn't recognize callables can be function names?
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of function [A-z0-9_:\\()]+ expects \(?callable\([A-z0-9_,|\\: ()-]+, ''[A-z0-9_:\\()]+'' given\.$#'
- message: '#^Parameter \#[0-9]+ \$[A-z0-9_]+ of function [A-z0-9_:\\\\(\\)]+ expects \(?callable\([A-z0-9_,|\\: \\(\\)-]+, ''[A-z0-9_:\\\\(\\)]+'' given\.$#'
reportUnmatched: false
# Not if we're using our own static make method.