✏️ 编辑:ScalarType.php
路径:
/home/forge/kingkrunch.com/wp/wp-content/plugins/woocommerce/src/Api/Attributes/ScalarType.php
大小:793 B · 修改:2026-07-15 13:50:33 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php declare(strict_types=1); namespace Automattic\WooCommerce\Api\Attributes; use Attribute; /** * Overrides the GraphQL type for a property with a custom scalar. * * By default the builder maps PHP types to built-in GraphQL scalars (String, * Int, Float, Boolean). Use this attribute when a property should use a custom * scalar type instead, such as `DateTime`. * * Example: `#[ScalarType(DateTime::class)]` on a `?string $date_created` * property produces the GraphQL type `DateTime` instead of `String`. */ #[Attribute] final class ScalarType { /** * Constructor. * * @param string $type The fully-qualified class name of the custom scalar * (e.g. `DateTime::class`). */ public function __construct( public readonly string $type, ) { } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF