SilencedErrorContext.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\Debug\Exception;
  11. /**
  12. * Data Object that represents a Silenced Error.
  13. *
  14. * @author Grégoire Pineau <lyrixx@lyrixx.info>
  15. */
  16. class SilencedErrorContext implements \JsonSerializable
  17. {
  18. private $severity;
  19. private $file;
  20. private $line;
  21. public function __construct($severity, $file, $line)
  22. {
  23. $this->severity = $severity;
  24. $this->file = $file;
  25. $this->line = $line;
  26. }
  27. public function getSeverity()
  28. {
  29. return $this->severity;
  30. }
  31. public function getFile()
  32. {
  33. return $this->file;
  34. }
  35. public function getLine()
  36. {
  37. return $this->line;
  38. }
  39. public function JsonSerialize()
  40. {
  41. return array(
  42. 'severity' => $this->severity,
  43. 'file' => $this->file,
  44. 'line' => $this->line,
  45. );
  46. }
  47. }