summaryrefslogtreecommitdiff
path: root/vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php')
-rw-r--r--vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php b/vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php
new file mode 100644
index 00000000..40a5fb7f
--- /dev/null
+++ b/vendor/symfony/debug/Tests/Fixtures/ToStringThrower.php
@@ -0,0 +1,24 @@
+<?php
+
+namespace Symfony\Component\Debug\Tests\Fixtures;
+
+class ToStringThrower
+{
+ private $exception;
+
+ public function __construct(\Exception $e)
+ {
+ $this->exception = $e;
+ }
+
+ public function __toString()
+ {
+ try {
+ throw $this->exception;
+ } catch (\Exception $e) {
+ // Using user_error() here is on purpose so we do not forget
+ // that this alias also should work alongside with trigger_error().
+ return user_error($e, E_USER_ERROR);
+ }
+ }
+}