Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ArgumentOutOfRangeException.php
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Rest\Exceptions
;
6
7
final
class
ArgumentOutOfRangeException
extends
ArgumentException
8
{
9
protected
mixed
$lowerLimit
;
10
protected
mixed
$upperLimit
;
11
12
public
function
__construct
(
string
$parameter
, mixed
$lowerLimit
=
null
, mixed
$upperLimit
=
null
, \Exception $previous =
null
)
13
{
14
if
(\is_array(
$lowerLimit
))
15
{
16
$message = sprintf(
"The value of an argument '%s' is outside the allowable range of values: %s"
,
$parameter
, implode(
", "
,
$lowerLimit
));
17
}
18
elseif ((
$lowerLimit
!==
null
) && (
$upperLimit
!==
null
))
19
{
20
$message = sprintf(
"The value of an argument '%s' is outside the allowable range of values: from %s to %s"
,
$parameter
,
$lowerLimit
,
$upperLimit
);
21
}
22
elseif ((
$lowerLimit
===
null
) && (
$upperLimit
!==
null
))
23
{
24
$message = sprintf(
"The value of an argument '%s' is outside the allowable range of values: not greater than %s"
,
$parameter
,
$upperLimit
);
25
}
26
elseif ((
$lowerLimit
!==
null
) && (
$upperLimit
===
null
))
27
{
28
$message = sprintf(
"The value of an argument '%s' is outside the allowable range of values: not less than %s"
,
$parameter
,
$lowerLimit
);
29
}
else
30
{
31
$message = sprintf(
"The value of an argument '%s' is outside the allowable range of values"
,
$parameter
);
32
}
33
34
$this->lowerLimit =
$lowerLimit
;
35
$this->upperLimit =
$upperLimit
;
36
37
parent::__construct($message,
$parameter
, $previous);
38
}
39
40
public
function
getLowerLimitType
(): mixed
41
{
42
return
$this->lowerLimit
;
43
}
44
45
public
function
getUpperType
(): mixed
46
{
47
return
$this->upperLimit
;
48
}
49
}
Bitrix\Rest\Exceptions\ArgumentException
Definition
ArgumentException.php:10
Bitrix\Rest\Exceptions\ArgumentException\$parameter
string $parameter
Definition
ArgumentException.php:11
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException
Definition
ArgumentOutOfRangeException.php:8
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException\__construct
__construct(string $parameter, mixed $lowerLimit=null, mixed $upperLimit=null, \Exception $previous=null)
Definition
ArgumentOutOfRangeException.php:12
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException\$lowerLimit
mixed $lowerLimit
Definition
ArgumentOutOfRangeException.php:9
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException\$upperLimit
mixed $upperLimit
Definition
ArgumentOutOfRangeException.php:10
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException\getUpperType
getUpperType()
Definition
ArgumentOutOfRangeException.php:45
Bitrix\Rest\Exceptions\ArgumentOutOfRangeException\getLowerLimitType
getLowerLimitType()
Definition
ArgumentOutOfRangeException.php:40
Bitrix\Rest\Exceptions
Definition
ArgumentException.php:5
modules
rest
lib
Exceptions
ArgumentOutOfRangeException.php
Создано системой
1.10.0