當前位置: 首頁>>代碼示例>>PHP>>正文


PHP InvalidArgumentException::__construct方法代碼示例

本文整理匯總了PHP中InvalidArgumentException::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP InvalidArgumentException::__construct方法的具體用法?PHP InvalidArgumentException::__construct怎麽用?PHP InvalidArgumentException::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在InvalidArgumentException的用法示例。


在下文中一共展示了InvalidArgumentException::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @inheritdoc
  */
 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     if (empty($message)) {
         $message = 'Invalid argument value.';
     }
     parent::__construct($message, $code, $previous);
 }
開發者ID:krixon,項目名稱:exceptions,代碼行數:10,代碼來源:InvalidArgumentValueException.php

示例2: __construct

 /**
  * @param string $message
  * @param \Exception $previous
  */
 public function __construct($message = null, \Exception $previous = null)
 {
     if (empty($message)) {
         $message = 'Listeners must implements EventListenerInterface';
     }
     parent::__construct($message, $previous);
 }
開發者ID:dw250100785,項目名稱:gitlab-webhook,代碼行數:11,代碼來源:InvalidListenerException.php

示例3: __construct

 public function __construct($name, $value, $expected)
 {
     if (!is_string($name)) {
         throw new InvalidArgumentException("Not a string: name");
     }
     if (!is_string($expected)) {
         throw new InvalidArgumentException("Not a string: expected");
     }
     $lead = "Invalid";
     if (NULL === $value) {
         $lead = "Not set";
     }
     $type = gettype($value);
     $got_msg = $type;
     if (is_object($value)) {
         $class = get_class($value);
         $got_msg = "{$type} ({$class})";
     }
     $this->name = $name;
     $this->type = $type;
     $this->expected = $expected;
     $this->message = $msg;
     $msg = "{$lead}: {$name} - Got: {$got_msg} - Expected: {$expected}";
     parent::__construct($msg, 0);
 }
開發者ID:hovenko,項目名稱:Madcow,代碼行數:25,代碼來源:InvalidArgumentException.php

示例4: __construct

 public function __construct($message = "", $code = 0, Exception $previous = null)
 {
     if (empty($message)) {
         $message = 'The specified file pointer is not a valid stream resource';
     }
     parent::__construct($message, $code, $previous);
 }
開發者ID:akeeba,項目名稱:s3,代碼行數:7,代碼來源:InvalidFilePointer.php

示例5: __construct

 public function __construct($message = "", $code = 500, Exception $previous = null)
 {
     if (empty($message)) {
         $message = \JText::_('LIB_FOF_MODEL_ERR_FILTER_INVALIDFIELD');
     }
     parent::__construct($message, $code, $previous);
 }
開發者ID:Joal01,項目名稱:fof,代碼行數:7,代碼來源:InvalidFieldObject.php

示例6: __construct

 public function __construct($message, $code, $propertyPath = null, $value, array $constraints = array())
 {
     parent::__construct($message, $code);
     $this->propertyPath = $propertyPath;
     $this->value = $value;
     $this->constraints = $constraints;
 }
開發者ID:GerDner,項目名稱:luck-docker,代碼行數:7,代碼來源:InvalidArgumentException.php

示例7: __construct

 /**
  * Constructor.
  *
  * @param string $name
  * @param array  $alternatives
  */
 public function __construct($name, array $alternatives = array())
 {
     $this->name = $name;
     $this->alternatives = $alternatives;
     parent::__construct('');
     $this->update();
 }
開發者ID:borobudur-php,項目名稱:borobudur-di,代碼行數:13,代碼來源:ParameterNotFoundException.php

示例8: __construct

 /**
  * Construct the exception with a type.
  * Use type from self constants.
  *
  * @param string     $type
  * @param int        $code
  * @param \Exception $previous
  */
 public function __construct($type, $code = 0, \Exception $previous = null)
 {
     if ($type != self::ROW || $type != self::COLUMN) {
         throw new parent(sprintf("Type must be %s or %s.", self::ROW, self::COLUMN));
     }
     parent::__construct(sprintf("%s number must be lower or equal than max %s number -1 and higher or equal than Zero.", lcfirst($type), $type), $code, $previous);
 }
開發者ID:skillberto,項目名稱:config,代碼行數:15,代碼來源:InvalidNumberException.php

示例9: __construct

 /**
  * Constructor.
  *
  * @param mixed        $value
  * @param string|array $expectedType
  */
 public function __construct($value, $expectedType)
 {
     if (is_array($expectedType)) {
         $expectedType = implode('", "', $expectedType);
     }
     parent::__construct(sprintf('Expected argument of type "%s", "%s" given', $expectedType, is_object($value) ? get_class($value) : gettype($value)));
 }
開發者ID:rollerworks,項目名稱:search,代碼行數:13,代碼來源:UnexpectedTypeException.php

示例10: __construct

 public function __construct($message = null)
 {
     if ($message === null) {
         $message = 'The parameter must be a non empty string';
     }
     parent::__construct($message);
 }
開發者ID:alpixel,項目名稱:AlpixelMenuBundle,代碼行數:7,代碼來源:LocaleException.php

示例11: __construct

 public function __construct($message = null)
 {
     if (null === $message) {
         $message = t('Соединение с БД не установлено.');
     }
     return parent::__construct($message);
 }
開發者ID:umonkey,項目名稱:molinos-cms,代碼行數:7,代碼來源:exception.notconnected.php

示例12: __construct

 /**
  * This function instantiates the exception with the specified message,
  * variables, and code.
  *
  * @access public
  * @param string $message                        the message
  * @param array $variables                       the variables
  * @param integer $code                          the code
  * @return Throwable_InvalidArgument_Exception   the exception
  */
 public function __construct($message, array $variables = NULL, $code = 0)
 {
     // Set the message
     $message = __($message, $variables);
     // Pass the message to the parent
     parent::__construct($message, $code);
 }
開發者ID:ruslankus,項目名稱:invoice-crm,代碼行數:17,代碼來源:Exception.php

示例13: __construct

 public function __construct($file, $line, $message)
 {
     parent::__construct();
     $this->file = $file;
     $this->line = $line;
     $this->message = $message;
 }
開發者ID:phpml,項目名稱:phpml,代碼行數:7,代碼來源:InvalidArgumentException.php

示例14: __construct

 public function __construct(\ReflectionParameter $parameter, $message = null, $code = null, \Exception $previous = null)
 {
     if (null === $message) {
         $message = sprintf('Unable to resolve argument $%s (#%d) of %s.', $parameter->name, $parameter->getPosition(), static::getFunctionName($parameter->getDeclaringFunction()));
     }
     parent::__construct($message, $code, $previous);
 }
開發者ID:rybakit,項目名稱:arguments-resolver,代碼行數:7,代碼來源:UnresolvableArgumentException.php

示例15: __construct

 public function __construct($message, array $errors, Exception $previous = null)
 {
     $flatErrors = iterator_to_array(new RecursiveIteratorIterator(new RecursiveArrayIterator($errors)), false);
     $message = $message . ":\n" . implode("\n", $flatErrors);
     parent::__construct($message, 0, $previous);
     $this->setErrors($errors);
 }
開發者ID:tobiasziegler,項目名稱:platform,代碼行數:7,代碼來源:ValidatorException.php


注:本文中的InvalidArgumentException::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。