Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ArgumentTypeException.php
1
<?php
2
3
declare(strict_types=1);
4
5
namespace
Bitrix\Rest\Exceptions
;
6
7
final
class
ArgumentTypeException
extends
ArgumentException
8
{
9
protected
mixed
$requiredType
;
10
11
public
function
__construct
(
string
$parameter
, mixed
$requiredType
=
''
, \Exception $previous =
null
)
12
{
13
if
(!empty(
$requiredType
))
14
{
15
$message = sprintf(
"The value of an argument '%s' must be of type %s"
,
$parameter
,
$requiredType
);
16
}
17
else
18
{
19
$message = sprintf(
"The value of an argument '%s' has an invalid type"
,
$parameter
);
20
}
21
22
$this->requiredType =
$requiredType
;
23
24
parent::__construct($message,
$parameter
, $previous);
25
}
26
27
public
function
getRequiredType
(): mixed
28
{
29
return
$this->requiredType
;
30
}
31
}
Bitrix\Rest\Exceptions\ArgumentException
Definition
ArgumentException.php:10
Bitrix\Rest\Exceptions\ArgumentException\$parameter
string $parameter
Definition
ArgumentException.php:11
Bitrix\Rest\Exceptions\ArgumentTypeException
Definition
ArgumentTypeException.php:8
Bitrix\Rest\Exceptions\ArgumentTypeException\__construct
__construct(string $parameter, mixed $requiredType='', \Exception $previous=null)
Definition
ArgumentTypeException.php:11
Bitrix\Rest\Exceptions\ArgumentTypeException\getRequiredType
getRequiredType()
Definition
ArgumentTypeException.php:27
Bitrix\Rest\Exceptions\ArgumentTypeException\$requiredType
mixed $requiredType
Definition
ArgumentTypeException.php:9
Bitrix\Rest\Exceptions
Definition
ArgumentException.php:5
modules
rest
lib
Exceptions
ArgumentTypeException.php
Создано системой
1.10.0