ProxyManagerCaster.php 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\VarDumper\Caster;
  11. use ProxyManager\Proxy\ProxyInterface;
  12. use Symfony\Component\VarDumper\Cloner\Stub;
  13. /**
  14. * @author Nicolas Grekas <p@tchwork.com>
  15. *
  16. * @final
  17. *
  18. * @internal since Symfony 7.3
  19. */
  20. class ProxyManagerCaster
  21. {
  22. public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested): array
  23. {
  24. if ($parent = get_parent_class($c)) {
  25. $stub->class .= ' - '.$parent;
  26. }
  27. $stub->class .= '@proxy';
  28. return $a;
  29. }
  30. }