Skip to content

Commit 17bec50

Browse files
committed
phpstan: Suppress extensionMethod parameter type mismatch
We are passing a function that has extra arguments compared to the `callable` in `extensionMethod` parameter type. Since a function with extra arguments is a supertype of a function without them, not a subtype, it will be rejected as per contravariance of arguments rule. See nette/forms#354 Let’s ignore it for now.
1 parent f86924c commit 17bec50

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

phpstan-baseline.neon

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ parameters:
2424
reportUnmatched: false
2525
count: 2
2626
path: src/Replicator/Container.php
27+
28+
-
29+
# https://github.com/nette/forms/pull/354
30+
message: '#^Parameter \#2 \$callback of static method Nette\\Forms\\Container\:\:extensionMethod\(\) expects callable\(static\)\: mixed, Closure\(Nette\\Forms\\Container, string, callable, int\=, bool\=\)\: static given\.$#'
31+
identifier: argument.type
32+
# Only occurs with forms ≥ 3.3.0
33+
reportUnmatched: false
34+
count: 1
35+
path: src/Replicator/Container.php

0 commit comments

Comments
 (0)