|
|
@@ -651,8 +651,40 @@ class Debugger
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Get the output format for Debugger error rendering.
|
|
|
+ *
|
|
|
+ * @return string Returns the current format when getting.
|
|
|
+ */
|
|
|
+ public static function getOutputAs()
|
|
|
+ {
|
|
|
+ $self = Debugger::getInstance();
|
|
|
+
|
|
|
+ return $self->_outputFormat;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the output format for Debugger error rendering.
|
|
|
+ *
|
|
|
+ * @param string $format The format you want errors to be output as.
|
|
|
+ * @return null
|
|
|
+ * @throws \InvalidArgumentException When choosing a format that doesn't exist.
|
|
|
+ */
|
|
|
+ public static function setOutputAs($format)
|
|
|
+ {
|
|
|
+ $self = Debugger::getInstance();
|
|
|
+
|
|
|
+ if (!isset($self->_templates[$format])) {
|
|
|
+ throw new InvalidArgumentException('Invalid Debugger output format.');
|
|
|
+ }
|
|
|
+ $self->_outputFormat = $format;
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Get/Set the output format for Debugger error rendering.
|
|
|
*
|
|
|
+ * @deprecated 3.5.0 Use getOutputAs()/setOutputAs() instead.
|
|
|
* @param string|null $format The format you want errors to be output as.
|
|
|
* Leave null to get the current format.
|
|
|
* @return string|null Returns null when setting. Returns the current format when getting.
|