WpOrg\Requests\Exception
InvalidArgument::create
Create a new invalid argument exception with a standardized text.
Метод класса: InvalidArgument{}
Хуков нет.
Возвращает
\WpOrg\Requests\Exception\InvalidArgument.
Использование
$result = InvalidArgument::create( $position, $name, $expected, $received );
- $position(int) (обязательный)
- The argument position in the function signature. 1-based.
- $name(строка) (обязательный)
- The argument name in the function signature.
- $expected(строка) (обязательный)
- The argument type expected as a string.
- $received(строка) (обязательный)
- The actual argument type received.
Код InvalidArgument::create() InvalidArgument::create WP 7.1.5
public static function create($position, $name, $expected, $received) {
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
return new self(
sprintf(
'%s::%s(): Argument #%d (%s) must be of type %s, %s given',
$stack[1]['class'],
$stack[1]['function'],
$position,
$name,
$expected,
$received
)
);
}