Exemplo n.º 1
0
 /**
  * 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()
  */
 static public function setToStringException(Exception $e)
 {
   if (null === self::$toStringException)
   {
     self::$toStringException = $e;
   }
 }
Exemplo n.º 2
0
 /**
  * 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;
     }
 }