Skip to content

Commit 4057112

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 69ae809 commit 4057112

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

phpstan.dist.neon

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,12 @@ parameters:
4848
reportUnmatched: false
4949
count: 2
5050
path: src/Replicator/Container.php
51+
52+
-
53+
# https://github.com/nette/forms/pull/354
54+
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\.$#'
55+
identifier: argument.type
56+
# Only occurs with forms ≥ 3.3.0
57+
reportUnmatched: false
58+
count: 1
59+
path: src/Replicator/Container.php

0 commit comments

Comments
 (0)