Skip to content

Commit

Permalink
Fix deprecated use of 'static' literal string in callable (#260)
Browse files Browse the repository at this point in the history
https://wiki.php.net/rfc/deprecate_partially_supported_callables
deprecates this in PHP 8.2 and it will be an error in PHP 9.0
(to use callables that could not be invoked as $callable())
  • Loading branch information
TysonAndre authored Jun 3, 2022
1 parent 4e22b65 commit af18046
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public static function isInstanceOfAny($value, array $classes, $message = '')
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected an instance of any of %2$s. Got: %s',
static::typeToString($value),
\implode(', ', \array_map(array('static', 'valueToString'), $classes))
\implode(', ', \array_map(array(static::class, 'valueToString'), $classes))
));
}

Expand Down Expand Up @@ -975,7 +975,7 @@ public static function inArray($value, array $values, $message = '')
static::reportInvalidArgument(\sprintf(
$message ?: 'Expected one of: %2$s. Got: %s',
static::valueToString($value),
\implode(', ', \array_map(array('static', 'valueToString'), $values))
\implode(', ', \array_map(array(static::class, 'valueToString'), $values))
));
}
}
Expand Down Expand Up @@ -1968,7 +1968,7 @@ public static function __callStatic($name, $arguments)
if ('nullOr' === \substr($name, 0, 6)) {
if (null !== $arguments[0]) {
$method = \lcfirst(\substr($name, 6));
\call_user_func_array(array('static', $method), $arguments);
\call_user_func_array(array(static::class, $method), $arguments);
}

return;
Expand All @@ -1983,7 +1983,7 @@ public static function __callStatic($name, $arguments)
foreach ($arguments[0] as $entry) {
$args[0] = $entry;

\call_user_func_array(array('static', $method), $args);
\call_user_func_array(array(static::class, $method), $args);
}

return;
Expand Down

0 comments on commit af18046

Please sign in to comment.