You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #35945 Leverage PHP8's get_debug_type() (nicolas-grekas)
This PR was merged into the 5.1-dev branch.
Discussion
----------
Leverage PHP8's get_debug_type()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
See symfony/polyfill#226 for background.
We might have to port part of the patch to 4.4 when we'll work on having it support PHP 8, but that's not needed for now.
Commits
-------
daf1c6605e Leverage PHP8's get_debug_type()
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, \gettype($callback)));
31
+
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, get_debug_type($callback)));
32
32
}
33
33
34
34
$lazyString = newstatic();
@@ -57,7 +57,7 @@ public static function fromCallable($callback, ...$arguments): self
57
57
publicstaticfunctionfromStringable($value): self
58
58
{
59
59
if (!self::isStringable($value)) {
60
-
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be a scalar or a stringable object, "%s" given.', __METHOD__, \is_object($value) ? \get_class($value) : \gettype($value)));
60
+
thrownew \TypeError(sprintf('Argument 1 passed to "%s()" must be a scalar or a stringable object, "%s" given.', __METHOD__, get_debug_type($value)));
61
61
}
62
62
63
63
if (\is_object($value)) {
@@ -143,7 +143,7 @@ private static function getPrettyName(callable $callback): string
0 commit comments