' . self::ORDER_ID . ') # UUID заказа ' . self::SEPARATOR . ' # разделитель [0-9]{14} # метка времени YmdHis (?:[A-Z0-9+\-]{1,6})? # пояс: MSK, +03 — не обязателен \z/x'; private function __construct() {} public static function build(string $orderId, ?DateTimeImmutable $now = null): string { $now ??= new DateTimeImmutable('now', core_date::get_server_timezone_object()); return $orderId . self::SEPARATOR . $now->format('YmdHisT'); } public static function parse(string $raw): ?string { return preg_match(self::PATTERN, $raw, $matches) === 1 ? $matches['id'] : null; } }