UndefinedMethodError.php 818 B

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