Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / http-kernel / Event / GetResponseForExceptionEvent.php
index 003953feac5139261f3db6d6f817dae19fa8f6a9..751b74515b48b23884b161f299df7cc222710342 100644 (file)
@@ -36,6 +36,11 @@ class GetResponseForExceptionEvent extends GetResponseEvent
      */
     private $exception;
 
+    /**
+     * @var bool
+     */
+    private $allowCustomResponseCode = false;
+
     public function __construct(HttpKernelInterface $kernel, Request $request, $requestType, \Exception $e)
     {
         parent::__construct($kernel, $request, $requestType);
@@ -64,4 +69,22 @@ class GetResponseForExceptionEvent extends GetResponseEvent
     {
         $this->exception = $exception;
     }
+
+    /**
+     * Mark the event as allowing a custom response code.
+     */
+    public function allowCustomResponseCode()
+    {
+        $this->allowCustomResponseCode = true;
+    }
+
+    /**
+     * Returns true if the event allows a custom response code.
+     *
+     * @return bool
+     */
+    public function isAllowingCustomResponseCode()
+    {
+        return $this->allowCustomResponseCode;
+    }
 }