Skip to content

Commit

Permalink
bug #36899 [VarDumper] ReflectionFunction::isDisabled() is deprecated…
Browse files Browse the repository at this point in the history
… (derrabus)

This PR was merged into the 3.4 branch.

Discussion
----------

[VarDumper] ReflectionFunction::isDisabled() is deprecated

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #36872
| License       | MIT
| Doc PR        | N/A

See php/php-src#5473. Calling `ReflectionFunction::isDisabled()` is pointless on php 8 and doing so triggers a deprecation warning.

Someone who is more familiar with that component might want to have a second look on this PR. I'm not really sure if this is the right way to fix the issue.

Commits
-------

1da347e [VarDumper] ReflectionFunction::isDisabled() is deprecated.
  • Loading branch information
nicolas-grekas committed May 23, 2020
2 parents 42692d6 + 1da347e commit fb91dc2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php
Expand Up @@ -333,6 +333,10 @@ private static function addExtra(&$a, \Reflector $c)
private static function addMap(&$a, \Reflector $c, $map, $prefix = Caster::PREFIX_VIRTUAL)
{
foreach ($map as $k => $m) {
if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
continue;
}

if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) {
$a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m;
}
Expand Down

0 comments on commit fb91dc2

Please sign in to comment.