本文整理汇总了PHP中RuntimeException::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP RuntimeException::__construct方法的具体用法?PHP RuntimeException::__construct怎么用?PHP RuntimeException::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RuntimeException
的用法示例。
在下文中一共展示了RuntimeException::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param \Exception $e
* @param \Carrooi\Doctrine\Entities\BaseEntity $entity
* @param string $column
* @param mixed $value
*/
public function __construct(Exception $e, BaseEntity $entity, $column, $value)
{
$this->entity = $entity;
$this->column = $column;
$this->value = $value;
parent::__construct($e->getMessage(), $e->getCode(), $e);
}
示例2: __construct
public function __construct($method, array $allowedMethods, \Exception $previous = null)
{
$message = sprintf('Method "%s" is not allowed and must be one of "%s".', $method, implode(', ', $allowedMethods));
parent::__construct($message, 0, $previous);
$this->method = $method;
$this->allowedMethods = $allowedMethods;
}
示例3: __construct
/**
* Public constructor.
*/
public function __construct()
{
$message = 'You must authenticate to access this resource.';
$code = 401;
$this->statusCode = $code;
parent::__construct($message, $code);
}
示例4: __construct
/**
*
* @param string $message
* @param integer $statusCode
* @param \Exception $previous
* @param array $errors
* @param array $headers
*/
public function __construct($message, $statusCode = 0, \Exception $previous = null, array $errors = [], array $headers = [])
{
$this->statusCode = $statusCode;
$this->headers = $headers;
$this->errors = $errors;
parent::__construct($message, $statusCode, $previous);
}
示例5: __construct
public function __construct($message = "", $code = 403, Exception $previous = null)
{
if (empty($message)) {
$message = \JText::_('LIB_FOF_VIEW_POSSIBLYSUHOSIN');
}
parent::__construct($message, $code, $previous);
}
示例6: WrongTypeException
public function WrongTypeException($msg = null)
{
if (is_null($msg)) {
$msg = "Tipo inválido";
}
parent::__construct($msg);
}
示例7: __construct
/**
* Create an exception based on LibXMLError objects
*
* @param array $errors Array of LibXMLError objects
* @see http://www.php.net/manual/en/class.libxmlerror.php
*/
public function __construct(array $errors)
{
$numErrors = count($errors);
if (1 == $numErrors) {
$message = "An error occurred ";
} elseif ($numErrors > 1) {
$message = "Some errors occurred ";
}
$message .= "while parsing XML configuration file:\n";
foreach ($errors as $error) {
$message .= " - ";
switch ($error->level) {
case LIBXML_ERR_WARNING:
$message .= "Warning {$error->code}: ";
break;
case LIBXML_ERR_ERROR:
$message .= "Error {$error->code}: ";
break;
case LIBXML_ERR_FATAL:
$message .= "Fatal Error {$error->code}: ";
break;
}
$message .= $error->message;
}
parent::__construct($message);
}
示例8: __construct
/**
* @param string $message
* @param string $actorId
* @param \DateTimeInterface $sinceDate
* @param \DateTimeInterface $actualDate
*/
public function __construct($message, $actorId, \DateTimeInterface $sinceDate, \DateTimeInterface $actualDate)
{
parent::__construct($message);
$this->actorId = $actorId;
$this->sinceDate = $sinceDate;
$this->actualDate = $actualDate;
}
示例9: __construct
/**
* Creates an instance.
*
* @param string $optionKey
* @param int $target
* @param \Exception $previous
*/
public function __construct($optionKey, $target, \Exception $previous = null)
{
$this->optionKey = $optionKey;
$this->target = $target;
$message = sprintf('Missing value for option "%s" in "%s"', $optionKey, $this->getTargetFQCN());
parent::__construct($message, 0, $previous);
}
示例10: __construct
public function __construct($message = NULL, $code = 0, \Exception $previous = NULL)
{
if (!isset($message)) {
$message = "rowCount() is supported for DELETE, INSERT, or UPDATE statements performed with structured query builders only, since they would not be portable across database engines otherwise. If the query builders are not sufficient, set the 'return' option to Database::RETURN_AFFECTED to get the number of affected rows.";
}
parent::__construct($message, $code, $previous);
}
示例11: __construct
public function __construct($errorCode, $message, $requestId, $hostId)
{
parent::__construct($message);
$this->requestId = $requestId;
$this->hostId = $hostId;
$this->errorCode = $errorCode;
}
示例12: App42Exception3
public function App42Exception3($detailMessage, $httpErrorCode, $appErrorCode)
{
$this->detailMessage = $detailMessage;
$this->httpErrorCode = $httpErrorCode;
$this->appErrorCode = $appErrorCode;
return parent::__construct($detailMessage, $httpErrorCode);
}
示例13: __construct
public function __construct($name, $value = null, $message = null, $code = 0, \Exception $prevException = null)
{
$this->argumentName = $name;
$this->argumentValue = $value;
$message = $message ?: sprintf('The argument for "%s" is invalid.', $name);
parent::__construct($message, $code, $prevException);
}
示例14: __construct
public function __construct($invalidHelper, array $supportedHelpers, \Exception $previous = null)
{
$message = sprintf('Unsupported helper "%s". It must be one of %s.', $invalidHelper, implode(', ', $supportedHelpers));
parent::__construct($message, 0, $previous);
$this->invalidHelper = $invalidHelper;
$this->supportedHelpers = $supportedHelpers;
}
示例15: WrongTypeException
public function WrongTypeException($msg = null)
{
if ($msg == null) {
$msg = "Esta planilha contem um formato inválido de acordo com os padrões definidos.";
}
parent::__construct($msg);
}