UndefinedFunctionError.php 897 B

123456789101112131415161718192021222324252627282930313233
  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\ErrorHandler\Error;
  11. class UndefinedFunctionError extends \Error
  12. {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function __construct(string $message, \Throwable $previous)
  17. {
  18. parent::__construct($message, $previous->getCode(), $previous->getPrevious());
  19. foreach ([
  20. 'file' => $previous->getFile(),
  21. 'line' => $previous->getLine(),
  22. 'trace' => $previous->getTrace(),
  23. ] as $property => $value) {
  24. $refl = new \ReflectionProperty(\Error::class, $property);
  25. $refl->setAccessible(true);
  26. $refl->setValue($this, $value);
  27. }
  28. }
  29. }