Ejemplo n.º 1
2
 /**
  * Creates new exception object
  *
  * @param string $parameter Argument that generates exception
  * @param string $requiredType Required type
  * @param \Exception $previous
  */
 public function __construct($parameter, $requiredType = "", \Exception $previous = null)
 {
     if (!empty($requiredType)) {
         $messageCode = "argument_type_real_exception_message";
         $messageParams = array("#PARAMETER#" => $parameter, "#REQUIRED_TYPE#" => $requiredType);
     } else {
         $messageCode = "argument_type_exception_message";
         $messageParams = array("#PARAMETER#" => $parameter);
     }
     $message = Loc::getMessage($messageCode, $messageParams);
     $this->requiredType = $requiredType;
     parent::__construct($message, $parameter, $previous);
 }
 /**
  * Creates new exception object
  *
  * @param string $parameter Argument that generates exception
  * @param string $requiredType Required type
  * @param \Exception $previous
  */
 public function __construct($parameter, $requiredType = "", \Exception $previous = null)
 {
     if (!empty($requiredType)) {
         $message = sprintf("The value of an argument '%s' must be of type %s", $parameter, $requiredType);
     } else {
         $message = sprintf("The value of an argument '%s' has an invalid type", $parameter);
     }
     $this->requiredType = $requiredType;
     parent::__construct($message, $parameter, $previous);
 }
Ejemplo n.º 3
0
 public function __construct($parameter, \Exception $previous = null)
 {
     $message = Loc::getMessage("argument_null_exception_message", array("#PARAMETER#" => $parameter));
     parent::__construct($message, $parameter, $previous);
 }