/** * Sets an exception thrown by the __toString() method. * * This is a hack needed because PHP does not allow to throw exceptions in __toString() magic method. * * @param Exception $e The exception thrown by __toString() */ public static function setToStringException(Exception $e) { if (null === self::$toStringException) { self::$toStringException = $e; } }
/** * Sets an exception thrown by the __toString() method. * * This is a hack needed because PHP does not allow to throw exceptions in __toString() magic method. * * @param Exception $e The exception thrown by __toString() */ public static function setToStringException(Exception $e) { if (is_null(self::$toStringException)) { self::$toStringException = $e; } }