Skip to content

Commit 3f4689a

Browse files
committed
allow 0 args for int and mixed filter
1 parent 0130a4e commit 3f4689a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Plugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,9 @@ public static function getFunctionParams( FunctionParamsProviderEvent $event ) :
10441044
$return_type = $hook['types'][0];
10451045

10461046
// for bool we can use 0, so "__return_true" and "__return_false" can be used without error, as for bool only (!) filters the previous value doesn't matter
1047-
if ( $return_type->isBool() ) {
1047+
// allow this for "mixed" too, since it could be bool and we don't want to force types on badly/non-documented filters
1048+
// same for single int type, where any previously filtered in values are often irrelevant
1049+
if ( $return_type->isBool() || $return_type->isMixed() || $return_type->isInt() ) {
10481050
$min_args = 0;
10491051
}
10501052
} else {

0 commit comments

Comments
 (0)