diff --git a/cron/ticket_email_parser.php b/cron/ticket_email_parser.php new file mode 100644 index 00000000..0cf570af --- /dev/null +++ b/cron/ticket_email_parser.php @@ -0,0 +1,536 @@ + Ticketing > Email-to-ticket parsing. See https://docs.itflow.org/ticket_email_parse -- Quitting.."); +} + +// System temp directory & lock +$temp_dir = sys_get_temp_dir(); +$lock_file_path = "{$temp_dir}/itflow_email_parser_{$installation_id}.lock"; + +if (file_exists($lock_file_path)) { + $file_age = time() - filemtime($lock_file_path); + if ($file_age > 300) { + unlink($lock_file_path); + logApp("Cron-Email-Parser", "warning", "Cron Email Parser detected a lock file was present but was over 5 minutes old so it removed it."); + } else { + logApp("Cron-Email-Parser", "warning", "Lock file present. Cron Email Parser attempted to execute but was already executing, so instead it terminated."); + exit("Script is already running. Exiting."); + } +} +file_put_contents($lock_file_path, "Locked"); + +// Ensure lock gets removed even on fatal error +register_shutdown_function(function() use ($lock_file_path) { + if (file_exists($lock_file_path)) { + @unlink($lock_file_path); + } +}); + +// Allowed attachment extensions +$allowed_extensions = array('jpg', 'jpeg', 'gif', 'png', 'webp', 'pdf', 'txt', 'md', 'doc', 'docx', 'csv', 'xls', 'xlsx', 'xlsm', 'zip', 'tar', 'gz'); + +/** ------------------------------------------------------------------ + * Ticket / Reply helpers (unchanged) + * ------------------------------------------------------------------ */ +function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message, $attachments, $original_message_file) { + global $mysqli, $config_app_name, $company_name, $company_phone, $config_ticket_prefix, $config_ticket_client_general_notifications, $config_ticket_new_ticket_notification_email, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $config_ticket_default_billable, $allowed_extensions; + + $ticket_number_sql = mysqli_fetch_array(mysqli_query($mysqli, "SELECT config_ticket_next_number FROM settings WHERE company_id = 1")); + $ticket_number = intval($ticket_number_sql['config_ticket_next_number']); + $new_config_ticket_next_number = $ticket_number + 1; + mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1"); + + // Clean up the message + $message = trim($message); + $message = preg_replace('/\s+/', ' ', $message); + $message = nl2br($message); + $message = "Email from: $contact_name <$contact_email> at $date:-

$message
"; + + $ticket_prefix_esc = mysqli_real_escape_string($mysqli, $config_ticket_prefix); + $message_esc = mysqli_real_escape_string($mysqli, $message); + $contact_email_esc = mysqli_real_escape_string($mysqli, $contact_email); + $client_id = intval($client_id); + + $url_key = randomString(156); + + mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$ticket_prefix_esc', ticket_number = $ticket_number, ticket_source = 'Email', ticket_subject = '$subject', ticket_details = '$message_esc', ticket_priority = 'Low', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = 0, ticket_contact_id = $contact_id, ticket_url_key = '$url_key', ticket_client_id = $client_id"); + $id = mysqli_insert_id($mysqli); + + // Logging + logAction("Ticket", "Create", "Email parser: Client contact $contact_email_esc created ticket $ticket_prefix_esc$ticket_number ($subject) ($id)", $client_id, $id); + + mkdirMissing('../uploads/tickets/'); + $att_dir = "../uploads/tickets/" . $id . "/"; + mkdirMissing($att_dir); + + // Move original .eml into the ticket folder + rename("../uploads/tmp/{$original_message_file}", "{$att_dir}/{$original_message_file}"); + $original_message_file_esc = mysqli_real_escape_string($mysqli, $original_message_file); + mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = 'Original-parsed-email.eml', ticket_attachment_reference_name = '$original_message_file_esc', ticket_attachment_ticket_id = $id"); + + // Save non-inline attachments + foreach ($attachments as $attachment) { + $att_name = $attachment['name']; + $att_extension = strtolower(pathinfo($att_name, PATHINFO_EXTENSION)); + + if (in_array($att_extension, $allowed_extensions)) { + $att_saved_filename = md5(uniqid(rand(), true)) . '.' . $att_extension; + $att_saved_path = $att_dir . $att_saved_filename; + file_put_contents($att_saved_path, $attachment['content']); + + $ticket_attachment_name = sanitizeInput($att_name); + $ticket_attachment_reference_name = sanitizeInput($att_saved_filename); + + $ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $ticket_attachment_name); + $ticket_attachment_reference_name_esc = mysqli_real_escape_string($mysqli, $ticket_attachment_reference_name); + mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_ticket_id = $id"); + } else { + $ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name); + logAction("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $contact_email_esc for ticket $ticket_prefix_esc$ticket_number", $client_id, $id); + } + } + + // Guest ticket watchers + if ($client_id == 0) { + mysqli_query($mysqli, "INSERT INTO ticket_watchers SET watcher_email = '$contact_email_esc', watcher_ticket_id = $id"); + } + + $data = []; + if ($config_ticket_client_general_notifications == 1) { + $subject_email = "Ticket created - [$config_ticket_prefix$ticket_number] - $subject"; + $body = "##- Please type your reply above this line -##

Hello $contact_name,

Thank you for your email. A ticket regarding \"$subject\" has been automatically created for you.

Ticket: $config_ticket_prefix$ticket_number
Subject: $subject
Status: New
Portal: View ticket

--
$company_name - Support
$config_ticket_from_email
$company_phone"; + $data[] = [ + 'from' => $config_ticket_from_email, + 'from_name' => $config_ticket_from_name, + 'recipient' => $contact_email, + 'recipient_name' => $contact_name, + 'subject' => $subject_email, + 'body' => mysqli_real_escape_string($mysqli, $body) + ]; + } + + if ($config_ticket_new_ticket_notification_email) { + if ($client_id == 0) { + $client_name = "Guest"; + } else { + $client_sql = mysqli_query($mysqli, "SELECT client_name FROM clients WHERE client_id = $client_id"); + $client_row = mysqli_fetch_array($client_sql); + $client_name = sanitizeInput($client_row['client_name']); + } + $email_subject = "$config_app_name - New Ticket - $client_name: $subject"; + $email_body = "Hello,

This is a notification that a new ticket has been raised in ITFlow.
Client: $client_name
Priority: Low (email parsed)
Link: https://$config_base_url/ticket.php?ticket_id=$id

--------------------------------

$subject
$message"; + + $data[] = [ + 'from' => $config_ticket_from_email, + 'from_name' => $config_ticket_from_name, + 'recipient' => $config_ticket_new_ticket_notification_email, + 'recipient_name' => $config_ticket_from_name, + 'subject' => $email_subject, + 'body' => mysqli_real_escape_string($mysqli, $email_body) + ]; + } + + addToMailQueue($data); + customAction('ticket_create', $id); + + return true; +} + +function addReply($from_email, $date, $subject, $ticket_number, $message, $attachments) { + global $mysqli, $config_app_name, $company_name, $company_phone, $config_ticket_prefix, $config_base_url, $config_ticket_from_name, $config_ticket_from_email, $allowed_extensions; + + $ticket_reply_type = 'Client'; + $message_parts = explode("##- Please type your reply above this line -##", $message); + $message_body = $message_parts[0]; + $message_body = trim($message_body); + $message_body = preg_replace('/\r\n|\r|\n/', ' ', $message_body); + $message_body = nl2br($message_body); + + $message = "Email from: $from_email at $date:-

$message_body
"; + + $ticket_number_esc = intval($ticket_number); + $message_esc = mysqli_real_escape_string($mysqli, $message); + $from_email_esc = mysqli_real_escape_string($mysqli, $from_email); + + $row = mysqli_fetch_array(mysqli_query($mysqli, "SELECT ticket_id, ticket_subject, ticket_status, ticket_contact_id, ticket_client_id, contact_email, client_name + FROM tickets + LEFT JOIN contacts on tickets.ticket_contact_id = contacts.contact_id + LEFT JOIN clients on tickets.ticket_client_id = clients.client_id + WHERE ticket_number = $ticket_number_esc LIMIT 1")); + + if ($row) { + $ticket_id = intval($row['ticket_id']); + $ticket_subject = sanitizeInput($row['ticket_subject']); + $ticket_status = sanitizeInput($row['ticket_status']); + $ticket_reply_contact = intval($row['ticket_contact_id']); + $ticket_contact_email = sanitizeInput($row['contact_email']); + $client_id = intval($row['ticket_client_id']); + $client_name = sanitizeInput($row['client_name']); + + if ($ticket_status == 5) { + $config_ticket_prefix_esc = mysqli_real_escape_string($mysqli, $config_ticket_prefix); + $ticket_number_esc2 = mysqli_real_escape_string($mysqli, $ticket_number); + + appNotify("Ticket", "Email parser: $from_email attempted to re-open ticket $config_ticket_prefix_esc$ticket_number_esc2 (ID $ticket_id) - check inbox manually to see email", "ticket.php?ticket_id=$ticket_id", $client_id); + + $email_subject = "Action required: This ticket is already closed"; + $email_body = "Hi there,

You've tried to reply to a ticket that is closed - we won't see your response.

Please raise a new ticket by sending a new e-mail to our support address below.

--
$company_name - Support
$config_ticket_from_email
$company_phone"; + + $data = [ + [ + 'from' => $config_ticket_from_email, + 'from_name' => $config_ticket_from_name, + 'recipient' => $from_email, + 'recipient_name' => $from_email, + 'subject' => $email_subject, + 'body' => mysqli_real_escape_string($mysqli, $email_body) + ] + ]; + + addToMailQueue($data); + return true; + } + + if (empty($ticket_contact_email) || $ticket_contact_email !== $from_email) { + $from_email_esc2 = mysqli_real_escape_string($mysqli, $from_email); + $row2 = mysqli_fetch_array(mysqli_query($mysqli, "SELECT contact_id FROM contacts WHERE contact_email = '$from_email_esc2' AND contact_client_id = $client_id LIMIT 1")); + if ($row2) { + $ticket_reply_contact = intval($row2['contact_id']); + } else { + $ticket_reply_type = 'Internal'; + $ticket_reply_contact = '0'; + $message = "WARNING: Contact email mismatch
$message"; + $message_esc = mysqli_real_escape_string($mysqli, $message); + } + } + + mysqli_query($mysqli, "INSERT INTO ticket_replies SET ticket_reply = '$message_esc', ticket_reply_type = '$ticket_reply_type', ticket_reply_time_worked = '00:00:00', ticket_reply_by = $ticket_reply_contact, ticket_reply_ticket_id = $ticket_id"); + $reply_id = mysqli_insert_id($mysqli); + + $ticket_dir = "../uploads/tickets/" . $ticket_id . "/"; + mkdirMissing($ticket_dir); + + foreach ($attachments as $attachment) { + $att_name = $attachment['name']; + $att_extension = strtolower(pathinfo($att_name, PATHINFO_EXTENSION)); + + if (in_array($att_extension, $allowed_extensions)) { + $att_saved_filename = md5(uniqid(rand(), true)) . '.' . $att_extension; + $att_saved_path = $ticket_dir . $att_saved_filename; + file_put_contents($att_saved_path, $attachment['content']); + + $ticket_attachment_name = sanitizeInput($att_name); + $ticket_attachment_reference_name = sanitizeInput($att_saved_filename); + + $ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $ticket_attachment_name); + $ticket_attachment_reference_name_esc = mysqli_real_escape_string($mysqli, $ticket_attachment_reference_name); + mysqli_query($mysqli, "INSERT INTO ticket_attachments SET ticket_attachment_name = '$ticket_attachment_name_esc', ticket_attachment_reference_name = '$ticket_attachment_reference_name_esc', ticket_attachment_reply_id = $reply_id, ticket_attachment_ticket_id = $ticket_id"); + } else { + $ticket_attachment_name_esc = mysqli_real_escape_string($mysqli, $att_name); + logAction("Ticket", "Edit", "Email parser: Blocked attachment $ticket_attachment_name_esc from Client contact $from_email_esc for ticket $config_ticket_prefix$ticket_number_esc", $client_id, $ticket_id); + } + } + + $ticket_assigned_to_sql = mysqli_query($mysqli, "SELECT ticket_assigned_to FROM tickets WHERE ticket_id = $ticket_id LIMIT 1"); + if ($ticket_assigned_to_sql) { + $row3 = mysqli_fetch_array($ticket_assigned_to_sql); + $ticket_assigned_to = intval($row3['ticket_assigned_to']); + + if ($ticket_assigned_to) { + $tech_sql = mysqli_query($mysqli, "SELECT user_email, user_name FROM users WHERE user_id = $ticket_assigned_to LIMIT 1"); + $tech_row = mysqli_fetch_array($tech_sql); + $tech_email = sanitizeInput($tech_row['user_email']); + $tech_name = sanitizeInput($tech_row['user_name']); + + $email_subject = "$config_app_name - Ticket updated - [$config_ticket_prefix$ticket_number] $ticket_subject"; + $email_body = "Hello $tech_name,

A new reply has been added to the below ticket, check ITFlow for full details.

Client: $client_name
Ticket: $config_ticket_prefix$ticket_number
Subject: $ticket_subject

https://$config_base_url/ticket.php?ticket_id=$ticket_id"; + + $data = [ + [ + 'from' => $config_ticket_from_email, + 'from_name' => $config_ticket_from_name, + 'recipient' => $tech_email, + 'recipient_name' => $tech_name, + 'subject' => mysqli_real_escape_string($mysqli, $email_subject), + 'body' => mysqli_real_escape_string($mysqli, $email_body) + ] + ]; + addToMailQueue($data); + } + } + + mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2, ticket_resolved_at = NULL WHERE ticket_id = $ticket_id AND ticket_client_id = $client_id LIMIT 1"); + + logAction("Ticket", "Edit", "Email parser: Client contact $from_email_esc updated ticket $config_ticket_prefix$ticket_number_esc ($subject)", $client_id, $ticket_id); + customAction('ticket_reply_client', $ticket_id); + return true; + } else { + return false; + } +} + +/** ------------------------------------------------------------------ + * Webklex IMAP setup + * ------------------------------------------------------------------ */ +use Webklex\PHPIMAP\ClientManager; + +$validate_cert = true; // or false based on your configuration + +$cm = new ClientManager(); + +$client = $cm->make([ + 'host' => $config_imap_host, + 'port' => (int)$config_imap_port, + 'encryption' => !empty($config_imap_encryption) ? $config_imap_encryption : null, // 'ssl' | 'tls' | null + 'validate_cert' => (bool)$validate_cert, + 'username' => $config_imap_username, + 'password' => $config_imap_password, + 'protocol' => 'imap' +]); + +try { + $client->connect(); +} catch (\Throwable $e) { + echo "Error connecting to IMAP server: " . $e->getMessage(); + unlink($lock_file_path); + exit(1); +} + +$inbox = $client->getFolderByPath('INBOX'); + +$targetFolderPath = 'ITFlow'; +try { + $targetFolder = $client->getFolderByPath($targetFolderPath); +} catch (\Throwable $e) { + $client->createFolder($targetFolderPath); + $targetFolder = $client->getFolderByPath($targetFolderPath); +} + +// Fetch unseen messages +$messages = $inbox->messages()->leaveUnread()->unseen()->get(); + +// Counters +$processed_count = 0; +$unprocessed_count = 0; + +// Process messages +foreach ($messages as $message) { + $email_processed = false; + + // Save original RFC822 message as .eml + mkdirMissing('../uploads/tmp/'); + $original_message_file = "processed-eml-" . randomString(200) . ".eml"; + + try { + // getRawMessage() available in v3; for v2 use getHeader()->raw or getStructure()? We'll try getRawMessage() + $raw_message = $message->getRawMessage(); + } catch (\Throwable $e) { + // Fallback to rebuilding from headers + body if raw not available + $raw_message = (string)$message->getHeader()->raw . "\r\n\r\n" . ($message->getRawBody() ?? $message->getHTMLBody() ?? $message->getTextBody()); + } + file_put_contents("../uploads/tmp/{$original_message_file}", $raw_message); + + // From + $fromCol = $message->getFrom(); + $fromFirst = ($fromCol && $fromCol->count()) ? $fromCol->first() : null; + $from_email = sanitizeInput($fromFirst->mail ?? 'itflow-guest@example.com'); + $from_name = sanitizeInput($fromFirst->personal ?? 'Unknown'); + + $from_domain = explode("@", $from_email); + $from_domain = sanitizeInput(end($from_domain)); + + // Subject + $subject = sanitizeInput((string)$message->getSubject() ?: 'No Subject'); + + // Date (string) + $dateAttr = $message->getDate(); // Attribute + $dateRaw = $dateAttr ? (string)$dateAttr : ''; // e.g. "Tue, 10 Sep 2025 13:22:05 +0000" + $ts = $dateRaw ? strtotime($dateRaw) : false; + $date = sanitizeInput($ts !== false ? date('Y-m-d H:i:s', $ts) : date('Y-m-d H:i:s')); + + // Body (prefer HTML) + $message_body_html = $message->getHTMLBody(); + $message_body_text = $message->getTextBody(); + $message_body = $message_body_html ?: nl2br(htmlspecialchars((string)$message_body_text)); + + // Handle attachments (inline vs regular) + $attachments = []; + foreach ($message->getAttachments() as $att) { + $attrs = $att->getAttributes(); // v6.2: canonical source + $dispo = strtolower((string)($attrs['disposition'] ?? '')); + $cid = $attrs['id'] ?? null; // Content-ID + $content = $attrs['content'] ?? null; // binary + $mime = $att->getMimeType(); + $name = $att->getName() ?: 'attachment'; + + $is_inline = false; + if ($dispo === 'inline' && $cid && $content !== null) { + $cid_trim = trim($cid, '<>'); + $dataUri = "data:$mime;base64,".base64_encode($content); + $message_body = str_replace(["cid:$cid_trim", "cid:$cid"], $dataUri, $message_body); + $is_inline = true; + } + + if (!$is_inline && $content !== null) { + $attachments[] = ['name' => $name, 'content' => $content]; + } + } + + // Decide whether it's a reply to an existing ticket or a new ticket + if (preg_match("/\[$config_ticket_prefix(\d+)\]/", $subject, $ticket_number_matches)) { + $ticket_number = intval($ticket_number_matches[1]); + if (addReply($from_email, $date, $subject, $ticket_number, $message_body, $attachments)) { + $email_processed = true; + } + } else { + // Known contact? + $from_email_esc = mysqli_real_escape_string($mysqli, $from_email); + $any_contact_sql = mysqli_query($mysqli, "SELECT * FROM contacts WHERE contact_email = '$from_email_esc' LIMIT 1"); + $rowc = mysqli_fetch_array($any_contact_sql); + + if ($rowc) { + $contact_name = sanitizeInput($rowc['contact_name']); + $contact_id = intval($rowc['contact_id']); + $contact_email = sanitizeInput($rowc['contact_email']); + $client_id = intval($rowc['contact_client_id']); + + if (addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message_body, $attachments, $original_message_file)) { + $email_processed = true; + } + } else { + // Known domain? + $from_domain_esc = mysqli_real_escape_string($mysqli, $from_domain); + $domain_sql = mysqli_query($mysqli, "SELECT * FROM domains WHERE domain_name = '$from_domain_esc' LIMIT 1"); + $rowd = mysqli_fetch_assoc($domain_sql); + + if ($rowd && $from_domain == $rowd['domain_name']) { + $client_id = intval($rowd['domain_client_id']); + + // Create a new contact + $contact_name = $from_name; + $contact_email = $from_email; + mysqli_query($mysqli, "INSERT INTO contacts SET contact_name = '".mysqli_real_escape_string($mysqli, $contact_name)."', contact_email = '".mysqli_real_escape_string($mysqli, $contact_email)."', contact_notes = 'Added automatically via email parsing.', contact_client_id = $client_id"); + $contact_id = mysqli_insert_id($mysqli); + + // Logging + logAction("Contact", "Create", "Email parser: created contact " . mysqli_real_escape_string($mysqli, $contact_name) . "", $client_id, $contact_id); + customAction('contact_create', $contact_id); + + if (addTicket($contact_id, $contact_name, $contact_email, $client_id, $date, $subject, $message_body, $attachments, $original_message_file)) { + $email_processed = true; + } + } elseif ($config_ticket_email_parse_unknown_senders) { + // Unknown sender allowed? + $bad_from_pattern = "/daemon|postmaster/i"; + if (!(preg_match($bad_from_pattern, $from_email))) { + if (addTicket(0, $from_name, $from_email, 0, $date, $subject, $message_body, $attachments, $original_message_file)) { + $email_processed = true; + } + } + } + } + } + + // Flag/move based on processing result + if ($email_processed) { + $processed_count++; // increment first so a move failure doesn't hide the success + try { + $message->setFlag('Seen'); + // Move using the Folder object (top-level "ITFlow") + $message->move($targetFolderPath); + // optional: logApp("Cron-Email-Parser", "info", "Moved message to ITFlow"); + } catch (\Throwable $e) { + // >>> Put the extra logging RIGHT HERE + $subj = (string)$message->getSubject(); + $uid = method_exists($message, 'getUid') ? $message->getUid() : 'n/a'; + $path = property_exists($targetFolder, 'path') ? $targetFolder->path : 'ITFlow'; + logApp( + "Cron-Email-Parser", + "warning", + "Move failed (subject=\"$subj\", uid=$uid) to [$path]: ".$e->getMessage() + ); + } + } else { + $unprocessed_count++; + try { + $message->setFlag('Flagged'); + $message->unsetFlag('Seen'); + } catch (\Throwable $e) { + logApp("Cron-Email-Parser", "warning", "Flag update failed: ".$e->getMessage()); + } + } + + // Cleanup temp .eml if still present (e.g., reply path) + if (isset($original_message_file)) { + $tmp_path = "../uploads/tmp/{$original_message_file}"; + if (file_exists($tmp_path)) { @unlink($tmp_path); } + } +} + +// Expunge & disconnect +try { + $client->expunge(); +} catch (\Throwable $e) { + // ignore +} +$client->disconnect(); + +// Execution timing (optional) +$script_end_time = microtime(true); +$execution_time = $script_end_time - $script_start_time; +$execution_time_formatted = number_format($execution_time, 2); + +$processed_info = "Processed: $processed_count email(s), Unprocessed: $unprocessed_count email(s)"; +// logAction("Cron-Email-Parser", "Execution", "Cron Email Parser executed in $execution_time_formatted seconds. $processed_info"); + +// Remove the lock file +unlink($lock_file_path); + +// DEBUG +echo "\nLock File Path: $lock_file_path\n"; +if (file_exists($lock_file_path)) { + echo "\nLock is present\n\n"; +} +echo "Processed Emails into tickets: $processed_count\n"; +echo "Unprocessed Emails: $unprocessed_count\n"; diff --git a/plugins/composer.json b/plugins/composer.json new file mode 100644 index 00000000..8d56034c --- /dev/null +++ b/plugins/composer.json @@ -0,0 +1,5 @@ +{ + "require": { + "webklex/php-imap": "^6.2" + } +} diff --git a/plugins/composer.lock b/plugins/composer.lock new file mode 100644 index 00000000..b4b5bb03 --- /dev/null +++ b/plugins/composer.lock @@ -0,0 +1,1645 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "5cc550c87df98ff88db99d5cbe524f1c", + "packages": [ + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.2.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2024-02-09T16:56:22+00:00" + }, + { + "name": "doctrine/inflector", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "time": "2025-08-10T19:31:58+00:00" + }, + { + "name": "illuminate/collections", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "2737a0477a3f4855a71bf8f3d0b8d32596ded628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/2737a0477a3f4855a71bf8f3d0b8d32596ded628", + "reference": "2737a0477a3f4855a71bf8f3d0b8d32596ded628", + "shasum": "" + }, + "require": { + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "php": "^8.2", + "symfony/polyfill-php84": "^1.33", + "symfony/polyfill-php85": "^1.33" + }, + "suggest": { + "illuminate/http": "Required to convert collections to API resources (^12.0).", + "symfony/var-dumper": "Required to use the dump method (^7.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "files": [ + "functions.php", + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2025-09-02T15:31:06+00:00" + }, + { + "name": "illuminate/conditionable", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/conditionable.git", + "reference": "ec677967c1f2faf90b8428919124d2184a4c9b49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/ec677967c1f2faf90b8428919124d2184a4c9b49", + "reference": "ec677967c1f2faf90b8428919124d2184a4c9b49", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Conditionable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2025-05-13T15:08:45+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d", + "reference": "f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d", + "shasum": "" + }, + "require": { + "php": "^8.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2025-08-27T18:34:41+00:00" + }, + { + "name": "illuminate/macroable", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "e862e5648ee34004fa56046b746f490dfa86c613" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/e862e5648ee34004fa56046b746f490dfa86c613", + "reference": "e862e5648ee34004fa56046b746f490dfa86c613", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2024-07-23T16:31:01+00:00" + }, + { + "name": "illuminate/pagination", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "1d95e70671177108b202e6ceb61bc7bc9924bdbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/1d95e70671177108b202e6ceb61bc7bc9924bdbf", + "reference": "1d95e70671177108b202e6ceb61bc7bc9924bdbf", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "illuminate/collections": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/support": "^12.0", + "php": "^8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2025-09-02T15:31:06+00:00" + }, + { + "name": "illuminate/support", + "version": "v12.28.1", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "487bbe527806615b818e87c364d93ba91f27db9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/487bbe527806615b818e87c364d93ba91f27db9b", + "reference": "487bbe527806615b818e87c364d93ba91f27db9b", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^2.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-mbstring": "*", + "illuminate/collections": "^12.0", + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "nesbot/carbon": "^3.8.4", + "php": "^8.2", + "symfony/polyfill-php83": "^1.33", + "symfony/polyfill-php85": "^1.33", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "replace": { + "spatie/once": "*" + }, + "suggest": { + "illuminate/filesystem": "Required to use the Composer class (^12.0).", + "laravel/serializable-closure": "Required to use the once function (^1.3|^2.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.7).", + "league/uri": "Required to use the Uri class (^7.5.1).", + "ramsey/uuid": "Required to use Str::uuid() (^4.7).", + "symfony/process": "Required to use the Composer class (^7.2).", + "symfony/uid": "Required to use Str::ulid() (^7.2).", + "symfony/var-dumper": "Required to use the dd function (^7.2).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.6.1)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "autoload": { + "files": [ + "functions.php", + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2025-09-03T16:23:04+00:00" + }, + { + "name": "nesbot/carbon", + "version": "3.10.3", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "time": "2025-09-06T13:39:36+00:00" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "time": "2022-11-25T14:36:26+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "symfony/clock", + "version": "v7.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v7.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v7.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "7475561ec27020196c49bb7c4f178d33d7d3dc00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7475561ec27020196c49bb7c4f178d33d7d3dc00", + "reference": "7475561ec27020196c49bb7c4f178d33d7d3dc00", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5", + "symfony/clock": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v7.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-08-20T08:04:18+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-08T02:45:35+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-24T13:30:11+00:00" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-23T16:12:55+00:00" + }, + { + "name": "symfony/translation", + "version": "v7.3.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "e0837b4cbcef63c754d89a4806575cada743a38d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/e0837b4cbcef63c754d89a4806575cada743a38d", + "reference": "e0837b4cbcef63c754d89a4806575cada743a38d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v7.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-08-01T21:02:37+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/df210c7a2573f1913b2d17cc95f90f53a73d8f7d", + "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-27T08:32:26+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2024-11-21T01:49:47+00:00" + }, + { + "name": "webklex/php-imap", + "version": "6.2.0", + "source": { + "type": "git", + "url": "https://github.com/Webklex/php-imap.git", + "reference": "6b8ef85d621bbbaf52741b00cca8e9237e2b2e05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/php-imap/zipball/6b8ef85d621bbbaf52741b00cca8e9237e2b2e05", + "reference": "6b8ef85d621bbbaf52741b00cca8e9237e2b2e05", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-zip": "*", + "illuminate/pagination": ">=5.0.0", + "nesbot/carbon": "^2.62.1|^3.2.4", + "php": "^8.0.2", + "symfony/http-foundation": ">=2.8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.10" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support", + "symfony/var-dumper": "Usefull tool for debugging" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "PHP IMAP client", + "homepage": "https://github.com/webklex/php-imap", + "keywords": [ + "imap", + "mail", + "php-imap", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/php-imap/issues", + "source": "https://github.com/Webklex/php-imap/tree/6.2.0" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "time": "2025-04-25T06:02:37+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.2.0" +} diff --git a/plugins/vendor/autoload.php b/plugins/vendor/autoload.php new file mode 100644 index 00000000..165b0733 --- /dev/null +++ b/plugins/vendor/autoload.php @@ -0,0 +1,7 @@ +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'); + exit(0); + } +} + +include __DIR__ . '/..'.'/nesbot/carbon/bin/carbon'; diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/LICENSE b/plugins/vendor/carbonphp/carbon-doctrine-types/LICENSE new file mode 100644 index 00000000..2ee1671d --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Carbon + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/README.md b/plugins/vendor/carbonphp/carbon-doctrine-types/README.md new file mode 100644 index 00000000..5a18121b --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/README.md @@ -0,0 +1,14 @@ +# carbonphp/carbon-doctrine-types + +Types to use Carbon in Doctrine + +## Documentation + +[Check how to use in the official Carbon documentation](https://carbon.nesbot.com/symfony/) + +This package is an externalization of [src/Carbon/Doctrine](https://github.com/briannesbitt/Carbon/tree/2.71.0/src/Carbon/Doctrine) +from `nestbot/carbon` package. + +Externalization allows to better deal with different versions of dbal. With +version 4.0 of dbal, it no longer sustainable to be compatible with all version +using a single code. diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/composer.json b/plugins/vendor/carbonphp/carbon-doctrine-types/composer.json new file mode 100644 index 00000000..abf45c5f --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/composer.json @@ -0,0 +1,36 @@ +{ + "name": "carbonphp/carbon-doctrine-types", + "description": "Types to use Carbon in Doctrine", + "type": "library", + "keywords": [ + "date", + "time", + "DateTime", + "Carbon", + "Doctrine" + ], + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "license": "MIT", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "minimum-stability": "dev" +} diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php new file mode 100644 index 00000000..a63a9b8d --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/CarbonDoctrineType.php @@ -0,0 +1,16 @@ + + */ + protected function getCarbonClassName(): string + { + return Carbon::class; + } + + public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string + { + $precision = min( + $fieldDeclaration['precision'] ?? DateTimeDefaultPrecision::get(), + $this->getMaximumPrecision($platform), + ); + + $type = parent::getSQLDeclaration($fieldDeclaration, $platform); + + if (!$precision) { + return $type; + } + + if (str_contains($type, '(')) { + return preg_replace('/\(\d+\)/', "($precision)", $type); + } + + [$before, $after] = explode(' ', "$type "); + + return trim("$before($precision) $after"); + } + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string + { + if ($value === null) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $value->format('Y-m-d H:i:s.u'); + } + + throw InvalidType::new( + $value, + static::class, + ['null', 'DateTime', 'Carbon'] + ); + } + + private function doConvertToPHPValue(mixed $value) + { + $class = $this->getCarbonClassName(); + + if ($value === null || is_a($value, $class)) { + return $value; + } + + if ($value instanceof DateTimeInterface) { + return $class::instance($value); + } + + $date = null; + $error = null; + + try { + $date = $class::parse($value); + } catch (Exception $exception) { + $error = $exception; + } + + if (!$date) { + throw ValueNotConvertible::new( + $value, + static::class, + 'Y-m-d H:i:s.u or any format supported by '.$class.'::parse()', + $error + ); + } + + return $date; + } + + private function getMaximumPrecision(AbstractPlatform $platform): int + { + if ($platform instanceof DB2Platform) { + return 12; + } + + if ($platform instanceof OraclePlatform) { + return 9; + } + + if ($platform instanceof SQLServerPlatform || $platform instanceof SQLitePlatform) { + return 3; + } + + return 6; + } +} diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php new file mode 100644 index 00000000..cd9896f9 --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeDefaultPrecision.php @@ -0,0 +1,30 @@ + */ + use CarbonTypeConverter; + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?CarbonImmutable + { + return $this->doConvertToPHPValue($value); + } + + /** + * @return class-string + */ + protected function getCarbonClassName(): string + { + return CarbonImmutable::class; + } +} diff --git a/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php new file mode 100644 index 00000000..89e4b790 --- /dev/null +++ b/plugins/vendor/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine/DateTimeType.php @@ -0,0 +1,24 @@ + */ + use CarbonTypeConverter; + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function convertToPHPValue(mixed $value, AbstractPlatform $platform): ?Carbon + { + return $this->doConvertToPHPValue($value); + } +} diff --git a/plugins/vendor/composer/ClassLoader.php b/plugins/vendor/composer/ClassLoader.php new file mode 100644 index 00000000..afef3fa2 --- /dev/null +++ b/plugins/vendor/composer/ClassLoader.php @@ -0,0 +1,572 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-return array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/plugins/vendor/composer/InstalledVersions.php b/plugins/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..d50e0c9f --- /dev/null +++ b/plugins/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/plugins/vendor/composer/LICENSE b/plugins/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/plugins/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/plugins/vendor/composer/autoload_classmap.php b/plugins/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..5dc1606d --- /dev/null +++ b/plugins/vendor/composer/autoload_classmap.php @@ -0,0 +1,24 @@ + $vendorDir . '/composer/InstalledVersions.php', + 'DateError' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateError.php', + 'DateException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateException.php', + 'DateInvalidOperationException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateInvalidOperationException.php', + 'DateInvalidTimeZoneException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateInvalidTimeZoneException.php', + 'DateMalformedIntervalStringException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateMalformedIntervalStringException.php', + 'DateMalformedPeriodStringException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateMalformedPeriodStringException.php', + 'DateMalformedStringException' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateMalformedStringException.php', + 'DateObjectError' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateObjectError.php', + 'DateRangeError' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/DateRangeError.php', + 'Deprecated' => $vendorDir . '/symfony/polyfill-php84/Resources/stubs/Deprecated.php', + 'NoDiscard' => $vendorDir . '/symfony/polyfill-php85/Resources/stubs/NoDiscard.php', + 'Override' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/Override.php', + 'ReflectionConstant' => $vendorDir . '/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php', + 'SQLite3Exception' => $vendorDir . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', +); diff --git a/plugins/vendor/composer/autoload_files.php b/plugins/vendor/composer/autoload_files.php new file mode 100644 index 00000000..a7d2f8fe --- /dev/null +++ b/plugins/vendor/composer/autoload_files.php @@ -0,0 +1,20 @@ + $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + '662a729f963d39afe703c9d9b7ab4a8c' => $vendorDir . '/symfony/polyfill-php83/bootstrap.php', + '606a39d89246991a373564698c2d8383' => $vendorDir . '/symfony/polyfill-php85/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + '2203a247e6fda86070a5e4e07aed533a' => $vendorDir . '/symfony/clock/Resources/now.php', + 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', + '9d2b9fc6db0f153a0a149fefb182415e' => $vendorDir . '/symfony/polyfill-php84/bootstrap.php', + '23f09fe3194f8c2f70923f90d6702129' => $vendorDir . '/illuminate/collections/functions.php', + '60799491728b879e74601d83e38b2cad' => $vendorDir . '/illuminate/collections/helpers.php', + 'f625ee536139dfb962a398b200bdb2bd' => $vendorDir . '/illuminate/support/functions.php', + '72579e7bd17821bb1321b87411366eae' => $vendorDir . '/illuminate/support/helpers.php', +); diff --git a/plugins/vendor/composer/autoload_namespaces.php b/plugins/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..b7fc0125 --- /dev/null +++ b/plugins/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($vendorDir . '/voku/portable-ascii/src/voku'), + 'Webklex\\PHPIMAP\\' => array($vendorDir . '/webklex/php-imap/src'), + 'Symfony\\Polyfill\\Php85\\' => array($vendorDir . '/symfony/polyfill-php85'), + 'Symfony\\Polyfill\\Php84\\' => array($vendorDir . '/symfony/polyfill-php84'), + 'Symfony\\Polyfill\\Php83\\' => array($vendorDir . '/symfony/polyfill-php83'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Contracts\\Translation\\' => array($vendorDir . '/symfony/translation-contracts'), + 'Symfony\\Component\\Translation\\' => array($vendorDir . '/symfony/translation'), + 'Symfony\\Component\\HttpFoundation\\' => array($vendorDir . '/symfony/http-foundation'), + 'Symfony\\Component\\Clock\\' => array($vendorDir . '/symfony/clock'), + 'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'Psr\\Clock\\' => array($vendorDir . '/psr/clock/src'), + 'Illuminate\\Support\\' => array($vendorDir . '/illuminate/macroable', $vendorDir . '/illuminate/conditionable', $vendorDir . '/illuminate/collections', $vendorDir . '/illuminate/support'), + 'Illuminate\\Pagination\\' => array($vendorDir . '/illuminate/pagination'), + 'Illuminate\\Contracts\\' => array($vendorDir . '/illuminate/contracts'), + 'Doctrine\\Inflector\\' => array($vendorDir . '/doctrine/inflector/src'), + 'Carbon\\Doctrine\\' => array($vendorDir . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine'), + 'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'), +); diff --git a/plugins/vendor/composer/autoload_real.php b/plugins/vendor/composer/autoload_real.php new file mode 100644 index 00000000..d60da886 --- /dev/null +++ b/plugins/vendor/composer/autoload_real.php @@ -0,0 +1,80 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit9b9826e5b5cc7806cd328c4112cca75e::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit9b9826e5b5cc7806cd328c4112cca75e::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire9b9826e5b5cc7806cd328c4112cca75e($fileIdentifier, $file); + } + + return $loader; + } +} + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire9b9826e5b5cc7806cd328c4112cca75e($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/plugins/vendor/composer/autoload_static.php b/plugins/vendor/composer/autoload_static.php new file mode 100644 index 00000000..00e27ea8 --- /dev/null +++ b/plugins/vendor/composer/autoload_static.php @@ -0,0 +1,175 @@ + __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + '662a729f963d39afe703c9d9b7ab4a8c' => __DIR__ . '/..' . '/symfony/polyfill-php83/bootstrap.php', + '606a39d89246991a373564698c2d8383' => __DIR__ . '/..' . '/symfony/polyfill-php85/bootstrap.php', + '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + '2203a247e6fda86070a5e4e07aed533a' => __DIR__ . '/..' . '/symfony/clock/Resources/now.php', + 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', + '9d2b9fc6db0f153a0a149fefb182415e' => __DIR__ . '/..' . '/symfony/polyfill-php84/bootstrap.php', + '23f09fe3194f8c2f70923f90d6702129' => __DIR__ . '/..' . '/illuminate/collections/functions.php', + '60799491728b879e74601d83e38b2cad' => __DIR__ . '/..' . '/illuminate/collections/helpers.php', + 'f625ee536139dfb962a398b200bdb2bd' => __DIR__ . '/..' . '/illuminate/support/functions.php', + '72579e7bd17821bb1321b87411366eae' => __DIR__ . '/..' . '/illuminate/support/helpers.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'v' => + array ( + 'voku\\' => 5, + ), + 'W' => + array ( + 'Webklex\\PHPIMAP\\' => 16, + ), + 'S' => + array ( + 'Symfony\\Polyfill\\Php85\\' => 23, + 'Symfony\\Polyfill\\Php84\\' => 23, + 'Symfony\\Polyfill\\Php83\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Contracts\\Translation\\' => 30, + 'Symfony\\Component\\Translation\\' => 30, + 'Symfony\\Component\\HttpFoundation\\' => 33, + 'Symfony\\Component\\Clock\\' => 24, + ), + 'P' => + array ( + 'Psr\\SimpleCache\\' => 16, + 'Psr\\Container\\' => 14, + 'Psr\\Clock\\' => 10, + ), + 'I' => + array ( + 'Illuminate\\Support\\' => 19, + 'Illuminate\\Pagination\\' => 22, + 'Illuminate\\Contracts\\' => 21, + ), + 'D' => + array ( + 'Doctrine\\Inflector\\' => 19, + ), + 'C' => + array ( + 'Carbon\\Doctrine\\' => 16, + 'Carbon\\' => 7, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'voku\\' => + array ( + 0 => __DIR__ . '/..' . '/voku/portable-ascii/src/voku', + ), + 'Webklex\\PHPIMAP\\' => + array ( + 0 => __DIR__ . '/..' . '/webklex/php-imap/src', + ), + 'Symfony\\Polyfill\\Php85\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php85', + ), + 'Symfony\\Polyfill\\Php84\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php84', + ), + 'Symfony\\Polyfill\\Php83\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php83', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Contracts\\Translation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/translation-contracts', + ), + 'Symfony\\Component\\Translation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/translation', + ), + 'Symfony\\Component\\HttpFoundation\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/http-foundation', + ), + 'Symfony\\Component\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/clock', + ), + 'Psr\\SimpleCache\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/simple-cache/src', + ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'Psr\\Clock\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/clock/src', + ), + 'Illuminate\\Support\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/macroable', + 1 => __DIR__ . '/..' . '/illuminate/conditionable', + 2 => __DIR__ . '/..' . '/illuminate/collections', + 3 => __DIR__ . '/..' . '/illuminate/support', + ), + 'Illuminate\\Pagination\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/pagination', + ), + 'Illuminate\\Contracts\\' => + array ( + 0 => __DIR__ . '/..' . '/illuminate/contracts', + ), + 'Doctrine\\Inflector\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/inflector/src', + ), + 'Carbon\\Doctrine\\' => + array ( + 0 => __DIR__ . '/..' . '/carbonphp/carbon-doctrine-types/src/Carbon/Doctrine', + ), + 'Carbon\\' => + array ( + 0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon', + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'DateError' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateError.php', + 'DateException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateException.php', + 'DateInvalidOperationException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateInvalidOperationException.php', + 'DateInvalidTimeZoneException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateInvalidTimeZoneException.php', + 'DateMalformedIntervalStringException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateMalformedIntervalStringException.php', + 'DateMalformedPeriodStringException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateMalformedPeriodStringException.php', + 'DateMalformedStringException' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateMalformedStringException.php', + 'DateObjectError' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateObjectError.php', + 'DateRangeError' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/DateRangeError.php', + 'Deprecated' => __DIR__ . '/..' . '/symfony/polyfill-php84/Resources/stubs/Deprecated.php', + 'NoDiscard' => __DIR__ . '/..' . '/symfony/polyfill-php85/Resources/stubs/NoDiscard.php', + 'Override' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/Override.php', + 'ReflectionConstant' => __DIR__ . '/..' . '/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php', + 'SQLite3Exception' => __DIR__ . '/..' . '/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit9b9826e5b5cc7806cd328c4112cca75e::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit9b9826e5b5cc7806cd328c4112cca75e::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit9b9826e5b5cc7806cd328c4112cca75e::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/plugins/vendor/composer/installed.json b/plugins/vendor/composer/installed.json new file mode 100644 index 00000000..a4d12430 --- /dev/null +++ b/plugins/vendor/composer/installed.json @@ -0,0 +1,1701 @@ +{ + "packages": [ + { + "name": "carbonphp/carbon-doctrine-types", + "version": "3.2.0", + "version_normalized": "3.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "conflict": { + "doctrine/dbal": "<4.0.0 || >=5.0.0" + }, + "require-dev": { + "doctrine/dbal": "^4.0.0", + "nesbot/carbon": "^2.71.0 || ^3.0.0", + "phpunit/phpunit": "^10.3" + }, + "time": "2024-02-09T16:56:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "KyleKatarn", + "email": "kylekatarnls@gmail.com" + } + ], + "description": "Types to use Carbon in Doctrine", + "keywords": [ + "carbon", + "date", + "datetime", + "doctrine", + "time" + ], + "support": { + "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + }, + "funding": [ + { + "url": "https://github.com/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "install-path": "../carbonphp/carbon-doctrine-types" + }, + { + "name": "doctrine/inflector", + "version": "2.1.0", + "version_normalized": "2.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "reference": "6d6c96277ea252fc1304627204c3d5e6e15faa3b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "time": "2025-08-10T19:31:58+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.1.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector", + "type": "tidelift" + } + ], + "install-path": "../doctrine/inflector" + }, + { + "name": "illuminate/collections", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "2737a0477a3f4855a71bf8f3d0b8d32596ded628" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/2737a0477a3f4855a71bf8f3d0b8d32596ded628", + "reference": "2737a0477a3f4855a71bf8f3d0b8d32596ded628", + "shasum": "" + }, + "require": { + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "php": "^8.2", + "symfony/polyfill-php84": "^1.33", + "symfony/polyfill-php85": "^1.33" + }, + "suggest": { + "illuminate/http": "Required to convert collections to API resources (^12.0).", + "symfony/var-dumper": "Required to use the dump method (^7.2)." + }, + "time": "2025-09-02T15:31:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "functions.php", + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/collections" + }, + { + "name": "illuminate/conditionable", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/conditionable.git", + "reference": "ec677967c1f2faf90b8428919124d2184a4c9b49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/conditionable/zipball/ec677967c1f2faf90b8428919124d2184a4c9b49", + "reference": "ec677967c1f2faf90b8428919124d2184a4c9b49", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "time": "2025-05-13T15:08:45+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Conditionable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/conditionable" + }, + { + "name": "illuminate/contracts", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d", + "reference": "f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d", + "shasum": "" + }, + "require": { + "php": "^8.2", + "psr/container": "^1.1.1|^2.0.1", + "psr/simple-cache": "^1.0|^2.0|^3.0" + }, + "time": "2025-08-27T18:34:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/contracts" + }, + { + "name": "illuminate/macroable", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "e862e5648ee34004fa56046b746f490dfa86c613" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/e862e5648ee34004fa56046b746f490dfa86c613", + "reference": "e862e5648ee34004fa56046b746f490dfa86c613", + "shasum": "" + }, + "require": { + "php": "^8.2" + }, + "time": "2024-07-23T16:31:01+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/macroable" + }, + { + "name": "illuminate/pagination", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/pagination.git", + "reference": "1d95e70671177108b202e6ceb61bc7bc9924bdbf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/pagination/zipball/1d95e70671177108b202e6ceb61bc7bc9924bdbf", + "reference": "1d95e70671177108b202e6ceb61bc7bc9924bdbf", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "illuminate/collections": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/support": "^12.0", + "php": "^8.2" + }, + "time": "2025-09-02T15:31:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Pagination package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/pagination" + }, + { + "name": "illuminate/support", + "version": "v12.28.1", + "version_normalized": "12.28.1.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "487bbe527806615b818e87c364d93ba91f27db9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/487bbe527806615b818e87c364d93ba91f27db9b", + "reference": "487bbe527806615b818e87c364d93ba91f27db9b", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^2.0", + "ext-ctype": "*", + "ext-filter": "*", + "ext-mbstring": "*", + "illuminate/collections": "^12.0", + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "nesbot/carbon": "^3.8.4", + "php": "^8.2", + "symfony/polyfill-php83": "^1.33", + "symfony/polyfill-php85": "^1.33", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "replace": { + "spatie/once": "*" + }, + "suggest": { + "illuminate/filesystem": "Required to use the Composer class (^12.0).", + "laravel/serializable-closure": "Required to use the once function (^1.3|^2.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.7).", + "league/uri": "Required to use the Uri class (^7.5.1).", + "ramsey/uuid": "Required to use Str::uuid() (^4.7).", + "symfony/process": "Required to use the Composer class (^7.2).", + "symfony/uid": "Required to use Str::ulid() (^7.2).", + "symfony/var-dumper": "Required to use the dd function (^7.2).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.6.1)." + }, + "time": "2025-09-03T16:23:04+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "functions.php", + "helpers.php" + ], + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "install-path": "../illuminate/support" + }, + { + "name": "nesbot/carbon", + "version": "3.10.3", + "version_normalized": "3.10.3.0", + "source": { + "type": "git", + "url": "https://github.com/CarbonPHP/carbon.git", + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", + "reference": "8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f", + "shasum": "" + }, + "require": { + "carbonphp/carbon-doctrine-types": "<100.0", + "ext-json": "*", + "php": "^8.1", + "psr/clock": "^1.0", + "symfony/clock": "^6.3.12 || ^7.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^4.4.18 || ^5.2.1 || ^6.0 || ^7.0" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "require-dev": { + "doctrine/dbal": "^3.6.3 || ^4.0", + "doctrine/orm": "^2.15.2 || ^3.0", + "friendsofphp/php-cs-fixer": "^v3.87.1", + "kylekatarnls/multi-tester": "^2.5.3", + "phpmd/phpmd": "^2.15.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.22", + "phpunit/phpunit": "^10.5.53", + "squizlabs/php_codesniffer": "^3.13.4" + }, + "time": "2025-09-06T13:39:36+00:00", + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "https://markido.com" + }, + { + "name": "kylekatarnls", + "homepage": "https://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "https://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/CarbonPHP/carbon/issues", + "source": "https://github.com/CarbonPHP/carbon" + }, + "funding": [ + { + "url": "https://github.com/sponsors/kylekatarnls", + "type": "github" + }, + { + "url": "https://opencollective.com/Carbon#sponsor", + "type": "opencollective" + }, + { + "url": "https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=readme", + "type": "tidelift" + } + ], + "install-path": "../nesbot/carbon" + }, + { + "name": "psr/clock", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/clock.git", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/clock/zipball/e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "reference": "e41a24703d4560fd0acb709162f73b8adfc3aa0d", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0" + }, + "time": "2022-11-25T14:36:26+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for reading the clock.", + "homepage": "https://github.com/php-fig/clock", + "keywords": [ + "clock", + "now", + "psr", + "psr-20", + "time" + ], + "support": { + "issues": "https://github.com/php-fig/clock/issues", + "source": "https://github.com/php-fig/clock/tree/1.0.0" + }, + "install-path": "../psr/clock" + }, + { + "name": "psr/container", + "version": "2.0.2", + "version_normalized": "2.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "time": "2021-11-05T16:47:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "install-path": "../psr/container" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2021-10-29T13:26:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "install-path": "../psr/simple-cache" + }, + { + "name": "symfony/clock", + "version": "v7.3.0", + "version_normalized": "7.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/clock.git", + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/clock/zipball/b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", + "reference": "b81435fbd6648ea425d1ee96a2d8e68f4ceacd24", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "provide": { + "psr/clock-implementation": "1.0" + }, + "time": "2024-09-25T14:21:43+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/now.php" + ], + "psr-4": { + "Symfony\\Component\\Clock\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Decouples applications from the system clock", + "homepage": "https://symfony.com", + "keywords": [ + "clock", + "psr20", + "time" + ], + "support": { + "source": "https://github.com/symfony/clock/tree/v7.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/clock" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "version_normalized": "3.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "time": "2024-09-25T14:21:43+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/http-foundation", + "version": "v7.3.3", + "version_normalized": "7.3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "7475561ec27020196c49bb7c4f178d33d7d3dc00" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/7475561ec27020196c49bb7c4f178d33d7d3dc00", + "reference": "7475561ec27020196c49bb7c4f178d33d7d3dc00", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5", + "symfony/clock": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" + }, + "time": "2025-08-20T08:04:18+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpFoundation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Defines an object-oriented layer for the HTTP specification", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v7.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/http-foundation" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2024-12-23T08:48:59+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2025-07-08T02:45:35+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php83" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2025-06-24T13:30:11+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php84" + }, + { + "name": "symfony/polyfill-php85", + "version": "v1.33.0", + "version_normalized": "1.33.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php85.git", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "reference": "d4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2025-06-23T16:12:55+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php85\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php85/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php85" + }, + { + "name": "symfony/translation", + "version": "v7.3.3", + "version_normalized": "7.3.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "e0837b4cbcef63c754d89a4806575cada743a38d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/e0837b4cbcef63c754d89a4806575cada743a38d", + "reference": "e0837b4cbcef63c754d89a4806575cada743a38d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/config": "<6.4", + "symfony/console": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0" + }, + "time": "2025-08-01T21:02:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v7.3.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/translation" + }, + { + "name": "symfony/translation-contracts", + "version": "v3.6.0", + "version_normalized": "3.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/df210c7a2573f1913b2d17cc95f90f53a73d8f7d", + "reference": "df210c7a2573f1913b2d17cc95f90f53a73d8f7d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "time": "2024-09-27T08:32:26+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/translation-contracts" + }, + { + "name": "voku/portable-ascii", + "version": "2.0.3", + "version_normalized": "2.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "reference": "b1d923f88091c6bf09699efcd7c8a1b1bfd7351d", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "time": "2024-11-21T01:49:47+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/2.0.3" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "install-path": "../voku/portable-ascii" + }, + { + "name": "webklex/php-imap", + "version": "6.2.0", + "version_normalized": "6.2.0.0", + "source": { + "type": "git", + "url": "https://github.com/Webklex/php-imap.git", + "reference": "6b8ef85d621bbbaf52741b00cca8e9237e2b2e05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Webklex/php-imap/zipball/6b8ef85d621bbbaf52741b00cca8e9237e2b2e05", + "reference": "6b8ef85d621bbbaf52741b00cca8e9237e2b2e05", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-zip": "*", + "illuminate/pagination": ">=5.0.0", + "nesbot/carbon": "^2.62.1|^3.2.4", + "php": "^8.0.2", + "symfony/http-foundation": ">=2.8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.10" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support", + "symfony/var-dumper": "Usefull tool for debugging" + }, + "time": "2025-04-25T06:02:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "description": "PHP IMAP client", + "homepage": "https://github.com/webklex/php-imap", + "keywords": [ + "imap", + "mail", + "php-imap", + "pop3", + "webklex" + ], + "support": { + "issues": "https://github.com/Webklex/php-imap/issues", + "source": "https://github.com/Webklex/php-imap/tree/6.2.0" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/webklex", + "type": "custom" + }, + { + "url": "https://ko-fi.com/webklex", + "type": "ko_fi" + } + ], + "install-path": "../webklex/php-imap" + } + ], + "dev": true, + "dev-package-names": [] +} diff --git a/plugins/vendor/composer/installed.php b/plugins/vendor/composer/installed.php new file mode 100644 index 00000000..b75cacc2 --- /dev/null +++ b/plugins/vendor/composer/installed.php @@ -0,0 +1,248 @@ + array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '981fb9585d0c76e8b9c31812d58dfdd5b56d6454', + 'name' => '__root__', + 'dev' => true, + ), + 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'reference' => '981fb9585d0c76e8b9c31812d58dfdd5b56d6454', + 'dev_requirement' => false, + ), + 'carbonphp/carbon-doctrine-types' => array( + 'pretty_version' => '3.2.0', + 'version' => '3.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../carbonphp/carbon-doctrine-types', + 'aliases' => array(), + 'reference' => '18ba5ddfec8976260ead6e866180bd5d2f71aa1d', + 'dev_requirement' => false, + ), + 'doctrine/inflector' => array( + 'pretty_version' => '2.1.0', + 'version' => '2.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../doctrine/inflector', + 'aliases' => array(), + 'reference' => '6d6c96277ea252fc1304627204c3d5e6e15faa3b', + 'dev_requirement' => false, + ), + 'illuminate/collections' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/collections', + 'aliases' => array(), + 'reference' => '2737a0477a3f4855a71bf8f3d0b8d32596ded628', + 'dev_requirement' => false, + ), + 'illuminate/conditionable' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/conditionable', + 'aliases' => array(), + 'reference' => 'ec677967c1f2faf90b8428919124d2184a4c9b49', + 'dev_requirement' => false, + ), + 'illuminate/contracts' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/contracts', + 'aliases' => array(), + 'reference' => 'f1c4cf02c9ab81a9ce47940cf261fa2386ed6c5d', + 'dev_requirement' => false, + ), + 'illuminate/macroable' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/macroable', + 'aliases' => array(), + 'reference' => 'e862e5648ee34004fa56046b746f490dfa86c613', + 'dev_requirement' => false, + ), + 'illuminate/pagination' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/pagination', + 'aliases' => array(), + 'reference' => '1d95e70671177108b202e6ceb61bc7bc9924bdbf', + 'dev_requirement' => false, + ), + 'illuminate/support' => array( + 'pretty_version' => 'v12.28.1', + 'version' => '12.28.1.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../illuminate/support', + 'aliases' => array(), + 'reference' => '487bbe527806615b818e87c364d93ba91f27db9b', + 'dev_requirement' => false, + ), + 'nesbot/carbon' => array( + 'pretty_version' => '3.10.3', + 'version' => '3.10.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../nesbot/carbon', + 'aliases' => array(), + 'reference' => '8e3643dcd149ae0fe1d2ff4f2c8e4bbfad7c165f', + 'dev_requirement' => false, + ), + 'psr/clock' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/clock', + 'aliases' => array(), + 'reference' => 'e41a24703d4560fd0acb709162f73b8adfc3aa0d', + 'dev_requirement' => false, + ), + 'psr/clock-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/container' => array( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', + 'dev_requirement' => false, + ), + 'psr/simple-cache' => array( + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/simple-cache', + 'aliases' => array(), + 'reference' => '764e0b3939f5ca87cb904f570ef9be2d78a07865', + 'dev_requirement' => false, + ), + 'spatie/once' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '*', + ), + ), + 'symfony/clock' => array( + 'pretty_version' => 'v7.3.0', + 'version' => '7.3.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/clock', + 'aliases' => array(), + 'reference' => 'b81435fbd6648ea425d1ee96a2d8e68f4ceacd24', + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.6.0', + 'version' => '3.6.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'reference' => '63afe740e99a13ba87ec199bb07bbdee937a5b62', + 'dev_requirement' => false, + ), + 'symfony/http-foundation' => array( + 'pretty_version' => 'v7.3.3', + 'version' => '7.3.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/http-foundation', + 'aliases' => array(), + 'reference' => '7475561ec27020196c49bb7c4f178d33d7d3dc00', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php83' => array( + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php83', + 'aliases' => array(), + 'reference' => '17f6f9a6b1735c0f163024d959f700cfbc5155e5', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php84' => array( + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php84', + 'aliases' => array(), + 'reference' => 'd8ced4d875142b6a7426000426b8abc631d6b191', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php85' => array( + 'pretty_version' => 'v1.33.0', + 'version' => '1.33.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php85', + 'aliases' => array(), + 'reference' => 'd4e5fcd4ab3d998ab16c0db48e6cbb9a01993f91', + 'dev_requirement' => false, + ), + 'symfony/translation' => array( + 'pretty_version' => 'v7.3.3', + 'version' => '7.3.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation', + 'aliases' => array(), + 'reference' => 'e0837b4cbcef63c754d89a4806575cada743a38d', + 'dev_requirement' => false, + ), + 'symfony/translation-contracts' => array( + 'pretty_version' => 'v3.6.0', + 'version' => '3.6.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/translation-contracts', + 'aliases' => array(), + 'reference' => 'df210c7a2573f1913b2d17cc95f90f53a73d8f7d', + 'dev_requirement' => false, + ), + 'symfony/translation-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '2.3|3.0', + ), + ), + 'voku/portable-ascii' => array( + 'pretty_version' => '2.0.3', + 'version' => '2.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../voku/portable-ascii', + 'aliases' => array(), + 'reference' => 'b1d923f88091c6bf09699efcd7c8a1b1bfd7351d', + 'dev_requirement' => false, + ), + 'webklex/php-imap' => array( + 'pretty_version' => '6.2.0', + 'version' => '6.2.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../webklex/php-imap', + 'aliases' => array(), + 'reference' => '6b8ef85d621bbbaf52741b00cca8e9237e2b2e05', + 'dev_requirement' => false, + ), + ), +); diff --git a/plugins/vendor/composer/platform_check.php b/plugins/vendor/composer/platform_check.php new file mode 100644 index 00000000..d32d90c6 --- /dev/null +++ b/plugins/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 80200)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/plugins/vendor/doctrine/inflector/LICENSE b/plugins/vendor/doctrine/inflector/LICENSE new file mode 100644 index 00000000..8c38cc1b --- /dev/null +++ b/plugins/vendor/doctrine/inflector/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2006-2015 Doctrine Project + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/vendor/doctrine/inflector/README.md b/plugins/vendor/doctrine/inflector/README.md new file mode 100644 index 00000000..6e3a97f7 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/README.md @@ -0,0 +1,7 @@ +# Doctrine Inflector + +Doctrine Inflector is a small library that can perform string manipulations +with regard to uppercase/lowercase and singular/plural forms of words. + +[![Build Status](https://github.com/doctrine/inflector/workflows/Continuous%20Integration/badge.svg)](https://github.com/doctrine/inflector/actions?query=workflow%3A%22Continuous+Integration%22+branch%3A4.0.x) +[![Code Coverage](https://codecov.io/gh/doctrine/inflector/branch/2.0.x/graph/badge.svg)](https://codecov.io/gh/doctrine/inflector/branch/2.0.x) diff --git a/plugins/vendor/doctrine/inflector/composer.json b/plugins/vendor/doctrine/inflector/composer.json new file mode 100644 index 00000000..6102926f --- /dev/null +++ b/plugins/vendor/doctrine/inflector/composer.json @@ -0,0 +1,67 @@ +{ + "name": "doctrine/inflector", + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "license": "MIT", + "type": "library", + "keywords": [ + "php", + "strings", + "words", + "manipulation", + "inflector", + "inflection", + "uppercase", + "lowercase", + "singular", + "plural" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0 || ^13.0", + "phpstan/phpstan": "^1.12 || ^2.0", + "phpstan/phpstan-phpunit": "^1.4 || ^2.0", + "phpstan/phpstan-strict-rules": "^1.6 || ^2.0", + "phpunit/phpunit": "^8.5 || ^12.2" + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Doctrine\\Tests\\Inflector\\": "tests" + } + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "sort-packages": true + } +} diff --git a/plugins/vendor/doctrine/inflector/docs/en/index.rst b/plugins/vendor/doctrine/inflector/docs/en/index.rst new file mode 100644 index 00000000..1e094c8e --- /dev/null +++ b/plugins/vendor/doctrine/inflector/docs/en/index.rst @@ -0,0 +1,227 @@ +Introduction +============ + +The Doctrine Inflector has methods for inflecting text. The features include pluralization, +singularization, converting between camelCase and under_score and capitalizing +words. + +Installation +============ + +You can install the Inflector with composer: + +.. code-block:: console + + $ composer require doctrine/inflector + +Usage +===== + +Using the inflector is easy, you can create a new ``Doctrine\Inflector\Inflector`` instance by using +the ``Doctrine\Inflector\InflectorFactory`` class: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + + $inflector = InflectorFactory::create()->build(); + +By default it will create an English inflector. If you want to use another language, just pass the language +you want to create an inflector for to the ``createForLanguage()`` method: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + use Doctrine\Inflector\Language; + + $inflector = InflectorFactory::createForLanguage(Language::SPANISH)->build(); + +The supported languages are as follows: + +- ``Language::ENGLISH`` +- ``Language::ESPERANTO`` +- ``Language::FRENCH`` +- ``Language::NORWEGIAN_BOKMAL`` +- ``Language::PORTUGUESE`` +- ``Language::SPANISH`` +- ``Language::TURKISH`` + +If you want to manually construct the inflector instead of using a factory, you can do so like this: + +.. code-block:: php + + use Doctrine\Inflector\CachedWordInflector; + use Doctrine\Inflector\RulesetInflector; + use Doctrine\Inflector\Rules\English; + + $inflector = new Inflector( + new CachedWordInflector(new RulesetInflector( + English\Rules::getSingularRuleset() + )), + new CachedWordInflector(new RulesetInflector( + English\Rules::getPluralRuleset() + )) + ); + +Adding Languages +---------------- + +If you are interested in adding support for your language, take a look at the other languages defined in the +``Doctrine\Inflector\Rules`` namespace and the tests located in ``Doctrine\Tests\Inflector\Rules``. You can copy +one of the languages and update the rules for your language. + +Once you have done this, send a pull request to the ``doctrine/inflector`` repository with the additions. + +Custom Setup +============ + +If you want to setup custom singular and plural rules, you can configure these in the factory: + +.. code-block:: php + + use Doctrine\Inflector\InflectorFactory; + use Doctrine\Inflector\Rules\Pattern; + use Doctrine\Inflector\Rules\Patterns; + use Doctrine\Inflector\Rules\Ruleset; + use Doctrine\Inflector\Rules\Substitution; + use Doctrine\Inflector\Rules\Substitutions; + use Doctrine\Inflector\Rules\Transformation; + use Doctrine\Inflector\Rules\Transformations; + use Doctrine\Inflector\Rules\Word; + + $inflector = InflectorFactory::create() + ->withSingularRules( + new Ruleset( + new Transformations( + new Transformation(new Pattern('/^(bil)er$/i'), '\1'), + new Transformation(new Pattern('/^(inflec|contribu)tors$/i'), '\1ta') + ), + new Patterns(new Pattern('singulars')), + new Substitutions(new Substitution(new Word('spins'), new Word('spinor'))) + ) + ) + ->withPluralRules( + new Ruleset( + new Transformations( + new Transformation(new Pattern('^(bil)er$'), '\1'), + new Transformation(new Pattern('^(inflec|contribu)tors$'), '\1ta') + ), + new Patterns(new Pattern('noflect'), new Pattern('abtuse')), + new Substitutions( + new Substitution(new Word('amaze'), new Word('amazable')), + new Substitution(new Word('phone'), new Word('phonezes')) + ) + ) + ) + ->build(); + +No operation inflector +---------------------- + +The ``Doctrine\Inflector\NoopWordInflector`` may be used to configure an inflector that doesn't perform any operation for +pluralization and/or singularization. If will simply return the input as output. + +This is an implementation of the `Null Object design pattern `_. + +.. code-block:: php + + use Doctrine\Inflector\Inflector; + use Doctrine\Inflector\NoopWordInflector; + + $inflector = new Inflector(new NoopWordInflector(), new NoopWordInflector()); + +Tableize +======== + +Converts ``ModelName`` to ``model_name``: + +.. code-block:: php + + echo $inflector->tableize('ModelName'); // model_name + +Classify +======== + +Converts ``model_name`` to ``ModelName``: + +.. code-block:: php + + echo $inflector->classify('model_name'); // ModelName + +Camelize +======== + +This method uses `Classify`_ and then converts the first character to lowercase: + +.. code-block:: php + + echo $inflector->camelize('model_name'); // modelName + +Capitalize +========== + +Takes a string and capitalizes all of the words, like PHP's built-in +``ucwords`` function. This extends that behavior, however, by allowing the +word delimiters to be configured, rather than only separating on +whitespace. + +Here is an example: + +.. code-block:: php + + $string = 'top-o-the-morning to all_of_you!'; + + echo $inflector->capitalize($string); // Top-O-The-Morning To All_of_you! + + echo $inflector->capitalize($string, '-_ '); // Top-O-The-Morning To All_Of_You! + +Pluralize +========= + +Returns a word in plural form. + +.. code-block:: php + + echo $inflector->pluralize('browser'); // browsers + +Singularize +=========== + +Returns a word in singular form. + +.. code-block:: php + + echo $inflector->singularize('browsers'); // browser + +Urlize +====== + +Generate a URL friendly string from a string of text: + +.. code-block:: php + + echo $inflector->urlize('My first blog post'); // my-first-blog-post + +Unaccent +======== + +You can unaccent a string of text using the ``unaccent()`` method: + +.. code-block:: php + + echo $inflector->unaccent('año'); // ano + +Legacy API +========== + +The API present in Inflector 1.x is still available, but will be deprecated in a future release and dropped for 3.0. +Support for languages other than English is available in the 2.0 API only. + +Acknowledgements +================ + +The language rules in this library have been adapted from several different sources, including but not limited to: + +- `Ruby On Rails Inflector `_ +- `ICanBoogie Inflector `_ +- `CakePHP Inflector `_ diff --git a/plugins/vendor/doctrine/inflector/src/CachedWordInflector.php b/plugins/vendor/doctrine/inflector/src/CachedWordInflector.php new file mode 100644 index 00000000..2d529087 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/CachedWordInflector.php @@ -0,0 +1,24 @@ +wordInflector = $wordInflector; + } + + public function inflect(string $word): string + { + return $this->cache[$word] ?? $this->cache[$word] = $this->wordInflector->inflect($word); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/GenericLanguageInflectorFactory.php b/plugins/vendor/doctrine/inflector/src/GenericLanguageInflectorFactory.php new file mode 100644 index 00000000..166061d2 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/GenericLanguageInflectorFactory.php @@ -0,0 +1,66 @@ +singularRulesets[] = $this->getSingularRuleset(); + $this->pluralRulesets[] = $this->getPluralRuleset(); + } + + final public function build(): Inflector + { + return new Inflector( + new CachedWordInflector(new RulesetInflector( + ...$this->singularRulesets + )), + new CachedWordInflector(new RulesetInflector( + ...$this->pluralRulesets + )) + ); + } + + final public function withSingularRules(?Ruleset $singularRules, bool $reset = false): LanguageInflectorFactory + { + if ($reset) { + $this->singularRulesets = []; + } + + if ($singularRules instanceof Ruleset) { + array_unshift($this->singularRulesets, $singularRules); + } + + return $this; + } + + final public function withPluralRules(?Ruleset $pluralRules, bool $reset = false): LanguageInflectorFactory + { + if ($reset) { + $this->pluralRulesets = []; + } + + if ($pluralRules instanceof Ruleset) { + array_unshift($this->pluralRulesets, $pluralRules); + } + + return $this; + } + + abstract protected function getSingularRuleset(): Ruleset; + + abstract protected function getPluralRuleset(): Ruleset; +} diff --git a/plugins/vendor/doctrine/inflector/src/Inflector.php b/plugins/vendor/doctrine/inflector/src/Inflector.php new file mode 100644 index 00000000..610a4cf4 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Inflector.php @@ -0,0 +1,507 @@ + 'A', + 'Á' => 'A', + 'Â' => 'A', + 'Ã' => 'A', + 'Ä' => 'Ae', + 'Æ' => 'Ae', + 'Å' => 'Aa', + 'æ' => 'a', + 'Ç' => 'C', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ñ' => 'N', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ö' => 'Oe', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ü' => 'Ue', + 'Ý' => 'Y', + 'ß' => 'ss', + 'à' => 'a', + 'á' => 'a', + 'â' => 'a', + 'ã' => 'a', + 'ä' => 'ae', + 'å' => 'aa', + 'ç' => 'c', + 'è' => 'e', + 'é' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ñ' => 'n', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ö' => 'oe', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ü' => 'ue', + 'ý' => 'y', + 'ÿ' => 'y', + 'Ā' => 'A', + 'ā' => 'a', + 'Ă' => 'A', + 'ă' => 'a', + 'Ą' => 'A', + 'ą' => 'a', + 'Ć' => 'C', + 'ć' => 'c', + 'Ĉ' => 'C', + 'ĉ' => 'c', + 'Ċ' => 'C', + 'ċ' => 'c', + 'Č' => 'C', + 'č' => 'c', + 'Ď' => 'D', + 'ď' => 'd', + 'Đ' => 'D', + 'đ' => 'd', + 'Ē' => 'E', + 'ē' => 'e', + 'Ĕ' => 'E', + 'ĕ' => 'e', + 'Ė' => 'E', + 'ė' => 'e', + 'Ę' => 'E', + 'ę' => 'e', + 'Ě' => 'E', + 'ě' => 'e', + 'Ĝ' => 'G', + 'ĝ' => 'g', + 'Ğ' => 'G', + 'ğ' => 'g', + 'Ġ' => 'G', + 'ġ' => 'g', + 'Ģ' => 'G', + 'ģ' => 'g', + 'Ĥ' => 'H', + 'ĥ' => 'h', + 'Ħ' => 'H', + 'ħ' => 'h', + 'Ĩ' => 'I', + 'ĩ' => 'i', + 'Ī' => 'I', + 'ī' => 'i', + 'Ĭ' => 'I', + 'ĭ' => 'i', + 'Į' => 'I', + 'į' => 'i', + 'İ' => 'I', + 'ı' => 'i', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'Ķ' => 'K', + 'ķ' => 'k', + 'ĸ' => 'k', + 'Ĺ' => 'L', + 'ĺ' => 'l', + 'Ļ' => 'L', + 'ļ' => 'l', + 'Ľ' => 'L', + 'ľ' => 'l', + 'Ŀ' => 'L', + 'ŀ' => 'l', + 'Ł' => 'L', + 'ł' => 'l', + 'Ń' => 'N', + 'ń' => 'n', + 'Ņ' => 'N', + 'ņ' => 'n', + 'Ň' => 'N', + 'ň' => 'n', + 'ʼn' => 'N', + 'Ŋ' => 'n', + 'ŋ' => 'N', + 'Ō' => 'O', + 'ō' => 'o', + 'Ŏ' => 'O', + 'ŏ' => 'o', + 'Ő' => 'O', + 'ő' => 'o', + 'Œ' => 'OE', + 'œ' => 'oe', + 'Ø' => 'O', + 'ø' => 'o', + 'Ŕ' => 'R', + 'ŕ' => 'r', + 'Ŗ' => 'R', + 'ŗ' => 'r', + 'Ř' => 'R', + 'ř' => 'r', + 'Ś' => 'S', + 'ś' => 's', + 'Ŝ' => 'S', + 'ŝ' => 's', + 'Ş' => 'S', + 'ş' => 's', + 'Š' => 'S', + 'š' => 's', + 'Ţ' => 'T', + 'ţ' => 't', + 'Ť' => 'T', + 'ť' => 't', + 'Ŧ' => 'T', + 'ŧ' => 't', + 'Ũ' => 'U', + 'ũ' => 'u', + 'Ū' => 'U', + 'ū' => 'u', + 'Ŭ' => 'U', + 'ŭ' => 'u', + 'Ů' => 'U', + 'ů' => 'u', + 'Ű' => 'U', + 'ű' => 'u', + 'Ų' => 'U', + 'ų' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ŷ' => 'Y', + 'ŷ' => 'y', + 'Ÿ' => 'Y', + 'Ź' => 'Z', + 'ź' => 'z', + 'Ż' => 'Z', + 'ż' => 'z', + 'Ž' => 'Z', + 'ž' => 'z', + 'ſ' => 's', + '€' => 'E', + '£' => '', + ]; + + /** @var WordInflector */ + private $singularizer; + + /** @var WordInflector */ + private $pluralizer; + + public function __construct(WordInflector $singularizer, WordInflector $pluralizer) + { + $this->singularizer = $singularizer; + $this->pluralizer = $pluralizer; + } + + /** + * Converts a word into the format for a Doctrine table name. Converts 'ModelName' to 'model_name'. + */ + public function tableize(string $word): string + { + $tableized = preg_replace('~(?<=\\w)([A-Z])~u', '_$1', $word); + + if ($tableized === null) { + throw new RuntimeException(sprintf( + 'preg_replace returned null for value "%s"', + $word + )); + } + + return mb_strtolower($tableized); + } + + /** + * Converts a word into the format for a Doctrine class name. Converts 'table_name' to 'TableName'. + */ + public function classify(string $word): string + { + return str_replace([' ', '_', '-'], '', ucwords($word, ' _-')); + } + + /** + * Camelizes a word. This uses the classify() method and turns the first character to lowercase. + */ + public function camelize(string $word): string + { + return lcfirst($this->classify($word)); + } + + /** + * Uppercases words with configurable delimiters between words. + * + * Takes a string and capitalizes all of the words, like PHP's built-in + * ucwords function. This extends that behavior, however, by allowing the + * word delimiters to be configured, rather than only separating on + * whitespace. + * + * Here is an example: + * + * capitalize($string); + * // Top-O-The-Morning To All_of_you! + * + * echo $inflector->capitalize($string, '-_ '); + * // Top-O-The-Morning To All_Of_You! + * ?> + * + * + * @param string $string The string to operate on. + * @param string $delimiters A list of word separators. + * + * @return string The string with all delimiter-separated words capitalized. + */ + public function capitalize(string $string, string $delimiters = " \n\t\r\0\x0B-"): string + { + return ucwords($string, $delimiters); + } + + /** + * Checks if the given string seems like it has utf8 characters in it. + * + * @param string $string The string to check for utf8 characters in. + */ + public function seemsUtf8(string $string): bool + { + for ($i = 0; $i < strlen($string); $i++) { + if (ord($string[$i]) < 0x80) { + continue; // 0bbbbbbb + } + + if ((ord($string[$i]) & 0xE0) === 0xC0) { + $n = 1; // 110bbbbb + } elseif ((ord($string[$i]) & 0xF0) === 0xE0) { + $n = 2; // 1110bbbb + } elseif ((ord($string[$i]) & 0xF8) === 0xF0) { + $n = 3; // 11110bbb + } elseif ((ord($string[$i]) & 0xFC) === 0xF8) { + $n = 4; // 111110bb + } elseif ((ord($string[$i]) & 0xFE) === 0xFC) { + $n = 5; // 1111110b + } else { + return false; // Does not match any model + } + + for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? + if (++$i === strlen($string) || ((ord($string[$i]) & 0xC0) !== 0x80)) { + return false; + } + } + } + + return true; + } + + /** + * Remove any illegal characters, accents, etc. + * + * @param string $string String to unaccent + * + * @return string Unaccented string + */ + public function unaccent(string $string): string + { + if (preg_match('/[\x80-\xff]/', $string) === false) { + return $string; + } + + if ($this->seemsUtf8($string)) { + $string = strtr($string, self::ACCENTED_CHARACTERS); + } else { + $characters = []; + + // Assume ISO-8859-1 if not UTF-8 + $characters['in'] = + chr(128) + . chr(131) + . chr(138) + . chr(142) + . chr(154) + . chr(158) + . chr(159) + . chr(162) + . chr(165) + . chr(181) + . chr(192) + . chr(193) + . chr(194) + . chr(195) + . chr(196) + . chr(197) + . chr(199) + . chr(200) + . chr(201) + . chr(202) + . chr(203) + . chr(204) + . chr(205) + . chr(206) + . chr(207) + . chr(209) + . chr(210) + . chr(211) + . chr(212) + . chr(213) + . chr(214) + . chr(216) + . chr(217) + . chr(218) + . chr(219) + . chr(220) + . chr(221) + . chr(224) + . chr(225) + . chr(226) + . chr(227) + . chr(228) + . chr(229) + . chr(231) + . chr(232) + . chr(233) + . chr(234) + . chr(235) + . chr(236) + . chr(237) + . chr(238) + . chr(239) + . chr(241) + . chr(242) + . chr(243) + . chr(244) + . chr(245) + . chr(246) + . chr(248) + . chr(249) + . chr(250) + . chr(251) + . chr(252) + . chr(253) + . chr(255); + + $characters['out'] = 'EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy'; + + $string = strtr($string, $characters['in'], $characters['out']); + + $doubleChars = []; + + $doubleChars['in'] = [ + chr(140), + chr(156), + chr(198), + chr(208), + chr(222), + chr(223), + chr(230), + chr(240), + chr(254), + ]; + + $doubleChars['out'] = ['OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th']; + + $string = str_replace($doubleChars['in'], $doubleChars['out'], $string); + } + + return $string; + } + + /** + * Convert any passed string to a url friendly string. + * Converts 'My first blog post' to 'my-first-blog-post' + * + * @param string $string String to urlize. + * + * @return string Urlized string. + */ + public function urlize(string $string): string + { + // Remove all non url friendly characters with the unaccent function + $unaccented = $this->unaccent($string); + + if (function_exists('mb_strtolower')) { + $lowered = mb_strtolower($unaccented); + } else { + $lowered = strtolower($unaccented); + } + + $replacements = [ + '/\W/' => ' ', + '/([A-Z]+)([A-Z][a-z])/' => '\1_\2', + '/([a-z\d])([A-Z])/' => '\1_\2', + '/[^A-Z^a-z^0-9^\/]+/' => '-', + ]; + + $urlized = $lowered; + + foreach ($replacements as $pattern => $replacement) { + $replaced = preg_replace($pattern, $replacement, $urlized); + + if ($replaced === null) { + throw new RuntimeException(sprintf( + 'preg_replace returned null for value "%s"', + $urlized + )); + } + + $urlized = $replaced; + } + + return trim($urlized, '-'); + } + + /** + * Returns a word in singular form. + * + * @param string $word The word in plural form. + * + * @return string The word in singular form. + */ + public function singularize(string $word): string + { + return $this->singularizer->inflect($word); + } + + /** + * Returns a word in plural form. + * + * @param string $word The word in singular form. + * + * @return string The word in plural form. + */ + public function pluralize(string $word): string + { + return $this->pluralizer->inflect($word); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/InflectorFactory.php b/plugins/vendor/doctrine/inflector/src/InflectorFactory.php new file mode 100644 index 00000000..3556b783 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/InflectorFactory.php @@ -0,0 +1,60 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/English/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/English/Uninflected.php new file mode 100644 index 00000000..02257de1 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/English/Uninflected.php @@ -0,0 +1,189 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Esperanto/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/Esperanto/Uninflected.php new file mode 100644 index 00000000..ed04c931 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Esperanto/Uninflected.php @@ -0,0 +1,28 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/French/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/French/Uninflected.php new file mode 100644 index 00000000..1c2b99a3 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/French/Uninflected.php @@ -0,0 +1,31 @@ + */ + public static function getSingular(): iterable + { + // Reverse of -sce → -scia (fasce → fascia) + yield new Transformation(new Pattern('([aeiou])sce$'), '\\1scia'); + + // Reverse of -cie → -cia (farmacia → farmacie) + yield new Transformation(new Pattern('cie$'), 'cia'); + + // Reverse of -gie → -gia (bugia → bugie) + yield new Transformation(new Pattern('gie$'), 'gia'); + + // Reverse of -ce → -cia (arance → arancia) + yield new Transformation(new Pattern('([^aeiou])ce$'), '\1cia'); + + // Reverse of -ge → -gia (valige → valigia) + yield new Transformation(new Pattern('([^aeiou])ge$'), '\1gia'); + + // Reverse of -chi → -co (bachi → baco) + yield new Transformation(new Pattern('([bcdfghjklmnpqrstvwxyz][aeiou])chi$'), '\1co'); + + // Reverse of -ghi → -go (laghi → lago) + yield new Transformation(new Pattern('([bcdfghjklmnpqrstvwxyz][aeiou])ghi$'), '\1go'); + + // Reverse of -ci → -co (medici → medico) + yield new Transformation(new Pattern('([aeiou][bcdfghjklmnpqrstvwxyz])ci$'), '\1co'); + + // Reverse of -gi → -go (psicologi → psicologo) + yield new Transformation(new Pattern('([aeiou][bcdfghjklmnpqrstvwxyz])gi$'), '\1go'); + + // Reverse of -i → -io (zii → zio, negozi → negozio) + // This is more complex due to Italian's stress patterns, but we'll handle the basic case + yield new Transformation(new Pattern('([^aeiou])i$'), '\1io'); + + // Handle words that end with -i but should go to -co/-go (amici → amico, not amice) + yield new Transformation(new Pattern('([^aeiou])ci$'), '\1co'); + yield new Transformation(new Pattern('([^aeiou])gi$'), '\1go'); + + // Reverse of -a → -e + yield new Transformation(new Pattern('e$'), 'a'); + + // Reverse of -e → -i + yield new Transformation(new Pattern('i$'), 'e'); + + // Reverse of -o → -i + yield new Transformation(new Pattern('i$'), 'o'); + } + + /** @return iterable */ + public static function getPlural(): iterable + { + // Words ending in -scia without stress on 'i' become -sce (e.g. fascia → fasce) + yield new Transformation(new Pattern('([aeiou])scia$'), '\\1sce'); + + // Words ending in -cia/gia with stress on 'i' keep the 'i' in plural + yield new Transformation(new Pattern('cia$'), 'cie'); // e.g. farmacia → farmacie + yield new Transformation(new Pattern('gia$'), 'gie'); // e.g. bugia → bugie + + // Words ending in -cia/gia without stress on 'i' lose the 'i' in plural + yield new Transformation(new Pattern('([^aeiou])cia$'), '\\1ce'); // e.g. arancia → arance + yield new Transformation(new Pattern('([^aeiou])gia$'), '\\1ge'); // e.g. valigia → valige + + // Words ending in -co/-go with stress on 'o' become -chi/-ghi + yield new Transformation(new Pattern('([bcdfghjklmnpqrstvwxyz][aeiou])co$'), '\\1chi'); // e.g. baco → bachi + yield new Transformation(new Pattern('([bcdfghjklmnpqrstvwxyz][aeiou])go$'), '\\1ghi'); // e.g. lago → laghi + + // Words ending in -co/-go with stress on the penultimate syllable become -ci/-gi + yield new Transformation(new Pattern('([aeiou][bcdfghjklmnpqrstvwxyz])co$'), '\\1ci'); // e.g. medico → medici + yield new Transformation(new Pattern('([aeiou][bcdfghjklmnpqrstvwxyz])go$'), '\\1gi'); // e.g. psicologo → psicologi + + // Words ending in -io with stress on 'i' keep the 'i' in plural + yield new Transformation(new Pattern('([^aeiou])io$'), '\\1i'); // e.g. zio → zii + + // Words ending in -io with stress on 'o' lose the 'i' in plural + yield new Transformation(new Pattern('([aeiou])io$'), '\\1i'); // e.g. negozio → negozi + + // Standard ending rules + yield new Transformation(new Pattern('a$'), 'e'); // -a → -e + yield new Transformation(new Pattern('e$'), 'i'); // -e → -i + yield new Transformation(new Pattern('o$'), 'i'); // -o → -i + } + + /** @return iterable */ + public static function getIrregular(): iterable + { + // Irregular substitutions (singular => plural) + $irregulars = [ + 'ala' => 'ali', + 'albergo' => 'alberghi', + 'amica' => 'amiche', + 'amico' => 'amici', + 'ampio' => 'ampi', + 'arancia' => 'arance', + 'arma' => 'armi', + 'asparago' => 'asparagi', + 'banca' => 'banche', + 'belga' => 'belgi', + 'braccio' => 'braccia', + 'budello' => 'budella', + 'bue' => 'buoi', + 'caccia' => 'cacce', + 'calcagno' => 'calcagna', + 'camicia' => 'camicie', + 'cane' => 'cani', + 'capitale' => 'capitali', + 'carcere' => 'carceri', + 'casa' => 'case', + 'cavaliere' => 'cavalieri', + 'centinaio' => 'centinaia', + 'cerchio' => 'cerchia', + 'cervello' => 'cervella', + 'chiave' => 'chiavi', + 'chirurgo' => 'chirurgi', + 'ciglio' => 'ciglia', + 'città' => 'città', + 'corno' => 'corna', + 'corpo' => 'corpi', + 'crisi' => 'crisi', + 'dente' => 'denti', + 'dio' => 'dei', + 'dito' => 'dita', + 'dottore' => 'dottori', + 'fiore' => 'fiori', + 'fratello' => 'fratelli', + 'fuoco' => 'fuochi', + 'gamba' => 'gambe', + 'ginocchio' => 'ginocchia', + 'gioco' => 'giochi', + 'giornale' => 'giornali', + 'giraffa' => 'giraffe', + 'labbro' => 'labbra', + 'lenzuolo' => 'lenzuola', + 'libro' => 'libri', + 'madre' => 'madri', + 'maestro' => 'maestri', + 'magico' => 'magici', + 'mago' => 'maghi', + 'maniaco' => 'maniaci', + 'manico' => 'manici', + 'mano' => 'mani', + 'medico' => 'medici', + 'membro' => 'membri', + 'metropoli' => 'metropoli', + 'migliaio' => 'migliaia', + 'miglio' => 'miglia', + 'mille' => 'mila', + 'mio' => 'miei', + 'moglie' => 'mogli', + 'mosaico' => 'mosaici', + 'muro' => 'muri', + 'nemico' => 'nemici', + 'nome' => 'nomi', + 'occhio' => 'occhi', + 'orecchio' => 'orecchi', + 'osso' => 'ossa', + 'paio' => 'paia', + 'pane' => 'pani', + 'papa' => 'papi', + 'pasta' => 'paste', + 'penna' => 'penne', + 'pesce' => 'pesci', + 'piede' => 'piedi', + 'pittore' => 'pittori', + 'poeta' => 'poeti', + 'porco' => 'porci', + 'porto' => 'porti', + 'problema' => 'problemi', + 'ragazzo' => 'ragazzi', + 're' => 're', + 'rene' => 'reni', + 'riso' => 'risa', + 'rosa' => 'rosa', + 'sale' => 'sali', + 'sarto' => 'sarti', + 'scuola' => 'scuole', + 'serie' => 'serie', + 'serramento' => 'serramenta', + 'sorella' => 'sorelle', + 'specie' => 'specie', + 'staio' => 'staia', + 'stazione' => 'stazioni', + 'strido' => 'strida', + 'strillo' => 'strilla', + 'studio' => 'studi', + 'suo' => 'suoi', + 'superficie' => 'superfici', + 'tavolo' => 'tavoli', + 'tempio' => 'templi', + 'treno' => 'treni', + 'tuo' => 'tuoi', + 'uomo' => 'uomini', + 'uovo' => 'uova', + 'urlo' => 'urla', + 'valigia' => 'valigie', + 'vestigio' => 'vestigia', + 'vino' => 'vini', + 'viola' => 'viola', + 'zio' => 'zii', + ]; + + foreach ($irregulars as $singular => $plural) { + yield new Substitution(new Word($singular), new Word($plural)); + } + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Italian/InflectorFactory.php b/plugins/vendor/doctrine/inflector/src/Rules/Italian/InflectorFactory.php new file mode 100644 index 00000000..41685c4a --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Italian/InflectorFactory.php @@ -0,0 +1,21 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Italian/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/Italian/Uninflected.php new file mode 100644 index 00000000..067a92a6 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Italian/Uninflected.php @@ -0,0 +1,80 @@ + */ + public static function getSingular(): iterable + { + yield from self::getDefault(); + } + + /** @return iterable */ + public static function getPlural(): iterable + { + yield from self::getDefault(); + } + + /** @return iterable */ + private static function getDefault(): iterable + { + // Invariable words (same form in singular and plural) + $invariables = [ + 'alpaca', + 'auto', + 'bar', + 'blu', + 'boia', + 'boomerang', + 'brindisi', + 'campus', + 'computer', + 'crisi', + 'crocevia', + 'dopocena', + 'film', + 'foto', + 'fuchsia', + 'gnu', + 'gorilla', + 'gru', + 'iguana', + 'kamikaze', + 'karaoke', + 'koala', + 'lama', + 'menu', + 'metropoli', + 'moto', + 'opossum', + 'panda', + 'quiz', + 'radio', + 're', + 'scacciapensieri', + 'serie', + 'smartphone', + 'sosia', + 'sottoscala', + 'specie', + 'sport', + 'tablet', + 'taxi', + 'vaglia', + 'virtù', + 'virus', + 'yogurt', + 'foto', + 'fuchsia', + ]; + + foreach ($invariables as $word) { + yield new Pattern($word); + } + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Inflectible.php b/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Inflectible.php new file mode 100644 index 00000000..1e952d84 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Inflectible.php @@ -0,0 +1,34 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Uninflected.php new file mode 100644 index 00000000..5d8d3b3a --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/NorwegianBokmal/Uninflected.php @@ -0,0 +1,30 @@ +pattern = $pattern; + + if (isset($this->pattern[0]) && $this->pattern[0] === '/') { + $this->regex = $this->pattern; + } else { + $this->regex = '/' . $this->pattern . '/i'; + } + } + + public function getPattern(): string + { + return $this->pattern; + } + + public function getRegex(): string + { + return $this->regex; + } + + public function matches(string $word): bool + { + return preg_match($this->getRegex(), $word) === 1; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Patterns.php b/plugins/vendor/doctrine/inflector/src/Rules/Patterns.php new file mode 100644 index 00000000..16594c4f --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Patterns.php @@ -0,0 +1,29 @@ +getPattern(); + }, $patterns); + + $this->regex = '/^(?:' . implode('|', $patterns) . ')$/i'; + } + + public function matches(string $word): bool + { + return preg_match($this->regex, $word, $regs) === 1; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Inflectible.php b/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Inflectible.php new file mode 100644 index 00000000..0d41fe7e --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Inflectible.php @@ -0,0 +1,98 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Uninflected.php new file mode 100644 index 00000000..b8e988f8 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Portuguese/Uninflected.php @@ -0,0 +1,32 @@ +regular = $regular; + $this->uninflected = $uninflected; + $this->irregular = $irregular; + } + + public function getRegular(): Transformations + { + return $this->regular; + } + + public function getUninflected(): Patterns + { + return $this->uninflected; + } + + public function getIrregular(): Substitutions + { + return $this->irregular; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Inflectible.php b/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Inflectible.php new file mode 100644 index 00000000..91294609 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Inflectible.php @@ -0,0 +1,47 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Uninflected.php new file mode 100644 index 00000000..c26ebe9c --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Spanish/Uninflected.php @@ -0,0 +1,30 @@ +from = $from; + $this->to = $to; + } + + public function getFrom(): Word + { + return $this->from; + } + + public function getTo(): Word + { + return $this->to; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Substitutions.php b/plugins/vendor/doctrine/inflector/src/Rules/Substitutions.php new file mode 100644 index 00000000..17ee2961 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Substitutions.php @@ -0,0 +1,57 @@ +substitutions[$substitution->getFrom()->getWord()] = $substitution; + } + } + + public function getFlippedSubstitutions(): Substitutions + { + $substitutions = []; + + foreach ($this->substitutions as $substitution) { + $substitutions[] = new Substitution( + $substitution->getTo(), + $substitution->getFrom() + ); + } + + return new Substitutions(...$substitutions); + } + + public function inflect(string $word): string + { + $lowerWord = strtolower($word); + + if (isset($this->substitutions[$lowerWord])) { + $firstLetterUppercase = $lowerWord[0] !== $word[0]; + + $toWord = $this->substitutions[$lowerWord]->getTo()->getWord(); + + if ($firstLetterUppercase) { + return strtoupper($toWord[0]) . substr($toWord, 1); + } + + return $toWord; + } + + return $word; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Transformation.php b/plugins/vendor/doctrine/inflector/src/Rules/Transformation.php new file mode 100644 index 00000000..30dcd594 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Transformation.php @@ -0,0 +1,39 @@ +pattern = $pattern; + $this->replacement = $replacement; + } + + public function getPattern(): Pattern + { + return $this->pattern; + } + + public function getReplacement(): string + { + return $this->replacement; + } + + public function inflect(string $word): string + { + return (string) preg_replace($this->pattern->getRegex(), $this->replacement, $word); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Transformations.php b/plugins/vendor/doctrine/inflector/src/Rules/Transformations.php new file mode 100644 index 00000000..b6a48fa8 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Transformations.php @@ -0,0 +1,29 @@ +transformations = $transformations; + } + + public function inflect(string $word): string + { + foreach ($this->transformations as $transformation) { + if ($transformation->getPattern()->matches($word)) { + return $transformation->inflect($word); + } + } + + return $word; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Inflectible.php b/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Inflectible.php new file mode 100644 index 00000000..a2bda0d9 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Inflectible.php @@ -0,0 +1,34 @@ +getFlippedSubstitutions() + ); + } + + public static function getPluralRuleset(): Ruleset + { + return new Ruleset( + new Transformations(...Inflectible::getPlural()), + new Patterns(...Uninflected::getPlural()), + new Substitutions(...Inflectible::getIrregular()) + ); + } +} diff --git a/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Uninflected.php b/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Uninflected.php new file mode 100644 index 00000000..ec1c37dd --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/Rules/Turkish/Uninflected.php @@ -0,0 +1,30 @@ +word = $word; + } + + public function getWord(): string + { + return $this->word; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/RulesetInflector.php b/plugins/vendor/doctrine/inflector/src/RulesetInflector.php new file mode 100644 index 00000000..12b2ed5b --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/RulesetInflector.php @@ -0,0 +1,56 @@ +rulesets = array_merge([$ruleset], $rulesets); + } + + public function inflect(string $word): string + { + if ($word === '') { + return ''; + } + + foreach ($this->rulesets as $ruleset) { + if ($ruleset->getUninflected()->matches($word)) { + return $word; + } + + $inflected = $ruleset->getIrregular()->inflect($word); + + if ($inflected !== $word) { + return $inflected; + } + + $inflected = $ruleset->getRegular()->inflect($word); + + if ($inflected !== $word) { + return $inflected; + } + } + + return $word; + } +} diff --git a/plugins/vendor/doctrine/inflector/src/WordInflector.php b/plugins/vendor/doctrine/inflector/src/WordInflector.php new file mode 100644 index 00000000..b88b1d69 --- /dev/null +++ b/plugins/vendor/doctrine/inflector/src/WordInflector.php @@ -0,0 +1,10 @@ +all(); + } elseif (is_array($values)) { + $results[] = $values; + } + } + + return array_merge([], ...$results); + } + + /** + * Cross join the given arrays, returning all possible permutations. + * + * @param iterable ...$arrays + * @return array + */ + public static function crossJoin(...$arrays) + { + $results = [[]]; + + foreach ($arrays as $index => $array) { + $append = []; + + foreach ($results as $product) { + foreach ($array as $item) { + $product[$index] = $item; + + $append[] = $product; + } + } + + $results = $append; + } + + return $results; + } + + /** + * Divide an array into two arrays. One with keys and the other with values. + * + * @param array $array + * @return array + */ + public static function divide($array) + { + return [array_keys($array), array_values($array)]; + } + + /** + * Flatten a multi-dimensional associative array with dots. + * + * @param iterable $array + * @param string $prepend + * @return array + */ + public static function dot($array, $prepend = '') + { + $results = []; + + $flatten = function ($data, $prefix) use (&$results, &$flatten): void { + foreach ($data as $key => $value) { + $newKey = $prefix.$key; + + if (is_array($value) && ! empty($value)) { + $flatten($value, $newKey.'.'); + } else { + $results[$newKey] = $value; + } + } + }; + + $flatten($array, $prepend); + + return $results; + } + + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @param iterable $array + * @return array + */ + public static function undot($array) + { + $results = []; + + foreach ($array as $key => $value) { + static::set($results, $key, $value); + } + + return $results; + } + + /** + * Get all of the given array except for a specified array of keys. + * + * @param array $array + * @param array|string|int|float $keys + * @return array + */ + public static function except($array, $keys) + { + static::forget($array, $keys); + + return $array; + } + + /** + * Determine if the given key exists in the provided array. + * + * @param \ArrayAccess|array $array + * @param string|int|float $key + * @return bool + */ + public static function exists($array, $key) + { + if ($array instanceof Enumerable) { + return $array->has($key); + } + + if ($array instanceof ArrayAccess) { + return $array->offsetExists($key); + } + + if (is_float($key)) { + $key = (string) $key; + } + + return array_key_exists($key, $array); + } + + /** + * Return the first element in an array passing a given truth test. + * + * @template TKey + * @template TValue + * @template TFirstDefault + * + * @param iterable $array + * @param (callable(TValue, TKey): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault + */ + public static function first($array, ?callable $callback = null, $default = null) + { + if (is_null($callback)) { + if (empty($array)) { + return value($default); + } + + if (is_array($array)) { + return array_first($array); + } + + foreach ($array as $item) { + return $item; + } + + return value($default); + } + + $key = array_find_key($array, $callback); + + return $key !== null ? $array[$key] : value($default); + } + + /** + * Return the last element in an array passing a given truth test. + * + * @template TKey + * @template TValue + * @template TLastDefault + * + * @param iterable $array + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault + */ + public static function last($array, ?callable $callback = null, $default = null) + { + if (is_null($callback)) { + return empty($array) ? value($default) : array_last($array); + } + + return static::first(array_reverse($array, true), $callback, $default); + } + + /** + * Take the first or last {$limit} items from an array. + * + * @param array $array + * @param int $limit + * @return array + */ + public static function take($array, $limit) + { + if ($limit < 0) { + return array_slice($array, $limit, abs($limit)); + } + + return array_slice($array, 0, $limit); + } + + /** + * Flatten a multi-dimensional array into a single level. + * + * @param iterable $array + * @param int $depth + * @return array + */ + public static function flatten($array, $depth = INF) + { + $result = []; + + foreach ($array as $item) { + $item = $item instanceof Collection ? $item->all() : $item; + + if (! is_array($item)) { + $result[] = $item; + } else { + $values = $depth === 1 + ? array_values($item) + : static::flatten($item, $depth - 1); + + foreach ($values as $value) { + $result[] = $value; + } + } + } + + return $result; + } + + /** + * Get a float item from an array using "dot" notation. + */ + public static function float(ArrayAccess|array $array, string|int|null $key, ?float $default = null): float + { + $value = Arr::get($array, $key, $default); + + if (! is_float($value)) { + throw new InvalidArgumentException( + sprintf('Array value for key [%s] must be a float, %s found.', $key, gettype($value)) + ); + } + + return $value; + } + + /** + * Remove one or many array items from a given array using "dot" notation. + * + * @param array $array + * @param array|string|int|float $keys + * @return void + */ + public static function forget(&$array, $keys) + { + $original = &$array; + + $keys = (array) $keys; + + if (count($keys) === 0) { + return; + } + + foreach ($keys as $key) { + // if the exact key exists in the top-level, remove it + if (static::exists($array, $key)) { + unset($array[$key]); + + continue; + } + + $parts = explode('.', $key); + + // clean up before each pass + $array = &$original; + + while (count($parts) > 1) { + $part = array_shift($parts); + + if (isset($array[$part]) && static::accessible($array[$part])) { + $array = &$array[$part]; + } else { + continue 2; + } + } + + unset($array[array_shift($parts)]); + } + } + + /** + * Get the underlying array of items from the given argument. + * + * @template TKey of array-key = array-key + * @template TValue = mixed + * + * @param array|Enumerable|Arrayable|WeakMap|Traversable|Jsonable|JsonSerializable|object $items + * @return ($items is WeakMap ? list : array) + * + * @throws \InvalidArgumentException + */ + public static function from($items) + { + return match (true) { + is_array($items) => $items, + $items instanceof Enumerable => $items->all(), + $items instanceof Arrayable => $items->toArray(), + $items instanceof WeakMap => iterator_to_array($items, false), + $items instanceof Traversable => iterator_to_array($items), + $items instanceof Jsonable => json_decode($items->toJson(), true), + $items instanceof JsonSerializable => (array) $items->jsonSerialize(), + is_object($items) => (array) $items, + default => throw new InvalidArgumentException('Items cannot be represented by a scalar value.'), + }; + } + + /** + * Get an item from an array using "dot" notation. + * + * @param \ArrayAccess|array $array + * @param string|int|null $key + * @param mixed $default + * @return mixed + */ + public static function get($array, $key, $default = null) + { + if (! static::accessible($array)) { + return value($default); + } + + if (is_null($key)) { + return $array; + } + + if (static::exists($array, $key)) { + return $array[$key]; + } + + if (! str_contains($key, '.')) { + return $array[$key] ?? value($default); + } + + foreach (explode('.', $key) as $segment) { + if (static::accessible($array) && static::exists($array, $segment)) { + $array = $array[$segment]; + } else { + return value($default); + } + } + + return $array; + } + + /** + * Check if an item or items exist in an array using "dot" notation. + * + * @param \ArrayAccess|array $array + * @param string|array $keys + * @return bool + */ + public static function has($array, $keys) + { + $keys = (array) $keys; + + if (! $array || $keys === []) { + return false; + } + + foreach ($keys as $key) { + $subKeyArray = $array; + + if (static::exists($array, $key)) { + continue; + } + + foreach (explode('.', $key) as $segment) { + if (static::accessible($subKeyArray) && static::exists($subKeyArray, $segment)) { + $subKeyArray = $subKeyArray[$segment]; + } else { + return false; + } + } + } + + return true; + } + + /** + * Determine if all keys exist in an array using "dot" notation. + * + * @param \ArrayAccess|array $array + * @param string|array $keys + * @return bool + */ + public static function hasAll($array, $keys) + { + $keys = (array) $keys; + + if (! $array || $keys === []) { + return false; + } + + foreach ($keys as $key) { + if (! static::has($array, $key)) { + return false; + } + } + + return true; + } + + /** + * Determine if any of the keys exist in an array using "dot" notation. + * + * @param \ArrayAccess|array $array + * @param string|array $keys + * @return bool + */ + public static function hasAny($array, $keys) + { + if (is_null($keys)) { + return false; + } + + $keys = (array) $keys; + + if (! $array) { + return false; + } + + if ($keys === []) { + return false; + } + + foreach ($keys as $key) { + if (static::has($array, $key)) { + return true; + } + } + + return false; + } + + /** + * Determine if all items pass the given truth test. + * + * @param iterable $array + * @param (callable(mixed, array-key): bool) $callback + * @return bool + */ + public static function every($array, callable $callback) + { + return array_all($array, $callback); + } + + /** + * Determine if some items pass the given truth test. + * + * @param iterable $array + * @param (callable(mixed, array-key): bool) $callback + * @return bool + */ + public static function some($array, callable $callback) + { + return array_any($array, $callback); + } + + /** + * Get an integer item from an array using "dot" notation. + */ + public static function integer(ArrayAccess|array $array, string|int|null $key, ?int $default = null): int + { + $value = Arr::get($array, $key, $default); + + if (! is_int($value)) { + throw new InvalidArgumentException( + sprintf('Array value for key [%s] must be an integer, %s found.', $key, gettype($value)) + ); + } + + return $value; + } + + /** + * Determines if an array is associative. + * + * An array is "associative" if it doesn't have sequential numerical keys beginning with zero. + * + * @param array $array + * @return bool + */ + public static function isAssoc(array $array) + { + return ! array_is_list($array); + } + + /** + * Determines if an array is a list. + * + * An array is a "list" if all array keys are sequential integers starting from 0 with no gaps in between. + * + * @param array $array + * @return bool + */ + public static function isList($array) + { + return array_is_list($array); + } + + /** + * Join all items using a string. The final items can use a separate glue string. + * + * @param array $array + * @param string $glue + * @param string $finalGlue + * @return string + */ + public static function join($array, $glue, $finalGlue = '') + { + if ($finalGlue === '') { + return implode($glue, $array); + } + + if (count($array) === 0) { + return ''; + } + + if (count($array) === 1) { + return array_last($array); + } + + $finalItem = array_pop($array); + + return implode($glue, $array).$finalGlue.$finalItem; + } + + /** + * Key an associative array by a field or using a callback. + * + * @param array $array + * @param callable|array|string $keyBy + * @return array + */ + public static function keyBy($array, $keyBy) + { + return (new Collection($array))->keyBy($keyBy)->all(); + } + + /** + * Prepend the key names of an associative array. + * + * @param array $array + * @param string $prependWith + * @return array + */ + public static function prependKeysWith($array, $prependWith) + { + return static::mapWithKeys($array, fn ($item, $key) => [$prependWith.$key => $item]); + } + + /** + * Get a subset of the items from the given array. + * + * @param array $array + * @param array|string $keys + * @return array + */ + public static function only($array, $keys) + { + return array_intersect_key($array, array_flip((array) $keys)); + } + + /** + * Select an array of values from an array. + * + * @param array $array + * @param array|string $keys + * @return array + */ + public static function select($array, $keys) + { + $keys = static::wrap($keys); + + return static::map($array, function ($item) use ($keys) { + $result = []; + + foreach ($keys as $key) { + if (Arr::accessible($item) && Arr::exists($item, $key)) { + $result[$key] = $item[$key]; + } elseif (is_object($item) && isset($item->{$key})) { + $result[$key] = $item->{$key}; + } + } + + return $result; + }); + } + + /** + * Pluck an array of values from an array. + * + * @param iterable $array + * @param string|array|int|Closure|null $value + * @param string|array|Closure|null $key + * @return array + */ + public static function pluck($array, $value, $key = null) + { + $results = []; + + [$value, $key] = static::explodePluckParameters($value, $key); + + foreach ($array as $item) { + $itemValue = $value instanceof Closure + ? $value($item) + : data_get($item, $value); + + // If the key is "null", we will just append the value to the array and keep + // looping. Otherwise we will key the array using the value of the key we + // received from the developer. Then we'll return the final array form. + if (is_null($key)) { + $results[] = $itemValue; + } else { + $itemKey = $key instanceof Closure + ? $key($item) + : data_get($item, $key); + + if (is_object($itemKey) && method_exists($itemKey, '__toString')) { + $itemKey = (string) $itemKey; + } + + $results[$itemKey] = $itemValue; + } + } + + return $results; + } + + /** + * Explode the "value" and "key" arguments passed to "pluck". + * + * @param string|array|Closure $value + * @param string|array|Closure|null $key + * @return array + */ + protected static function explodePluckParameters($value, $key) + { + $value = is_string($value) ? explode('.', $value) : $value; + + $key = is_null($key) || is_array($key) || $key instanceof Closure ? $key : explode('.', $key); + + return [$value, $key]; + } + + /** + * Run a map over each of the items in the array. + * + * @param array $array + * @param callable $callback + * @return array + */ + public static function map(array $array, callable $callback) + { + $keys = array_keys($array); + + try { + $items = array_map($callback, $array, $keys); + } catch (ArgumentCountError) { + $items = array_map($callback, $array); + } + + return array_combine($keys, $items); + } + + /** + * Run an associative map over each of the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TKey + * @template TValue + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param array $array + * @param callable(TValue, TKey): array $callback + * @return array + */ + public static function mapWithKeys(array $array, callable $callback) + { + $result = []; + + foreach ($array as $key => $value) { + $assoc = $callback($value, $key); + + foreach ($assoc as $mapKey => $mapValue) { + $result[$mapKey] = $mapValue; + } + } + + return $result; + } + + /** + * Run a map over each nested chunk of items. + * + * @template TKey + * @template TValue + * + * @param array $array + * @param callable(mixed...): TValue $callback + * @return array + */ + public static function mapSpread(array $array, callable $callback) + { + return static::map($array, function ($chunk, $key) use ($callback) { + $chunk[] = $key; + + return $callback(...$chunk); + }); + } + + /** + * Push an item onto the beginning of an array. + * + * @param array $array + * @param mixed $value + * @param mixed $key + * @return array + */ + public static function prepend($array, $value, $key = null) + { + if (func_num_args() == 2) { + array_unshift($array, $value); + } else { + $array = [$key => $value] + $array; + } + + return $array; + } + + /** + * Get a value from the array, and remove it. + * + * @param array $array + * @param string|int $key + * @param mixed $default + * @return mixed + */ + public static function pull(&$array, $key, $default = null) + { + $value = static::get($array, $key, $default); + + static::forget($array, $key); + + return $value; + } + + /** + * Convert the array into a query string. + * + * @param array $array + * @return string + */ + public static function query($array) + { + return http_build_query($array, '', '&', PHP_QUERY_RFC3986); + } + + /** + * Get one or a specified number of random values from an array. + * + * @param array $array + * @param int|null $number + * @param bool $preserveKeys + * @return mixed + * + * @throws \InvalidArgumentException + */ + public static function random($array, $number = null, $preserveKeys = false) + { + $requested = is_null($number) ? 1 : $number; + + $count = count($array); + + if ($requested > $count) { + throw new InvalidArgumentException( + "You requested {$requested} items, but there are only {$count} items available." + ); + } + + if (empty($array) || (! is_null($number) && $number <= 0)) { + return is_null($number) ? null : []; + } + + $keys = (new Randomizer)->pickArrayKeys($array, $requested); + + if (is_null($number)) { + return $array[$keys[0]]; + } + + $results = []; + + if ($preserveKeys) { + foreach ($keys as $key) { + $results[$key] = $array[$key]; + } + } else { + foreach ($keys as $key) { + $results[] = $array[$key]; + } + } + + return $results; + } + + /** + * Set an array item to a given value using "dot" notation. + * + * If no key is given to the method, the entire array will be replaced. + * + * @param array $array + * @param string|int|null $key + * @param mixed $value + * @return array + */ + public static function set(&$array, $key, $value) + { + if (is_null($key)) { + return $array = $value; + } + + $keys = explode('.', $key); + + foreach ($keys as $i => $key) { + if (count($keys) === 1) { + break; + } + + unset($keys[$i]); + + // If the key doesn't exist at this depth, we will just create an empty array + // to hold the next value, allowing us to create the arrays to hold final + // values at the correct depth. Then we'll keep digging into the array. + if (! isset($array[$key]) || ! is_array($array[$key])) { + $array[$key] = []; + } + + $array = &$array[$key]; + } + + $array[array_shift($keys)] = $value; + + return $array; + } + + /** + * Push an item into an array using "dot" notation. + * + * @param \ArrayAccess|array $array + * @param string|int|null $key + * @param mixed $values + * @return array + */ + public static function push(ArrayAccess|array &$array, string|int|null $key, mixed ...$values): array + { + $target = static::array($array, $key, []); + + array_push($target, ...$values); + + return static::set($array, $key, $target); + } + + /** + * Shuffle the given array and return the result. + * + * @param array $array + * @return array + */ + public static function shuffle($array) + { + return (new Randomizer)->shuffleArray($array); + } + + /** + * Get the first item in the array, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param array $array + * @param (callable(mixed, array-key): array)|null $callback + * + * @throws \Illuminate\Support\ItemNotFoundException + * @throws \Illuminate\Support\MultipleItemsFoundException + */ + public static function sole($array, ?callable $callback = null) + { + if ($callback) { + $array = static::where($array, $callback); + } + + $count = count($array); + + if ($count === 0) { + throw new ItemNotFoundException; + } + + if ($count > 1) { + throw new MultipleItemsFoundException($count); + } + + return static::first($array); + } + + /** + * Sort the array using the given callback or "dot" notation. + * + * @param array $array + * @param callable|array|string|null $callback + * @return array + */ + public static function sort($array, $callback = null) + { + return (new Collection($array))->sortBy($callback)->all(); + } + + /** + * Sort the array in descending order using the given callback or "dot" notation. + * + * @param array $array + * @param callable|array|string|null $callback + * @return array + */ + public static function sortDesc($array, $callback = null) + { + return (new Collection($array))->sortByDesc($callback)->all(); + } + + /** + * Recursively sort an array by keys and values. + * + * @param array $array + * @param int $options + * @param bool $descending + * @return array + */ + public static function sortRecursive($array, $options = SORT_REGULAR, $descending = false) + { + foreach ($array as &$value) { + if (is_array($value)) { + $value = static::sortRecursive($value, $options, $descending); + } + } + + if (! array_is_list($array)) { + $descending + ? krsort($array, $options) + : ksort($array, $options); + } else { + $descending + ? rsort($array, $options) + : sort($array, $options); + } + + return $array; + } + + /** + * Recursively sort an array by keys and values in descending order. + * + * @param array $array + * @param int $options + * @return array + */ + public static function sortRecursiveDesc($array, $options = SORT_REGULAR) + { + return static::sortRecursive($array, $options, true); + } + + /** + * Get a string item from an array using "dot" notation. + */ + public static function string(ArrayAccess|array $array, string|int|null $key, ?string $default = null): string + { + $value = Arr::get($array, $key, $default); + + if (! is_string($value)) { + throw new InvalidArgumentException( + sprintf('Array value for key [%s] must be a string, %s found.', $key, gettype($value)) + ); + } + + return $value; + } + + /** + * Conditionally compile classes from an array into a CSS class list. + * + * @param array|string $array + * @return string + */ + public static function toCssClasses($array) + { + $classList = static::wrap($array); + + $classes = []; + + foreach ($classList as $class => $constraint) { + if (is_numeric($class)) { + $classes[] = $constraint; + } elseif ($constraint) { + $classes[] = $class; + } + } + + return implode(' ', $classes); + } + + /** + * Conditionally compile styles from an array into a style list. + * + * @param array|string $array + * @return string + */ + public static function toCssStyles($array) + { + $styleList = static::wrap($array); + + $styles = []; + + foreach ($styleList as $class => $constraint) { + if (is_numeric($class)) { + $styles[] = Str::finish($constraint, ';'); + } elseif ($constraint) { + $styles[] = Str::finish($class, ';'); + } + } + + return implode(' ', $styles); + } + + /** + * Filter the array using the given callback. + * + * @param array $array + * @param callable $callback + * @return array + */ + public static function where($array, callable $callback) + { + return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH); + } + + /** + * Filter the array using the negation of the given callback. + * + * @param array $array + * @param callable $callback + * @return array + */ + public static function reject($array, callable $callback) + { + return static::where($array, fn ($value, $key) => ! $callback($value, $key)); + } + + /** + * Partition the array into two arrays using the given callback. + * + * @template TKey of array-key + * @template TValue of mixed + * + * @param iterable $array + * @param callable(TValue, TKey): bool $callback + * @return array, array> + */ + public static function partition($array, callable $callback) + { + $passed = []; + $failed = []; + + foreach ($array as $key => $item) { + if ($callback($item, $key)) { + $passed[$key] = $item; + } else { + $failed[$key] = $item; + } + } + + return [$passed, $failed]; + } + + /** + * Filter items where the value is not null. + * + * @param array $array + * @return array + */ + public static function whereNotNull($array) + { + return static::where($array, fn ($value) => ! is_null($value)); + } + + /** + * If the given value is not an array and not null, wrap it in one. + * + * @param mixed $value + * @return array + */ + public static function wrap($value) + { + if (is_null($value)) { + return []; + } + + return is_array($value) ? $value : [$value]; + } +} diff --git a/plugins/vendor/illuminate/collections/Collection.php b/plugins/vendor/illuminate/collections/Collection.php new file mode 100644 index 00000000..b01db682 --- /dev/null +++ b/plugins/vendor/illuminate/collections/Collection.php @@ -0,0 +1,1934 @@ + + * @implements \Illuminate\Support\Enumerable + */ +class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable +{ + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ + use EnumeratesValues, Macroable, TransformsToResourceCollection; + + /** + * The items contained in the collection. + * + * @var array + */ + protected $items = []; + + /** + * Create a new collection. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items + */ + public function __construct($items = []) + { + $this->items = $this->getArrayableItems($items); + } + + /** + * Create a collection with the given range. + * + * @param int $from + * @param int $to + * @param int $step + * @return static + */ + public static function range($from, $to, $step = 1) + { + return new static(range($from, $to, $step)); + } + + /** + * Get all of the items in the collection. + * + * @return array + */ + public function all() + { + return $this->items; + } + + /** + * Get a lazy collection for the items in this collection. + * + * @return \Illuminate\Support\LazyCollection + */ + public function lazy() + { + return new LazyCollection($this->items); + } + + /** + * Get the median of a given key. + * + * @param string|array|null $key + * @return float|int|null + */ + public function median($key = null) + { + $values = (isset($key) ? $this->pluck($key) : $this) + ->reject(fn ($item) => is_null($item)) + ->sort()->values(); + + $count = $values->count(); + + if ($count === 0) { + return; + } + + $middle = (int) ($count / 2); + + if ($count % 2) { + return $values->get($middle); + } + + return (new static([ + $values->get($middle - 1), $values->get($middle), + ]))->average(); + } + + /** + * Get the mode of a given key. + * + * @param string|array|null $key + * @return array|null + */ + public function mode($key = null) + { + if ($this->count() === 0) { + return; + } + + $collection = isset($key) ? $this->pluck($key) : $this; + + $counts = new static; + + $collection->each(fn ($value) => $counts[$value] = isset($counts[$value]) ? $counts[$value] + 1 : 1); + + $sorted = $counts->sort(); + + $highestValue = $sorted->last(); + + return $sorted->filter(fn ($value) => $value == $highestValue) + ->sort()->keys()->all(); + } + + /** + * Collapse the collection of items into a single array. + * + * @return static + */ + public function collapse() + { + return new static(Arr::collapse($this->items)); + } + + /** + * Collapse the collection of items into a single array while preserving its keys. + * + * @return static + */ + public function collapseWithKeys() + { + if (! $this->items) { + return new static; + } + + $results = []; + + foreach ($this->items as $key => $values) { + if ($values instanceof Collection) { + $values = $values->all(); + } elseif (! is_array($values)) { + continue; + } + + $results[$key] = $values; + } + + if (! $results) { + return new static; + } + + return new static(array_replace(...$results)); + } + + /** + * Determine if an item exists in the collection. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function contains($key, $operator = null, $value = null) + { + if (func_num_args() === 1) { + if ($this->useAsCallable($key)) { + return array_any($this->items, $key); + } + + return in_array($key, $this->items); + } + + return $this->contains($this->operatorForWhere(...func_get_args())); + } + + /** + * Determine if an item exists, using strict comparison. + * + * @param (callable(TValue): bool)|TValue|array-key $key + * @param TValue|null $value + * @return bool + */ + public function containsStrict($key, $value = null) + { + if (func_num_args() === 2) { + return $this->contains(fn ($item) => data_get($item, $key) === $value); + } + + if ($this->useAsCallable($key)) { + return ! is_null($this->first($key)); + } + + return in_array($key, $this->items, true); + } + + /** + * Determine if an item is not contained in the collection. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + + /** + * Determine if an item is not contained in the enumerable, using strict comparison. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContainStrict($key, $operator = null, $value = null) + { + return ! $this->containsStrict(...func_get_args()); + } + + /** + * Cross join with the given lists, returning all possible permutations. + * + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> + */ + public function crossJoin(...$lists) + { + return new static(Arr::crossJoin( + $this->items, ...array_map($this->getArrayableItems(...), $lists) + )); + } + + /** + * Get the items in the collection that are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diff($items) + { + return new static(array_diff($this->items, $this->getArrayableItems($items))); + } + + /** + * Get the items in the collection that are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function diffUsing($items, callable $callback) + { + return new static(array_udiff($this->items, $this->getArrayableItems($items), $callback)); + } + + /** + * Get the items in the collection whose keys and values are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffAssoc($items) + { + return new static(array_diff_assoc($this->items, $this->getArrayableItems($items))); + } + + /** + * Get the items in the collection whose keys and values are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffAssocUsing($items, callable $callback) + { + return new static(array_diff_uassoc($this->items, $this->getArrayableItems($items), $callback)); + } + + /** + * Get the items in the collection whose keys are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffKeys($items) + { + return new static(array_diff_key($this->items, $this->getArrayableItems($items))); + } + + /** + * Get the items in the collection whose keys are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffKeysUsing($items, callable $callback) + { + return new static(array_diff_ukey($this->items, $this->getArrayableItems($items), $callback)); + } + + /** + * Retrieve duplicate items from the collection. + * + * @template TMapValue + * + * @param (callable(TValue): TMapValue)|string|null $callback + * @param bool $strict + * @return static + */ + public function duplicates($callback = null, $strict = false) + { + $items = $this->map($this->valueRetriever($callback)); + + $uniqueItems = $items->unique(null, $strict); + + $compare = $this->duplicateComparator($strict); + + $duplicates = new static; + + foreach ($items as $key => $value) { + if ($uniqueItems->isNotEmpty() && $compare($value, $uniqueItems->first())) { + $uniqueItems->shift(); + } else { + $duplicates[$key] = $value; + } + } + + return $duplicates; + } + + /** + * Retrieve duplicate items from the collection using strict comparison. + * + * @template TMapValue + * + * @param (callable(TValue): TMapValue)|string|null $callback + * @return static + */ + public function duplicatesStrict($callback = null) + { + return $this->duplicates($callback, true); + } + + /** + * Get the comparison function to detect duplicates. + * + * @param bool $strict + * @return callable(TValue, TValue): bool + */ + protected function duplicateComparator($strict) + { + if ($strict) { + return fn ($a, $b) => $a === $b; + } + + return fn ($a, $b) => $a == $b; + } + + /** + * Get all items except for those with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array|string $keys + * @return static + */ + public function except($keys) + { + if (is_null($keys)) { + return new static($this->items); + } + + if ($keys instanceof Enumerable) { + $keys = $keys->all(); + } elseif (! is_array($keys)) { + $keys = func_get_args(); + } + + return new static(Arr::except($this->items, $keys)); + } + + /** + * Run a filter over each of the items. + * + * @param (callable(TValue, TKey): bool)|null $callback + * @return static + */ + public function filter(?callable $callback = null) + { + if ($callback) { + return new static(Arr::where($this->items, $callback)); + } + + return new static(array_filter($this->items)); + } + + /** + * Get the first item from the collection passing the given truth test. + * + * @template TFirstDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault + */ + public function first(?callable $callback = null, $default = null) + { + return Arr::first($this->items, $callback, $default); + } + + /** + * Get a flattened array of the items in the collection. + * + * @param int $depth + * @return static + */ + public function flatten($depth = INF) + { + return new static(Arr::flatten($this->items, $depth)); + } + + /** + * Flip the items in the collection. + * + * @return static + */ + public function flip() + { + return new static(array_flip($this->items)); + } + + /** + * Remove an item from the collection by key. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|TKey $keys + * @return $this + */ + public function forget($keys) + { + foreach ($this->getArrayableItems($keys) as $key) { + $this->offsetUnset($key); + } + + return $this; + } + + /** + * Get an item from the collection by key. + * + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault + */ + public function get($key, $default = null) + { + if (array_key_exists($key, $this->items)) { + return $this->items[$key]; + } + + return value($default); + } + + /** + * Get an item from the collection by key or add it to collection if it does not exist. + * + * @template TGetOrPutValue + * + * @param mixed $key + * @param TGetOrPutValue|(\Closure(): TGetOrPutValue) $value + * @return TValue|TGetOrPutValue + */ + public function getOrPut($key, $value) + { + if (array_key_exists($key, $this->items)) { + return $this->items[$key]; + } + + $this->offsetSet($key, $value = value($value)); + + return $value; + } + + /** + * Group an associative array by a field or using a callback. + * + * @template TGroupKey of array-key + * + * @param (callable(TValue, TKey): TGroupKey)|array|string $groupBy + * @param bool $preserveKeys + * @return static<($groupBy is string ? array-key : ($groupBy is array ? array-key : TGroupKey)), static<($preserveKeys is true ? TKey : int), ($groupBy is array ? mixed : TValue)>> + */ + public function groupBy($groupBy, $preserveKeys = false) + { + if (! $this->useAsCallable($groupBy) && is_array($groupBy)) { + $nextGroups = $groupBy; + + $groupBy = array_shift($nextGroups); + } + + $groupBy = $this->valueRetriever($groupBy); + + $results = []; + + foreach ($this->items as $key => $value) { + $groupKeys = $groupBy($value, $key); + + if (! is_array($groupKeys)) { + $groupKeys = [$groupKeys]; + } + + foreach ($groupKeys as $groupKey) { + $groupKey = match (true) { + is_bool($groupKey) => (int) $groupKey, + $groupKey instanceof \UnitEnum => enum_value($groupKey), + $groupKey instanceof \Stringable => (string) $groupKey, + default => $groupKey, + }; + + if (! array_key_exists($groupKey, $results)) { + $results[$groupKey] = new static; + } + + $results[$groupKey]->offsetSet($preserveKeys ? $key : null, $value); + } + } + + $result = new static($results); + + if (! empty($nextGroups)) { + return $result->map->groupBy($nextGroups, $preserveKeys); + } + + return $result; + } + + /** + * Key an associative array by a field or using a callback. + * + * @template TNewKey of array-key + * + * @param (callable(TValue, TKey): TNewKey)|array|string $keyBy + * @return static<($keyBy is string ? array-key : ($keyBy is array ? array-key : TNewKey)), TValue> + */ + public function keyBy($keyBy) + { + $keyBy = $this->valueRetriever($keyBy); + + $results = []; + + foreach ($this->items as $key => $item) { + $resolvedKey = $keyBy($item, $key); + + if ($resolvedKey instanceof \UnitEnum) { + $resolvedKey = enum_value($resolvedKey); + } + + if (is_object($resolvedKey)) { + $resolvedKey = (string) $resolvedKey; + } + + $results[$resolvedKey] = $item; + } + + return new static($results); + } + + /** + * Determine if an item exists in the collection by key. + * + * @param TKey|array $key + * @return bool + */ + public function has($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + return array_all($keys, fn ($key) => array_key_exists($key, $this->items)); + } + + /** + * Determine if any of the keys exist in the collection. + * + * @param TKey|array $key + * @return bool + */ + public function hasAny($key) + { + if ($this->isEmpty()) { + return false; + } + + $keys = is_array($key) ? $key : func_get_args(); + + return array_any($keys, fn ($key) => array_key_exists($key, $this->items)); + } + + /** + * Concatenate values of a given key as a string. + * + * @param (callable(TValue, TKey): mixed)|string|null $value + * @param string|null $glue + * @return string + */ + public function implode($value, $glue = null) + { + if ($this->useAsCallable($value)) { + return implode($glue ?? '', $this->map($value)->all()); + } + + $first = $this->first(); + + if (is_array($first) || (is_object($first) && ! $first instanceof Stringable)) { + return implode($glue ?? '', $this->pluck($value)->all()); + } + + return implode($value ?? '', $this->items); + } + + /** + * Intersect the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersect($items) + { + return new static(array_intersect($this->items, $this->getArrayableItems($items))); + } + + /** + * Intersect the collection with the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectUsing($items, callable $callback) + { + return new static(array_uintersect($this->items, $this->getArrayableItems($items), $callback)); + } + + /** + * Intersect the collection with the given items with additional index check. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectAssoc($items) + { + return new static(array_intersect_assoc($this->items, $this->getArrayableItems($items))); + } + + /** + * Intersect the collection with the given items with additional index check, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectAssocUsing($items, callable $callback) + { + return new static(array_intersect_uassoc($this->items, $this->getArrayableItems($items), $callback)); + } + + /** + * Intersect the collection with the given items by key. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectByKeys($items) + { + return new static(array_intersect_key( + $this->items, $this->getArrayableItems($items) + )); + } + + /** + * Determine if the collection is empty or not. + * + * @phpstan-assert-if-true null $this->first() + * @phpstan-assert-if-true null $this->last() + * + * @phpstan-assert-if-false TValue $this->first() + * @phpstan-assert-if-false TValue $this->last() + * + * @return bool + */ + public function isEmpty() + { + return empty($this->items); + } + + /** + * Determine if the collection contains exactly one item. If a callback is provided, determine if exactly one item matches the condition. + * + * @param (callable(TValue, TKey): bool)|null $callback + * @return bool + */ + public function containsOneItem(?callable $callback = null): bool + { + if ($callback) { + return $this->filter($callback)->count() === 1; + } + + return $this->count() === 1; + } + + /** + * Join all items from the collection using a string. The final items can use a separate glue string. + * + * @param string $glue + * @param string $finalGlue + * @return string + */ + public function join($glue, $finalGlue = '') + { + if ($finalGlue === '') { + return $this->implode($glue); + } + + $count = $this->count(); + + if ($count === 0) { + return ''; + } + + if ($count === 1) { + return $this->last(); + } + + $collection = new static($this->items); + + $finalItem = $collection->pop(); + + return $collection->implode($glue).$finalGlue.$finalItem; + } + + /** + * Get the keys of the collection items. + * + * @return static + */ + public function keys() + { + return new static(array_keys($this->items)); + } + + /** + * Get the last item from the collection. + * + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault + */ + public function last(?callable $callback = null, $default = null) + { + return Arr::last($this->items, $callback, $default); + } + + /** + * Get the values of a given key. + * + * @param string|int|array|null $value + * @param string|null $key + * @return static + */ + public function pluck($value, $key = null) + { + return new static(Arr::pluck($this->items, $value, $key)); + } + + /** + * Run a map over each of the items. + * + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static + */ + public function map(callable $callback) + { + return new static(Arr::map($this->items, $callback)); + } + + /** + * Run a dictionary map over the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> + */ + public function mapToDictionary(callable $callback) + { + $dictionary = []; + + foreach ($this->items as $key => $item) { + $pair = $callback($item, $key); + + $key = key($pair); + + $value = reset($pair); + + if (! isset($dictionary[$key])) { + $dictionary[$key] = []; + } + + $dictionary[$key][] = $value; + } + + return new static($dictionary); + } + + /** + * Run an associative map over each of the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static + */ + public function mapWithKeys(callable $callback) + { + return new static(Arr::mapWithKeys($this->items, $callback)); + } + + /** + * Merge the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function merge($items) + { + return new static(array_merge($this->items, $this->getArrayableItems($items))); + } + + /** + * Recursively merge the collection with the given items. + * + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function mergeRecursive($items) + { + return new static(array_merge_recursive($this->items, $this->getArrayableItems($items))); + } + + /** + * Multiply the items in the collection by the multiplier. + * + * @param int $multiplier + * @return static + */ + public function multiply(int $multiplier) + { + $new = new static; + + for ($i = 0; $i < $multiplier; $i++) { + $new->push(...$this->items); + } + + return $new; + } + + /** + * Create a collection by using this collection for keys and another for its values. + * + * @template TCombineValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function combine($values) + { + return new static(array_combine($this->all(), $this->getArrayableItems($values))); + } + + /** + * Union the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function union($items) + { + return new static($this->items + $this->getArrayableItems($items)); + } + + /** + * Create a new collection consisting of every n-th element. + * + * @param int $step + * @param int $offset + * @return static + */ + public function nth($step, $offset = 0) + { + $new = []; + + $position = 0; + + foreach ($this->slice($offset)->items as $item) { + if ($position % $step === 0) { + $new[] = $item; + } + + $position++; + } + + return new static($new); + } + + /** + * Get the items with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array|string|null $keys + * @return static + */ + public function only($keys) + { + if (is_null($keys)) { + return new static($this->items); + } + + if ($keys instanceof Enumerable) { + $keys = $keys->all(); + } + + $keys = is_array($keys) ? $keys : func_get_args(); + + return new static(Arr::only($this->items, $keys)); + } + + /** + * Select specific values from the items within the collection. + * + * @param \Illuminate\Support\Enumerable|array|string|null $keys + * @return static + */ + public function select($keys) + { + if (is_null($keys)) { + return new static($this->items); + } + + if ($keys instanceof Enumerable) { + $keys = $keys->all(); + } + + $keys = is_array($keys) ? $keys : func_get_args(); + + return new static(Arr::select($this->items, $keys)); + } + + /** + * Get and remove the last N items from the collection. + * + * @param int $count + * @return ($count is 1 ? TValue|null : static) + */ + public function pop($count = 1) + { + if ($count < 1) { + return new static; + } + + if ($count === 1) { + return array_pop($this->items); + } + + if ($this->isEmpty()) { + return new static; + } + + $results = []; + + $collectionCount = $this->count(); + + foreach (range(1, min($count, $collectionCount)) as $item) { + $results[] = array_pop($this->items); + } + + return new static($results); + } + + /** + * Push an item onto the beginning of the collection. + * + * @param TValue $value + * @param TKey $key + * @return $this + */ + public function prepend($value, $key = null) + { + $this->items = Arr::prepend($this->items, ...func_get_args()); + + return $this; + } + + /** + * Push one or more items onto the end of the collection. + * + * @param TValue ...$values + * @return $this + */ + public function push(...$values) + { + foreach ($values as $value) { + $this->items[] = $value; + } + + return $this; + } + + /** + * Prepend one or more items to the beginning of the collection. + * + * @param TValue ...$values + * @return $this + */ + public function unshift(...$values) + { + array_unshift($this->items, ...$values); + + return $this; + } + + /** + * Push all of the given items onto the collection. + * + * @template TConcatKey of array-key + * @template TConcatValue + * + * @param iterable $source + * @return static + */ + public function concat($source) + { + $result = new static($this); + + foreach ($source as $item) { + $result->push($item); + } + + return $result; + } + + /** + * Get and remove an item from the collection. + * + * @template TPullDefault + * + * @param TKey $key + * @param TPullDefault|(\Closure(): TPullDefault) $default + * @return TValue|TPullDefault + */ + public function pull($key, $default = null) + { + return Arr::pull($this->items, $key, $default); + } + + /** + * Put an item in the collection by key. + * + * @param TKey $key + * @param TValue $value + * @return $this + */ + public function put($key, $value) + { + $this->offsetSet($key, $value); + + return $this; + } + + /** + * Get one or a specified number of items randomly from the collection. + * + * @param (callable(self): int)|int|null $number + * @param bool $preserveKeys + * @return ($number is null ? TValue : static) + * + * @throws \InvalidArgumentException + */ + public function random($number = null, $preserveKeys = false) + { + if (is_null($number)) { + return Arr::random($this->items); + } + + if (is_callable($number)) { + return new static(Arr::random($this->items, $number($this), $preserveKeys)); + } + + return new static(Arr::random($this->items, $number, $preserveKeys)); + } + + /** + * Replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replace($items) + { + return new static(array_replace($this->items, $this->getArrayableItems($items))); + } + + /** + * Recursively replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replaceRecursive($items) + { + return new static(array_replace_recursive($this->items, $this->getArrayableItems($items))); + } + + /** + * Reverse items order. + * + * @return static + */ + public function reverse() + { + return new static(array_reverse($this->items, true)); + } + + /** + * Search the collection for a given value and return the corresponding key if successful. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TKey|false + */ + public function search($value, $strict = false) + { + if (! $this->useAsCallable($value)) { + return array_search($value, $this->items, $strict); + } + + return array_find_key($this->items, $value) ?? false; + } + + /** + * Get the item before the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function before($value, $strict = false) + { + $key = $this->search($value, $strict); + + if ($key === false) { + return null; + } + + $position = ($keys = $this->keys())->search($key); + + if ($position === 0) { + return null; + } + + return $this->get($keys->get($position - 1)); + } + + /** + * Get the item after the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function after($value, $strict = false) + { + $key = $this->search($value, $strict); + + if ($key === false) { + return null; + } + + $position = ($keys = $this->keys())->search($key); + + if ($position === $keys->count() - 1) { + return null; + } + + return $this->get($keys->get($position + 1)); + } + + /** + * Get and remove the first N items from the collection. + * + * @param int<0, max> $count + * @return ($count is 1 ? TValue|null : static) + * + * @throws \InvalidArgumentException + */ + public function shift($count = 1) + { + if ($count < 0) { + throw new InvalidArgumentException('Number of shifted items may not be less than zero.'); + } + + if ($this->isEmpty()) { + return null; + } + + if ($count === 0) { + return new static; + } + + if ($count === 1) { + return array_shift($this->items); + } + + $results = []; + + $collectionCount = $this->count(); + + foreach (range(1, min($count, $collectionCount)) as $item) { + $results[] = array_shift($this->items); + } + + return new static($results); + } + + /** + * Shuffle the items in the collection. + * + * @return static + */ + public function shuffle() + { + return new static(Arr::shuffle($this->items)); + } + + /** + * Create chunks representing a "sliding window" view of the items in the collection. + * + * @param int $size + * @param int $step + * @return static + */ + public function sliding($size = 2, $step = 1) + { + $chunks = floor(($this->count() - $size) / $step) + 1; + + return static::times($chunks, fn ($number) => $this->slice(($number - 1) * $step, $size)); + } + + /** + * Skip the first {$count} items. + * + * @param int $count + * @return static + */ + public function skip($count) + { + return $this->slice($count); + } + + /** + * Skip items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipUntil($value) + { + return new static($this->lazy()->skipUntil($value)->all()); + } + + /** + * Skip items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipWhile($value) + { + return new static($this->lazy()->skipWhile($value)->all()); + } + + /** + * Slice the underlying collection array. + * + * @param int $offset + * @param int|null $length + * @return static + */ + public function slice($offset, $length = null) + { + return new static(array_slice($this->items, $offset, $length, true)); + } + + /** + * Split a collection into a certain number of groups. + * + * @param int $numberOfGroups + * @return static + */ + public function split($numberOfGroups) + { + if ($this->isEmpty()) { + return new static; + } + + $groups = new static; + + $groupSize = floor($this->count() / $numberOfGroups); + + $remain = $this->count() % $numberOfGroups; + + $start = 0; + + for ($i = 0; $i < $numberOfGroups; $i++) { + $size = $groupSize; + + if ($i < $remain) { + $size++; + } + + if ($size) { + $groups->push(new static(array_slice($this->items, $start, $size))); + + $start += $size; + } + } + + return $groups; + } + + /** + * Split a collection into a certain number of groups, and fill the first groups completely. + * + * @param int $numberOfGroups + * @return static + */ + public function splitIn($numberOfGroups) + { + return $this->chunk((int) ceil($this->count() / $numberOfGroups)); + } + + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + * @throws \Illuminate\Support\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + $items = $this->unless($filter == null)->filter($filter); + + $count = $items->count(); + + if ($count === 0) { + throw new ItemNotFoundException; + } + + if ($count > 1) { + throw new MultipleItemsFoundException($count); + } + + return $items->first(); + } + + /** + * Get the first item in the collection but throw an exception if no matching items exist. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + */ + public function firstOrFail($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + $placeholder = new stdClass(); + + $item = $this->first($filter, $placeholder); + + if ($item === $placeholder) { + throw new ItemNotFoundException; + } + + return $item; + } + + /** + * Chunk the collection into chunks of the given size. + * + * @param int $size + * @param bool $preserveKeys + * @return ($preserveKeys is true ? static : static>) + */ + public function chunk($size, $preserveKeys = true) + { + if ($size <= 0) { + return new static; + } + + $chunks = []; + + foreach (array_chunk($this->items, $size, $preserveKeys) as $chunk) { + $chunks[] = new static($chunk); + } + + return new static($chunks); + } + + /** + * Chunk the collection into chunks with a callback. + * + * @param callable(TValue, TKey, static): bool $callback + * @return static> + */ + public function chunkWhile(callable $callback) + { + return new static( + $this->lazy()->chunkWhile($callback)->mapInto(static::class) + ); + } + + /** + * Sort through each item with a callback. + * + * @param (callable(TValue, TValue): int)|null|int $callback + * @return static + */ + public function sort($callback = null) + { + $items = $this->items; + + $callback && is_callable($callback) + ? uasort($items, $callback) + : asort($items, $callback ?? SORT_REGULAR); + + return new static($items); + } + + /** + * Sort items in descending order. + * + * @param int $options + * @return static + */ + public function sortDesc($options = SORT_REGULAR) + { + $items = $this->items; + + arsort($items, $options); + + return new static($items); + } + + /** + * Sort the collection using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @param bool $descending + * @return static + */ + public function sortBy($callback, $options = SORT_REGULAR, $descending = false) + { + if (is_array($callback) && ! is_callable($callback)) { + return $this->sortByMany($callback, $options); + } + + $results = []; + + $callback = $this->valueRetriever($callback); + + // First we will loop through the items and get the comparator from a callback + // function which we were given. Then, we will sort the returned values and + // grab all the corresponding values for the sorted keys from this array. + foreach ($this->items as $key => $value) { + $results[$key] = $callback($value, $key); + } + + $descending ? arsort($results, $options) + : asort($results, $options); + + // Once we have sorted all of the keys in the array, we will loop through them + // and grab the corresponding model so we can set the underlying items list + // to the sorted version. Then we'll just return the collection instance. + foreach (array_keys($results) as $key) { + $results[$key] = $this->items[$key]; + } + + return new static($results); + } + + /** + * Sort the collection using multiple comparisons. + * + * @param array $comparisons + * @param int $options + * @return static + */ + protected function sortByMany(array $comparisons = [], int $options = SORT_REGULAR) + { + $items = $this->items; + + uasort($items, function ($a, $b) use ($comparisons, $options) { + foreach ($comparisons as $comparison) { + $comparison = Arr::wrap($comparison); + + $prop = $comparison[0]; + + $ascending = Arr::get($comparison, 1, true) === true || + Arr::get($comparison, 1, true) === 'asc'; + + if (! is_string($prop) && is_callable($prop)) { + $result = $prop($a, $b); + } else { + $values = [data_get($a, $prop), data_get($b, $prop)]; + + if (! $ascending) { + $values = array_reverse($values); + } + + if (($options & SORT_FLAG_CASE) === SORT_FLAG_CASE) { + if (($options & SORT_NATURAL) === SORT_NATURAL) { + $result = strnatcasecmp($values[0], $values[1]); + } else { + $result = strcasecmp($values[0], $values[1]); + } + } else { + $result = match ($options) { + SORT_NUMERIC => intval($values[0]) <=> intval($values[1]), + SORT_STRING => strcmp($values[0], $values[1]), + SORT_NATURAL => strnatcmp((string) $values[0], (string) $values[1]), + SORT_LOCALE_STRING => strcoll($values[0], $values[1]), + default => $values[0] <=> $values[1], + }; + } + } + + if ($result === 0) { + continue; + } + + return $result; + } + }); + + return new static($items); + } + + /** + * Sort the collection in descending order using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @return static + */ + public function sortByDesc($callback, $options = SORT_REGULAR) + { + if (is_array($callback) && ! is_callable($callback)) { + foreach ($callback as $index => $key) { + $comparison = Arr::wrap($key); + + $comparison[1] = 'desc'; + + $callback[$index] = $comparison; + } + } + + return $this->sortBy($callback, $options, true); + } + + /** + * Sort the collection keys. + * + * @param int $options + * @param bool $descending + * @return static + */ + public function sortKeys($options = SORT_REGULAR, $descending = false) + { + $items = $this->items; + + $descending ? krsort($items, $options) : ksort($items, $options); + + return new static($items); + } + + /** + * Sort the collection keys in descending order. + * + * @param int $options + * @return static + */ + public function sortKeysDesc($options = SORT_REGULAR) + { + return $this->sortKeys($options, true); + } + + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + $items = $this->items; + + uksort($items, $callback); + + return new static($items); + } + + /** + * Splice a portion of the underlying collection array. + * + * @param int $offset + * @param int|null $length + * @param array $replacement + * @return static + */ + public function splice($offset, $length = null, $replacement = []) + { + if (func_num_args() === 1) { + return new static(array_splice($this->items, $offset)); + } + + return new static(array_splice($this->items, $offset, $length, $this->getArrayableItems($replacement))); + } + + /** + * Take the first or last {$limit} items. + * + * @param int $limit + * @return static + */ + public function take($limit) + { + if ($limit < 0) { + return $this->slice($limit, abs($limit)); + } + + return $this->slice(0, $limit); + } + + /** + * Take items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeUntil($value) + { + return new static($this->lazy()->takeUntil($value)->all()); + } + + /** + * Take items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeWhile($value) + { + return new static($this->lazy()->takeWhile($value)->all()); + } + + /** + * Transform each item in the collection using a callback. + * + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return $this + * + * @phpstan-this-out static + */ + public function transform(callable $callback) + { + $this->items = $this->map($callback)->all(); + + return $this; + } + + /** + * Flatten a multi-dimensional associative array with dots. + * + * @return static + */ + public function dot() + { + return new static(Arr::dot($this->all())); + } + + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @return static + */ + public function undot() + { + return new static(Arr::undot($this->all())); + } + + /** + * Return only unique items from the collection array. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + if (is_null($key) && $strict === false) { + return new static(array_unique($this->items, SORT_REGULAR)); + } + + $callback = $this->valueRetriever($key); + + $exists = []; + + return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { + if (in_array($id = $callback($item, $key), $exists, $strict)) { + return true; + } + + $exists[] = $id; + }); + } + + /** + * Reset the keys on the underlying array. + * + * @return static + */ + public function values() + { + return new static(array_values($this->items)); + } + + /** + * Zip the collection together with one or more arrays. + * + * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); + * => [[1, 4], [2, 5], [3, 6]] + * + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> + */ + public function zip($items) + { + $arrayableItems = array_map(fn ($items) => $this->getArrayableItems($items), func_get_args()); + + $params = array_merge([fn () => new static(func_get_args()), $this->items], $arrayableItems); + + return new static(array_map(...$params)); + } + + /** + * Pad collection to the specified length with a value. + * + * @template TPadValue + * + * @param int $size + * @param TPadValue $value + * @return static + */ + public function pad($size, $value) + { + return new static(array_pad($this->items, $size, $value)); + } + + /** + * Get an iterator for the items. + * + * @return \ArrayIterator + */ + public function getIterator(): Traversable + { + return new ArrayIterator($this->items); + } + + /** + * Count the number of items in the collection. + * + * @return int<0, max> + */ + public function count(): int + { + return count($this->items); + } + + /** + * Count the number of items in the collection by a field or using a callback. + * + * @param (callable(TValue, TKey): array-key|\UnitEnum)|string|null $countBy + * @return static + */ + public function countBy($countBy = null) + { + return new static($this->lazy()->countBy($countBy)->all()); + } + + /** + * Add an item to the collection. + * + * @param TValue $item + * @return $this + */ + public function add($item) + { + $this->items[] = $item; + + return $this; + } + + /** + * Get a base Support collection instance from this collection. + * + * @return \Illuminate\Support\Collection + */ + public function toBase() + { + return new self($this); + } + + /** + * Determine if an item exists at an offset. + * + * @param TKey $key + * @return bool + */ + public function offsetExists($key): bool + { + return isset($this->items[$key]); + } + + /** + * Get an item at a given offset. + * + * @param TKey $key + * @return TValue + */ + public function offsetGet($key): mixed + { + return $this->items[$key]; + } + + /** + * Set the item at a given offset. + * + * @param TKey|null $key + * @param TValue $value + * @return void + */ + public function offsetSet($key, $value): void + { + if (is_null($key)) { + $this->items[] = $value; + } else { + $this->items[$key] = $value; + } + } + + /** + * Unset the item at a given offset. + * + * @param TKey $key + * @return void + */ + public function offsetUnset($key): void + { + unset($this->items[$key]); + } +} diff --git a/plugins/vendor/illuminate/collections/Enumerable.php b/plugins/vendor/illuminate/collections/Enumerable.php new file mode 100644 index 00000000..0b434804 --- /dev/null +++ b/plugins/vendor/illuminate/collections/Enumerable.php @@ -0,0 +1,1321 @@ + + * @extends \IteratorAggregate + */ +interface Enumerable extends Arrayable, Countable, IteratorAggregate, Jsonable, JsonSerializable +{ + /** + * Create a new collection instance if the value isn't one already. + * + * @template TMakeKey of array-key + * @template TMakeValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static + */ + public static function make($items = []); + + /** + * Create a new instance by invoking the callback a given amount of times. + * + * @param int $number + * @param callable|null $callback + * @return static + */ + public static function times($number, ?callable $callback = null); + + /** + * Create a collection with the given range. + * + * @param int $from + * @param int $to + * @param int $step + * @return static + */ + public static function range($from, $to, $step = 1); + + /** + * Wrap the given value in a collection if applicable. + * + * @template TWrapValue + * + * @param iterable|TWrapValue $value + * @return static + */ + public static function wrap($value); + + /** + * Get the underlying items from the given collection if applicable. + * + * @template TUnwrapKey of array-key + * @template TUnwrapValue + * + * @param array|static $value + * @return array + */ + public static function unwrap($value); + + /** + * Create a new instance with no items. + * + * @return static + */ + public static function empty(); + + /** + * Get all items in the enumerable. + * + * @return array + */ + public function all(); + + /** + * Alias for the "avg" method. + * + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null + */ + public function average($callback = null); + + /** + * Get the median of a given key. + * + * @param string|array|null $key + * @return float|int|null + */ + public function median($key = null); + + /** + * Get the mode of a given key. + * + * @param string|array|null $key + * @return array|null + */ + public function mode($key = null); + + /** + * Collapse the items into a single enumerable. + * + * @return static + */ + public function collapse(); + + /** + * Alias for the "contains" method. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function some($key, $operator = null, $value = null); + + /** + * Determine if an item exists, using strict comparison. + * + * @param (callable(TValue): bool)|TValue|array-key $key + * @param TValue|null $value + * @return bool + */ + public function containsStrict($key, $value = null); + + /** + * Get the average value of a given key. + * + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null + */ + public function avg($callback = null); + + /** + * Determine if an item exists in the enumerable. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function contains($key, $operator = null, $value = null); + + /** + * Determine if an item is not contained in the collection. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null); + + /** + * Cross join with the given lists, returning all possible permutations. + * + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$lists + * @return static> + */ + public function crossJoin(...$lists); + + /** + * Dump the collection and end the script. + * + * @param mixed ...$args + * @return never + */ + public function dd(...$args); + + /** + * Dump the collection. + * + * @param mixed ...$args + * @return $this + */ + public function dump(...$args); + + /** + * Get the items that are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diff($items); + + /** + * Get the items that are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function diffUsing($items, callable $callback); + + /** + * Get the items whose keys and values are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffAssoc($items); + + /** + * Get the items whose keys and values are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffAssocUsing($items, callable $callback); + + /** + * Get the items whose keys are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffKeys($items); + + /** + * Get the items whose keys are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffKeysUsing($items, callable $callback); + + /** + * Retrieve duplicate items. + * + * @param (callable(TValue): bool)|string|null $callback + * @param bool $strict + * @return static + */ + public function duplicates($callback = null, $strict = false); + + /** + * Retrieve duplicate items using strict comparison. + * + * @param (callable(TValue): bool)|string|null $callback + * @return static + */ + public function duplicatesStrict($callback = null); + + /** + * Execute a callback over each item. + * + * @param callable(TValue, TKey): mixed $callback + * @return $this + */ + public function each(callable $callback); + + /** + * Execute a callback over each nested chunk of items. + * + * @param callable $callback + * @return static + */ + public function eachSpread(callable $callback); + + /** + * Determine if all items pass the given truth test. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function every($key, $operator = null, $value = null); + + /** + * Get all items except for those with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array $keys + * @return static + */ + public function except($keys); + + /** + * Run a filter over each of the items. + * + * @param (callable(TValue): bool)|null $callback + * @return static + */ + public function filter(?callable $callback = null); + + /** + * Apply the callback if the given "value" is (or resolves to) truthy. + * + * @template TWhenReturnType as null + * + * @param bool $value + * @param (callable($this): TWhenReturnType)|null $callback + * @param (callable($this): TWhenReturnType)|null $default + * @return $this|TWhenReturnType + */ + public function when($value, ?callable $callback = null, ?callable $default = null); + + /** + * Apply the callback if the collection is empty. + * + * @template TWhenEmptyReturnType + * + * @param (callable($this): TWhenEmptyReturnType) $callback + * @param (callable($this): TWhenEmptyReturnType)|null $default + * @return $this|TWhenEmptyReturnType + */ + public function whenEmpty(callable $callback, ?callable $default = null); + + /** + * Apply the callback if the collection is not empty. + * + * @template TWhenNotEmptyReturnType + * + * @param callable($this): TWhenNotEmptyReturnType $callback + * @param (callable($this): TWhenNotEmptyReturnType)|null $default + * @return $this|TWhenNotEmptyReturnType + */ + public function whenNotEmpty(callable $callback, ?callable $default = null); + + /** + * Apply the callback if the given "value" is (or resolves to) falsy. + * + * @template TUnlessReturnType + * + * @param bool $value + * @param (callable($this): TUnlessReturnType) $callback + * @param (callable($this): TUnlessReturnType)|null $default + * @return $this|TUnlessReturnType + */ + public function unless($value, callable $callback, ?callable $default = null); + + /** + * Apply the callback unless the collection is empty. + * + * @template TUnlessEmptyReturnType + * + * @param callable($this): TUnlessEmptyReturnType $callback + * @param (callable($this): TUnlessEmptyReturnType)|null $default + * @return $this|TUnlessEmptyReturnType + */ + public function unlessEmpty(callable $callback, ?callable $default = null); + + /** + * Apply the callback unless the collection is not empty. + * + * @template TUnlessNotEmptyReturnType + * + * @param callable($this): TUnlessNotEmptyReturnType $callback + * @param (callable($this): TUnlessNotEmptyReturnType)|null $default + * @return $this|TUnlessNotEmptyReturnType + */ + public function unlessNotEmpty(callable $callback, ?callable $default = null); + + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param mixed $operator + * @param mixed $value + * @return static + */ + public function where($key, $operator = null, $value = null); + + /** + * Filter items where the value for the given key is null. + * + * @param string|null $key + * @return static + */ + public function whereNull($key = null); + + /** + * Filter items where the value for the given key is not null. + * + * @param string|null $key + * @return static + */ + public function whereNotNull($key = null); + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param mixed $value + * @return static + */ + public function whereStrict($key, $value); + + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param bool $strict + * @return static + */ + public function whereIn($key, $values, $strict = false); + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereInStrict($key, $values); + + /** + * Filter items such that the value of the given key is between the given values. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereBetween($key, $values); + + /** + * Filter items such that the value of the given key is not between the given values. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereNotBetween($key, $values); + + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param bool $strict + * @return static + */ + public function whereNotIn($key, $values, $strict = false); + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereNotInStrict($key, $values); + + /** + * Filter the items, removing any items that don't match the given type(s). + * + * @template TWhereInstanceOf + * + * @param class-string|array> $type + * @return static + */ + public function whereInstanceOf($type); + + /** + * Get the first item from the enumerable passing the given truth test. + * + * @template TFirstDefault + * + * @param (callable(TValue,TKey): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault + */ + public function first(?callable $callback = null, $default = null); + + /** + * Get the first item by the given key value pair. + * + * @param string $key + * @param mixed $operator + * @param mixed $value + * @return TValue|null + */ + public function firstWhere($key, $operator = null, $value = null); + + /** + * Get a flattened array of the items in the collection. + * + * @param int $depth + * @return static + */ + public function flatten($depth = INF); + + /** + * Flip the values with their keys. + * + * @return static + */ + public function flip(); + + /** + * Get an item from the collection by key. + * + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault + */ + public function get($key, $default = null); + + /** + * Group an associative array by a field or using a callback. + * + * @template TGroupKey of array-key + * + * @param (callable(TValue, TKey): TGroupKey)|array|string $groupBy + * @param bool $preserveKeys + * @return static<($groupBy is string ? array-key : ($groupBy is array ? array-key : TGroupKey)), static<($preserveKeys is true ? TKey : int), ($groupBy is array ? mixed : TValue)>> + */ + public function groupBy($groupBy, $preserveKeys = false); + + /** + * Key an associative array by a field or using a callback. + * + * @template TNewKey of array-key + * + * @param (callable(TValue, TKey): TNewKey)|array|string $keyBy + * @return static<($keyBy is string ? array-key : ($keyBy is array ? array-key : TNewKey)), TValue> + */ + public function keyBy($keyBy); + + /** + * Determine if an item exists in the collection by key. + * + * @param TKey|array $key + * @return bool + */ + public function has($key); + + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key); + + /** + * Concatenate values of a given key as a string. + * + * @param (callable(TValue, TKey): mixed)|string $value + * @param string|null $glue + * @return string + */ + public function implode($value, $glue = null); + + /** + * Intersect the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersect($items); + + /** + * Intersect the collection with the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectUsing($items, callable $callback); + + /** + * Intersect the collection with the given items with additional index check. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectAssoc($items); + + /** + * Intersect the collection with the given items with additional index check, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectAssocUsing($items, callable $callback); + + /** + * Intersect the collection with the given items by key. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectByKeys($items); + + /** + * Determine if the collection is empty or not. + * + * @return bool + */ + public function isEmpty(); + + /** + * Determine if the collection is not empty. + * + * @return bool + */ + public function isNotEmpty(); + + /** + * Determine if the collection contains a single item. + * + * @return bool + */ + public function containsOneItem(); + + /** + * Join all items from the collection using a string. The final items can use a separate glue string. + * + * @param string $glue + * @param string $finalGlue + * @return string + */ + public function join($glue, $finalGlue = ''); + + /** + * Get the keys of the collection items. + * + * @return static + */ + public function keys(); + + /** + * Get the last item from the collection. + * + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault + */ + public function last(?callable $callback = null, $default = null); + + /** + * Run a map over each of the items. + * + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static + */ + public function map(callable $callback); + + /** + * Run a map over each nested chunk of items. + * + * @param callable $callback + * @return static + */ + public function mapSpread(callable $callback); + + /** + * Run a dictionary map over the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> + */ + public function mapToDictionary(callable $callback); + + /** + * Run a grouping map over the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapToGroupsKey of array-key + * @template TMapToGroupsValue + * + * @param callable(TValue, TKey): array $callback + * @return static> + */ + public function mapToGroups(callable $callback); + + /** + * Run an associative map over each of the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static + */ + public function mapWithKeys(callable $callback); + + /** + * Map a collection and flatten the result by a single level. + * + * @template TFlatMapKey of array-key + * @template TFlatMapValue + * + * @param callable(TValue, TKey): (\Illuminate\Support\Collection|array) $callback + * @return static + */ + public function flatMap(callable $callback); + + /** + * Map the values into a new class. + * + * @template TMapIntoValue + * + * @param class-string $class + * @return static + */ + public function mapInto($class); + + /** + * Merge the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function merge($items); + + /** + * Recursively merge the collection with the given items. + * + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function mergeRecursive($items); + + /** + * Create a collection by using this collection for keys and another for its values. + * + * @template TCombineValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function combine($values); + + /** + * Union the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function union($items); + + /** + * Get the min value of a given key. + * + * @param (callable(TValue):mixed)|string|null $callback + * @return mixed + */ + public function min($callback = null); + + /** + * Get the max value of a given key. + * + * @param (callable(TValue):mixed)|string|null $callback + * @return mixed + */ + public function max($callback = null); + + /** + * Create a new collection consisting of every n-th element. + * + * @param int $step + * @param int $offset + * @return static + */ + public function nth($step, $offset = 0); + + /** + * Get the items with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array|string $keys + * @return static + */ + public function only($keys); + + /** + * "Paginate" the collection by slicing it into a smaller collection. + * + * @param int $page + * @param int $perPage + * @return static + */ + public function forPage($page, $perPage); + + /** + * Partition the collection into two arrays using the given callback or key. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return static, static> + */ + public function partition($key, $operator = null, $value = null); + + /** + * Push all of the given items onto the collection. + * + * @template TConcatKey of array-key + * @template TConcatValue + * + * @param iterable $source + * @return static + */ + public function concat($source); + + /** + * Get one or a specified number of items randomly from the collection. + * + * @param int|null $number + * @return static|TValue + * + * @throws \InvalidArgumentException + */ + public function random($number = null); + + /** + * Reduce the collection to a single value. + * + * @template TReduceInitial + * @template TReduceReturnType + * + * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback + * @param TReduceInitial $initial + * @return TReduceInitial|TReduceReturnType + */ + public function reduce(callable $callback, $initial = null); + + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @throws \UnexpectedValueException + */ + public function reduceSpread(callable $callback, ...$initial); + + /** + * Replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replace($items); + + /** + * Recursively replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replaceRecursive($items); + + /** + * Reverse items order. + * + * @return static + */ + public function reverse(); + + /** + * Search the collection for a given value and return the corresponding key if successful. + * + * @param TValue|callable(TValue,TKey): bool $value + * @param bool $strict + * @return TKey|bool + */ + public function search($value, $strict = false); + + /** + * Get the item before the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function before($value, $strict = false); + + /** + * Get the item after the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function after($value, $strict = false); + + /** + * Shuffle the items in the collection. + * + * @return static + */ + public function shuffle(); + + /** + * Create chunks representing a "sliding window" view of the items in the collection. + * + * @param int $size + * @param int $step + * @return static + */ + public function sliding($size = 2, $step = 1); + + /** + * Skip the first {$count} items. + * + * @param int $count + * @return static + */ + public function skip($count); + + /** + * Skip items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipUntil($value); + + /** + * Skip items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipWhile($value); + + /** + * Get a slice of items from the enumerable. + * + * @param int $offset + * @param int|null $length + * @return static + */ + public function slice($offset, $length = null); + + /** + * Split a collection into a certain number of groups. + * + * @param int $numberOfGroups + * @return static + */ + public function split($numberOfGroups); + + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + * @throws \Illuminate\Support\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null); + + /** + * Get the first item in the collection but throw an exception if no matching items exist. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + */ + public function firstOrFail($key = null, $operator = null, $value = null); + + /** + * Chunk the collection into chunks of the given size. + * + * @param int $size + * @return static + */ + public function chunk($size); + + /** + * Chunk the collection into chunks with a callback. + * + * @param callable(TValue, TKey, static): bool $callback + * @return static> + */ + public function chunkWhile(callable $callback); + + /** + * Split a collection into a certain number of groups, and fill the first groups completely. + * + * @param int $numberOfGroups + * @return static + */ + public function splitIn($numberOfGroups); + + /** + * Sort through each item with a callback. + * + * @param (callable(TValue, TValue): int)|null|int $callback + * @return static + */ + public function sort($callback = null); + + /** + * Sort items in descending order. + * + * @param int $options + * @return static + */ + public function sortDesc($options = SORT_REGULAR); + + /** + * Sort the collection using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @param bool $descending + * @return static + */ + public function sortBy($callback, $options = SORT_REGULAR, $descending = false); + + /** + * Sort the collection in descending order using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @return static + */ + public function sortByDesc($callback, $options = SORT_REGULAR); + + /** + * Sort the collection keys. + * + * @param int $options + * @param bool $descending + * @return static + */ + public function sortKeys($options = SORT_REGULAR, $descending = false); + + /** + * Sort the collection keys in descending order. + * + * @param int $options + * @return static + */ + public function sortKeysDesc($options = SORT_REGULAR); + + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback); + + /** + * Get the sum of the given values. + * + * @param (callable(TValue): mixed)|string|null $callback + * @return mixed + */ + public function sum($callback = null); + + /** + * Take the first or last {$limit} items. + * + * @param int $limit + * @return static + */ + public function take($limit); + + /** + * Take items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeUntil($value); + + /** + * Take items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeWhile($value); + + /** + * Pass the collection to the given callback and then return it. + * + * @param callable(TValue): mixed $callback + * @return $this + */ + public function tap(callable $callback); + + /** + * Pass the enumerable to the given callback and return the result. + * + * @template TPipeReturnType + * + * @param callable($this): TPipeReturnType $callback + * @return TPipeReturnType + */ + public function pipe(callable $callback); + + /** + * Pass the collection into a new class. + * + * @template TPipeIntoValue + * + * @param class-string $class + * @return TPipeIntoValue + */ + public function pipeInto($class); + + /** + * Pass the collection through a series of callable pipes and return the result. + * + * @param array $pipes + * @return mixed + */ + public function pipeThrough($pipes); + + /** + * Get the values of a given key. + * + * @param string|array $value + * @param string|null $key + * @return static + */ + public function pluck($value, $key = null); + + /** + * Create a collection of all elements that do not pass a given truth test. + * + * @param (callable(TValue, TKey): bool)|bool|TValue $callback + * @return static + */ + public function reject($callback = true); + + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @return static + */ + public function undot(); + + /** + * Return only unique items from the collection array. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false); + + /** + * Return only unique items from the collection array using strict comparison. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @return static + */ + public function uniqueStrict($key = null); + + /** + * Reset the keys on the underlying array. + * + * @return static + */ + public function values(); + + /** + * Pad collection to the specified length with a value. + * + * @template TPadValue + * + * @param int $size + * @param TPadValue $value + * @return static + */ + public function pad($size, $value); + + /** + * Get the values iterator. + * + * @return \Traversable + */ + public function getIterator(): Traversable; + + /** + * Count the number of items in the collection. + * + * @return int + */ + public function count(): int; + + /** + * Count the number of items in the collection by a field or using a callback. + * + * @param (callable(TValue, TKey): array-key)|string|null $countBy + * @return static + */ + public function countBy($countBy = null); + + /** + * Zip the collection together with one or more arrays. + * + * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); + * => [[1, 4], [2, 5], [3, 6]] + * + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> + */ + public function zip($items); + + /** + * Collect the values into a collection. + * + * @return \Illuminate\Support\Collection + */ + public function collect(); + + /** + * Get the collection of items as a plain array. + * + * @return array + */ + public function toArray(); + + /** + * Convert the object into something JSON serializable. + * + * @return mixed + */ + public function jsonSerialize(): mixed; + + /** + * Get the collection of items as JSON. + * + * @param int $options + * @return string + */ + public function toJson($options = 0); + + /** + * Get the collection of items as pretty print formatted JSON. + * + * + * @param int $options + * @return string + */ + public function toPrettyJson(int $options = 0); + + /** + * Get a CachingIterator instance. + * + * @param int $flags + * @return \CachingIterator + */ + public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING); + + /** + * Convert the collection to its string representation. + * + * @return string + */ + public function __toString(); + + /** + * Indicate that the model's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true); + + /** + * Add a method to the list of proxied methods. + * + * @param string $method + * @return void + */ + public static function proxy($method); + + /** + * Dynamically access collection proxies. + * + * @param string $key + * @return mixed + * + * @throws \Exception + */ + public function __get($key); +} diff --git a/plugins/vendor/illuminate/collections/HigherOrderCollectionProxy.php b/plugins/vendor/illuminate/collections/HigherOrderCollectionProxy.php new file mode 100644 index 00000000..035d0fda --- /dev/null +++ b/plugins/vendor/illuminate/collections/HigherOrderCollectionProxy.php @@ -0,0 +1,69 @@ + + * @mixin TValue + */ +class HigherOrderCollectionProxy +{ + /** + * The collection being operated on. + * + * @var \Illuminate\Support\Enumerable + */ + protected $collection; + + /** + * The method being proxied. + * + * @var string + */ + protected $method; + + /** + * Create a new proxy instance. + * + * @param \Illuminate\Support\Enumerable $collection + * @param string $method + */ + public function __construct(Enumerable $collection, $method) + { + $this->method = $method; + $this->collection = $collection; + } + + /** + * Proxy accessing an attribute onto the collection items. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + return $this->collection->{$this->method}(function ($value) use ($key) { + return is_array($value) ? $value[$key] : $value->{$key}; + }); + } + + /** + * Proxy a method call onto the collection items. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->collection->{$this->method}(function ($value) use ($method, $parameters) { + return is_string($value) + ? $value::{$method}(...$parameters) + : $value->{$method}(...$parameters); + }); + } +} diff --git a/plugins/vendor/illuminate/collections/ItemNotFoundException.php b/plugins/vendor/illuminate/collections/ItemNotFoundException.php new file mode 100644 index 00000000..05a51d95 --- /dev/null +++ b/plugins/vendor/illuminate/collections/ItemNotFoundException.php @@ -0,0 +1,9 @@ + + */ +class LazyCollection implements CanBeEscapedWhenCastToString, Enumerable +{ + /** + * @use \Illuminate\Support\Traits\EnumeratesValues + */ + use EnumeratesValues, Macroable; + + /** + * The source from which to generate items. + * + * @var (Closure(): \Generator)|static|array + */ + public $source; + + /** + * Create a new lazy collection instance. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $source + */ + public function __construct($source = null) + { + if ($source instanceof Closure || $source instanceof self) { + $this->source = $source; + } elseif (is_null($source)) { + $this->source = static::empty(); + } elseif ($source instanceof Generator) { + throw new InvalidArgumentException( + 'Generators should not be passed directly to LazyCollection. Instead, pass a generator function.' + ); + } else { + $this->source = $this->getArrayableItems($source); + } + } + + /** + * Create a new collection instance if the value isn't one already. + * + * @template TMakeKey of array-key + * @template TMakeValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|(Closure(): \Generator)|self|array|null $items + * @return static + */ + public static function make($items = []) + { + return new static($items); + } + + /** + * Create a collection with the given range. + * + * @param int $from + * @param int $to + * @param int $step + * @return static + */ + public static function range($from, $to, $step = 1) + { + if ($step == 0) { + throw new InvalidArgumentException('Step value cannot be zero.'); + } + + return new static(function () use ($from, $to, $step) { + if ($from <= $to) { + for (; $from <= $to; $from += abs($step)) { + yield $from; + } + } else { + for (; $from >= $to; $from -= abs($step)) { + yield $from; + } + } + }); + } + + /** + * Get all items in the enumerable. + * + * @return array + */ + public function all() + { + if (is_array($this->source)) { + return $this->source; + } + + return iterator_to_array($this->getIterator()); + } + + /** + * Eager load all items into a new lazy collection backed by an array. + * + * @return static + */ + public function eager() + { + return new static($this->all()); + } + + /** + * Cache values as they're enumerated. + * + * @return static + */ + public function remember() + { + $iterator = $this->getIterator(); + + $iteratorIndex = 0; + + $cache = []; + + return new static(function () use ($iterator, &$iteratorIndex, &$cache) { + for ($index = 0; true; $index++) { + if (array_key_exists($index, $cache)) { + yield $cache[$index][0] => $cache[$index][1]; + + continue; + } + + if ($iteratorIndex < $index) { + $iterator->next(); + + $iteratorIndex++; + } + + if (! $iterator->valid()) { + break; + } + + $cache[$index] = [$iterator->key(), $iterator->current()]; + + yield $cache[$index][0] => $cache[$index][1]; + } + }); + } + + /** + * Get the median of a given key. + * + * @param string|array|null $key + * @return float|int|null + */ + public function median($key = null) + { + return $this->collect()->median($key); + } + + /** + * Get the mode of a given key. + * + * @param string|array|null $key + * @return array|null + */ + public function mode($key = null) + { + return $this->collect()->mode($key); + } + + /** + * Collapse the collection of items into a single array. + * + * @return static + */ + public function collapse() + { + return new static(function () { + foreach ($this as $values) { + if (is_array($values) || $values instanceof Enumerable) { + foreach ($values as $value) { + yield $value; + } + } + } + }); + } + + /** + * Collapse the collection of items into a single array while preserving its keys. + * + * @return static + */ + public function collapseWithKeys() + { + return new static(function () { + foreach ($this as $values) { + if (is_array($values) || $values instanceof Enumerable) { + foreach ($values as $key => $value) { + yield $key => $value; + } + } + } + }); + } + + /** + * Determine if an item exists in the enumerable. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function contains($key, $operator = null, $value = null) + { + if (func_num_args() === 1 && $this->useAsCallable($key)) { + $placeholder = new stdClass; + + /** @var callable $key */ + return $this->first($key, $placeholder) !== $placeholder; + } + + if (func_num_args() === 1) { + $needle = $key; + + foreach ($this as $value) { + if ($value == $needle) { + return true; + } + } + + return false; + } + + return $this->contains($this->operatorForWhere(...func_get_args())); + } + + /** + * Determine if an item exists, using strict comparison. + * + * @param (callable(TValue): bool)|TValue|array-key $key + * @param TValue|null $value + * @return bool + */ + public function containsStrict($key, $value = null) + { + if (func_num_args() === 2) { + return $this->contains(fn ($item) => data_get($item, $key) === $value); + } + + if ($this->useAsCallable($key)) { + return ! is_null($this->first($key)); + } + + foreach ($this as $item) { + if ($item === $key) { + return true; + } + } + + return false; + } + + /** + * Determine if an item is not contained in the enumerable. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContain($key, $operator = null, $value = null) + { + return ! $this->contains(...func_get_args()); + } + + /** + * Determine if an item is not contained in the enumerable, using strict comparison. + * + * @param mixed $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function doesntContainStrict($key, $operator = null, $value = null) + { + return ! $this->containsStrict(...func_get_args()); + } + + /** + * Cross join the given iterables, returning all possible permutations. + * + * @template TCrossJoinKey + * @template TCrossJoinValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$arrays + * @return static> + */ + public function crossJoin(...$arrays) + { + return $this->passthru('crossJoin', func_get_args()); + } + + /** + * Count the number of items in the collection by a field or using a callback. + * + * @param (callable(TValue, TKey): array-key|\UnitEnum)|string|null $countBy + * @return static + */ + public function countBy($countBy = null) + { + $countBy = is_null($countBy) + ? $this->identity() + : $this->valueRetriever($countBy); + + return new static(function () use ($countBy) { + $counts = []; + + foreach ($this as $key => $value) { + $group = enum_value($countBy($value, $key)); + + if (empty($counts[$group])) { + $counts[$group] = 0; + } + + $counts[$group]++; + } + + yield from $counts; + }); + } + + /** + * Get the items that are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diff($items) + { + return $this->passthru('diff', func_get_args()); + } + + /** + * Get the items that are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function diffUsing($items, callable $callback) + { + return $this->passthru('diffUsing', func_get_args()); + } + + /** + * Get the items whose keys and values are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffAssoc($items) + { + return $this->passthru('diffAssoc', func_get_args()); + } + + /** + * Get the items whose keys and values are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffAssocUsing($items, callable $callback) + { + return $this->passthru('diffAssocUsing', func_get_args()); + } + + /** + * Get the items whose keys are not present in the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function diffKeys($items) + { + return $this->passthru('diffKeys', func_get_args()); + } + + /** + * Get the items whose keys are not present in the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function diffKeysUsing($items, callable $callback) + { + return $this->passthru('diffKeysUsing', func_get_args()); + } + + /** + * Retrieve duplicate items. + * + * @template TMapValue + * + * @param (callable(TValue): TMapValue)|string|null $callback + * @param bool $strict + * @return static + */ + public function duplicates($callback = null, $strict = false) + { + return $this->passthru('duplicates', func_get_args()); + } + + /** + * Retrieve duplicate items using strict comparison. + * + * @template TMapValue + * + * @param (callable(TValue): TMapValue)|string|null $callback + * @return static + */ + public function duplicatesStrict($callback = null) + { + return $this->passthru('duplicatesStrict', func_get_args()); + } + + /** + * Get all items except for those with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array $keys + * @return static + */ + public function except($keys) + { + return $this->passthru('except', func_get_args()); + } + + /** + * Run a filter over each of the items. + * + * @param (callable(TValue, TKey): bool)|null $callback + * @return static + */ + public function filter(?callable $callback = null) + { + if (is_null($callback)) { + $callback = fn ($value) => (bool) $value; + } + + return new static(function () use ($callback) { + foreach ($this as $key => $value) { + if ($callback($value, $key)) { + yield $key => $value; + } + } + }); + } + + /** + * Get the first item from the enumerable passing the given truth test. + * + * @template TFirstDefault + * + * @param (callable(TValue): bool)|null $callback + * @param TFirstDefault|(\Closure(): TFirstDefault) $default + * @return TValue|TFirstDefault + */ + public function first(?callable $callback = null, $default = null) + { + $iterator = $this->getIterator(); + + if (is_null($callback)) { + if (! $iterator->valid()) { + return value($default); + } + + return $iterator->current(); + } + + foreach ($iterator as $key => $value) { + if ($callback($value, $key)) { + return $value; + } + } + + return value($default); + } + + /** + * Get a flattened list of the items in the collection. + * + * @param int $depth + * @return static + */ + public function flatten($depth = INF) + { + $instance = new static(function () use ($depth) { + foreach ($this as $item) { + if (! is_array($item) && ! $item instanceof Enumerable) { + yield $item; + } elseif ($depth === 1) { + yield from $item; + } else { + yield from (new static($item))->flatten($depth - 1); + } + } + }); + + return $instance->values(); + } + + /** + * Flip the items in the collection. + * + * @return static + */ + public function flip() + { + return new static(function () { + foreach ($this as $key => $value) { + yield $value => $key; + } + }); + } + + /** + * Get an item by key. + * + * @template TGetDefault + * + * @param TKey|null $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault + */ + public function get($key, $default = null) + { + if (is_null($key)) { + return; + } + + foreach ($this as $outerKey => $outerValue) { + if ($outerKey == $key) { + return $outerValue; + } + } + + return value($default); + } + + /** + * Group an associative array by a field or using a callback. + * + * @template TGroupKey of array-key + * + * @param (callable(TValue, TKey): TGroupKey)|array|string $groupBy + * @param bool $preserveKeys + * @return static<($groupBy is string ? array-key : ($groupBy is array ? array-key : TGroupKey)), static<($preserveKeys is true ? TKey : int), ($groupBy is array ? mixed : TValue)>> + */ + public function groupBy($groupBy, $preserveKeys = false) + { + return $this->passthru('groupBy', func_get_args()); + } + + /** + * Key an associative array by a field or using a callback. + * + * @template TNewKey of array-key + * + * @param (callable(TValue, TKey): TNewKey)|array|string $keyBy + * @return static<($keyBy is string ? array-key : ($keyBy is array ? array-key : TNewKey)), TValue> + */ + public function keyBy($keyBy) + { + return new static(function () use ($keyBy) { + $keyBy = $this->valueRetriever($keyBy); + + foreach ($this as $key => $item) { + $resolvedKey = $keyBy($item, $key); + + if (is_object($resolvedKey)) { + $resolvedKey = (string) $resolvedKey; + } + + yield $resolvedKey => $item; + } + }); + } + + /** + * Determine if an item exists in the collection by key. + * + * @param mixed $key + * @return bool + */ + public function has($key) + { + $keys = array_flip(is_array($key) ? $key : func_get_args()); + $count = count($keys); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys) && --$count == 0) { + return true; + } + } + + return false; + } + + /** + * Determine if any of the keys exist in the collection. + * + * @param mixed $key + * @return bool + */ + public function hasAny($key) + { + $keys = array_flip(is_array($key) ? $key : func_get_args()); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys)) { + return true; + } + } + + return false; + } + + /** + * Concatenate values of a given key as a string. + * + * @param (callable(TValue, TKey): mixed)|string $value + * @param string|null $glue + * @return string + */ + public function implode($value, $glue = null) + { + return $this->collect()->implode(...func_get_args()); + } + + /** + * Intersect the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersect($items) + { + return $this->passthru('intersect', func_get_args()); + } + + /** + * Intersect the collection with the given items, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectUsing($items, callable $callback) + { + return $this->passthru('intersectUsing', func_get_args()); + } + + /** + * Intersect the collection with the given items with additional index check. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectAssoc($items) + { + return $this->passthru('intersectAssoc', func_get_args()); + } + + /** + * Intersect the collection with the given items with additional index check, using the callback. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @param callable(TValue, TValue): int $callback + * @return static + */ + public function intersectAssocUsing($items, callable $callback) + { + return $this->passthru('intersectAssocUsing', func_get_args()); + } + + /** + * Intersect the collection with the given items by key. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function intersectByKeys($items) + { + return $this->passthru('intersectByKeys', func_get_args()); + } + + /** + * Determine if the items are empty or not. + * + * @return bool + */ + public function isEmpty() + { + return ! $this->getIterator()->valid(); + } + + /** + * Determine if the collection contains a single item. + * + * @return bool + */ + public function containsOneItem() + { + return $this->take(2)->count() === 1; + } + + /** + * Join all items from the collection using a string. The final items can use a separate glue string. + * + * @param string $glue + * @param string $finalGlue + * @return string + */ + public function join($glue, $finalGlue = '') + { + return $this->collect()->join(...func_get_args()); + } + + /** + * Get the keys of the collection items. + * + * @return static + */ + public function keys() + { + return new static(function () { + foreach ($this as $key => $value) { + yield $key; + } + }); + } + + /** + * Get the last item from the collection. + * + * @template TLastDefault + * + * @param (callable(TValue, TKey): bool)|null $callback + * @param TLastDefault|(\Closure(): TLastDefault) $default + * @return TValue|TLastDefault + */ + public function last(?callable $callback = null, $default = null) + { + $needle = $placeholder = new stdClass; + + foreach ($this as $key => $value) { + if (is_null($callback) || $callback($value, $key)) { + $needle = $value; + } + } + + return $needle === $placeholder ? value($default) : $needle; + } + + /** + * Get the values of a given key. + * + * @param string|array $value + * @param string|null $key + * @return static + */ + public function pluck($value, $key = null) + { + return new static(function () use ($value, $key) { + [$value, $key] = $this->explodePluckParameters($value, $key); + + foreach ($this as $item) { + $itemValue = $value instanceof Closure + ? $value($item) + : data_get($item, $value); + + if (is_null($key)) { + yield $itemValue; + } else { + $itemKey = $key instanceof Closure + ? $key($item) + : data_get($item, $key); + + if (is_object($itemKey) && method_exists($itemKey, '__toString')) { + $itemKey = (string) $itemKey; + } + + yield $itemKey => $itemValue; + } + } + }); + } + + /** + * Run a map over each of the items. + * + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return static + */ + public function map(callable $callback) + { + return new static(function () use ($callback) { + foreach ($this as $key => $value) { + yield $key => $callback($value, $key); + } + }); + } + + /** + * Run a dictionary map over the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapToDictionaryKey of array-key + * @template TMapToDictionaryValue + * + * @param callable(TValue, TKey): array $callback + * @return static> + */ + public function mapToDictionary(callable $callback) + { + return $this->passthru('mapToDictionary', func_get_args()); + } + + /** + * Run an associative map over each of the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapWithKeysKey of array-key + * @template TMapWithKeysValue + * + * @param callable(TValue, TKey): array $callback + * @return static + */ + public function mapWithKeys(callable $callback) + { + return new static(function () use ($callback) { + foreach ($this as $key => $value) { + yield from $callback($value, $key); + } + }); + } + + /** + * Merge the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function merge($items) + { + return $this->passthru('merge', func_get_args()); + } + + /** + * Recursively merge the collection with the given items. + * + * @template TMergeRecursiveValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function mergeRecursive($items) + { + return $this->passthru('mergeRecursive', func_get_args()); + } + + /** + * Multiply the items in the collection by the multiplier. + * + * @param int $multiplier + * @return static + */ + public function multiply(int $multiplier) + { + return $this->passthru('multiply', func_get_args()); + } + + /** + * Create a collection by using this collection for keys and another for its values. + * + * @template TCombineValue + * + * @param \IteratorAggregate|array|(callable(): \Generator) $values + * @return static + */ + public function combine($values) + { + return new static(function () use ($values) { + $values = $this->makeIterator($values); + + $errorMessage = 'Both parameters should have an equal number of elements'; + + foreach ($this as $key) { + if (! $values->valid()) { + trigger_error($errorMessage, E_USER_WARNING); + + break; + } + + yield $key => $values->current(); + + $values->next(); + } + + if ($values->valid()) { + trigger_error($errorMessage, E_USER_WARNING); + } + }); + } + + /** + * Union the collection with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function union($items) + { + return $this->passthru('union', func_get_args()); + } + + /** + * Create a new collection consisting of every n-th element. + * + * @param int $step + * @param int $offset + * @return static + */ + public function nth($step, $offset = 0) + { + return new static(function () use ($step, $offset) { + $position = 0; + + foreach ($this->slice($offset) as $item) { + if ($position % $step === 0) { + yield $item; + } + + $position++; + } + }); + } + + /** + * Get the items with the specified keys. + * + * @param \Illuminate\Support\Enumerable|array|string $keys + * @return static + */ + public function only($keys) + { + if ($keys instanceof Enumerable) { + $keys = $keys->all(); + } elseif (! is_null($keys)) { + $keys = is_array($keys) ? $keys : func_get_args(); + } + + return new static(function () use ($keys) { + if (is_null($keys)) { + yield from $this; + } else { + $keys = array_flip($keys); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $keys)) { + yield $key => $value; + + unset($keys[$key]); + + if (empty($keys)) { + break; + } + } + } + } + }); + } + + /** + * Select specific values from the items within the collection. + * + * @param \Illuminate\Support\Enumerable|array|string $keys + * @return static + */ + public function select($keys) + { + if ($keys instanceof Enumerable) { + $keys = $keys->all(); + } elseif (! is_null($keys)) { + $keys = is_array($keys) ? $keys : func_get_args(); + } + + return new static(function () use ($keys) { + if (is_null($keys)) { + yield from $this; + } else { + foreach ($this as $item) { + $result = []; + + foreach ($keys as $key) { + if (Arr::accessible($item) && Arr::exists($item, $key)) { + $result[$key] = $item[$key]; + } elseif (is_object($item) && isset($item->{$key})) { + $result[$key] = $item->{$key}; + } + } + + yield $result; + } + } + }); + } + + /** + * Push all of the given items onto the collection. + * + * @template TConcatKey of array-key + * @template TConcatValue + * + * @param iterable $source + * @return static + */ + public function concat($source) + { + return (new static(function () use ($source) { + yield from $this; + yield from $source; + }))->values(); + } + + /** + * Get one or a specified number of items randomly from the collection. + * + * @param int|null $number + * @return static|TValue + * + * @throws \InvalidArgumentException + */ + public function random($number = null) + { + $result = $this->collect()->random(...func_get_args()); + + return is_null($number) ? $result : new static($result); + } + + /** + * Replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replace($items) + { + return new static(function () use ($items) { + $items = $this->getArrayableItems($items); + + foreach ($this as $key => $value) { + if (array_key_exists($key, $items)) { + yield $key => $items[$key]; + + unset($items[$key]); + } else { + yield $key => $value; + } + } + + foreach ($items as $key => $value) { + yield $key => $value; + } + }); + } + + /** + * Recursively replace the collection items with the given items. + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable $items + * @return static + */ + public function replaceRecursive($items) + { + return $this->passthru('replaceRecursive', func_get_args()); + } + + /** + * Reverse items order. + * + * @return static + */ + public function reverse() + { + return $this->passthru('reverse', func_get_args()); + } + + /** + * Search the collection for a given value and return the corresponding key if successful. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TKey|false + */ + public function search($value, $strict = false) + { + /** @var (callable(TValue,TKey): bool) $predicate */ + $predicate = $this->useAsCallable($value) + ? $value + : function ($item) use ($value, $strict) { + return $strict ? $item === $value : $item == $value; + }; + + foreach ($this as $key => $item) { + if ($predicate($item, $key)) { + return $key; + } + } + + return false; + } + + /** + * Get the item before the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function before($value, $strict = false) + { + $previous = null; + + /** @var (callable(TValue,TKey): bool) $predicate */ + $predicate = $this->useAsCallable($value) + ? $value + : function ($item) use ($value, $strict) { + return $strict ? $item === $value : $item == $value; + }; + + foreach ($this as $key => $item) { + if ($predicate($item, $key)) { + return $previous; + } + + $previous = $item; + } + + return null; + } + + /** + * Get the item after the given item. + * + * @param TValue|(callable(TValue,TKey): bool) $value + * @param bool $strict + * @return TValue|null + */ + public function after($value, $strict = false) + { + $found = false; + + /** @var (callable(TValue,TKey): bool) $predicate */ + $predicate = $this->useAsCallable($value) + ? $value + : function ($item) use ($value, $strict) { + return $strict ? $item === $value : $item == $value; + }; + + foreach ($this as $key => $item) { + if ($found) { + return $item; + } + + if ($predicate($item, $key)) { + $found = true; + } + } + + return null; + } + + /** + * Shuffle the items in the collection. + * + * @return static + */ + public function shuffle() + { + return $this->passthru('shuffle', []); + } + + /** + * Create chunks representing a "sliding window" view of the items in the collection. + * + * @param int $size + * @param int $step + * @return static + */ + public function sliding($size = 2, $step = 1) + { + return new static(function () use ($size, $step) { + $iterator = $this->getIterator(); + + $chunk = []; + + while ($iterator->valid()) { + $chunk[$iterator->key()] = $iterator->current(); + + if (count($chunk) == $size) { + yield (new static($chunk))->tap(function () use (&$chunk, $step) { + $chunk = array_slice($chunk, $step, null, true); + }); + + // If the $step between chunks is bigger than each chunk's $size + // we will skip the extra items (which should never be in any + // chunk) before we continue to the next chunk in the loop. + if ($step > $size) { + $skip = $step - $size; + + for ($i = 0; $i < $skip && $iterator->valid(); $i++) { + $iterator->next(); + } + } + } + + $iterator->next(); + } + }); + } + + /** + * Skip the first {$count} items. + * + * @param int $count + * @return static + */ + public function skip($count) + { + return new static(function () use ($count) { + $iterator = $this->getIterator(); + + while ($iterator->valid() && $count--) { + $iterator->next(); + } + + while ($iterator->valid()) { + yield $iterator->key() => $iterator->current(); + + $iterator->next(); + } + }); + } + + /** + * Skip items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipUntil($value) + { + $callback = $this->useAsCallable($value) ? $value : $this->equality($value); + + return $this->skipWhile($this->negate($callback)); + } + + /** + * Skip items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function skipWhile($value) + { + $callback = $this->useAsCallable($value) ? $value : $this->equality($value); + + return new static(function () use ($callback) { + $iterator = $this->getIterator(); + + while ($iterator->valid() && $callback($iterator->current(), $iterator->key())) { + $iterator->next(); + } + + while ($iterator->valid()) { + yield $iterator->key() => $iterator->current(); + + $iterator->next(); + } + }); + } + + /** + * Get a slice of items from the enumerable. + * + * @param int $offset + * @param int|null $length + * @return static + */ + public function slice($offset, $length = null) + { + if ($offset < 0 || $length < 0) { + return $this->passthru('slice', func_get_args()); + } + + $instance = $this->skip($offset); + + return is_null($length) ? $instance : $instance->take($length); + } + + /** + * Split a collection into a certain number of groups. + * + * @param int $numberOfGroups + * @return static + */ + public function split($numberOfGroups) + { + return $this->passthru('split', func_get_args()); + } + + /** + * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + * @throws \Illuminate\Support\MultipleItemsFoundException + */ + public function sole($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + return $this + ->unless($filter == null) + ->filter($filter) + ->take(2) + ->collect() + ->sole(); + } + + /** + * Get the first item in the collection but throw an exception if no matching items exist. + * + * @param (callable(TValue, TKey): bool)|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue + * + * @throws \Illuminate\Support\ItemNotFoundException + */ + public function firstOrFail($key = null, $operator = null, $value = null) + { + $filter = func_num_args() > 1 + ? $this->operatorForWhere(...func_get_args()) + : $key; + + return $this + ->unless($filter == null) + ->filter($filter) + ->take(1) + ->collect() + ->firstOrFail(); + } + + /** + * Chunk the collection into chunks of the given size. + * + * @param int $size + * @param bool $preserveKeys + * @return ($preserveKeys is true ? static : static>) + */ + public function chunk($size, $preserveKeys = true) + { + if ($size <= 0) { + return static::empty(); + } + + $add = match ($preserveKeys) { + true => fn (array &$chunk, Traversable $iterator) => $chunk[$iterator->key()] = $iterator->current(), + false => fn (array &$chunk, Traversable $iterator) => $chunk[] = $iterator->current(), + }; + + return new static(function () use ($size, $add) { + $iterator = $this->getIterator(); + + while ($iterator->valid()) { + $chunk = []; + + while (true) { + $add($chunk, $iterator); + + if (count($chunk) < $size) { + $iterator->next(); + + if (! $iterator->valid()) { + break; + } + } else { + break; + } + } + + yield new static($chunk); + + $iterator->next(); + } + }); + } + + /** + * Split a collection into a certain number of groups, and fill the first groups completely. + * + * @param int $numberOfGroups + * @return static + */ + public function splitIn($numberOfGroups) + { + return $this->chunk((int) ceil($this->count() / $numberOfGroups)); + } + + /** + * Chunk the collection into chunks with a callback. + * + * @param callable(TValue, TKey, Collection): bool $callback + * @return static> + */ + public function chunkWhile(callable $callback) + { + return new static(function () use ($callback) { + $iterator = $this->getIterator(); + + $chunk = new Collection; + + if ($iterator->valid()) { + $chunk[$iterator->key()] = $iterator->current(); + + $iterator->next(); + } + + while ($iterator->valid()) { + if (! $callback($iterator->current(), $iterator->key(), $chunk)) { + yield new static($chunk); + + $chunk = new Collection; + } + + $chunk[$iterator->key()] = $iterator->current(); + + $iterator->next(); + } + + if ($chunk->isNotEmpty()) { + yield new static($chunk); + } + }); + } + + /** + * Sort through each item with a callback. + * + * @param (callable(TValue, TValue): int)|null|int $callback + * @return static + */ + public function sort($callback = null) + { + return $this->passthru('sort', func_get_args()); + } + + /** + * Sort items in descending order. + * + * @param int $options + * @return static + */ + public function sortDesc($options = SORT_REGULAR) + { + return $this->passthru('sortDesc', func_get_args()); + } + + /** + * Sort the collection using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @param bool $descending + * @return static + */ + public function sortBy($callback, $options = SORT_REGULAR, $descending = false) + { + return $this->passthru('sortBy', func_get_args()); + } + + /** + * Sort the collection in descending order using the given callback. + * + * @param array|(callable(TValue, TKey): mixed)|string $callback + * @param int $options + * @return static + */ + public function sortByDesc($callback, $options = SORT_REGULAR) + { + return $this->passthru('sortByDesc', func_get_args()); + } + + /** + * Sort the collection keys. + * + * @param int $options + * @param bool $descending + * @return static + */ + public function sortKeys($options = SORT_REGULAR, $descending = false) + { + return $this->passthru('sortKeys', func_get_args()); + } + + /** + * Sort the collection keys in descending order. + * + * @param int $options + * @return static + */ + public function sortKeysDesc($options = SORT_REGULAR) + { + return $this->passthru('sortKeysDesc', func_get_args()); + } + + /** + * Sort the collection keys using a callback. + * + * @param callable(TKey, TKey): int $callback + * @return static + */ + public function sortKeysUsing(callable $callback) + { + return $this->passthru('sortKeysUsing', func_get_args()); + } + + /** + * Take the first or last {$limit} items. + * + * @param int $limit + * @return static + */ + public function take($limit) + { + if ($limit < 0) { + return new static(function () use ($limit) { + $limit = abs($limit); + $ringBuffer = []; + $position = 0; + + foreach ($this as $key => $value) { + $ringBuffer[$position] = [$key, $value]; + $position = ($position + 1) % $limit; + } + + for ($i = 0, $end = min($limit, count($ringBuffer)); $i < $end; $i++) { + $pointer = ($position + $i) % $limit; + yield $ringBuffer[$pointer][0] => $ringBuffer[$pointer][1]; + } + }); + } + + return new static(function () use ($limit) { + $iterator = $this->getIterator(); + + while ($limit--) { + if (! $iterator->valid()) { + break; + } + + yield $iterator->key() => $iterator->current(); + + if ($limit) { + $iterator->next(); + } + } + }); + } + + /** + * Take items in the collection until the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeUntil($value) + { + /** @var callable(TValue, TKey): bool $callback */ + $callback = $this->useAsCallable($value) ? $value : $this->equality($value); + + return new static(function () use ($callback) { + foreach ($this as $key => $item) { + if ($callback($item, $key)) { + break; + } + + yield $key => $item; + } + }); + } + + /** + * Take items in the collection until a given point in time. + * + * @param \DateTimeInterface $timeout + * @return static + */ + public function takeUntilTimeout(DateTimeInterface $timeout) + { + $timeout = $timeout->getTimestamp(); + + return new static(function () use ($timeout) { + if ($this->now() >= $timeout) { + return; + } + + foreach ($this as $key => $value) { + yield $key => $value; + + if ($this->now() >= $timeout) { + break; + } + } + }); + } + + /** + * Take items in the collection while the given condition is met. + * + * @param TValue|callable(TValue,TKey): bool $value + * @return static + */ + public function takeWhile($value) + { + /** @var callable(TValue, TKey): bool $callback */ + $callback = $this->useAsCallable($value) ? $value : $this->equality($value); + + return $this->takeUntil(fn ($item, $key) => ! $callback($item, $key)); + } + + /** + * Pass each item in the collection to the given callback, lazily. + * + * @param callable(TValue, TKey): mixed $callback + * @return static + */ + public function tapEach(callable $callback) + { + return new static(function () use ($callback) { + foreach ($this as $key => $value) { + $callback($value, $key); + + yield $key => $value; + } + }); + } + + /** + * Throttle the values, releasing them at most once per the given seconds. + * + * @return static + */ + public function throttle(float $seconds) + { + return new static(function () use ($seconds) { + $microseconds = $seconds * 1_000_000; + + foreach ($this as $key => $value) { + $fetchedAt = $this->preciseNow(); + + yield $key => $value; + + $sleep = $microseconds - ($this->preciseNow() - $fetchedAt); + + $this->usleep((int) $sleep); + } + }); + } + + /** + * Flatten a multi-dimensional associative array with dots. + * + * @return static + */ + public function dot() + { + return $this->passthru('dot', []); + } + + /** + * Convert a flatten "dot" notation array into an expanded array. + * + * @return static + */ + public function undot() + { + return $this->passthru('undot', []); + } + + /** + * Return only unique items from the collection array. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + $callback = $this->valueRetriever($key); + + return new static(function () use ($callback, $strict) { + $exists = []; + + foreach ($this as $key => $item) { + if (! in_array($id = $callback($item, $key), $exists, $strict)) { + yield $key => $item; + + $exists[] = $id; + } + } + }); + } + + /** + * Reset the keys on the underlying array. + * + * @return static + */ + public function values() + { + return new static(function () { + foreach ($this as $item) { + yield $item; + } + }); + } + + /** + * Run the given callback every time the interval has passed. + * + * @return static + */ + public function withHeartbeat(DateInterval|int $interval, callable $callback) + { + $seconds = is_int($interval) ? $interval : $this->intervalSeconds($interval); + + return new static(function () use ($seconds, $callback) { + $start = $this->now(); + + foreach ($this as $key => $value) { + $now = $this->now(); + + if (($now - $start) >= $seconds) { + $callback(); + + $start = $now; + } + + yield $key => $value; + } + }); + } + + /** + * Get the total seconds from the given interval. + */ + protected function intervalSeconds(DateInterval $interval): int + { + $start = new DateTimeImmutable(); + + return $start->add($interval)->getTimestamp() - $start->getTimestamp(); + } + + /** + * Zip the collection together with one or more arrays. + * + * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]); + * => [[1, 4], [2, 5], [3, 6]] + * + * @template TZipValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable ...$items + * @return static> + */ + public function zip($items) + { + $iterables = func_get_args(); + + return new static(function () use ($iterables) { + $iterators = (new Collection($iterables)) + ->map(fn ($iterable) => $this->makeIterator($iterable)) + ->prepend($this->getIterator()); + + while ($iterators->contains->valid()) { + yield new static($iterators->map->current()); + + $iterators->each->next(); + } + }); + } + + /** + * Pad collection to the specified length with a value. + * + * @template TPadValue + * + * @param int $size + * @param TPadValue $value + * @return static + */ + public function pad($size, $value) + { + if ($size < 0) { + return $this->passthru('pad', func_get_args()); + } + + return new static(function () use ($size, $value) { + $yielded = 0; + + foreach ($this as $index => $item) { + yield $index => $item; + + $yielded++; + } + + while ($yielded++ < $size) { + yield $value; + } + }); + } + + /** + * Get the values iterator. + * + * @return \Traversable + */ + public function getIterator(): Traversable + { + return $this->makeIterator($this->source); + } + + /** + * Count the number of items in the collection. + * + * @return int + */ + public function count(): int + { + if (is_array($this->source)) { + return count($this->source); + } + + return iterator_count($this->getIterator()); + } + + /** + * Make an iterator from the given source. + * + * @template TIteratorKey of array-key + * @template TIteratorValue + * + * @param \IteratorAggregate|array|(callable(): \Generator) $source + * @return \Traversable + */ + protected function makeIterator($source) + { + if ($source instanceof IteratorAggregate) { + return $source->getIterator(); + } + + if (is_array($source)) { + return new ArrayIterator($source); + } + + if (is_callable($source)) { + $maybeTraversable = $source(); + + return $maybeTraversable instanceof Traversable + ? $maybeTraversable + : new ArrayIterator(Arr::wrap($maybeTraversable)); + } + + return new ArrayIterator((array) $source); + } + + /** + * Explode the "value" and "key" arguments passed to "pluck". + * + * @param string|string[] $value + * @param string|string[]|null $key + * @return array{string[],string[]|null} + */ + protected function explodePluckParameters($value, $key) + { + $value = is_string($value) ? explode('.', $value) : $value; + + $key = is_null($key) || is_array($key) || $key instanceof Closure ? $key : explode('.', $key); + + return [$value, $key]; + } + + /** + * Pass this lazy collection through a method on the collection class. + * + * @param string $method + * @param array $params + * @return static + */ + protected function passthru($method, array $params) + { + return new static(function () use ($method, $params) { + yield from $this->collect()->$method(...$params); + }); + } + + /** + * Get the current time. + * + * @return int + */ + protected function now() + { + return class_exists(Carbon::class) + ? Carbon::now()->timestamp + : time(); + } + + /** + * Get the precise current time. + * + * @return float + */ + protected function preciseNow() + { + return class_exists(Carbon::class) + ? Carbon::now()->getPreciseTimestamp() + : microtime(true) * 1_000_000; + } + + /** + * Sleep for the given amount of microseconds. + * + * @return void + */ + protected function usleep(int $microseconds) + { + if ($microseconds <= 0) { + return; + } + + class_exists(Sleep::class) + ? Sleep::usleep($microseconds) + : usleep($microseconds); + } +} diff --git a/plugins/vendor/illuminate/collections/MultipleItemsFoundException.php b/plugins/vendor/illuminate/collections/MultipleItemsFoundException.php new file mode 100644 index 00000000..9c5c7c56 --- /dev/null +++ b/plugins/vendor/illuminate/collections/MultipleItemsFoundException.php @@ -0,0 +1,39 @@ +count = $count; + + parent::__construct("$count items were found.", $code, $previous); + } + + /** + * Get the number of items found. + * + * @return int + */ + public function getCount() + { + return $this->count; + } +} diff --git a/plugins/vendor/illuminate/collections/Traits/EnumeratesValues.php b/plugins/vendor/illuminate/collections/Traits/EnumeratesValues.php new file mode 100644 index 00000000..9b6c4cf6 --- /dev/null +++ b/plugins/vendor/illuminate/collections/Traits/EnumeratesValues.php @@ -0,0 +1,1191 @@ + $average + * @property-read HigherOrderCollectionProxy $avg + * @property-read HigherOrderCollectionProxy $contains + * @property-read HigherOrderCollectionProxy $doesntContain + * @property-read HigherOrderCollectionProxy $each + * @property-read HigherOrderCollectionProxy $every + * @property-read HigherOrderCollectionProxy $filter + * @property-read HigherOrderCollectionProxy $first + * @property-read HigherOrderCollectionProxy $flatMap + * @property-read HigherOrderCollectionProxy $groupBy + * @property-read HigherOrderCollectionProxy $keyBy + * @property-read HigherOrderCollectionProxy $last + * @property-read HigherOrderCollectionProxy $map + * @property-read HigherOrderCollectionProxy $max + * @property-read HigherOrderCollectionProxy $min + * @property-read HigherOrderCollectionProxy $partition + * @property-read HigherOrderCollectionProxy $percentage + * @property-read HigherOrderCollectionProxy $reject + * @property-read HigherOrderCollectionProxy $skipUntil + * @property-read HigherOrderCollectionProxy $skipWhile + * @property-read HigherOrderCollectionProxy $some + * @property-read HigherOrderCollectionProxy $sortBy + * @property-read HigherOrderCollectionProxy $sortByDesc + * @property-read HigherOrderCollectionProxy $sum + * @property-read HigherOrderCollectionProxy $takeUntil + * @property-read HigherOrderCollectionProxy $takeWhile + * @property-read HigherOrderCollectionProxy $unique + * @property-read HigherOrderCollectionProxy $unless + * @property-read HigherOrderCollectionProxy $until + * @property-read HigherOrderCollectionProxy $when + */ +trait EnumeratesValues +{ + use Conditionable; + + /** + * Indicates that the object's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + + /** + * The methods that can be proxied. + * + * @var array + */ + protected static $proxies = [ + 'average', + 'avg', + 'contains', + 'doesntContain', + 'each', + 'every', + 'filter', + 'first', + 'flatMap', + 'groupBy', + 'keyBy', + 'last', + 'map', + 'max', + 'min', + 'partition', + 'percentage', + 'reject', + 'skipUntil', + 'skipWhile', + 'some', + 'sortBy', + 'sortByDesc', + 'sum', + 'takeUntil', + 'takeWhile', + 'unique', + 'unless', + 'until', + 'when', + ]; + + /** + * Create a new collection instance if the value isn't one already. + * + * @template TMakeKey of array-key + * @template TMakeValue + * + * @param \Illuminate\Contracts\Support\Arrayable|iterable|null $items + * @return static + */ + public static function make($items = []) + { + return new static($items); + } + + /** + * Wrap the given value in a collection if applicable. + * + * @template TWrapValue + * + * @param iterable|TWrapValue $value + * @return static + */ + public static function wrap($value) + { + return $value instanceof Enumerable + ? new static($value) + : new static(Arr::wrap($value)); + } + + /** + * Get the underlying items from the given collection if applicable. + * + * @template TUnwrapKey of array-key + * @template TUnwrapValue + * + * @param array|static $value + * @return array + */ + public static function unwrap($value) + { + return $value instanceof Enumerable ? $value->all() : $value; + } + + /** + * Create a new instance with no items. + * + * @return static + */ + public static function empty() + { + return new static([]); + } + + /** + * Create a new collection by invoking the callback a given amount of times. + * + * @template TTimesValue + * + * @param int $number + * @param (callable(int): TTimesValue)|null $callback + * @return static + */ + public static function times($number, ?callable $callback = null) + { + if ($number < 1) { + return new static; + } + + return static::range(1, $number) + ->unless($callback == null) + ->map($callback); + } + + /** + * Create a new collection by decoding a JSON string. + * + * @param string $json + * @param int $depth + * @param int $flags + * @return static + */ + public static function fromJson($json, $depth = 512, $flags = 0) + { + return new static(json_decode($json, true, $depth, $flags)); + } + + /** + * Get the average value of a given key. + * + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null + */ + public function avg($callback = null) + { + $callback = $this->valueRetriever($callback); + + $reduced = $this->reduce(static function (&$reduce, $value) use ($callback) { + if (! is_null($resolved = $callback($value))) { + $reduce[0] += $resolved; + $reduce[1]++; + } + + return $reduce; + }, [0, 0]); + + return $reduced[1] ? $reduced[0] / $reduced[1] : null; + } + + /** + * Alias for the "avg" method. + * + * @param (callable(TValue): float|int)|string|null $callback + * @return float|int|null + */ + public function average($callback = null) + { + return $this->avg($callback); + } + + /** + * Alias for the "contains" method. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function some($key, $operator = null, $value = null) + { + return $this->contains(...func_get_args()); + } + + /** + * Dump the given arguments and terminate execution. + * + * @param mixed ...$args + * @return never + */ + public function dd(...$args) + { + dd($this->all(), ...$args); + } + + /** + * Dump the items. + * + * @param mixed ...$args + * @return $this + */ + public function dump(...$args) + { + dump($this->all(), ...$args); + + return $this; + } + + /** + * Execute a callback over each item. + * + * @param callable(TValue, TKey): mixed $callback + * @return $this + */ + public function each(callable $callback) + { + foreach ($this as $key => $item) { + if ($callback($item, $key) === false) { + break; + } + } + + return $this; + } + + /** + * Execute a callback over each nested chunk of items. + * + * @param callable(...mixed): mixed $callback + * @return static + */ + public function eachSpread(callable $callback) + { + return $this->each(function ($chunk, $key) use ($callback) { + $chunk[] = $key; + + return $callback(...$chunk); + }); + } + + /** + * Determine if all items pass the given truth test. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return bool + */ + public function every($key, $operator = null, $value = null) + { + if (func_num_args() === 1) { + $callback = $this->valueRetriever($key); + + foreach ($this as $k => $v) { + if (! $callback($v, $k)) { + return false; + } + } + + return true; + } + + return $this->every($this->operatorForWhere(...func_get_args())); + } + + /** + * Get the first item by the given key value pair. + * + * @param callable|string $key + * @param mixed $operator + * @param mixed $value + * @return TValue|null + */ + public function firstWhere($key, $operator = null, $value = null) + { + return $this->first($this->operatorForWhere(...func_get_args())); + } + + /** + * Get a single key's value from the first matching item in the collection. + * + * @template TValueDefault + * + * @param string $key + * @param TValueDefault|(\Closure(): TValueDefault) $default + * @return TValue|TValueDefault + */ + public function value($key, $default = null) + { + if ($value = $this->firstWhere($key)) { + return data_get($value, $key, $default); + } + + return value($default); + } + + /** + * Ensure that every item in the collection is of the expected type. + * + * @template TEnsureOfType + * + * @param class-string|array>|'string'|'int'|'float'|'bool'|'array'|'null' $type + * @return static + * + * @throws \UnexpectedValueException + */ + public function ensure($type) + { + $allowedTypes = is_array($type) ? $type : [$type]; + + return $this->each(function ($item, $index) use ($allowedTypes) { + $itemType = get_debug_type($item); + + foreach ($allowedTypes as $allowedType) { + if ($itemType === $allowedType || $item instanceof $allowedType) { + return true; + } + } + + throw new UnexpectedValueException( + sprintf("Collection should only include [%s] items, but '%s' found at position %d.", implode(', ', $allowedTypes), $itemType, $index) + ); + }); + } + + /** + * Determine if the collection is not empty. + * + * @phpstan-assert-if-true TValue $this->first() + * @phpstan-assert-if-true TValue $this->last() + * + * @phpstan-assert-if-false null $this->first() + * @phpstan-assert-if-false null $this->last() + * + * @return bool + */ + public function isNotEmpty() + { + return ! $this->isEmpty(); + } + + /** + * Run a map over each nested chunk of items. + * + * @template TMapSpreadValue + * + * @param callable(mixed...): TMapSpreadValue $callback + * @return static + */ + public function mapSpread(callable $callback) + { + return $this->map(function ($chunk, $key) use ($callback) { + $chunk[] = $key; + + return $callback(...$chunk); + }); + } + + /** + * Run a grouping map over the items. + * + * The callback should return an associative array with a single key/value pair. + * + * @template TMapToGroupsKey of array-key + * @template TMapToGroupsValue + * + * @param callable(TValue, TKey): array $callback + * @return static> + */ + public function mapToGroups(callable $callback) + { + $groups = $this->mapToDictionary($callback); + + return $groups->map($this->make(...)); + } + + /** + * Map a collection and flatten the result by a single level. + * + * @template TFlatMapKey of array-key + * @template TFlatMapValue + * + * @param callable(TValue, TKey): (\Illuminate\Support\Collection|array) $callback + * @return static + */ + public function flatMap(callable $callback) + { + return $this->map($callback)->collapse(); + } + + /** + * Map the values into a new class. + * + * @template TMapIntoValue + * + * @param class-string $class + * @return static + */ + public function mapInto($class) + { + if (is_subclass_of($class, BackedEnum::class)) { + return $this->map(fn ($value, $key) => $class::from($value)); + } + + return $this->map(fn ($value, $key) => new $class($value, $key)); + } + + /** + * Get the min value of a given key. + * + * @param (callable(TValue):mixed)|string|null $callback + * @return mixed + */ + public function min($callback = null) + { + $callback = $this->valueRetriever($callback); + + return $this->map(fn ($value) => $callback($value)) + ->reject(fn ($value) => is_null($value)) + ->reduce(fn ($result, $value) => is_null($result) || $value < $result ? $value : $result); + } + + /** + * Get the max value of a given key. + * + * @param (callable(TValue):mixed)|string|null $callback + * @return mixed + */ + public function max($callback = null) + { + $callback = $this->valueRetriever($callback); + + return $this->reject(fn ($value) => is_null($value))->reduce(function ($result, $item) use ($callback) { + $value = $callback($item); + + return is_null($result) || $value > $result ? $value : $result; + }); + } + + /** + * "Paginate" the collection by slicing it into a smaller collection. + * + * @param int $page + * @param int $perPage + * @return static + */ + public function forPage($page, $perPage) + { + $offset = max(0, ($page - 1) * $perPage); + + return $this->slice($offset, $perPage); + } + + /** + * Partition the collection into two arrays using the given callback or key. + * + * @param (callable(TValue, TKey): bool)|TValue|string $key + * @param mixed $operator + * @param mixed $value + * @return static, static> + */ + public function partition($key, $operator = null, $value = null) + { + $callback = func_num_args() === 1 + ? $this->valueRetriever($key) + : $this->operatorForWhere(...func_get_args()); + + [$passed, $failed] = Arr::partition($this->getIterator(), $callback); + + return new static([new static($passed), new static($failed)]); + } + + /** + * Calculate the percentage of items that pass a given truth test. + * + * @param (callable(TValue, TKey): bool) $callback + * @param int $precision + * @return float|null + */ + public function percentage(callable $callback, int $precision = 2) + { + if ($this->isEmpty()) { + return null; + } + + return round( + $this->filter($callback)->count() / $this->count() * 100, + $precision + ); + } + + /** + * Get the sum of the given values. + * + * @template TReturnType + * + * @param (callable(TValue): TReturnType)|string|null $callback + * @return ($callback is callable ? TReturnType : mixed) + */ + public function sum($callback = null) + { + $callback = is_null($callback) + ? $this->identity() + : $this->valueRetriever($callback); + + return $this->reduce(fn ($result, $item) => $result + $callback($item), 0); + } + + /** + * Apply the callback if the collection is empty. + * + * @template TWhenEmptyReturnType + * + * @param (callable($this): TWhenEmptyReturnType) $callback + * @param (callable($this): TWhenEmptyReturnType)|null $default + * @return $this|TWhenEmptyReturnType + */ + public function whenEmpty(callable $callback, ?callable $default = null) + { + return $this->when($this->isEmpty(), $callback, $default); + } + + /** + * Apply the callback if the collection is not empty. + * + * @template TWhenNotEmptyReturnType + * + * @param callable($this): TWhenNotEmptyReturnType $callback + * @param (callable($this): TWhenNotEmptyReturnType)|null $default + * @return $this|TWhenNotEmptyReturnType + */ + public function whenNotEmpty(callable $callback, ?callable $default = null) + { + return $this->when($this->isNotEmpty(), $callback, $default); + } + + /** + * Apply the callback unless the collection is empty. + * + * @template TUnlessEmptyReturnType + * + * @param callable($this): TUnlessEmptyReturnType $callback + * @param (callable($this): TUnlessEmptyReturnType)|null $default + * @return $this|TUnlessEmptyReturnType + */ + public function unlessEmpty(callable $callback, ?callable $default = null) + { + return $this->whenNotEmpty($callback, $default); + } + + /** + * Apply the callback unless the collection is not empty. + * + * @template TUnlessNotEmptyReturnType + * + * @param callable($this): TUnlessNotEmptyReturnType $callback + * @param (callable($this): TUnlessNotEmptyReturnType)|null $default + * @return $this|TUnlessNotEmptyReturnType + */ + public function unlessNotEmpty(callable $callback, ?callable $default = null) + { + return $this->whenEmpty($callback, $default); + } + + /** + * Filter items by the given key value pair. + * + * @param callable|string $key + * @param mixed $operator + * @param mixed $value + * @return static + */ + public function where($key, $operator = null, $value = null) + { + return $this->filter($this->operatorForWhere(...func_get_args())); + } + + /** + * Filter items where the value for the given key is null. + * + * @param string|null $key + * @return static + */ + public function whereNull($key = null) + { + return $this->whereStrict($key, null); + } + + /** + * Filter items where the value for the given key is not null. + * + * @param string|null $key + * @return static + */ + public function whereNotNull($key = null) + { + return $this->where($key, '!==', null); + } + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param mixed $value + * @return static + */ + public function whereStrict($key, $value) + { + return $this->where($key, '===', $value); + } + + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param bool $strict + * @return static + */ + public function whereIn($key, $values, $strict = false) + { + $values = $this->getArrayableItems($values); + + return $this->filter(fn ($item) => in_array(data_get($item, $key), $values, $strict)); + } + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereInStrict($key, $values) + { + return $this->whereIn($key, $values, true); + } + + /** + * Filter items such that the value of the given key is between the given values. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereBetween($key, $values) + { + return $this->where($key, '>=', reset($values))->where($key, '<=', end($values)); + } + + /** + * Filter items such that the value of the given key is not between the given values. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereNotBetween($key, $values) + { + return $this->filter( + fn ($item) => data_get($item, $key) < reset($values) || data_get($item, $key) > end($values) + ); + } + + /** + * Filter items by the given key value pair. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @param bool $strict + * @return static + */ + public function whereNotIn($key, $values, $strict = false) + { + $values = $this->getArrayableItems($values); + + return $this->reject(fn ($item) => in_array(data_get($item, $key), $values, $strict)); + } + + /** + * Filter items by the given key value pair using strict comparison. + * + * @param string $key + * @param \Illuminate\Contracts\Support\Arrayable|iterable $values + * @return static + */ + public function whereNotInStrict($key, $values) + { + return $this->whereNotIn($key, $values, true); + } + + /** + * Filter the items, removing any items that don't match the given type(s). + * + * @template TWhereInstanceOf + * + * @param class-string|array> $type + * @return static + */ + public function whereInstanceOf($type) + { + return $this->filter(function ($value) use ($type) { + if (is_array($type)) { + foreach ($type as $classType) { + if ($value instanceof $classType) { + return true; + } + } + + return false; + } + + return $value instanceof $type; + }); + } + + /** + * Pass the collection to the given callback and return the result. + * + * @template TPipeReturnType + * + * @param callable($this): TPipeReturnType $callback + * @return TPipeReturnType + */ + public function pipe(callable $callback) + { + return $callback($this); + } + + /** + * Pass the collection into a new class. + * + * @template TPipeIntoValue + * + * @param class-string $class + * @return TPipeIntoValue + */ + public function pipeInto($class) + { + return new $class($this); + } + + /** + * Pass the collection through a series of callable pipes and return the result. + * + * @param array $callbacks + * @return mixed + */ + public function pipeThrough($callbacks) + { + return (new Collection($callbacks))->reduce( + fn ($carry, $callback) => $callback($carry), + $this, + ); + } + + /** + * Reduce the collection to a single value. + * + * @template TReduceInitial + * @template TReduceReturnType + * + * @param callable(TReduceInitial|TReduceReturnType, TValue, TKey): TReduceReturnType $callback + * @param TReduceInitial $initial + * @return TReduceReturnType + */ + public function reduce(callable $callback, $initial = null) + { + $result = $initial; + + foreach ($this as $key => $value) { + $result = $callback($result, $value, $key); + } + + return $result; + } + + /** + * Reduce the collection to multiple aggregate values. + * + * @param callable $callback + * @param mixed ...$initial + * @return array + * + * @throws \UnexpectedValueException + */ + public function reduceSpread(callable $callback, ...$initial) + { + $result = $initial; + + foreach ($this as $key => $value) { + $result = call_user_func_array($callback, array_merge($result, [$value, $key])); + + if (! is_array($result)) { + throw new UnexpectedValueException(sprintf( + "%s::reduceSpread expects reducer to return an array, but got a '%s' instead.", + class_basename(static::class), gettype($result) + )); + } + } + + return $result; + } + + /** + * Reduce an associative collection to a single value. + * + * @template TReduceWithKeysInitial + * @template TReduceWithKeysReturnType + * + * @param callable(TReduceWithKeysInitial|TReduceWithKeysReturnType, TValue, TKey): TReduceWithKeysReturnType $callback + * @param TReduceWithKeysInitial $initial + * @return TReduceWithKeysReturnType + */ + public function reduceWithKeys(callable $callback, $initial = null) + { + return $this->reduce($callback, $initial); + } + + /** + * Create a collection of all elements that do not pass a given truth test. + * + * @param (callable(TValue, TKey): bool)|bool|TValue $callback + * @return static + */ + public function reject($callback = true) + { + $useAsCallable = $this->useAsCallable($callback); + + return $this->filter(function ($value, $key) use ($callback, $useAsCallable) { + return $useAsCallable + ? ! $callback($value, $key) + : $value != $callback; + }); + } + + /** + * Pass the collection to the given callback and then return it. + * + * @param callable($this): mixed $callback + * @return $this + */ + public function tap(callable $callback) + { + $callback($this); + + return $this; + } + + /** + * Return only unique items from the collection array. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @param bool $strict + * @return static + */ + public function unique($key = null, $strict = false) + { + $callback = $this->valueRetriever($key); + + $exists = []; + + return $this->reject(function ($item, $key) use ($callback, $strict, &$exists) { + if (in_array($id = $callback($item, $key), $exists, $strict)) { + return true; + } + + $exists[] = $id; + }); + } + + /** + * Return only unique items from the collection array using strict comparison. + * + * @param (callable(TValue, TKey): mixed)|string|null $key + * @return static + */ + public function uniqueStrict($key = null) + { + return $this->unique($key, true); + } + + /** + * Collect the values into a collection. + * + * @return \Illuminate\Support\Collection + */ + public function collect() + { + return new Collection($this->all()); + } + + /** + * Get the collection of items as a plain array. + * + * @return array + */ + public function toArray() + { + return $this->map(fn ($value) => $value instanceof Arrayable ? $value->toArray() : $value)->all(); + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return array_map(function ($value) { + if ($value instanceof JsonSerializable) { + return $value->jsonSerialize(); + } elseif ($value instanceof Jsonable) { + return json_decode($value->toJson(), true); + } elseif ($value instanceof Arrayable) { + return $value->toArray(); + } + + return $value; + }, $this->all()); + } + + /** + * Get the collection of items as JSON. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Get the collection of items as pretty print formatted JSON. + * + * @param int $options + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } + + /** + * Get a CachingIterator instance. + * + * @param int $flags + * @return \CachingIterator + */ + public function getCachingIterator($flags = CachingIterator::CALL_TOSTRING) + { + return new CachingIterator($this->getIterator(), $flags); + } + + /** + * Convert the collection to its string representation. + * + * @return string + */ + public function __toString() + { + return $this->escapeWhenCastingToString + ? e($this->toJson()) + : $this->toJson(); + } + + /** + * Indicate that the model's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; + } + + /** + * Add a method to the list of proxied methods. + * + * @param string $method + * @return void + */ + public static function proxy($method) + { + static::$proxies[] = $method; + } + + /** + * Dynamically access collection proxies. + * + * @param string $key + * @return mixed + * + * @throws \Exception + */ + public function __get($key) + { + if (! in_array($key, static::$proxies)) { + throw new Exception("Property [{$key}] does not exist on this collection instance."); + } + + return new HigherOrderCollectionProxy($this, $key); + } + + /** + * Results array of items from Collection or Arrayable. + * + * @param mixed $items + * @return array + */ + protected function getArrayableItems($items) + { + return is_null($items) || is_scalar($items) || $items instanceof UnitEnum + ? Arr::wrap($items) + : Arr::from($items); + } + + /** + * Get an operator checker callback. + * + * @param callable|string $key + * @param string|null $operator + * @param mixed $value + * @return \Closure + */ + protected function operatorForWhere($key, $operator = null, $value = null) + { + if ($this->useAsCallable($key)) { + return $key; + } + + if (func_num_args() === 1) { + $value = true; + + $operator = '='; + } + + if (func_num_args() === 2) { + $value = $operator; + + $operator = '='; + } + + return function ($item) use ($key, $operator, $value) { + $retrieved = enum_value(data_get($item, $key)); + $value = enum_value($value); + + $strings = array_filter([$retrieved, $value], function ($value) { + return match (true) { + is_string($value) => true, + $value instanceof \Stringable => true, + default => false, + }; + }); + + if (count($strings) < 2 && count(array_filter([$retrieved, $value], 'is_object')) == 1) { + return in_array($operator, ['!=', '<>', '!==']); + } + + switch ($operator) { + default: + case '=': + case '==': return $retrieved == $value; + case '!=': + case '<>': return $retrieved != $value; + case '<': return $retrieved < $value; + case '>': return $retrieved > $value; + case '<=': return $retrieved <= $value; + case '>=': return $retrieved >= $value; + case '===': return $retrieved === $value; + case '!==': return $retrieved !== $value; + case '<=>': return $retrieved <=> $value; + } + }; + } + + /** + * Determine if the given value is callable, but not a string. + * + * @param mixed $value + * @return bool + */ + protected function useAsCallable($value) + { + return ! is_string($value) && is_callable($value); + } + + /** + * Get a value retrieving callback. + * + * @param callable|string|null $value + * @return callable + */ + protected function valueRetriever($value) + { + if ($this->useAsCallable($value)) { + return $value; + } + + return fn ($item) => data_get($item, $value); + } + + /** + * Make a function to check an item's equality. + * + * @param mixed $value + * @return \Closure(mixed): bool + */ + protected function equality($value) + { + return fn ($item) => $item === $value; + } + + /** + * Make a function using another function, by negating its result. + * + * @param \Closure $callback + * @return \Closure + */ + protected function negate(Closure $callback) + { + return fn (...$params) => ! $callback(...$params); + } + + /** + * Make a function that returns what's passed to it. + * + * @return \Closure(TValue): TValue + */ + protected function identity() + { + return fn ($value) => $value; + } +} diff --git a/plugins/vendor/illuminate/collections/Traits/TransformsToResourceCollection.php b/plugins/vendor/illuminate/collections/Traits/TransformsToResourceCollection.php new file mode 100644 index 00000000..22143b35 --- /dev/null +++ b/plugins/vendor/illuminate/collections/Traits/TransformsToResourceCollection.php @@ -0,0 +1,68 @@ +|null $resourceClass + * @return \Illuminate\Http\Resources\Json\ResourceCollection + * + * @throws \Throwable + */ + public function toResourceCollection(?string $resourceClass = null): ResourceCollection + { + if ($resourceClass === null) { + return $this->guessResourceCollection(); + } + + return $resourceClass::collection($this); + } + + /** + * Guess the resource collection for the items. + * + * @return \Illuminate\Http\Resources\Json\ResourceCollection + * + * @throws \Throwable + */ + protected function guessResourceCollection(): ResourceCollection + { + if ($this->isEmpty()) { + return new ResourceCollection($this); + } + + $model = $this->items[0] ?? null; + + throw_unless(is_object($model), LogicException::class, 'Resource collection guesser expects the collection to contain objects.'); + + /** @var class-string $className */ + $className = get_class($model); + + throw_unless(method_exists($className, 'guessResourceName'), LogicException::class, sprintf('Expected class %s to implement guessResourceName method. Make sure the model uses the TransformsToResource trait.', $className)); + + $resourceClasses = $className::guessResourceName(); + + foreach ($resourceClasses as $resourceClass) { + $resourceCollection = $resourceClass.'Collection'; + + if (is_string($resourceCollection) && class_exists($resourceCollection)) { + return new $resourceCollection($this); + } + } + + foreach ($resourceClasses as $resourceClass) { + if (is_string($resourceClass) && class_exists($resourceClass)) { + return $resourceClass::collection($this); + } + } + + throw new LogicException(sprintf('Failed to find resource class for model [%s].', $className)); + } +} diff --git a/plugins/vendor/illuminate/collections/composer.json b/plugins/vendor/illuminate/collections/composer.json new file mode 100644 index 00000000..107e36a5 --- /dev/null +++ b/plugins/vendor/illuminate/collections/composer.json @@ -0,0 +1,46 @@ +{ + "name": "illuminate/collections", + "description": "The Illuminate Collections package.", + "license": "MIT", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "require": { + "php": "^8.2", + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "symfony/polyfill-php84": "^1.33", + "symfony/polyfill-php85": "^1.33" + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "functions.php", + "helpers.php" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "suggest": { + "illuminate/http": "Required to convert collections to API resources (^12.0).", + "symfony/var-dumper": "Required to use the dump method (^7.2)." + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/illuminate/collections/functions.php b/plugins/vendor/illuminate/collections/functions.php new file mode 100644 index 00000000..6ccd9b3e --- /dev/null +++ b/plugins/vendor/illuminate/collections/functions.php @@ -0,0 +1,27 @@ + $value->value, + $value instanceof \UnitEnum => $value->name, + + default => $value ?? value($default), + }; + } +} diff --git a/plugins/vendor/illuminate/collections/helpers.php b/plugins/vendor/illuminate/collections/helpers.php new file mode 100644 index 00000000..ed94004f --- /dev/null +++ b/plugins/vendor/illuminate/collections/helpers.php @@ -0,0 +1,259 @@ +|iterable|null $value + * @return \Illuminate\Support\Collection + */ + function collect($value = []): Collection + { + return new Collection($value); + } +} + +if (! function_exists('data_fill')) { + /** + * Fill in data where it's missing. + * + * @param mixed $target + * @param string|array $key + * @param mixed $value + * @return mixed + */ + function data_fill(&$target, $key, $value) + { + return data_set($target, $key, $value, false); + } +} + +if (! function_exists('data_get')) { + /** + * Get an item from an array or object using "dot" notation. + * + * @param mixed $target + * @param string|array|int|null $key + * @param mixed $default + * @return mixed + */ + function data_get($target, $key, $default = null) + { + if (is_null($key)) { + return $target; + } + + $key = is_array($key) ? $key : explode('.', $key); + + foreach ($key as $i => $segment) { + unset($key[$i]); + + if (is_null($segment)) { + return $target; + } + + if ($segment === '*') { + if ($target instanceof Collection) { + $target = $target->all(); + } elseif (! is_iterable($target)) { + return value($default); + } + + $result = []; + + foreach ($target as $item) { + $result[] = data_get($item, $key); + } + + return in_array('*', $key) ? Arr::collapse($result) : $result; + } + + $segment = match ($segment) { + '\*' => '*', + '\{first}' => '{first}', + '{first}' => array_key_first(Arr::from($target)), + '\{last}' => '{last}', + '{last}' => array_key_last(Arr::from($target)), + default => $segment, + }; + + if (Arr::accessible($target) && Arr::exists($target, $segment)) { + $target = $target[$segment]; + } elseif (is_object($target) && isset($target->{$segment})) { + $target = $target->{$segment}; + } else { + return value($default); + } + } + + return $target; + } +} + +if (! function_exists('data_set')) { + /** + * Set an item on an array or object using dot notation. + * + * @param mixed $target + * @param string|array $key + * @param mixed $value + * @param bool $overwrite + * @return mixed + */ + function data_set(&$target, $key, $value, $overwrite = true) + { + $segments = is_array($key) ? $key : explode('.', $key); + + if (($segment = array_shift($segments)) === '*') { + if (! Arr::accessible($target)) { + $target = []; + } + + if ($segments) { + foreach ($target as &$inner) { + data_set($inner, $segments, $value, $overwrite); + } + } elseif ($overwrite) { + foreach ($target as &$inner) { + $inner = $value; + } + } + } elseif (Arr::accessible($target)) { + if ($segments) { + if (! Arr::exists($target, $segment)) { + $target[$segment] = []; + } + + data_set($target[$segment], $segments, $value, $overwrite); + } elseif ($overwrite || ! Arr::exists($target, $segment)) { + $target[$segment] = $value; + } + } elseif (is_object($target)) { + if ($segments) { + if (! isset($target->{$segment})) { + $target->{$segment} = []; + } + + data_set($target->{$segment}, $segments, $value, $overwrite); + } elseif ($overwrite || ! isset($target->{$segment})) { + $target->{$segment} = $value; + } + } else { + $target = []; + + if ($segments) { + data_set($target[$segment], $segments, $value, $overwrite); + } elseif ($overwrite) { + $target[$segment] = $value; + } + } + + return $target; + } +} + +if (! function_exists('data_forget')) { + /** + * Remove / unset an item from an array or object using "dot" notation. + * + * @param mixed $target + * @param string|array|int|null $key + * @return mixed + */ + function data_forget(&$target, $key) + { + $segments = is_array($key) ? $key : explode('.', $key); + + if (($segment = array_shift($segments)) === '*' && Arr::accessible($target)) { + if ($segments) { + foreach ($target as &$inner) { + data_forget($inner, $segments); + } + } + } elseif (Arr::accessible($target)) { + if ($segments && Arr::exists($target, $segment)) { + data_forget($target[$segment], $segments); + } else { + Arr::forget($target, $segment); + } + } elseif (is_object($target)) { + if ($segments && isset($target->{$segment})) { + data_forget($target->{$segment}, $segments); + } elseif (isset($target->{$segment})) { + unset($target->{$segment}); + } + } + + return $target; + } +} + +if (! function_exists('head')) { + /** + * Get the first element of an array. Useful for method chaining. + * + * @param array $array + * @return mixed + */ + function head($array) + { + return empty($array) ? false : array_first($array); + } +} + +if (! function_exists('last')) { + /** + * Get the last element from an array. + * + * @param array $array + * @return mixed + */ + function last($array) + { + return empty($array) ? false : array_last($array); + } +} + +if (! function_exists('value')) { + /** + * Return the default value of the given value. + * + * @template TValue + * @template TArgs + * + * @param TValue|\Closure(TArgs): TValue $value + * @param TArgs ...$args + * @return TValue + */ + function value($value, ...$args) + { + return $value instanceof Closure ? $value(...$args) : $value; + } +} + +if (! function_exists('when')) { + /** + * Return a value if the given condition is true. + * + * @param mixed $condition + * @param \Closure|mixed $value + * @param \Closure|mixed $default + * @return mixed + */ + function when($condition, $value, $default = null) + { + $condition = $condition instanceof Closure ? $condition() : $condition; + + if ($condition) { + return value($value, $condition); + } + + return value($default, $condition); + } +} diff --git a/plugins/vendor/illuminate/conditionable/HigherOrderWhenProxy.php b/plugins/vendor/illuminate/conditionable/HigherOrderWhenProxy.php new file mode 100644 index 00000000..0a694c24 --- /dev/null +++ b/plugins/vendor/illuminate/conditionable/HigherOrderWhenProxy.php @@ -0,0 +1,108 @@ +target = $target; + } + + /** + * Set the condition on the proxy. + * + * @param bool $condition + * @return $this + */ + public function condition($condition) + { + [$this->condition, $this->hasCondition] = [$condition, true]; + + return $this; + } + + /** + * Indicate that the condition should be negated. + * + * @return $this + */ + public function negateConditionOnCapture() + { + $this->negateConditionOnCapture = true; + + return $this; + } + + /** + * Proxy accessing an attribute onto the target. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + if (! $this->hasCondition) { + $condition = $this->target->{$key}; + + return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition); + } + + return $this->condition + ? $this->target->{$key} + : $this->target; + } + + /** + * Proxy a method call on the target. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + if (! $this->hasCondition) { + $condition = $this->target->{$method}(...$parameters); + + return $this->condition($this->negateConditionOnCapture ? ! $condition : $condition); + } + + return $this->condition + ? $this->target->{$method}(...$parameters) + : $this->target; + } +} diff --git a/plugins/vendor/illuminate/conditionable/LICENSE.md b/plugins/vendor/illuminate/conditionable/LICENSE.md new file mode 100644 index 00000000..79810c84 --- /dev/null +++ b/plugins/vendor/illuminate/conditionable/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Taylor Otwell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/illuminate/conditionable/Traits/Conditionable.php b/plugins/vendor/illuminate/conditionable/Traits/Conditionable.php new file mode 100644 index 00000000..5e3194bb --- /dev/null +++ b/plugins/vendor/illuminate/conditionable/Traits/Conditionable.php @@ -0,0 +1,73 @@ +condition($value); + } + + if ($value) { + return $callback($this, $value) ?? $this; + } elseif ($default) { + return $default($this, $value) ?? $this; + } + + return $this; + } + + /** + * Apply the callback if the given "value" is (or resolves to) falsy. + * + * @template TUnlessParameter + * @template TUnlessReturnType + * + * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value + * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback + * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default + * @return $this|TUnlessReturnType + */ + public function unless($value = null, ?callable $callback = null, ?callable $default = null) + { + $value = $value instanceof Closure ? $value($this) : $value; + + if (func_num_args() === 0) { + return (new HigherOrderWhenProxy($this))->negateConditionOnCapture(); + } + + if (func_num_args() === 1) { + return (new HigherOrderWhenProxy($this))->condition(! $value); + } + + if (! $value) { + return $callback($this, $value) ?? $this; + } elseif ($default) { + return $default($this, $value) ?? $this; + } + + return $this; + } +} diff --git a/plugins/vendor/illuminate/conditionable/composer.json b/plugins/vendor/illuminate/conditionable/composer.json new file mode 100644 index 00000000..9e0ddfbb --- /dev/null +++ b/plugins/vendor/illuminate/conditionable/composer.json @@ -0,0 +1,33 @@ +{ + "name": "illuminate/conditionable", + "description": "The Illuminate Conditionable package.", + "license": "MIT", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "require": { + "php": "^8.2" + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/illuminate/contracts/Auth/Access/Authorizable.php b/plugins/vendor/illuminate/contracts/Auth/Access/Authorizable.php new file mode 100644 index 00000000..6b8a0441 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Auth/Access/Authorizable.php @@ -0,0 +1,15 @@ + $id + * @return ($id is class-string ? TClass : mixed) + */ + public function get(string $id); + + /** + * Determine if the given abstract type has been bound. + * + * @param string $abstract + * @return bool + */ + public function bound($abstract); + + /** + * Alias a type to a different name. + * + * @param string $abstract + * @param string $alias + * @return void + * + * @throws \LogicException + */ + public function alias($abstract, $alias); + + /** + * Assign a set of tags to a given binding. + * + * @param array|string $abstracts + * @param mixed ...$tags + * @return void + */ + public function tag($abstracts, $tags); + + /** + * Resolve all of the bindings for a given tag. + * + * @param string $tag + * @return iterable + */ + public function tagged($tag); + + /** + * Register a binding with the container. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @param bool $shared + * @return void + */ + public function bind($abstract, $concrete = null, $shared = false); + + /** + * Bind a callback to resolve with Container::call. + * + * @param array|string $method + * @param \Closure $callback + * @return void + */ + public function bindMethod($method, $callback); + + /** + * Register a binding if it hasn't already been registered. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @param bool $shared + * @return void + */ + public function bindIf($abstract, $concrete = null, $shared = false); + + /** + * Register a shared binding in the container. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function singleton($abstract, $concrete = null); + + /** + * Register a shared binding if it hasn't already been registered. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function singletonIf($abstract, $concrete = null); + + /** + * Register a scoped binding in the container. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scoped($abstract, $concrete = null); + + /** + * Register a scoped binding if it hasn't already been registered. + * + * @param \Closure|string $abstract + * @param \Closure|string|null $concrete + * @return void + */ + public function scopedIf($abstract, $concrete = null); + + /** + * "Extend" an abstract type in the container. + * + * @param \Closure|string $abstract + * @param \Closure $closure + * @return void + * + * @throws \InvalidArgumentException + */ + public function extend($abstract, Closure $closure); + + /** + * Register an existing instance as shared in the container. + * + * @template TInstance of mixed + * + * @param \Closure|string $abstract + * @param TInstance $instance + * @return TInstance + */ + public function instance($abstract, $instance); + + /** + * Add a contextual binding to the container. + * + * @param string $concrete + * @param \Closure|string $abstract + * @param \Closure|string $implementation + * @return void + */ + public function addContextualBinding($concrete, $abstract, $implementation); + + /** + * Define a contextual binding. + * + * @param string|array $concrete + * @return \Illuminate\Contracts\Container\ContextualBindingBuilder + */ + public function when($concrete); + + /** + * Get a closure to resolve the given type from the container. + * + * @template TClass of object + * + * @param string|class-string $abstract + * @return ($abstract is class-string ? \Closure(): TClass : \Closure(): mixed) + */ + public function factory($abstract); + + /** + * Flush the container of all bindings and resolved instances. + * + * @return void + */ + public function flush(); + + /** + * Resolve the given type from the container. + * + * @template TClass of object + * + * @param string|class-string $abstract + * @param array $parameters + * @return ($abstract is class-string ? TClass : mixed) + * + * @throws \Illuminate\Contracts\Container\BindingResolutionException + */ + public function make($abstract, array $parameters = []); + + /** + * Call the given Closure / class@method and inject its dependencies. + * + * @param callable|string $callback + * @param array $parameters + * @param string|null $defaultMethod + * @return mixed + */ + public function call($callback, array $parameters = [], $defaultMethod = null); + + /** + * Determine if the given abstract type has been resolved. + * + * @param string $abstract + * @return bool + */ + public function resolved($abstract); + + /** + * Register a new before resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + */ + public function beforeResolving($abstract, ?Closure $callback = null); + + /** + * Register a new resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + */ + public function resolving($abstract, ?Closure $callback = null); + + /** + * Register a new after resolving callback. + * + * @param \Closure|string $abstract + * @param \Closure|null $callback + * @return void + */ + public function afterResolving($abstract, ?Closure $callback = null); +} diff --git a/plugins/vendor/illuminate/contracts/Container/ContextualAttribute.php b/plugins/vendor/illuminate/contracts/Container/ContextualAttribute.php new file mode 100644 index 00000000..06f6f06b --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Container/ContextualAttribute.php @@ -0,0 +1,8 @@ +|CastsAttributes|CastsInboundAttributes + */ + public static function castUsing(array $arguments); +} diff --git a/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php b/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php new file mode 100644 index 00000000..89cec66a --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php @@ -0,0 +1,34 @@ + $attributes + * @return TGet|null + */ + public function get(Model $model, string $key, mixed $value, array $attributes); + + /** + * Transform the attribute to its underlying model values. + * + * @param \Illuminate\Database\Eloquent\Model $model + * @param string $key + * @param TSet|null $value + * @param array $attributes + * @return mixed + */ + public function set(Model $model, string $key, mixed $value, array $attributes); +} diff --git a/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php b/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php new file mode 100644 index 00000000..312f7aed --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Database/Eloquent/CastsInboundAttributes.php @@ -0,0 +1,19 @@ + $attributes + * @return mixed + */ + public function set(Model $model, string $key, mixed $value, array $attributes); +} diff --git a/plugins/vendor/illuminate/contracts/Database/Eloquent/ComparesCastableAttributes.php b/plugins/vendor/illuminate/contracts/Database/Eloquent/ComparesCastableAttributes.php new file mode 100644 index 00000000..5c9ad195 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Database/Eloquent/ComparesCastableAttributes.php @@ -0,0 +1,19 @@ + $attributes + * @return mixed + */ + public function serialize(Model $model, string $key, mixed $value, array $attributes); +} diff --git a/plugins/vendor/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php b/plugins/vendor/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php new file mode 100644 index 00000000..c82125aa --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Database/Eloquent/SupportsPartialRelations.php @@ -0,0 +1,30 @@ + + */ + public $class; + + /** + * The unique identifier of the model. + * + * This may be either a single ID or an array of IDs. + * + * @var mixed + */ + public $id; + + /** + * The relationships loaded on the model. + * + * @var array + */ + public $relations; + + /** + * The connection name of the model. + * + * @var string|null + */ + public $connection; + + /** + * The class name of the model collection. + * + * @var class-string<\Illuminate\Database\Eloquent\Collection>|null + */ + public $collectionClass; + + /** + * Create a new model identifier. + * + * @param class-string<\Illuminate\Database\Eloquent\Model> $class + * @param mixed $id + * @param array $relations + * @param mixed $connection + */ + public function __construct($class, $id, array $relations, $connection) + { + $this->id = $id; + $this->class = $class; + $this->relations = $relations; + $this->connection = $connection; + } + + /** + * Specify the collection class that should be used when serializing / restoring collections. + * + * @param class-string<\Illuminate\Database\Eloquent\Collection> $collectionClass + * @return $this + */ + public function useCollectionClass(?string $collectionClass) + { + $this->collectionClass = $collectionClass; + + return $this; + } +} diff --git a/plugins/vendor/illuminate/contracts/Database/Query/Builder.php b/plugins/vendor/illuminate/contracts/Database/Query/Builder.php new file mode 100644 index 00000000..e116ebf4 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Database/Query/Builder.php @@ -0,0 +1,12 @@ + + */ + public function files($directory = null, $recursive = false); + + /** + * Get all of the files from the given directory (recursive). + * + * @param string|null $directory + * @return array + */ + public function allFiles($directory = null); + + /** + * Get all of the directories within a given directory. + * + * @param string|null $directory + * @param bool $recursive + * @return array + */ + public function directories($directory = null, $recursive = false); + + /** + * Get all (recursive) of the directories within a given directory. + * + * @param string|null $directory + * @return array + */ + public function allDirectories($directory = null); + + /** + * Create a directory. + * + * @param string $path + * @return bool + */ + public function makeDirectory($path); + + /** + * Recursively delete a directory. + * + * @param string $directory + * @return bool + */ + public function deleteDirectory($directory); +} diff --git a/plugins/vendor/illuminate/contracts/Filesystem/LockTimeoutException.php b/plugins/vendor/illuminate/contracts/Filesystem/LockTimeoutException.php new file mode 100644 index 00000000..f03f5c4e --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Filesystem/LockTimeoutException.php @@ -0,0 +1,10 @@ + + */ + public function items(); + + /** + * Get the "cursor" of the previous set of items. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function previousCursor(); + + /** + * Get the "cursor" of the next set of items. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function nextCursor(); + + /** + * Determine how many items are being shown per page. + * + * @return int + */ + public function perPage(); + + /** + * Get the current cursor being paginated. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function cursor(); + + /** + * Determine if there are enough items to split into multiple pages. + * + * @return bool + */ + public function hasPages(); + + /** + * Determine if there are more items in the data source. + * + * @return bool + */ + public function hasMorePages(); + + /** + * Get the base path for paginator generated URLs. + * + * @return string|null + */ + public function path(); + + /** + * Determine if the list of items is empty or not. + * + * @return bool + */ + public function isEmpty(); + + /** + * Determine if the list of items is not empty. + * + * @return bool + */ + public function isNotEmpty(); + + /** + * Render the paginator using a given view. + * + * @param string|null $view + * @param array $data + * @return string + */ + public function render($view = null, $data = []); +} diff --git a/plugins/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php b/plugins/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php new file mode 100644 index 00000000..bd080821 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Pagination/LengthAwarePaginator.php @@ -0,0 +1,36 @@ + + */ +interface LengthAwarePaginator extends Paginator +{ + /** + * Create a range of pagination URLs. + * + * @param int $start + * @param int $end + * @return array + */ + public function getUrlRange($start, $end); + + /** + * Determine the total number of items in the data store. + * + * @return int + */ + public function total(); + + /** + * Get the page number of the last available page. + * + * @return int + */ + public function lastPage(); +} diff --git a/plugins/vendor/illuminate/contracts/Pagination/Paginator.php b/plugins/vendor/illuminate/contracts/Pagination/Paginator.php new file mode 100644 index 00000000..409ea1d6 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Pagination/Paginator.php @@ -0,0 +1,138 @@ + + */ + public function items(); + + /** + * Get the "index" of the first item being paginated. + * + * @return int|null + */ + public function firstItem(); + + /** + * Get the "index" of the last item being paginated. + * + * @return int|null + */ + public function lastItem(); + + /** + * Determine how many items are being shown per page. + * + * @return int + */ + public function perPage(); + + /** + * Determine the current page being paginated. + * + * @return int + */ + public function currentPage(); + + /** + * Determine if there are enough items to split into multiple pages. + * + * @return bool + */ + public function hasPages(); + + /** + * Determine if there are more items in the data store. + * + * @return bool + */ + public function hasMorePages(); + + /** + * Get the base path for paginator generated URLs. + * + * @return string|null + */ + public function path(); + + /** + * Determine if the list of items is empty or not. + * + * @return bool + */ + public function isEmpty(); + + /** + * Determine if the list of items is not empty. + * + * @return bool + */ + public function isNotEmpty(); + + /** + * Render the paginator using a given view. + * + * @param string|null $view + * @param array $data + * @return string + */ + public function render($view = null, $data = []); +} diff --git a/plugins/vendor/illuminate/contracts/Pipeline/Hub.php b/plugins/vendor/illuminate/contracts/Pipeline/Hub.php new file mode 100644 index 00000000..1ae675f7 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Pipeline/Hub.php @@ -0,0 +1,15 @@ + + */ + public function getQueueableIds(); + + /** + * Get the relationships of the entities being queued. + * + * @return array + */ + public function getQueueableRelations(); + + /** + * Get the connection of the entities being queued. + * + * @return string|null + */ + public function getQueueableConnection(); +} diff --git a/plugins/vendor/illuminate/contracts/Queue/QueueableEntity.php b/plugins/vendor/illuminate/contracts/Queue/QueueableEntity.php new file mode 100644 index 00000000..366f0c84 --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Queue/QueueableEntity.php @@ -0,0 +1,27 @@ + + */ + public function toArray(); +} diff --git a/plugins/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php b/plugins/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php new file mode 100644 index 00000000..e1be6fef --- /dev/null +++ b/plugins/vendor/illuminate/contracts/Support/CanBeEscapedWhenCastToString.php @@ -0,0 +1,14 @@ +getMethods( + ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED + ); + + foreach ($methods as $method) { + if ($replace || ! static::hasMacro($method->name)) { + static::macro($method->name, $method->invoke($mixin)); + } + } + } + + /** + * Checks if macro is registered. + * + * @param string $name + * @return bool + */ + public static function hasMacro($name) + { + return isset(static::$macros[$name]); + } + + /** + * Flush the existing macros. + * + * @return void + */ + public static function flushMacros() + { + static::$macros = []; + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * + * @throws \BadMethodCallException + */ + public static function __callStatic($method, $parameters) + { + if (! static::hasMacro($method)) { + throw new BadMethodCallException(sprintf( + 'Method %s::%s does not exist.', static::class, $method + )); + } + + $macro = static::$macros[$method]; + + if ($macro instanceof Closure) { + $macro = $macro->bindTo(null, static::class); + } + + return $macro(...$parameters); + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method + * @param array $parameters + * @return mixed + * + * @throws \BadMethodCallException + */ + public function __call($method, $parameters) + { + if (! static::hasMacro($method)) { + throw new BadMethodCallException(sprintf( + 'Method %s::%s does not exist.', static::class, $method + )); + } + + $macro = static::$macros[$method]; + + if ($macro instanceof Closure) { + $macro = $macro->bindTo($this, static::class); + } + + return $macro(...$parameters); + } +} diff --git a/plugins/vendor/illuminate/macroable/composer.json b/plugins/vendor/illuminate/macroable/composer.json new file mode 100644 index 00000000..38dc6f16 --- /dev/null +++ b/plugins/vendor/illuminate/macroable/composer.json @@ -0,0 +1,33 @@ +{ + "name": "illuminate/macroable", + "description": "The Illuminate Macroable package.", + "license": "MIT", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "require": { + "php": "^8.2" + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/illuminate/pagination/AbstractCursorPaginator.php b/plugins/vendor/illuminate/pagination/AbstractCursorPaginator.php new file mode 100644 index 00000000..fea9fdc2 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/AbstractCursorPaginator.php @@ -0,0 +1,687 @@ + + */ +abstract class AbstractCursorPaginator implements Htmlable, Stringable +{ + use ForwardsCalls, Tappable, TransformsToResourceCollection; + + /** + * All of the items being paginated. + * + * @var \Illuminate\Support\Collection + */ + protected $items; + + /** + * The number of items to be shown per page. + * + * @var int + */ + protected $perPage; + + /** + * The base path to assign to all URLs. + * + * @var string + */ + protected $path = '/'; + + /** + * The query parameters to add to all URLs. + * + * @var array + */ + protected $query = []; + + /** + * The URL fragment to add to all URLs. + * + * @var string|null + */ + protected $fragment; + + /** + * The cursor string variable used to store the page. + * + * @var string + */ + protected $cursorName = 'cursor'; + + /** + * The current cursor. + * + * @var \Illuminate\Pagination\Cursor|null + */ + protected $cursor; + + /** + * The paginator parameters for the cursor. + * + * @var array + */ + protected $parameters; + + /** + * The paginator options. + * + * @var array + */ + protected $options; + + /** + * The current cursor resolver callback. + * + * @var \Closure + */ + protected static $currentCursorResolver; + + /** + * Get the URL for a given cursor. + * + * @param \Illuminate\Pagination\Cursor|null $cursor + * @return string + */ + public function url($cursor) + { + // If we have any extra query string key / value pairs that need to be added + // onto the URL, we will put them in query string form and then attach it + // to the URL. This allows for extra information like sortings storage. + $parameters = is_null($cursor) ? [] : [$this->cursorName => $cursor->encode()]; + + if (count($this->query) > 0) { + $parameters = array_merge($this->query, $parameters); + } + + return $this->path() + .(str_contains($this->path(), '?') ? '&' : '?') + .Arr::query($parameters) + .$this->buildFragment(); + } + + /** + * Get the URL for the previous page. + * + * @return string|null + */ + public function previousPageUrl() + { + if (is_null($previousCursor = $this->previousCursor())) { + return null; + } + + return $this->url($previousCursor); + } + + /** + * The URL for the next page, or null. + * + * @return string|null + */ + public function nextPageUrl() + { + if (is_null($nextCursor = $this->nextCursor())) { + return null; + } + + return $this->url($nextCursor); + } + + /** + * Get the "cursor" that points to the previous set of items. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function previousCursor() + { + if (is_null($this->cursor) || + ($this->cursor->pointsToPreviousItems() && ! $this->hasMore)) { + return null; + } + + if ($this->items->isEmpty()) { + return null; + } + + return $this->getCursorForItem($this->items->first(), false); + } + + /** + * Get the "cursor" that points to the next set of items. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function nextCursor() + { + if ((is_null($this->cursor) && ! $this->hasMore) || + (! is_null($this->cursor) && $this->cursor->pointsToNextItems() && ! $this->hasMore)) { + return null; + } + + if ($this->items->isEmpty()) { + return null; + } + + return $this->getCursorForItem($this->items->last(), true); + } + + /** + * Get a cursor instance for the given item. + * + * @param \ArrayAccess|\stdClass $item + * @param bool $isNext + * @return \Illuminate\Pagination\Cursor + */ + public function getCursorForItem($item, $isNext = true) + { + return new Cursor($this->getParametersForItem($item), $isNext); + } + + /** + * Get the cursor parameters for a given object. + * + * @param \ArrayAccess|\stdClass $item + * @return array + * + * @throws \Exception + */ + public function getParametersForItem($item) + { + return (new Collection($this->parameters)) + ->filter() + ->flip() + ->map(function ($_, $parameterName) use ($item) { + if ($item instanceof JsonResource) { + $item = $item->resource; + } + + if ($item instanceof Model && + ! is_null($parameter = $this->getPivotParameterForItem($item, $parameterName))) { + return $parameter; + } elseif ($item instanceof ArrayAccess || is_array($item)) { + return $this->ensureParameterIsPrimitive( + $item[$parameterName] ?? $item[Str::afterLast($parameterName, '.')] + ); + } elseif (is_object($item)) { + return $this->ensureParameterIsPrimitive( + $item->{$parameterName} ?? $item->{Str::afterLast($parameterName, '.')} + ); + } + + throw new Exception('Only arrays and objects are supported when cursor paginating items.'); + })->toArray(); + } + + /** + * Get the cursor parameter value from a pivot model if applicable. + * + * @param \ArrayAccess|\stdClass $item + * @param string $parameterName + * @return string|null + */ + protected function getPivotParameterForItem($item, $parameterName) + { + $table = Str::beforeLast($parameterName, '.'); + + foreach ($item->getRelations() as $relation) { + if ($relation instanceof Pivot && $relation->getTable() === $table) { + return $this->ensureParameterIsPrimitive( + $relation->getAttribute(Str::afterLast($parameterName, '.')) + ); + } + } + } + + /** + * Ensure the parameter is a primitive type. + * + * This can resolve issues that arise the developer uses a value object for an attribute. + * + * @param mixed $parameter + * @return mixed + */ + protected function ensureParameterIsPrimitive($parameter) + { + return is_object($parameter) && method_exists($parameter, '__toString') + ? (string) $parameter + : $parameter; + } + + /** + * Get / set the URL fragment to be appended to URLs. + * + * @param string|null $fragment + * @return $this|string|null + */ + public function fragment($fragment = null) + { + if (is_null($fragment)) { + return $this->fragment; + } + + $this->fragment = $fragment; + + return $this; + } + + /** + * Add a set of query string values to the paginator. + * + * @param array|string|null $key + * @param string|null $value + * @return $this + */ + public function appends($key, $value = null) + { + if (is_null($key)) { + return $this; + } + + if (is_array($key)) { + return $this->appendArray($key); + } + + return $this->addQuery($key, $value); + } + + /** + * Add an array of query string values. + * + * @param array $keys + * @return $this + */ + protected function appendArray(array $keys) + { + foreach ($keys as $key => $value) { + $this->addQuery($key, $value); + } + + return $this; + } + + /** + * Add all current query string values to the paginator. + * + * @return $this + */ + public function withQueryString() + { + if (! is_null($query = Paginator::resolveQueryString())) { + return $this->appends($query); + } + + return $this; + } + + /** + * Add a query string value to the paginator. + * + * @param string $key + * @param string $value + * @return $this + */ + protected function addQuery($key, $value) + { + if ($key !== $this->cursorName) { + $this->query[$key] = $value; + } + + return $this; + } + + /** + * Build the full fragment portion of a URL. + * + * @return string + */ + protected function buildFragment() + { + return $this->fragment ? '#'.$this->fragment : ''; + } + + /** + * Load a set of relationships onto the mixed relationship collection. + * + * @param string $relation + * @param array $relations + * @return $this + */ + public function loadMorph($relation, $relations) + { + $this->getCollection()->loadMorph($relation, $relations); + + return $this; + } + + /** + * Load a set of relationship counts onto the mixed relationship collection. + * + * @param string $relation + * @param array $relations + * @return $this + */ + public function loadMorphCount($relation, $relations) + { + $this->getCollection()->loadMorphCount($relation, $relations); + + return $this; + } + + /** + * Get the slice of items being paginated. + * + * @return array + */ + public function items() + { + return $this->items->all(); + } + + /** + * Transform each item in the slice of items using a callback. + * + * @template TThroughValue + * + * @param callable(TValue, TKey): TThroughValue $callback + * @return $this + * + * @phpstan-this-out static + */ + public function through(callable $callback) + { + $this->items->transform($callback); + + return $this; + } + + /** + * Get the number of items shown per page. + * + * @return int + */ + public function perPage() + { + return $this->perPage; + } + + /** + * Get the current cursor being paginated. + * + * @return \Illuminate\Pagination\Cursor|null + */ + public function cursor() + { + return $this->cursor; + } + + /** + * Get the query string variable used to store the cursor. + * + * @return string + */ + public function getCursorName() + { + return $this->cursorName; + } + + /** + * Set the query string variable used to store the cursor. + * + * @param string $name + * @return $this + */ + public function setCursorName($name) + { + $this->cursorName = $name; + + return $this; + } + + /** + * Set the base path to assign to all URLs. + * + * @param string $path + * @return $this + */ + public function withPath($path) + { + return $this->setPath($path); + } + + /** + * Set the base path to assign to all URLs. + * + * @param string $path + * @return $this + */ + public function setPath($path) + { + $this->path = $path; + + return $this; + } + + /** + * Get the base path for paginator generated URLs. + * + * @return string|null + */ + public function path() + { + return $this->path; + } + + /** + * Resolve the current cursor or return the default value. + * + * @param string $cursorName + * @return \Illuminate\Pagination\Cursor|null + */ + public static function resolveCurrentCursor($cursorName = 'cursor', $default = null) + { + if (isset(static::$currentCursorResolver)) { + return call_user_func(static::$currentCursorResolver, $cursorName); + } + + return $default; + } + + /** + * Set the current cursor resolver callback. + * + * @param \Closure $resolver + * @return void + */ + public static function currentCursorResolver(Closure $resolver) + { + static::$currentCursorResolver = $resolver; + } + + /** + * Get an instance of the view factory from the resolver. + * + * @return \Illuminate\Contracts\View\Factory + */ + public static function viewFactory() + { + return Paginator::viewFactory(); + } + + /** + * Get an iterator for the items. + * + * @return \ArrayIterator + */ + public function getIterator(): Traversable + { + return $this->items->getIterator(); + } + + /** + * Determine if the list of items is empty. + * + * @return bool + */ + public function isEmpty() + { + return $this->items->isEmpty(); + } + + /** + * Determine if the list of items is not empty. + * + * @return bool + */ + public function isNotEmpty() + { + return $this->items->isNotEmpty(); + } + + /** + * Get the number of items for the current page. + * + * @return int + */ + public function count(): int + { + return $this->items->count(); + } + + /** + * Get the paginator's underlying collection. + * + * @return \Illuminate\Support\Collection + */ + public function getCollection() + { + return $this->items; + } + + /** + * Set the paginator's underlying collection. + * + * @template TSetKey of array-key + * @template TSetValue + * + * @param \Illuminate\Support\Collection $collection + * @return $this + * + * @phpstan-this-out static + */ + public function setCollection(Collection $collection) + { + $this->items = $collection; + + return $this; + } + + /** + * Get the paginator options. + * + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * Determine if the given item exists. + * + * @param TKey $key + * @return bool + */ + public function offsetExists($key): bool + { + return $this->items->has($key); + } + + /** + * Get the item at the given offset. + * + * @param TKey $key + * @return TValue|null + */ + public function offsetGet($key): mixed + { + return $this->items->get($key); + } + + /** + * Set the item at the given offset. + * + * @param TKey|null $key + * @param TValue $value + * @return void + */ + public function offsetSet($key, $value): void + { + $this->items->put($key, $value); + } + + /** + * Unset the item at the given key. + * + * @param TKey $key + * @return void + */ + public function offsetUnset($key): void + { + $this->items->forget($key); + } + + /** + * Render the contents of the paginator to HTML. + * + * @return string + */ + public function toHtml() + { + return (string) $this->render(); + } + + /** + * Make dynamic calls into the collection. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->forwardCallTo($this->getCollection(), $method, $parameters); + } + + /** + * Render the contents of the paginator when casting to a string. + * + * @return string + */ + public function __toString() + { + return (string) $this->render(); + } +} diff --git a/plugins/vendor/illuminate/pagination/AbstractPaginator.php b/plugins/vendor/illuminate/pagination/AbstractPaginator.php new file mode 100644 index 00000000..bce700f7 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/AbstractPaginator.php @@ -0,0 +1,830 @@ + + */ +abstract class AbstractPaginator implements CanBeEscapedWhenCastToString, Htmlable, Stringable +{ + use ForwardsCalls, Tappable, TransformsToResourceCollection; + + /** + * All of the items being paginated. + * + * @var \Illuminate\Support\Collection + */ + protected $items; + + /** + * The number of items to be shown per page. + * + * @var int + */ + protected $perPage; + + /** + * The current page being "viewed". + * + * @var int + */ + protected $currentPage; + + /** + * The base path to assign to all URLs. + * + * @var string + */ + protected $path = '/'; + + /** + * The query parameters to add to all URLs. + * + * @var array + */ + protected $query = []; + + /** + * The URL fragment to add to all URLs. + * + * @var string|null + */ + protected $fragment; + + /** + * The query string variable used to store the page. + * + * @var string + */ + protected $pageName = 'page'; + + /** + * Indicates that the paginator's string representation should be escaped when __toString is invoked. + * + * @var bool + */ + protected $escapeWhenCastingToString = false; + + /** + * The number of links to display on each side of current page link. + * + * @var int + */ + public $onEachSide = 3; + + /** + * The paginator options. + * + * @var array + */ + protected $options; + + /** + * The current path resolver callback. + * + * @var \Closure + */ + protected static $currentPathResolver; + + /** + * The current page resolver callback. + * + * @var \Closure + */ + protected static $currentPageResolver; + + /** + * The query string resolver callback. + * + * @var \Closure + */ + protected static $queryStringResolver; + + /** + * The view factory resolver callback. + * + * @var \Closure + */ + protected static $viewFactoryResolver; + + /** + * The default pagination view. + * + * @var string + */ + public static $defaultView = 'pagination::tailwind'; + + /** + * The default "simple" pagination view. + * + * @var string + */ + public static $defaultSimpleView = 'pagination::simple-tailwind'; + + /** + * Determine if the given value is a valid page number. + * + * @param int $page + * @return bool + */ + protected function isValidPageNumber($page) + { + return $page >= 1 && filter_var($page, FILTER_VALIDATE_INT) !== false; + } + + /** + * Get the URL for the previous page. + * + * @return string|null + */ + public function previousPageUrl() + { + if ($this->currentPage() > 1) { + return $this->url($this->currentPage() - 1); + } + } + + /** + * Create a range of pagination URLs. + * + * @param int $start + * @param int $end + * @return array + */ + public function getUrlRange($start, $end) + { + return Collection::range($start, $end) + ->mapWithKeys(fn ($page) => [$page => $this->url($page)]) + ->all(); + } + + /** + * Get the URL for a given page number. + * + * @param int $page + * @return string + */ + public function url($page) + { + if ($page <= 0) { + $page = 1; + } + + // If we have any extra query string key / value pairs that need to be added + // onto the URL, we will put them in query string form and then attach it + // to the URL. This allows for extra information like sortings storage. + $parameters = [$this->pageName => $page]; + + if (count($this->query) > 0) { + $parameters = array_merge($this->query, $parameters); + } + + return $this->path() + .(str_contains($this->path(), '?') ? '&' : '?') + .Arr::query($parameters) + .$this->buildFragment(); + } + + /** + * Get / set the URL fragment to be appended to URLs. + * + * @param string|null $fragment + * @return $this|string|null + */ + public function fragment($fragment = null) + { + if (is_null($fragment)) { + return $this->fragment; + } + + $this->fragment = $fragment; + + return $this; + } + + /** + * Add a set of query string values to the paginator. + * + * @param array|string|null $key + * @param string|null $value + * @return $this + */ + public function appends($key, $value = null) + { + if (is_null($key)) { + return $this; + } + + if (is_array($key)) { + return $this->appendArray($key); + } + + return $this->addQuery($key, $value); + } + + /** + * Add an array of query string values. + * + * @param array $keys + * @return $this + */ + protected function appendArray(array $keys) + { + foreach ($keys as $key => $value) { + $this->addQuery($key, $value); + } + + return $this; + } + + /** + * Add all current query string values to the paginator. + * + * @return $this + */ + public function withQueryString() + { + if (isset(static::$queryStringResolver)) { + return $this->appends(call_user_func(static::$queryStringResolver)); + } + + return $this; + } + + /** + * Add a query string value to the paginator. + * + * @param string $key + * @param string $value + * @return $this + */ + protected function addQuery($key, $value) + { + if ($key !== $this->pageName) { + $this->query[$key] = $value; + } + + return $this; + } + + /** + * Build the full fragment portion of a URL. + * + * @return string + */ + protected function buildFragment() + { + return $this->fragment ? '#'.$this->fragment : ''; + } + + /** + * Load a set of relationships onto the mixed relationship collection. + * + * @param string $relation + * @param array $relations + * @return $this + */ + public function loadMorph($relation, $relations) + { + $this->getCollection()->loadMorph($relation, $relations); + + return $this; + } + + /** + * Load a set of relationship counts onto the mixed relationship collection. + * + * @param string $relation + * @param array $relations + * @return $this + */ + public function loadMorphCount($relation, $relations) + { + $this->getCollection()->loadMorphCount($relation, $relations); + + return $this; + } + + /** + * Get the slice of items being paginated. + * + * @return array + */ + public function items() + { + return $this->items->all(); + } + + /** + * Get the number of the first item in the slice. + * + * @return int|null + */ + public function firstItem() + { + return count($this->items) > 0 ? ($this->currentPage - 1) * $this->perPage + 1 : null; + } + + /** + * Get the number of the last item in the slice. + * + * @return int|null + */ + public function lastItem() + { + return count($this->items) > 0 ? $this->firstItem() + $this->count() - 1 : null; + } + + /** + * Transform each item in the slice of items using a callback. + * + * @template TMapValue + * + * @param callable(TValue, TKey): TMapValue $callback + * @return $this + * + * @phpstan-this-out static + */ + public function through(callable $callback) + { + $this->items->transform($callback); + + return $this; + } + + /** + * Get the number of items shown per page. + * + * @return int + */ + public function perPage() + { + return $this->perPage; + } + + /** + * Determine if there are enough items to split into multiple pages. + * + * @return bool + */ + public function hasPages() + { + return $this->currentPage() != 1 || $this->hasMorePages(); + } + + /** + * Determine if the paginator is on the first page. + * + * @return bool + */ + public function onFirstPage() + { + return $this->currentPage() <= 1; + } + + /** + * Determine if the paginator is on the last page. + * + * @return bool + */ + public function onLastPage() + { + return ! $this->hasMorePages(); + } + + /** + * Get the current page. + * + * @return int + */ + public function currentPage() + { + return $this->currentPage; + } + + /** + * Get the query string variable used to store the page. + * + * @return string + */ + public function getPageName() + { + return $this->pageName; + } + + /** + * Set the query string variable used to store the page. + * + * @param string $name + * @return $this + */ + public function setPageName($name) + { + $this->pageName = $name; + + return $this; + } + + /** + * Set the base path to assign to all URLs. + * + * @param string $path + * @return $this + */ + public function withPath($path) + { + return $this->setPath($path); + } + + /** + * Set the base path to assign to all URLs. + * + * @param string $path + * @return $this + */ + public function setPath($path) + { + $this->path = $path; + + return $this; + } + + /** + * Set the number of links to display on each side of current page link. + * + * @param int $count + * @return $this + */ + public function onEachSide($count) + { + $this->onEachSide = $count; + + return $this; + } + + /** + * Get the base path for paginator generated URLs. + * + * @return string|null + */ + public function path() + { + return $this->path; + } + + /** + * Resolve the current request path or return the default value. + * + * @param string $default + * @return string + */ + public static function resolveCurrentPath($default = '/') + { + if (isset(static::$currentPathResolver)) { + return call_user_func(static::$currentPathResolver); + } + + return $default; + } + + /** + * Set the current request path resolver callback. + * + * @param \Closure $resolver + * @return void + */ + public static function currentPathResolver(Closure $resolver) + { + static::$currentPathResolver = $resolver; + } + + /** + * Resolve the current page or return the default value. + * + * @param string $pageName + * @param int $default + * @return int + */ + public static function resolveCurrentPage($pageName = 'page', $default = 1) + { + if (isset(static::$currentPageResolver)) { + return (int) call_user_func(static::$currentPageResolver, $pageName); + } + + return $default; + } + + /** + * Set the current page resolver callback. + * + * @param \Closure $resolver + * @return void + */ + public static function currentPageResolver(Closure $resolver) + { + static::$currentPageResolver = $resolver; + } + + /** + * Resolve the query string or return the default value. + * + * @param string|array|null $default + * @return string + */ + public static function resolveQueryString($default = null) + { + if (isset(static::$queryStringResolver)) { + return (static::$queryStringResolver)(); + } + + return $default; + } + + /** + * Set with query string resolver callback. + * + * @param \Closure $resolver + * @return void + */ + public static function queryStringResolver(Closure $resolver) + { + static::$queryStringResolver = $resolver; + } + + /** + * Get an instance of the view factory from the resolver. + * + * @return \Illuminate\Contracts\View\Factory + */ + public static function viewFactory() + { + return call_user_func(static::$viewFactoryResolver); + } + + /** + * Set the view factory resolver callback. + * + * @param \Closure $resolver + * @return void + */ + public static function viewFactoryResolver(Closure $resolver) + { + static::$viewFactoryResolver = $resolver; + } + + /** + * Set the default pagination view. + * + * @param string $view + * @return void + */ + public static function defaultView($view) + { + static::$defaultView = $view; + } + + /** + * Set the default "simple" pagination view. + * + * @param string $view + * @return void + */ + public static function defaultSimpleView($view) + { + static::$defaultSimpleView = $view; + } + + /** + * Indicate that Tailwind styling should be used for generated links. + * + * @return void + */ + public static function useTailwind() + { + static::defaultView('pagination::tailwind'); + static::defaultSimpleView('pagination::simple-tailwind'); + } + + /** + * Indicate that Bootstrap 4 styling should be used for generated links. + * + * @return void + */ + public static function useBootstrap() + { + static::useBootstrapFour(); + } + + /** + * Indicate that Bootstrap 3 styling should be used for generated links. + * + * @return void + */ + public static function useBootstrapThree() + { + static::defaultView('pagination::default'); + static::defaultSimpleView('pagination::simple-default'); + } + + /** + * Indicate that Bootstrap 4 styling should be used for generated links. + * + * @return void + */ + public static function useBootstrapFour() + { + static::defaultView('pagination::bootstrap-4'); + static::defaultSimpleView('pagination::simple-bootstrap-4'); + } + + /** + * Indicate that Bootstrap 5 styling should be used for generated links. + * + * @return void + */ + public static function useBootstrapFive() + { + static::defaultView('pagination::bootstrap-5'); + static::defaultSimpleView('pagination::simple-bootstrap-5'); + } + + /** + * Get an iterator for the items. + * + * @return \ArrayIterator + */ + public function getIterator(): Traversable + { + return $this->items->getIterator(); + } + + /** + * Determine if the list of items is empty. + * + * @return bool + */ + public function isEmpty() + { + return $this->items->isEmpty(); + } + + /** + * Determine if the list of items is not empty. + * + * @return bool + */ + public function isNotEmpty() + { + return $this->items->isNotEmpty(); + } + + /** + * Get the number of items for the current page. + * + * @return int + */ + public function count(): int + { + return $this->items->count(); + } + + /** + * Get the paginator's underlying collection. + * + * @return \Illuminate\Support\Collection + */ + public function getCollection() + { + return $this->items; + } + + /** + * Set the paginator's underlying collection. + * + * @param \Illuminate\Support\Collection $collection + * @return $this + */ + public function setCollection(Collection $collection) + { + $this->items = $collection; + + return $this; + } + + /** + * Get the paginator options. + * + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * Determine if the given item exists. + * + * @param TKey $key + * @return bool + */ + public function offsetExists($key): bool + { + return $this->items->has($key); + } + + /** + * Get the item at the given offset. + * + * @param TKey $key + * @return TValue|null + */ + public function offsetGet($key): mixed + { + return $this->items->get($key); + } + + /** + * Set the item at the given offset. + * + * @param TKey|null $key + * @param TValue $value + * @return void + */ + public function offsetSet($key, $value): void + { + $this->items->put($key, $value); + } + + /** + * Unset the item at the given key. + * + * @param TKey $key + * @return void + */ + public function offsetUnset($key): void + { + $this->items->forget($key); + } + + /** + * Render the contents of the paginator to HTML. + * + * @return string + */ + public function toHtml() + { + return (string) $this->render(); + } + + /** + * Make dynamic calls into the collection. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->forwardCallTo($this->getCollection(), $method, $parameters); + } + + /** + * Render the contents of the paginator when casting to a string. + * + * @return string + */ + public function __toString() + { + return $this->escapeWhenCastingToString + ? e((string) $this->render()) + : (string) $this->render(); + } + + /** + * Indicate that the paginator's string representation should be escaped when __toString is invoked. + * + * @param bool $escape + * @return $this + */ + public function escapeWhenCastingToString($escape = true) + { + $this->escapeWhenCastingToString = $escape; + + return $this; + } +} diff --git a/plugins/vendor/illuminate/pagination/Cursor.php b/plugins/vendor/illuminate/pagination/Cursor.php new file mode 100644 index 00000000..433e33e0 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/Cursor.php @@ -0,0 +1,134 @@ + */ +class Cursor implements Arrayable +{ + /** + * The parameters associated with the cursor. + * + * @var array + */ + protected $parameters; + + /** + * Determine whether the cursor points to the next or previous set of items. + * + * @var bool + */ + protected $pointsToNextItems; + + /** + * Create a new cursor instance. + * + * @param array $parameters + * @param bool $pointsToNextItems + */ + public function __construct(array $parameters, $pointsToNextItems = true) + { + $this->parameters = $parameters; + $this->pointsToNextItems = $pointsToNextItems; + } + + /** + * Get the given parameter from the cursor. + * + * @param string $parameterName + * @return string|null + * + * @throws \UnexpectedValueException + */ + public function parameter(string $parameterName) + { + if (! array_key_exists($parameterName, $this->parameters)) { + throw new UnexpectedValueException("Unable to find parameter [{$parameterName}] in pagination item."); + } + + return $this->parameters[$parameterName]; + } + + /** + * Get the given parameters from the cursor. + * + * @param array $parameterNames + * @return array + */ + public function parameters(array $parameterNames) + { + return (new Collection($parameterNames)) + ->map(fn ($parameterName) => $this->parameter($parameterName)) + ->toArray(); + } + + /** + * Determine whether the cursor points to the next set of items. + * + * @return bool + */ + public function pointsToNextItems() + { + return $this->pointsToNextItems; + } + + /** + * Determine whether the cursor points to the previous set of items. + * + * @return bool + */ + public function pointsToPreviousItems() + { + return ! $this->pointsToNextItems; + } + + /** + * Get the array representation of the cursor. + * + * @return array + */ + public function toArray() + { + return array_merge($this->parameters, [ + '_pointsToNextItems' => $this->pointsToNextItems, + ]); + } + + /** + * Get the encoded string representation of the cursor to construct a URL. + * + * @return string + */ + public function encode() + { + return str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(json_encode($this->toArray()))); + } + + /** + * Get a cursor instance from the encoded string representation. + * + * @param string|null $encodedString + * @return static|null + */ + public static function fromEncoded($encodedString) + { + if (! is_string($encodedString)) { + return null; + } + + $parameters = json_decode(base64_decode(str_replace(['-', '_'], ['+', '/'], $encodedString)), true); + + if (json_last_error() !== JSON_ERROR_NONE) { + return null; + } + + $pointsToNextItems = $parameters['_pointsToNextItems']; + + unset($parameters['_pointsToNextItems']); + + return new static($parameters, $pointsToNextItems); + } +} diff --git a/plugins/vendor/illuminate/pagination/CursorPaginator.php b/plugins/vendor/illuminate/pagination/CursorPaginator.php new file mode 100644 index 00000000..314365ae --- /dev/null +++ b/plugins/vendor/illuminate/pagination/CursorPaginator.php @@ -0,0 +1,195 @@ + + * + * @implements Arrayable + * @implements ArrayAccess + * @implements IteratorAggregate + * @implements PaginatorContract + */ +class CursorPaginator extends AbstractCursorPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, JsonSerializable, PaginatorContract +{ + /** + * Indicates whether there are more items in the data source. + * + * @return bool + */ + protected $hasMore; + + /** + * Create a new paginator instance. + * + * @param Collection|Arrayable|iterable|null $items + * @param int $perPage + * @param \Illuminate\Pagination\Cursor|null $cursor + * @param array $options (path, query, fragment, pageName) + */ + public function __construct($items, $perPage, $cursor = null, array $options = []) + { + $this->options = $options; + + foreach ($options as $key => $value) { + $this->{$key} = $value; + } + + $this->perPage = (int) $perPage; + $this->cursor = $cursor; + $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; + + $this->setItems($items); + } + + /** + * Set the items for the paginator. + * + * @param Collection|Arrayable|iterable|null $items + * @return void + */ + protected function setItems($items) + { + $this->items = $items instanceof Collection ? $items : new Collection($items); + + $this->hasMore = $this->items->count() > $this->perPage; + + $this->items = $this->items->slice(0, $this->perPage); + + if (! is_null($this->cursor) && $this->cursor->pointsToPreviousItems()) { + $this->items = $this->items->reverse()->values(); + } + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return \Illuminate\Contracts\Support\Htmlable + */ + public function links($view = null, $data = []) + { + return $this->render($view, $data); + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return \Illuminate\Contracts\Support\Htmlable + */ + public function render($view = null, $data = []) + { + return static::viewFactory()->make($view ?: Paginator::$defaultSimpleView, array_merge($data, [ + 'paginator' => $this, + ])); + } + + /** + * Determine if there are more items in the data source. + * + * @return bool + */ + public function hasMorePages() + { + return (is_null($this->cursor) && $this->hasMore) || + (! is_null($this->cursor) && $this->cursor->pointsToNextItems() && $this->hasMore) || + (! is_null($this->cursor) && $this->cursor->pointsToPreviousItems()); + } + + /** + * Determine if there are enough items to split into multiple pages. + * + * @return bool + */ + public function hasPages() + { + return ! $this->onFirstPage() || $this->hasMorePages(); + } + + /** + * Determine if the paginator is on the first page. + * + * @return bool + */ + public function onFirstPage() + { + return is_null($this->cursor) || ($this->cursor->pointsToPreviousItems() && ! $this->hasMore); + } + + /** + * Determine if the paginator is on the last page. + * + * @return bool + */ + public function onLastPage() + { + return ! $this->hasMorePages(); + } + + /** + * Get the instance as an array. + * + * @return array + */ + public function toArray() + { + return [ + 'data' => $this->items->toArray(), + 'path' => $this->path(), + 'per_page' => $this->perPage(), + 'next_cursor' => $this->nextCursor()?->encode(), + 'next_page_url' => $this->nextPageUrl(), + 'prev_cursor' => $this->previousCursor()?->encode(), + 'prev_page_url' => $this->previousPageUrl(), + ]; + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Convert the object to its JSON representation. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Convert the object to pretty print formatted JSON. + * + * @params int $options + * + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } +} diff --git a/plugins/vendor/illuminate/pagination/LICENSE.md b/plugins/vendor/illuminate/pagination/LICENSE.md new file mode 100644 index 00000000..79810c84 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Taylor Otwell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/illuminate/pagination/LengthAwarePaginator.php b/plugins/vendor/illuminate/pagination/LengthAwarePaginator.php new file mode 100644 index 00000000..aafa1447 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/LengthAwarePaginator.php @@ -0,0 +1,257 @@ + + * + * @implements Arrayable + * @implements ArrayAccess + * @implements IteratorAggregate + * @implements LengthAwarePaginatorContract + */ +class LengthAwarePaginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, JsonSerializable, LengthAwarePaginatorContract +{ + /** + * The total number of items before slicing. + * + * @var int + */ + protected $total; + + /** + * The last available page. + * + * @var int + */ + protected $lastPage; + + /** + * Create a new paginator instance. + * + * @param Collection|Arrayable|iterable|null $items + * @param int $total + * @param int $perPage + * @param int|null $currentPage + * @param array $options (path, query, fragment, pageName) + */ + public function __construct($items, $total, $perPage, $currentPage = null, array $options = []) + { + $this->options = $options; + + foreach ($options as $key => $value) { + $this->{$key} = $value; + } + + $this->total = $total; + $this->perPage = (int) $perPage; + $this->lastPage = max((int) ceil($total / $perPage), 1); + $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; + $this->currentPage = $this->setCurrentPage($currentPage, $this->pageName); + $this->items = $items instanceof Collection ? $items : new Collection($items); + } + + /** + * Get the current page for the request. + * + * @param int $currentPage + * @param string $pageName + * @return int + */ + protected function setCurrentPage($currentPage, $pageName) + { + $currentPage = $currentPage ?: static::resolveCurrentPage($pageName); + + return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1; + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return \Illuminate\Contracts\Support\Htmlable + */ + public function links($view = null, $data = []) + { + return $this->render($view, $data); + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return \Illuminate\Contracts\Support\Htmlable + */ + public function render($view = null, $data = []) + { + return static::viewFactory()->make($view ?: static::$defaultView, array_merge($data, [ + 'paginator' => $this, + 'elements' => $this->elements(), + ])); + } + + /** + * Get the paginator links as a collection (for JSON responses). + * + * @return \Illuminate\Support\Collection + */ + public function linkCollection() + { + return (new Collection($this->elements()))->flatMap(function ($item) { + if (! is_array($item)) { + return [['url' => null, 'label' => '...', 'active' => false]]; + } + + return (new Collection($item))->map(function ($url, $page) { + return [ + 'url' => $url, + 'label' => (string) $page, + 'page' => $page, + 'active' => $this->currentPage() === $page, + ]; + }); + })->prepend([ + 'url' => $this->previousPageUrl(), + 'label' => function_exists('__') ? __('pagination.previous') : 'Previous', + 'page' => $this->currentPage() > 1 ? $this->currentPage() - 1 : null, + 'active' => false, + ])->push([ + 'url' => $this->nextPageUrl(), + 'label' => function_exists('__') ? __('pagination.next') : 'Next', + 'page' => $this->hasMorePages() ? $this->currentPage() + 1 : null, + 'active' => false, + ]); + } + + /** + * Get the array of elements to pass to the view. + * + * @return array + */ + protected function elements() + { + $window = UrlWindow::make($this); + + return array_filter([ + $window['first'], + is_array($window['slider']) ? '...' : null, + $window['slider'], + is_array($window['last']) ? '...' : null, + $window['last'], + ]); + } + + /** + * Get the total number of items being paginated. + * + * @return int + */ + public function total() + { + return $this->total; + } + + /** + * Determine if there are more items in the data source. + * + * @return bool + */ + public function hasMorePages() + { + return $this->currentPage() < $this->lastPage(); + } + + /** + * Get the URL for the next page. + * + * @return string|null + */ + public function nextPageUrl() + { + if ($this->hasMorePages()) { + return $this->url($this->currentPage() + 1); + } + } + + /** + * Get the last page. + * + * @return int + */ + public function lastPage() + { + return $this->lastPage; + } + + /** + * Get the instance as an array. + * + * @return array + */ + public function toArray() + { + return [ + 'current_page' => $this->currentPage(), + 'data' => $this->items->toArray(), + 'first_page_url' => $this->url(1), + 'from' => $this->firstItem(), + 'last_page' => $this->lastPage(), + 'last_page_url' => $this->url($this->lastPage()), + 'links' => $this->linkCollection()->toArray(), + 'next_page_url' => $this->nextPageUrl(), + 'path' => $this->path(), + 'per_page' => $this->perPage(), + 'prev_page_url' => $this->previousPageUrl(), + 'to' => $this->lastItem(), + 'total' => $this->total(), + ]; + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Convert the object to its JSON representation. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Convert the object to pretty print formatted JSON. + * + * @params int $options + * + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } +} diff --git a/plugins/vendor/illuminate/pagination/PaginationServiceProvider.php b/plugins/vendor/illuminate/pagination/PaginationServiceProvider.php new file mode 100755 index 00000000..e94cebd6 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/PaginationServiceProvider.php @@ -0,0 +1,34 @@ +loadViewsFrom(__DIR__.'/resources/views', 'pagination'); + + if ($this->app->runningInConsole()) { + $this->publishes([ + __DIR__.'/resources/views' => $this->app->resourcePath('views/vendor/pagination'), + ], 'laravel-pagination'); + } + } + + /** + * Register the service provider. + * + * @return void + */ + public function register() + { + PaginationState::resolveUsing($this->app); + } +} diff --git a/plugins/vendor/illuminate/pagination/PaginationState.php b/plugins/vendor/illuminate/pagination/PaginationState.php new file mode 100644 index 00000000..347c6e22 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/PaginationState.php @@ -0,0 +1,35 @@ + $app['view']); + + Paginator::currentPathResolver(fn () => $app['request']->url()); + + Paginator::currentPageResolver(function ($pageName = 'page') use ($app) { + $page = $app['request']->input($pageName); + + if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) { + return (int) $page; + } + + return 1; + }); + + Paginator::queryStringResolver(fn () => $app['request']->query()); + + CursorPaginator::currentCursorResolver(function ($cursorName = 'cursor') use ($app) { + return Cursor::fromEncoded($app['request']->input($cursorName)); + }); + } +} diff --git a/plugins/vendor/illuminate/pagination/Paginator.php b/plugins/vendor/illuminate/pagination/Paginator.php new file mode 100644 index 00000000..32e5ca57 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/Paginator.php @@ -0,0 +1,200 @@ + + * + * @implements Arrayable + * @implements ArrayAccess + * @implements IteratorAggregate + * @implements PaginatorContract + */ +class Paginator extends AbstractPaginator implements Arrayable, ArrayAccess, Countable, IteratorAggregate, Jsonable, JsonSerializable, PaginatorContract +{ + /** + * Determine if there are more items in the data source. + * + * @return bool + */ + protected $hasMore; + + /** + * Create a new paginator instance. + * + * @param Collection|Arrayable|iterable $items + * @param int $perPage + * @param int|null $currentPage + * @param array $options (path, query, fragment, pageName) + */ + public function __construct($items, $perPage, $currentPage = null, array $options = []) + { + $this->options = $options; + + foreach ($options as $key => $value) { + $this->{$key} = $value; + } + + $this->perPage = $perPage; + $this->currentPage = $this->setCurrentPage($currentPage); + $this->path = $this->path !== '/' ? rtrim($this->path, '/') : $this->path; + + $this->setItems($items); + } + + /** + * Get the current page for the request. + * + * @param int $currentPage + * @return int + */ + protected function setCurrentPage($currentPage) + { + $currentPage = $currentPage ?: static::resolveCurrentPage(); + + return $this->isValidPageNumber($currentPage) ? (int) $currentPage : 1; + } + + /** + * Set the items for the paginator. + * + * @param Collection|Arrayable|iterable|null $items + * @return void + */ + protected function setItems($items) + { + $this->items = $items instanceof Collection ? $items : new Collection($items); + + $this->hasMore = $this->items->count() > $this->perPage; + + $this->items = $this->items->slice(0, $this->perPage); + } + + /** + * Get the URL for the next page. + * + * @return string|null + */ + public function nextPageUrl() + { + if ($this->hasMorePages()) { + return $this->url($this->currentPage() + 1); + } + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return string + */ + public function links($view = null, $data = []) + { + return $this->render($view, $data); + } + + /** + * Render the paginator using the given view. + * + * @param string|null $view + * @param array $data + * @return \Illuminate\Contracts\Support\Htmlable + */ + public function render($view = null, $data = []) + { + return static::viewFactory()->make($view ?: static::$defaultSimpleView, array_merge($data, [ + 'paginator' => $this, + ])); + } + + /** + * Manually indicate that the paginator does have more pages. + * + * @param bool $hasMore + * @return $this + */ + public function hasMorePagesWhen($hasMore = true) + { + $this->hasMore = $hasMore; + + return $this; + } + + /** + * Determine if there are more items in the data source. + * + * @return bool + */ + public function hasMorePages() + { + return $this->hasMore; + } + + /** + * Get the instance as an array. + * + * @return array + */ + public function toArray() + { + return [ + 'current_page' => $this->currentPage(), + 'current_page_url' => $this->url($this->currentPage()), + 'data' => $this->items->toArray(), + 'first_page_url' => $this->url(1), + 'from' => $this->firstItem(), + 'next_page_url' => $this->nextPageUrl(), + 'path' => $this->path(), + 'per_page' => $this->perPage(), + 'prev_page_url' => $this->previousPageUrl(), + 'to' => $this->lastItem(), + ]; + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Convert the object to its JSON representation. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Convert the object to pretty print formatted JSON. + * + * @params int $options + * + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } +} diff --git a/plugins/vendor/illuminate/pagination/UrlWindow.php b/plugins/vendor/illuminate/pagination/UrlWindow.php new file mode 100644 index 00000000..863d4c59 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/UrlWindow.php @@ -0,0 +1,219 @@ +paginator = $paginator; + } + + /** + * Create a new URL window instance. + * + * @param \Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator + * @return array + */ + public static function make(PaginatorContract $paginator) + { + return (new static($paginator))->get(); + } + + /** + * Get the window of URLs to be shown. + * + * @return array + */ + public function get() + { + $onEachSide = $this->paginator->onEachSide; + + if ($this->paginator->lastPage() < ($onEachSide * 2) + 8) { + return $this->getSmallSlider(); + } + + return $this->getUrlSlider($onEachSide); + } + + /** + * Get the slider of URLs there are not enough pages to slide. + * + * @return array + */ + protected function getSmallSlider() + { + return [ + 'first' => $this->paginator->getUrlRange(1, $this->lastPage()), + 'slider' => null, + 'last' => null, + ]; + } + + /** + * Create a URL slider links. + * + * @param int $onEachSide + * @return array + */ + protected function getUrlSlider($onEachSide) + { + $window = $onEachSide + 4; + + if (! $this->hasPages()) { + return ['first' => null, 'slider' => null, 'last' => null]; + } + + // If the current page is very close to the beginning of the page range, we will + // just render the beginning of the page range, followed by the last 2 of the + // links in this list, since we will not have room to create a full slider. + if ($this->currentPage() <= $window) { + return $this->getSliderTooCloseToBeginning($window, $onEachSide); + } + + // If the current page is close to the ending of the page range we will just get + // this first couple pages, followed by a larger window of these ending pages + // since we're too close to the end of the list to create a full on slider. + elseif ($this->currentPage() > ($this->lastPage() - $window)) { + return $this->getSliderTooCloseToEnding($window, $onEachSide); + } + + // If we have enough room on both sides of the current page to build a slider we + // will surround it with both the beginning and ending caps, with this window + // of pages in the middle providing a Google style sliding paginator setup. + return $this->getFullSlider($onEachSide); + } + + /** + * Get the slider of URLs when too close to the beginning of the window. + * + * @param int $window + * @param int $onEachSide + * @return array + */ + protected function getSliderTooCloseToBeginning($window, $onEachSide) + { + return [ + 'first' => $this->paginator->getUrlRange(1, $window + $onEachSide), + 'slider' => null, + 'last' => $this->getFinish(), + ]; + } + + /** + * Get the slider of URLs when too close to the ending of the window. + * + * @param int $window + * @param int $onEachSide + * @return array + */ + protected function getSliderTooCloseToEnding($window, $onEachSide) + { + $last = $this->paginator->getUrlRange( + $this->lastPage() - ($window + ($onEachSide - 1)), + $this->lastPage() + ); + + return [ + 'first' => $this->getStart(), + 'slider' => null, + 'last' => $last, + ]; + } + + /** + * Get the slider of URLs when a full slider can be made. + * + * @param int $onEachSide + * @return array + */ + protected function getFullSlider($onEachSide) + { + return [ + 'first' => $this->getStart(), + 'slider' => $this->getAdjacentUrlRange($onEachSide), + 'last' => $this->getFinish(), + ]; + } + + /** + * Get the page range for the current page window. + * + * @param int $onEachSide + * @return array + */ + public function getAdjacentUrlRange($onEachSide) + { + return $this->paginator->getUrlRange( + $this->currentPage() - $onEachSide, + $this->currentPage() + $onEachSide + ); + } + + /** + * Get the starting URLs of a pagination slider. + * + * @return array + */ + public function getStart() + { + return $this->paginator->getUrlRange(1, 2); + } + + /** + * Get the ending URLs of a pagination slider. + * + * @return array + */ + public function getFinish() + { + return $this->paginator->getUrlRange( + $this->lastPage() - 1, + $this->lastPage() + ); + } + + /** + * Determine if the underlying paginator being presented has pages to show. + * + * @return bool + */ + public function hasPages() + { + return $this->paginator->lastPage() > 1; + } + + /** + * Get the current page from the paginator. + * + * @return int + */ + protected function currentPage() + { + return $this->paginator->currentPage(); + } + + /** + * Get the last page from the paginator. + * + * @return int + */ + protected function lastPage() + { + return $this->paginator->lastPage(); + } +} diff --git a/plugins/vendor/illuminate/pagination/composer.json b/plugins/vendor/illuminate/pagination/composer.json new file mode 100755 index 00000000..b848b4a3 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/composer.json @@ -0,0 +1,37 @@ +{ + "name": "illuminate/pagination", + "description": "The Illuminate Pagination package.", + "license": "MIT", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "require": { + "php": "^8.2", + "ext-filter": "*", + "illuminate/collections": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/support": "^12.0" + }, + "autoload": { + "psr-4": { + "Illuminate\\Pagination\\": "" + } + }, + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/illuminate/pagination/resources/views/bootstrap-4.blade.php b/plugins/vendor/illuminate/pagination/resources/views/bootstrap-4.blade.php new file mode 100644 index 00000000..63c6f56b --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/bootstrap-4.blade.php @@ -0,0 +1,46 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php b/plugins/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php new file mode 100644 index 00000000..a1795a4d --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/bootstrap-5.blade.php @@ -0,0 +1,88 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/default.blade.php b/plugins/vendor/illuminate/pagination/resources/views/default.blade.php new file mode 100644 index 00000000..0db70b56 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/default.blade.php @@ -0,0 +1,46 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php b/plugins/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php new file mode 100644 index 00000000..ef0dbb18 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/semantic-ui.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-4.blade.php b/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-4.blade.php new file mode 100644 index 00000000..4bb49174 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-4.blade.php @@ -0,0 +1,27 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php b/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php new file mode 100644 index 00000000..7006add8 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/simple-bootstrap-5.blade.php @@ -0,0 +1,29 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/simple-default.blade.php b/plugins/vendor/illuminate/pagination/resources/views/simple-default.blade.php new file mode 100644 index 00000000..36bdbc18 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/simple-default.blade.php @@ -0,0 +1,19 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/simple-tailwind.blade.php b/plugins/vendor/illuminate/pagination/resources/views/simple-tailwind.blade.php new file mode 100644 index 00000000..34ab49d1 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/simple-tailwind.blade.php @@ -0,0 +1,25 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/pagination/resources/views/tailwind.blade.php b/plugins/vendor/illuminate/pagination/resources/views/tailwind.blade.php new file mode 100644 index 00000000..aee2ad28 --- /dev/null +++ b/plugins/vendor/illuminate/pagination/resources/views/tailwind.blade.php @@ -0,0 +1,106 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/plugins/vendor/illuminate/support/AggregateServiceProvider.php b/plugins/vendor/illuminate/support/AggregateServiceProvider.php new file mode 100644 index 00000000..d7425c5c --- /dev/null +++ b/plugins/vendor/illuminate/support/AggregateServiceProvider.php @@ -0,0 +1,52 @@ +instances = []; + + foreach ($this->providers as $provider) { + $this->instances[] = $this->app->register($provider); + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + $provides = []; + + foreach ($this->providers as $provider) { + $instance = $this->app->resolveProvider($provider); + + $provides = array_merge($provides, $instance->provides()); + } + + return $provides; + } +} diff --git a/plugins/vendor/illuminate/support/Benchmark.php b/plugins/vendor/illuminate/support/Benchmark.php new file mode 100644 index 00000000..1bb000fe --- /dev/null +++ b/plugins/vendor/illuminate/support/Benchmark.php @@ -0,0 +1,69 @@ +map(function ($callback) use ($iterations) { + return Collection::range(1, $iterations)->map(function () use ($callback) { + gc_collect_cycles(); + + $start = hrtime(true); + + $callback(); + + return (hrtime(true) - $start) / 1_000_000; + })->average(); + })->when( + $benchmarkables instanceof Closure, + fn ($c) => $c->first(), + fn ($c) => $c->all(), + ); + } + + /** + * Measure a callable once and return the result and duration in milliseconds. + * + * @template TReturn of mixed + * + * @param (callable(): TReturn) $callback + * @return array{0: TReturn, 1: float} + */ + public static function value(callable $callback): array + { + gc_collect_cycles(); + + $start = hrtime(true); + + $result = $callback(); + + return [$result, (hrtime(true) - $start) / 1_000_000]; + } + + /** + * Measure a callable or array of callables over the given number of iterations, then dump and die. + * + * @param \Closure|array $benchmarkables + * @param int $iterations + * @return never + */ + public static function dd(Closure|array $benchmarkables, int $iterations = 1): never + { + $result = (new Collection(static::measure(Arr::wrap($benchmarkables), $iterations))) + ->map(fn ($average) => number_format($average, 3).'ms') + ->when($benchmarkables instanceof Closure, fn ($c) => $c->first(), fn ($c) => $c->all()); + + dd($result); + } +} diff --git a/plugins/vendor/illuminate/support/Carbon.php b/plugins/vendor/illuminate/support/Carbon.php new file mode 100644 index 00000000..bd56ad83 --- /dev/null +++ b/plugins/vendor/illuminate/support/Carbon.php @@ -0,0 +1,36 @@ +getDateTime()); + } +} diff --git a/plugins/vendor/illuminate/support/Composer.php b/plugins/vendor/illuminate/support/Composer.php new file mode 100644 index 00000000..4f9ddaa6 --- /dev/null +++ b/plugins/vendor/illuminate/support/Composer.php @@ -0,0 +1,254 @@ +files = $files; + $this->workingPath = $workingPath; + } + + /** + * Determine if the given Composer package is installed. + * + * @param string $package + * @return bool + * + * @throws \RuntimeException + */ + public function hasPackage($package) + { + $composer = json_decode(file_get_contents($this->findComposerFile()), true); + + return array_key_exists($package, $composer['require'] ?? []) + || array_key_exists($package, $composer['require-dev'] ?? []); + } + + /** + * Install the given Composer packages into the application. + * + * @param array $packages + * @param bool $dev + * @param \Closure|\Symfony\Component\Console\Output\OutputInterface|null $output + * @param string|null $composerBinary + * @return bool + */ + public function requirePackages(array $packages, bool $dev = false, Closure|OutputInterface|null $output = null, $composerBinary = null) + { + $command = (new Collection([ + ...$this->findComposer($composerBinary), + 'require', + ...$packages, + ])) + ->when($dev, function ($command) { + $command->push('--dev'); + })->all(); + + return 0 === $this->getProcess($command, ['COMPOSER_MEMORY_LIMIT' => '-1']) + ->run( + $output instanceof OutputInterface + ? function ($type, $line) use ($output) { + $output->write(' '.$line); + } : $output + ); + } + + /** + * Remove the given Composer packages from the application. + * + * @param array $packages + * @param bool $dev + * @param \Closure|\Symfony\Component\Console\Output\OutputInterface|null $output + * @param string|null $composerBinary + * @return bool + */ + public function removePackages(array $packages, bool $dev = false, Closure|OutputInterface|null $output = null, $composerBinary = null) + { + $command = (new Collection([ + ...$this->findComposer($composerBinary), + 'remove', + ...$packages, + ])) + ->when($dev, function ($command) { + $command->push('--dev'); + })->all(); + + return 0 === $this->getProcess($command, ['COMPOSER_MEMORY_LIMIT' => '-1']) + ->run( + $output instanceof OutputInterface + ? function ($type, $line) use ($output) { + $output->write(' '.$line); + } : $output + ); + } + + /** + * Modify the "composer.json" file contents using the given callback. + * + * @param callable(array):array $callback + * @return void + * + * @throws \RuntimeException + */ + public function modify(callable $callback) + { + $composerFile = $this->findComposerFile(); + + $composer = json_decode(file_get_contents($composerFile), true, 512, JSON_THROW_ON_ERROR); + + file_put_contents( + $composerFile, + json_encode( + call_user_func($callback, $composer), + JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE + ) + ); + } + + /** + * Regenerate the Composer autoloader files. + * + * @param string|array $extra + * @param string|null $composerBinary + * @return int + */ + public function dumpAutoloads($extra = '', $composerBinary = null) + { + $extra = $extra ? (array) $extra : []; + + $command = array_merge($this->findComposer($composerBinary), ['dump-autoload'], $extra); + + return $this->getProcess($command)->run(); + } + + /** + * Regenerate the optimized Composer autoloader files. + * + * @param string|null $composerBinary + * @return int + */ + public function dumpOptimized($composerBinary = null) + { + return $this->dumpAutoloads('--optimize', $composerBinary); + } + + /** + * Get the Composer binary / command for the environment. + * + * @param string|null $composerBinary + * @return array + */ + public function findComposer($composerBinary = null) + { + if (! is_null($composerBinary) && $this->files->exists($composerBinary)) { + return [$this->phpBinary(), $composerBinary]; + } elseif ($this->files->exists($this->workingPath.'/composer.phar')) { + return [$this->phpBinary(), 'composer.phar']; + } + + return ['composer']; + } + + /** + * Get the path to the "composer.json" file. + * + * @return string + * + * @throws \RuntimeException + */ + protected function findComposerFile() + { + $composerFile = "{$this->workingPath}/composer.json"; + + if (! file_exists($composerFile)) { + throw new RuntimeException("Unable to locate `composer.json` file at [{$this->workingPath}]."); + } + + return $composerFile; + } + + /** + * Get the PHP binary. + * + * @return string + */ + protected function phpBinary() + { + return php_binary(); + } + + /** + * Get a new Symfony process instance. + * + * @param array $command + * @param array $env + * @return \Symfony\Component\Process\Process + */ + protected function getProcess(array $command, array $env = []) + { + return (new Process($command, $this->workingPath, $env))->setTimeout(null); + } + + /** + * Set the working path used by the class. + * + * @param string $path + * @return $this + */ + public function setWorkingPath($path) + { + $this->workingPath = realpath($path); + + return $this; + } + + /** + * Get the version of Composer. + * + * @return string|null + */ + public function getVersion() + { + $command = array_merge($this->findComposer(), ['-V', '--no-ansi']); + + $process = $this->getProcess($command); + + $process->run(); + + $output = $process->getOutput(); + + if (preg_match('/(\d+(\.\d+){2})/', $output, $version)) { + return $version[1]; + } + + return explode(' ', $output)[2] ?? null; + } +} diff --git a/plugins/vendor/illuminate/support/ConfigurationUrlParser.php b/plugins/vendor/illuminate/support/ConfigurationUrlParser.php new file mode 100644 index 00000000..b841b65e --- /dev/null +++ b/plugins/vendor/illuminate/support/ConfigurationUrlParser.php @@ -0,0 +1,191 @@ + 'sqlsrv', + 'mysql2' => 'mysql', // RDS + 'postgres' => 'pgsql', + 'postgresql' => 'pgsql', + 'sqlite3' => 'sqlite', + 'redis' => 'tcp', + 'rediss' => 'tls', + ]; + + /** + * Parse the database configuration, hydrating options using a database configuration URL if possible. + * + * @param array|string $config + * @return array + */ + public function parseConfiguration($config) + { + if (is_string($config)) { + $config = ['url' => $config]; + } + + $url = Arr::pull($config, 'url'); + + if (! $url) { + return $config; + } + + $rawComponents = $this->parseUrl($url); + + $decodedComponents = $this->parseStringsToNativeTypes( + array_map(rawurldecode(...), $rawComponents) + ); + + return array_merge( + $config, + $this->getPrimaryOptions($decodedComponents), + $this->getQueryOptions($rawComponents) + ); + } + + /** + * Get the primary database connection options. + * + * @param array $url + * @return array + */ + protected function getPrimaryOptions($url) + { + return array_filter([ + 'driver' => $this->getDriver($url), + 'database' => $this->getDatabase($url), + 'host' => $url['host'] ?? null, + 'port' => $url['port'] ?? null, + 'username' => $url['user'] ?? null, + 'password' => $url['pass'] ?? null, + ], fn ($value) => ! is_null($value)); + } + + /** + * Get the database driver from the URL. + * + * @param array $url + * @return string|null + */ + protected function getDriver($url) + { + $alias = $url['scheme'] ?? null; + + if (! $alias) { + return; + } + + return static::$driverAliases[$alias] ?? $alias; + } + + /** + * Get the database name from the URL. + * + * @param array $url + * @return string|null + */ + protected function getDatabase($url) + { + $path = $url['path'] ?? null; + + return $path && $path !== '/' ? substr($path, 1) : null; + } + + /** + * Get all of the additional database options from the query string. + * + * @param array $url + * @return array + */ + protected function getQueryOptions($url) + { + $queryString = $url['query'] ?? null; + + if (! $queryString) { + return []; + } + + $query = []; + + parse_str($queryString, $query); + + return $this->parseStringsToNativeTypes($query); + } + + /** + * Parse the string URL to an array of components. + * + * @param string $url + * @return array + * + * @throws \InvalidArgumentException + */ + protected function parseUrl($url) + { + $url = preg_replace('#^(sqlite3?):///#', '$1://null/', $url); + + $parsedUrl = parse_url($url); + + if ($parsedUrl === false) { + throw new InvalidArgumentException('The database configuration URL is malformed.'); + } + + return $parsedUrl; + } + + /** + * Convert string casted values to their native types. + * + * @param mixed $value + * @return mixed + */ + protected function parseStringsToNativeTypes($value) + { + if (is_array($value)) { + return array_map($this->parseStringsToNativeTypes(...), $value); + } + + if (! is_string($value)) { + return $value; + } + + $parsedValue = json_decode($value, true); + + if (json_last_error() === JSON_ERROR_NONE) { + return $parsedValue; + } + + return $value; + } + + /** + * Get all of the current drivers' aliases. + * + * @return array + */ + public static function getDriverAliases() + { + return static::$driverAliases; + } + + /** + * Add the given driver alias to the driver aliases array. + * + * @param string $alias + * @param string $driver + * @return void + */ + public static function addDriverAlias($alias, $driver) + { + static::$driverAliases[$alias] = $driver; + } +} diff --git a/plugins/vendor/illuminate/support/DateFactory.php b/plugins/vendor/illuminate/support/DateFactory.php new file mode 100644 index 00000000..5a2feb59 --- /dev/null +++ b/plugins/vendor/illuminate/support/DateFactory.php @@ -0,0 +1,250 @@ +$method(...$parameters); + } + + $dateClass = static::$dateClass ?: $defaultClassName; + + // Check if the date can be created using the public class method... + if (method_exists($dateClass, $method) || + method_exists($dateClass, 'hasMacro') && $dateClass::hasMacro($method)) { + return $dateClass::$method(...$parameters); + } + + // If that fails, create the date with the default class... + $date = $defaultClassName::$method(...$parameters); + + // If the configured class has an "instance" method, we'll try to pass our date into there... + if (method_exists($dateClass, 'instance')) { + return $dateClass::instance($date); + } + + // Otherwise, assume the configured class has a DateTime compatible constructor... + return new $dateClass($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); + } +} diff --git a/plugins/vendor/illuminate/support/DefaultProviders.php b/plugins/vendor/illuminate/support/DefaultProviders.php new file mode 100644 index 00000000..6430e843 --- /dev/null +++ b/plugins/vendor/illuminate/support/DefaultProviders.php @@ -0,0 +1,101 @@ +providers = $providers ?: [ + \Illuminate\Auth\AuthServiceProvider::class, + \Illuminate\Broadcasting\BroadcastServiceProvider::class, + \Illuminate\Bus\BusServiceProvider::class, + \Illuminate\Cache\CacheServiceProvider::class, + \Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class, + \Illuminate\Concurrency\ConcurrencyServiceProvider::class, + \Illuminate\Cookie\CookieServiceProvider::class, + \Illuminate\Database\DatabaseServiceProvider::class, + \Illuminate\Encryption\EncryptionServiceProvider::class, + \Illuminate\Filesystem\FilesystemServiceProvider::class, + \Illuminate\Foundation\Providers\FoundationServiceProvider::class, + \Illuminate\Hashing\HashServiceProvider::class, + \Illuminate\Mail\MailServiceProvider::class, + \Illuminate\Notifications\NotificationServiceProvider::class, + \Illuminate\Pagination\PaginationServiceProvider::class, + \Illuminate\Auth\Passwords\PasswordResetServiceProvider::class, + \Illuminate\Pipeline\PipelineServiceProvider::class, + \Illuminate\Queue\QueueServiceProvider::class, + \Illuminate\Redis\RedisServiceProvider::class, + \Illuminate\Session\SessionServiceProvider::class, + \Illuminate\Translation\TranslationServiceProvider::class, + \Illuminate\Validation\ValidationServiceProvider::class, + \Illuminate\View\ViewServiceProvider::class, + ]; + } + + /** + * Merge the given providers into the provider collection. + * + * @param array $providers + * @return static + */ + public function merge(array $providers) + { + $this->providers = array_merge($this->providers, $providers); + + return new static($this->providers); + } + + /** + * Replace the given providers with other providers. + * + * @param array $replacements + * @return static + */ + public function replace(array $replacements) + { + $current = new Collection($this->providers); + + foreach ($replacements as $from => $to) { + $key = $current->search($from); + + $current = is_int($key) ? $current->replace([$key => $to]) : $current; + } + + return new static($current->values()->toArray()); + } + + /** + * Disable the given providers. + * + * @param array $providers + * @return static + */ + public function except(array $providers) + { + return new static((new Collection($this->providers)) + ->reject(fn ($p) => in_array($p, $providers)) + ->values() + ->toArray()); + } + + /** + * Convert the provider collection to an array. + * + * @return array + */ + public function toArray() + { + return $this->providers; + } +} diff --git a/plugins/vendor/illuminate/support/Defer/DeferredCallback.php b/plugins/vendor/illuminate/support/Defer/DeferredCallback.php new file mode 100644 index 00000000..6840b495 --- /dev/null +++ b/plugins/vendor/illuminate/support/Defer/DeferredCallback.php @@ -0,0 +1,54 @@ +name = $name ?? (string) Str::uuid(); + } + + /** + * Specify the name of the deferred callback so it can be cancelled later. + * + * @param string $name + * @return $this + */ + public function name(string $name): static + { + $this->name = $name; + + return $this; + } + + /** + * Indicate that the deferred callback should run even on unsuccessful requests and jobs. + * + * @param bool $always + * @return $this + */ + public function always(bool $always = true): static + { + $this->always = $always; + + return $this; + } + + /** + * Invoke the deferred callback. + * + * @return void + */ + public function __invoke(): void + { + call_user_func($this->callback); + } +} diff --git a/plugins/vendor/illuminate/support/Defer/DeferredCallbackCollection.php b/plugins/vendor/illuminate/support/Defer/DeferredCallbackCollection.php new file mode 100644 index 00000000..93116ef9 --- /dev/null +++ b/plugins/vendor/illuminate/support/Defer/DeferredCallbackCollection.php @@ -0,0 +1,157 @@ +callbacks)[0]; + } + + /** + * Invoke the deferred callbacks. + * + * @return void + */ + public function invoke(): void + { + $this->invokeWhen(fn () => true); + } + + /** + * Invoke the deferred callbacks if the given truth test evaluates to true. + * + * @param \Closure|null $when + * @return void + */ + public function invokeWhen(?Closure $when = null): void + { + $when ??= fn () => true; + + $this->forgetDuplicates(); + + foreach ($this->callbacks as $index => $callback) { + if ($when($callback)) { + rescue($callback); + } + + unset($this->callbacks[$index]); + } + } + + /** + * Remove any deferred callbacks with the given name. + * + * @param string $name + * @return void + */ + public function forget(string $name): void + { + $this->callbacks = (new Collection($this->callbacks)) + ->reject(fn ($callback) => $callback->name === $name) + ->values() + ->all(); + } + + /** + * Remove any duplicate callbacks. + * + * @return $this + */ + protected function forgetDuplicates(): static + { + $this->callbacks = (new Collection($this->callbacks)) + ->reverse() + ->unique(fn ($c) => $c->name) + ->reverse() + ->values() + ->all(); + + return $this; + } + + /** + * Determine if the collection has a callback with the given key. + * + * @param mixed $offset + * @return bool + */ + public function offsetExists(mixed $offset): bool + { + $this->forgetDuplicates(); + + return isset($this->callbacks[$offset]); + } + + /** + * Get the callback with the given key. + * + * @param mixed $offset + * @return mixed + */ + public function offsetGet(mixed $offset): mixed + { + $this->forgetDuplicates(); + + return $this->callbacks[$offset]; + } + + /** + * Set the callback with the given key. + * + * @param mixed $offset + * @param mixed $value + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->callbacks[] = $value; + } else { + $this->callbacks[$offset] = $value; + } + } + + /** + * Remove the callback with the given key from the collection. + * + * @param mixed $offset + * @return void + */ + public function offsetUnset(mixed $offset): void + { + $this->forgetDuplicates(); + + unset($this->callbacks[$offset]); + } + + /** + * Determine how many callbacks are in the collection. + * + * @return int + */ + public function count(): int + { + $this->forgetDuplicates(); + + return count($this->callbacks); + } +} diff --git a/plugins/vendor/illuminate/support/EncodedHtmlString.php b/plugins/vendor/illuminate/support/EncodedHtmlString.php new file mode 100644 index 00000000..36b29cc3 --- /dev/null +++ b/plugins/vendor/illuminate/support/EncodedHtmlString.php @@ -0,0 +1,100 @@ +html; + + if ($value instanceof DeferringDisplayableValue) { + $value = $value->resolveDisplayableValue(); + } + + if ($value instanceof Htmlable) { + return $value->toHtml(); + } + + if ($value instanceof BackedEnum) { + $value = $value->value; + } + + return (static::$encodeUsingFactory ?? function ($value, $doubleEncode) { + return static::convert($value, doubleEncode: $doubleEncode); + })($value, $this->doubleEncode); + } + + /** + * Set the callable that will be used to encode the HTML strings. + * + * @param callable|null $factory + * @return void + */ + public static function encodeUsing(?callable $factory = null) + { + static::$encodeUsingFactory = $factory; + } + + /** + * Flush the class's global state. + * + * @return void + */ + public static function flushState() + { + static::$encodeUsingFactory = null; + } +} diff --git a/plugins/vendor/illuminate/support/Env.php b/plugins/vendor/illuminate/support/Env.php new file mode 100644 index 00000000..01747846 --- /dev/null +++ b/plugins/vendor/illuminate/support/Env.php @@ -0,0 +1,310 @@ + + */ + protected static $customAdapters = []; + + /** + * Enable the putenv adapter. + * + * @return void + */ + public static function enablePutenv() + { + static::$putenv = true; + static::$repository = null; + } + + /** + * Disable the putenv adapter. + * + * @return void + */ + public static function disablePutenv() + { + static::$putenv = false; + static::$repository = null; + } + + /** + * Register a custom adapter creator Closure. + */ + public static function extend(Closure $callback, ?string $name = null): void + { + if (! is_null($name)) { + static::$customAdapters[$name] = $callback; + } else { + static::$customAdapters[] = $callback; + } + + static::$repository = null; + } + + /** + * Get the environment repository instance. + * + * @return \Dotenv\Repository\RepositoryInterface + */ + public static function getRepository() + { + if (static::$repository === null) { + $builder = RepositoryBuilder::createWithDefaultAdapters(); + + if (static::$putenv) { + $builder = $builder->addAdapter(PutenvAdapter::class); + } + + foreach (static::$customAdapters as $adapter) { + $builder = $builder->addAdapter($adapter()); + } + + static::$repository = $builder->immutable()->make(); + } + + return static::$repository; + } + + /** + * Get the value of an environment variable. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public static function get($key, $default = null) + { + return self::getOption($key)->getOrCall(fn () => value($default)); + } + + /** + * Get the value of a required environment variable. + * + * @param string $key + * @return mixed + * + * @throws \RuntimeException + */ + public static function getOrFail($key) + { + return self::getOption($key)->getOrThrow(new RuntimeException("Environment variable [$key] has no value.")); + } + + /** + * Write an array of key-value pairs to the environment file. + * + * @param array $variables + * @param string $pathToFile + * @param bool $overwrite + * @return void + * + * @throws RuntimeException + * @throws FileNotFoundException + */ + public static function writeVariables(array $variables, string $pathToFile, bool $overwrite = false): void + { + $filesystem = new Filesystem; + + if ($filesystem->missing($pathToFile)) { + throw new RuntimeException("The file [{$pathToFile}] does not exist."); + } + + $lines = explode(PHP_EOL, $filesystem->get($pathToFile)); + + foreach ($variables as $key => $value) { + $lines = self::addVariableToEnvContents($key, $value, $lines, $overwrite); + } + + $filesystem->put($pathToFile, implode(PHP_EOL, $lines)); + } + + /** + * Write a single key-value pair to the environment file. + * + * @param string $key + * @param mixed $value + * @param string $pathToFile + * @param bool $overwrite + * @return void + * + * @throws RuntimeException + * @throws FileNotFoundException + */ + public static function writeVariable(string $key, mixed $value, string $pathToFile, bool $overwrite = false): void + { + $filesystem = new Filesystem; + + if ($filesystem->missing($pathToFile)) { + throw new RuntimeException("The file [{$pathToFile}] does not exist."); + } + + $envContent = $filesystem->get($pathToFile); + + $lines = explode(PHP_EOL, $envContent); + $lines = self::addVariableToEnvContents($key, $value, $lines, $overwrite); + + $filesystem->put($pathToFile, implode(PHP_EOL, $lines)); + } + + /** + * Add a variable to the environment file contents. + * + * @param string $key + * @param mixed $value + * @param array $envLines + * @param bool $overwrite + * @return array + */ + protected static function addVariableToEnvContents(string $key, mixed $value, array $envLines, bool $overwrite): array + { + $prefix = explode('_', $key)[0].'_'; + $lastPrefixIndex = -1; + + $shouldQuote = preg_match('/^[a-zA-z0-9]+$/', $value) === 0; + + $lineToAddVariations = [ + $key.'='.(is_string($value) ? self::prepareQuotedValue($value) : $value), + $key.'='.$value, + ]; + + $lineToAdd = $shouldQuote ? $lineToAddVariations[0] : $lineToAddVariations[1]; + + if ($value === '') { + $lineToAdd = $key.'='; + } + + foreach ($envLines as $index => $line) { + if (str_starts_with($line, $prefix)) { + $lastPrefixIndex = $index; + } + + if (in_array($line, $lineToAddVariations)) { + // This exact line already exists, so we don't need to add it again. + return $envLines; + } + + if ($line === $key.'=') { + // If the value is empty, we can replace it with the new value. + $envLines[$index] = $lineToAdd; + + return $envLines; + } + + if (str_starts_with($line, $key.'=')) { + if (! $overwrite) { + return $envLines; + } + + $envLines[$index] = $lineToAdd; + + return $envLines; + } + } + + if ($lastPrefixIndex === -1) { + if (count($envLines) && $envLines[count($envLines) - 1] !== '') { + $envLines[] = ''; + } + + return array_merge($envLines, [$lineToAdd]); + } + + return array_merge( + array_slice($envLines, 0, $lastPrefixIndex + 1), + [$lineToAdd], + array_slice($envLines, $lastPrefixIndex + 1) + ); + } + + /** + * Get the possible option for this environment variable. + * + * @param string $key + * @return \PhpOption\Option|\PhpOption\Some + */ + protected static function getOption($key) + { + return Option::fromValue(static::getRepository()->get($key)) + ->map(function ($value) { + switch (strtolower($value)) { + case 'true': + case '(true)': + return true; + case 'false': + case '(false)': + return false; + case 'empty': + case '(empty)': + return ''; + case 'null': + case '(null)': + return; + } + + if (preg_match('/\A([\'"])(.*)\1\z/', $value, $matches)) { + return $matches[2]; + } + + return $value; + }); + } + + /** + * Wrap a string in quotes, choosing double or single quotes. + * + * @param string $input + * @return string + */ + protected static function prepareQuotedValue(string $input) + { + return strpos($input, '"') !== false + ? "'".self::addSlashesExceptFor($input, ['"'])."'" + : '"'.self::addSlashesExceptFor($input, ["'"]).'"'; + } + + /** + * Escape a string using addslashes, excluding the specified characters from being escaped. + * + * @param string $value + * @param array $except + * @return string + */ + protected static function addSlashesExceptFor(string $value, array $except = []) + { + $escaped = addslashes($value); + + foreach ($except as $character) { + $escaped = str_replace('\\'.$character, $character, $escaped); + } + + return $escaped; + } +} diff --git a/plugins/vendor/illuminate/support/Exceptions/MathException.php b/plugins/vendor/illuminate/support/Exceptions/MathException.php new file mode 100644 index 00000000..6f9158df --- /dev/null +++ b/plugins/vendor/illuminate/support/Exceptions/MathException.php @@ -0,0 +1,10 @@ +providerIsLoaded(UiServiceProvider::class)) { + throw new RuntimeException('In order to use the Auth::routes() method, please install the laravel/ui package.'); + } + + static::$app->make('router')->auth($options); + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Blade.php b/plugins/vendor/illuminate/support/Facades/Blade.php new file mode 100755 index 00000000..8ca0ca8c --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Blade.php @@ -0,0 +1,63 @@ +dispatcher + : static::getFacadeRoot(); + + return tap(new BusFake($actualDispatcher, $jobsToFake, $batchRepository), function ($fake) { + static::swap($fake); + }); + } + + /** + * Dispatch the given chain of jobs. + * + * @param mixed $jobs + * @return \Illuminate\Foundation\Bus\PendingDispatch + */ + public static function dispatchChain($jobs) + { + $jobs = is_array($jobs) ? $jobs : func_get_args(); + + return (new PendingChain(array_shift($jobs), $jobs)) + ->dispatch(); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return BusDispatcherContract::class; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Cache.php b/plugins/vendor/illuminate/support/Facades/Cache.php new file mode 100755 index 00000000..3a1e832b --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Cache.php @@ -0,0 +1,74 @@ +cookie($key, null)); + } + + /** + * Retrieve a cookie from the request. + * + * @param string|null $key + * @param mixed $default + * @return string|array|null + */ + public static function get($key = null, $default = null) + { + return static::$app['request']->cookie($key, $default); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'cookie'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Crypt.php b/plugins/vendor/illuminate/support/Facades/Crypt.php new file mode 100755 index 00000000..6d197161 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Crypt.php @@ -0,0 +1,30 @@ +dispatcher + : static::getFacadeRoot(); + + return tap(new EventFake($actualDispatcher, $eventsToFake), function ($fake) { + static::swap($fake); + + Model::setEventDispatcher($fake); + Cache::refreshEventDispatcher(); + }); + } + + /** + * Replace the bound instance with a fake that fakes all events except the given events. + * + * @param string[]|string $eventsToAllow + * @return \Illuminate\Support\Testing\Fakes\EventFake + */ + public static function fakeExcept($eventsToAllow) + { + return static::fake([ + function ($eventName) use ($eventsToAllow) { + return ! in_array($eventName, (array) $eventsToAllow); + }, + ]); + } + + /** + * Replace the bound instance with a fake during the given callable's execution. + * + * @param callable $callable + * @param array $eventsToFake + * @return mixed + */ + public static function fakeFor(callable $callable, array $eventsToFake = []) + { + $originalDispatcher = static::getFacadeRoot(); + + static::fake($eventsToFake); + + try { + return $callable(); + } finally { + static::swap($originalDispatcher); + + Model::setEventDispatcher($originalDispatcher); + Cache::refreshEventDispatcher(); + } + } + + /** + * Replace the bound instance with a fake during the given callable's execution. + * + * @param callable $callable + * @param array $eventsToAllow + * @return mixed + */ + public static function fakeExceptFor(callable $callable, array $eventsToAllow = []) + { + $originalDispatcher = static::getFacadeRoot(); + + static::fakeExcept($eventsToAllow); + + try { + return $callable(); + } finally { + static::swap($originalDispatcher); + + Model::setEventDispatcher($originalDispatcher); + Cache::refreshEventDispatcher(); + } + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'events'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Exceptions.php b/plugins/vendor/illuminate/support/Facades/Exceptions.php new file mode 100644 index 00000000..263b95bd --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Exceptions.php @@ -0,0 +1,70 @@ +>|class-string<\Throwable> $exceptions + * @return \Illuminate\Support\Testing\Fakes\ExceptionHandlerFake + */ + public static function fake(array|string $exceptions = []) + { + $exceptionHandler = static::isFake() + ? static::getFacadeRoot()->handler() + : static::getFacadeRoot(); + + return tap(new ExceptionHandlerFake($exceptionHandler, Arr::wrap($exceptions)), function ($fake) { + static::swap($fake); + }); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return ExceptionHandler::class; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Facade.php b/plugins/vendor/illuminate/support/Facades/Facade.php new file mode 100755 index 00000000..f5ce6aab --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Facade.php @@ -0,0 +1,365 @@ +resolved($accessor) === true) { + $callback(static::getFacadeRoot(), static::$app); + } + + static::$app->afterResolving($accessor, function ($service, $app) use ($callback) { + $callback($service, $app); + }); + } + + /** + * Convert the facade into a Mockery spy. + * + * @return \Mockery\MockInterface + */ + public static function spy() + { + if (! static::isMock()) { + $class = static::getMockableClass(); + + return tap($class ? Mockery::spy($class) : Mockery::spy(), function ($spy) { + static::swap($spy); + }); + } + } + + /** + * Initiate a partial mock on the facade. + * + * @return \Mockery\MockInterface + */ + public static function partialMock() + { + $name = static::getFacadeAccessor(); + + $mock = static::isMock() + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); + + return $mock->makePartial(); + } + + /** + * Initiate a mock expectation on the facade. + * + * @return \Mockery\Expectation + */ + public static function shouldReceive() + { + $name = static::getFacadeAccessor(); + + $mock = static::isMock() + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); + + return $mock->shouldReceive(...func_get_args()); + } + + /** + * Initiate a mock expectation on the facade. + * + * @return \Mockery\Expectation + */ + public static function expects() + { + $name = static::getFacadeAccessor(); + + $mock = static::isMock() + ? static::$resolvedInstance[$name] + : static::createFreshMockInstance(); + + return $mock->expects(...func_get_args()); + } + + /** + * Create a fresh mock instance for the given class. + * + * @return \Mockery\MockInterface + */ + protected static function createFreshMockInstance() + { + return tap(static::createMock(), function ($mock) { + static::swap($mock); + + $mock->shouldAllowMockingProtectedMethods(); + }); + } + + /** + * Create a fresh mock instance for the given class. + * + * @return \Mockery\MockInterface + */ + protected static function createMock() + { + $class = static::getMockableClass(); + + return $class ? Mockery::mock($class) : Mockery::mock(); + } + + /** + * Determines whether a mock is set as the instance of the facade. + * + * @return bool + */ + protected static function isMock() + { + $name = static::getFacadeAccessor(); + + return isset(static::$resolvedInstance[$name]) && + static::$resolvedInstance[$name] instanceof LegacyMockInterface; + } + + /** + * Get the mockable class for the bound instance. + * + * @return string|null + */ + protected static function getMockableClass() + { + if ($root = static::getFacadeRoot()) { + return get_class($root); + } + } + + /** + * Hotswap the underlying instance behind the facade. + * + * @param mixed $instance + * @return void + */ + public static function swap($instance) + { + static::$resolvedInstance[static::getFacadeAccessor()] = $instance; + + if (isset(static::$app)) { + static::$app->instance(static::getFacadeAccessor(), $instance); + } + } + + /** + * Determines whether a "fake" has been set as the facade instance. + * + * @return bool + */ + public static function isFake() + { + $name = static::getFacadeAccessor(); + + return isset(static::$resolvedInstance[$name]) && + static::$resolvedInstance[$name] instanceof Fake; + } + + /** + * Get the root object behind the facade. + * + * @return mixed + */ + public static function getFacadeRoot() + { + return static::resolveFacadeInstance(static::getFacadeAccessor()); + } + + /** + * Get the registered name of the component. + * + * @return string + * + * @throws \RuntimeException + */ + protected static function getFacadeAccessor() + { + throw new RuntimeException('Facade does not implement getFacadeAccessor method.'); + } + + /** + * Resolve the facade root instance from the container. + * + * @param string $name + * @return mixed + */ + protected static function resolveFacadeInstance($name) + { + if (isset(static::$resolvedInstance[$name])) { + return static::$resolvedInstance[$name]; + } + + if (static::$app) { + if (static::$cached) { + return static::$resolvedInstance[$name] = static::$app[$name]; + } + + return static::$app[$name]; + } + } + + /** + * Clear a resolved facade instance. + * + * @param string $name + * @return void + */ + public static function clearResolvedInstance($name) + { + unset(static::$resolvedInstance[$name]); + } + + /** + * Clear all of the resolved instances. + * + * @return void + */ + public static function clearResolvedInstances() + { + static::$resolvedInstance = []; + } + + /** + * Get the application default aliases. + * + * @return \Illuminate\Support\Collection + */ + public static function defaultAliases() + { + return new Collection([ + 'App' => App::class, + 'Arr' => Arr::class, + 'Artisan' => Artisan::class, + 'Auth' => Auth::class, + 'Benchmark' => Benchmark::class, + 'Blade' => Blade::class, + 'Broadcast' => Broadcast::class, + 'Bus' => Bus::class, + 'Cache' => Cache::class, + 'Concurrency' => Concurrency::class, + 'Config' => Config::class, + 'Context' => Context::class, + 'Cookie' => Cookie::class, + 'Crypt' => Crypt::class, + 'Date' => Date::class, + 'DB' => DB::class, + 'Eloquent' => Model::class, + 'Event' => Event::class, + 'File' => File::class, + 'Gate' => Gate::class, + 'Hash' => Hash::class, + 'Http' => Http::class, + 'Js' => Js::class, + 'Lang' => Lang::class, + 'Log' => Log::class, + 'Mail' => Mail::class, + 'Notification' => Notification::class, + 'Number' => Number::class, + 'Password' => Password::class, + 'Process' => Process::class, + 'Queue' => Queue::class, + 'RateLimiter' => RateLimiter::class, + 'Redirect' => Redirect::class, + 'Request' => Request::class, + 'Response' => Response::class, + 'Route' => Route::class, + 'Schedule' => Schedule::class, + 'Schema' => Schema::class, + 'Session' => Session::class, + 'Storage' => Storage::class, + 'Str' => Str::class, + 'Uri' => Uri::class, + 'URL' => URL::class, + 'Validator' => Validator::class, + 'View' => View::class, + 'Vite' => Vite::class, + ]); + } + + /** + * Get the application instance behind the facade. + * + * @return \Illuminate\Contracts\Foundation\Application|null + */ + public static function getFacadeApplication() + { + return static::$app; + } + + /** + * Set the application instance. + * + * @param \Illuminate\Contracts\Foundation\Application|null $app + * @return void + */ + public static function setFacadeApplication($app) + { + static::$app = $app; + } + + /** + * Handle dynamic, static calls to the object. + * + * @param string $method + * @param array $args + * @return mixed + * + * @throws \RuntimeException + */ + public static function __callStatic($method, $args) + { + $instance = static::getFacadeRoot(); + + if (! $instance) { + throw new RuntimeException('A facade root has not been set.'); + } + + return $instance->$method(...$args); + } +} diff --git a/plugins/vendor/illuminate/support/Facades/File.php b/plugins/vendor/illuminate/support/Facades/File.php new file mode 100755 index 00000000..b28cc6c7 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/File.php @@ -0,0 +1,72 @@ +fake($callback)); + }); + } + + /** + * Register a response sequence for the given URL pattern. + * + * @param string $urlPattern + * @return \Illuminate\Http\Client\ResponseSequence + */ + public static function fakeSequence(string $urlPattern = '*') + { + $fake = tap(static::getFacadeRoot(), function ($fake) { + static::swap($fake); + }); + + return $fake->fakeSequence($urlPattern); + } + + /** + * Indicate that an exception should be thrown if any request is not faked. + * + * @param bool $prevent + * @return \Illuminate\Http\Client\Factory + */ + public static function preventStrayRequests($prevent = true) + { + return tap(static::getFacadeRoot(), function ($fake) use ($prevent) { + static::swap($fake->preventStrayRequests($prevent)); + }); + } + + /** + * Stub the given URL using the given callback. + * + * @param string $url + * @param \Illuminate\Http\Client\Response|\GuzzleHttp\Promise\PromiseInterface|callable $callback + * @return \Illuminate\Http\Client\Factory + */ + public static function stubUrl($url, $callback) + { + return tap(static::getFacadeRoot(), function ($fake) use ($url, $callback) { + static::swap($fake->stubUrl($url, $callback)); + }); + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Lang.php b/plugins/vendor/illuminate/support/Facades/Lang.php new file mode 100755 index 00000000..7dc08da5 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Lang.php @@ -0,0 +1,48 @@ +manager + : static::getFacadeRoot(); + + return tap(new MailFake($actualMailManager), function ($fake) { + static::swap($fake); + }); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'mail.manager'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/MaintenanceMode.php b/plugins/vendor/illuminate/support/Facades/MaintenanceMode.php new file mode 100644 index 00000000..51d57adb --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/MaintenanceMode.php @@ -0,0 +1,18 @@ + $route) { + $notifiable->route($channel, $route); + } + + return $notifiable; + } + + /** + * Begin sending a notification to an anonymous notifiable. + * + * @param string $channel + * @param mixed $route + * @return \Illuminate\Notifications\AnonymousNotifiable + */ + public static function route($channel, $route) + { + return (new AnonymousNotifiable)->route($channel, $route); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return ChannelManager::class; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/ParallelTesting.php b/plugins/vendor/illuminate/support/Facades/ParallelTesting.php new file mode 100644 index 00000000..d91558c1 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/ParallelTesting.php @@ -0,0 +1,34 @@ +fake($callback)); + }); + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Queue.php b/plugins/vendor/illuminate/support/Facades/Queue.php new file mode 100755 index 00000000..a22eca21 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Queue.php @@ -0,0 +1,159 @@ +queue + : static::getFacadeRoot(); + + return tap(new QueueFake(static::getFacadeApplication(), $jobsToFake, $actualQueueManager), function ($fake) { + static::swap($fake); + }); + } + + /** + * Replace the bound instance with a fake that fakes all jobs except the given jobs. + * + * @param string[]|string $jobsToAllow + * @return \Illuminate\Support\Testing\Fakes\QueueFake + */ + public static function fakeExcept($jobsToAllow) + { + return static::fake()->except($jobsToAllow); + } + + /** + * Replace the bound instance with a fake during the given callable's execution. + * + * @param callable $callable + * @param array $jobsToFake + * @return mixed + */ + public static function fakeFor(callable $callable, array $jobsToFake = []) + { + $originalQueueManager = static::getFacadeRoot(); + + static::fake($jobsToFake); + + try { + return $callable(); + } finally { + static::swap($originalQueueManager); + } + } + + /** + * Replace the bound instance with a fake during the given callable's execution. + * + * @param callable $callable + * @param array $jobsToAllow + * @return mixed + */ + public static function fakeExceptFor(callable $callable, array $jobsToAllow = []) + { + $originalQueueManager = static::getFacadeRoot(); + + static::fakeExcept($jobsToAllow); + + try { + return $callable(); + } finally { + static::swap($originalQueueManager); + } + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'queue'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/RateLimiter.php b/plugins/vendor/illuminate/support/Facades/RateLimiter.php new file mode 100644 index 00000000..e04a4d16 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/RateLimiter.php @@ -0,0 +1,34 @@ +') + * @method static \Symfony\Component\HttpFoundation\StreamedResponse stream(callable|null $callback, int $status = 200, array $headers = []) + * @method static \Symfony\Component\HttpFoundation\StreamedJsonResponse streamJson(array $data, int $status = 200, array $headers = [], int $encodingOptions = 15) + * @method static \Symfony\Component\HttpFoundation\StreamedResponse streamDownload(callable $callback, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') + * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse download(\SplFileInfo|string $file, string|null $name = null, array $headers = [], string|null $disposition = 'attachment') + * @method static \Symfony\Component\HttpFoundation\BinaryFileResponse file(\SplFileInfo|string $file, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse redirectTo(string $path, int $status = 302, array $headers = [], bool|null $secure = null) + * @method static \Illuminate\Http\RedirectResponse redirectToRoute(\BackedEnum|string $route, mixed $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse redirectToAction(array|string $action, mixed $parameters = [], int $status = 302, array $headers = []) + * @method static \Illuminate\Http\RedirectResponse redirectGuest(string $path, int $status = 302, array $headers = [], bool|null $secure = null) + * @method static \Illuminate\Http\RedirectResponse redirectToIntended(string $default = '/', int $status = 302, array $headers = [], bool|null $secure = null) + * @method static void macro(string $name, object|callable $macro) + * @method static void mixin(object $mixin, bool $replace = true) + * @method static bool hasMacro(string $name) + * @method static void flushMacros() + * + * @see \Illuminate\Routing\ResponseFactory + */ +class Response extends Facade +{ + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return ResponseFactoryContract::class; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Route.php b/plugins/vendor/illuminate/support/Facades/Route.php new file mode 100755 index 00000000..7b0e1c0c --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Route.php @@ -0,0 +1,119 @@ +connection($name)->getSchemaBuilder(); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'db.schema'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/Session.php b/plugins/vendor/illuminate/support/Facades/Session.php new file mode 100755 index 00000000..0a124624 --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/Session.php @@ -0,0 +1,87 @@ +get('filesystems.default')); + + if ($token = ParallelTesting::token()) { + $root = "{$root}_test_{$token}"; + } + + (new Filesystem)->cleanDirectory($root); + + static::set($disk, $fake = static::createLocalDriver( + self::buildDiskConfiguration($disk, $config, root: $root) + )); + + return tap($fake)->buildTemporaryUrlsUsing(function ($path, $expiration) { + return URL::to($path.'?expiration='.$expiration->getTimestamp()); + }); + } + + /** + * Replace the given disk with a persistent local testing disk. + * + * @param string|null $disk + * @param array $config + * @return \Illuminate\Contracts\Filesystem\Filesystem + */ + public static function persistentFake($disk = null, array $config = []) + { + $disk = $disk ?: static::$app['config']->get('filesystems.default'); + + static::set($disk, $fake = static::createLocalDriver( + self::buildDiskConfiguration($disk, $config, root: self::getRootPath($disk)) + )); + + return $fake; + } + + /** + * Get the root path of the given disk. + * + * @param string $disk + * @return string + */ + protected static function getRootPath(string $disk): string + { + return storage_path('framework/testing/disks/'.$disk); + } + + /** + * Assemble the configuration of the given disk. + * + * @param string $disk + * @param array $config + * @param string $root + * @return array + */ + protected static function buildDiskConfiguration(string $disk, array $config, string $root): array + { + $originalConfig = static::$app['config']["filesystems.disks.{$disk}"] ?? []; + + return array_merge([ + 'throw' => $originalConfig['throw'] ?? false], + $config, + ['root' => $root] + ); + } + + /** + * Get the registered name of the component. + * + * @return string + */ + protected static function getFacadeAccessor() + { + return 'filesystem'; + } +} diff --git a/plugins/vendor/illuminate/support/Facades/URL.php b/plugins/vendor/illuminate/support/Facades/URL.php new file mode 100755 index 00000000..acd1107c --- /dev/null +++ b/plugins/vendor/illuminate/support/Facades/URL.php @@ -0,0 +1,66 @@ + + * @implements \ArrayAccess + */ +class Fluent implements Arrayable, ArrayAccess, IteratorAggregate, Jsonable, JsonSerializable +{ + use Conditionable, InteractsWithData, Macroable { + __call as macroCall; + } + + /** + * All of the attributes set on the fluent instance. + * + * @var array + */ + protected $attributes = []; + + /** + * Create a new fluent instance. + * + * @param iterable $attributes + */ + public function __construct($attributes = []) + { + $this->fill($attributes); + } + + /** + * Create a new fluent instance. + * + * @param iterable $attributes + * @return static + */ + public static function make($attributes = []) + { + return new static($attributes); + } + + /** + * Get an attribute from the fluent instance using "dot" notation. + * + * @template TGetDefault + * + * @param TKey $key + * @param TGetDefault|(\Closure(): TGetDefault) $default + * @return TValue|TGetDefault + */ + public function get($key, $default = null) + { + return data_get($this->attributes, $key, $default); + } + + /** + * Set an attribute on the fluent instance using "dot" notation. + * + * @param TKey $key + * @param TValue $value + * @return $this + */ + public function set($key, $value) + { + data_set($this->attributes, $key, $value); + + return $this; + } + + /** + * Fill the fluent instance with an array of attributes. + * + * @param iterable $attributes + * @return $this + */ + public function fill($attributes) + { + foreach ($attributes as $key => $value) { + $this->attributes[$key] = $value; + } + + return $this; + } + + /** + * Get an attribute from the fluent instance. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + public function value($key, $default = null) + { + if (array_key_exists($key, $this->attributes)) { + return $this->attributes[$key]; + } + + return value($default); + } + + /** + * Get the value of the given key as a new Fluent instance. + * + * @param string $key + * @param mixed $default + * @return static + */ + public function scope($key, $default = null) + { + return new static( + (array) $this->get($key, $default) + ); + } + + /** + * Get all of the attributes from the fluent instance. + * + * @param mixed $keys + * @return array + */ + public function all($keys = null) + { + $data = $this->data(); + + if (! $keys) { + return $data; + } + + $results = []; + + foreach (is_array($keys) ? $keys : func_get_args() as $key) { + Arr::set($results, $key, Arr::get($data, $key)); + } + + return $results; + } + + /** + * Get data from the fluent instance. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + protected function data($key = null, $default = null) + { + return $this->get($key, $default); + } + + /** + * Get the attributes from the fluent instance. + * + * @return array + */ + public function getAttributes() + { + return $this->attributes; + } + + /** + * Convert the fluent instance to an array. + * + * @return array + */ + public function toArray() + { + return $this->attributes; + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Convert the fluent instance to JSON. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Convert the fluent instance to pretty print formatted JSON. + * + * @params int $options + * + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } + + /** + * Determine if the fluent instance is empty. + * + * @return bool + */ + public function isEmpty(): bool + { + return empty($this->attributes); + } + + /** + * Determine if the fluent instance is not empty. + * + * @return bool + */ + public function isNotEmpty(): bool + { + return ! $this->isEmpty(); + } + + /** + * Determine if the given offset exists. + * + * @param TKey $offset + * @return bool + */ + public function offsetExists($offset): bool + { + return isset($this->attributes[$offset]); + } + + /** + * Get the value for a given offset. + * + * @param TKey $offset + * @return TValue|null + */ + public function offsetGet($offset): mixed + { + return $this->value($offset); + } + + /** + * Set the value at the given offset. + * + * @param TKey $offset + * @param TValue $value + * @return void + */ + public function offsetSet($offset, $value): void + { + $this->attributes[$offset] = $value; + } + + /** + * Unset the value at the given offset. + * + * @param TKey $offset + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->attributes[$offset]); + } + + /** + * Get an iterator for the attributes. + * + * @return ArrayIterator + */ + public function getIterator(): Traversable + { + return new ArrayIterator($this->attributes); + } + + /** + * Handle dynamic calls to the fluent instance to set attributes. + * + * @param TKey $method + * @param array{0: ?TValue} $parameters + * @return $this + */ + public function __call($method, $parameters) + { + if (static::hasMacro($method)) { + return $this->macroCall($method, $parameters); + } + + $this->attributes[$method] = count($parameters) > 0 ? array_first($parameters) : true; + + return $this; + } + + /** + * Dynamically retrieve the value of an attribute. + * + * @param TKey $key + * @return TValue|null + */ + public function __get($key) + { + return $this->value($key); + } + + /** + * Dynamically set the value of an attribute. + * + * @param TKey $key + * @param TValue $value + * @return void + */ + public function __set($key, $value) + { + $this->offsetSet($key, $value); + } + + /** + * Dynamically check if an attribute is set. + * + * @param TKey $key + * @return bool + */ + public function __isset($key) + { + return $this->offsetExists($key); + } + + /** + * Dynamically unset an attribute. + * + * @param TKey $key + * @return void + */ + public function __unset($key) + { + $this->offsetUnset($key); + } +} diff --git a/plugins/vendor/illuminate/support/HigherOrderTapProxy.php b/plugins/vendor/illuminate/support/HigherOrderTapProxy.php new file mode 100644 index 00000000..85201f08 --- /dev/null +++ b/plugins/vendor/illuminate/support/HigherOrderTapProxy.php @@ -0,0 +1,37 @@ +target = $target; + } + + /** + * Dynamically pass method calls to the target. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + $this->target->{$method}(...$parameters); + + return $this->target; + } +} diff --git a/plugins/vendor/illuminate/support/HtmlString.php b/plugins/vendor/illuminate/support/HtmlString.php new file mode 100644 index 00000000..6b8d98cc --- /dev/null +++ b/plugins/vendor/illuminate/support/HtmlString.php @@ -0,0 +1,66 @@ +html = $html; + } + + /** + * Get the HTML string. + * + * @return string + */ + public function toHtml() + { + return $this->html; + } + + /** + * Determine if the given HTML string is empty. + * + * @return bool + */ + public function isEmpty() + { + return ($this->html ?? '') === ''; + } + + /** + * Determine if the given HTML string is not empty. + * + * @return bool + */ + public function isNotEmpty() + { + return ! $this->isEmpty(); + } + + /** + * Get the HTML string. + * + * @return string + */ + public function __toString() + { + return $this->toHtml() ?? ''; + } +} diff --git a/plugins/vendor/illuminate/support/InteractsWithTime.php b/plugins/vendor/illuminate/support/InteractsWithTime.php new file mode 100644 index 00000000..6b78be16 --- /dev/null +++ b/plugins/vendor/illuminate/support/InteractsWithTime.php @@ -0,0 +1,83 @@ +parseDateInterval($delay); + + return $delay instanceof DateTimeInterface + ? max(0, $delay->getTimestamp() - $this->currentTime()) + : (int) $delay; + } + + /** + * Get the "available at" UNIX timestamp. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @return int + */ + protected function availableAt($delay = 0) + { + $delay = $this->parseDateInterval($delay); + + return $delay instanceof DateTimeInterface + ? $delay->getTimestamp() + : Carbon::now()->addSeconds($delay)->getTimestamp(); + } + + /** + * If the given value is an interval, convert it to a DateTime instance. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @return \DateTimeInterface|int + */ + protected function parseDateInterval($delay) + { + if ($delay instanceof DateInterval) { + $delay = Carbon::now()->add($delay); + } + + return $delay; + } + + /** + * Get the current system time as a UNIX timestamp. + * + * @return int + */ + protected function currentTime() + { + return Carbon::now()->getTimestamp(); + } + + /** + * Given a start time, format the total run time for human readability. + * + * @param float $startTime + * @param float $endTime + * @return string + */ + protected function runTimeForHumans($startTime, $endTime = null) + { + $endTime ??= microtime(true); + + $runTime = ($endTime - $startTime) * 1000; + + return $runTime > 1000 + ? CarbonInterval::milliseconds($runTime)->cascade()->forHumans(short: true) + : number_format($runTime, 2).'ms'; + } +} diff --git a/plugins/vendor/illuminate/support/Js.php b/plugins/vendor/illuminate/support/Js.php new file mode 100644 index 00000000..ff9d663b --- /dev/null +++ b/plugins/vendor/illuminate/support/Js.php @@ -0,0 +1,157 @@ +js = $this->convertDataToJavaScriptExpression($data, $flags, $depth); + } + + /** + * Create a new JavaScript string from the given data. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return static + * + * @throws \JsonException + */ + public static function from($data, $flags = 0, $depth = 512) + { + return new static($data, $flags, $depth); + } + + /** + * Convert the given data to a JavaScript expression. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return string + * + * @throws \JsonException + */ + protected function convertDataToJavaScriptExpression($data, $flags = 0, $depth = 512) + { + if ($data instanceof self) { + return $data->toHtml(); + } + + if ($data instanceof Htmlable && + ! $data instanceof Arrayable && + ! $data instanceof Jsonable && + ! $data instanceof JsonSerializable) { + $data = $data->toHtml(); + } + + if ($data instanceof UnitEnum) { + $data = enum_value($data); + } + + $json = static::encode($data, $flags, $depth); + + if (is_string($data)) { + return "'".substr($json, 1, -1)."'"; + } + + return $this->convertJsonToJavaScriptExpression($json, $flags); + } + + /** + * Encode the given data as JSON. + * + * @param mixed $data + * @param int $flags + * @param int $depth + * @return string + * + * @throws \JsonException + */ + public static function encode($data, $flags = 0, $depth = 512) + { + if ($data instanceof Jsonable) { + return $data->toJson($flags | static::REQUIRED_FLAGS); + } + + if ($data instanceof Arrayable && ! ($data instanceof JsonSerializable)) { + $data = $data->toArray(); + } + + return json_encode($data, $flags | static::REQUIRED_FLAGS, $depth); + } + + /** + * Convert the given JSON to a JavaScript expression. + * + * @param string $json + * @param int $flags + * @return string + * + * @throws \JsonException + */ + protected function convertJsonToJavaScriptExpression($json, $flags = 0) + { + if ($json === '[]' || $json === '{}') { + return $json; + } + + if (Str::startsWith($json, ['"', '{', '['])) { + return "JSON.parse('".substr(json_encode($json, $flags | static::REQUIRED_FLAGS), 1, -1)."')"; + } + + return $json; + } + + /** + * Get the string representation of the data for use in HTML. + * + * @return string + */ + public function toHtml() + { + return $this->js; + } + + /** + * Get the string representation of the data for use in HTML. + * + * @return string + */ + public function __toString() + { + return $this->toHtml(); + } +} diff --git a/plugins/vendor/illuminate/support/LICENSE.md b/plugins/vendor/illuminate/support/LICENSE.md new file mode 100644 index 00000000..79810c84 --- /dev/null +++ b/plugins/vendor/illuminate/support/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Taylor Otwell + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/illuminate/support/Lottery.php b/plugins/vendor/illuminate/support/Lottery.php new file mode 100644 index 00000000..183cf957 --- /dev/null +++ b/plugins/vendor/illuminate/support/Lottery.php @@ -0,0 +1,284 @@ +|null $outOf + */ + public function __construct($chances, $outOf = null) + { + if ($outOf === null && is_float($chances) && $chances > 1) { + throw new RuntimeException('Float must not be greater than 1.'); + } + + if ($outOf !== null && $outOf < 1) { + throw new RuntimeException('Lottery "out of" value must be greater than or equal to 1.'); + } + + $this->chances = $chances; + + $this->outOf = $outOf; + } + + /** + * Create a new Lottery instance. + * + * @param int|float $chances + * @param int|null $outOf + * @return static + */ + public static function odds($chances, $outOf = null) + { + return new static($chances, $outOf); + } + + /** + * Set the winner callback. + * + * @param callable $callback + * @return $this + */ + public function winner($callback) + { + $this->winner = $callback; + + return $this; + } + + /** + * Set the loser callback. + * + * @param callable $callback + * @return $this + */ + public function loser($callback) + { + $this->loser = $callback; + + return $this; + } + + /** + * Run the lottery. + * + * @param mixed ...$args + * @return mixed + */ + public function __invoke(...$args) + { + return $this->runCallback(...$args); + } + + /** + * Run the lottery. + * + * @param null|int $times + * @return mixed + */ + public function choose($times = null) + { + if ($times === null) { + return $this->runCallback(); + } + + $results = []; + + for ($i = 0; $i < $times; $i++) { + $results[] = $this->runCallback(); + } + + return $results; + } + + /** + * Run the winner or loser callback, randomly. + * + * @param mixed ...$args + * @return callable + */ + protected function runCallback(...$args) + { + return $this->wins() + ? ($this->winner ?? fn () => true)(...$args) + : ($this->loser ?? fn () => false)(...$args); + } + + /** + * Determine if the lottery "wins" or "loses". + * + * @return bool + */ + protected function wins() + { + return static::resultFactory()($this->chances, $this->outOf); + } + + /** + * The factory that determines the lottery result. + * + * @return callable + */ + protected static function resultFactory() + { + return static::$resultFactory ?? fn ($chances, $outOf) => $outOf === null + ? random_int(0, PHP_INT_MAX) / PHP_INT_MAX <= $chances + : random_int(1, $outOf) <= $chances; + } + + /** + * Force the lottery to always result in a win. + * + * @param callable|null $callback + * @return void + */ + public static function alwaysWin($callback = null) + { + self::setResultFactory(fn () => true); + + if ($callback === null) { + return; + } + + $callback(); + + static::determineResultNormally(); + } + + /** + * Force the lottery to always result in a lose. + * + * @param callable|null $callback + * @return void + */ + public static function alwaysLose($callback = null) + { + self::setResultFactory(fn () => false); + + if ($callback === null) { + return; + } + + $callback(); + + static::determineResultNormally(); + } + + /** + * Set the sequence that will be used to determine lottery results. + * + * @param array $sequence + * @param callable|null $whenMissing + * @return void + */ + public static function fix($sequence, $whenMissing = null) + { + static::forceResultWithSequence($sequence, $whenMissing); + } + + /** + * Set the sequence that will be used to determine lottery results. + * + * @param array $sequence + * @param callable|null $whenMissing + * @return void + */ + public static function forceResultWithSequence($sequence, $whenMissing = null) + { + $next = 0; + + $whenMissing ??= function ($chances, $outOf) use (&$next) { + $factoryCache = static::$resultFactory; + + static::$resultFactory = null; + + $result = static::resultFactory()($chances, $outOf); + + static::$resultFactory = $factoryCache; + + $next++; + + return $result; + }; + + static::setResultFactory(function ($chances, $outOf) use (&$next, $sequence, $whenMissing) { + if (array_key_exists($next, $sequence)) { + return $sequence[$next++]; + } + + return $whenMissing($chances, $outOf); + }); + } + + /** + * Indicate that the lottery results should be determined normally. + * + * @return void + */ + public static function determineResultsNormally() + { + static::determineResultNormally(); + } + + /** + * Indicate that the lottery results should be determined normally. + * + * @return void + */ + public static function determineResultNormally() + { + static::$resultFactory = null; + } + + /** + * Set the factory that should be used to determine the lottery results. + * + * @param callable $factory + * @return void + */ + public static function setResultFactory($factory) + { + self::$resultFactory = $factory; + } +} diff --git a/plugins/vendor/illuminate/support/Manager.php b/plugins/vendor/illuminate/support/Manager.php new file mode 100755 index 00000000..ebd95c85 --- /dev/null +++ b/plugins/vendor/illuminate/support/Manager.php @@ -0,0 +1,188 @@ +container = $container; + $this->config = $container->make('config'); + } + + /** + * Get the default driver name. + * + * @return string + */ + abstract public function getDefaultDriver(); + + /** + * Get a driver instance. + * + * @param string|null $driver + * @return mixed + * + * @throws \InvalidArgumentException + */ + public function driver($driver = null) + { + $driver = $driver ?: $this->getDefaultDriver(); + + if (is_null($driver)) { + throw new InvalidArgumentException(sprintf( + 'Unable to resolve NULL driver for [%s].', static::class + )); + } + + // If the given driver has not been created before, we will create the instances + // here and cache it so we can return it next time very quickly. If there is + // already a driver created by this name, we'll just return that instance. + return $this->drivers[$driver] ??= $this->createDriver($driver); + } + + /** + * Create a new driver instance. + * + * @param string $driver + * @return mixed + * + * @throws \InvalidArgumentException + */ + protected function createDriver($driver) + { + // First, we will determine if a custom driver creator exists for the given driver and + // if it does not we will check for a creator method for the driver. Custom creator + // callbacks allow developers to build their own "drivers" easily using Closures. + if (isset($this->customCreators[$driver])) { + return $this->callCustomCreator($driver); + } + + $method = 'create'.Str::studly($driver).'Driver'; + + if (method_exists($this, $method)) { + return $this->$method(); + } + + throw new InvalidArgumentException("Driver [$driver] not supported."); + } + + /** + * Call a custom driver creator. + * + * @param string $driver + * @return mixed + */ + protected function callCustomCreator($driver) + { + return $this->customCreators[$driver]($this->container); + } + + /** + * Register a custom driver creator Closure. + * + * @param string $driver + * @param \Closure $callback + * @return $this + */ + public function extend($driver, Closure $callback) + { + $this->customCreators[$driver] = $callback; + + return $this; + } + + /** + * Get all of the created "drivers". + * + * @return array + */ + public function getDrivers() + { + return $this->drivers; + } + + /** + * Get the container instance used by the manager. + * + * @return \Illuminate\Contracts\Container\Container + */ + public function getContainer() + { + return $this->container; + } + + /** + * Set the container instance used by the manager. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return $this + */ + public function setContainer(Container $container) + { + $this->container = $container; + + return $this; + } + + /** + * Forget all of the resolved driver instances. + * + * @return $this + */ + public function forgetDrivers() + { + $this->drivers = []; + + return $this; + } + + /** + * Dynamically call the default driver instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->driver()->$method(...$parameters); + } +} diff --git a/plugins/vendor/illuminate/support/MessageBag.php b/plugins/vendor/illuminate/support/MessageBag.php new file mode 100755 index 00000000..7ce0c4a6 --- /dev/null +++ b/plugins/vendor/illuminate/support/MessageBag.php @@ -0,0 +1,455 @@ +> + */ + protected $messages = []; + + /** + * Default format for message output. + * + * @var string + */ + protected $format = ':message'; + + /** + * Create a new message bag instance. + * + * @param array> $messages + */ + public function __construct(array $messages = []) + { + foreach ($messages as $key => $value) { + $value = $value instanceof Arrayable ? $value->toArray() : (array) $value; + + $this->messages[$key] = array_unique($value); + } + } + + /** + * Get the keys present in the message bag. + * + * @return array + */ + public function keys() + { + return array_keys($this->messages); + } + + /** + * Add a message to the message bag. + * + * @param string $key + * @param string $message + * @return $this + */ + public function add($key, $message) + { + if ($this->isUnique($key, $message)) { + $this->messages[$key][] = $message; + } + + return $this; + } + + /** + * Add a message to the message bag if the given conditional is "true". + * + * @param bool $boolean + * @param string $key + * @param string $message + * @return $this + */ + public function addIf($boolean, $key, $message) + { + return $boolean ? $this->add($key, $message) : $this; + } + + /** + * Determine if a key and message combination already exists. + * + * @param string $key + * @param string $message + * @return bool + */ + protected function isUnique($key, $message) + { + $messages = (array) $this->messages; + + return ! isset($messages[$key]) || ! in_array($message, $messages[$key]); + } + + /** + * Merge a new array of messages into the message bag. + * + * @param \Illuminate\Contracts\Support\MessageProvider|array> $messages + * @return $this + */ + public function merge($messages) + { + if ($messages instanceof MessageProvider) { + $messages = $messages->getMessageBag()->getMessages(); + } + + $this->messages = array_merge_recursive($this->messages, $messages); + + return $this; + } + + /** + * Determine if messages exist for all of the given keys. + * + * @param array|string|null $key + * @return bool + */ + public function has($key) + { + if ($this->isEmpty()) { + return false; + } + + if (is_null($key)) { + return $this->any(); + } + + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $key) { + if ($this->first($key) === '') { + return false; + } + } + + return true; + } + + /** + * Determine if messages exist for any of the given keys. + * + * @param array|string|null $keys + * @return bool + */ + public function hasAny($keys = []) + { + if ($this->isEmpty()) { + return false; + } + + $keys = is_array($keys) ? $keys : func_get_args(); + + foreach ($keys as $key) { + if ($this->has($key)) { + return true; + } + } + + return false; + } + + /** + * Determine if messages don't exist for all of the given keys. + * + * @param array|string|null $key + * @return bool + */ + public function missing($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + return ! $this->hasAny($keys); + } + + /** + * Get the first message from the message bag for a given key. + * + * @param string|null $key + * @param string|null $format + * @return string + */ + public function first($key = null, $format = null) + { + $messages = is_null($key) ? $this->all($format) : $this->get($key, $format); + + $firstMessage = Arr::first($messages, null, ''); + + return is_array($firstMessage) ? Arr::first($firstMessage) : $firstMessage; + } + + /** + * Get all of the messages from the message bag for a given key. + * + * @param string $key + * @param string|null $format + * @return array|array> + */ + public function get($key, $format = null) + { + // If the message exists in the message bag, we will transform it and return + // the message. Otherwise, we will check if the key is implicit & collect + // all the messages that match the given key and output it as an array. + if (array_key_exists($key, $this->messages)) { + return $this->transform( + $this->messages[$key], $this->checkFormat($format), $key + ); + } + + if (str_contains($key, '*')) { + return $this->getMessagesForWildcardKey($key, $format); + } + + return []; + } + + /** + * Get the messages for a wildcard key. + * + * @param string $key + * @param string|null $format + * @return array> + */ + protected function getMessagesForWildcardKey($key, $format) + { + return (new Collection($this->messages)) + ->filter(fn ($messages, $messageKey) => Str::is($key, $messageKey)) + ->map(function ($messages, $messageKey) use ($format) { + return $this->transform($messages, $this->checkFormat($format), $messageKey); + }) + ->all(); + } + + /** + * Get all of the messages for every key in the message bag. + * + * @param string|null $format + * @return array + */ + public function all($format = null) + { + $format = $this->checkFormat($format); + + $all = []; + + foreach ($this->messages as $key => $messages) { + $all = array_merge($all, $this->transform($messages, $format, $key)); + } + + return $all; + } + + /** + * Get all of the unique messages for every key in the message bag. + * + * @param string|null $format + * @return array + */ + public function unique($format = null) + { + return array_unique($this->all($format)); + } + + /** + * Remove a message from the message bag. + * + * @param string $key + * @return $this + */ + public function forget($key) + { + unset($this->messages[$key]); + + return $this; + } + + /** + * Format an array of messages. + * + * @param array $messages + * @param string $format + * @param string $messageKey + * @return array + */ + protected function transform($messages, $format, $messageKey) + { + if ($format == ':message') { + return (array) $messages; + } + + return (new Collection((array) $messages)) + ->map(function ($message) use ($format, $messageKey) { + // We will simply spin through the given messages and transform each one + // replacing the :message place holder with the real message allowing + // the messages to be easily formatted to each developer's desires. + return str_replace([':message', ':key'], [$message, $messageKey], $format); + })->all(); + } + + /** + * Get the appropriate format based on the given format. + * + * @param string $format + * @return string + */ + protected function checkFormat($format) + { + return $format ?: $this->format; + } + + /** + * Get the raw messages in the message bag. + * + * @return array> + */ + public function messages() + { + return $this->messages; + } + + /** + * Get the raw messages in the message bag. + * + * @return array> + */ + public function getMessages() + { + return $this->messages(); + } + + /** + * Get the messages for the instance. + * + * @return \Illuminate\Support\MessageBag + */ + public function getMessageBag() + { + return $this; + } + + /** + * Get the default message format. + * + * @return string + */ + public function getFormat() + { + return $this->format; + } + + /** + * Set the default message format. + * + * @param string $format + * @return \Illuminate\Support\MessageBag + */ + public function setFormat($format = ':message') + { + $this->format = $format; + + return $this; + } + + /** + * Determine if the message bag has any messages. + * + * @return bool + */ + public function isEmpty() + { + return ! $this->any(); + } + + /** + * Determine if the message bag has any messages. + * + * @return bool + */ + public function isNotEmpty() + { + return $this->any(); + } + + /** + * Determine if the message bag has any messages. + * + * @return bool + */ + public function any() + { + return $this->count() > 0; + } + + /** + * Get the number of messages in the message bag. + * + * @return int + */ + public function count(): int + { + return count($this->messages, COUNT_RECURSIVE) - count($this->messages); + } + + /** + * Get the instance as an array. + * + * @return array + */ + public function toArray() + { + return $this->getMessages(); + } + + /** + * Convert the object into something JSON serializable. + * + * @return array + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Convert the object to its JSON representation. + * + * @param int $options + * @return string + */ + public function toJson($options = 0) + { + return json_encode($this->jsonSerialize(), $options); + } + + /** + * Convert the object to pretty print formatted JSON. + * + * @params int $options + * + * @return string + */ + public function toPrettyJson(int $options = 0) + { + return $this->toJson(JSON_PRETTY_PRINT | $options); + } + + /** + * Convert the message bag to its string representation. + * + * @return string + */ + public function __toString() + { + return $this->toJson(); + } +} diff --git a/plugins/vendor/illuminate/support/MultipleInstanceManager.php b/plugins/vendor/illuminate/support/MultipleInstanceManager.php new file mode 100644 index 00000000..66fff08e --- /dev/null +++ b/plugins/vendor/illuminate/support/MultipleInstanceManager.php @@ -0,0 +1,230 @@ +app = $app; + $this->config = $app->make('config'); + } + + /** + * Get the default instance name. + * + * @return string + */ + abstract public function getDefaultInstance(); + + /** + * Set the default instance name. + * + * @param string $name + * @return void + */ + abstract public function setDefaultInstance($name); + + /** + * Get the instance specific configuration. + * + * @param string $name + * @return array + */ + abstract public function getInstanceConfig($name); + + /** + * Get an instance by name. + * + * @param string|null $name + * @return mixed + */ + public function instance($name = null) + { + $name = $name ?: $this->getDefaultInstance(); + + return $this->instances[$name] = $this->get($name); + } + + /** + * Attempt to get an instance from the local cache. + * + * @param string $name + * @return mixed + */ + protected function get($name) + { + return $this->instances[$name] ?? $this->resolve($name); + } + + /** + * Resolve the given instance. + * + * @param string $name + * @return mixed + * + * @throws \InvalidArgumentException + * @throws \RuntimeException + */ + protected function resolve($name) + { + $config = $this->getInstanceConfig($name); + + if (is_null($config)) { + throw new InvalidArgumentException("Instance [{$name}] is not defined."); + } + + if (! array_key_exists($this->driverKey, $config)) { + throw new RuntimeException("Instance [{$name}] does not specify a {$this->driverKey}."); + } + + $driverName = $config[$this->driverKey]; + + if (isset($this->customCreators[$driverName])) { + return $this->callCustomCreator($config); + } else { + $createMethod = 'create'.ucfirst($driverName).ucfirst($this->driverKey); + + if (method_exists($this, $createMethod)) { + return $this->{$createMethod}($config); + } + + $createMethod = 'create'.Str::studly($driverName).ucfirst($this->driverKey); + + if (method_exists($this, $createMethod)) { + return $this->{$createMethod}($config); + } + + throw new InvalidArgumentException("Instance {$this->driverKey} [{$config[$this->driverKey]}] is not supported."); + } + } + + /** + * Call a custom instance creator. + * + * @param array $config + * @return mixed + */ + protected function callCustomCreator(array $config) + { + return $this->customCreators[$config[$this->driverKey]]($this->app, $config); + } + + /** + * Unset the given instances. + * + * @param array|string|null $name + * @return $this + */ + public function forgetInstance($name = null) + { + $name ??= $this->getDefaultInstance(); + + foreach ((array) $name as $instanceName) { + if (isset($this->instances[$instanceName])) { + unset($this->instances[$instanceName]); + } + } + + return $this; + } + + /** + * Disconnect the given instance and remove from local cache. + * + * @param string|null $name + * @return void + */ + public function purge($name = null) + { + $name ??= $this->getDefaultInstance(); + + unset($this->instances[$name]); + } + + /** + * Register a custom instance creator Closure. + * + * @param string $name + * @param \Closure $callback + * + * @param-closure-this $this $callback + * + * @return $this + */ + public function extend($name, Closure $callback) + { + $this->customCreators[$name] = $callback->bindTo($this, $this); + + return $this; + } + + /** + * Set the application instance used by the manager. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @return $this + */ + public function setApplication($app) + { + $this->app = $app; + + return $this; + } + + /** + * Dynamically call the default instance. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->instance()->$method(...$parameters); + } +} diff --git a/plugins/vendor/illuminate/support/NamespacedItemResolver.php b/plugins/vendor/illuminate/support/NamespacedItemResolver.php new file mode 100755 index 00000000..10007be9 --- /dev/null +++ b/plugins/vendor/illuminate/support/NamespacedItemResolver.php @@ -0,0 +1,112 @@ +parsed[$key])) { + return $this->parsed[$key]; + } + + // If the key does not contain a double colon, it means the key is not in a + // namespace, and is just a regular configuration item. Namespaces are a + // tool for organizing configuration items for things such as modules. + if (! str_contains($key, '::')) { + $segments = explode('.', $key); + + $parsed = $this->parseBasicSegments($segments); + } else { + $parsed = $this->parseNamespacedSegments($key); + } + + // Once we have the parsed array of this key's elements, such as its groups + // and namespace, we will cache each array inside a simple list that has + // the key and the parsed array for quick look-ups for later requests. + return $this->parsed[$key] = $parsed; + } + + /** + * Parse an array of basic segments. + * + * @param array $segments + * @return array + */ + protected function parseBasicSegments(array $segments) + { + // The first segment in a basic array will always be the group, so we can go + // ahead and grab that segment. If there is only one total segment we are + // just pulling an entire group out of the array and not a single item. + $group = $segments[0]; + + // If there is more than one segment in this group, it means we are pulling + // a specific item out of a group and will need to return this item name + // as well as the group so we know which item to pull from the arrays. + $item = count($segments) === 1 + ? null + : implode('.', array_slice($segments, 1)); + + return [null, $group, $item]; + } + + /** + * Parse an array of namespaced segments. + * + * @param string $key + * @return array + */ + protected function parseNamespacedSegments($key) + { + [$namespace, $item] = explode('::', $key); + + // First we'll just explode the first segment to get the namespace and group + // since the item should be in the remaining segments. Once we have these + // two pieces of data we can proceed with parsing out the item's value. + $itemSegments = explode('.', $item); + + $groupAndItem = array_slice( + $this->parseBasicSegments($itemSegments), 1 + ); + + return array_merge([$namespace], $groupAndItem); + } + + /** + * Set the parsed value of a key. + * + * @param string $key + * @param array $parsed + * @return void + */ + public function setParsedKey($key, $parsed) + { + $this->parsed[$key] = $parsed; + } + + /** + * Flush the cache of parsed keys. + * + * @return void + */ + public function flushParsedKeys() + { + $this->parsed = []; + } +} diff --git a/plugins/vendor/illuminate/support/Number.php b/plugins/vendor/illuminate/support/Number.php new file mode 100644 index 00000000..1162a9c1 --- /dev/null +++ b/plugins/vendor/illuminate/support/Number.php @@ -0,0 +1,442 @@ +setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $maxPrecision); + } elseif (! is_null($precision)) { + $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $precision); + } + + return $formatter->format($number); + } + + /** + * Parse the given string according to the specified format type. + * + * @param string $string + * @param int|null $type + * @param string|null $locale + * @return int|float|false + */ + public static function parse(string $string, ?int $type = NumberFormatter::TYPE_DOUBLE, ?string $locale = null): int|float + { + static::ensureIntlExtensionIsInstalled(); + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::DECIMAL); + + return $formatter->parse($string, $type); + } + + /** + * Parse a string into an integer according to the specified locale. + * + * @param string $string + * @param string|null $locale + * @return int|false + */ + public static function parseInt(string $string, ?string $locale = null): int + { + return self::parse($string, NumberFormatter::TYPE_INT32, $locale); + } + + /** + * Parse a string into a float according to the specified locale. + * + * @param string $string + * @param string|null $locale + * @return float|false + */ + public static function parseFloat(string $string, ?string $locale = null): float + { + return self::parse($string, NumberFormatter::TYPE_DOUBLE, $locale); + } + + /** + * Spell out the given number in the given locale. + * + * @param int|float $number + * @param string|null $locale + * @param int|null $after + * @param int|null $until + * @return string + */ + public static function spell(int|float $number, ?string $locale = null, ?int $after = null, ?int $until = null) + { + static::ensureIntlExtensionIsInstalled(); + + if (! is_null($after) && $number <= $after) { + return static::format($number, locale: $locale); + } + + if (! is_null($until) && $number >= $until) { + return static::format($number, locale: $locale); + } + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::SPELLOUT); + + return $formatter->format($number); + } + + /** + * Convert the given number to ordinal form. + * + * @param int|float $number + * @param string|null $locale + * @return string + */ + public static function ordinal(int|float $number, ?string $locale = null) + { + static::ensureIntlExtensionIsInstalled(); + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::ORDINAL); + + return $formatter->format($number); + } + + /** + * Spell out the given number in the given locale in ordinal form. + * + * @param int|float $number + * @param string|null $locale + * @return string + */ + public static function spellOrdinal(int|float $number, ?string $locale = null) + { + static::ensureIntlExtensionIsInstalled(); + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::SPELLOUT); + + $formatter->setTextAttribute(NumberFormatter::DEFAULT_RULESET, '%spellout-ordinal'); + + return $formatter->format($number); + } + + /** + * Convert the given number to its percentage equivalent. + * + * @param int|float $number + * @param int $precision + * @param int|null $maxPrecision + * @param string|null $locale + * @return string|false + */ + public static function percentage(int|float $number, int $precision = 0, ?int $maxPrecision = null, ?string $locale = null) + { + static::ensureIntlExtensionIsInstalled(); + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::PERCENT); + + if (! is_null($maxPrecision)) { + $formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, $maxPrecision); + } else { + $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $precision); + } + + return $formatter->format($number / 100); + } + + /** + * Convert the given number to its currency equivalent. + * + * @param int|float $number + * @param string $in + * @param string|null $locale + * @param int|null $precision + * @return string|false + */ + public static function currency(int|float $number, string $in = '', ?string $locale = null, ?int $precision = null) + { + static::ensureIntlExtensionIsInstalled(); + + $formatter = new NumberFormatter($locale ?? static::$locale, NumberFormatter::CURRENCY); + + if (! is_null($precision)) { + $formatter->setAttribute(NumberFormatter::FRACTION_DIGITS, $precision); + } + + return $formatter->formatCurrency($number, ! empty($in) ? $in : static::$currency); + } + + /** + * Convert the given number to its file size equivalent. + * + * @param int|float $bytes + * @param int $precision + * @param int|null $maxPrecision + * @return string + */ + public static function fileSize(int|float $bytes, int $precision = 0, ?int $maxPrecision = null) + { + $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; + + $unitCount = count($units); + + for ($i = 0; ($bytes / 1024) > 0.9 && ($i < $unitCount - 1); $i++) { + $bytes /= 1024; + } + + return sprintf('%s %s', static::format($bytes, $precision, $maxPrecision), $units[$i]); + } + + /** + * Convert the number to its human-readable equivalent. + * + * @param int|float $number + * @param int $precision + * @param int|null $maxPrecision + * @return bool|string + */ + public static function abbreviate(int|float $number, int $precision = 0, ?int $maxPrecision = null) + { + return static::forHumans($number, $precision, $maxPrecision, abbreviate: true); + } + + /** + * Convert the number to its human-readable equivalent. + * + * @param int|float $number + * @param int $precision + * @param int|null $maxPrecision + * @param bool $abbreviate + * @return string|false + */ + public static function forHumans(int|float $number, int $precision = 0, ?int $maxPrecision = null, bool $abbreviate = false) + { + return static::summarize($number, $precision, $maxPrecision, $abbreviate ? [ + 3 => 'K', + 6 => 'M', + 9 => 'B', + 12 => 'T', + 15 => 'Q', + ] : [ + 3 => ' thousand', + 6 => ' million', + 9 => ' billion', + 12 => ' trillion', + 15 => ' quadrillion', + ]); + } + + /** + * Convert the number to its human-readable equivalent. + * + * @param int|float $number + * @param int $precision + * @param int|null $maxPrecision + * @param array $units + * @return string|false + */ + protected static function summarize(int|float $number, int $precision = 0, ?int $maxPrecision = null, array $units = []) + { + if (empty($units)) { + $units = [ + 3 => 'K', + 6 => 'M', + 9 => 'B', + 12 => 'T', + 15 => 'Q', + ]; + } + + switch (true) { + case floatval($number) === 0.0: + return $precision > 0 ? static::format(0, $precision, $maxPrecision) : '0'; + case $number < 0: + return sprintf('-%s', static::summarize(abs($number), $precision, $maxPrecision, $units)); + case $number >= 1e15: + return sprintf('%s'.end($units), static::summarize($number / 1e15, $precision, $maxPrecision, $units)); + } + + $numberExponent = floor(log10($number)); + $displayExponent = $numberExponent - ($numberExponent % 3); + $number /= pow(10, $displayExponent); + + return trim(sprintf('%s%s', static::format($number, $precision, $maxPrecision), $units[$displayExponent] ?? '')); + } + + /** + * Clamp the given number between the given minimum and maximum. + * + * @param int|float $number + * @param int|float $min + * @param int|float $max + * @return int|float + */ + public static function clamp(int|float $number, int|float $min, int|float $max) + { + return min(max($number, $min), $max); + } + + /** + * Split the given number into pairs of min/max values. + * + * @param int|float $to + * @param int|float $by + * @param int|float $start + * @param int|float $offset + * @return array + */ + public static function pairs(int|float $to, int|float $by, int|float $start = 0, int|float $offset = 1) + { + $output = []; + + for ($lower = $start; $lower < $to; $lower += $by) { + $upper = $lower + $by - $offset; + + if ($upper > $to) { + $upper = $to; + } + + $output[] = [$lower, $upper]; + } + + return $output; + } + + /** + * Remove any trailing zero digits after the decimal point of the given number. + * + * @param int|float $number + * @return int|float + */ + public static function trim(int|float $number) + { + return json_decode(json_encode($number)); + } + + /** + * Execute the given callback using the given locale. + * + * @param string $locale + * @param callable $callback + * @return mixed + */ + public static function withLocale(string $locale, callable $callback) + { + $previousLocale = static::$locale; + + static::useLocale($locale); + + try { + return $callback(); + } finally { + static::useLocale($previousLocale); + } + } + + /** + * Execute the given callback using the given currency. + * + * @param string $currency + * @param callable $callback + * @return mixed + */ + public static function withCurrency(string $currency, callable $callback) + { + $previousCurrency = static::$currency; + + static::useCurrency($currency); + + try { + return $callback(); + } finally { + static::useCurrency($previousCurrency); + } + } + + /** + * Set the default locale. + * + * @param string $locale + * @return void + */ + public static function useLocale(string $locale) + { + static::$locale = $locale; + } + + /** + * Set the default currency. + * + * @param string $currency + * @return void + */ + public static function useCurrency(string $currency) + { + static::$currency = $currency; + } + + /** + * Get the default locale. + * + * @return string + */ + public static function defaultLocale() + { + return static::$locale; + } + + /** + * Get the default currency. + * + * @return string + */ + public static function defaultCurrency() + { + return static::$currency; + } + + /** + * Ensure the "intl" PHP extension is installed. + * + * @return void + * + * @throws \RuntimeException + */ + protected static function ensureIntlExtensionIsInstalled() + { + if (! extension_loaded('intl')) { + $method = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function']; + + throw new RuntimeException('The "intl" PHP extension is required to use the ['.$method.'] method.'); + } + } +} diff --git a/plugins/vendor/illuminate/support/Once.php b/plugins/vendor/illuminate/support/Once.php new file mode 100644 index 00000000..4d860b29 --- /dev/null +++ b/plugins/vendor/illuminate/support/Once.php @@ -0,0 +1,99 @@ +> $values + */ + protected function __construct(protected WeakMap $values) + { + // + } + + /** + * Create a new once instance. + * + * @return static + */ + public static function instance() + { + return static::$instance ??= new static(new WeakMap); + } + + /** + * Get the value of the given onceable. + * + * @param Onceable $onceable + * @return mixed + */ + public function value(Onceable $onceable) + { + if (! static::$enabled) { + return call_user_func($onceable->callable); + } + + $object = $onceable->object ?: $this; + + $hash = $onceable->hash; + + if (! isset($this->values[$object])) { + $this->values[$object] = []; + } + + if (array_key_exists($hash, $this->values[$object])) { + return $this->values[$object][$hash]; + } + + return $this->values[$object][$hash] = call_user_func($onceable->callable); + } + + /** + * Re-enable the once instance if it was disabled. + * + * @return void + */ + public static function enable() + { + static::$enabled = true; + } + + /** + * Disable the once instance. + * + * @return void + */ + public static function disable() + { + static::$enabled = false; + } + + /** + * Flush the once instance. + * + * @return void + */ + public static function flush() + { + static::$instance = null; + } +} diff --git a/plugins/vendor/illuminate/support/Onceable.php b/plugins/vendor/illuminate/support/Onceable.php new file mode 100644 index 00000000..3621e393 --- /dev/null +++ b/plugins/vendor/illuminate/support/Onceable.php @@ -0,0 +1,92 @@ +> $trace + * @return static|null + */ + public static function tryFromTrace(array $trace, callable $callable) + { + if (! is_null($hash = static::hashFromTrace($trace, $callable))) { + $object = static::objectFromTrace($trace); + + return new static($hash, $object, $callable); + } + } + + /** + * Computes the object of the onceable from the given trace, if any. + * + * @param array> $trace + * @return object|null + */ + protected static function objectFromTrace(array $trace) + { + return $trace[1]['object'] ?? null; + } + + /** + * Computes the hash of the onceable from the given trace. + * + * @param array> $trace + * @return string|null + */ + protected static function hashFromTrace(array $trace, callable $callable) + { + if (str_contains($trace[0]['file'] ?? '', 'eval()\'d code')) { + return null; + } + + $uses = array_map( + static function (mixed $argument) { + if ($argument instanceof HasOnceHash) { + return $argument->onceHash(); + } + + if (is_object($argument)) { + return spl_object_hash($argument); + } + + return $argument; + }, + $callable instanceof Closure ? (new ReflectionClosure($callable))->getClosureUsedVariables() : [], + ); + + $class = $callable instanceof Closure ? (new ReflectionClosure($callable))->getClosureCalledClass()?->getName() : null; + + $class ??= isset($trace[1]['class']) ? $trace[1]['class'] : null; + + return hash('xxh128', sprintf( + '%s@%s%s:%s (%s)', + $trace[0]['file'], + $class ? $class.'@' : '', + $trace[1]['function'], + $trace[0]['line'], + serialize($uses), + )); + } +} diff --git a/plugins/vendor/illuminate/support/Optional.php b/plugins/vendor/illuminate/support/Optional.php new file mode 100644 index 00000000..fcf71ed0 --- /dev/null +++ b/plugins/vendor/illuminate/support/Optional.php @@ -0,0 +1,130 @@ +value = $value; + } + + /** + * Dynamically access a property on the underlying object. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + if (is_object($this->value)) { + return $this->value->{$key} ?? null; + } + } + + /** + * Dynamically check a property exists on the underlying object. + * + * @param mixed $name + * @return bool + */ + public function __isset($name) + { + if (is_object($this->value)) { + return isset($this->value->{$name}); + } + + if (is_array($this->value) || $this->value instanceof ArrayObject) { + return isset($this->value[$name]); + } + + return false; + } + + /** + * Determine if an item exists at an offset. + * + * @param mixed $key + * @return bool + */ + public function offsetExists($key): bool + { + return Arr::accessible($this->value) && Arr::exists($this->value, $key); + } + + /** + * Get an item at a given offset. + * + * @param mixed $key + * @return mixed + */ + public function offsetGet($key): mixed + { + return Arr::get($this->value, $key); + } + + /** + * Set the item at a given offset. + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value): void + { + if (Arr::accessible($this->value)) { + $this->value[$key] = $value; + } + } + + /** + * Unset the item at a given offset. + * + * @param string $key + * @return void + */ + public function offsetUnset($key): void + { + if (Arr::accessible($this->value)) { + unset($this->value[$key]); + } + } + + /** + * Dynamically pass a method to the underlying object. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + if (static::hasMacro($method)) { + return $this->macroCall($method, $parameters); + } + + if (is_object($this->value)) { + return $this->value->{$method}(...$parameters); + } + } +} diff --git a/plugins/vendor/illuminate/support/Pluralizer.php b/plugins/vendor/illuminate/support/Pluralizer.php new file mode 100755 index 00000000..0d909de1 --- /dev/null +++ b/plugins/vendor/illuminate/support/Pluralizer.php @@ -0,0 +1,127 @@ +pluralize($value); + + return static::matchCase($plural, $value); + } + + /** + * Get the singular form of an English word. + * + * @param string $value + * @return string + */ + public static function singular($value) + { + $singular = static::inflector()->singularize($value); + + return static::matchCase($singular, $value); + } + + /** + * Determine if the given value is uncountable. + * + * @param string $value + * @return bool + */ + protected static function uncountable($value) + { + return in_array(strtolower($value), static::$uncountable); + } + + /** + * Attempt to match the case on two strings. + * + * @param string $value + * @param string $comparison + * @return string + */ + protected static function matchCase($value, $comparison) + { + $functions = ['mb_strtolower', 'mb_strtoupper', 'ucfirst', 'ucwords']; + + foreach ($functions as $function) { + if ($function($comparison) === $comparison) { + return $function($value); + } + } + + return $value; + } + + /** + * Get the inflector instance. + * + * @return \Doctrine\Inflector\Inflector + */ + public static function inflector() + { + if (is_null(static::$inflector)) { + static::$inflector = InflectorFactory::createForLanguage(static::$language)->build(); + } + + return static::$inflector; + } + + /** + * Specify the language that should be used by the inflector. + * + * @param string $language + * @return void + */ + public static function useLanguage(string $language) + { + static::$language = $language; + + static::$inflector = null; + } +} diff --git a/plugins/vendor/illuminate/support/ProcessUtils.php b/plugins/vendor/illuminate/support/ProcessUtils.php new file mode 100644 index 00000000..165e7516 --- /dev/null +++ b/plugins/vendor/illuminate/support/ProcessUtils.php @@ -0,0 +1,69 @@ + 2 && $char === $arg[0] && $char === $arg[strlen($arg) - 1]; + } +} diff --git a/plugins/vendor/illuminate/support/Reflector.php b/plugins/vendor/illuminate/support/Reflector.php new file mode 100644 index 00000000..2ee9c5fe --- /dev/null +++ b/plugins/vendor/illuminate/support/Reflector.php @@ -0,0 +1,211 @@ +isPublic(); + } + + if (is_object($var[0]) && method_exists($class, '__call')) { + return (new ReflectionMethod($class, '__call'))->isPublic(); + } + + if (! is_object($var[0]) && method_exists($class, '__callStatic')) { + return (new ReflectionMethod($class, '__callStatic'))->isPublic(); + } + + return false; + } + + /** + * Get the specified class attribute, optionally following an inheritance chain. + * + * @template TAttribute of object + * + * @param object|class-string $objectOrClass + * @param class-string $attribute + * @return TAttribute|null + */ + public static function getClassAttribute($objectOrClass, $attribute, $ascend = false) + { + return static::getClassAttributes($objectOrClass, $attribute, $ascend)->flatten()->first(); + } + + /** + * Get the specified class attribute(s), optionally following an inheritance chain. + * + * @template TTarget of object + * @template TAttribute of object + * + * @param TTarget|class-string $objectOrClass + * @param class-string $attribute + * @return ($includeParents is true ? Collection, Collection> : Collection) + */ + public static function getClassAttributes($objectOrClass, $attribute, $includeParents = false) + { + $reflectionClass = new ReflectionClass($objectOrClass); + + $attributes = []; + + do { + $attributes[$reflectionClass->name] = new Collection(array_map( + fn (ReflectionAttribute $reflectionAttribute) => $reflectionAttribute->newInstance(), + $reflectionClass->getAttributes($attribute) + )); + } while ($includeParents && false !== $reflectionClass = $reflectionClass->getParentClass()); + + return $includeParents ? new Collection($attributes) : array_first($attributes); + } + + /** + * Get the class name of the given parameter's type, if possible. + * + * @param \ReflectionParameter $parameter + * @return string|null + */ + public static function getParameterClassName($parameter) + { + $type = $parameter->getType(); + + if (! $type instanceof ReflectionNamedType || $type->isBuiltin()) { + return; + } + + return static::getTypeName($parameter, $type); + } + + /** + * Get the class names of the given parameter's type, including union types. + * + * @param \ReflectionParameter $parameter + * @return array + */ + public static function getParameterClassNames($parameter) + { + $type = $parameter->getType(); + + if (! $type instanceof ReflectionUnionType) { + return array_filter([static::getParameterClassName($parameter)]); + } + + $unionTypes = []; + + foreach ($type->getTypes() as $listedType) { + if (! $listedType instanceof ReflectionNamedType || $listedType->isBuiltin()) { + continue; + } + + $unionTypes[] = static::getTypeName($parameter, $listedType); + } + + return array_filter($unionTypes); + } + + /** + * Get the given type's class name. + * + * @param \ReflectionParameter $parameter + * @param \ReflectionNamedType $type + * @return string + */ + protected static function getTypeName($parameter, $type) + { + $name = $type->getName(); + + if (! is_null($class = $parameter->getDeclaringClass())) { + if ($name === 'self') { + return $class->getName(); + } + + if ($name === 'parent' && $parent = $class->getParentClass()) { + return $parent->getName(); + } + } + + return $name; + } + + /** + * Determine if the parameter's type is a subclass of the given type. + * + * @param \ReflectionParameter $parameter + * @param string $className + * @return bool + */ + public static function isParameterSubclassOf($parameter, $className) + { + $paramClassName = static::getParameterClassName($parameter); + + return $paramClassName + && (class_exists($paramClassName) || interface_exists($paramClassName)) + && (new ReflectionClass($paramClassName))->isSubclassOf($className); + } + + /** + * Determine if the parameter's type is a Backed Enum with a string backing type. + * + * @param \ReflectionParameter $parameter + * @return bool + */ + public static function isParameterBackedEnumWithStringBackingType($parameter) + { + if (! $parameter->getType() instanceof ReflectionNamedType) { + return false; + } + + $backedEnumClass = $parameter->getType()?->getName(); + + if (is_null($backedEnumClass)) { + return false; + } + + if (enum_exists($backedEnumClass)) { + $reflectionBackedEnum = new ReflectionEnum($backedEnumClass); + + return $reflectionBackedEnum->isBacked() + && $reflectionBackedEnum->getBackingType()->getName() == 'string'; + } + + return false; + } +} diff --git a/plugins/vendor/illuminate/support/ServiceProvider.php b/plugins/vendor/illuminate/support/ServiceProvider.php new file mode 100755 index 00000000..85b0ee11 --- /dev/null +++ b/plugins/vendor/illuminate/support/ServiceProvider.php @@ -0,0 +1,583 @@ + $bindings All of the container bindings that should be registered. + * @property array $singletons All of the singletons that should be registered. + */ +abstract class ServiceProvider +{ + /** + * The application instance. + * + * @var \Illuminate\Contracts\Foundation\Application + */ + protected $app; + + /** + * All of the registered booting callbacks. + * + * @var array + */ + protected $bootingCallbacks = []; + + /** + * All of the registered booted callbacks. + * + * @var array + */ + protected $bootedCallbacks = []; + + /** + * The paths that should be published. + * + * @var array + */ + public static $publishes = []; + + /** + * The paths that should be published by group. + * + * @var array + */ + public static $publishGroups = []; + + /** + * The migration paths available for publishing. + * + * @var array + */ + protected static $publishableMigrationPaths = []; + + /** + * Commands that should be run during the "optimize" command. + * + * @var array + */ + public static array $optimizeCommands = []; + + /** + * Commands that should be run during the "optimize:clear" command. + * + * @var array + */ + public static array $optimizeClearCommands = []; + + /** + * Create a new service provider instance. + * + * @param \Illuminate\Contracts\Foundation\Application $app + */ + public function __construct($app) + { + $this->app = $app; + } + + /** + * Register any application services. + * + * @return void + */ + public function register() + { + // + } + + /** + * Register a booting callback to be run before the "boot" method is called. + * + * @param \Closure $callback + * @return void + */ + public function booting(Closure $callback) + { + $this->bootingCallbacks[] = $callback; + } + + /** + * Register a booted callback to be run after the "boot" method is called. + * + * @param \Closure $callback + * @return void + */ + public function booted(Closure $callback) + { + $this->bootedCallbacks[] = $callback; + } + + /** + * Call the registered booting callbacks. + * + * @return void + */ + public function callBootingCallbacks() + { + $index = 0; + + while ($index < count($this->bootingCallbacks)) { + $this->app->call($this->bootingCallbacks[$index]); + + $index++; + } + } + + /** + * Call the registered booted callbacks. + * + * @return void + */ + public function callBootedCallbacks() + { + $index = 0; + + while ($index < count($this->bootedCallbacks)) { + $this->app->call($this->bootedCallbacks[$index]); + + $index++; + } + } + + /** + * Merge the given configuration with the existing configuration. + * + * @param string $path + * @param string $key + * @return void + */ + protected function mergeConfigFrom($path, $key) + { + if (! ($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) { + $config = $this->app->make('config'); + + $config->set($key, array_merge( + require $path, $config->get($key, []) + )); + } + } + + /** + * Replace the given configuration with the existing configuration recursively. + * + * @param string $path + * @param string $key + * @return void + */ + protected function replaceConfigRecursivelyFrom($path, $key) + { + if (! ($this->app instanceof CachesConfiguration && $this->app->configurationIsCached())) { + $config = $this->app->make('config'); + + $config->set($key, array_replace_recursive( + require $path, $config->get($key, []) + )); + } + } + + /** + * Load the given routes file if routes are not already cached. + * + * @param string $path + * @return void + */ + protected function loadRoutesFrom($path) + { + if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { + require $path; + } + } + + /** + * Register a view file namespace. + * + * @param string|array $path + * @param string $namespace + * @return void + */ + protected function loadViewsFrom($path, $namespace) + { + $this->callAfterResolving('view', function ($view) use ($path, $namespace) { + if (isset($this->app->config['view']['paths']) && + is_array($this->app->config['view']['paths'])) { + foreach ($this->app->config['view']['paths'] as $viewPath) { + if (is_dir($appPath = $viewPath.'/vendor/'.$namespace)) { + $view->addNamespace($namespace, $appPath); + } + } + } + + $view->addNamespace($namespace, $path); + }); + } + + /** + * Register the given view components with a custom prefix. + * + * @param string $prefix + * @param array $components + * @return void + */ + protected function loadViewComponentsAs($prefix, array $components) + { + $this->callAfterResolving(BladeCompiler::class, function ($blade) use ($prefix, $components) { + foreach ($components as $alias => $component) { + $blade->component($component, is_string($alias) ? $alias : null, $prefix); + } + }); + } + + /** + * Register a translation file namespace or path. + * + * @param string $path + * @param string|null $namespace + * @return void + */ + protected function loadTranslationsFrom($path, $namespace = null) + { + $this->callAfterResolving('translator', fn ($translator) => is_null($namespace) + ? $translator->addPath($path) + : $translator->addNamespace($namespace, $path)); + } + + /** + * Register a JSON translation file path. + * + * @param string $path + * @return void + */ + protected function loadJsonTranslationsFrom($path) + { + $this->callAfterResolving('translator', function ($translator) use ($path) { + $translator->addJsonPath($path); + }); + } + + /** + * Register database migration paths. + * + * @param array|string $paths + * @return void + */ + protected function loadMigrationsFrom($paths) + { + $this->callAfterResolving('migrator', function ($migrator) use ($paths) { + foreach ((array) $paths as $path) { + $migrator->path($path); + } + }); + } + + /** + * Register Eloquent model factory paths. + * + * @deprecated Will be removed in a future Laravel version. + * + * @param array|string $paths + * @return void + */ + protected function loadFactoriesFrom($paths) + { + $this->callAfterResolving(ModelFactory::class, function ($factory) use ($paths) { + foreach ((array) $paths as $path) { + $factory->load($path); + } + }); + } + + /** + * Setup an after resolving listener, or fire immediately if already resolved. + * + * @param string $name + * @param callable $callback + * @return void + */ + protected function callAfterResolving($name, $callback) + { + $this->app->afterResolving($name, $callback); + + if ($this->app->resolved($name)) { + $callback($this->app->make($name), $this->app); + } + } + + /** + * Register migration paths to be published by the publish command. + * + * @param array $paths + * @param mixed $groups + * @return void + */ + protected function publishesMigrations(array $paths, $groups = null) + { + $this->publishes($paths, $groups); + + if ($this->app->config->get('database.migrations.update_date_on_publish', false)) { + static::$publishableMigrationPaths = array_unique(array_merge(static::$publishableMigrationPaths, array_keys($paths))); + } + } + + /** + * Register paths to be published by the publish command. + * + * @param array $paths + * @param mixed $groups + * @return void + */ + protected function publishes(array $paths, $groups = null) + { + $this->ensurePublishArrayInitialized($class = static::class); + + static::$publishes[$class] = array_merge(static::$publishes[$class], $paths); + + foreach ((array) $groups as $group) { + $this->addPublishGroup($group, $paths); + } + } + + /** + * Ensure the publish array for the service provider is initialized. + * + * @param string $class + * @return void + */ + protected function ensurePublishArrayInitialized($class) + { + if (! array_key_exists($class, static::$publishes)) { + static::$publishes[$class] = []; + } + } + + /** + * Add a publish group / tag to the service provider. + * + * @param string $group + * @param array $paths + * @return void + */ + protected function addPublishGroup($group, $paths) + { + if (! array_key_exists($group, static::$publishGroups)) { + static::$publishGroups[$group] = []; + } + + static::$publishGroups[$group] = array_merge( + static::$publishGroups[$group], $paths + ); + } + + /** + * Get the paths to publish. + * + * @param string|null $provider + * @param string|null $group + * @return array + */ + public static function pathsToPublish($provider = null, $group = null) + { + if (! is_null($paths = static::pathsForProviderOrGroup($provider, $group))) { + return $paths; + } + + return (new Collection(static::$publishes))->reduce(function ($paths, $p) { + return array_merge($paths, $p); + }, []); + } + + /** + * Get the paths for the provider or group (or both). + * + * @param string|null $provider + * @param string|null $group + * @return array + */ + protected static function pathsForProviderOrGroup($provider, $group) + { + if ($provider && $group) { + return static::pathsForProviderAndGroup($provider, $group); + } elseif ($group && array_key_exists($group, static::$publishGroups)) { + return static::$publishGroups[$group]; + } elseif ($provider && array_key_exists($provider, static::$publishes)) { + return static::$publishes[$provider]; + } elseif ($group || $provider) { + return []; + } + } + + /** + * Get the paths for the provider and group. + * + * @param string $provider + * @param string $group + * @return array + */ + protected static function pathsForProviderAndGroup($provider, $group) + { + if (! empty(static::$publishes[$provider]) && ! empty(static::$publishGroups[$group])) { + return array_intersect_key(static::$publishes[$provider], static::$publishGroups[$group]); + } + + return []; + } + + /** + * Get the service providers available for publishing. + * + * @return array + */ + public static function publishableProviders() + { + return array_keys(static::$publishes); + } + + /** + * Get the migration paths available for publishing. + * + * @return array + */ + public static function publishableMigrationPaths() + { + return static::$publishableMigrationPaths; + } + + /** + * Get the groups available for publishing. + * + * @return array + */ + public static function publishableGroups() + { + return array_keys(static::$publishGroups); + } + + /** + * Register the package's custom Artisan commands. + * + * @param mixed $commands + * @return void + */ + public function commands($commands) + { + $commands = is_array($commands) ? $commands : func_get_args(); + + Artisan::starting(function ($artisan) use ($commands) { + $artisan->resolveCommands($commands); + }); + } + + /** + * Register commands that should run on "optimize" or "optimize:clear". + * + * @param string|null $optimize + * @param string|null $clear + * @param string|null $key + * @return void + */ + protected function optimizes(?string $optimize = null, ?string $clear = null, ?string $key = null) + { + $key ??= (string) Str::of(get_class($this)) + ->classBasename() + ->before('ServiceProvider') + ->kebab() + ->lower() + ->trim(); + + if (empty($key)) { + $key = class_basename(get_class($this)); + } + + if ($optimize) { + static::$optimizeCommands[$key] = $optimize; + } + + if ($clear) { + static::$optimizeClearCommands[$key] = $clear; + } + } + + /** + * Get the services provided by the provider. + * + * @return array + */ + public function provides() + { + return []; + } + + /** + * Get the events that trigger this service provider to register. + * + * @return array + */ + public function when() + { + return []; + } + + /** + * Determine if the provider is deferred. + * + * @return bool + */ + public function isDeferred() + { + return $this instanceof DeferrableProvider; + } + + /** + * Get the default providers for a Laravel application. + * + * @return \Illuminate\Support\DefaultProviders + */ + public static function defaultProviders() + { + return new DefaultProviders; + } + + /** + * Add the given provider to the application's provider bootstrap file. + * + * @param string $provider + * @param string $path + * @return bool + */ + public static function addProviderToBootstrapFile(string $provider, ?string $path = null) + { + $path ??= app()->getBootstrapProvidersPath(); + + if (! file_exists($path)) { + return false; + } + + if (function_exists('opcache_invalidate')) { + opcache_invalidate($path, true); + } + + $providers = (new Collection(require $path)) + ->merge([$provider]) + ->unique() + ->sort() + ->values() + ->map(fn ($p) => ' '.$p.'::class,') + ->implode(PHP_EOL); + + $content = ' + */ + protected static $sequence = []; + + /** + * Indicates if the instance should sleep. + * + * @var bool + */ + protected $shouldSleep = true; + + /** + * Indicates if the instance already slept via `then()`. + * + * @var bool + */ + protected $alreadySlept = false; + + /** + * Create a new class instance. + * + * @param int|float|\DateInterval $duration + */ + public function __construct($duration) + { + $this->duration($duration); + } + + /** + * Sleep for the given duration. + * + * @param \DateInterval|int|float $duration + * @return static + */ + public static function for($duration) + { + return new static($duration); + } + + /** + * Sleep until the given timestamp. + * + * @param \DateTimeInterface|int|float|numeric-string $timestamp + * @return static + */ + public static function until($timestamp) + { + if (is_numeric($timestamp)) { + $timestamp = Carbon::createFromTimestamp($timestamp, date_default_timezone_get()); + } + + return new static(Carbon::now()->diff($timestamp)); + } + + /** + * Sleep for the given number of microseconds. + * + * @param int $duration + * @return static + */ + public static function usleep($duration) + { + return (new static($duration))->microseconds(); + } + + /** + * Sleep for the given number of seconds. + * + * @param int|float $duration + * @return static + */ + public static function sleep($duration) + { + return (new static($duration))->seconds(); + } + + /** + * Sleep for the given duration. Replaces any previously defined duration. + * + * @param \DateInterval|int|float $duration + * @return $this + */ + protected function duration($duration) + { + if (! $duration instanceof DateInterval) { + $this->duration = CarbonInterval::microsecond(0); + + $this->pending = $duration; + } else { + $duration = CarbonInterval::instance($duration); + + if ($duration->totalMicroseconds < 0) { + $duration = CarbonInterval::seconds(0); + } + + $this->duration = $duration; + $this->pending = null; + } + + return $this; + } + + /** + * Sleep for the given number of minutes. + * + * @return $this + */ + public function minutes() + { + $this->duration->add('minutes', $this->pullPending()); + + return $this; + } + + /** + * Sleep for one minute. + * + * @return $this + */ + public function minute() + { + return $this->minutes(); + } + + /** + * Sleep for the given number of seconds. + * + * @return $this + */ + public function seconds() + { + $this->duration->add('seconds', $this->pullPending()); + + return $this; + } + + /** + * Sleep for one second. + * + * @return $this + */ + public function second() + { + return $this->seconds(); + } + + /** + * Sleep for the given number of milliseconds. + * + * @return $this + */ + public function milliseconds() + { + $this->duration->add('milliseconds', $this->pullPending()); + + return $this; + } + + /** + * Sleep for one millisecond. + * + * @return $this + */ + public function millisecond() + { + return $this->milliseconds(); + } + + /** + * Sleep for the given number of microseconds. + * + * @return $this + */ + public function microseconds() + { + $this->duration->add('microseconds', $this->pullPending()); + + return $this; + } + + /** + * Sleep for on microsecond. + * + * @return $this + */ + public function microsecond() + { + return $this->microseconds(); + } + + /** + * Add additional time to sleep for. + * + * @param int|float $duration + * @return $this + */ + public function and($duration) + { + $this->pending = $duration; + + return $this; + } + + /** + * Sleep while a given callback returns "true". + * + * @param \Closure $callback + * @return $this + */ + public function while(Closure $callback) + { + $this->while = $callback; + + return $this; + } + + /** + * Specify a callback that should be executed after sleeping. + * + * @param callable $then + * @return mixed + */ + public function then(callable $then) + { + $this->goodnight(); + + $this->alreadySlept = true; + + return $then(); + } + + /** + * Handle the object's destruction. + * + * @return void + */ + public function __destruct() + { + $this->goodnight(); + } + + /** + * Handle the object's destruction. + * + * @return void + */ + protected function goodnight() + { + if ($this->alreadySlept || ! $this->shouldSleep) { + return; + } + + if ($this->pending !== null) { + throw new RuntimeException('Unknown duration unit.'); + } + + if (static::$fake) { + static::$sequence[] = $this->duration; + + if (static::$syncWithCarbon) { + Carbon::setTestNow(Carbon::now()->add($this->duration)); + } + + foreach (static::$fakeSleepCallbacks as $callback) { + $callback($this->duration); + } + + return; + } + + $remaining = $this->duration->copy(); + + $seconds = (int) $remaining->totalSeconds; + + $while = $this->while ?: function () { + static $return = [true, false]; + + return array_shift($return); + }; + + while ($while()) { + if ($seconds > 0) { + sleep($seconds); + + $remaining = $remaining->subSeconds($seconds); + } + + $microseconds = (int) $remaining->totalMicroseconds; + + if ($microseconds > 0) { + usleep($microseconds); + } + } + } + + /** + * Resolve the pending duration. + * + * @return int|float + */ + protected function pullPending() + { + if ($this->pending === null) { + $this->shouldNotSleep(); + + throw new RuntimeException('No duration specified.'); + } + + if ($this->pending < 0) { + $this->pending = 0; + } + + return tap($this->pending, function () { + $this->pending = null; + }); + } + + /** + * Stay awake and capture any attempts to sleep. + * + * @param bool $value + * @param bool $syncWithCarbon + * @return void + */ + public static function fake($value = true, $syncWithCarbon = false) + { + static::$fake = $value; + + static::$sequence = []; + static::$fakeSleepCallbacks = []; + static::$syncWithCarbon = $syncWithCarbon; + } + + /** + * Assert a given amount of sleeping occurred a specific number of times. + * + * @param \Closure $expected + * @param int $times + * @return void + */ + public static function assertSlept($expected, $times = 1) + { + $count = (new Collection(static::$sequence))->filter($expected)->count(); + + PHPUnit::assertSame( + $times, + $count, + "The expected sleep was found [{$count}] times instead of [{$times}]." + ); + } + + /** + * Assert sleeping occurred a given number of times. + * + * @param int $expected + * @return void + */ + public static function assertSleptTimes($expected) + { + PHPUnit::assertSame($expected, $count = count(static::$sequence), "Expected [{$expected}] sleeps but found [{$count}]."); + } + + /** + * Assert the given sleep sequence was encountered. + * + * @param array $sequence + * @return void + */ + public static function assertSequence($sequence) + { + try { + static::assertSleptTimes(count($sequence)); + + (new Collection($sequence)) + ->zip(static::$sequence) + ->eachSpread(function (?Sleep $expected, CarbonInterval $actual) { + if ($expected === null) { + return; + } + + PHPUnit::assertTrue( + $expected->shouldNotSleep()->duration->equalTo($actual), + vsprintf('Expected sleep duration of [%s] but actually slept for [%s].', [ + $expected->duration->cascade()->forHumans([ + 'options' => 0, + 'minimumUnit' => 'microsecond', + ]), + $actual->cascade()->forHumans([ + 'options' => 0, + 'minimumUnit' => 'microsecond', + ]), + ]) + ); + }); + } finally { + foreach ($sequence as $expected) { + if ($expected instanceof self) { + $expected->shouldNotSleep(); + } + } + } + } + + /** + * Assert that no sleeping occurred. + * + * @return void + */ + public static function assertNeverSlept() + { + static::assertSleptTimes(0); + } + + /** + * Assert that no sleeping occurred. + * + * @return void + */ + public static function assertInsomniac() + { + if (static::$sequence === []) { + PHPUnit::assertTrue(true); + } + + foreach (static::$sequence as $duration) { + PHPUnit::assertSame(0, (int) $duration->totalMicroseconds, vsprintf('Unexpected sleep duration of [%s] found.', [ + $duration->cascade()->forHumans([ + 'options' => 0, + 'minimumUnit' => 'microsecond', + ]), + ])); + } + } + + /** + * Indicate that the instance should not sleep. + * + * @return $this + */ + protected function shouldNotSleep() + { + $this->shouldSleep = false; + + return $this; + } + + /** + * Only sleep when the given condition is true. + * + * @param (\Closure($this): bool)|bool $condition + * @return $this + */ + public function when($condition) + { + $this->shouldSleep = (bool) value($condition, $this); + + return $this; + } + + /** + * Don't sleep when the given condition is true. + * + * @param (\Closure($this): bool)|bool $condition + * @return $this + */ + public function unless($condition) + { + return $this->when(! value($condition, $this)); + } + + /** + * Specify a callback that should be invoked when faking sleep within a test. + * + * @param callable $callback + * @return void + */ + public static function whenFakingSleep($callback) + { + static::$fakeSleepCallbacks[] = $callback; + } + + /** + * Indicate that Carbon's "now" should be kept in sync when sleeping. + * + * @return void + */ + public static function syncWithCarbon($value = true) + { + static::$syncWithCarbon = $value; + } +} diff --git a/plugins/vendor/illuminate/support/Str.php b/plugins/vendor/illuminate/support/Str.php new file mode 100644 index 00000000..6fd6b7f7 --- /dev/null +++ b/plugins/vendor/illuminate/support/Str.php @@ -0,0 +1,2091 @@ + $length - 1) { + return false; + } + + return mb_substr($subject, $index, 1); + } + + /** + * Remove the given string(s) if it exists at the start of the haystack. + * + * @param string $subject + * @param string|array $needle + * @return string + */ + public static function chopStart($subject, $needle) + { + foreach ((array) $needle as $n) { + if (str_starts_with($subject, $n)) { + return substr($subject, strlen($n)); + } + } + + return $subject; + } + + /** + * Remove the given string(s) if it exists at the end of the haystack. + * + * @param string $subject + * @param string|array $needle + * @return string + */ + public static function chopEnd($subject, $needle) + { + foreach ((array) $needle as $n) { + if (str_ends_with($subject, $n)) { + return substr($subject, 0, -strlen($n)); + } + } + + return $subject; + } + + /** + * Determine if a given string contains a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @param bool $ignoreCase + * @return bool + */ + public static function contains($haystack, $needles, $ignoreCase = false) + { + if (is_null($haystack)) { + return false; + } + + if ($ignoreCase) { + $haystack = mb_strtolower($haystack); + } + + if (! is_iterable($needles)) { + $needles = (array) $needles; + } + + foreach ($needles as $needle) { + if ($ignoreCase) { + $needle = mb_strtolower($needle); + } + + if ($needle !== '' && str_contains($haystack, $needle)) { + return true; + } + } + + return false; + } + + /** + * Determine if a given string contains all array values. + * + * @param string $haystack + * @param iterable $needles + * @param bool $ignoreCase + * @return bool + */ + public static function containsAll($haystack, $needles, $ignoreCase = false) + { + foreach ($needles as $needle) { + if (! static::contains($haystack, $needle, $ignoreCase)) { + return false; + } + } + + return true; + } + + /** + * Determine if a given string doesn't contain a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @param bool $ignoreCase + * @return bool + */ + public static function doesntContain($haystack, $needles, $ignoreCase = false) + { + return ! static::contains($haystack, $needles, $ignoreCase); + } + + /** + * Convert the case of a string. + * + * @param string $string + * @param int $mode + * @param string|null $encoding + * @return string + */ + public static function convertCase(string $string, int $mode = MB_CASE_FOLD, ?string $encoding = 'UTF-8') + { + return mb_convert_case($string, $mode, $encoding); + } + + /** + * Replace consecutive instances of a given character with a single character in the given string. + * + * @param string $string + * @param array|string $characters + * @return string + */ + public static function deduplicate(string $string, array|string $characters = ' ') + { + if (is_string($characters)) { + return preg_replace('/'.preg_quote($characters, '/').'+/u', $characters, $string); + } + + return array_reduce( + $characters, + fn ($carry, $character) => preg_replace('/'.preg_quote($character, '/').'+/u', $character, $carry), + $string + ); + } + + /** + * Determine if a given string ends with a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @return bool + */ + public static function endsWith($haystack, $needles) + { + if (is_null($haystack)) { + return false; + } + + if (! is_iterable($needles)) { + $needles = (array) $needles; + } + + foreach ($needles as $needle) { + if ((string) $needle !== '' && str_ends_with($haystack, $needle)) { + return true; + } + } + + return false; + } + + /** + * Determine if a given string doesn't end with a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @return bool + */ + public static function doesntEndWith($haystack, $needles) + { + return ! static::endsWith($haystack, $needles); + } + + /** + * Extracts an excerpt from text that matches the first instance of a phrase. + * + * @param string $text + * @param string $phrase + * @param array $options + * @return string|null + */ + public static function excerpt($text, $phrase = '', $options = []) + { + $radius = $options['radius'] ?? 100; + $omission = $options['omission'] ?? '...'; + + preg_match('/^(.*?)('.preg_quote((string) $phrase, '/').')(.*)$/iu', (string) $text, $matches); + + if (empty($matches)) { + return null; + } + + $start = ltrim($matches[1]); + + $start = Str::of(mb_substr($start, max(mb_strlen($start, 'UTF-8') - $radius, 0), $radius, 'UTF-8'))->ltrim()->unless( + fn ($startWithRadius) => $startWithRadius->exactly($start), + fn ($startWithRadius) => $startWithRadius->prepend($omission), + ); + + $end = rtrim($matches[3]); + + $end = Str::of(mb_substr($end, 0, $radius, 'UTF-8'))->rtrim()->unless( + fn ($endWithRadius) => $endWithRadius->exactly($end), + fn ($endWithRadius) => $endWithRadius->append($omission), + ); + + return $start->append($matches[2], $end)->toString(); + } + + /** + * Cap a string with a single instance of a given value. + * + * @param string $value + * @param string $cap + * @return string + */ + public static function finish($value, $cap) + { + $quoted = preg_quote($cap, '/'); + + return preg_replace('/(?:'.$quoted.')+$/u', '', $value).$cap; + } + + /** + * Wrap the string with the given strings. + * + * @param string $value + * @param string $before + * @param string|null $after + * @return string + */ + public static function wrap($value, $before, $after = null) + { + return $before.$value.($after ?? $before); + } + + /** + * Unwrap the string with the given strings. + * + * @param string $value + * @param string $before + * @param string|null $after + * @return string + */ + public static function unwrap($value, $before, $after = null) + { + if (static::startsWith($value, $before)) { + $value = static::substr($value, static::length($before)); + } + + if (static::endsWith($value, $after ??= $before)) { + $value = static::substr($value, 0, -static::length($after)); + } + + return $value; + } + + /** + * Determine if a given string matches a given pattern. + * + * @param string|iterable $pattern + * @param string $value + * @param bool $ignoreCase + * @return bool + */ + public static function is($pattern, $value, $ignoreCase = false) + { + $value = (string) $value; + + if (! is_iterable($pattern)) { + $pattern = [$pattern]; + } + + foreach ($pattern as $pattern) { + $pattern = (string) $pattern; + + // If the given value is an exact match we can of course return true right + // from the beginning. Otherwise, we will translate asterisks and do an + // actual pattern match against the two strings to see if they match. + if ($pattern === '*' || $pattern === $value) { + return true; + } + + if ($ignoreCase && mb_strtolower($pattern) === mb_strtolower($value)) { + return true; + } + + $pattern = preg_quote($pattern, '#'); + + // Asterisks are translated into zero-or-more regular expression wildcards + // to make it convenient to check if the strings starts with the given + // pattern such as "library/*", making any string check convenient. + $pattern = str_replace('\*', '.*', $pattern); + + if (preg_match('#^'.$pattern.'\z#'.($ignoreCase ? 'isu' : 'su'), $value) === 1) { + return true; + } + } + + return false; + } + + /** + * Determine if a given string is 7 bit ASCII. + * + * @param string $value + * @return bool + */ + public static function isAscii($value) + { + return ASCII::is_ascii((string) $value); + } + + /** + * Determine if a given value is valid JSON. + * + * @param mixed $value + * @return bool + */ + public static function isJson($value) + { + if (! is_string($value)) { + return false; + } + + return json_validate($value, 512); + } + + /** + * Determine if a given value is a valid URL. + * + * @param mixed $value + * @param array $protocols + * @return bool + */ + public static function isUrl($value, array $protocols = []) + { + if (! is_string($value)) { + return false; + } + + $protocolList = empty($protocols) + ? 'aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap\+tcp|coap\+ws|coaps|coaps\+tcp|coaps\+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris\.beep|iris\.lwz|iris\.xpc|iris\.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap\.beep|soap\.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc\.beep|xmlrpc\.beeps|xmpp|xri|ymsgr|z39\.50|z39\.50r|z39\.50s' + : implode('|', $protocols); + + /* + * This pattern is derived from Symfony\Component\Validator\Constraints\UrlValidator (5.0.7). + * + * (c) Fabien Potencier http://symfony.com + */ + $pattern = '~^ + (LARAVEL_PROTOCOLS):// # protocol + (((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+:)?((?:[\_\.\pL\pN-]|%[0-9A-Fa-f]{2})+)@)? # basic auth + ( + ([\pL\pN\pS\-\_\.])+(\.?([\pL\pN]|xn\-\-[\pL\pN-]+)+\.?) # a domain name + | # or + \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} # an IP address + | # or + \[ + (?:(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){6})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:::(?:(?:(?:[0-9a-f]{1,4})):){5})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){4})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,1}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){3})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,2}(?:(?:[0-9a-f]{1,4})))?::(?:(?:(?:[0-9a-f]{1,4})):){2})(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,3}(?:(?:[0-9a-f]{1,4})))?::(?:(?:[0-9a-f]{1,4})):)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,4}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:(?:(?:(?:[0-9a-f]{1,4})):(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9]))\.){3}(?:(?:25[0-5]|(?:[1-9]|1[0-9]|2[0-4])?[0-9])))))))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,5}(?:(?:[0-9a-f]{1,4})))?::)(?:(?:[0-9a-f]{1,4})))|(?:(?:(?:(?:(?:(?:[0-9a-f]{1,4})):){0,6}(?:(?:[0-9a-f]{1,4})))?::)))) + \] # an IPv6 address + ) + (:[0-9]+)? # a port (optional) + (?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%[0-9A-Fa-f]{2})* )* # a path + (?:\? (?:[\pL\pN\-._\~!$&\'\[\]()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a query (optional) + (?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )? # a fragment (optional) + $~ixu'; + + return preg_match(str_replace('LARAVEL_PROTOCOLS', $protocolList, $pattern), $value) > 0; + } + + /** + * Determine if a given value is a valid UUID. + * + * @param mixed $value + * @param int<0, 8>|'nil'|'max'|null $version + * @return bool + */ + public static function isUuid($value, $version = null) + { + if (! is_string($value)) { + return false; + } + + if ($version === null) { + return preg_match('/^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/D', $value) > 0; + } + + $factory = new UuidFactory; + + try { + $factoryUuid = $factory->fromString($value); + } catch (InvalidUuidStringException) { + return false; + } + + $fields = $factoryUuid->getFields(); + + if (! ($fields instanceof FieldsInterface)) { + return false; + } + + if ($version === 0 || $version === 'nil') { + return $fields->isNil(); + } + + if ($version === 'max') { + return $fields->isMax(); + } + + return $fields->getVersion() === $version; + } + + /** + * Determine if a given value is a valid ULID. + * + * @param mixed $value + * @return bool + */ + public static function isUlid($value) + { + if (! is_string($value)) { + return false; + } + + return Ulid::isValid($value); + } + + /** + * Convert a string to kebab case. + * + * @param string $value + * @return string + */ + public static function kebab($value) + { + return static::snake($value, '-'); + } + + /** + * Return the length of the given string. + * + * @param string $value + * @param string|null $encoding + * @return int + */ + public static function length($value, $encoding = null) + { + return mb_strlen($value, $encoding); + } + + /** + * Limit the number of characters in a string. + * + * @param string $value + * @param int $limit + * @param string $end + * @param bool $preserveWords + * @return string + */ + public static function limit($value, $limit = 100, $end = '...', $preserveWords = false) + { + if (mb_strwidth($value, 'UTF-8') <= $limit) { + return $value; + } + + if (! $preserveWords) { + return rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')).$end; + } + + $value = trim(preg_replace('/[\n\r]+/', ' ', strip_tags($value))); + + $trimmed = rtrim(mb_strimwidth($value, 0, $limit, '', 'UTF-8')); + + if (mb_substr($value, $limit, 1, 'UTF-8') === ' ') { + return $trimmed.$end; + } + + return preg_replace("/(.*)\s.*/", '$1', $trimmed).$end; + } + + /** + * Convert the given string to lower-case. + * + * @param string $value + * @return string + */ + public static function lower($value) + { + return mb_strtolower($value, 'UTF-8'); + } + + /** + * Limit the number of words in a string. + * + * @param string $value + * @param int $words + * @param string $end + * @return string + */ + public static function words($value, $words = 100, $end = '...') + { + preg_match('/^\s*+(?:\S++\s*+){1,'.$words.'}/u', $value, $matches); + + if (! isset($matches[0]) || static::length($value) === static::length($matches[0])) { + return $value; + } + + return rtrim($matches[0]).$end; + } + + /** + * Converts GitHub flavored Markdown into HTML. + * + * @param string $string + * @param array $options + * @param array $extensions + * @return string + */ + public static function markdown($string, array $options = [], array $extensions = []) + { + $converter = new GithubFlavoredMarkdownConverter($options); + + $environment = $converter->getEnvironment(); + + foreach ($extensions as $extension) { + $environment->addExtension($extension); + } + + return (string) $converter->convert($string); + } + + /** + * Converts inline Markdown into HTML. + * + * @param string $string + * @param array $options + * @param array $extensions + * @return string + */ + public static function inlineMarkdown($string, array $options = [], array $extensions = []) + { + $environment = new Environment($options); + + $environment->addExtension(new GithubFlavoredMarkdownExtension()); + $environment->addExtension(new InlinesOnlyExtension()); + + foreach ($extensions as $extension) { + $environment->addExtension($extension); + } + + $converter = new MarkdownConverter($environment); + + return (string) $converter->convert($string); + } + + /** + * Masks a portion of a string with a repeated character. + * + * @param string $string + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return string + */ + public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8') + { + if ($character === '') { + return $string; + } + + $segment = mb_substr($string, $index, $length, $encoding); + + if ($segment === '') { + return $string; + } + + $strlen = mb_strlen($string, $encoding); + $startIndex = $index; + + if ($index < 0) { + $startIndex = $index < -$strlen ? 0 : $strlen + $index; + } + + $start = mb_substr($string, 0, $startIndex, $encoding); + $segmentLen = mb_strlen($segment, $encoding); + $end = mb_substr($string, $startIndex + $segmentLen); + + return $start.str_repeat(mb_substr($character, 0, 1, $encoding), $segmentLen).$end; + } + + /** + * Get the string matching the given pattern. + * + * @param string $pattern + * @param string $subject + * @return string + */ + public static function match($pattern, $subject) + { + preg_match($pattern, $subject, $matches); + + if (! $matches) { + return ''; + } + + return $matches[1] ?? $matches[0]; + } + + /** + * Determine if a given string matches a given pattern. + * + * @param string|iterable $pattern + * @param string $value + * @return bool + */ + public static function isMatch($pattern, $value) + { + $value = (string) $value; + + if (! is_iterable($pattern)) { + $pattern = [$pattern]; + } + + foreach ($pattern as $pattern) { + $pattern = (string) $pattern; + + if (preg_match($pattern, $value) === 1) { + return true; + } + } + + return false; + } + + /** + * Get the string matching the given pattern. + * + * @param string $pattern + * @param string $subject + * @return \Illuminate\Support\Collection + */ + public static function matchAll($pattern, $subject) + { + preg_match_all($pattern, $subject, $matches); + + if (empty($matches[0])) { + return new Collection; + } + + return new Collection($matches[1] ?? $matches[0]); + } + + /** + * Remove all non-numeric characters from a string. + * + * @param string $value + * @return string + */ + public static function numbers($value) + { + return preg_replace('/[^0-9]/', '', $value); + } + + /** + * Pad both sides of a string with another. + * + * @param string $value + * @param int $length + * @param string $pad + * @return string + */ + public static function padBoth($value, $length, $pad = ' ') + { + return mb_str_pad($value, $length, $pad, STR_PAD_BOTH); + } + + /** + * Pad the left side of a string with another. + * + * @param string $value + * @param int $length + * @param string $pad + * @return string + */ + public static function padLeft($value, $length, $pad = ' ') + { + return mb_str_pad($value, $length, $pad, STR_PAD_LEFT); + } + + /** + * Pad the right side of a string with another. + * + * @param string $value + * @param int $length + * @param string $pad + * @return string + */ + public static function padRight($value, $length, $pad = ' ') + { + return mb_str_pad($value, $length, $pad, STR_PAD_RIGHT); + } + + /** + * Parse a Class[@]method style callback into class and method. + * + * @param string $callback + * @param string|null $default + * @return array + */ + public static function parseCallback($callback, $default = null) + { + if (static::contains($callback, "@anonymous\0")) { + if (static::substrCount($callback, '@') > 1) { + return [ + static::beforeLast($callback, '@'), + static::afterLast($callback, '@'), + ]; + } + + return [$callback, $default]; + } + + return static::contains($callback, '@') ? explode('@', $callback, 2) : [$callback, $default]; + } + + /** + * Get the plural form of an English word. + * + * @param string $value + * @param int|array|\Countable $count + * @param bool $prependCount + * @return string + */ + public static function plural($value, $count = 2, $prependCount = false) + { + return ($prependCount ? Number::format($count).' ' : '').Pluralizer::plural($value, $count); + } + + /** + * Pluralize the last word of an English, studly caps case string. + * + * @param string $value + * @param int|array|\Countable $count + * @return string + */ + public static function pluralStudly($value, $count = 2) + { + $parts = preg_split('/(.)(?=[A-Z])/u', $value, -1, PREG_SPLIT_DELIM_CAPTURE); + + $lastWord = array_pop($parts); + + return implode('', $parts).self::plural($lastWord, $count); + } + + /** + * Pluralize the last word of an English, Pascal caps case string. + * + * @param string $value + * @param int|array|\Countable $count + * @return string + */ + public static function pluralPascal($value, $count = 2) + { + return static::pluralStudly($value, $count); + } + + /** + * Generate a random, secure password. + * + * @param int $length + * @param bool $letters + * @param bool $numbers + * @param bool $symbols + * @param bool $spaces + * @return string + */ + public static function password($length = 32, $letters = true, $numbers = true, $symbols = true, $spaces = false) + { + $password = new Collection(); + + $options = (new Collection([ + 'letters' => $letters === true ? [ + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', + 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + ] : null, + 'numbers' => $numbers === true ? [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + ] : null, + 'symbols' => $symbols === true ? [ + '~', '!', '#', '$', '%', '^', '&', '*', '(', ')', '-', + '_', '.', ',', '<', '>', '?', '/', '\\', '{', '}', '[', + ']', '|', ':', ';', + ] : null, + 'spaces' => $spaces === true ? [' '] : null, + ])) + ->filter() + ->each(fn ($c) => $password->push($c[random_int(0, count($c) - 1)])) + ->flatten(); + + $length = $length - $password->count(); + + return $password->merge($options->pipe( + fn ($c) => Collection::times($length, fn () => $c[random_int(0, $c->count() - 1)]) + ))->shuffle()->implode(''); + } + + /** + * Find the multi-byte safe position of the first occurrence of a given substring in a string. + * + * @param string $haystack + * @param string $needle + * @param int $offset + * @param string|null $encoding + * @return int|false + */ + public static function position($haystack, $needle, $offset = 0, $encoding = null) + { + return mb_strpos($haystack, (string) $needle, $offset, $encoding); + } + + /** + * Generate a more truly "random" alpha-numeric string. + * + * @param int $length + * @return string + */ + public static function random($length = 16) + { + return (static::$randomStringFactory ?? function ($length) { + $string = ''; + + while (($len = strlen($string)) < $length) { + $size = $length - $len; + + $bytesSize = (int) ceil($size / 3) * 3; + + $bytes = random_bytes($bytesSize); + + $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size); + } + + return $string; + })($length); + } + + /** + * Set the callable that will be used to generate random strings. + * + * @param callable|null $factory + * @return void + */ + public static function createRandomStringsUsing(?callable $factory = null) + { + static::$randomStringFactory = $factory; + } + + /** + * Set the sequence that will be used to generate random strings. + * + * @param array $sequence + * @param callable|null $whenMissing + * @return void + */ + public static function createRandomStringsUsingSequence(array $sequence, $whenMissing = null) + { + $next = 0; + + $whenMissing ??= function ($length) use (&$next) { + $factoryCache = static::$randomStringFactory; + + static::$randomStringFactory = null; + + $randomString = static::random($length); + + static::$randomStringFactory = $factoryCache; + + $next++; + + return $randomString; + }; + + static::createRandomStringsUsing(function ($length) use (&$next, $sequence, $whenMissing) { + if (array_key_exists($next, $sequence)) { + return $sequence[$next++]; + } + + return $whenMissing($length); + }); + } + + /** + * Indicate that random strings should be created normally and not using a custom factory. + * + * @return void + */ + public static function createRandomStringsNormally() + { + static::$randomStringFactory = null; + } + + /** + * Repeat the given string. + * + * @param string $string + * @param int $times + * @return string + */ + public static function repeat(string $string, int $times) + { + return str_repeat($string, $times); + } + + /** + * Replace a given value in the string sequentially with an array. + * + * @param string $search + * @param iterable $replace + * @param string $subject + * @return string + */ + public static function replaceArray($search, $replace, $subject) + { + if ($replace instanceof Traversable) { + $replace = Arr::from($replace); + } + + $segments = explode($search, $subject); + + $result = array_shift($segments); + + foreach ($segments as $segment) { + $result .= self::toStringOr(array_shift($replace) ?? $search, $search).$segment; + } + + return $result; + } + + /** + * Convert the given value to a string or return the given fallback on failure. + * + * @param mixed $value + * @param string $fallback + * @return string + */ + private static function toStringOr($value, $fallback) + { + try { + return (string) $value; + } catch (Throwable $e) { + return $fallback; + } + } + + /** + * Replace the given value in the given string. + * + * @param string|iterable $search + * @param string|iterable $replace + * @param string|iterable $subject + * @param bool $caseSensitive + * @return string|string[] + */ + public static function replace($search, $replace, $subject, $caseSensitive = true) + { + if ($search instanceof Traversable) { + $search = Arr::from($search); + } + + if ($replace instanceof Traversable) { + $replace = Arr::from($replace); + } + + if ($subject instanceof Traversable) { + $subject = Arr::from($subject); + } + + return $caseSensitive + ? str_replace($search, $replace, $subject) + : str_ireplace($search, $replace, $subject); + } + + /** + * Replace the first occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceFirst($search, $replace, $subject) + { + $search = (string) $search; + + if ($search === '') { + return $subject; + } + + $position = strpos($subject, $search); + + if ($position !== false) { + return substr_replace($subject, $replace, $position, strlen($search)); + } + + return $subject; + } + + /** + * Replace the first occurrence of the given value if it appears at the start of the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceStart($search, $replace, $subject) + { + $search = (string) $search; + + if ($search === '') { + return $subject; + } + + if (static::startsWith($subject, $search)) { + return static::replaceFirst($search, $replace, $subject); + } + + return $subject; + } + + /** + * Replace the last occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceLast($search, $replace, $subject) + { + $search = (string) $search; + + if ($search === '') { + return $subject; + } + + $position = strrpos($subject, $search); + + if ($position !== false) { + return substr_replace($subject, $replace, $position, strlen($search)); + } + + return $subject; + } + + /** + * Replace the last occurrence of a given value if it appears at the end of the string. + * + * @param string $search + * @param string $replace + * @param string $subject + * @return string + */ + public static function replaceEnd($search, $replace, $subject) + { + $search = (string) $search; + + if ($search === '') { + return $subject; + } + + if (static::endsWith($subject, $search)) { + return static::replaceLast($search, $replace, $subject); + } + + return $subject; + } + + /** + * Replace the patterns matching the given regular expression. + * + * @param array|string $pattern + * @param \Closure|string[]|string $replace + * @param array|string $subject + * @param int $limit + * @return string|string[]|null + */ + public static function replaceMatches($pattern, $replace, $subject, $limit = -1) + { + if ($replace instanceof Closure) { + return preg_replace_callback($pattern, $replace, $subject, $limit); + } + + return preg_replace($pattern, $replace, $subject, $limit); + } + + /** + * Remove any occurrence of the given string in the subject. + * + * @param string|iterable $search + * @param string|iterable $subject + * @param bool $caseSensitive + * @return string + */ + public static function remove($search, $subject, $caseSensitive = true) + { + if ($search instanceof Traversable) { + $search = Arr::from($search); + } + + return $caseSensitive + ? str_replace($search, '', $subject) + : str_ireplace($search, '', $subject); + } + + /** + * Reverse the given string. + * + * @param string $value + * @return string + */ + public static function reverse(string $value) + { + return implode(array_reverse(mb_str_split($value))); + } + + /** + * Begin a string with a single instance of a given value. + * + * @param string $value + * @param string $prefix + * @return string + */ + public static function start($value, $prefix) + { + $quoted = preg_quote($prefix, '/'); + + return $prefix.preg_replace('/^(?:'.$quoted.')+/u', '', $value); + } + + /** + * Convert the given string to upper-case. + * + * @param string $value + * @return string + */ + public static function upper($value) + { + return mb_strtoupper($value, 'UTF-8'); + } + + /** + * Convert the given string to proper case. + * + * @param string $value + * @return string + */ + public static function title($value) + { + return mb_convert_case($value, MB_CASE_TITLE, 'UTF-8'); + } + + /** + * Convert the given string to proper case for each word. + * + * @param string $value + * @return string + */ + public static function headline($value) + { + $parts = mb_split('\s+', $value); + + $parts = count($parts) > 1 + ? array_map(static::title(...), $parts) + : array_map(static::title(...), static::ucsplit(implode('_', $parts))); + + $collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts)); + + return implode(' ', array_filter(explode('_', $collapsed))); + } + + /** + * Convert the given string to APA-style title case. + * + * See: https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case + * + * @param string $value + * @return string + */ + public static function apa($value) + { + if (trim($value) === '') { + return $value; + } + + $minorWords = [ + 'and', 'as', 'but', 'for', 'if', 'nor', 'or', 'so', 'yet', 'a', 'an', + 'the', 'at', 'by', 'for', 'in', 'of', 'off', 'on', 'per', 'to', 'up', 'via', + 'et', 'ou', 'un', 'une', 'la', 'le', 'les', 'de', 'du', 'des', 'par', 'à', + ]; + + $endPunctuation = ['.', '!', '?', ':', '—', ',']; + + $words = mb_split('\s+', $value); + $wordCount = count($words); + + for ($i = 0; $i < $wordCount; $i++) { + $lowercaseWord = mb_strtolower($words[$i]); + + if (str_contains($lowercaseWord, '-')) { + $hyphenatedWords = explode('-', $lowercaseWord); + + $hyphenatedWords = array_map(function ($part) use ($minorWords) { + return (in_array($part, $minorWords) && mb_strlen($part) <= 3) + ? $part + : mb_strtoupper(mb_substr($part, 0, 1)).mb_substr($part, 1); + }, $hyphenatedWords); + + $words[$i] = implode('-', $hyphenatedWords); + } else { + if (in_array($lowercaseWord, $minorWords) && + mb_strlen($lowercaseWord) <= 3 && + ! ($i === 0 || in_array(mb_substr($words[$i - 1], -1), $endPunctuation))) { + $words[$i] = $lowercaseWord; + } else { + $words[$i] = mb_strtoupper(mb_substr($lowercaseWord, 0, 1)).mb_substr($lowercaseWord, 1); + } + } + } + + return implode(' ', $words); + } + + /** + * Get the singular form of an English word. + * + * @param string $value + * @return string + */ + public static function singular($value) + { + return Pluralizer::singular($value); + } + + /** + * Generate a URL friendly "slug" from a given string. + * + * @param string $title + * @param string $separator + * @param string|null $language + * @param array $dictionary + * @return string + */ + public static function slug($title, $separator = '-', $language = 'en', $dictionary = ['@' => 'at']) + { + $title = $language ? static::ascii($title, $language) : $title; + + // Convert all dashes/underscores into separator + $flip = $separator === '-' ? '_' : '-'; + + $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); + + // Replace dictionary words + foreach ($dictionary as $key => $value) { + $dictionary[$key] = $separator.$value.$separator; + } + + $title = str_replace(array_keys($dictionary), array_values($dictionary), $title); + + // Remove all characters that are not the separator, letters, numbers, or whitespace + $title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title)); + + // Replace all separator characters and whitespace by a single separator + $title = preg_replace('!['.preg_quote($separator).'\s]+!u', $separator, $title); + + return trim($title, $separator); + } + + /** + * Convert a string to snake case. + * + * @param string $value + * @param string $delimiter + * @return string + */ + public static function snake($value, $delimiter = '_') + { + $key = $value; + + if (isset(static::$snakeCache[$key][$delimiter])) { + return static::$snakeCache[$key][$delimiter]; + } + + if (! ctype_lower($value)) { + $value = preg_replace('/\s+/u', '', ucwords($value)); + + $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value)); + } + + return static::$snakeCache[$key][$delimiter] = $value; + } + + /** + * Remove all whitespace from both ends of a string. + * + * @param string $value + * @param string|null $charlist + * @return string + */ + public static function trim($value, $charlist = null) + { + if ($charlist === null) { + $trimDefaultCharacters = " \n\r\t\v\0"; + + return preg_replace('~^[\s'.self::INVISIBLE_CHARACTERS.$trimDefaultCharacters.']+|[\s'.self::INVISIBLE_CHARACTERS.$trimDefaultCharacters.']+$~u', '', $value) ?? trim($value); + } + + return trim($value, $charlist); + } + + /** + * Remove all whitespace from the beginning of a string. + * + * @param string $value + * @param string|null $charlist + * @return string + */ + public static function ltrim($value, $charlist = null) + { + if ($charlist === null) { + $ltrimDefaultCharacters = " \n\r\t\v\0"; + + return preg_replace('~^[\s'.self::INVISIBLE_CHARACTERS.$ltrimDefaultCharacters.']+~u', '', $value) ?? ltrim($value); + } + + return ltrim($value, $charlist); + } + + /** + * Remove all whitespace from the end of a string. + * + * @param string $value + * @param string|null $charlist + * @return string + */ + public static function rtrim($value, $charlist = null) + { + if ($charlist === null) { + $rtrimDefaultCharacters = " \n\r\t\v\0"; + + return preg_replace('~[\s'.self::INVISIBLE_CHARACTERS.$rtrimDefaultCharacters.']+$~u', '', $value) ?? rtrim($value); + } + + return rtrim($value, $charlist); + } + + /** + * Remove all "extra" blank space from the given string. + * + * @param string $value + * @return string + */ + public static function squish($value) + { + return preg_replace('~(\s|\x{3164}|\x{1160})+~u', ' ', static::trim($value)); + } + + /** + * Determine if a given string starts with a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @return bool + */ + public static function startsWith($haystack, $needles) + { + if (is_null($haystack)) { + return false; + } + + if (! is_iterable($needles)) { + $needles = [$needles]; + } + + foreach ($needles as $needle) { + if ((string) $needle !== '' && str_starts_with($haystack, $needle)) { + return true; + } + } + + return false; + } + + /** + * Determine if a given string doesn't start with a given substring. + * + * @param string $haystack + * @param string|iterable $needles + * @return bool + */ + public static function doesntStartWith($haystack, $needles) + { + return ! static::startsWith($haystack, $needles); + } + + /** + * Convert a value to studly caps case. + * + * @param string $value + * @return string + */ + public static function studly($value) + { + $key = $value; + + if (isset(static::$studlyCache[$key])) { + return static::$studlyCache[$key]; + } + + $words = mb_split('\s+', static::replace(['-', '_'], ' ', $value)); + + $studlyWords = array_map(fn ($word) => static::ucfirst($word), $words); + + return static::$studlyCache[$key] = implode($studlyWords); + } + + /** + * Convert a value to Pascal case. + * + * @param string $value + * @return string + */ + public static function pascal($value) + { + return static::studly($value); + } + + /** + * Returns the portion of the string specified by the start and length parameters. + * + * @param string $string + * @param int $start + * @param int|null $length + * @param string $encoding + * @return string + */ + public static function substr($string, $start, $length = null, $encoding = 'UTF-8') + { + return mb_substr($string, $start, $length, $encoding); + } + + /** + * Returns the number of substring occurrences. + * + * @param string $haystack + * @param string $needle + * @param int $offset + * @param int|null $length + * @return int + */ + public static function substrCount($haystack, $needle, $offset = 0, $length = null) + { + if (! is_null($length)) { + return substr_count($haystack, $needle, $offset, $length); + } + + return substr_count($haystack, $needle, $offset); + } + + /** + * Replace text within a portion of a string. + * + * @param string|string[] $string + * @param string|string[] $replace + * @param int|int[] $offset + * @param int|int[]|null $length + * @return string|string[] + */ + public static function substrReplace($string, $replace, $offset = 0, $length = null) + { + if ($length === null) { + $length = strlen($string); + } + + return substr_replace($string, $replace, $offset, $length); + } + + /** + * Swap multiple keywords in a string with other keywords. + * + * @param array $map + * @param string $subject + * @return string + */ + public static function swap(array $map, $subject) + { + return strtr($subject, $map); + } + + /** + * Take the first or last {$limit} characters of a string. + * + * @param string $string + * @param int $limit + * @return string + */ + public static function take($string, int $limit): string + { + if ($limit < 0) { + return static::substr($string, $limit); + } + + return static::substr($string, 0, $limit); + } + + /** + * Convert the given string to Base64 encoding. + * + * @param string $string + * @return string + */ + public static function toBase64($string): string + { + return base64_encode($string); + } + + /** + * Decode the given Base64 encoded string. + * + * @param string $string + * @param bool $strict + * @return string|false + */ + public static function fromBase64($string, $strict = false) + { + return base64_decode($string, $strict); + } + + /** + * Make a string's first character lowercase. + * + * @param string $string + * @return string + */ + public static function lcfirst($string) + { + return static::lower(static::substr($string, 0, 1)).static::substr($string, 1); + } + + /** + * Make a string's first character uppercase. + * + * @param string $string + * @return string + */ + public static function ucfirst($string) + { + return static::upper(static::substr($string, 0, 1)).static::substr($string, 1); + } + + /** + * Split a string into pieces by uppercase characters. + * + * @param string $string + * @return string[] + */ + public static function ucsplit($string) + { + return preg_split('/(?=\p{Lu})/u', $string, -1, PREG_SPLIT_NO_EMPTY); + } + + /** + * Get the number of words a string contains. + * + * @param string $string + * @param string|null $characters + * @return int + */ + public static function wordCount($string, $characters = null) + { + return str_word_count($string, 0, $characters); + } + + /** + * Wrap a string to a given number of characters. + * + * @param string $string + * @param int $characters + * @param string $break + * @param bool $cutLongWords + * @return string + */ + public static function wordWrap($string, $characters = 75, $break = "\n", $cutLongWords = false) + { + return wordwrap($string, $characters, $break, $cutLongWords); + } + + /** + * Generate a UUID (version 4). + * + * @return \Ramsey\Uuid\UuidInterface + */ + public static function uuid() + { + return static::$uuidFactory + ? call_user_func(static::$uuidFactory) + : Uuid::uuid4(); + } + + /** + * Generate a UUID (version 7). + * + * @param \DateTimeInterface|null $time + * @return \Ramsey\Uuid\UuidInterface + */ + public static function uuid7($time = null) + { + return static::$uuidFactory + ? call_user_func(static::$uuidFactory) + : Uuid::uuid7($time); + } + + /** + * Generate a time-ordered UUID. + * + * @return \Ramsey\Uuid\UuidInterface + */ + public static function orderedUuid() + { + if (static::$uuidFactory) { + return call_user_func(static::$uuidFactory); + } + + $factory = new UuidFactory; + + $factory->setRandomGenerator(new CombGenerator( + $factory->getRandomGenerator(), + $factory->getNumberConverter() + )); + + $factory->setCodec(new TimestampFirstCombCodec( + $factory->getUuidBuilder() + )); + + return $factory->uuid4(); + } + + /** + * Set the callable that will be used to generate UUIDs. + * + * @param callable|null $factory + * @return void + */ + public static function createUuidsUsing(?callable $factory = null) + { + static::$uuidFactory = $factory; + } + + /** + * Set the sequence that will be used to generate UUIDs. + * + * @param array $sequence + * @param callable|null $whenMissing + * @return void + */ + public static function createUuidsUsingSequence(array $sequence, $whenMissing = null) + { + $next = 0; + + $whenMissing ??= function () use (&$next) { + $factoryCache = static::$uuidFactory; + + static::$uuidFactory = null; + + $uuid = static::uuid(); + + static::$uuidFactory = $factoryCache; + + $next++; + + return $uuid; + }; + + static::createUuidsUsing(function () use (&$next, $sequence, $whenMissing) { + if (array_key_exists($next, $sequence)) { + return $sequence[$next++]; + } + + return $whenMissing(); + }); + } + + /** + * Always return the same UUID when generating new UUIDs. + * + * @param \Closure|null $callback + * @return \Ramsey\Uuid\UuidInterface + */ + public static function freezeUuids(?Closure $callback = null) + { + $uuid = Str::uuid(); + + Str::createUuidsUsing(fn () => $uuid); + + if ($callback !== null) { + try { + $callback($uuid); + } finally { + Str::createUuidsNormally(); + } + } + + return $uuid; + } + + /** + * Indicate that UUIDs should be created normally and not using a custom factory. + * + * @return void + */ + public static function createUuidsNormally() + { + static::$uuidFactory = null; + } + + /** + * Generate a ULID. + * + * @param \DateTimeInterface|null $time + * @return \Symfony\Component\Uid\Ulid + */ + public static function ulid($time = null) + { + if (static::$ulidFactory) { + return call_user_func(static::$ulidFactory); + } + + if ($time === null) { + return new Ulid(); + } + + return new Ulid(Ulid::generate($time)); + } + + /** + * Indicate that ULIDs should be created normally and not using a custom factory. + * + * @return void + */ + public static function createUlidsNormally() + { + static::$ulidFactory = null; + } + + /** + * Set the callable that will be used to generate ULIDs. + * + * @param callable|null $factory + * @return void + */ + public static function createUlidsUsing(?callable $factory = null) + { + static::$ulidFactory = $factory; + } + + /** + * Set the sequence that will be used to generate ULIDs. + * + * @param array $sequence + * @param callable|null $whenMissing + * @return void + */ + public static function createUlidsUsingSequence(array $sequence, $whenMissing = null) + { + $next = 0; + + $whenMissing ??= function () use (&$next) { + $factoryCache = static::$ulidFactory; + + static::$ulidFactory = null; + + $ulid = static::ulid(); + + static::$ulidFactory = $factoryCache; + + $next++; + + return $ulid; + }; + + static::createUlidsUsing(function () use (&$next, $sequence, $whenMissing) { + if (array_key_exists($next, $sequence)) { + return $sequence[$next++]; + } + + return $whenMissing(); + }); + } + + /** + * Always return the same ULID when generating new ULIDs. + * + * @param Closure|null $callback + * @return Ulid + */ + public static function freezeUlids(?Closure $callback = null) + { + $ulid = Str::ulid(); + + Str::createUlidsUsing(fn () => $ulid); + + if ($callback !== null) { + try { + $callback($ulid); + } finally { + Str::createUlidsNormally(); + } + } + + return $ulid; + } + + /** + * Remove all strings from the casing caches. + * + * @return void + */ + public static function flushCache() + { + static::$snakeCache = []; + static::$camelCache = []; + static::$studlyCache = []; + } +} diff --git a/plugins/vendor/illuminate/support/Stringable.php b/plugins/vendor/illuminate/support/Stringable.php new file mode 100644 index 00000000..16d524eb --- /dev/null +++ b/plugins/vendor/illuminate/support/Stringable.php @@ -0,0 +1,1590 @@ +value = (string) $value; + } + + /** + * Return the remainder of a string after the first occurrence of a given value. + * + * @param string $search + * @return static + */ + public function after($search) + { + return new static(Str::after($this->value, $search)); + } + + /** + * Return the remainder of a string after the last occurrence of a given value. + * + * @param string $search + * @return static + */ + public function afterLast($search) + { + return new static(Str::afterLast($this->value, $search)); + } + + /** + * Append the given values to the string. + * + * @param array|string ...$values + * @return static + */ + public function append(...$values) + { + return new static($this->value.implode('', $values)); + } + + /** + * Append a new line to the string. + * + * @param int $count + * @return $this + */ + public function newLine($count = 1) + { + return $this->append(str_repeat(PHP_EOL, $count)); + } + + /** + * Transliterate a UTF-8 value to ASCII. + * + * @param string $language + * @return static + */ + public function ascii($language = 'en') + { + return new static(Str::ascii($this->value, $language)); + } + + /** + * Get the trailing name component of the path. + * + * @param string $suffix + * @return static + */ + public function basename($suffix = '') + { + return new static(basename($this->value, $suffix)); + } + + /** + * Get the character at the specified index. + * + * @param int $index + * @return string|false + */ + public function charAt($index) + { + return Str::charAt($this->value, $index); + } + + /** + * Remove the given string if it exists at the start of the current string. + * + * @param string|array $needle + * @return static + */ + public function chopStart($needle) + { + return new static(Str::chopStart($this->value, $needle)); + } + + /** + * Remove the given string if it exists at the end of the current string. + * + * @param string|array $needle + * @return static + */ + public function chopEnd($needle) + { + return new static(Str::chopEnd($this->value, $needle)); + } + + /** + * Get the basename of the class path. + * + * @return static + */ + public function classBasename() + { + return new static(class_basename($this->value)); + } + + /** + * Get the portion of a string before the first occurrence of a given value. + * + * @param string $search + * @return static + */ + public function before($search) + { + return new static(Str::before($this->value, $search)); + } + + /** + * Get the portion of a string before the last occurrence of a given value. + * + * @param string $search + * @return static + */ + public function beforeLast($search) + { + return new static(Str::beforeLast($this->value, $search)); + } + + /** + * Get the portion of a string between two given values. + * + * @param string $from + * @param string $to + * @return static + */ + public function between($from, $to) + { + return new static(Str::between($this->value, $from, $to)); + } + + /** + * Get the smallest possible portion of a string between two given values. + * + * @param string $from + * @param string $to + * @return static + */ + public function betweenFirst($from, $to) + { + return new static(Str::betweenFirst($this->value, $from, $to)); + } + + /** + * Convert a value to camel case. + * + * @return static + */ + public function camel() + { + return new static(Str::camel($this->value)); + } + + /** + * Determine if a given string contains a given substring. + * + * @param string|iterable $needles + * @param bool $ignoreCase + * @return bool + */ + public function contains($needles, $ignoreCase = false) + { + return Str::contains($this->value, $needles, $ignoreCase); + } + + /** + * Determine if a given string contains all array values. + * + * @param iterable $needles + * @param bool $ignoreCase + * @return bool + */ + public function containsAll($needles, $ignoreCase = false) + { + return Str::containsAll($this->value, $needles, $ignoreCase); + } + + /** + * Convert the case of a string. + * + * @param int $mode + * @param string|null $encoding + * @return static + */ + public function convertCase(int $mode = MB_CASE_FOLD, ?string $encoding = 'UTF-8') + { + return new static(Str::convertCase($this->value, $mode, $encoding)); + } + + /** + * Replace consecutive instances of a given character with a single character. + * + * @param string $character + * @return static + */ + public function deduplicate(string $character = ' ') + { + return new static(Str::deduplicate($this->value, $character)); + } + + /** + * Get the parent directory's path. + * + * @param int $levels + * @return static + */ + public function dirname($levels = 1) + { + return new static(dirname($this->value, $levels)); + } + + /** + * Determine if a given string ends with a given substring. + * + * @param string|iterable $needles + * @return bool + */ + public function endsWith($needles) + { + return Str::endsWith($this->value, $needles); + } + + /** + * Determine if a given string doesn't end with a given substring. + * + * @param string|iterable $needles + * @return bool + */ + public function doesntEndWith($needles) + { + return Str::doesntEndWith($this->value, $needles); + } + + /** + * Determine if the string is an exact match with the given value. + * + * @param \Illuminate\Support\Stringable|string $value + * @return bool + */ + public function exactly($value) + { + if ($value instanceof Stringable) { + $value = $value->toString(); + } + + return $this->value === $value; + } + + /** + * Extracts an excerpt from text that matches the first instance of a phrase. + * + * @param string $phrase + * @param array $options + * @return string|null + */ + public function excerpt($phrase = '', $options = []) + { + return Str::excerpt($this->value, $phrase, $options); + } + + /** + * Explode the string into a collection. + * + * @param string $delimiter + * @param int $limit + * @return \Illuminate\Support\Collection + */ + public function explode($delimiter, $limit = PHP_INT_MAX) + { + return new Collection(explode($delimiter, $this->value, $limit)); + } + + /** + * Split a string using a regular expression or by length. + * + * @param string|int $pattern + * @param int $limit + * @param int $flags + * @return \Illuminate\Support\Collection + */ + public function split($pattern, $limit = -1, $flags = 0) + { + if (filter_var($pattern, FILTER_VALIDATE_INT) !== false) { + return new Collection(mb_str_split($this->value, $pattern)); + } + + $segments = preg_split($pattern, $this->value, $limit, $flags); + + return ! empty($segments) ? new Collection($segments) : new Collection; + } + + /** + * Cap a string with a single instance of a given value. + * + * @param string $cap + * @return static + */ + public function finish($cap) + { + return new static(Str::finish($this->value, $cap)); + } + + /** + * Determine if a given string matches a given pattern. + * + * @param string|iterable $pattern + * @param bool $ignoreCase + * @return bool + */ + public function is($pattern, $ignoreCase = false) + { + return Str::is($pattern, $this->value, $ignoreCase); + } + + /** + * Determine if a given string is 7 bit ASCII. + * + * @return bool + */ + public function isAscii() + { + return Str::isAscii($this->value); + } + + /** + * Determine if a given string is valid JSON. + * + * @return bool + */ + public function isJson() + { + return Str::isJson($this->value); + } + + /** + * Determine if a given value is a valid URL. + * + * @param array $protocols + * @return bool + */ + public function isUrl(array $protocols = []) + { + return Str::isUrl($this->value, $protocols); + } + + /** + * Determine if a given string is a valid UUID. + * + * @param int<0, 8>|'max'|null $version + * @return bool + */ + public function isUuid($version = null) + { + return Str::isUuid($this->value, $version); + } + + /** + * Determine if a given string is a valid ULID. + * + * @return bool + */ + public function isUlid() + { + return Str::isUlid($this->value); + } + + /** + * Determine if the given string is empty. + * + * @return bool + */ + public function isEmpty() + { + return $this->value === ''; + } + + /** + * Determine if the given string is not empty. + * + * @return bool + */ + public function isNotEmpty() + { + return ! $this->isEmpty(); + } + + /** + * Convert a string to kebab case. + * + * @return static + */ + public function kebab() + { + return new static(Str::kebab($this->value)); + } + + /** + * Return the length of the given string. + * + * @param string|null $encoding + * @return int + */ + public function length($encoding = null) + { + return Str::length($this->value, $encoding); + } + + /** + * Limit the number of characters in a string. + * + * @param int $limit + * @param string $end + * @param bool $preserveWords + * @return static + */ + public function limit($limit = 100, $end = '...', $preserveWords = false) + { + return new static(Str::limit($this->value, $limit, $end, $preserveWords)); + } + + /** + * Convert the given string to lower-case. + * + * @return static + */ + public function lower() + { + return new static(Str::lower($this->value)); + } + + /** + * Convert GitHub flavored Markdown into HTML. + * + * @param array $options + * @param array $extensions + * @return static + */ + public function markdown(array $options = [], array $extensions = []) + { + return new static(Str::markdown($this->value, $options, $extensions)); + } + + /** + * Convert inline Markdown into HTML. + * + * @param array $options + * @param array $extensions + * @return static + */ + public function inlineMarkdown(array $options = [], array $extensions = []) + { + return new static(Str::inlineMarkdown($this->value, $options, $extensions)); + } + + /** + * Masks a portion of a string with a repeated character. + * + * @param string $character + * @param int $index + * @param int|null $length + * @param string $encoding + * @return static + */ + public function mask($character, $index, $length = null, $encoding = 'UTF-8') + { + return new static(Str::mask($this->value, $character, $index, $length, $encoding)); + } + + /** + * Get the string matching the given pattern. + * + * @param string $pattern + * @return static + */ + public function match($pattern) + { + return new static(Str::match($pattern, $this->value)); + } + + /** + * Determine if a given string matches a given pattern. + * + * @param string|iterable $pattern + * @return bool + */ + public function isMatch($pattern) + { + return Str::isMatch($pattern, $this->value); + } + + /** + * Get the string matching the given pattern. + * + * @param string $pattern + * @return \Illuminate\Support\Collection + */ + public function matchAll($pattern) + { + return Str::matchAll($pattern, $this->value); + } + + /** + * Determine if the string matches the given pattern. + * + * @param string $pattern + * @return bool + */ + public function test($pattern) + { + return $this->isMatch($pattern); + } + + /** + * Remove all non-numeric characters from a string. + * + * @return static + */ + public function numbers() + { + return new static(Str::numbers($this->value)); + } + + /** + * Pad both sides of the string with another. + * + * @param int $length + * @param string $pad + * @return static + */ + public function padBoth($length, $pad = ' ') + { + return new static(Str::padBoth($this->value, $length, $pad)); + } + + /** + * Pad the left side of the string with another. + * + * @param int $length + * @param string $pad + * @return static + */ + public function padLeft($length, $pad = ' ') + { + return new static(Str::padLeft($this->value, $length, $pad)); + } + + /** + * Pad the right side of the string with another. + * + * @param int $length + * @param string $pad + * @return static + */ + public function padRight($length, $pad = ' ') + { + return new static(Str::padRight($this->value, $length, $pad)); + } + + /** + * Parse a Class@method style callback into class and method. + * + * @param string|null $default + * @return array + */ + public function parseCallback($default = null) + { + return Str::parseCallback($this->value, $default); + } + + /** + * Call the given callback and return a new string. + * + * @param callable $callback + * @return static + */ + public function pipe(callable $callback) + { + return new static($callback($this)); + } + + /** + * Get the plural form of an English word. + * + * @param int|array|\Countable $count + * @param bool $prependCount + * @return static + */ + public function plural($count = 2, $prependCount = false) + { + return new static(Str::plural($this->value, $count, $prependCount)); + } + + /** + * Pluralize the last word of an English, studly caps case string. + * + * @param int|array|\Countable $count + * @return static + */ + public function pluralStudly($count = 2) + { + return new static(Str::pluralStudly($this->value, $count)); + } + + /** + * Pluralize the last word of an English, Pascal caps case string. + * + * @param int|array|\Countable $count + * @return static + */ + public function pluralPascal($count = 2) + { + return new static(Str::pluralStudly($this->value, $count)); + } + + /** + * Find the multi-byte safe position of the first occurrence of the given substring. + * + * @param string $needle + * @param int $offset + * @param string|null $encoding + * @return int|false + */ + public function position($needle, $offset = 0, $encoding = null) + { + return Str::position($this->value, $needle, $offset, $encoding); + } + + /** + * Prepend the given values to the string. + * + * @param string ...$values + * @return static + */ + public function prepend(...$values) + { + return new static(implode('', $values).$this->value); + } + + /** + * Remove any occurrence of the given string in the subject. + * + * @param string|iterable $search + * @param bool $caseSensitive + * @return static + */ + public function remove($search, $caseSensitive = true) + { + return new static(Str::remove($search, $this->value, $caseSensitive)); + } + + /** + * Reverse the string. + * + * @return static + */ + public function reverse() + { + return new static(Str::reverse($this->value)); + } + + /** + * Repeat the string. + * + * @param int $times + * @return static + */ + public function repeat(int $times) + { + return new static(str_repeat($this->value, $times)); + } + + /** + * Replace the given value in the given string. + * + * @param string|iterable $search + * @param string|iterable $replace + * @param bool $caseSensitive + * @return static + */ + public function replace($search, $replace, $caseSensitive = true) + { + return new static(Str::replace($search, $replace, $this->value, $caseSensitive)); + } + + /** + * Replace a given value in the string sequentially with an array. + * + * @param string $search + * @param iterable $replace + * @return static + */ + public function replaceArray($search, $replace) + { + return new static(Str::replaceArray($search, $replace, $this->value)); + } + + /** + * Replace the first occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @return static + */ + public function replaceFirst($search, $replace) + { + return new static(Str::replaceFirst($search, $replace, $this->value)); + } + + /** + * Replace the first occurrence of the given value if it appears at the start of the string. + * + * @param string $search + * @param string $replace + * @return static + */ + public function replaceStart($search, $replace) + { + return new static(Str::replaceStart($search, $replace, $this->value)); + } + + /** + * Replace the last occurrence of a given value in the string. + * + * @param string $search + * @param string $replace + * @return static + */ + public function replaceLast($search, $replace) + { + return new static(Str::replaceLast($search, $replace, $this->value)); + } + + /** + * Replace the last occurrence of a given value if it appears at the end of the string. + * + * @param string $search + * @param string $replace + * @return static + */ + public function replaceEnd($search, $replace) + { + return new static(Str::replaceEnd($search, $replace, $this->value)); + } + + /** + * Replace the patterns matching the given regular expression. + * + * @param array|string $pattern + * @param \Closure|string[]|string $replace + * @param int $limit + * @return static + */ + public function replaceMatches($pattern, $replace, $limit = -1) + { + if ($replace instanceof Closure) { + return new static(preg_replace_callback($pattern, $replace, $this->value, $limit)); + } + + return new static(preg_replace($pattern, $replace, $this->value, $limit)); + } + + /** + * Parse input from a string to a collection, according to a format. + * + * @param string $format + * @return \Illuminate\Support\Collection + */ + public function scan($format) + { + return new Collection(sscanf($this->value, $format)); + } + + /** + * Remove all "extra" blank space from the given string. + * + * @return static + */ + public function squish() + { + return new static(Str::squish($this->value)); + } + + /** + * Begin a string with a single instance of a given value. + * + * @param string $prefix + * @return static + */ + public function start($prefix) + { + return new static(Str::start($this->value, $prefix)); + } + + /** + * Strip HTML and PHP tags from the given string. + * + * @param string[]|string|null $allowedTags + * @return static + */ + public function stripTags($allowedTags = null) + { + return new static(strip_tags($this->value, $allowedTags)); + } + + /** + * Convert the given string to upper-case. + * + * @return static + */ + public function upper() + { + return new static(Str::upper($this->value)); + } + + /** + * Convert the given string to proper case. + * + * @return static + */ + public function title() + { + return new static(Str::title($this->value)); + } + + /** + * Convert the given string to proper case for each word. + * + * @return static + */ + public function headline() + { + return new static(Str::headline($this->value)); + } + + /** + * Convert the given string to APA-style title case. + * + * @return static + */ + public function apa() + { + return new static(Str::apa($this->value)); + } + + /** + * Transliterate a string to its closest ASCII representation. + * + * @param string|null $unknown + * @param bool|null $strict + * @return static + */ + public function transliterate($unknown = '?', $strict = false) + { + return new static(Str::transliterate($this->value, $unknown, $strict)); + } + + /** + * Get the singular form of an English word. + * + * @return static + */ + public function singular() + { + return new static(Str::singular($this->value)); + } + + /** + * Generate a URL friendly "slug" from a given string. + * + * @param string $separator + * @param string|null $language + * @param array $dictionary + * @return static + */ + public function slug($separator = '-', $language = 'en', $dictionary = ['@' => 'at']) + { + return new static(Str::slug($this->value, $separator, $language, $dictionary)); + } + + /** + * Convert a string to snake case. + * + * @param string $delimiter + * @return static + */ + public function snake($delimiter = '_') + { + return new static(Str::snake($this->value, $delimiter)); + } + + /** + * Determine if a given string starts with a given substring. + * + * @param string|iterable $needles + * @return bool + */ + public function startsWith($needles) + { + return Str::startsWith($this->value, $needles); + } + + /** + * Determine if a given string doesn't start with a given substring. + * + * @param string|iterable $needles + * @return bool + */ + public function doesntStartWith($needles) + { + return Str::doesntStartWith($this->value, $needles); + } + + /** + * Convert a value to studly caps case. + * + * @return static + */ + public function studly() + { + return new static(Str::studly($this->value)); + } + + /** + * Convert the string to Pascal case. + * + * @return static + */ + public function pascal() + { + return new static(Str::pascal($this->value)); + } + + /** + * Returns the portion of the string specified by the start and length parameters. + * + * @param int $start + * @param int|null $length + * @param string $encoding + * @return static + */ + public function substr($start, $length = null, $encoding = 'UTF-8') + { + return new static(Str::substr($this->value, $start, $length, $encoding)); + } + + /** + * Returns the number of substring occurrences. + * + * @param string $needle + * @param int $offset + * @param int|null $length + * @return int + */ + public function substrCount($needle, $offset = 0, $length = null) + { + return Str::substrCount($this->value, $needle, $offset, $length); + } + + /** + * Replace text within a portion of a string. + * + * @param string|string[] $replace + * @param int|int[] $offset + * @param int|int[]|null $length + * @return static + */ + public function substrReplace($replace, $offset = 0, $length = null) + { + return new static(Str::substrReplace($this->value, $replace, $offset, $length)); + } + + /** + * Swap multiple keywords in a string with other keywords. + * + * @param array $map + * @return static + */ + public function swap(array $map) + { + return new static(strtr($this->value, $map)); + } + + /** + * Take the first or last {$limit} characters. + * + * @param int $limit + * @return static + */ + public function take(int $limit) + { + if ($limit < 0) { + return $this->substr($limit); + } + + return $this->substr(0, $limit); + } + + /** + * Trim the string of the given characters. + * + * @param string $characters + * @return static + */ + public function trim($characters = null) + { + return new static(Str::trim(...array_merge([$this->value], func_get_args()))); + } + + /** + * Left trim the string of the given characters. + * + * @param string $characters + * @return static + */ + public function ltrim($characters = null) + { + return new static(Str::ltrim(...array_merge([$this->value], func_get_args()))); + } + + /** + * Right trim the string of the given characters. + * + * @param string $characters + * @return static + */ + public function rtrim($characters = null) + { + return new static(Str::rtrim(...array_merge([$this->value], func_get_args()))); + } + + /** + * Make a string's first character lowercase. + * + * @return static + */ + public function lcfirst() + { + return new static(Str::lcfirst($this->value)); + } + + /** + * Make a string's first character uppercase. + * + * @return static + */ + public function ucfirst() + { + return new static(Str::ucfirst($this->value)); + } + + /** + * Split a string by uppercase characters. + * + * @return \Illuminate\Support\Collection + */ + public function ucsplit() + { + return new Collection(Str::ucsplit($this->value)); + } + + /** + * Execute the given callback if the string contains a given substring. + * + * @param string|iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenContains($needles, $callback, $default = null) + { + return $this->when($this->contains($needles), $callback, $default); + } + + /** + * Execute the given callback if the string contains all array values. + * + * @param iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenContainsAll(array $needles, $callback, $default = null) + { + return $this->when($this->containsAll($needles), $callback, $default); + } + + /** + * Execute the given callback if the string is empty. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenEmpty($callback, $default = null) + { + return $this->when($this->isEmpty(), $callback, $default); + } + + /** + * Execute the given callback if the string is not empty. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenNotEmpty($callback, $default = null) + { + return $this->when($this->isNotEmpty(), $callback, $default); + } + + /** + * Execute the given callback if the string ends with a given substring. + * + * @param string|iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenEndsWith($needles, $callback, $default = null) + { + return $this->when($this->endsWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string doesn't end with a given substring. + * + * @param string|iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenDoesntEndWith($needles, $callback, $default = null) + { + return $this->when($this->doesntEndWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string is an exact match with the given value. + * + * @param string $value + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenExactly($value, $callback, $default = null) + { + return $this->when($this->exactly($value), $callback, $default); + } + + /** + * Execute the given callback if the string is not an exact match with the given value. + * + * @param string $value + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenNotExactly($value, $callback, $default = null) + { + return $this->when(! $this->exactly($value), $callback, $default); + } + + /** + * Execute the given callback if the string matches a given pattern. + * + * @param string|iterable $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIs($pattern, $callback, $default = null) + { + return $this->when($this->is($pattern), $callback, $default); + } + + /** + * Execute the given callback if the string is 7 bit ASCII. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsAscii($callback, $default = null) + { + return $this->when($this->isAscii(), $callback, $default); + } + + /** + * Execute the given callback if the string is a valid UUID. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsUuid($callback, $default = null) + { + return $this->when($this->isUuid(), $callback, $default); + } + + /** + * Execute the given callback if the string is a valid ULID. + * + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenIsUlid($callback, $default = null) + { + return $this->when($this->isUlid(), $callback, $default); + } + + /** + * Execute the given callback if the string starts with a given substring. + * + * @param string|iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenStartsWith($needles, $callback, $default = null) + { + return $this->when($this->startsWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string doesn't start with a given substring. + * + * @param string|iterable $needles + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenDoesntStartWith($needles, $callback, $default = null) + { + return $this->when($this->doesntStartWith($needles), $callback, $default); + } + + /** + * Execute the given callback if the string matches the given pattern. + * + * @param string $pattern + * @param callable $callback + * @param callable|null $default + * @return static + */ + public function whenTest($pattern, $callback, $default = null) + { + return $this->when($this->test($pattern), $callback, $default); + } + + /** + * Limit the number of words in a string. + * + * @param int $words + * @param string $end + * @return static + */ + public function words($words = 100, $end = '...') + { + return new static(Str::words($this->value, $words, $end)); + } + + /** + * Get the number of words a string contains. + * + * @param string|null $characters + * @return int + */ + public function wordCount($characters = null) + { + return Str::wordCount($this->value, $characters); + } + + /** + * Wrap a string to a given number of characters. + * + * @param int $characters + * @param string $break + * @param bool $cutLongWords + * @return static + */ + public function wordWrap($characters = 75, $break = "\n", $cutLongWords = false) + { + return new static(Str::wordWrap($this->value, $characters, $break, $cutLongWords)); + } + + /** + * Wrap the string with the given strings. + * + * @param string $before + * @param string|null $after + * @return static + */ + public function wrap($before, $after = null) + { + return new static(Str::wrap($this->value, $before, $after)); + } + + /** + * Unwrap the string with the given strings. + * + * @param string $before + * @param string|null $after + * @return static + */ + public function unwrap($before, $after = null) + { + return new static(Str::unwrap($this->value, $before, $after)); + } + + /** + * Convert the string into a `HtmlString` instance. + * + * @return \Illuminate\Support\HtmlString + */ + public function toHtmlString() + { + return new HtmlString($this->value); + } + + /** + * Convert the string to Base64 encoding. + * + * @return static + */ + public function toBase64() + { + return new static(base64_encode($this->value)); + } + + /** + * Decode the Base64 encoded string. + * + * @param bool $strict + * @return static + */ + public function fromBase64($strict = false) + { + return new static(base64_decode($this->value, $strict)); + } + + /** + * Hash the string using the given algorithm. + * + * @param string $algorithm + * @return static + */ + public function hash(string $algorithm) + { + return new static(hash($algorithm, $this->value)); + } + + /** + * Encrypt the string. + * + * @param bool $serialize + * @return static + */ + public function encrypt(bool $serialize = false) + { + return new static(encrypt($this->value, $serialize)); + } + + /** + * Decrypt the string. + * + * @param bool $serialize + * @return static + */ + public function decrypt(bool $serialize = false) + { + return new static(decrypt($this->value, $serialize)); + } + + /** + * Dump the string. + * + * @param mixed ...$args + * @return $this + */ + public function dump(...$args) + { + dump($this->value, ...$args); + + return $this; + } + + /** + * Get the underlying string value. + * + * @return string + */ + public function value() + { + return $this->toString(); + } + + /** + * Get the underlying string value. + * + * @return string + */ + public function toString() + { + return $this->value; + } + + /** + * Get the underlying string value as an integer. + * + * @param int $base + * @return int + */ + public function toInteger($base = 10) + { + return intval($this->value, $base); + } + + /** + * Get the underlying string value as a float. + * + * @return float + */ + public function toFloat() + { + return floatval($this->value); + } + + /** + * Get the underlying string value as a boolean. + * + * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. + * + * @return bool + */ + public function toBoolean() + { + return filter_var($this->value, FILTER_VALIDATE_BOOLEAN); + } + + /** + * Get the underlying string value as a Carbon instance. + * + * @param string|null $format + * @param string|null $tz + * @return \Illuminate\Support\Carbon + * + * @throws \Carbon\Exceptions\InvalidFormatException + */ + public function toDate($format = null, $tz = null) + { + if (is_null($format)) { + return Date::parse($this->value, $tz); + } + + return Date::createFromFormat($format, $this->value, $tz); + } + + /** + * Get the underlying string value as a Uri instance. + * + * @return \Illuminate\Support\Uri + */ + public function toUri() + { + return Uri::of($this->value); + } + + /** + * Convert the object to a string when JSON encoded. + * + * @return string + */ + public function jsonSerialize(): string + { + return $this->__toString(); + } + + /** + * Determine if the given offset exists. + * + * @param mixed $offset + * @return bool + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->value[$offset]); + } + + /** + * Get the value at the given offset. + * + * @param mixed $offset + * @return string + */ + public function offsetGet(mixed $offset): string + { + return $this->value[$offset]; + } + + /** + * Set the value at the given offset. + * + * @param mixed $offset + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void + { + $this->value[$offset] = $value; + } + + /** + * Unset the value at the given offset. + * + * @param mixed $offset + * @return void + */ + public function offsetUnset(mixed $offset): void + { + unset($this->value[$offset]); + } + + /** + * Proxy dynamic properties onto methods. + * + * @param string $key + * @return mixed + */ + public function __get($key) + { + return $this->{$key}(); + } + + /** + * Get the raw string value. + * + * @return string + */ + public function __toString() + { + return (string) $this->value; + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/BatchFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/BatchFake.php new file mode 100644 index 00000000..0d1176c2 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/BatchFake.php @@ -0,0 +1,168 @@ +id = $id; + $this->name = $name; + $this->totalJobs = $totalJobs; + $this->pendingJobs = $pendingJobs; + $this->failedJobs = $failedJobs; + $this->failedJobIds = $failedJobIds; + $this->options = $options; + $this->createdAt = $createdAt; + $this->cancelledAt = $cancelledAt; + $this->finishedAt = $finishedAt; + } + + /** + * Get a fresh instance of the batch represented by this ID. + * + * @return self + */ + public function fresh() + { + return $this; + } + + /** + * Add additional jobs to the batch. + * + * @param \Illuminate\Support\Enumerable|object|array $jobs + * @return self + */ + public function add($jobs) + { + $jobs = Collection::wrap($jobs); + + foreach ($jobs as $job) { + $this->added[] = $job; + } + + $this->totalJobs += $jobs->count(); + + return $this; + } + + /** + * Record that a job within the batch finished successfully, executing any callbacks if necessary. + * + * @param string $jobId + * @return void + */ + public function recordSuccessfulJob(string $jobId) + { + // + } + + /** + * Decrement the pending jobs for the batch. + * + * @param string $jobId + * @return void + */ + public function decrementPendingJobs(string $jobId) + { + // + } + + /** + * Record that a job within the batch failed to finish successfully, executing any callbacks if necessary. + * + * @param string $jobId + * @param \Throwable $e + * @return void + */ + public function recordFailedJob(string $jobId, $e) + { + // + } + + /** + * Increment the failed jobs for the batch. + * + * @param string $jobId + * @return \Illuminate\Bus\UpdatedBatchJobCounts + */ + public function incrementFailedJobs(string $jobId) + { + return new UpdatedBatchJobCounts; + } + + /** + * Cancel the batch. + * + * @return void + */ + public function cancel() + { + $this->cancelledAt = Carbon::now(); + } + + /** + * Delete the batch from storage. + * + * @return void + */ + public function delete() + { + $this->deleted = true; + } + + /** + * Determine if the batch has been deleted. + * + * @return bool + */ + public function deleted() + { + return $this->deleted; + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/BatchRepositoryFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/BatchRepositoryFake.php new file mode 100644 index 00000000..2afa4ab9 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/BatchRepositoryFake.php @@ -0,0 +1,163 @@ +batches; + } + + /** + * Retrieve information about an existing batch. + * + * @param string $batchId + * @return \Illuminate\Bus\Batch|null + */ + public function find(string $batchId) + { + return $this->batches[$batchId] ?? null; + } + + /** + * Store a new pending batch. + * + * @param \Illuminate\Bus\PendingBatch $batch + * @return \Illuminate\Bus\Batch + */ + public function store(PendingBatch $batch) + { + $id = (string) Str::orderedUuid(); + + $this->batches[$id] = new BatchFake( + $id, + $batch->name, + count($batch->jobs), + count($batch->jobs), + 0, + [], + $batch->options, + CarbonImmutable::now(), + null, + null + ); + + return $this->batches[$id]; + } + + /** + * Increment the total number of jobs within the batch. + * + * @param string $batchId + * @param int $amount + * @return void + */ + public function incrementTotalJobs(string $batchId, int $amount) + { + // + } + + /** + * Decrement the total number of pending jobs for the batch. + * + * @param string $batchId + * @param string $jobId + * @return \Illuminate\Bus\UpdatedBatchJobCounts + */ + public function decrementPendingJobs(string $batchId, string $jobId) + { + return new UpdatedBatchJobCounts; + } + + /** + * Increment the total number of failed jobs for the batch. + * + * @param string $batchId + * @param string $jobId + * @return \Illuminate\Bus\UpdatedBatchJobCounts + */ + public function incrementFailedJobs(string $batchId, string $jobId) + { + return new UpdatedBatchJobCounts; + } + + /** + * Mark the batch that has the given ID as finished. + * + * @param string $batchId + * @return void + */ + public function markAsFinished(string $batchId) + { + if (isset($this->batches[$batchId])) { + $this->batches[$batchId]->finishedAt = now(); + } + } + + /** + * Cancel the batch that has the given ID. + * + * @param string $batchId + * @return void + */ + public function cancel(string $batchId) + { + if (isset($this->batches[$batchId])) { + $this->batches[$batchId]->cancel(); + } + } + + /** + * Delete the batch that has the given ID. + * + * @param string $batchId + * @return void + */ + public function delete(string $batchId) + { + unset($this->batches[$batchId]); + } + + /** + * Execute the given Closure within a storage specific transaction. + * + * @param \Closure $callback + * @return mixed + */ + public function transaction(Closure $callback) + { + return $callback(); + } + + /** + * Rollback the last database transaction for the connection. + * + * @return void + */ + public function rollBack() + { + // + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/BusFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/BusFake.php new file mode 100644 index 00000000..ac464e98 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/BusFake.php @@ -0,0 +1,925 @@ +dispatcher = $dispatcher; + $this->jobsToFake = Arr::wrap($jobsToFake); + $this->batchRepository = $batchRepository ?: new BatchRepositoryFake; + } + + /** + * Specify the jobs that should be dispatched instead of faked. + * + * @param array|string $jobsToDispatch + * @return $this + */ + public function except($jobsToDispatch) + { + $this->jobsToDispatch = array_merge($this->jobsToDispatch, Arr::wrap($jobsToDispatch)); + + return $this; + } + + /** + * Assert if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + */ + public function assertDispatched($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + if (is_numeric($callback)) { + return $this->assertDispatchedTimes($command, $callback); + } + + PHPUnit::assertTrue( + $this->dispatched($command, $callback)->count() > 0 || + $this->dispatchedAfterResponse($command, $callback)->count() > 0 || + $this->dispatchedSync($command, $callback)->count() > 0, + "The expected [{$command}] job was not dispatched." + ); + } + + /** + * Assert if a job was pushed exactly once. + * + * @param string|\Closure $command + * @param int $times + * @return void + */ + public function assertDispatchedOnce($command) + { + $this->assertDispatchedTimes($command, 1); + } + + /** + * Assert if a job was pushed a number of times. + * + * @param string|\Closure $command + * @param int $times + * @return void + */ + public function assertDispatchedTimes($command, $times = 1) + { + $callback = null; + + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + $count = $this->dispatched($command, $callback)->count() + + $this->dispatchedAfterResponse($command, $callback)->count() + + $this->dispatchedSync($command, $callback)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$command}] job was pushed {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + */ + public function assertNotDispatched($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + PHPUnit::assertTrue( + $this->dispatched($command, $callback)->count() === 0 && + $this->dispatchedAfterResponse($command, $callback)->count() === 0 && + $this->dispatchedSync($command, $callback)->count() === 0, + "The unexpected [{$command}] job was dispatched." + ); + } + + /** + * Assert that no jobs were dispatched. + * + * @return void + */ + public function assertNothingDispatched() + { + $commandNames = implode("\n- ", array_keys($this->commands)); + + PHPUnit::assertEmpty($this->commands, "The following jobs were dispatched unexpectedly:\n\n- $commandNames\n"); + } + + /** + * Assert if a job was explicitly dispatched synchronously based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + */ + public function assertDispatchedSync($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + if (is_numeric($callback)) { + return $this->assertDispatchedSyncTimes($command, $callback); + } + + PHPUnit::assertTrue( + $this->dispatchedSync($command, $callback)->count() > 0, + "The expected [{$command}] job was not dispatched synchronously." + ); + } + + /** + * Assert if a job was pushed synchronously a number of times. + * + * @param string|\Closure $command + * @param int $times + * @return void + */ + public function assertDispatchedSyncTimes($command, $times = 1) + { + $callback = null; + + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + $count = $this->dispatchedSync($command, $callback)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$command}] job was synchronously pushed {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + */ + public function assertNotDispatchedSync($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + PHPUnit::assertCount( + 0, $this->dispatchedSync($command, $callback), + "The unexpected [{$command}] job was dispatched synchronously." + ); + } + + /** + * Assert if a job was dispatched after the response was sent based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|int|null $callback + * @return void + */ + public function assertDispatchedAfterResponse($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + if (is_numeric($callback)) { + return $this->assertDispatchedAfterResponseTimes($command, $callback); + } + + PHPUnit::assertTrue( + $this->dispatchedAfterResponse($command, $callback)->count() > 0, + "The expected [{$command}] job was not dispatched after sending the response." + ); + } + + /** + * Assert if a job was pushed after the response was sent a number of times. + * + * @param string|\Closure $command + * @param int $times + * @return void + */ + public function assertDispatchedAfterResponseTimes($command, $times = 1) + { + $callback = null; + + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + $count = $this->dispatchedAfterResponse($command, $callback)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$command}] job was pushed {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if a job was dispatched based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + */ + public function assertNotDispatchedAfterResponse($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + PHPUnit::assertCount( + 0, $this->dispatchedAfterResponse($command, $callback), + "The unexpected [{$command}] job was dispatched after sending the response." + ); + } + + /** + * Assert if a chain of jobs was dispatched. + * + * @param array $expectedChain + * @return void + */ + public function assertChained(array $expectedChain) + { + $command = $expectedChain[0]; + + $expectedChain = array_slice($expectedChain, 1); + + $callback = null; + + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } elseif ($command instanceof ChainedBatchTruthTest) { + $instance = $command; + + $command = ChainedBatch::class; + + $callback = fn ($job) => $instance($job->toPendingBatch()); + } elseif (! is_string($command)) { + $instance = $command; + + $command = get_class($instance); + + $callback = function ($job) use ($instance) { + return serialize($this->resetChainPropertiesToDefaults($job)) === serialize($instance); + }; + } + + PHPUnit::assertTrue( + $this->dispatched($command, $callback)->isNotEmpty(), + "The expected [{$command}] job was not dispatched." + ); + + $this->assertDispatchedWithChainOfObjects($command, $expectedChain, $callback); + } + + /** + * Assert no chained jobs was dispatched. + * + * @return void + */ + public function assertNothingChained() + { + $this->assertNothingDispatched(); + } + + /** + * Reset the chain properties to their default values on the job. + * + * @param mixed $job + * @return mixed + */ + protected function resetChainPropertiesToDefaults($job) + { + return tap(clone $job, function ($job) { + $job->chainConnection = null; + $job->chainQueue = null; + $job->chainCatchCallbacks = null; + $job->chained = []; + }); + } + + /** + * Assert if a job was dispatched with an empty chain based on a truth-test callback. + * + * @param string|\Closure $command + * @param callable|null $callback + * @return void + */ + public function assertDispatchedWithoutChain($command, $callback = null) + { + if ($command instanceof Closure) { + [$command, $callback] = [$this->firstClosureParameterType($command), $command]; + } + + PHPUnit::assertTrue( + $this->dispatched($command, $callback)->isNotEmpty(), + "The expected [{$command}] job was not dispatched." + ); + + $this->assertDispatchedWithChainOfObjects($command, [], $callback); + } + + /** + * Assert if a job was dispatched with chained jobs based on a truth-test callback. + * + * @param string $command + * @param array $expectedChain + * @param callable|null $callback + * @return void + */ + protected function assertDispatchedWithChainOfObjects($command, $expectedChain, $callback) + { + $chain = $expectedChain; + + PHPUnit::assertTrue( + $this->dispatched($command, $callback)->filter(function ($job) use ($chain) { + if (count($chain) !== count($job->chained)) { + return false; + } + + foreach ($job->chained as $index => $serializedChainedJob) { + if ($chain[$index] instanceof ChainedBatchTruthTest) { + $chainedBatch = unserialize($serializedChainedJob); + + if (! $chainedBatch instanceof ChainedBatch || + ! $chain[$index]($chainedBatch->toPendingBatch())) { + return false; + } + } elseif ($chain[$index] instanceof Closure) { + [$expectedType, $callback] = [$this->firstClosureParameterType($chain[$index]), $chain[$index]]; + + $chainedJob = unserialize($serializedChainedJob); + + if (! $chainedJob instanceof $expectedType) { + throw new RuntimeException('The chained job was expected to be of type '.$expectedType.', '.$chainedJob::class.' chained.'); + } + + if (! $callback($chainedJob)) { + return false; + } + } elseif (is_string($chain[$index])) { + if ($chain[$index] != get_class(unserialize($serializedChainedJob))) { + return false; + } + } elseif (serialize($chain[$index]) != $serializedChainedJob) { + return false; + } + } + + return true; + })->isNotEmpty(), + 'The expected chain was not dispatched.' + ); + } + + /** + * Create a new assertion about a chained batch. + * + * @param \Closure $callback + * @return \Illuminate\Support\Testing\Fakes\ChainedBatchTruthTest + */ + public function chainedBatch(Closure $callback) + { + return new ChainedBatchTruthTest($callback); + } + + /** + * Assert if a batch was dispatched based on a truth-test callback. + * + * @param callable $callback + * @return void + */ + public function assertBatched(callable $callback) + { + PHPUnit::assertTrue( + $this->batched($callback)->count() > 0, + 'The expected batch was not dispatched.' + ); + } + + /** + * Assert the number of batches that have been dispatched. + * + * @param int $count + * @return void + */ + public function assertBatchCount($count) + { + PHPUnit::assertCount( + $count, $this->batches, + ); + } + + /** + * Assert that no batched jobs were dispatched. + * + * @return void + */ + public function assertNothingBatched() + { + $jobNames = (new Collection($this->batches)) + ->map(fn ($batch) => $batch->jobs->map(fn ($job) => get_class($job))) + ->flatten() + ->join("\n- "); + + PHPUnit::assertEmpty($this->batches, "The following batched jobs were dispatched unexpectedly:\n\n- $jobNames\n"); + } + + /** + * Assert that no jobs were dispatched, chained, or batched. + * + * @return void + */ + public function assertNothingPlaced() + { + $this->assertNothingDispatched(); + $this->assertNothingBatched(); + } + + /** + * Get all of the jobs matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function dispatched($command, $callback = null) + { + if (! $this->hasDispatched($command)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return (new Collection($this->commands[$command]))->filter(fn ($command) => $callback($command)); + } + + /** + * Get all of the jobs dispatched synchronously matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function dispatchedSync(string $command, $callback = null) + { + if (! $this->hasDispatchedSync($command)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return (new Collection($this->commandsSync[$command]))->filter(fn ($command) => $callback($command)); + } + + /** + * Get all of the jobs dispatched after the response was sent matching a truth-test callback. + * + * @param string $command + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function dispatchedAfterResponse(string $command, $callback = null) + { + if (! $this->hasDispatchedAfterResponse($command)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return (new Collection($this->commandsAfterResponse[$command]))->filter(fn ($command) => $callback($command)); + } + + /** + * Get all of the pending batches matching a truth-test callback. + * + * @param callable $callback + * @return \Illuminate\Support\Collection + */ + public function batched(callable $callback) + { + if (empty($this->batches)) { + return new Collection; + } + + return (new Collection($this->batches))->filter(fn ($batch) => $callback($batch)); + } + + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + */ + public function hasDispatched($command) + { + return isset($this->commands[$command]) && ! empty($this->commands[$command]); + } + + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + */ + public function hasDispatchedSync($command) + { + return isset($this->commandsSync[$command]) && ! empty($this->commandsSync[$command]); + } + + /** + * Determine if there are any stored commands for a given class. + * + * @param string $command + * @return bool + */ + public function hasDispatchedAfterResponse($command) + { + return isset($this->commandsAfterResponse[$command]) && ! empty($this->commandsAfterResponse[$command]); + } + + /** + * Dispatch a command to its appropriate handler. + * + * @param mixed $command + * @return mixed + */ + public function dispatch($command) + { + if ($this->shouldFakeJob($command)) { + $this->commands[get_class($command)][] = $this->getCommandRepresentation($command); + } else { + return $this->dispatcher->dispatch($command); + } + } + + /** + * Dispatch a command to its appropriate handler in the current process. + * + * Queueable jobs will be dispatched to the "sync" queue. + * + * @param mixed $command + * @param mixed $handler + * @return mixed + */ + public function dispatchSync($command, $handler = null) + { + if ($this->shouldFakeJob($command)) { + $this->commandsSync[get_class($command)][] = $this->getCommandRepresentation($command); + } else { + return $this->dispatcher->dispatchSync($command, $handler); + } + } + + /** + * Dispatch a command to its appropriate handler in the current process. + * + * @param mixed $command + * @param mixed $handler + * @return mixed + */ + public function dispatchNow($command, $handler = null) + { + if ($this->shouldFakeJob($command)) { + $this->commands[get_class($command)][] = $this->getCommandRepresentation($command); + } else { + return $this->dispatcher->dispatchNow($command, $handler); + } + } + + /** + * Dispatch a command to its appropriate handler behind a queue. + * + * @param mixed $command + * @return mixed + */ + public function dispatchToQueue($command) + { + if ($this->shouldFakeJob($command)) { + $this->commands[get_class($command)][] = $this->getCommandRepresentation($command); + } else { + return $this->dispatcher->dispatchToQueue($command); + } + } + + /** + * Dispatch a command to its appropriate handler. + * + * @param mixed $command + * @return mixed + */ + public function dispatchAfterResponse($command) + { + if ($this->shouldFakeJob($command)) { + $this->commandsAfterResponse[get_class($command)][] = $this->getCommandRepresentation($command); + } else { + return $this->dispatcher->dispatch($command); + } + } + + /** + * Create a new chain of queueable jobs. + * + * @param \Illuminate\Support\Collection|array|null $jobs + * @return \Illuminate\Foundation\Bus\PendingChain + */ + public function chain($jobs = null) + { + $jobs = Collection::wrap($jobs); + $jobs = ChainedBatch::prepareNestedBatches($jobs); + + return new PendingChainFake($this, $jobs->shift(), $jobs->toArray()); + } + + /** + * Attempt to find the batch with the given ID. + * + * @param string $batchId + * @return \Illuminate\Bus\Batch|null + */ + public function findBatch(string $batchId) + { + return $this->batchRepository->find($batchId); + } + + /** + * Create a new batch of queueable jobs. + * + * @param \Illuminate\Support\Collection|array $jobs + * @return \Illuminate\Bus\PendingBatch + */ + public function batch($jobs) + { + return new PendingBatchFake($this, Collection::wrap($jobs)); + } + + /** + * Dispatch an empty job batch for testing. + * + * @param string $name + * @return \Illuminate\Bus\Batch + */ + public function dispatchFakeBatch($name = '') + { + return $this->batch([])->name($name)->dispatch(); + } + + /** + * Record the fake pending batch dispatch. + * + * @param \Illuminate\Bus\PendingBatch $pendingBatch + * @return \Illuminate\Bus\Batch + */ + public function recordPendingBatch(PendingBatch $pendingBatch) + { + $this->batches[] = $pendingBatch; + + return $this->batchRepository->store($pendingBatch); + } + + /** + * Determine if a command should be faked or actually dispatched. + * + * @param mixed $command + * @return bool + */ + protected function shouldFakeJob($command) + { + if ($this->shouldDispatchCommand($command)) { + return false; + } + + if (empty($this->jobsToFake)) { + return true; + } + + return (new Collection($this->jobsToFake)) + ->filter(function ($job) use ($command) { + return $job instanceof Closure + ? $job($command) + : $job === get_class($command); + })->isNotEmpty(); + } + + /** + * Determine if a command should be dispatched or not. + * + * @param mixed $command + * @return bool + */ + protected function shouldDispatchCommand($command) + { + return (new Collection($this->jobsToDispatch)) + ->filter(function ($job) use ($command) { + return $job instanceof Closure + ? $job($command) + : $job === get_class($command); + })->isNotEmpty(); + } + + /** + * Specify if commands should be serialized and restored when being batched. + * + * @param bool $serializeAndRestore + * @return $this + */ + public function serializeAndRestore(bool $serializeAndRestore = true) + { + $this->serializeAndRestore = $serializeAndRestore; + + return $this; + } + + /** + * Serialize and unserialize the command to simulate the queueing process. + * + * @param mixed $command + * @return mixed + */ + protected function serializeAndRestoreCommand($command) + { + return unserialize(serialize($command)); + } + + /** + * Return the command representation that should be stored. + * + * @param mixed $command + * @return mixed + */ + protected function getCommandRepresentation($command) + { + return $this->serializeAndRestore ? $this->serializeAndRestoreCommand($command) : $command; + } + + /** + * Set the pipes commands should be piped through before dispatching. + * + * @param array $pipes + * @return $this + */ + public function pipeThrough(array $pipes) + { + $this->dispatcher->pipeThrough($pipes); + + return $this; + } + + /** + * Determine if the given command has a handler. + * + * @param mixed $command + * @return bool + */ + public function hasCommandHandler($command) + { + return $this->dispatcher->hasCommandHandler($command); + } + + /** + * Retrieve the handler for a command. + * + * @param mixed $command + * @return mixed + */ + public function getCommandHandler($command) + { + return $this->dispatcher->getCommandHandler($command); + } + + /** + * Map a command to a handler. + * + * @param array $map + * @return $this + */ + public function map(array $map) + { + $this->dispatcher->map($map); + + return $this; + } + + /** + * Get the batches that have been dispatched. + * + * @return array + */ + public function dispatchedBatches() + { + return $this->batches; + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/ChainedBatchTruthTest.php b/plugins/vendor/illuminate/support/Testing/Fakes/ChainedBatchTruthTest.php new file mode 100644 index 00000000..63a44e75 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/ChainedBatchTruthTest.php @@ -0,0 +1,36 @@ +callback = $callback; + } + + /** + * Invoke the truth test with the given pending batch. + * + * @param \Illuminate\Bus\PendingBatch $pendingBatch + * @return bool + */ + public function __invoke($pendingBatch) + { + return call_user_func($this->callback, $pendingBatch); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/EventFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/EventFake.php new file mode 100644 index 00000000..ead0c862 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/EventFake.php @@ -0,0 +1,453 @@ +dispatcher = $dispatcher; + + $this->eventsToFake = Arr::wrap($eventsToFake); + } + + /** + * Specify the events that should be dispatched instead of faked. + * + * @param array|string $eventsToDispatch + * @return $this + */ + public function except($eventsToDispatch) + { + $this->eventsToDispatch = array_merge( + $this->eventsToDispatch, + Arr::wrap($eventsToDispatch) + ); + + return $this; + } + + /** + * Assert if an event has a listener attached to it. + * + * @param string $expectedEvent + * @param string|array $expectedListener + * @return void + */ + public function assertListening($expectedEvent, $expectedListener) + { + foreach ($this->dispatcher->getListeners($expectedEvent) as $listenerClosure) { + $actualListener = (new ReflectionFunction($listenerClosure)) + ->getStaticVariables()['listener']; + + $normalizedListener = $expectedListener; + + if (is_string($actualListener) && Str::contains($actualListener, '@')) { + $actualListener = Str::parseCallback($actualListener); + + if (is_string($expectedListener)) { + if (Str::contains($expectedListener, '@')) { + $normalizedListener = Str::parseCallback($expectedListener); + } else { + $normalizedListener = [ + $expectedListener, + method_exists($expectedListener, 'handle') ? 'handle' : '__invoke', + ]; + } + } + } + + if ($actualListener === $normalizedListener || + ($actualListener instanceof Closure && + $normalizedListener === Closure::class)) { + PHPUnit::assertTrue(true); + + return; + } + } + + PHPUnit::assertTrue( + false, + sprintf( + 'Event [%s] does not have the [%s] listener attached to it', + $expectedEvent, + print_r($expectedListener, true) + ) + ); + } + + /** + * Assert if an event was dispatched based on a truth-test callback. + * + * @param string|\Closure $event + * @param callable|int|null $callback + * @return void + */ + public function assertDispatched($event, $callback = null) + { + if ($event instanceof Closure) { + [$event, $callback] = [$this->firstClosureParameterType($event), $event]; + } + + if (is_int($callback)) { + return $this->assertDispatchedTimes($event, $callback); + } + + PHPUnit::assertTrue( + $this->dispatched($event, $callback)->count() > 0, + "The expected [{$event}] event was not dispatched." + ); + } + + /** + * Assert if an event was dispatched exactly once. + * + * @param string $event + * @param int $times + * @return void + */ + public function assertDispatchedOnce($event) + { + $this->assertDispatchedTimes($event, 1); + } + + /** + * Assert if an event was dispatched a number of times. + * + * @param string $event + * @param int $times + * @return void + */ + public function assertDispatchedTimes($event, $times = 1) + { + $count = $this->dispatched($event)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$event}] event was dispatched {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if an event was dispatched based on a truth-test callback. + * + * @param string|\Closure $event + * @param callable|null $callback + * @return void + */ + public function assertNotDispatched($event, $callback = null) + { + if ($event instanceof Closure) { + [$event, $callback] = [$this->firstClosureParameterType($event), $event]; + } + + PHPUnit::assertCount( + 0, $this->dispatched($event, $callback), + "The unexpected [{$event}] event was dispatched." + ); + } + + /** + * Assert that no events were dispatched. + * + * @return void + */ + public function assertNothingDispatched() + { + $count = count(Arr::flatten($this->events)); + + $eventNames = (new Collection($this->events)) + ->map(fn ($events, $eventName) => sprintf( + '%s dispatched %s %s', + $eventName, + count($events), + Str::plural('time', count($events)), + )) + ->join("\n- "); + + PHPUnit::assertSame( + 0, $count, + "{$count} unexpected events were dispatched:\n\n- $eventNames\n" + ); + } + + /** + * Get all of the events matching a truth-test callback. + * + * @param string $event + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function dispatched($event, $callback = null) + { + if (! $this->hasDispatched($event)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return (new Collection($this->events[$event]))->filter( + fn ($arguments) => $callback(...$arguments) + ); + } + + /** + * Determine if the given event has been dispatched. + * + * @param string $event + * @return bool + */ + public function hasDispatched($event) + { + return isset($this->events[$event]) && ! empty($this->events[$event]); + } + + /** + * Register an event listener with the dispatcher. + * + * @param \Closure|string|array $events + * @param mixed $listener + * @return void + */ + public function listen($events, $listener = null) + { + $this->dispatcher->listen($events, $listener); + } + + /** + * Determine if a given event has listeners. + * + * @param string $eventName + * @return bool + */ + public function hasListeners($eventName) + { + return $this->dispatcher->hasListeners($eventName); + } + + /** + * Register an event and payload to be dispatched later. + * + * @param string $event + * @param array $payload + * @return void + */ + public function push($event, $payload = []) + { + // + } + + /** + * Register an event subscriber with the dispatcher. + * + * @param object|string $subscriber + * @return void + */ + public function subscribe($subscriber) + { + $this->dispatcher->subscribe($subscriber); + } + + /** + * Flush a set of pushed events. + * + * @param string $event + * @return void + */ + public function flush($event) + { + // + } + + /** + * Fire an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @param bool $halt + * @return array|null + */ + public function dispatch($event, $payload = [], $halt = false) + { + $name = is_object($event) ? get_class($event) : (string) $event; + + if ($this->shouldFakeEvent($name, $payload)) { + $this->fakeEvent($event, $name, func_get_args()); + } else { + return $this->dispatcher->dispatch($event, $payload, $halt); + } + } + + /** + * Determine if an event should be faked or actually dispatched. + * + * @param string $eventName + * @param mixed $payload + * @return bool + */ + protected function shouldFakeEvent($eventName, $payload) + { + if ($this->shouldDispatchEvent($eventName, $payload)) { + return false; + } + + if (empty($this->eventsToFake)) { + return true; + } + + return (new Collection($this->eventsToFake)) + ->filter(function ($event) use ($eventName, $payload) { + return $event instanceof Closure + ? $event($eventName, $payload) + : $event === $eventName; + }) + ->isNotEmpty(); + } + + /** + * Push the event onto the fake events array immediately or after the next database transaction. + * + * @param string|object $event + * @param string $name + * @param array $arguments + * @return void + */ + protected function fakeEvent($event, $name, $arguments) + { + if ($event instanceof ShouldDispatchAfterCommit && Container::getInstance()->bound('db.transactions')) { + return Container::getInstance()->make('db.transactions') + ->addCallback(fn () => $this->events[$name][] = $arguments); + } + + $this->events[$name][] = $arguments; + } + + /** + * Determine whether an event should be dispatched or not. + * + * @param string $eventName + * @param mixed $payload + * @return bool + */ + protected function shouldDispatchEvent($eventName, $payload) + { + if (empty($this->eventsToDispatch)) { + return false; + } + + return (new Collection($this->eventsToDispatch)) + ->filter(function ($event) use ($eventName, $payload) { + return $event instanceof Closure + ? $event($eventName, $payload) + : $event === $eventName; + }) + ->isNotEmpty(); + } + + /** + * Remove a set of listeners from the dispatcher. + * + * @param string $event + * @return void + */ + public function forget($event) + { + // + } + + /** + * Forget all of the queued listeners. + * + * @return void + */ + public function forgetPushed() + { + // + } + + /** + * Dispatch an event and call the listeners. + * + * @param string|object $event + * @param mixed $payload + * @return mixed + */ + public function until($event, $payload = []) + { + return $this->dispatch($event, $payload, true); + } + + /** + * Get the events that have been dispatched. + * + * @return array + */ + public function dispatchedEvents() + { + return $this->events; + } + + /** + * Handle dynamic method calls to the dispatcher. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->forwardCallTo($this->dispatcher, $method, $parameters); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/ExceptionHandlerFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/ExceptionHandlerFake.php new file mode 100644 index 00000000..4b94b5c5 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/ExceptionHandlerFake.php @@ -0,0 +1,285 @@ + + */ + protected $reported = []; + + /** + * If the fake should throw exceptions when they are reported. + * + * @var bool + */ + protected $throwOnReport = false; + + /** + * Create a new exception handler fake. + * + * @param \Illuminate\Contracts\Debug\ExceptionHandler $handler + * @param list> $exceptions + */ + public function __construct( + protected ExceptionHandler $handler, + protected array $exceptions = [], + ) { + // + } + + /** + * Get the underlying handler implementation. + * + * @return \Illuminate\Contracts\Debug\ExceptionHandler + */ + public function handler() + { + return $this->handler; + } + + /** + * Assert if an exception of the given type has been reported. + * + * @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception + * @return void + */ + public function assertReported(Closure|string $exception) + { + $message = sprintf( + 'The expected [%s] exception was not reported.', + is_string($exception) ? $exception : $this->firstClosureParameterType($exception) + ); + + if (is_string($exception)) { + Assert::assertTrue( + in_array($exception, array_map(get_class(...), $this->reported), true), + $message, + ); + + return; + } + + Assert::assertTrue( + (new Collection($this->reported))->contains( + fn (Throwable $e) => $this->firstClosureParameterType($exception) === get_class($e) + && $exception($e) === true, + ), $message, + ); + } + + /** + * Assert the number of exceptions that have been reported. + * + * @param int $count + * @return void + */ + public function assertReportedCount(int $count) + { + $total = (new Collection($this->reported))->count(); + + PHPUnit::assertSame( + $count, $total, + "The total number of exceptions reported was {$total} instead of {$count}." + ); + } + + /** + * Assert if an exception of the given type has not been reported. + * + * @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception + * @return void + */ + public function assertNotReported(Closure|string $exception) + { + try { + $this->assertReported($exception); + } catch (ExpectationFailedException $e) { + return; + } + + throw new ExpectationFailedException(sprintf( + 'The expected [%s] exception was reported.', + is_string($exception) ? $exception : $this->firstClosureParameterType($exception) + )); + } + + /** + * Assert nothing has been reported. + * + * @return void + */ + public function assertNothingReported() + { + Assert::assertEmpty( + $this->reported, + sprintf( + 'The following exceptions were reported: %s.', + implode(', ', array_map(get_class(...), $this->reported)), + ), + ); + } + + /** + * Report or log an exception. + * + * @param \Throwable $e + * @return void + */ + public function report($e) + { + if (! $this->isFakedException($e)) { + $this->handler->report($e); + + return; + } + + if (! $this->shouldReport($e)) { + return; + } + + $this->reported[] = $e; + + if ($this->throwOnReport) { + throw $e; + } + } + + /** + * Determine if the given exception is faked. + * + * @param \Throwable $e + * @return bool + */ + protected function isFakedException(Throwable $e) + { + return count($this->exceptions) === 0 || in_array(get_class($e), $this->exceptions, true); + } + + /** + * Determine if the exception should be reported. + * + * @param \Throwable $e + * @return bool + */ + public function shouldReport($e) + { + return $this->runningWithoutExceptionHandling() || $this->handler->shouldReport($e); + } + + /** + * Determine if the handler is running without exception handling. + * + * @return bool + */ + protected function runningWithoutExceptionHandling() + { + return $this->handler instanceof WithoutExceptionHandlingHandler; + } + + /** + * Render an exception into an HTTP response. + * + * @param \Illuminate\Http\Request $request + * @param \Throwable $e + * @return \Symfony\Component\HttpFoundation\Response + */ + public function render($request, $e) + { + return $this->handler->render($request, $e); + } + + /** + * Render an exception to the console. + * + * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param \Throwable $e + * @return void + */ + public function renderForConsole($output, Throwable $e) + { + $this->handler->renderForConsole($output, $e); + } + + /** + * Throw exceptions when they are reported. + * + * @return $this + */ + public function throwOnReport() + { + $this->throwOnReport = true; + + return $this; + } + + /** + * Throw the first reported exception. + * + * @return $this + * + * @throws \Throwable + */ + public function throwFirstReported() + { + foreach ($this->reported as $e) { + throw $e; + } + + return $this; + } + + /** + * Get the exceptions that have been reported. + * + * @return list<\Throwable> + */ + public function reported() + { + return $this->reported; + } + + /** + * Set the "original" handler that should be used by the fake. + * + * @param \Illuminate\Contracts\Debug\ExceptionHandler $handler + * @return $this + */ + public function setHandler(ExceptionHandler $handler) + { + $this->handler = $handler; + + return $this; + } + + /** + * Handle dynamic method calls to the handler. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call(string $method, array $parameters) + { + return $this->forwardCallTo($this->handler, $method, $parameters); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/Fake.php b/plugins/vendor/illuminate/support/Testing/Fakes/Fake.php new file mode 100644 index 00000000..4a243c4e --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/Fake.php @@ -0,0 +1,8 @@ +manager = $manager; + $this->currentMailer = $manager->getDefaultDriver(); + } + + /** + * Assert if a mailable was sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|array|string|int|null $callback + * @return void + */ + public function assertSent($mailable, $callback = null) + { + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + if (is_numeric($callback)) { + return $this->assertSentTimes($mailable, $callback); + } + + $suggestion = count($this->queuedMailables) ? ' Did you mean to use assertQueued() instead?' : ''; + + if (is_array($callback) || is_string($callback)) { + foreach (Arr::wrap($callback) as $address) { + $callback = fn ($mail) => $mail->hasTo($address); + + PHPUnit::assertTrue( + $this->sent($mailable, $callback)->count() > 0, + "The expected [{$mailable}] mailable was not sent to address [{$address}].".$suggestion + ); + } + + return; + } + + PHPUnit::assertTrue( + $this->sent($mailable, $callback)->count() > 0, + "The expected [{$mailable}] mailable was not sent.".$suggestion + ); + } + + /** + * Assert if a mailable was sent a number of times. + * + * @param string $mailable + * @param int $times + * @return void + */ + protected function assertSentTimes($mailable, $times = 1) + { + $count = $this->sent($mailable)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$mailable}] mailable was sent {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if a mailable was not sent or queued to be sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return void + */ + public function assertNotOutgoing($mailable, $callback = null) + { + $this->assertNotSent($mailable, $callback); + $this->assertNotQueued($mailable, $callback); + } + + /** + * Determine if a mailable was not sent based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|array|string|null $callback + * @return void + */ + public function assertNotSent($mailable, $callback = null) + { + if (is_string($callback) || is_array($callback)) { + foreach (Arr::wrap($callback) as $address) { + $callback = fn ($mail) => $mail->hasTo($address); + + PHPUnit::assertCount( + 0, $this->sent($mailable, $callback), + "The unexpected [{$mailable}] mailable was sent to address [{$address}]." + ); + } + + return; + } + + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + PHPUnit::assertCount( + 0, $this->sent($mailable, $callback), + "The unexpected [{$mailable}] mailable was sent." + ); + } + + /** + * Assert that no mailables were sent or queued to be sent. + * + * @return void + */ + public function assertNothingOutgoing() + { + $this->assertNothingSent(); + $this->assertNothingQueued(); + } + + /** + * Assert that no mailables were sent. + * + * @return void + */ + public function assertNothingSent() + { + $mailableNames = (new Collection($this->mailables))->map( + fn ($mailable) => get_class($mailable) + )->join("\n- "); + + PHPUnit::assertEmpty($this->mailables, "The following mailables were sent unexpectedly:\n\n- $mailableNames\n"); + } + + /** + * Assert if a mailable was queued based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|array|string|int|null $callback + * @return void + */ + public function assertQueued($mailable, $callback = null) + { + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + if (is_numeric($callback)) { + return $this->assertQueuedTimes($mailable, $callback); + } + + if (is_string($callback) || is_array($callback)) { + foreach (Arr::wrap($callback) as $address) { + $callback = fn ($mail) => $mail->hasTo($address); + + PHPUnit::assertTrue( + $this->queued($mailable, $callback)->count() > 0, + "The expected [{$mailable}] mailable was not queued to address [{$address}]." + ); + } + + return; + } + + PHPUnit::assertTrue( + $this->queued($mailable, $callback)->count() > 0, + "The expected [{$mailable}] mailable was not queued." + ); + } + + /** + * Assert if a mailable was queued a number of times. + * + * @param string $mailable + * @param int $times + * @return void + */ + protected function assertQueuedTimes($mailable, $times = 1) + { + $count = $this->queued($mailable)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$mailable}] mailable was queued {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Determine if a mailable was not queued based on a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|array|string|null $callback + * @return void + */ + public function assertNotQueued($mailable, $callback = null) + { + if (is_string($callback) || is_array($callback)) { + foreach (Arr::wrap($callback) as $address) { + $callback = fn ($mail) => $mail->hasTo($address); + + PHPUnit::assertCount( + 0, $this->queued($mailable, $callback), + "The unexpected [{$mailable}] mailable was queued to address [{$address}]." + ); + } + + return; + } + + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + PHPUnit::assertCount( + 0, $this->queued($mailable, $callback), + "The unexpected [{$mailable}] mailable was queued." + ); + } + + /** + * Assert that no mailables were queued. + * + * @return void + */ + public function assertNothingQueued() + { + $mailableNames = (new Collection($this->queuedMailables))->map( + fn ($mailable) => get_class($mailable) + )->join("\n- "); + + PHPUnit::assertEmpty($this->queuedMailables, "The following mailables were queued unexpectedly:\n\n- $mailableNames\n"); + } + + /** + * Assert the total number of mailables that were sent. + * + * @param int $count + * @return void + */ + public function assertSentCount($count) + { + $total = (new Collection($this->mailables))->count(); + + PHPUnit::assertSame( + $count, $total, + "The total number of mailables sent was {$total} instead of {$count}." + ); + } + + /** + * Assert the total number of mailables that were queued. + * + * @param int $count + * @return void + */ + public function assertQueuedCount($count) + { + $total = (new Collection($this->queuedMailables))->count(); + + PHPUnit::assertSame( + $count, $total, + "The total number of mailables queued was {$total} instead of {$count}." + ); + } + + /** + * Assert the total number of mailables that were sent or queued. + * + * @param int $count + * @return void + */ + public function assertOutgoingCount($count) + { + $total = (new Collection($this->mailables)) + ->concat($this->queuedMailables) + ->count(); + + PHPUnit::assertSame( + $count, $total, + "The total number of outgoing mailables was {$total} instead of {$count}." + ); + } + + /** + * Get all of the mailables matching a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function sent($mailable, $callback = null) + { + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + if (! $this->hasSent($mailable)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return $this->mailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); + } + + /** + * Determine if the given mailable has been sent. + * + * @param string $mailable + * @return bool + */ + public function hasSent($mailable) + { + return $this->mailablesOf($mailable)->count() > 0; + } + + /** + * Get all of the queued mailables matching a truth-test callback. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function queued($mailable, $callback = null) + { + [$mailable, $callback] = $this->prepareMailableAndCallback($mailable, $callback); + + if (! $this->hasQueued($mailable)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return $this->queuedMailablesOf($mailable)->filter(fn ($mailable) => $callback($mailable)); + } + + /** + * Determine if the given mailable has been queued. + * + * @param string $mailable + * @return bool + */ + public function hasQueued($mailable) + { + return $this->queuedMailablesOf($mailable)->count() > 0; + } + + /** + * Get all of the mailed mailables for a given type. + * + * @param string $type + * @return \Illuminate\Support\Collection + */ + protected function mailablesOf($type) + { + return (new Collection($this->mailables))->filter(fn ($mailable) => $mailable instanceof $type); + } + + /** + * Get all of the mailed mailables for a given type. + * + * @param string $type + * @return \Illuminate\Support\Collection + */ + protected function queuedMailablesOf($type) + { + return (new Collection($this->queuedMailables))->filter(fn ($mailable) => $mailable instanceof $type); + } + + /** + * Get a mailer instance by name. + * + * @param string|null $name + * @return \Illuminate\Contracts\Mail\Mailer + */ + public function mailer($name = null) + { + $this->currentMailer = $name; + + return $this; + } + + /** + * Begin the process of mailing a mailable class instance. + * + * @param mixed $users + * @return \Illuminate\Mail\PendingMail + */ + public function to($users) + { + return (new PendingMailFake($this))->to($users); + } + + /** + * Begin the process of mailing a mailable class instance. + * + * @param mixed $users + * @return \Illuminate\Mail\PendingMail + */ + public function cc($users) + { + return (new PendingMailFake($this))->cc($users); + } + + /** + * Begin the process of mailing a mailable class instance. + * + * @param mixed $users + * @return \Illuminate\Mail\PendingMail + */ + public function bcc($users) + { + return (new PendingMailFake($this))->bcc($users); + } + + /** + * Send a new message with only a raw text part. + * + * @param string $text + * @param \Closure|string $callback + * @return void + */ + public function raw($text, $callback) + { + // + } + + /** + * Send a new message using a view. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param array $data + * @param \Closure|string|null $callback + * @return mixed|void + */ + public function send($view, array $data = [], $callback = null) + { + return $this->sendMail($view, $view instanceof ShouldQueue); + } + + /** + * Send a new message synchronously using a view. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $mailable + * @param array $data + * @param \Closure|string|null $callback + * @return void + */ + public function sendNow($mailable, array $data = [], $callback = null) + { + $this->sendMail($mailable, shouldQueue: false); + } + + /** + * Send a new message using a view. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param bool $shouldQueue + * @return mixed|void + */ + protected function sendMail($view, $shouldQueue = false) + { + if (! $view instanceof Mailable) { + return; + } + + $view->mailer($this->currentMailer); + + if ($shouldQueue) { + return $this->queue($view); + } + + $this->currentMailer = null; + + $this->mailables[] = $view; + } + + /** + * Queue a new message for sending. + * + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param string|null $queue + * @return mixed + */ + public function queue($view, $queue = null) + { + if (! $view instanceof Mailable) { + return; + } + + $view->mailer($this->currentMailer); + + $this->currentMailer = null; + + $this->queuedMailables[] = $view; + } + + /** + * Queue a new e-mail message for sending after (n) seconds. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @param \Illuminate\Contracts\Mail\Mailable|string|array $view + * @param string|null $queue + * @return mixed + */ + public function later($delay, $view, $queue = null) + { + $this->queue($view, $queue); + } + + /** + * Infer mailable class using reflection if a typehinted closure is passed to assertion. + * + * @param string|\Closure $mailable + * @param callable|null $callback + * @return array + */ + protected function prepareMailableAndCallback($mailable, $callback) + { + if ($mailable instanceof Closure) { + return [$this->firstClosureParameterType($mailable), $mailable]; + } + + return [$mailable, $callback]; + } + + /** + * Forget all of the resolved mailer instances. + * + * @return $this + */ + public function forgetMailers() + { + $this->currentMailer = null; + + return $this; + } + + /** + * Handle dynamic method calls to the mailer. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->forwardCallTo($this->manager, $method, $parameters); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/NotificationFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/NotificationFake.php new file mode 100644 index 00000000..9403e31b --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/NotificationFake.php @@ -0,0 +1,405 @@ +assertSentTo(new AnonymousNotifiable, $notification, $callback); + } + + /** + * Assert if a notification was sent based on a truth-test callback. + * + * @param mixed $notifiable + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * + * @throws \Exception + */ + public function assertSentTo($notifiable, $notification, $callback = null) + { + if (is_array($notifiable) || $notifiable instanceof Collection) { + if (count($notifiable) === 0) { + throw new Exception('No notifiable given.'); + } + + foreach ($notifiable as $singleNotifiable) { + $this->assertSentTo($singleNotifiable, $notification, $callback); + } + + return; + } + + if ($notification instanceof Closure) { + [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification]; + } + + if (is_numeric($callback)) { + return $this->assertSentToTimes($notifiable, $notification, $callback); + } + + PHPUnit::assertTrue( + $this->sent($notifiable, $notification, $callback)->count() > 0, + "The expected [{$notification}] notification was not sent." + ); + } + + /** + * Assert if a notification was sent on-demand a number of times. + * + * @param string $notification + * @param int $times + * @return void + */ + public function assertSentOnDemandTimes($notification, $times = 1) + { + $this->assertSentToTimes(new AnonymousNotifiable, $notification, $times); + } + + /** + * Assert if a notification was sent a number of times. + * + * @param mixed $notifiable + * @param string $notification + * @param int $times + * @return void + */ + public function assertSentToTimes($notifiable, $notification, $times = 1) + { + $count = $this->sent($notifiable, $notification)->count(); + + PHPUnit::assertSame( + $times, $count, + "Expected [{$notification}] to be sent {$times} times, but was sent {$count} times." + ); + } + + /** + * Determine if a notification was sent based on a truth-test callback. + * + * @param mixed $notifiable + * @param string|\Closure $notification + * @param callable|null $callback + * @return void + * + * @throws \Exception + */ + public function assertNotSentTo($notifiable, $notification, $callback = null) + { + if (is_array($notifiable) || $notifiable instanceof Collection) { + if (count($notifiable) === 0) { + throw new Exception('No notifiable given.'); + } + + foreach ($notifiable as $singleNotifiable) { + $this->assertNotSentTo($singleNotifiable, $notification, $callback); + } + + return; + } + + if ($notification instanceof Closure) { + [$notification, $callback] = [$this->firstClosureParameterType($notification), $notification]; + } + + PHPUnit::assertCount( + 0, $this->sent($notifiable, $notification, $callback), + "The unexpected [{$notification}] notification was sent." + ); + } + + /** + * Assert that no notifications were sent. + * + * @return void + */ + public function assertNothingSent() + { + $notificationNames = (new Collection($this->notifications)) + ->map(fn ($notifiableModels) => (new Collection($notifiableModels)) + ->map(fn ($notifiables) => (new Collection($notifiables))->keys()) + ) + ->flatten()->join("\n- "); + + PHPUnit::assertEmpty($this->notifications, "The following notifications were sent unexpectedly:\n\n- $notificationNames\n"); + } + + /** + * Assert that no notifications were sent to the given notifiable. + * + * @param mixed $notifiable + * @return void + * + * @throws \Exception + */ + public function assertNothingSentTo($notifiable) + { + if (is_array($notifiable) || $notifiable instanceof Collection) { + if (count($notifiable) === 0) { + throw new Exception('No notifiable given.'); + } + + foreach ($notifiable as $singleNotifiable) { + $this->assertNothingSentTo($singleNotifiable); + } + + return; + } + + PHPUnit::assertEmpty( + $this->notifications[get_class($notifiable)][$notifiable->getKey()] ?? [], + 'Notifications were sent unexpectedly.', + ); + } + + /** + * Assert the total amount of times a notification was sent. + * + * @param string $notification + * @param int $expectedCount + * @return void + */ + public function assertSentTimes($notification, $expectedCount) + { + $actualCount = (new Collection($this->notifications)) + ->flatten(1) + ->reduce(fn ($count, $sent) => $count + count($sent[$notification] ?? []), 0); + + PHPUnit::assertSame( + $expectedCount, $actualCount, + sprintf( + "Expected [{$notification}] to be sent {$expectedCount} %s, but was sent {$actualCount} %s.", + Str::plural('time', $expectedCount), + Str::plural('time', $actualCount) + ) + ); + } + + /** + * Assert the total count of notification that were sent. + * + * @param int $expectedCount + * @return void + */ + public function assertCount($expectedCount) + { + $actualCount = (new Collection($this->notifications))->flatten(3)->count(); + + PHPUnit::assertSame( + $expectedCount, $actualCount, + "Expected {$expectedCount} notifications to be sent, but {$actualCount} were sent." + ); + } + + /** + * Get all of the notifications matching a truth-test callback. + * + * @param mixed $notifiable + * @param string $notification + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function sent($notifiable, $notification, $callback = null) + { + if (! $this->hasSent($notifiable, $notification)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + $notifications = new Collection($this->notificationsFor($notifiable, $notification)); + + return $notifications->filter( + fn ($arguments) => $callback(...array_values($arguments)) + )->pluck('notification'); + } + + /** + * Determine if there are more notifications left to inspect. + * + * @param mixed $notifiable + * @param string $notification + * @return bool + */ + public function hasSent($notifiable, $notification) + { + return ! empty($this->notificationsFor($notifiable, $notification)); + } + + /** + * Get all of the notifications for a notifiable entity by type. + * + * @param mixed $notifiable + * @param string $notification + * @return array + */ + protected function notificationsFor($notifiable, $notification) + { + return $this->notifications[get_class($notifiable)][(string) $notifiable->getKey()][$notification] ?? []; + } + + /** + * Send the given notification to the given notifiable entities. + * + * @param \Illuminate\Support\Collection|mixed $notifiables + * @param mixed $notification + * @return void + */ + public function send($notifiables, $notification) + { + $this->sendNow($notifiables, $notification); + } + + /** + * Send the given notification immediately. + * + * @param \Illuminate\Support\Collection|mixed $notifiables + * @param mixed $notification + * @param array|null $channels + * @return void + */ + public function sendNow($notifiables, $notification, ?array $channels = null) + { + if (! $notifiables instanceof Collection && ! is_array($notifiables)) { + $notifiables = [$notifiables]; + } + + foreach ($notifiables as $notifiable) { + if (! $notification->id) { + $notification->id = Str::uuid()->toString(); + } + + $notifiableChannels = $channels ?: $notification->via($notifiable); + + if (method_exists($notification, 'shouldSend')) { + $notifiableChannels = array_filter( + $notifiableChannels, + fn ($channel) => $notification->shouldSend($notifiable, $channel) !== false + ); + } + + if (empty($notifiableChannels)) { + continue; + } + + $this->notifications[get_class($notifiable)][(string) $notifiable->getKey()][get_class($notification)][] = [ + 'notification' => $this->serializeAndRestore && $notification instanceof ShouldQueue + ? $this->serializeAndRestoreNotification($notification) + : $notification, + 'channels' => $notifiableChannels, + 'notifiable' => $notifiable, + 'locale' => $notification->locale ?? $this->locale ?? value(function () use ($notifiable) { + if ($notifiable instanceof HasLocalePreference) { + return $notifiable->preferredLocale(); + } + }), + ]; + } + } + + /** + * Get a channel instance by name. + * + * @param string|null $name + * @return mixed + */ + public function channel($name = null) + { + // + } + + /** + * Set the locale of notifications. + * + * @param string $locale + * @return $this + */ + public function locale($locale) + { + $this->locale = $locale; + + return $this; + } + + /** + * Specify if notification should be serialized and restored when being "pushed" to the queue. + * + * @param bool $serializeAndRestore + * @return $this + */ + public function serializeAndRestore(bool $serializeAndRestore = true) + { + $this->serializeAndRestore = $serializeAndRestore; + + return $this; + } + + /** + * Serialize and unserialize the notification to simulate the queueing process. + * + * @param mixed $notification + * @return mixed + */ + protected function serializeAndRestoreNotification($notification) + { + return unserialize(serialize($notification)); + } + + /** + * Get the notifications that have been sent. + * + * @return array + */ + public function sentNotifications() + { + return $this->notifications; + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php new file mode 100644 index 00000000..6c06cf06 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/PendingBatchFake.php @@ -0,0 +1,48 @@ +bus = $bus; + $this->jobs = $jobs; + } + + /** + * Dispatch the batch. + * + * @return \Illuminate\Bus\Batch + */ + public function dispatch() + { + return $this->bus->recordPendingBatch($this); + } + + /** + * Dispatch the batch after the response is sent to the browser. + * + * @return \Illuminate\Bus\Batch + */ + public function dispatchAfterResponse() + { + return $this->bus->recordPendingBatch($this); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/PendingChainFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/PendingChainFake.php new file mode 100644 index 00000000..42d98c17 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/PendingChainFake.php @@ -0,0 +1,55 @@ +bus = $bus; + $this->job = $job; + $this->chain = $chain; + } + + /** + * Dispatch the job with the given arguments. + * + * @return \Illuminate\Foundation\Bus\PendingDispatch + */ + public function dispatch() + { + if (is_string($this->job)) { + $firstJob = new $this->job(...func_get_args()); + } elseif ($this->job instanceof Closure) { + $firstJob = CallQueuedClosure::create($this->job); + } else { + $firstJob = $this->job; + } + + $firstJob->allOnConnection($this->connection); + $firstJob->allOnQueue($this->queue); + $firstJob->chain($this->chain); + $firstJob->delay($this->delay); + $firstJob->chainCatchCallbacks = $this->catchCallbacks(); + + return $this->bus->dispatch($firstJob); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php new file mode 100644 index 00000000..a3d64e73 --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/PendingMailFake.php @@ -0,0 +1,52 @@ +mailer = $mailer; + } + + /** + * Send a new mailable message instance. + * + * @param \Illuminate\Contracts\Mail\Mailable $mailable + * @return void + */ + public function send(Mailable $mailable) + { + $this->mailer->send($this->fill($mailable)); + } + + /** + * Send a new mailable message instance synchronously. + * + * @param \Illuminate\Contracts\Mail\Mailable $mailable + * @return void + */ + public function sendNow(Mailable $mailable) + { + $this->mailer->sendNow($this->fill($mailable)); + } + + /** + * Push the given mailable onto the queue. + * + * @param \Illuminate\Contracts\Mail\Mailable $mailable + * @return mixed + */ + public function queue(Mailable $mailable) + { + return $this->mailer->queue($this->fill($mailable)); + } +} diff --git a/plugins/vendor/illuminate/support/Testing/Fakes/QueueFake.php b/plugins/vendor/illuminate/support/Testing/Fakes/QueueFake.php new file mode 100644 index 00000000..b379a9ac --- /dev/null +++ b/plugins/vendor/illuminate/support/Testing/Fakes/QueueFake.php @@ -0,0 +1,689 @@ +} + */ +class QueueFake extends QueueManager implements Fake, Queue +{ + use ReflectsClosures; + + /** + * The original queue manager. + * + * @var \Illuminate\Contracts\Queue\Queue + */ + public $queue; + + /** + * The job types that should be intercepted instead of pushed to the queue. + * + * @var \Illuminate\Support\Collection + */ + protected $jobsToFake; + + /** + * The job types that should be pushed to the queue and not intercepted. + * + * @var \Illuminate\Support\Collection + */ + protected $jobsToBeQueued; + + /** + * All of the jobs that have been pushed. + * + * @var array + */ + protected $jobs = []; + + /** + * All of the payloads that have been raw pushed. + * + * @var list + */ + protected $rawPushes = []; + + /** + * Indicates if items should be serialized and restored when pushed to the queue. + * + * @var bool + */ + protected bool $serializeAndRestore = false; + + /** + * Create a new fake queue instance. + * + * @param \Illuminate\Contracts\Foundation\Application $app + * @param array $jobsToFake + * @param \Illuminate\Queue\QueueManager|null $queue + */ + public function __construct($app, $jobsToFake = [], $queue = null) + { + parent::__construct($app); + + $this->jobsToFake = Collection::wrap($jobsToFake); + $this->jobsToBeQueued = new Collection; + $this->queue = $queue; + } + + /** + * Specify the jobs that should be queued instead of faked. + * + * @param array|string $jobsToBeQueued + * @return $this + */ + public function except($jobsToBeQueued) + { + $this->jobsToBeQueued = Collection::wrap($jobsToBeQueued)->merge($this->jobsToBeQueued); + + return $this; + } + + /** + * Assert if a job was pushed based on a truth-test callback. + * + * @param string|\Closure $job + * @param callable|int|null $callback + * @return void + */ + public function assertPushed($job, $callback = null) + { + if ($job instanceof Closure) { + [$job, $callback] = [$this->firstClosureParameterType($job), $job]; + } + + if (is_numeric($callback)) { + return $this->assertPushedTimes($job, $callback); + } + + PHPUnit::assertTrue( + $this->pushed($job, $callback)->count() > 0, + "The expected [{$job}] job was not pushed." + ); + } + + /** + * Assert if a job was pushed a number of times. + * + * @param string $job + * @param int $times + * @return void + */ + protected function assertPushedTimes($job, $times = 1) + { + $count = $this->pushed($job)->count(); + + PHPUnit::assertSame( + $times, $count, + sprintf( + "The expected [{$job}] job was pushed {$count} %s instead of {$times} %s.", + Str::plural('time', $count), + Str::plural('time', $times) + ) + ); + } + + /** + * Assert if a job was pushed based on a truth-test callback. + * + * @param string $queue + * @param string|\Closure $job + * @param callable|null $callback + * @return void + */ + public function assertPushedOn($queue, $job, $callback = null) + { + if ($job instanceof Closure) { + [$job, $callback] = [$this->firstClosureParameterType($job), $job]; + } + + $this->assertPushed($job, function ($job, $pushedQueue) use ($callback, $queue) { + if ($pushedQueue !== $queue) { + return false; + } + + return $callback ? $callback(...func_get_args()) : true; + }); + } + + /** + * Assert if a job was pushed with chained jobs based on a truth-test callback. + * + * @param string $job + * @param array $expectedChain + * @param callable|null $callback + * @return void + */ + public function assertPushedWithChain($job, $expectedChain = [], $callback = null) + { + PHPUnit::assertTrue( + $this->pushed($job, $callback)->isNotEmpty(), + "The expected [{$job}] job was not pushed." + ); + + PHPUnit::assertTrue( + (new Collection($expectedChain))->isNotEmpty(), + 'The expected chain can not be empty.' + ); + + $this->isChainOfObjects($expectedChain) + ? $this->assertPushedWithChainOfObjects($job, $expectedChain, $callback) + : $this->assertPushedWithChainOfClasses($job, $expectedChain, $callback); + } + + /** + * Assert if a job was pushed with an empty chain based on a truth-test callback. + * + * @param string $job + * @param callable|null $callback + * @return void + */ + public function assertPushedWithoutChain($job, $callback = null) + { + PHPUnit::assertTrue( + $this->pushed($job, $callback)->isNotEmpty(), + "The expected [{$job}] job was not pushed." + ); + + $this->assertPushedWithChainOfClasses($job, [], $callback); + } + + /** + * Assert if a job was pushed with chained jobs based on a truth-test callback. + * + * @param string $job + * @param array $expectedChain + * @param callable|null $callback + * @return void + */ + protected function assertPushedWithChainOfObjects($job, $expectedChain, $callback) + { + $chain = (new Collection($expectedChain))->map(fn ($job) => serialize($job))->all(); + + PHPUnit::assertTrue( + $this->pushed($job, $callback)->filter(fn ($job) => $job->chained == $chain)->isNotEmpty(), + 'The expected chain was not pushed.' + ); + } + + /** + * Assert if a job was pushed with chained jobs based on a truth-test callback. + * + * @param string $job + * @param array $expectedChain + * @param callable|null $callback + * @return void + */ + protected function assertPushedWithChainOfClasses($job, $expectedChain, $callback) + { + $matching = $this->pushed($job, $callback)->map->chained->map(function ($chain) { + return (new Collection($chain))->map(function ($job) { + return get_class(unserialize($job)); + }); + })->filter(function ($chain) use ($expectedChain) { + return $chain->all() === $expectedChain; + }); + + PHPUnit::assertTrue( + $matching->isNotEmpty(), 'The expected chain was not pushed.' + ); + } + + /** + * Assert if a closure was pushed based on a truth-test callback. + * + * @param callable|int|null $callback + * @return void + */ + public function assertClosurePushed($callback = null) + { + $this->assertPushed(CallQueuedClosure::class, $callback); + } + + /** + * Assert that a closure was not pushed based on a truth-test callback. + * + * @param callable|null $callback + * @return void + */ + public function assertClosureNotPushed($callback = null) + { + $this->assertNotPushed(CallQueuedClosure::class, $callback); + } + + /** + * Determine if the given chain is entirely composed of objects. + * + * @param array $chain + * @return bool + */ + protected function isChainOfObjects($chain) + { + return ! (new Collection($chain))->contains(fn ($job) => ! is_object($job)); + } + + /** + * Determine if a job was pushed based on a truth-test callback. + * + * @param string|\Closure $job + * @param callable|null $callback + * @return void + */ + public function assertNotPushed($job, $callback = null) + { + if ($job instanceof Closure) { + [$job, $callback] = [$this->firstClosureParameterType($job), $job]; + } + + PHPUnit::assertCount( + 0, $this->pushed($job, $callback), + "The unexpected [{$job}] job was pushed." + ); + } + + /** + * Assert the total count of jobs that were pushed. + * + * @param int $expectedCount + * @return void + */ + public function assertCount($expectedCount) + { + $actualCount = (new Collection($this->jobs))->flatten(1)->count(); + + PHPUnit::assertSame( + $expectedCount, $actualCount, + "Expected {$expectedCount} jobs to be pushed, but found {$actualCount} instead." + ); + } + + /** + * Assert that no jobs were pushed. + * + * @return void + */ + public function assertNothingPushed() + { + $pushedJobs = implode("\n- ", array_keys($this->jobs)); + + PHPUnit::assertEmpty($this->jobs, "The following jobs were pushed unexpectedly:\n\n- $pushedJobs\n"); + } + + /** + * Get all of the jobs matching a truth-test callback. + * + * @param string $job + * @param callable|null $callback + * @return \Illuminate\Support\Collection + */ + public function pushed($job, $callback = null) + { + if (! $this->hasPushed($job)) { + return new Collection; + } + + $callback = $callback ?: fn () => true; + + return (new Collection($this->jobs[$job]))->filter( + fn ($data) => $callback($data['job'], $data['queue'], $data['data']) + )->pluck('job'); + } + + /** + * Get all of the raw pushes matching a truth-test callback. + * + * @param null|\Closure(string, ?string, array): bool $callback + * @return \Illuminate\Support\Collection + */ + public function pushedRaw($callback = null) + { + $callback ??= static fn () => true; + + return (new Collection($this->rawPushes))->filter(fn ($data) => $callback($data['payload'], $data['queue'], $data['options'])); + } + + /** + * Get all of the jobs by listener class, passing an optional truth-test callback. + * + * @param class-string $listenerClass + * @param (\Closure(mixed, \Illuminate\Events\CallQueuedListener, string|null, mixed): bool)|null $callback + * @return \Illuminate\Support\Collection + */ + public function listenersPushed($listenerClass, $callback = null) + { + if (! $this->hasPushed(CallQueuedListener::class)) { + return new Collection; + } + + $collection = (new Collection($this->jobs[CallQueuedListener::class])) + ->filter(fn ($data) => $data['job']->class === $listenerClass); + + if ($callback) { + $collection = $collection->filter(fn ($data) => $callback($data['job']->data[0] ?? null, $data['job'], $data['queue'], $data['data'])); + } + + return $collection->pluck('job'); + } + + /** + * Determine if there are any stored jobs for a given class. + * + * @param string $job + * @return bool + */ + public function hasPushed($job) + { + return isset($this->jobs[$job]) && ! empty($this->jobs[$job]); + } + + /** + * Resolve a queue connection instance. + * + * @param mixed $value + * @return \Illuminate\Contracts\Queue\Queue + */ + public function connection($value = null) + { + return $this; + } + + /** + * Get the size of the queue. + * + * @param string|null $queue + * @return int + */ + public function size($queue = null) + { + return (new Collection($this->jobs)) + ->flatten(1) + ->filter(fn ($job) => $job['queue'] === $queue) + ->count(); + } + + /** + * Get the number of pending jobs. + * + * @param string|null $queue + * @return int + */ + public function pendingSize($queue = null) + { + return $this->size($queue); + } + + /** + * Get the number of delayed jobs. + * + * @param string|null $queue + * @return int + */ + public function delayedSize($queue = null) + { + return 0; + } + + /** + * Get the number of reserved jobs. + * + * @param string|null $queue + * @return int + */ + public function reservedSize($queue = null) + { + return 0; + } + + /** + * Get the creation timestamp of the oldest pending job, excluding delayed jobs. + * + * @param string|null $queue + * @return int|null + */ + public function creationTimeOfOldestPendingJob($queue = null) + { + return null; + } + + /** + * Push a new job onto the queue. + * + * @param string|object $job + * @param mixed $data + * @param string|null $queue + * @return mixed + */ + public function push($job, $data = '', $queue = null) + { + if ($this->shouldFakeJob($job)) { + if ($job instanceof Closure) { + $job = CallQueuedClosure::create($job); + } + + $this->jobs[is_object($job) ? get_class($job) : $job][] = [ + 'job' => $this->serializeAndRestore ? $this->serializeAndRestoreJob($job) : $job, + 'queue' => $queue, + 'data' => $data, + ]; + } else { + is_object($job) && isset($job->connection) + ? $this->queue->connection($job->connection)->push($job, $data, $queue) + : $this->queue->push($job, $data, $queue); + } + } + + /** + * Determine if a job should be faked or actually dispatched. + * + * @param object $job + * @return bool + */ + public function shouldFakeJob($job) + { + if ($this->shouldDispatchJob($job)) { + return false; + } + + if ($this->jobsToFake->isEmpty()) { + return true; + } + + return $this->jobsToFake->contains( + fn ($jobToFake) => $job instanceof ((string) $jobToFake) || $job === (string) $jobToFake + ); + } + + /** + * Determine if a job should be pushed to the queue instead of faked. + * + * @param object $job + * @return bool + */ + protected function shouldDispatchJob($job) + { + if ($this->jobsToBeQueued->isEmpty()) { + return false; + } + + return $this->jobsToBeQueued->contains( + fn ($jobToQueue) => $job instanceof ((string) $jobToQueue) + ); + } + + /** + * Push a raw payload onto the queue. + * + * @param string $payload + * @param string|null $queue + * @param array $options + * @return mixed + */ + public function pushRaw($payload, $queue = null, array $options = []) + { + $this->rawPushes[] = [ + 'payload' => $payload, + 'queue' => $queue, + 'options' => $options, + ]; + } + + /** + * Push a new job onto the queue after (n) seconds. + * + * @param \DateTimeInterface|\DateInterval|int $delay + * @param string|object $job + * @param mixed $data + * @param string|null $queue + * @return mixed + */ + public function later($delay, $job, $data = '', $queue = null) + { + return $this->push($job, $data, $queue); + } + + /** + * Push a new job onto the queue. + * + * @param string $queue + * @param string|object $job + * @param mixed $data + * @return mixed + */ + public function pushOn($queue, $job, $data = '') + { + return $this->push($job, $data, $queue); + } + + /** + * Push a new job onto a specific queue after (n) seconds. + * + * @param string $queue + * @param \DateTimeInterface|\DateInterval|int $delay + * @param string|object $job + * @param mixed $data + * @return mixed + */ + public function laterOn($queue, $delay, $job, $data = '') + { + return $this->push($job, $data, $queue); + } + + /** + * Pop the next job off of the queue. + * + * @param string|null $queue + * @return \Illuminate\Contracts\Queue\Job|null + */ + public function pop($queue = null) + { + // + } + + /** + * Push an array of jobs onto the queue. + * + * @param array $jobs + * @param mixed $data + * @param string|null $queue + * @return mixed + */ + public function bulk($jobs, $data = '', $queue = null) + { + foreach ($jobs as $job) { + $this->push($job, $data, $queue); + } + } + + /** + * Get the jobs that have been pushed. + * + * @return array + */ + public function pushedJobs() + { + return $this->jobs; + } + + /** + * Get the payloads that were pushed raw. + * + * @return list + */ + public function rawPushes() + { + return $this->rawPushes; + } + + /** + * Specify if jobs should be serialized and restored when being "pushed" to the queue. + * + * @param bool $serializeAndRestore + * @return $this + */ + public function serializeAndRestore(bool $serializeAndRestore = true) + { + $this->serializeAndRestore = $serializeAndRestore; + + return $this; + } + + /** + * Serialize and unserialize the job to simulate the queueing process. + * + * @param mixed $job + * @return mixed + */ + protected function serializeAndRestoreJob($job) + { + return unserialize(serialize($job)); + } + + /** + * Get the connection name for the queue. + * + * @return string + */ + public function getConnectionName() + { + // + } + + /** + * Set the connection name for the queue. + * + * @param string $name + * @return $this + */ + public function setConnectionName($name) + { + return $this; + } + + /** + * Override the QueueManager to prevent circular dependency. + * + * @param string $method + * @param array $parameters + * @return mixed + * + * @throws \BadMethodCallException + */ + public function __call($method, $parameters) + { + throw new BadMethodCallException(sprintf( + 'Call to undefined method %s::%s()', static::class, $method + )); + } +} diff --git a/plugins/vendor/illuminate/support/Timebox.php b/plugins/vendor/illuminate/support/Timebox.php new file mode 100644 index 00000000..586a5754 --- /dev/null +++ b/plugins/vendor/illuminate/support/Timebox.php @@ -0,0 +1,86 @@ +earlyReturn && $remainder > 0) { + $this->usleep($remainder); + } + + if ($exception) { + throw $exception; + } + + return $result; + } + + /** + * Indicate that the timebox can return early. + * + * @return $this + */ + public function returnEarly() + { + $this->earlyReturn = true; + + return $this; + } + + /** + * Indicate that the timebox cannot return early. + * + * @return $this + */ + public function dontReturnEarly() + { + $this->earlyReturn = false; + + return $this; + } + + /** + * Sleep for the specified number of microseconds. + * + * @param int $microseconds + * @return void + */ + protected function usleep(int $microseconds) + { + Sleep::usleep($microseconds); + } +} diff --git a/plugins/vendor/illuminate/support/Traits/CapsuleManagerTrait.php b/plugins/vendor/illuminate/support/Traits/CapsuleManagerTrait.php new file mode 100644 index 00000000..05327552 --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/CapsuleManagerTrait.php @@ -0,0 +1,69 @@ +container = $container; + + if (! $this->container->bound('config')) { + $this->container->instance('config', new Fluent); + } + } + + /** + * Make this capsule instance available globally. + * + * @return void + */ + public function setAsGlobal() + { + static::$instance = $this; + } + + /** + * Get the IoC container instance. + * + * @return \Illuminate\Contracts\Container\Container + */ + public function getContainer() + { + return $this->container; + } + + /** + * Set the IoC container instance. + * + * @param \Illuminate\Contracts\Container\Container $container + * @return void + */ + public function setContainer(Container $container) + { + $this->container = $container; + } +} diff --git a/plugins/vendor/illuminate/support/Traits/Dumpable.php b/plugins/vendor/illuminate/support/Traits/Dumpable.php new file mode 100644 index 00000000..44ad14df --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/Dumpable.php @@ -0,0 +1,30 @@ +{$method}(...$parameters); + } catch (Error|BadMethodCallException $e) { + $pattern = '~^Call to undefined method (?P[^:]+)::(?P[^\(]+)\(\)$~'; + + if (! preg_match($pattern, $e->getMessage(), $matches)) { + throw $e; + } + + if ($matches['class'] != get_class($object) || + $matches['method'] != $method) { + throw $e; + } + + static::throwBadMethodCallException($method); + } + } + + /** + * Forward a method call to the given object, returning $this if the forwarded call returned itself. + * + * @param mixed $object + * @param string $method + * @param array $parameters + * @return mixed + * + * @throws \BadMethodCallException + */ + protected function forwardDecoratedCallTo($object, $method, $parameters) + { + $result = $this->forwardCallTo($object, $method, $parameters); + + return $result === $object ? $this : $result; + } + + /** + * Throw a bad method call exception for the given method. + * + * @param string $method + * @return never + * + * @throws \BadMethodCallException + */ + protected static function throwBadMethodCallException($method) + { + throw new BadMethodCallException(sprintf( + 'Call to undefined method %s::%s()', static::class, $method + )); + } +} diff --git a/plugins/vendor/illuminate/support/Traits/InteractsWithData.php b/plugins/vendor/illuminate/support/Traits/InteractsWithData.php new file mode 100644 index 00000000..43174746 --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/InteractsWithData.php @@ -0,0 +1,426 @@ +has($key); + } + + /** + * Determine if the data contains a given key. + * + * @param string|array $key + * @return bool + */ + public function has($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + $data = $this->all(); + + foreach ($keys as $value) { + if (! Arr::has($data, $value)) { + return false; + } + } + + return true; + } + + /** + * Determine if the instance contains any of the given keys. + * + * @param string|array $keys + * @return bool + */ + public function hasAny($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + $data = $this->all(); + + return Arr::hasAny($data, $keys); + } + + /** + * Apply the callback if the instance contains the given key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenHas($key, callable $callback, ?callable $default = null) + { + if ($this->has($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Determine if the instance contains a non-empty value for the given key. + * + * @param string|array $key + * @return bool + */ + public function filled($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if ($this->isEmptyString($value)) { + return false; + } + } + + return true; + } + + /** + * Determine if the instance contains an empty value for the given key. + * + * @param string|array $key + * @return bool + */ + public function isNotFilled($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if (! $this->isEmptyString($value)) { + return false; + } + } + + return true; + } + + /** + * Determine if the instance contains a non-empty value for any of the given keys. + * + * @param string|array $keys + * @return bool + */ + public function anyFilled($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + foreach ($keys as $key) { + if ($this->filled($key)) { + return true; + } + } + + return false; + } + + /** + * Apply the callback if the instance contains a non-empty value for the given key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenFilled($key, callable $callback, ?callable $default = null) + { + if ($this->filled($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Determine if the instance is missing a given key. + * + * @param string|array $key + * @return bool + */ + public function missing($key) + { + $keys = is_array($key) ? $key : func_get_args(); + + return ! $this->has($keys); + } + + /** + * Apply the callback if the instance is missing the given key. + * + * @param string $key + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function whenMissing($key, callable $callback, ?callable $default = null) + { + if ($this->missing($key)) { + return $callback(data_get($this->all(), $key)) ?: $this; + } + + if ($default) { + return $default(); + } + + return $this; + } + + /** + * Determine if the given key is an empty string for "filled". + * + * @param string $key + * @return bool + */ + protected function isEmptyString($key) + { + $value = $this->data($key); + + return ! is_bool($value) && ! is_array($value) && trim((string) $value) === ''; + } + + /** + * Retrieve data from the instance as a Stringable instance. + * + * @param string $key + * @param mixed $default + * @return \Illuminate\Support\Stringable + */ + public function str($key, $default = null) + { + return $this->string($key, $default); + } + + /** + * Retrieve data from the instance as a Stringable instance. + * + * @param string $key + * @param mixed $default + * @return \Illuminate\Support\Stringable + */ + public function string($key, $default = null) + { + return Str::of($this->data($key, $default)); + } + + /** + * Retrieve data as a boolean value. + * + * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. + * + * @param string|null $key + * @param bool $default + * @return bool + */ + public function boolean($key = null, $default = false) + { + return filter_var($this->data($key, $default), FILTER_VALIDATE_BOOLEAN); + } + + /** + * Retrieve data as an integer value. + * + * @param string $key + * @param int $default + * @return int + */ + public function integer($key, $default = 0) + { + return intval($this->data($key, $default)); + } + + /** + * Retrieve data as a float value. + * + * @param string $key + * @param float $default + * @return float + */ + public function float($key, $default = 0.0) + { + return floatval($this->data($key, $default)); + } + + /** + * Retrieve data from the instance as a Carbon instance. + * + * @param string $key + * @param string|null $format + * @param \UnitEnum|string|null $tz + * @return \Illuminate\Support\Carbon|null + * + * @throws \Carbon\Exceptions\InvalidFormatException + */ + public function date($key, $format = null, $tz = null) + { + $tz = enum_value($tz); + + if ($this->isNotFilled($key)) { + return null; + } + + if (is_null($format)) { + return Date::parse($this->data($key), $tz); + } + + return Date::createFromFormat($format, $this->data($key), $tz); + } + + /** + * Retrieve data from the instance as an enum. + * + * @template TEnum of \BackedEnum + * + * @param string $key + * @param class-string $enumClass + * @param TEnum|null $default + * @return TEnum|null + */ + public function enum($key, $enumClass, $default = null) + { + if ($this->isNotFilled($key) || ! $this->isBackedEnum($enumClass)) { + return value($default); + } + + return $enumClass::tryFrom($this->data($key)) ?: value($default); + } + + /** + * Retrieve data from the instance as an array of enums. + * + * @template TEnum of \BackedEnum + * + * @param string $key + * @param class-string $enumClass + * @return TEnum[] + */ + public function enums($key, $enumClass) + { + if ($this->isNotFilled($key) || ! $this->isBackedEnum($enumClass)) { + return []; + } + + return $this->collect($key) + ->map(fn ($value) => $enumClass::tryFrom($value)) + ->filter() + ->all(); + } + + /** + * Determine if the given enum class is backed. + * + * @param class-string $enumClass + * @return bool + */ + protected function isBackedEnum($enumClass) + { + return enum_exists($enumClass) && method_exists($enumClass, 'tryFrom'); + } + + /** + * Retrieve data from the instance as an array. + * + * @param array|string|null $key + * @return array + */ + public function array($key = null) + { + return (array) (is_array($key) ? $this->only($key) : $this->data($key)); + } + + /** + * Retrieve data from the instance as a collection. + * + * @param array|string|null $key + * @return \Illuminate\Support\Collection + */ + public function collect($key = null) + { + return new Collection(is_array($key) ? $this->only($key) : $this->data($key)); + } + + /** + * Get a subset containing the provided keys with values from the instance data. + * + * @param mixed $keys + * @return array + */ + public function only($keys) + { + $results = []; + + $data = $this->all(); + + $placeholder = new stdClass; + + foreach (is_array($keys) ? $keys : func_get_args() as $key) { + $value = data_get($data, $key, $placeholder); + + if ($value !== $placeholder) { + Arr::set($results, $key, $value); + } + } + + return $results; + } + + /** + * Get all of the data except for a specified array of items. + * + * @param mixed $keys + * @return array + */ + public function except($keys) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + $results = $this->all(); + + Arr::forget($results, $keys); + + return $results; + } +} diff --git a/plugins/vendor/illuminate/support/Traits/Localizable.php b/plugins/vendor/illuminate/support/Traits/Localizable.php new file mode 100644 index 00000000..1e9fa58c --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/Localizable.php @@ -0,0 +1,34 @@ +getLocale(); + + try { + $app->setLocale($locale); + + return $callback(); + } finally { + $app->setLocale($original); + } + } +} diff --git a/plugins/vendor/illuminate/support/Traits/ReflectsClosures.php b/plugins/vendor/illuminate/support/Traits/ReflectsClosures.php new file mode 100644 index 00000000..9e12285a --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/ReflectsClosures.php @@ -0,0 +1,95 @@ +closureParameterTypes($closure)); + + if (! $types) { + throw new RuntimeException('The given Closure has no parameters.'); + } + + if ($types[0] === null) { + throw new RuntimeException('The first parameter of the given Closure is missing a type hint.'); + } + + return $types[0]; + } + + /** + * Get the class names of the first parameter of the given Closure, including union types. + * + * @param \Closure $closure + * @return array + * + * @throws \ReflectionException + * @throws \RuntimeException + */ + protected function firstClosureParameterTypes(Closure $closure) + { + $reflection = new ReflectionFunction($closure); + + $types = (new Collection($reflection->getParameters())) + ->mapWithKeys(function ($parameter) { + if ($parameter->isVariadic()) { + return [$parameter->getName() => null]; + } + + return [$parameter->getName() => Reflector::getParameterClassNames($parameter)]; + }) + ->filter() + ->values() + ->all(); + + if (empty($types)) { + throw new RuntimeException('The given Closure has no parameters.'); + } + + if (isset($types[0]) && empty($types[0])) { + throw new RuntimeException('The first parameter of the given Closure is missing a type hint.'); + } + + return $types[0]; + } + + /** + * Get the class names / types of the parameters of the given Closure. + * + * @param \Closure $closure + * @return array + * + * @throws \ReflectionException + */ + protected function closureParameterTypes(Closure $closure) + { + $reflection = new ReflectionFunction($closure); + + return (new Collection($reflection->getParameters())) + ->mapWithKeys(function ($parameter) { + if ($parameter->isVariadic()) { + return [$parameter->getName() => null]; + } + + return [$parameter->getName() => Reflector::getParameterClassName($parameter)]; + }) + ->all(); + } +} diff --git a/plugins/vendor/illuminate/support/Traits/Tappable.php b/plugins/vendor/illuminate/support/Traits/Tappable.php new file mode 100644 index 00000000..9369e9ac --- /dev/null +++ b/plugins/vendor/illuminate/support/Traits/Tappable.php @@ -0,0 +1,17 @@ +uri = $uri instanceof UriInterface ? $uri : LeagueUri::new((string) $uri); + } + + /** + * Create a new URI instance. + */ + public static function of(UriInterface|Stringable|string $uri = ''): static + { + return new static($uri); + } + + /** + * Get a URI instance of an absolute URL for the given path. + */ + public static function to(string $path): static + { + return new static(call_user_func(static::$urlGeneratorResolver)->to($path)); + } + + /** + * Get a URI instance for a named route. + * + * @param \BackedEnum|string $name + * @param mixed $parameters + * @param bool $absolute + * @return static + * + * @throws \Symfony\Component\Routing\Exception\RouteNotFoundException|\InvalidArgumentException + */ + public static function route($name, $parameters = [], $absolute = true): static + { + return new static(call_user_func(static::$urlGeneratorResolver)->route($name, $parameters, $absolute)); + } + + /** + * Create a signed route URI instance for a named route. + * + * @param \BackedEnum|string $name + * @param mixed $parameters + * @param \DateTimeInterface|\DateInterval|int|null $expiration + * @param bool $absolute + * @return static + * + * @throws \InvalidArgumentException + */ + public static function signedRoute($name, $parameters = [], $expiration = null, $absolute = true): static + { + return new static(call_user_func(static::$urlGeneratorResolver)->signedRoute($name, $parameters, $expiration, $absolute)); + } + + /** + * Create a temporary signed route URI instance for a named route. + * + * @param \BackedEnum|string $name + * @param \DateTimeInterface|\DateInterval|int $expiration + * @param array $parameters + * @param bool $absolute + * @return static + */ + public static function temporarySignedRoute($name, $expiration, $parameters = [], $absolute = true): static + { + return static::signedRoute($name, $parameters, $expiration, $absolute); + } + + /** + * Get a URI instance for a controller action. + * + * @param string|array $action + * @param mixed $parameters + * @param bool $absolute + * @return static + * + * @throws \InvalidArgumentException + */ + public static function action($action, $parameters = [], $absolute = true): static + { + return new static(call_user_func(static::$urlGeneratorResolver)->action($action, $parameters, $absolute)); + } + + /** + * Get the URI's scheme. + */ + public function scheme(): ?string + { + return $this->uri->getScheme(); + } + + /** + * Get the user from the URI. + */ + public function user(bool $withPassword = false): ?string + { + return $withPassword + ? $this->uri->getUserInfo() + : $this->uri->getUsername(); + } + + /** + * Get the password from the URI. + */ + public function password(): ?string + { + return $this->uri->getPassword(); + } + + /** + * Get the URI's host. + */ + public function host(): ?string + { + return $this->uri->getHost(); + } + + /** + * Get the URI's port. + */ + public function port(): ?int + { + return $this->uri->getPort(); + } + + /** + * Get the URI's path. + * + * Empty or missing paths are returned as a single "/". + */ + public function path(): ?string + { + $path = trim((string) $this->uri->getPath(), '/'); + + return $path === '' ? '/' : $path; + } + + /** + * Get the URI's path segments. + * + * Empty or missing paths are returned as an empty collection. + */ + public function pathSegments(): Collection + { + $path = $this->path(); + + return $path === '/' ? new Collection : new Collection(explode('/', $path)); + } + + /** + * Get the URI's query string. + */ + public function query(): UriQueryString + { + return new UriQueryString($this); + } + + /** + * Get the URI's fragment. + */ + public function fragment(): ?string + { + return $this->uri->getFragment(); + } + + /** + * Specify the scheme of the URI. + */ + public function withScheme(Stringable|string $scheme): static + { + return new static($this->uri->withScheme($scheme)); + } + + /** + * Specify the user and password for the URI. + */ + public function withUser(Stringable|string|null $user, #[SensitiveParameter] Stringable|string|null $password = null): static + { + return new static($this->uri->withUserInfo($user, $password)); + } + + /** + * Specify the host of the URI. + */ + public function withHost(Stringable|string $host): static + { + return new static($this->uri->withHost($host)); + } + + /** + * Specify the port of the URI. + */ + public function withPort(?int $port): static + { + return new static($this->uri->withPort($port)); + } + + /** + * Specify the path of the URI. + */ + public function withPath(Stringable|string $path): static + { + return new static($this->uri->withPath(Str::start((string) $path, '/'))); + } + + /** + * Merge new query parameters into the URI. + */ + public function withQuery(array $query, bool $merge = true): static + { + foreach ($query as $key => $value) { + if ($value instanceof UrlRoutable) { + $query[$key] = $value->getRouteKey(); + } + } + + if ($merge) { + $mergedQuery = $this->query()->all(); + + foreach ($query as $key => $value) { + data_set($mergedQuery, $key, $value); + } + + $newQuery = $mergedQuery; + } else { + $newQuery = []; + + foreach ($query as $key => $value) { + data_set($newQuery, $key, $value); + } + } + + return new static($this->uri->withQuery(Arr::query($newQuery) ?: null)); + } + + /** + * Merge new query parameters into the URI if they are not already in the query string. + */ + public function withQueryIfMissing(array $query): static + { + $currentQuery = $this->query(); + + foreach ($query as $key => $value) { + if (! $currentQuery->missing($key)) { + Arr::forget($query, $key); + } + } + + return $this->withQuery($query); + } + + /** + * Push a value onto the end of a query string parameter that is a list. + */ + public function pushOntoQuery(string $key, mixed $value): static + { + $currentValue = data_get($this->query()->all(), $key); + + $values = Arr::wrap($value); + + return $this->withQuery([$key => match (true) { + is_array($currentValue) && array_is_list($currentValue) => array_values(array_unique([...$currentValue, ...$values])), + is_array($currentValue) => [...$currentValue, ...$values], + ! is_null($currentValue) => [$currentValue, ...$values], + default => $values, + }]); + } + + /** + * Remove the given query parameters from the URI. + */ + public function withoutQuery(array|string $keys): static + { + return $this->replaceQuery(Arr::except($this->query()->all(), $keys)); + } + + /** + * Specify new query parameters for the URI. + */ + public function replaceQuery(array $query): static + { + return $this->withQuery($query, merge: false); + } + + /** + * Specify the fragment of the URI. + */ + public function withFragment(string $fragment): static + { + return new static($this->uri->withFragment($fragment)); + } + + /** + * Create a redirect HTTP response for the given URI. + */ + public function redirect(int $status = 302, array $headers = []): RedirectResponse + { + return new RedirectResponse($this->value(), $status, $headers); + } + + /** + * Get the URI as a Stringable instance. + * + * @return \Illuminate\Support\Stringable + */ + public function toStringable() + { + return Str::of($this->value()); + } + + /** + * Create an HTTP response that represents the URI object. + * + * @param \Illuminate\Http\Request $request + * @return \Symfony\Component\HttpFoundation\Response + */ + public function toResponse($request) + { + return new RedirectResponse($this->value()); + } + + /** + * Get the URI as a string of HTML. + * + * @return string + */ + public function toHtml() + { + return $this->value(); + } + + /** + * Get the decoded string representation of the URI. + */ + public function decode(): string + { + if (empty($this->query()->toArray())) { + return $this->value(); + } + + return Str::replace(Str::after($this->value(), '?'), $this->query()->decode(), $this->value()); + } + + /** + * Get the string representation of the URI. + */ + public function value(): string + { + return (string) $this; + } + + /** + * Determine if the URI is currently an empty string. + */ + public function isEmpty(): bool + { + return trim($this->value()) === ''; + } + + /** + * Dump the string representation of the URI. + * + * @param mixed ...$args + * @return $this + */ + public function dump(...$args) + { + dump($this->value(), ...$args); + + return $this; + } + + /** + * Set the URL generator resolver. + */ + public static function setUrlGeneratorResolver(Closure $urlGeneratorResolver): void + { + static::$urlGeneratorResolver = $urlGeneratorResolver; + } + + /** + * Get the underlying URI instance. + */ + public function getUri(): UriInterface + { + return $this->uri; + } + + /** + * Convert the object into a value that is JSON serializable. + * + * @return string + */ + public function jsonSerialize(): string + { + return $this->value(); + } + + /** + * Get the string representation of the URI. + */ + public function __toString(): string + { + return $this->uri->toString(); + } +} diff --git a/plugins/vendor/illuminate/support/UriQueryString.php b/plugins/vendor/illuminate/support/UriQueryString.php new file mode 100644 index 00000000..ccfb66fe --- /dev/null +++ b/plugins/vendor/illuminate/support/UriQueryString.php @@ -0,0 +1,96 @@ +toArray(); + + if (! $keys) { + return $query; + } + + $results = []; + + foreach (is_array($keys) ? $keys : func_get_args() as $key) { + Arr::set($results, $key, Arr::get($query, $key)); + } + + return $results; + } + + /** + * Retrieve data from the instance. + * + * @param string|null $key + * @param mixed $default + * @return mixed + */ + protected function data($key = null, $default = null) + { + return $this->get($key, $default); + } + + /** + * Get a query string parameter. + */ + public function get(?string $key = null, mixed $default = null): mixed + { + return data_get($this->toArray(), $key, $default); + } + + /** + * Get the URL decoded version of the query string. + */ + public function decode(): string + { + return rawurldecode((string) $this); + } + + /** + * Get the string representation of the query string. + */ + public function value(): string + { + return (string) $this; + } + + /** + * Convert the query string into an array. + */ + public function toArray() + { + return QueryString::extract($this->value()); + } + + /** + * Get the string representation of the query string. + */ + public function __toString(): string + { + return (string) $this->uri->getUri()->getQuery(); + } +} diff --git a/plugins/vendor/illuminate/support/ValidatedInput.php b/plugins/vendor/illuminate/support/ValidatedInput.php new file mode 100644 index 00000000..f6bde4a8 --- /dev/null +++ b/plugins/vendor/illuminate/support/ValidatedInput.php @@ -0,0 +1,240 @@ +input = $input; + } + + /** + * Merge the validated input with the given array of additional data. + * + * @param array $items + * @return static + */ + public function merge(array $items) + { + return new static(array_merge($this->all(), $items)); + } + + /** + * Get the raw, underlying input array. + * + * @param mixed $keys + * @return array + */ + public function all($keys = null) + { + if (! $keys) { + return $this->input; + } + + $input = []; + + foreach (is_array($keys) ? $keys : func_get_args() as $key) { + Arr::set($input, $key, Arr::get($this->input, $key)); + } + + return $input; + } + + /** + * Retrieve data from the instance. + * + * @param string|null $key + * @param mixed $default + * @return mixed + */ + protected function data($key = null, $default = null) + { + return $this->input($key, $default); + } + + /** + * Get the keys for all of the input. + * + * @return array + */ + public function keys() + { + return array_keys($this->input()); + } + + /** + * Retrieve an input item from the validated inputs. + * + * @param string|null $key + * @param mixed $default + * @return mixed + */ + public function input($key = null, $default = null) + { + return data_get( + $this->all(), $key, $default + ); + } + + /** + * Dump the validated inputs items and end the script. + * + * @param mixed ...$keys + * @return never + */ + public function dd(...$keys) + { + $this->dump(...$keys); + + exit(1); + } + + /** + * Dump the items. + * + * @param mixed $keys + * @return $this + */ + public function dump($keys = []) + { + $keys = is_array($keys) ? $keys : func_get_args(); + + VarDumper::dump(count($keys) > 0 ? $this->only($keys) : $this->all()); + + return $this; + } + + /** + * Get the instance as an array. + * + * @return array + */ + public function toArray() + { + return $this->all(); + } + + /** + * Dynamically access input data. + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + return $this->input($name); + } + + /** + * Dynamically set input data. + * + * @param string $name + * @param mixed $value + * @return mixed + */ + public function __set($name, $value) + { + $this->input[$name] = $value; + } + + /** + * Determine if an input item is set. + * + * @return bool + */ + public function __isset($name) + { + return $this->exists($name); + } + + /** + * Remove an input item. + * + * @param string $name + * @return void + */ + public function __unset($name) + { + unset($this->input[$name]); + } + + /** + * Determine if an item exists at an offset. + * + * @param mixed $key + * @return bool + */ + public function offsetExists($key): bool + { + return $this->exists($key); + } + + /** + * Get an item at a given offset. + * + * @param mixed $key + * @return mixed + */ + public function offsetGet($key): mixed + { + return $this->input($key); + } + + /** + * Set the item at a given offset. + * + * @param mixed $key + * @param mixed $value + * @return void + */ + public function offsetSet($key, $value): void + { + if (is_null($key)) { + $this->input[] = $value; + } else { + $this->input[$key] = $value; + } + } + + /** + * Unset the item at a given offset. + * + * @param string $key + * @return void + */ + public function offsetUnset($key): void + { + unset($this->input[$key]); + } + + /** + * Get an iterator for the input. + * + * @return \ArrayIterator + */ + public function getIterator(): Traversable + { + return new ArrayIterator($this->input); + } +} diff --git a/plugins/vendor/illuminate/support/ViewErrorBag.php b/plugins/vendor/illuminate/support/ViewErrorBag.php new file mode 100644 index 00000000..3d95bded --- /dev/null +++ b/plugins/vendor/illuminate/support/ViewErrorBag.php @@ -0,0 +1,131 @@ + + */ + protected $bags = []; + + /** + * Checks if a named MessageBag exists in the bags. + * + * @param string $key + * @return bool + */ + public function hasBag($key = 'default') + { + return isset($this->bags[$key]); + } + + /** + * Get a MessageBag instance from the bags. + * + * @param string $key + * @return \Illuminate\Contracts\Support\MessageBag + */ + public function getBag($key) + { + return Arr::get($this->bags, $key) ?: new MessageBag; + } + + /** + * Get all the bags. + * + * @return array + */ + public function getBags() + { + return $this->bags; + } + + /** + * Add a new MessageBag instance to the bags. + * + * @param string $key + * @param \Illuminate\Contracts\Support\MessageBag $bag + * @return $this + */ + public function put($key, MessageBagContract $bag) + { + $this->bags[$key] = $bag; + + return $this; + } + + /** + * Determine if the default message bag has any messages. + * + * @return bool + */ + public function any() + { + return $this->count() > 0; + } + + /** + * Get the number of messages in the default bag. + * + * @return int + */ + public function count(): int + { + return $this->getBag('default')->count(); + } + + /** + * Dynamically call methods on the default bag. + * + * @param string $method + * @param array $parameters + * @return mixed + */ + public function __call($method, $parameters) + { + return $this->getBag('default')->$method(...$parameters); + } + + /** + * Dynamically access a view error bag. + * + * @param string $key + * @return \Illuminate\Contracts\Support\MessageBag + */ + public function __get($key) + { + return $this->getBag($key); + } + + /** + * Dynamically set a view error bag. + * + * @param string $key + * @param \Illuminate\Contracts\Support\MessageBag $value + * @return void + */ + public function __set($key, $value) + { + $this->put($key, $value); + } + + /** + * Convert the default bag to its string representation. + * + * @return string + */ + public function __toString() + { + return (string) $this->getBag('default'); + } +} diff --git a/plugins/vendor/illuminate/support/composer.json b/plugins/vendor/illuminate/support/composer.json new file mode 100644 index 00000000..477b5b1f --- /dev/null +++ b/plugins/vendor/illuminate/support/composer.json @@ -0,0 +1,66 @@ +{ + "name": "illuminate/support", + "description": "The Illuminate Support package.", + "license": "MIT", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "require": { + "php": "^8.2", + "ext-ctype": "*", + "ext-filter": "*", + "ext-mbstring": "*", + "doctrine/inflector": "^2.0", + "illuminate/collections": "^12.0", + "illuminate/conditionable": "^12.0", + "illuminate/contracts": "^12.0", + "illuminate/macroable": "^12.0", + "nesbot/carbon": "^3.8.4", + "symfony/polyfill-php83": "^1.33", + "symfony/polyfill-php85": "^1.33", + "voku/portable-ascii": "^2.0.2" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "replace": { + "spatie/once": "*" + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "functions.php", + "helpers.php" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "12.x-dev" + } + }, + "suggest": { + "illuminate/filesystem": "Required to use the Composer class (^12.0).", + "laravel/serializable-closure": "Required to use the once function (^1.3|^2.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.7).", + "league/uri": "Required to use the Uri class (^7.5.1).", + "ramsey/uuid": "Required to use Str::uuid() (^4.7).", + "symfony/process": "Required to use the Composer class (^7.2).", + "symfony/uid": "Required to use Str::ulid() (^7.2).", + "symfony/var-dumper": "Required to use the dd function (^7.2).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.6.1)." + }, + "config": { + "sort-packages": true + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/illuminate/support/functions.php b/plugins/vendor/illuminate/support/functions.php new file mode 100644 index 00000000..bb596c65 --- /dev/null +++ b/plugins/vendor/illuminate/support/functions.php @@ -0,0 +1,49 @@ + app(DeferredCallbackCollection::class)[] = $deferred + ); + } +} + +if (! function_exists('Illuminate\Support\php_binary')) { + /** + * Determine the PHP Binary. + */ + function php_binary(): string + { + return (new PhpExecutableFinder)->find(false) ?: 'php'; + } +} + +if (! function_exists('Illuminate\Support\artisan_binary')) { + /** + * Determine the proper Artisan executable. + */ + function artisan_binary(): string + { + return defined('ARTISAN_BINARY') ? ARTISAN_BINARY : 'artisan'; + } +} diff --git a/plugins/vendor/illuminate/support/helpers.php b/plugins/vendor/illuminate/support/helpers.php new file mode 100644 index 00000000..3c2d1764 --- /dev/null +++ b/plugins/vendor/illuminate/support/helpers.php @@ -0,0 +1,517 @@ + $value) { + if (is_numeric($key)) { + $start++; + + $array[$start] = Arr::pull($array, $key); + } + } + + return $array; + } +} + +if (! function_exists('blank')) { + /** + * Determine if the given value is "blank". + * + * @phpstan-assert-if-false !=null|'' $value + * + * @phpstan-assert-if-true !=numeric|bool $value + * + * @param mixed $value + */ + function blank($value): bool + { + if (is_null($value)) { + return true; + } + + if (is_string($value)) { + return trim($value) === ''; + } + + if (is_numeric($value) || is_bool($value)) { + return false; + } + + if ($value instanceof Model) { + return false; + } + + if ($value instanceof Countable) { + return count($value) === 0; + } + + if ($value instanceof Stringable) { + return trim((string) $value) === ''; + } + + return empty($value); + } +} + +if (! function_exists('class_basename')) { + /** + * Get the class "basename" of the given object / class. + * + * @param string|object $class + */ + function class_basename($class): string + { + $class = is_object($class) ? get_class($class) : $class; + + return basename(str_replace('\\', '/', $class)); + } +} + +if (! function_exists('class_uses_recursive')) { + /** + * Returns all traits used by a class, its parent classes and trait of their traits. + * + * @param object|string $class + * @return array + */ + function class_uses_recursive($class): array + { + if (is_object($class)) { + $class = get_class($class); + } + + $results = []; + + foreach (array_reverse(class_parents($class) ?: []) + [$class => $class] as $class) { + $results += trait_uses_recursive($class); + } + + return array_unique($results); + } +} + +if (! function_exists('e')) { + /** + * Encode HTML special characters in a string. + * + * @param \Illuminate\Contracts\Support\DeferringDisplayableValue|\Illuminate\Contracts\Support\Htmlable|\BackedEnum|string|int|float|null $value + * @param bool $doubleEncode + */ + function e($value, $doubleEncode = true): string + { + if ($value instanceof DeferringDisplayableValue) { + $value = $value->resolveDisplayableValue(); + } + + if ($value instanceof Htmlable) { + return $value->toHtml(); + } + + if ($value instanceof BackedEnum) { + $value = $value->value; + } + + return htmlspecialchars($value ?? '', ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8', $doubleEncode); + } +} + +if (! function_exists('env')) { + /** + * Gets the value of an environment variable. + * + * @param string $key + * @param mixed $default + * @return mixed + */ + function env($key, $default = null) + { + return Env::get($key, $default); + } +} + +if (! function_exists('filled')) { + /** + * Determine if a value is "filled". + * + * @phpstan-assert-if-true !=null|'' $value + * + * @phpstan-assert-if-false !=numeric|bool $value + * + * @param mixed $value + */ + function filled($value): bool + { + return ! blank($value); + } +} + +if (! function_exists('fluent')) { + /** + * Create a Fluent object from the given value. + * + * @param iterable|object|null $value + */ + function fluent($value = null): Fluent + { + return new Fluent($value ?? []); + } +} + +if (! function_exists('literal')) { + /** + * Return a new literal or anonymous object using named arguments. + * + * @return mixed + */ + function literal(...$arguments) + { + if (count($arguments) === 1 && array_is_list($arguments)) { + return $arguments[0]; + } + + return (object) $arguments; + } +} + +if (! function_exists('object_get')) { + /** + * Get an item from an object using "dot" notation. + * + * @template TValue of object + * + * @param TValue $object + * @param string|null $key + * @param mixed $default + * @return ($key is empty ? TValue : mixed) + */ + function object_get($object, $key, $default = null) + { + if (is_null($key) || trim($key) === '') { + return $object; + } + + foreach (explode('.', $key) as $segment) { + if (! is_object($object) || ! isset($object->{$segment})) { + return value($default); + } + + $object = $object->{$segment}; + } + + return $object; + } +} + +if (! function_exists('laravel_cloud')) { + /** + * Determine if the application is running on Laravel Cloud. + */ + function laravel_cloud(): bool + { + return ($_ENV['LARAVEL_CLOUD'] ?? false) === '1' || + ($_SERVER['LARAVEL_CLOUD'] ?? false) === '1'; + } +} + +if (! function_exists('once')) { + /** + * Ensures a callable is only called once, and returns the result on subsequent calls. + * + * @template TReturnType + * + * @param callable(): TReturnType $callback + * @return TReturnType + */ + function once(callable $callback) + { + $onceable = Onceable::tryFromTrace( + debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2), + $callback, + ); + + return $onceable ? Once::instance()->value($onceable) : call_user_func($callback); + } +} + +if (! function_exists('optional')) { + /** + * Provide access to optional objects. + * + * @template TValue + * @template TReturn + * + * @param TValue $value + * @param (callable(TValue): TReturn)|null $callback + * @return ($callback is null ? \Illuminate\Support\Optional : ($value is null ? null : TReturn)) + */ + function optional($value = null, ?callable $callback = null) + { + if (is_null($callback)) { + return new Optional($value); + } elseif (! is_null($value)) { + return $callback($value); + } + } +} + +if (! function_exists('preg_replace_array')) { + /** + * Replace a given pattern with each value in the array in sequentially. + * + * @param string $pattern + * @param array $replacements + * @param string $subject + */ + function preg_replace_array($pattern, array $replacements, $subject): string + { + return preg_replace_callback($pattern, function () use (&$replacements) { + foreach ($replacements as $value) { + return array_shift($replacements); + } + }, $subject); + } +} + +if (! function_exists('retry')) { + /** + * Retry an operation a given number of times. + * + * @template TValue + * + * @param int|array $times + * @param callable(int): TValue $callback + * @param int|\Closure(int, \Throwable): int $sleepMilliseconds + * @param (callable(\Throwable): bool)|null $when + * @return TValue + * + * @throws \Throwable + */ + function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) + { + $attempts = 0; + + $backoff = []; + + if (is_array($times)) { + $backoff = $times; + + $times = count($times) + 1; + } + + beginning: + $attempts++; + $times--; + + try { + return $callback($attempts); + } catch (Throwable $e) { + if ($times < 1 || ($when && ! $when($e))) { + throw $e; + } + + $sleepMilliseconds = $backoff[$attempts - 1] ?? $sleepMilliseconds; + + if ($sleepMilliseconds) { + Sleep::usleep(value($sleepMilliseconds, $attempts, $e) * 1000); + } + + goto beginning; + } + } +} + +if (! function_exists('str')) { + /** + * Get a new stringable object from the given string. + * + * @param string|null $string + * @return ($string is null ? object : \Illuminate\Support\Stringable) + */ + function str($string = null) + { + if (func_num_args() === 0) { + return new class + { + public function __call($method, $parameters) + { + return Str::$method(...$parameters); + } + + public function __toString() + { + return ''; + } + }; + } + + return new SupportStringable($string); + } +} + +if (! function_exists('tap')) { + /** + * Call the given Closure with the given value then return the value. + * + * @template TValue + * + * @param TValue $value + * @param (callable(TValue): mixed)|null $callback + * @return ($callback is null ? \Illuminate\Support\HigherOrderTapProxy : TValue) + */ + function tap($value, $callback = null) + { + if (is_null($callback)) { + return new HigherOrderTapProxy($value); + } + + $callback($value); + + return $value; + } +} + +if (! function_exists('throw_if')) { + /** + * Throw the given exception if the given condition is true. + * + * @template TValue + * @template TException of \Throwable + * + * @param TValue $condition + * @param TException|class-string|string $exception + * @param mixed ...$parameters + * @return ($condition is true ? never : ($condition is non-empty-mixed ? never : TValue)) + * + * @throws TException + */ + function throw_if($condition, $exception = 'RuntimeException', ...$parameters) + { + if ($condition) { + if (is_string($exception) && class_exists($exception)) { + $exception = new $exception(...$parameters); + } + + throw is_string($exception) ? new RuntimeException($exception) : $exception; + } + + return $condition; + } +} + +if (! function_exists('throw_unless')) { + /** + * Throw the given exception unless the given condition is true. + * + * @template TValue + * @template TException of \Throwable + * + * @param TValue $condition + * @param TException|class-string|string $exception + * @param mixed ...$parameters + * @return ($condition is false ? never : ($condition is non-empty-mixed ? TValue : never)) + * + * @throws TException + */ + function throw_unless($condition, $exception = 'RuntimeException', ...$parameters) + { + throw_if(! $condition, $exception, ...$parameters); + + return $condition; + } +} + +if (! function_exists('trait_uses_recursive')) { + /** + * Returns all traits used by a trait and its traits. + * + * @param object|string $trait + * @return array + */ + function trait_uses_recursive($trait): array + { + $traits = class_uses($trait) ?: []; + + foreach ($traits as $trait) { + $traits += trait_uses_recursive($trait); + } + + return $traits; + } +} + +if (! function_exists('transform')) { + /** + * Transform the given value if it is present. + * + * @template TValue + * @template TReturn + * @template TDefault + * + * @param TValue $value + * @param callable(TValue): TReturn $callback + * @param TDefault|callable(TValue): TDefault $default + * @return ($value is empty ? TDefault : TReturn) + */ + function transform($value, callable $callback, $default = null) + { + if (filled($value)) { + return $callback($value); + } + + if (is_callable($default)) { + return $default($value); + } + + return $default; + } +} + +if (! function_exists('windows_os')) { + /** + * Determine whether the current environment is Windows based. + */ + function windows_os(): bool + { + return PHP_OS_FAMILY === 'Windows'; + } +} + +if (! function_exists('with')) { + /** + * Return the given value, optionally passed through the given callback. + * + * @template TValue + * @template TReturn + * + * @param TValue $value + * @param (callable(TValue): (TReturn))|null $callback + * @return ($callback is null ? TValue : TReturn) + */ + function with($value, ?callable $callback = null) + { + return is_null($callback) ? $value : $callback($value); + } +} diff --git a/plugins/vendor/nesbot/carbon/.phpstorm.meta.php b/plugins/vendor/nesbot/carbon/.phpstorm.meta.php new file mode 100644 index 00000000..bd7c7e0e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/.phpstorm.meta.php @@ -0,0 +1,10 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\MessageFormatter; + +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +if (!class_exists(LazyMessageFormatter::class, false)) { + abstract class LazyMessageFormatter implements MessageFormatterInterface + { + public function format(string $message, string $locale, array $parameters = []): string + { + return $this->formatter->format( + $message, + $this->transformLocale($locale), + $parameters + ); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php b/plugins/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php new file mode 100644 index 00000000..cbd890d5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\MessageFormatter; + +use Symfony\Component\Translation\Formatter\ChoiceMessageFormatterInterface; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +if (!class_exists(LazyMessageFormatter::class, false)) { + abstract class LazyMessageFormatter implements MessageFormatterInterface, ChoiceMessageFormatterInterface + { + abstract protected function transformLocale(?string $locale): ?string; + + public function format($message, $locale, array $parameters = []) + { + return $this->formatter->format( + $message, + $this->transformLocale($locale), + $parameters + ); + } + + public function choiceFormat($message, $number, $locale, array $parameters = []) + { + return $this->formatter->choiceFormat($message, $number, $locale, $parameters); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/lazy/Carbon/ProtectedDatePeriod.php b/plugins/vendor/nesbot/carbon/lazy/Carbon/ProtectedDatePeriod.php new file mode 100644 index 00000000..927e48d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/lazy/Carbon/ProtectedDatePeriod.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use DatePeriod; + +if (!class_exists(DatePeriodBase::class, false)) { + class DatePeriodBase extends DatePeriod + { + /** + * Period start in PHP < 8.2. + * + * @var CarbonInterface + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period start. + */ + protected $start; + + /** + * Period end in PHP < 8.2. + * + * @var CarbonInterface|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period end. + */ + protected $end; + + /** + * Period current iterated date in PHP < 8.2. + * + * @var CarbonInterface|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period current iterated date. + */ + protected $current; + + /** + * Period interval in PHP < 8.2. + * + * @var CarbonInterval|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period interval. + */ + protected $interval; + + /** + * Period recurrences in PHP < 8.2. + * + * @var int|float|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period recurrences. + */ + protected $recurrences; + + /** + * Period start included option in PHP < 8.2. + * + * @var bool + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period start included option. + */ + protected $include_start_date; + } +} diff --git a/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php b/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php new file mode 100644 index 00000000..d35308a6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorStrongType.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator implements TranslatorStrongTypeInterface + { + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + return $this->translate($id, $parameters, $domain, $locale); + } + + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages') + { + $messages = $this->getPrivateProperty($catalogue, 'messages'); + + if (isset($messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id])) { + return $messages[$domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX][$id]; + } + + if (isset($messages[$domain][$id])) { + return $messages[$domain][$id]; + } + + $fallbackCatalogue = $this->getPrivateProperty($catalogue, 'fallbackCatalogue'); + + if ($fallbackCatalogue !== null) { + return $this->getFromCatalogue($fallbackCatalogue, $id, $domain); + } + + return $id; + } + + private function getPrivateProperty($instance, string $field) + { + return (function (string $field) { + return $this->$field; + })->call($instance, $field); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php b/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php new file mode 100644 index 00000000..94dbdc30 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/lazy/Carbon/TranslatorWeakType.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +if (!class_exists(LazyTranslator::class, false)) { + class LazyTranslator extends AbstractTranslator + { + /** + * Returns the translation. + * + * @param string|null $id + * @param array $parameters + * @param string|null $domain + * @param string|null $locale + * + * @return string + */ + public function trans($id, array $parameters = [], $domain = null, $locale = null) + { + return $this->translate($id, $parameters, $domain, $locale); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/lazy/Carbon/UnprotectedDatePeriod.php b/plugins/vendor/nesbot/carbon/lazy/Carbon/UnprotectedDatePeriod.php new file mode 100644 index 00000000..2341be71 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/lazy/Carbon/UnprotectedDatePeriod.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use DatePeriod; + +if (!class_exists(DatePeriodBase::class, false)) { + class DatePeriodBase extends DatePeriod + { + } +} diff --git a/plugins/vendor/nesbot/carbon/readme.md b/plugins/vendor/nesbot/carbon/readme.md new file mode 100644 index 00000000..32bfc6b2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/readme.md @@ -0,0 +1,189 @@ +# Carbon + +[![Latest Stable Version](https://img.shields.io/packagist/v/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) +[![Total Downloads](https://img.shields.io/packagist/dt/nesbot/carbon.svg?style=flat-square)](https://packagist.org/packages/nesbot/carbon) +[![GitHub Actions](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FCarbonPHP%2Fcarbon%2Fbadge&style=flat-square&label=Build&logo=none)](https://github.com/CarbonPHP/carbon/actions) +[![codecov.io](https://img.shields.io/codecov/c/github/CarbonPHP/carbon.svg?style=flat-square)](https://codecov.io/github/CarbonPHP/carbon/actions?branch=master) + +An international PHP extension for DateTime. [https://carbon.nesbot.com](https://carbon.nesbot.com) + +> [!NOTE] +> We're migrating the repository from [briannesbitt/Carbon](https://github.com/briannesbitt/Carbon) to [CarbonPHP/carbon](https://github.com/CarbonPHP/carbon), +> which means if you're looking specific issues/pull-requests, you may have to search both. No other impact as code on both will be kept up to date. + +```php +toDateTimeString()); +printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver')); //implicit __toString() +$tomorrow = Carbon::now()->addDay(); +$lastWeek = Carbon::now()->subWeek(); + +$officialDate = Carbon::now()->toRfc2822String(); + +$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age; + +$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London'); + +$internetWillBlowUpOn = Carbon::create(2038, 01, 19, 3, 14, 7, 'GMT'); + +// Don't really want this to happen so mock now +Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1)); + +// comparisons are always done in UTC +if (Carbon::now()->gte($internetWillBlowUpOn)) { + die(); +} + +// Phew! Return to normal behaviour +Carbon::setTestNow(); + +if (Carbon::now()->isWeekend()) { + echo 'Party!'; +} +// Over 200 languages (and over 500 regional variants) supported: +echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago' +echo Carbon::now()->subMinutes(2)->locale('zh_CN')->diffForHumans(); // '2分钟前' +echo Carbon::parse('2019-07-23 14:51')->isoFormat('LLLL'); // 'Tuesday, July 23, 2019 2:51 PM' +echo Carbon::parse('2019-07-23 14:51')->locale('fr_FR')->isoFormat('LLLL'); // 'mardi 23 juillet 2019 14:51' + +// ... but also does 'from now', 'after' and 'before' +// rolling up to seconds, minutes, hours, days, months, years + +$daysSinceEpoch = Carbon::createFromTimestamp(0)->diffInDays(); // something such as: + // 19817.6771 +$daysUntilInternetBlowUp = $internetWillBlowUpOn->diffInDays(); // Negative value since it's in the future: + // -5037.4560 + +// Without parameter, difference is calculated from now, but doing $a->diff($b) +// it will count time from $a to $b. +Carbon::createFromTimestamp(0)->diffInDays($internetWillBlowUpOn); // 24855.1348 +``` + +## Installation + +### With Composer + +``` +$ composer require nesbot/carbon +``` + +```json +{ + "require": { + "nesbot/carbon": "^3" + } +} +``` + +```php + + +### Translators + +[Thanks to people helping us to translate Carbon in so many languages](https://carbon.nesbot.com/contribute/translators/) + +### Sponsors + +Support this project by becoming a sponsor. Your logo will show up here with a link to your website. + + +Онлайн казино 777 +Non GamStop Bookies UK +Best non Gamstop sites in the UK +Route4Me Route Planner +gaia-wines.gr +Букмекер +non Gamstop casinos +CasinoHex Canada +Real Money Pokies +best non Gamstop casinos +Betking казино
See more +OnlineCasinosSpelen +Guidebook.BetWinner +Онлайн казино casino.ua +PayIDGambler +Legal Casino +Playfortune.net.br +https://play-fortune.pl/kasyno/z-minimalnym-depozytem/ +Best Betting +WestNews онлайн казино Украины +Online Kasyno Polis +Sportsbook Reviews Online +Ставки на спорт Favbet +UK casinos not on GamStop +Casino-portugal.pt +Probukmacher +Tidelift +inkedin +Slots not on GamStop +Онлайн казино України +Slots City +Sites not on GamStop +Лучшие онлайн казино Украины на Sportarena +Онлайн казино та їхні бонуси y-k.com.ua +Non Gamstop Casinos +Slotozilla +Ігрові автомати +ssddanbrown
+ +[[See all](https://carbon.nesbot.com/#sponsors)] + +[[Become a sponsor via OpenCollective*](https://opencollective.com/Carbon#sponsor)] + +[[Become a sponsor via GitHub*](https://github.com/sponsors/kylekatarnls)] + +* This is a donation. No goods or services are expected in return. Any requests for refunds for those purposes will be rejected. + +### Backers + +Thank you to all our backers! 🙏 + + + +[[Become a backer](https://opencollective.com/Carbon#backer)] + +## Carbon for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of ``Carbon`` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/plugins/vendor/nesbot/carbon/sponsors.php b/plugins/vendor/nesbot/carbon/sponsors.php new file mode 100644 index 00000000..05a6a919 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/sponsors.php @@ -0,0 +1,268 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Carbon\CarbonImmutable; + +require_once __DIR__.'/vendor/autoload.php'; + +function getMaxHistoryMonthsByAmount($amount): int +{ + if ($amount >= 50) { + return 6; + } + + if ($amount >= 20) { + return 4; + } + + return 2; +} + +function getHtmlAttribute($rawValue): string +{ + return str_replace( + ['​', "\r"], + '', + trim(htmlspecialchars((string) $rawValue), "  \n\r\t\v\0"), + ); +} + +function getOpenCollectiveSponsors(): string +{ + $customSponsorOverride = [ + // For consistency and equity among sponsors, as of now, we kindly ask our sponsors + // to provide an image having a width/height ratio between 1/1 and 2/1. + // By default, we'll show the member picture from OpenCollective, and will resize it if bigger + 662698 => [ + // alt attribute + 'name' => 'Non Gamstop Casinos', + // title attribute + 'description' => 'Casinos not on Gamstop', + // src attribute + 'image' => 'https://lgcnews.com/wp-content/uploads/2018/01/LGC-logo-v8-temp.png', + // href attribute + 'website' => 'https://lgcnews.com/', + ], + 663069 => [ + // alt attribute + 'name' => 'Ставки на спорт Favbet', + // href attribute + 'website' => 'https://www.favbet.ua/uk/', + ], + 676798 => [ + // alt attribute + 'name' => 'Top Casinos Canada', + // title attribute + 'description' => 'Top Casinos Canada', + // src attribute + 'image' => 'https://topcasino.net/img/topcasino-logo-cover.png', + // href attribute + 'website' => 'https://topcasino.net/', + ], + ]; + + $members = json_decode(file_get_contents('https://opencollective.com/carbon/members/all.json'), true); + + foreach ($members as &$member) { + $member = array_merge($member, $customSponsorOverride[$member['MemberId']] ?? []); + } + + // Adding sponsors paying via other payment methods + $members[] = [ + 'MemberId' => 1, + 'createdAt' => '2019-01-01 02:00', + 'type' => 'ORGANIZATION', + 'role' => 'BACKER', + 'tier' => 'backer+', + 'isActive' => true, + 'totalAmountDonated' => 1000, + 'currency' => 'USD', + 'lastTransactionAt' => CarbonImmutable::now()->format('Y-m-d').' 02:00', + 'lastTransactionAmount' => 25, + 'profile' => 'https://tidelift.com/', + 'name' => 'Tidelift', + 'description' => 'Get professional support for Carbon', + 'image' => 'https://carbon.nesbot.com/docs/sponsors/tidelift-brand.png', + 'website' => 'https://tidelift.com/subscription/pkg/packagist-nesbot-carbon?utm_source=packagist-nesbot-carbon&utm_medium=referral&utm_campaign=docs', + ]; + $members[] = [ + 'MemberId' => 2, + 'createdAt' => '2024-11-14 02:00', + 'type' => 'ORGANIZATION', + 'role' => 'BACKER', + 'tier' => 'backer+ yearly', + 'isActive' => true, + 'totalAmountDonated' => 170, + 'currency' => 'USD', + 'lastTransactionAt' => '2024-11-14 02:00', + 'lastTransactionAmount' => 170, + 'profile' => 'https://www.slotozilla.com/nz/free-spins', + 'name' => 'Slotozilla', + 'description' => 'Slotozilla website', + 'image' => 'https://carbon.nesbot.com/docs/sponsors/slotozilla.png', + 'website' => 'https://www.slotozilla.com/nz/free-spins', + ]; + + $list = array_filter($members, static fn (array $member): bool => $member['totalAmountDonated'] > 3 && $member['role'] !== 'HOST' && ( + $member['totalAmountDonated'] > 100 || + $member['lastTransactionAt'] > CarbonImmutable::now() + ->subMonthsNoOverflow(getMaxHistoryMonthsByAmount($member['lastTransactionAmount'])) + ->format('Y-m-d h:i') || + $member['isActive'] && $member['lastTransactionAmount'] >= 30 + )); + + $list = array_map(static function (array $member): array { + $createdAt = CarbonImmutable::parse($member['createdAt']); + $lastTransactionAt = CarbonImmutable::parse($member['lastTransactionAt']); + + if ($createdAt->format('d H:i:s.u') > $lastTransactionAt->format('d H:i:s.u')) { + $createdAt = $createdAt + ->setDay($lastTransactionAt->day) + ->modify($lastTransactionAt->format('H:i:s.u')); + } + + $isYearly = str_contains(strtolower($member['tier'] ?? ''), 'yearly'); + $monthlyContribution = (float) ( + ($isYearly && $lastTransactionAt > CarbonImmutable::parse('-1 year')) + ? ($member['lastTransactionAmount'] / 11.2) // 11.2 instead of 12 to include the discount for yearly subscription + : ($member['totalAmountDonated'] / ceil($createdAt->floatDiffInMonths())) + ); + + if (!$isYearly) { + if ( + $lastTransactionAt->isAfter('last month') && + $member['lastTransactionAmount'] > $monthlyContribution + ) { + $monthlyContribution = (float) $member['lastTransactionAmount']; + } + + if ($lastTransactionAt->isBefore('-75 days')) { + $days = min(120, $lastTransactionAt->diffInDays('now') - 70); + $monthlyContribution *= 1 - $days / 240; + } + } + + $yearlyContribution = (float) ( + $isYearly + ? (12 * $monthlyContribution) + : ($member['totalAmountDonated'] / max(1, $createdAt->floatDiffInYears())) + ); + $status = null; + $rank = 0; + + if ($monthlyContribution > 50 || $yearlyContribution > 900) { + $status = 'sponsor'; + $rank = 5; + } elseif ($monthlyContribution > 29 || $yearlyContribution > 700) { + $status = 'sponsor'; + $rank = 4; + } elseif ($monthlyContribution > 14.5 || $yearlyContribution > 500) { + $status = 'backerPlus'; + $rank = 3; + } elseif ($monthlyContribution > 4.5 || $yearlyContribution > 80) { + $status = 'backer'; + $rank = 2; + } elseif ($member['totalAmountDonated'] > 0) { + $status = 'helper'; + $rank = 1; + } + + return array_merge($member, [ + 'star' => ($monthlyContribution > 98 || $yearlyContribution > 800), + 'status' => $status, + 'rank' => $rank, + 'monthlyContribution' => $monthlyContribution, + 'yearlyContribution' => $yearlyContribution, + ]); + }, $list); + + usort($list, static function (array $a, array $b): int { + return ($b['star'] <=> $a['star']) + ?: ($b['rank'] <=> $a['rank']) + ?: ($b['monthlyContribution'] <=> $a['monthlyContribution']) + ?: ($b['totalAmountDonated'] <=> $a['totalAmountDonated']); + }); + + $membersByUrl = []; + $output = ''; + $extra = ''; + + foreach ($list as $member) { + $url = $member['website'] ?? $member['profile']; + + if (isset($membersByUrl[$url]) || !\in_array($member['status'], ['sponsor', 'backerPlus'], true)) { + continue; + } + + $membersByUrl[$url] = $member; + $href = htmlspecialchars($url); + $src = $customSponsorImages[$member['MemberId'] ?? ''] ?? $member['image'] ?? (strtr($member['profile'], ['https://opencollective.com/' => 'https://images.opencollective.com/']).'/avatar/256.png'); + [$x, $y] = @getimagesize($src) ?: [0, 0]; + $validImage = ($x && $y); + $src = $validImage ? htmlspecialchars($src) : 'https://opencollective.com/static/images/default-guest-logo.svg'; + $height = match ($member['status']) { + 'sponsor' => 64, + 'backerPlus' => 42, + 'backer' => 32, + default => 24, + }; + $rel = match ($member['status']) { + 'sponsor', 'backerPlus' => '', + default => ' rel="sponsored"', + }; + + $width = min($height * 2, $validImage ? round($x * $height / $y) : $height); + + if (!str_contains($href, 'utm_source') && !preg_match('/^https?:\/\/(?:www\.)?(?:onlinekasyno-polis\.pl|zonaminecraft\.net|slotozilla\.com)(\/.*)?/', $href)) { + $href .= (!str_contains($href, '?') ? '?' : '&').'utm_source=opencollective&utm_medium=github&utm_campaign=Carbon'; + } + + $title = getHtmlAttribute(($member['description'] ?? null) ?: $member['name']); + $alt = getHtmlAttribute($member['name']); + + if ($member['star']) { + $width *= 1.5; + $height *= 1.5; + } + + $link = "\n".''. + ''.$alt.''. + ''; + + if ($member['rank'] >= 5) { + $output .= $link; + + continue; + } + + $extra .= $link; + } + + $github = [ + 8343178 => 'ssddanbrown', + ]; + + foreach ($github as $avatar => $user) { + $extra .= "\n".''. + ''.$user.''. + ''; + } + + return $output.'
See more'.$extra.'
'; +} + +file_put_contents('readme.md', preg_replace_callback( + '/()[\s\S]+()/', + static function (array $match): string { + return $match[1].getOpenCollectiveSponsors().$match[2]; + }, + file_get_contents('readme.md'), +)); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php b/plugins/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php new file mode 100644 index 00000000..9e043a52 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/AbstractTranslator.php @@ -0,0 +1,440 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\MessageFormatter\MessageFormatterMapper; +use Closure; +use ReflectionException; +use ReflectionFunction; +use ReflectionProperty; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; +use Symfony\Component\Translation\Loader\ArrayLoader; +use Symfony\Component\Translation\Translator as SymfonyTranslator; +use Throwable; + +abstract class AbstractTranslator extends SymfonyTranslator +{ + public const REGION_CODE_LENGTH = 2; + + /** + * Translator singletons for each language. + * + * @var array + */ + protected static array $singletons = []; + + /** + * List of custom localized messages. + * + * @var array + */ + protected array $messages = []; + + /** + * List of custom directories that contain translation files. + * + * @var string[] + */ + protected array $directories = []; + + /** + * Set to true while constructing. + */ + protected bool $initializing = false; + + /** + * List of locales aliases. + * + * @var array + */ + protected array $aliases = [ + 'me' => 'sr_Latn_ME', + 'scr' => 'sh', + ]; + + /** + * Return a singleton instance of Translator. + * + * @param string|null $locale optional initial locale ("en" - english by default) + * + * @return static + */ + public static function get(?string $locale = null): static + { + $locale = $locale ?: 'en'; + $key = static::class === Translator::class ? $locale : static::class.'|'.$locale; + $count = \count(static::$singletons); + + // Remember only the last 10 translators created + if ($count > 10) { + foreach (\array_slice(array_keys(static::$singletons), 0, $count - 10) as $index) { + unset(static::$singletons[$index]); + } + } + + static::$singletons[$key] ??= new static($locale); + + return static::$singletons[$key]; + } + + public function __construct($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + $this->initialize($locale, $formatter, $cacheDir, $debug); + } + + /** + * Returns the list of directories translation files are searched in. + */ + public function getDirectories(): array + { + return $this->directories; + } + + /** + * Set list of directories translation files are searched in. + * + * @param array $directories new directories list + * + * @return $this + */ + public function setDirectories(array $directories): static + { + $this->directories = $directories; + + return $this; + } + + /** + * Add a directory to the list translation files are searched in. + * + * @param string $directory new directory + * + * @return $this + */ + public function addDirectory(string $directory): static + { + $this->directories[] = $directory; + + return $this; + } + + /** + * Remove a directory from the list translation files are searched in. + * + * @param string $directory directory path + * + * @return $this + */ + public function removeDirectory(string $directory): static + { + $search = rtrim(strtr($directory, '\\', '/'), '/'); + + return $this->setDirectories(array_filter( + $this->getDirectories(), + static fn ($item) => rtrim(strtr($item, '\\', '/'), '/') !== $search, + )); + } + + /** + * Reset messages of a locale (all locale if no locale passed). + * Remove custom messages and reload initial messages from matching + * file in Lang directory. + */ + public function resetMessages(?string $locale = null): bool + { + if ($locale === null) { + $this->messages = []; + $this->catalogues = []; + $this->modifyResources(static function (array $resources): array { + foreach ($resources as &$list) { + array_splice($list, 1); + } + + return $resources; + }); + + return true; + } + + $this->assertValidLocale($locale); + + foreach ($this->getDirectories() as $directory) { + $file = \sprintf('%s/%s.php', rtrim($directory, '\\/'), $locale); + $data = @include $file; + + if ($data !== false) { + $this->messages[$locale] = $data; + unset($this->catalogues[$locale]); + $this->modifyResources(static function (array $resources) use ($locale): array { + unset($resources[$locale]); + + return $resources; + }); + $this->addResource('array', $this->messages[$locale], $locale); + + return true; + } + } + + return false; + } + + /** + * Returns the list of files matching a given locale prefix (or all if empty). + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getLocalesFiles(string $prefix = ''): array + { + $files = []; + + foreach ($this->getDirectories() as $directory) { + $directory = rtrim($directory, '\\/'); + + foreach (glob("$directory/$prefix*.php") as $file) { + $files[] = $file; + } + } + + return array_unique($files); + } + + /** + * Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * + * @param string $prefix prefix required to filter result + * + * @return array + */ + public function getAvailableLocales(string $prefix = ''): array + { + $locales = []; + foreach ($this->getLocalesFiles($prefix) as $file) { + $locales[] = substr($file, strrpos($file, '/') + 1, -4); + } + + return array_unique(array_merge($locales, array_keys($this->messages))); + } + + protected function translate(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + if ($domain === null) { + $domain = 'messages'; + } + + $catalogue = $this->getCatalogue($locale); + $format = $this instanceof TranslatorStrongTypeInterface + ? $this->getFromCatalogue($catalogue, (string) $id, $domain) + : $this->getCatalogue($locale)->get((string) $id, $domain); // @codeCoverageIgnore + + if ($format instanceof Closure) { + // @codeCoverageIgnoreStart + try { + $count = (new ReflectionFunction($format))->getNumberOfRequiredParameters(); + } catch (ReflectionException) { + $count = 0; + } + // @codeCoverageIgnoreEnd + + return $format( + ...array_values($parameters), + ...array_fill(0, max(0, $count - \count($parameters)), null) + ); + } + + return parent::trans($id, $parameters, $domain, $locale); + } + + /** + * Init messages language from matching file in Lang directory. + * + * @param string $locale + * + * @return bool + */ + protected function loadMessagesFromFile(string $locale): bool + { + return isset($this->messages[$locale]) || $this->resetMessages($locale); + } + + /** + * Set messages of a locale and take file first if present. + * + * @param string $locale + * @param array $messages + * + * @return $this + */ + public function setMessages(string $locale, array $messages): static + { + $this->loadMessagesFromFile($locale); + $this->addResource('array', $messages, $locale); + $this->messages[$locale] = array_merge( + $this->messages[$locale] ?? [], + $messages + ); + + return $this; + } + + /** + * Set messages of the current locale and take file first if present. + * + * @param array $messages + * + * @return $this + */ + public function setTranslations(array $messages): static + { + return $this->setMessages($this->getLocale(), $messages); + } + + /** + * Get messages of a locale, if none given, return all the + * languages. + */ + public function getMessages(?string $locale = null): array + { + return $locale === null ? $this->messages : $this->messages[$locale]; + } + + /** + * Set the current translator locale and indicate if the source locale file exists + * + * @param string $locale locale ex. en + */ + public function setLocale($locale): void + { + $locale = preg_replace_callback('/[-_]([a-z]{2,}|\d{2,})/', function ($matches) { + // _2-letters or YUE is a region, _3+-letters is a variant + $upper = strtoupper($matches[1]); + + if ($upper === 'YUE' || $upper === 'ISO' || \strlen($upper) <= static::REGION_CODE_LENGTH) { + return "_$upper"; + } + + return '_'.ucfirst($matches[1]); + }, strtolower($locale)); + + $previousLocale = $this->getLocale(); + + if ($previousLocale === $locale && isset($this->messages[$locale])) { + return; + } + + unset(static::$singletons[$previousLocale]); + + if ($locale === 'auto') { + $completeLocale = setlocale(LC_TIME, '0'); + $locale = preg_replace('/^([^_.-]+).*$/', '$1', $completeLocale); + $locales = $this->getAvailableLocales($locale); + + $completeLocaleChunks = preg_split('/[_.-]+/', $completeLocale); + + $getScore = static fn ($language) => self::compareChunkLists( + $completeLocaleChunks, + preg_split('/[_.-]+/', $language), + ); + + usort($locales, static fn ($first, $second) => $getScore($second) <=> $getScore($first)); + + $locale = $locales[0]; + } + + if (isset($this->aliases[$locale])) { + $locale = $this->aliases[$locale]; + } + + // If subtag (ex: en_CA) first load the macro (ex: en) to have a fallback + if (str_contains($locale, '_') && + $this->loadMessagesFromFile($macroLocale = preg_replace('/^([^_]+).*$/', '$1', $locale)) + ) { + parent::setLocale($macroLocale); + } + + if (!$this->loadMessagesFromFile($locale) && !$this->initializing) { + return; + } + + parent::setLocale($locale); + } + + /** + * Show locale on var_dump(). + * + * @return array + */ + public function __debugInfo() + { + return [ + 'locale' => $this->getLocale(), + ]; + } + + public function __serialize(): array + { + return [ + 'locale' => $this->getLocale(), + ]; + } + + public function __unserialize(array $data): void + { + $this->initialize($data['locale'] ?? 'en'); + } + + private function initialize($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false): void + { + parent::setLocale($locale); + $this->initializing = true; + $this->directories = [__DIR__.'/Lang']; + $this->addLoader('array', new ArrayLoader()); + parent::__construct($locale, new MessageFormatterMapper($formatter), $cacheDir, $debug); + $this->initializing = false; + } + + private static function compareChunkLists($referenceChunks, $chunks) + { + $score = 0; + + foreach ($referenceChunks as $index => $chunk) { + if (!isset($chunks[$index])) { + $score++; + + continue; + } + + if (strtolower($chunks[$index]) === strtolower($chunk)) { + $score += 10; + } + } + + return $score; + } + + /** @codeCoverageIgnore */ + private function modifyResources(callable $callback): void + { + try { + $resourcesProperty = new ReflectionProperty(SymfonyTranslator::class, 'resources'); + $resources = $resourcesProperty->getValue($this); + $resourcesProperty->setValue($this, $callback($resources)); + } catch (Throwable) { + // Clear resources if available, if not, then nothing to clean + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Callback.php b/plugins/vendor/nesbot/carbon/src/Carbon/Callback.php new file mode 100644 index 00000000..c7456f1e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Callback.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Closure; +use DateInterval; +use DatePeriod; +use DateTime; +use DateTimeInterface; +use DateTimeZone; +use ReflectionFunction; +use ReflectionNamedType; +use ReflectionType; + +final class Callback +{ + private ?ReflectionFunction $function; + + private function __construct(private readonly Closure $closure) + { + } + + public static function fromClosure(Closure $closure): self + { + return new self($closure); + } + + public static function parameter(mixed $closure, mixed $value, string|int $index = 0): mixed + { + if ($closure instanceof Closure) { + return self::fromClosure($closure)->prepareParameter($value, $index); + } + + return $value; + } + + public function getReflectionFunction(): ReflectionFunction + { + return $this->function ??= new ReflectionFunction($this->closure); + } + + public function prepareParameter(mixed $value, string|int $index = 0): mixed + { + $type = $this->getParameterType($index); + + if (!($type instanceof ReflectionNamedType)) { + return $value; + } + + $name = $type->getName(); + + if ($name === CarbonInterface::class) { + $name = $value instanceof DateTime ? Carbon::class : CarbonImmutable::class; + } + + if (!class_exists($name) || is_a($value, $name)) { + return $value; + } + + $class = $this->getPromotedClass($value); + + if ($class && is_a($name, $class, true)) { + return $name::instance($value); + } + + return $value; + } + + public function call(mixed ...$arguments): mixed + { + foreach ($arguments as $index => &$value) { + if ($this->getPromotedClass($value)) { + $value = $this->prepareParameter($value, $index); + } + } + + return ($this->closure)(...$arguments); + } + + private function getParameterType(string|int $index): ?ReflectionType + { + $parameters = $this->getReflectionFunction()->getParameters(); + + if (\is_int($index)) { + return ($parameters[$index] ?? null)?->getType(); + } + + foreach ($parameters as $parameter) { + if ($parameter->getName() === $index) { + return $parameter->getType(); + } + } + + return null; + } + + /** @return class-string|null */ + private function getPromotedClass(mixed $value): ?string + { + if ($value instanceof DateTimeInterface) { + return CarbonInterface::class; + } + + if ($value instanceof DateInterval) { + return CarbonInterval::class; + } + + if ($value instanceof DatePeriod) { + return CarbonPeriod::class; + } + + if ($value instanceof DateTimeZone) { + return CarbonTimeZone::class; + } + + return null; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Carbon.php b/plugins/vendor/nesbot/carbon/src/Carbon/Carbon.php new file mode 100644 index 00000000..8364e841 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Carbon.php @@ -0,0 +1,847 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Traits\Date; +use DateTime; +use DateTimeInterface; + +/** + * A simple API extension for DateTime. + * + * + * + * @property string $localeDayOfWeek the day of week in current locale + * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale + * @property string $localeMonth the month in current locale + * @property string $shortLocaleMonth the abbreviated month in current locale + * @property int $year + * @property int $yearIso + * @property int $month + * @property int $day + * @property int $hour + * @property int $minute + * @property int $second + * @property int $micro + * @property int $microsecond + * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English + * @property int $milliseconds + * @property int $millisecond + * @property int $milli + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium + * @property int $dayOfCentury The value of the day starting from the beginning of the current century + * @property int $dayOfDecade The value of the day starting from the beginning of the current decade + * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium + * @property int $dayOfMonth The value of the day starting from the beginning of the current month + * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter + * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property int $dayOfYear 1 through 366 + * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century + * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium + * @property int $hourOfCentury The value of the hour starting from the beginning of the current century + * @property int $hourOfDay The value of the hour starting from the beginning of the current day + * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade + * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium + * @property int $hourOfMonth The value of the hour starting from the beginning of the current month + * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter + * @property int $hourOfWeek The value of the hour starting from the beginning of the current week + * @property int $hourOfYear The value of the hour starting from the beginning of the current year + * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century + * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day + * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade + * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour + * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium + * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond + * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute + * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month + * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter + * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second + * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week + * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year + * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century + * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day + * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade + * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour + * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium + * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute + * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month + * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter + * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second + * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week + * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year + * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century + * @property int $minuteOfDay The value of the minute starting from the beginning of the current day + * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade + * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour + * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium + * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month + * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter + * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week + * @property int $minuteOfYear The value of the minute starting from the beginning of the current year + * @property int $monthOfCentury The value of the month starting from the beginning of the current century + * @property int $monthOfDecade The value of the month starting from the beginning of the current decade + * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium + * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter + * @property int $monthOfYear The value of the month starting from the beginning of the current year + * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century + * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade + * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium + * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year + * @property int $secondOfCentury The value of the second starting from the beginning of the current century + * @property int $secondOfDay The value of the second starting from the beginning of the current day + * @property int $secondOfDecade The value of the second starting from the beginning of the current decade + * @property int $secondOfHour The value of the second starting from the beginning of the current hour + * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium + * @property int $secondOfMinute The value of the second starting from the beginning of the current minute + * @property int $secondOfMonth The value of the second starting from the beginning of the current month + * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter + * @property int $secondOfWeek The value of the second starting from the beginning of the current week + * @property int $secondOfYear The value of the second starting from the beginning of the current year + * @property int $weekOfCentury The value of the week starting from the beginning of the current century + * @property int $weekOfDecade The value of the week starting from the beginning of the current decade + * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium + * @property int $weekOfMonth 1 through 5 + * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter + * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property int $yearOfCentury The value of the year starting from the beginning of the current century + * @property int $yearOfDecade The value of the year starting from the beginning of the current decade + * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance + * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium + * @property-read int $daysInCentury The number of days contained in the current century + * @property-read int $daysInDecade The number of days contained in the current decade + * @property-read int $daysInMillennium The number of days contained in the current millennium + * @property-read int $daysInMonth number of days in the given month + * @property-read int $daysInQuarter The number of days contained in the current quarter + * @property-read int $daysInWeek The number of days contained in the current week + * @property-read int $daysInYear 365 or 366 + * @property-read int $decadesInCentury The number of decades contained in the current century + * @property-read int $decadesInMillennium The number of decades contained in the current millennium + * @property-read int $hoursInCentury The number of hours contained in the current century + * @property-read int $hoursInDay The number of hours contained in the current day + * @property-read int $hoursInDecade The number of hours contained in the current decade + * @property-read int $hoursInMillennium The number of hours contained in the current millennium + * @property-read int $hoursInMonth The number of hours contained in the current month + * @property-read int $hoursInQuarter The number of hours contained in the current quarter + * @property-read int $hoursInWeek The number of hours contained in the current week + * @property-read int $hoursInYear The number of hours contained in the current year + * @property-read int $microsecondsInCentury The number of microseconds contained in the current century + * @property-read int $microsecondsInDay The number of microseconds contained in the current day + * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade + * @property-read int $microsecondsInHour The number of microseconds contained in the current hour + * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium + * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond + * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute + * @property-read int $microsecondsInMonth The number of microseconds contained in the current month + * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter + * @property-read int $microsecondsInSecond The number of microseconds contained in the current second + * @property-read int $microsecondsInWeek The number of microseconds contained in the current week + * @property-read int $microsecondsInYear The number of microseconds contained in the current year + * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century + * @property-read int $millisecondsInDay The number of milliseconds contained in the current day + * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade + * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour + * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium + * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute + * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month + * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter + * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second + * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week + * @property-read int $millisecondsInYear The number of milliseconds contained in the current year + * @property-read int $minutesInCentury The number of minutes contained in the current century + * @property-read int $minutesInDay The number of minutes contained in the current day + * @property-read int $minutesInDecade The number of minutes contained in the current decade + * @property-read int $minutesInHour The number of minutes contained in the current hour + * @property-read int $minutesInMillennium The number of minutes contained in the current millennium + * @property-read int $minutesInMonth The number of minutes contained in the current month + * @property-read int $minutesInQuarter The number of minutes contained in the current quarter + * @property-read int $minutesInWeek The number of minutes contained in the current week + * @property-read int $minutesInYear The number of minutes contained in the current year + * @property-read int $monthsInCentury The number of months contained in the current century + * @property-read int $monthsInDecade The number of months contained in the current decade + * @property-read int $monthsInMillennium The number of months contained in the current millennium + * @property-read int $monthsInQuarter The number of months contained in the current quarter + * @property-read int $monthsInYear The number of months contained in the current year + * @property-read int $quartersInCentury The number of quarters contained in the current century + * @property-read int $quartersInDecade The number of quarters contained in the current decade + * @property-read int $quartersInMillennium The number of quarters contained in the current millennium + * @property-read int $quartersInYear The number of quarters contained in the current year + * @property-read int $secondsInCentury The number of seconds contained in the current century + * @property-read int $secondsInDay The number of seconds contained in the current day + * @property-read int $secondsInDecade The number of seconds contained in the current decade + * @property-read int $secondsInHour The number of seconds contained in the current hour + * @property-read int $secondsInMillennium The number of seconds contained in the current millennium + * @property-read int $secondsInMinute The number of seconds contained in the current minute + * @property-read int $secondsInMonth The number of seconds contained in the current month + * @property-read int $secondsInQuarter The number of seconds contained in the current quarter + * @property-read int $secondsInWeek The number of seconds contained in the current week + * @property-read int $secondsInYear The number of seconds contained in the current year + * @property-read int $weeksInCentury The number of weeks contained in the current century + * @property-read int $weeksInDecade The number of weeks contained in the current decade + * @property-read int $weeksInMillennium The number of weeks contained in the current millennium + * @property-read int $weeksInMonth The number of weeks contained in the current month + * @property-read int $weeksInQuarter The number of weeks contained in the current quarter + * @property-read int $weeksInYear 51 through 53 + * @property-read int $yearsInCentury The number of years contained in the current century + * @property-read int $yearsInDecade The number of years contained in the current decade + * @property-read int $yearsInMillennium The number of years contained in the current millennium + * + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method $this years(int $value) Set current instance year to the given value. + * @method $this year(int $value) Set current instance year to the given value. + * @method $this setYears(int $value) Set current instance year to the given value. + * @method $this setYear(int $value) Set current instance year to the given value. + * @method $this months(Month|int $value) Set current instance month to the given value. + * @method $this month(Month|int $value) Set current instance month to the given value. + * @method $this setMonths(Month|int $value) Set current instance month to the given value. + * @method $this setMonth(Month|int $value) Set current instance month to the given value. + * @method $this days(int $value) Set current instance day to the given value. + * @method $this day(int $value) Set current instance day to the given value. + * @method $this setDays(int $value) Set current instance day to the given value. + * @method $this setDay(int $value) Set current instance day to the given value. + * @method $this hours(int $value) Set current instance hour to the given value. + * @method $this hour(int $value) Set current instance hour to the given value. + * @method $this setHours(int $value) Set current instance hour to the given value. + * @method $this setHour(int $value) Set current instance hour to the given value. + * @method $this minutes(int $value) Set current instance minute to the given value. + * @method $this minute(int $value) Set current instance minute to the given value. + * @method $this setMinutes(int $value) Set current instance minute to the given value. + * @method $this setMinute(int $value) Set current instance minute to the given value. + * @method $this seconds(int $value) Set current instance second to the given value. + * @method $this second(int $value) Set current instance second to the given value. + * @method $this setSeconds(int $value) Set current instance second to the given value. + * @method $this setSecond(int $value) Set current instance second to the given value. + * @method $this millis(int $value) Set current instance millisecond to the given value. + * @method $this milli(int $value) Set current instance millisecond to the given value. + * @method $this setMillis(int $value) Set current instance millisecond to the given value. + * @method $this setMilli(int $value) Set current instance millisecond to the given value. + * @method $this milliseconds(int $value) Set current instance millisecond to the given value. + * @method $this millisecond(int $value) Set current instance millisecond to the given value. + * @method $this setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method $this setMillisecond(int $value) Set current instance millisecond to the given value. + * @method $this micros(int $value) Set current instance microsecond to the given value. + * @method $this micro(int $value) Set current instance microsecond to the given value. + * @method $this setMicros(int $value) Set current instance microsecond to the given value. + * @method $this setMicro(int $value) Set current instance microsecond to the given value. + * @method $this microseconds(int $value) Set current instance microsecond to the given value. + * @method $this microsecond(int $value) Set current instance microsecond to the given value. + * @method $this setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method $this setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method $this addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method $this addYear() Add one year to the instance (using date interval). + * @method $this subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method $this subYear() Sub one year to the instance (using date interval). + * @method $this addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method $this subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method $this addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method $this addMonth() Add one month to the instance (using date interval). + * @method $this subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method $this subMonth() Sub one month to the instance (using date interval). + * @method $this addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method $this addDay() Add one day to the instance (using date interval). + * @method $this subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method $this subDay() Sub one day to the instance (using date interval). + * @method $this addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method $this addHour() Add one hour to the instance (using date interval). + * @method $this subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method $this subHour() Sub one hour to the instance (using date interval). + * @method $this addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method $this addMinute() Add one minute to the instance (using date interval). + * @method $this subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method $this subMinute() Sub one minute to the instance (using date interval). + * @method $this addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method $this addSecond() Add one second to the instance (using date interval). + * @method $this subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method $this subSecond() Sub one second to the instance (using date interval). + * @method $this addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMilli() Add one millisecond to the instance (using date interval). + * @method $this subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMilli() Sub one millisecond to the instance (using date interval). + * @method $this addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMillisecond() Add one millisecond to the instance (using date interval). + * @method $this subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMillisecond() Sub one millisecond to the instance (using date interval). + * @method $this addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMicro() Add one microsecond to the instance (using date interval). + * @method $this subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMicro() Sub one microsecond to the instance (using date interval). + * @method $this addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method $this addMicrosecond() Add one microsecond to the instance (using date interval). + * @method $this subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method $this subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method $this addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method $this addMillennium() Add one millennium to the instance (using date interval). + * @method $this subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method $this subMillennium() Sub one millennium to the instance (using date interval). + * @method $this addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method $this addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method $this addCentury() Add one century to the instance (using date interval). + * @method $this subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method $this subCentury() Sub one century to the instance (using date interval). + * @method $this addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method $this subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method $this addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method $this addDecade() Add one decade to the instance (using date interval). + * @method $this subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method $this subDecade() Sub one decade to the instance (using date interval). + * @method $this addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method $this subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method $this addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method $this addQuarter() Add one quarter to the instance (using date interval). + * @method $this subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method $this subQuarter() Sub one quarter to the instance (using date interval). + * @method $this addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method $this subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method $this subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method $this addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method $this subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method $this addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method $this addWeek() Add one week to the instance (using date interval). + * @method $this subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method $this subWeek() Sub one week to the instance (using date interval). + * @method $this addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method $this addWeekday() Add one weekday to the instance (using date interval). + * @method $this subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method $this subWeekday() Sub one weekday to the instance (using date interval). + * @method $this addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMicro() Add one microsecond to the instance (using timestamp). + * @method $this subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method $this addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMicrosecond() Add one microsecond to the instance (using timestamp). + * @method $this subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method $this addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMilli() Add one millisecond to the instance (using timestamp). + * @method $this subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method $this addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMillisecond() Add one millisecond to the instance (using timestamp). + * @method $this subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method $this addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCSecond() Add one second to the instance (using timestamp). + * @method $this subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. + * @method $this addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMinute() Add one minute to the instance (using timestamp). + * @method $this subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. + * @method $this addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCHour() Add one hour to the instance (using timestamp). + * @method $this subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. + * @method $this addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCDay() Add one day to the instance (using timestamp). + * @method $this subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. + * @method $this addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCWeek() Add one week to the instance (using timestamp). + * @method $this subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. + * @method $this addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMonth() Add one month to the instance (using timestamp). + * @method $this subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. + * @method $this addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCQuarter() Add one quarter to the instance (using timestamp). + * @method $this subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. + * @method $this addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCYear() Add one year to the instance (using timestamp). + * @method $this subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. + * @method $this addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCDecade() Add one decade to the instance (using timestamp). + * @method $this subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. + * @method $this addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCCentury() Add one century to the instance (using timestamp). + * @method $this subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. + * @method $this addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method $this addUTCMillennium() Add one millennium to the instance (using timestamp). + * @method $this subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method $this subUTCMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. + * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium + * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value + * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value + * @method int daysInCentury() Return the number of days contained in the current century + * @method int daysInDecade() Return the number of days contained in the current decade + * @method int daysInMillennium() Return the number of days contained in the current millennium + * @method int daysInMonth() Return the number of days contained in the current month + * @method int daysInQuarter() Return the number of days contained in the current quarter + * @method int daysInWeek() Return the number of days contained in the current week + * @method int daysInYear() Return the number of days contained in the current year + * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value + * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value + * @method int decadesInCentury() Return the number of decades contained in the current century + * @method int decadesInMillennium() Return the number of decades contained in the current millennium + * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value + * @method int hoursInCentury() Return the number of hours contained in the current century + * @method int hoursInDay() Return the number of hours contained in the current day + * @method int hoursInDecade() Return the number of hours contained in the current decade + * @method int hoursInMillennium() Return the number of hours contained in the current millennium + * @method int hoursInMonth() Return the number of hours contained in the current month + * @method int hoursInQuarter() Return the number of hours contained in the current quarter + * @method int hoursInWeek() Return the number of hours contained in the current week + * @method int hoursInYear() Return the number of hours contained in the current year + * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value + * @method int microsecondsInCentury() Return the number of microseconds contained in the current century + * @method int microsecondsInDay() Return the number of microseconds contained in the current day + * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade + * @method int microsecondsInHour() Return the number of microseconds contained in the current hour + * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium + * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond + * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute + * @method int microsecondsInMonth() Return the number of microseconds contained in the current month + * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter + * @method int microsecondsInSecond() Return the number of microseconds contained in the current second + * @method int microsecondsInWeek() Return the number of microseconds contained in the current week + * @method int microsecondsInYear() Return the number of microseconds contained in the current year + * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value + * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century + * @method int millisecondsInDay() Return the number of milliseconds contained in the current day + * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade + * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour + * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium + * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute + * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month + * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter + * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second + * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week + * @method int millisecondsInYear() Return the number of milliseconds contained in the current year + * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value + * @method int minutesInCentury() Return the number of minutes contained in the current century + * @method int minutesInDay() Return the number of minutes contained in the current day + * @method int minutesInDecade() Return the number of minutes contained in the current decade + * @method int minutesInHour() Return the number of minutes contained in the current hour + * @method int minutesInMillennium() Return the number of minutes contained in the current millennium + * @method int minutesInMonth() Return the number of minutes contained in the current month + * @method int minutesInQuarter() Return the number of minutes contained in the current quarter + * @method int minutesInWeek() Return the number of minutes contained in the current week + * @method int minutesInYear() Return the number of minutes contained in the current year + * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value + * @method int monthsInCentury() Return the number of months contained in the current century + * @method int monthsInDecade() Return the number of months contained in the current decade + * @method int monthsInMillennium() Return the number of months contained in the current millennium + * @method int monthsInQuarter() Return the number of months contained in the current quarter + * @method int monthsInYear() Return the number of months contained in the current year + * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value + * @method int quartersInCentury() Return the number of quarters contained in the current century + * @method int quartersInDecade() Return the number of quarters contained in the current decade + * @method int quartersInMillennium() Return the number of quarters contained in the current millennium + * @method int quartersInYear() Return the number of quarters contained in the current year + * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value + * @method int secondsInCentury() Return the number of seconds contained in the current century + * @method int secondsInDay() Return the number of seconds contained in the current day + * @method int secondsInDecade() Return the number of seconds contained in the current decade + * @method int secondsInHour() Return the number of seconds contained in the current hour + * @method int secondsInMillennium() Return the number of seconds contained in the current millennium + * @method int secondsInMinute() Return the number of seconds contained in the current minute + * @method int secondsInMonth() Return the number of seconds contained in the current month + * @method int secondsInQuarter() Return the number of seconds contained in the current quarter + * @method int secondsInWeek() Return the number of seconds contained in the current week + * @method int secondsInYear() Return the number of seconds contained in the current year + * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value + * @method int weeksInCentury() Return the number of weeks contained in the current century + * @method int weeksInDecade() Return the number of weeks contained in the current decade + * @method int weeksInMillennium() Return the number of weeks contained in the current millennium + * @method int weeksInMonth() Return the number of weeks contained in the current month + * @method int weeksInQuarter() Return the number of weeks contained in the current quarter + * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value + * @method int yearsInCentury() Return the number of years contained in the current century + * @method int yearsInDecade() Return the number of years contained in the current decade + * @method int yearsInMillennium() Return the number of years contained in the current millennium + * + * + */ +class Carbon extends DateTime implements CarbonInterface +{ + use Date; + + /** + * Returns true if the current class/instance is mutable. + */ + public static function isMutable(): bool + { + return true; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php new file mode 100644 index 00000000..fd89bd77 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonConverterInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use DateTimeInterface; + +interface CarbonConverterInterface +{ + public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface; +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php new file mode 100644 index 00000000..ee8cb155 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonImmutable.php @@ -0,0 +1,890 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Traits\Date; +use DateTimeImmutable; +use DateTimeInterface; + +/** + * A simple API extension for DateTimeImmutable. + * + * + * + * @property string $localeDayOfWeek the day of week in current locale + * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale + * @property string $localeMonth the month in current locale + * @property string $shortLocaleMonth the abbreviated month in current locale + * @property int $year + * @property int $yearIso + * @property int $month + * @property int $day + * @property int $hour + * @property int $minute + * @property int $second + * @property int $micro + * @property int $microsecond + * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English + * @property int $milliseconds + * @property int $millisecond + * @property int $milli + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium + * @property int $dayOfCentury The value of the day starting from the beginning of the current century + * @property int $dayOfDecade The value of the day starting from the beginning of the current decade + * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium + * @property int $dayOfMonth The value of the day starting from the beginning of the current month + * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter + * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property int $dayOfYear 1 through 366 + * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century + * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium + * @property int $hourOfCentury The value of the hour starting from the beginning of the current century + * @property int $hourOfDay The value of the hour starting from the beginning of the current day + * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade + * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium + * @property int $hourOfMonth The value of the hour starting from the beginning of the current month + * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter + * @property int $hourOfWeek The value of the hour starting from the beginning of the current week + * @property int $hourOfYear The value of the hour starting from the beginning of the current year + * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century + * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day + * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade + * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour + * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium + * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond + * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute + * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month + * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter + * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second + * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week + * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year + * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century + * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day + * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade + * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour + * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium + * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute + * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month + * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter + * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second + * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week + * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year + * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century + * @property int $minuteOfDay The value of the minute starting from the beginning of the current day + * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade + * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour + * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium + * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month + * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter + * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week + * @property int $minuteOfYear The value of the minute starting from the beginning of the current year + * @property int $monthOfCentury The value of the month starting from the beginning of the current century + * @property int $monthOfDecade The value of the month starting from the beginning of the current decade + * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium + * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter + * @property int $monthOfYear The value of the month starting from the beginning of the current year + * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century + * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade + * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium + * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year + * @property int $secondOfCentury The value of the second starting from the beginning of the current century + * @property int $secondOfDay The value of the second starting from the beginning of the current day + * @property int $secondOfDecade The value of the second starting from the beginning of the current decade + * @property int $secondOfHour The value of the second starting from the beginning of the current hour + * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium + * @property int $secondOfMinute The value of the second starting from the beginning of the current minute + * @property int $secondOfMonth The value of the second starting from the beginning of the current month + * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter + * @property int $secondOfWeek The value of the second starting from the beginning of the current week + * @property int $secondOfYear The value of the second starting from the beginning of the current year + * @property int $weekOfCentury The value of the week starting from the beginning of the current century + * @property int $weekOfDecade The value of the week starting from the beginning of the current decade + * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium + * @property int $weekOfMonth 1 through 5 + * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter + * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property int $yearOfCentury The value of the year starting from the beginning of the current century + * @property int $yearOfDecade The value of the year starting from the beginning of the current decade + * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance + * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium + * @property-read int $daysInCentury The number of days contained in the current century + * @property-read int $daysInDecade The number of days contained in the current decade + * @property-read int $daysInMillennium The number of days contained in the current millennium + * @property-read int $daysInMonth number of days in the given month + * @property-read int $daysInQuarter The number of days contained in the current quarter + * @property-read int $daysInWeek The number of days contained in the current week + * @property-read int $daysInYear 365 or 366 + * @property-read int $decadesInCentury The number of decades contained in the current century + * @property-read int $decadesInMillennium The number of decades contained in the current millennium + * @property-read int $hoursInCentury The number of hours contained in the current century + * @property-read int $hoursInDay The number of hours contained in the current day + * @property-read int $hoursInDecade The number of hours contained in the current decade + * @property-read int $hoursInMillennium The number of hours contained in the current millennium + * @property-read int $hoursInMonth The number of hours contained in the current month + * @property-read int $hoursInQuarter The number of hours contained in the current quarter + * @property-read int $hoursInWeek The number of hours contained in the current week + * @property-read int $hoursInYear The number of hours contained in the current year + * @property-read int $microsecondsInCentury The number of microseconds contained in the current century + * @property-read int $microsecondsInDay The number of microseconds contained in the current day + * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade + * @property-read int $microsecondsInHour The number of microseconds contained in the current hour + * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium + * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond + * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute + * @property-read int $microsecondsInMonth The number of microseconds contained in the current month + * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter + * @property-read int $microsecondsInSecond The number of microseconds contained in the current second + * @property-read int $microsecondsInWeek The number of microseconds contained in the current week + * @property-read int $microsecondsInYear The number of microseconds contained in the current year + * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century + * @property-read int $millisecondsInDay The number of milliseconds contained in the current day + * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade + * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour + * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium + * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute + * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month + * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter + * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second + * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week + * @property-read int $millisecondsInYear The number of milliseconds contained in the current year + * @property-read int $minutesInCentury The number of minutes contained in the current century + * @property-read int $minutesInDay The number of minutes contained in the current day + * @property-read int $minutesInDecade The number of minutes contained in the current decade + * @property-read int $minutesInHour The number of minutes contained in the current hour + * @property-read int $minutesInMillennium The number of minutes contained in the current millennium + * @property-read int $minutesInMonth The number of minutes contained in the current month + * @property-read int $minutesInQuarter The number of minutes contained in the current quarter + * @property-read int $minutesInWeek The number of minutes contained in the current week + * @property-read int $minutesInYear The number of minutes contained in the current year + * @property-read int $monthsInCentury The number of months contained in the current century + * @property-read int $monthsInDecade The number of months contained in the current decade + * @property-read int $monthsInMillennium The number of months contained in the current millennium + * @property-read int $monthsInQuarter The number of months contained in the current quarter + * @property-read int $monthsInYear The number of months contained in the current year + * @property-read int $quartersInCentury The number of quarters contained in the current century + * @property-read int $quartersInDecade The number of quarters contained in the current decade + * @property-read int $quartersInMillennium The number of quarters contained in the current millennium + * @property-read int $quartersInYear The number of quarters contained in the current year + * @property-read int $secondsInCentury The number of seconds contained in the current century + * @property-read int $secondsInDay The number of seconds contained in the current day + * @property-read int $secondsInDecade The number of seconds contained in the current decade + * @property-read int $secondsInHour The number of seconds contained in the current hour + * @property-read int $secondsInMillennium The number of seconds contained in the current millennium + * @property-read int $secondsInMinute The number of seconds contained in the current minute + * @property-read int $secondsInMonth The number of seconds contained in the current month + * @property-read int $secondsInQuarter The number of seconds contained in the current quarter + * @property-read int $secondsInWeek The number of seconds contained in the current week + * @property-read int $secondsInYear The number of seconds contained in the current year + * @property-read int $weeksInCentury The number of weeks contained in the current century + * @property-read int $weeksInDecade The number of weeks contained in the current decade + * @property-read int $weeksInMillennium The number of weeks contained in the current millennium + * @property-read int $weeksInMonth The number of weeks contained in the current month + * @property-read int $weeksInQuarter The number of weeks contained in the current quarter + * @property-read int $weeksInYear 51 through 53 + * @property-read int $yearsInCentury The number of years contained in the current century + * @property-read int $yearsInDecade The number of years contained in the current decade + * @property-read int $yearsInMillennium The number of years contained in the current millennium + * + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method CarbonImmutable years(int $value) Set current instance year to the given value. + * @method CarbonImmutable year(int $value) Set current instance year to the given value. + * @method CarbonImmutable setYears(int $value) Set current instance year to the given value. + * @method CarbonImmutable setYear(int $value) Set current instance year to the given value. + * @method CarbonImmutable months(Month|int $value) Set current instance month to the given value. + * @method CarbonImmutable month(Month|int $value) Set current instance month to the given value. + * @method CarbonImmutable setMonths(Month|int $value) Set current instance month to the given value. + * @method CarbonImmutable setMonth(Month|int $value) Set current instance month to the given value. + * @method CarbonImmutable days(int $value) Set current instance day to the given value. + * @method CarbonImmutable day(int $value) Set current instance day to the given value. + * @method CarbonImmutable setDays(int $value) Set current instance day to the given value. + * @method CarbonImmutable setDay(int $value) Set current instance day to the given value. + * @method CarbonImmutable hours(int $value) Set current instance hour to the given value. + * @method CarbonImmutable hour(int $value) Set current instance hour to the given value. + * @method CarbonImmutable setHours(int $value) Set current instance hour to the given value. + * @method CarbonImmutable setHour(int $value) Set current instance hour to the given value. + * @method CarbonImmutable minutes(int $value) Set current instance minute to the given value. + * @method CarbonImmutable minute(int $value) Set current instance minute to the given value. + * @method CarbonImmutable setMinutes(int $value) Set current instance minute to the given value. + * @method CarbonImmutable setMinute(int $value) Set current instance minute to the given value. + * @method CarbonImmutable seconds(int $value) Set current instance second to the given value. + * @method CarbonImmutable second(int $value) Set current instance second to the given value. + * @method CarbonImmutable setSeconds(int $value) Set current instance second to the given value. + * @method CarbonImmutable setSecond(int $value) Set current instance second to the given value. + * @method CarbonImmutable millis(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable milli(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMillis(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMilli(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable milliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable millisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable setMillisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonImmutable micros(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable micro(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicros(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicro(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable microseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable microsecond(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method CarbonImmutable addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addYear() Add one year to the instance (using date interval). + * @method CarbonImmutable subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subYear() Sub one year to the instance (using date interval). + * @method CarbonImmutable addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMonth() Add one month to the instance (using date interval). + * @method CarbonImmutable subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMonth() Sub one month to the instance (using date interval). + * @method CarbonImmutable addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addDay() Add one day to the instance (using date interval). + * @method CarbonImmutable subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subDay() Sub one day to the instance (using date interval). + * @method CarbonImmutable addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addHour() Add one hour to the instance (using date interval). + * @method CarbonImmutable subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subHour() Sub one hour to the instance (using date interval). + * @method CarbonImmutable addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMinute() Add one minute to the instance (using date interval). + * @method CarbonImmutable subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMinute() Sub one minute to the instance (using date interval). + * @method CarbonImmutable addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addSecond() Add one second to the instance (using date interval). + * @method CarbonImmutable subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subSecond() Sub one second to the instance (using date interval). + * @method CarbonImmutable addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMilli() Add one millisecond to the instance (using date interval). + * @method CarbonImmutable subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMilli() Sub one millisecond to the instance (using date interval). + * @method CarbonImmutable addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMillisecond() Add one millisecond to the instance (using date interval). + * @method CarbonImmutable subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMillisecond() Sub one millisecond to the instance (using date interval). + * @method CarbonImmutable addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMicro() Add one microsecond to the instance (using date interval). + * @method CarbonImmutable subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMicro() Sub one microsecond to the instance (using date interval). + * @method CarbonImmutable addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMicrosecond() Add one microsecond to the instance (using date interval). + * @method CarbonImmutable subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method CarbonImmutable addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addMillennium() Add one millennium to the instance (using date interval). + * @method CarbonImmutable subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subMillennium() Sub one millennium to the instance (using date interval). + * @method CarbonImmutable addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addCentury() Add one century to the instance (using date interval). + * @method CarbonImmutable subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subCentury() Sub one century to the instance (using date interval). + * @method CarbonImmutable addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addDecade() Add one decade to the instance (using date interval). + * @method CarbonImmutable subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subDecade() Sub one decade to the instance (using date interval). + * @method CarbonImmutable addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addQuarter() Add one quarter to the instance (using date interval). + * @method CarbonImmutable subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subQuarter() Sub one quarter to the instance (using date interval). + * @method CarbonImmutable addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonImmutable addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonImmutable addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addWeek() Add one week to the instance (using date interval). + * @method CarbonImmutable subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subWeek() Sub one week to the instance (using date interval). + * @method CarbonImmutable addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable addWeekday() Add one weekday to the instance (using date interval). + * @method CarbonImmutable subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonImmutable subWeekday() Sub one weekday to the instance (using date interval). + * @method CarbonImmutable addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMicro() Add one microsecond to the instance (using timestamp). + * @method CarbonImmutable subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonImmutable addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMicrosecond() Add one microsecond to the instance (using timestamp). + * @method CarbonImmutable subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonImmutable addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMilli() Add one millisecond to the instance (using timestamp). + * @method CarbonImmutable subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonImmutable addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMillisecond() Add one millisecond to the instance (using timestamp). + * @method CarbonImmutable subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonImmutable addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCSecond() Add one second to the instance (using timestamp). + * @method CarbonImmutable subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. + * @method CarbonImmutable addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMinute() Add one minute to the instance (using timestamp). + * @method CarbonImmutable subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. + * @method CarbonImmutable addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCHour() Add one hour to the instance (using timestamp). + * @method CarbonImmutable subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. + * @method CarbonImmutable addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCDay() Add one day to the instance (using timestamp). + * @method CarbonImmutable subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. + * @method CarbonImmutable addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCWeek() Add one week to the instance (using timestamp). + * @method CarbonImmutable subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. + * @method CarbonImmutable addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMonth() Add one month to the instance (using timestamp). + * @method CarbonImmutable subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. + * @method CarbonImmutable addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCQuarter() Add one quarter to the instance (using timestamp). + * @method CarbonImmutable subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. + * @method CarbonImmutable addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCYear() Add one year to the instance (using timestamp). + * @method CarbonImmutable subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. + * @method CarbonImmutable addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCDecade() Add one decade to the instance (using timestamp). + * @method CarbonImmutable subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. + * @method CarbonImmutable addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCCentury() Add one century to the instance (using timestamp). + * @method CarbonImmutable subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. + * @method CarbonImmutable addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable addUTCMillennium() Add one millennium to the instance (using timestamp). + * @method CarbonImmutable subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonImmutable subUTCMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. + * @method CarbonImmutable roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonImmutable roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonImmutable floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonImmutable floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonImmutable ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonImmutable ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonImmutable roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonImmutable roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonImmutable floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonImmutable floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonImmutable ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonImmutable ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonImmutable roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonImmutable roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonImmutable floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonImmutable floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonImmutable ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonImmutable ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonImmutable roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonImmutable roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonImmutable floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonImmutable floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonImmutable ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonImmutable ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonImmutable roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonImmutable roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonImmutable floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonImmutable floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonImmutable ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonImmutable ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonImmutable roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonImmutable roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonImmutable floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonImmutable floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonImmutable ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonImmutable ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonImmutable roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonImmutable roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonImmutable floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonImmutable floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonImmutable ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonImmutable ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonImmutable roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonImmutable roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonImmutable floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonImmutable floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonImmutable ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonImmutable ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonImmutable roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonImmutable roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonImmutable floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonImmutable floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonImmutable ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonImmutable ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonImmutable roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonImmutable roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonImmutable floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonImmutable floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonImmutable ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonImmutable ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonImmutable roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonImmutable roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonImmutable floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonImmutable floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonImmutable ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonImmutable ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonImmutable roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonImmutable roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonImmutable floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonImmutable floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonImmutable ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method CarbonImmutable ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium + * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value + * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value + * @method int daysInCentury() Return the number of days contained in the current century + * @method int daysInDecade() Return the number of days contained in the current decade + * @method int daysInMillennium() Return the number of days contained in the current millennium + * @method int daysInMonth() Return the number of days contained in the current month + * @method int daysInQuarter() Return the number of days contained in the current quarter + * @method int daysInWeek() Return the number of days contained in the current week + * @method int daysInYear() Return the number of days contained in the current year + * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value + * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value + * @method int decadesInCentury() Return the number of decades contained in the current century + * @method int decadesInMillennium() Return the number of decades contained in the current millennium + * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value + * @method int hoursInCentury() Return the number of hours contained in the current century + * @method int hoursInDay() Return the number of hours contained in the current day + * @method int hoursInDecade() Return the number of hours contained in the current decade + * @method int hoursInMillennium() Return the number of hours contained in the current millennium + * @method int hoursInMonth() Return the number of hours contained in the current month + * @method int hoursInQuarter() Return the number of hours contained in the current quarter + * @method int hoursInWeek() Return the number of hours contained in the current week + * @method int hoursInYear() Return the number of hours contained in the current year + * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value + * @method int microsecondsInCentury() Return the number of microseconds contained in the current century + * @method int microsecondsInDay() Return the number of microseconds contained in the current day + * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade + * @method int microsecondsInHour() Return the number of microseconds contained in the current hour + * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium + * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond + * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute + * @method int microsecondsInMonth() Return the number of microseconds contained in the current month + * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter + * @method int microsecondsInSecond() Return the number of microseconds contained in the current second + * @method int microsecondsInWeek() Return the number of microseconds contained in the current week + * @method int microsecondsInYear() Return the number of microseconds contained in the current year + * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value + * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century + * @method int millisecondsInDay() Return the number of milliseconds contained in the current day + * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade + * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour + * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium + * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute + * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month + * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter + * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second + * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week + * @method int millisecondsInYear() Return the number of milliseconds contained in the current year + * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value + * @method int minutesInCentury() Return the number of minutes contained in the current century + * @method int minutesInDay() Return the number of minutes contained in the current day + * @method int minutesInDecade() Return the number of minutes contained in the current decade + * @method int minutesInHour() Return the number of minutes contained in the current hour + * @method int minutesInMillennium() Return the number of minutes contained in the current millennium + * @method int minutesInMonth() Return the number of minutes contained in the current month + * @method int minutesInQuarter() Return the number of minutes contained in the current quarter + * @method int minutesInWeek() Return the number of minutes contained in the current week + * @method int minutesInYear() Return the number of minutes contained in the current year + * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value + * @method int monthsInCentury() Return the number of months contained in the current century + * @method int monthsInDecade() Return the number of months contained in the current decade + * @method int monthsInMillennium() Return the number of months contained in the current millennium + * @method int monthsInQuarter() Return the number of months contained in the current quarter + * @method int monthsInYear() Return the number of months contained in the current year + * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value + * @method int quartersInCentury() Return the number of quarters contained in the current century + * @method int quartersInDecade() Return the number of quarters contained in the current decade + * @method int quartersInMillennium() Return the number of quarters contained in the current millennium + * @method int quartersInYear() Return the number of quarters contained in the current year + * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value + * @method int secondsInCentury() Return the number of seconds contained in the current century + * @method int secondsInDay() Return the number of seconds contained in the current day + * @method int secondsInDecade() Return the number of seconds contained in the current decade + * @method int secondsInHour() Return the number of seconds contained in the current hour + * @method int secondsInMillennium() Return the number of seconds contained in the current millennium + * @method int secondsInMinute() Return the number of seconds contained in the current minute + * @method int secondsInMonth() Return the number of seconds contained in the current month + * @method int secondsInQuarter() Return the number of seconds contained in the current quarter + * @method int secondsInWeek() Return the number of seconds contained in the current week + * @method int secondsInYear() Return the number of seconds contained in the current year + * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value + * @method int weeksInCentury() Return the number of weeks contained in the current century + * @method int weeksInDecade() Return the number of weeks contained in the current decade + * @method int weeksInMillennium() Return the number of weeks contained in the current millennium + * @method int weeksInMonth() Return the number of weeks contained in the current month + * @method int weeksInQuarter() Return the number of weeks contained in the current quarter + * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value + * @method int yearsInCentury() Return the number of years contained in the current century + * @method int yearsInDecade() Return the number of years contained in the current decade + * @method int yearsInMillennium() Return the number of years contained in the current millennium + * + * + */ +class CarbonImmutable extends DateTimeImmutable implements CarbonInterface +{ + use Date { + __clone as dateTraitClone; + } + + public function __clone(): void + { + $this->dateTraitClone(); + $this->endOfTime = false; + $this->startOfTime = false; + } + + /** + * Create a very old date representing start of time. + * + * @return static + */ + public static function startOfTime(): static + { + $date = static::parse('0001-01-01')->years(self::getStartOfTimeYear()); + $date->startOfTime = true; + + return $date; + } + + /** + * Create a very far date representing end of time. + * + * @return static + */ + public static function endOfTime(): static + { + $date = static::parse('9999-12-31 23:59:59.999999')->years(self::getEndOfTimeYear()); + $date->endOfTime = true; + + return $date; + } + + /** + * @codeCoverageIgnore + */ + private static function getEndOfTimeYear(): int + { + return 1118290769066902787; // PHP_INT_MAX no longer work since PHP 8.1 + } + + /** + * @codeCoverageIgnore + */ + private static function getStartOfTimeYear(): int + { + return -1118290769066898816; // PHP_INT_MIN no longer work since PHP 8.1 + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php new file mode 100644 index 00000000..1779246e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterface.php @@ -0,0 +1,4960 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use BadMethodCallException; +use Carbon\Exceptions\BadComparisonUnitException; +use Carbon\Exceptions\ImmutableException; +use Carbon\Exceptions\InvalidDateException; +use Carbon\Exceptions\InvalidFormatException; +use Carbon\Exceptions\UnknownGetterException; +use Carbon\Exceptions\UnknownMethodException; +use Carbon\Exceptions\UnknownSetterException; +use Closure; +use DateInterval; +use DateTime; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use JsonSerializable; +use ReflectionException; +use ReturnTypeWillChange; +use Symfony\Contracts\Translation\TranslatorInterface; +use Throwable; + +/** + * Common interface for Carbon and CarbonImmutable. + * + * + * + * @property string $localeDayOfWeek the day of week in current locale + * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale + * @property string $localeMonth the month in current locale + * @property string $shortLocaleMonth the abbreviated month in current locale + * @property int $year + * @property int $yearIso + * @property int $month + * @property int $day + * @property int $hour + * @property int $minute + * @property int $second + * @property int $micro + * @property int $microsecond + * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English + * @property int $milliseconds + * @property int $millisecond + * @property int $milli + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium + * @property int $dayOfCentury The value of the day starting from the beginning of the current century + * @property int $dayOfDecade The value of the day starting from the beginning of the current decade + * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium + * @property int $dayOfMonth The value of the day starting from the beginning of the current month + * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter + * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property int $dayOfYear 1 through 366 + * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century + * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium + * @property int $hourOfCentury The value of the hour starting from the beginning of the current century + * @property int $hourOfDay The value of the hour starting from the beginning of the current day + * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade + * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium + * @property int $hourOfMonth The value of the hour starting from the beginning of the current month + * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter + * @property int $hourOfWeek The value of the hour starting from the beginning of the current week + * @property int $hourOfYear The value of the hour starting from the beginning of the current year + * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century + * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day + * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade + * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour + * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium + * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond + * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute + * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month + * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter + * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second + * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week + * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year + * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century + * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day + * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade + * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour + * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium + * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute + * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month + * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter + * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second + * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week + * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year + * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century + * @property int $minuteOfDay The value of the minute starting from the beginning of the current day + * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade + * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour + * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium + * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month + * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter + * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week + * @property int $minuteOfYear The value of the minute starting from the beginning of the current year + * @property int $monthOfCentury The value of the month starting from the beginning of the current century + * @property int $monthOfDecade The value of the month starting from the beginning of the current decade + * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium + * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter + * @property int $monthOfYear The value of the month starting from the beginning of the current year + * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century + * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade + * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium + * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year + * @property int $secondOfCentury The value of the second starting from the beginning of the current century + * @property int $secondOfDay The value of the second starting from the beginning of the current day + * @property int $secondOfDecade The value of the second starting from the beginning of the current decade + * @property int $secondOfHour The value of the second starting from the beginning of the current hour + * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium + * @property int $secondOfMinute The value of the second starting from the beginning of the current minute + * @property int $secondOfMonth The value of the second starting from the beginning of the current month + * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter + * @property int $secondOfWeek The value of the second starting from the beginning of the current week + * @property int $secondOfYear The value of the second starting from the beginning of the current year + * @property int $weekOfCentury The value of the week starting from the beginning of the current century + * @property int $weekOfDecade The value of the week starting from the beginning of the current decade + * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium + * @property int $weekOfMonth 1 through 5 + * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter + * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property int $yearOfCentury The value of the year starting from the beginning of the current century + * @property int $yearOfDecade The value of the year starting from the beginning of the current decade + * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance + * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium + * @property-read int $daysInCentury The number of days contained in the current century + * @property-read int $daysInDecade The number of days contained in the current decade + * @property-read int $daysInMillennium The number of days contained in the current millennium + * @property-read int $daysInMonth number of days in the given month + * @property-read int $daysInQuarter The number of days contained in the current quarter + * @property-read int $daysInWeek The number of days contained in the current week + * @property-read int $daysInYear 365 or 366 + * @property-read int $decadesInCentury The number of decades contained in the current century + * @property-read int $decadesInMillennium The number of decades contained in the current millennium + * @property-read int $hoursInCentury The number of hours contained in the current century + * @property-read int $hoursInDay The number of hours contained in the current day + * @property-read int $hoursInDecade The number of hours contained in the current decade + * @property-read int $hoursInMillennium The number of hours contained in the current millennium + * @property-read int $hoursInMonth The number of hours contained in the current month + * @property-read int $hoursInQuarter The number of hours contained in the current quarter + * @property-read int $hoursInWeek The number of hours contained in the current week + * @property-read int $hoursInYear The number of hours contained in the current year + * @property-read int $microsecondsInCentury The number of microseconds contained in the current century + * @property-read int $microsecondsInDay The number of microseconds contained in the current day + * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade + * @property-read int $microsecondsInHour The number of microseconds contained in the current hour + * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium + * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond + * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute + * @property-read int $microsecondsInMonth The number of microseconds contained in the current month + * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter + * @property-read int $microsecondsInSecond The number of microseconds contained in the current second + * @property-read int $microsecondsInWeek The number of microseconds contained in the current week + * @property-read int $microsecondsInYear The number of microseconds contained in the current year + * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century + * @property-read int $millisecondsInDay The number of milliseconds contained in the current day + * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade + * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour + * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium + * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute + * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month + * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter + * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second + * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week + * @property-read int $millisecondsInYear The number of milliseconds contained in the current year + * @property-read int $minutesInCentury The number of minutes contained in the current century + * @property-read int $minutesInDay The number of minutes contained in the current day + * @property-read int $minutesInDecade The number of minutes contained in the current decade + * @property-read int $minutesInHour The number of minutes contained in the current hour + * @property-read int $minutesInMillennium The number of minutes contained in the current millennium + * @property-read int $minutesInMonth The number of minutes contained in the current month + * @property-read int $minutesInQuarter The number of minutes contained in the current quarter + * @property-read int $minutesInWeek The number of minutes contained in the current week + * @property-read int $minutesInYear The number of minutes contained in the current year + * @property-read int $monthsInCentury The number of months contained in the current century + * @property-read int $monthsInDecade The number of months contained in the current decade + * @property-read int $monthsInMillennium The number of months contained in the current millennium + * @property-read int $monthsInQuarter The number of months contained in the current quarter + * @property-read int $monthsInYear The number of months contained in the current year + * @property-read int $quartersInCentury The number of quarters contained in the current century + * @property-read int $quartersInDecade The number of quarters contained in the current decade + * @property-read int $quartersInMillennium The number of quarters contained in the current millennium + * @property-read int $quartersInYear The number of quarters contained in the current year + * @property-read int $secondsInCentury The number of seconds contained in the current century + * @property-read int $secondsInDay The number of seconds contained in the current day + * @property-read int $secondsInDecade The number of seconds contained in the current decade + * @property-read int $secondsInHour The number of seconds contained in the current hour + * @property-read int $secondsInMillennium The number of seconds contained in the current millennium + * @property-read int $secondsInMinute The number of seconds contained in the current minute + * @property-read int $secondsInMonth The number of seconds contained in the current month + * @property-read int $secondsInQuarter The number of seconds contained in the current quarter + * @property-read int $secondsInWeek The number of seconds contained in the current week + * @property-read int $secondsInYear The number of seconds contained in the current year + * @property-read int $weeksInCentury The number of weeks contained in the current century + * @property-read int $weeksInDecade The number of weeks contained in the current decade + * @property-read int $weeksInMillennium The number of weeks contained in the current millennium + * @property-read int $weeksInMonth The number of weeks contained in the current month + * @property-read int $weeksInQuarter The number of weeks contained in the current quarter + * @property-read int $weeksInYear 51 through 53 + * @property-read int $yearsInCentury The number of years contained in the current century + * @property-read int $yearsInDecade The number of years contained in the current decade + * @property-read int $yearsInMillennium The number of years contained in the current millennium + * + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method CarbonInterface years(int $value) Set current instance year to the given value. + * @method CarbonInterface year(int $value) Set current instance year to the given value. + * @method CarbonInterface setYears(int $value) Set current instance year to the given value. + * @method CarbonInterface setYear(int $value) Set current instance year to the given value. + * @method CarbonInterface months(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface month(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface setMonths(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface setMonth(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface days(int $value) Set current instance day to the given value. + * @method CarbonInterface day(int $value) Set current instance day to the given value. + * @method CarbonInterface setDays(int $value) Set current instance day to the given value. + * @method CarbonInterface setDay(int $value) Set current instance day to the given value. + * @method CarbonInterface hours(int $value) Set current instance hour to the given value. + * @method CarbonInterface hour(int $value) Set current instance hour to the given value. + * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. + * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. + * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. + * @method CarbonInterface minute(int $value) Set current instance minute to the given value. + * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. + * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. + * @method CarbonInterface seconds(int $value) Set current instance second to the given value. + * @method CarbonInterface second(int $value) Set current instance second to the given value. + * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. + * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. + * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addYear() Add one year to the instance (using date interval). + * @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subYear() Sub one year to the instance (using date interval). + * @method CarbonInterface addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMonth() Add one month to the instance (using date interval). + * @method CarbonInterface subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). + * @method CarbonInterface addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addDay() Add one day to the instance (using date interval). + * @method CarbonInterface subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subDay() Sub one day to the instance (using date interval). + * @method CarbonInterface addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addHour() Add one hour to the instance (using date interval). + * @method CarbonInterface subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). + * @method CarbonInterface addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). + * @method CarbonInterface subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). + * @method CarbonInterface addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addSecond() Add one second to the instance (using date interval). + * @method CarbonInterface subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). + * @method CarbonInterface addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). + * @method CarbonInterface subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). + * @method CarbonInterface addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). + * @method CarbonInterface subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). + * @method CarbonInterface addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). + * @method CarbonInterface subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). + * @method CarbonInterface addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). + * @method CarbonInterface subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method CarbonInterface addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). + * @method CarbonInterface subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). + * @method CarbonInterface addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addCentury() Add one century to the instance (using date interval). + * @method CarbonInterface subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). + * @method CarbonInterface addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). + * @method CarbonInterface subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). + * @method CarbonInterface addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). + * @method CarbonInterface subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). + * @method CarbonInterface addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addWeek() Add one week to the instance (using date interval). + * @method CarbonInterface subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). + * @method CarbonInterface addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). + * @method CarbonInterface subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). + * @method CarbonInterface addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMicro() Add one microsecond to the instance (using timestamp). + * @method CarbonInterface subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonInterface addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMicrosecond() Add one microsecond to the instance (using timestamp). + * @method CarbonInterface subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonInterface addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMilli() Add one millisecond to the instance (using timestamp). + * @method CarbonInterface subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonInterface addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMillisecond() Add one millisecond to the instance (using timestamp). + * @method CarbonInterface subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonInterface addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCSecond() Add one second to the instance (using timestamp). + * @method CarbonInterface subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. + * @method CarbonInterface addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMinute() Add one minute to the instance (using timestamp). + * @method CarbonInterface subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. + * @method CarbonInterface addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCHour() Add one hour to the instance (using timestamp). + * @method CarbonInterface subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. + * @method CarbonInterface addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCDay() Add one day to the instance (using timestamp). + * @method CarbonInterface subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. + * @method CarbonInterface addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCWeek() Add one week to the instance (using timestamp). + * @method CarbonInterface subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. + * @method CarbonInterface addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMonth() Add one month to the instance (using timestamp). + * @method CarbonInterface subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. + * @method CarbonInterface addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCQuarter() Add one quarter to the instance (using timestamp). + * @method CarbonInterface subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. + * @method CarbonInterface addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCYear() Add one year to the instance (using timestamp). + * @method CarbonInterface subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. + * @method CarbonInterface addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCDecade() Add one decade to the instance (using timestamp). + * @method CarbonInterface subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. + * @method CarbonInterface addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCCentury() Add one century to the instance (using timestamp). + * @method CarbonInterface subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. + * @method CarbonInterface addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMillennium() Add one millennium to the instance (using timestamp). + * @method CarbonInterface subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. + * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium + * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value + * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value + * @method int daysInCentury() Return the number of days contained in the current century + * @method int daysInDecade() Return the number of days contained in the current decade + * @method int daysInMillennium() Return the number of days contained in the current millennium + * @method int daysInMonth() Return the number of days contained in the current month + * @method int daysInQuarter() Return the number of days contained in the current quarter + * @method int daysInWeek() Return the number of days contained in the current week + * @method int daysInYear() Return the number of days contained in the current year + * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value + * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value + * @method int decadesInCentury() Return the number of decades contained in the current century + * @method int decadesInMillennium() Return the number of decades contained in the current millennium + * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value + * @method int hoursInCentury() Return the number of hours contained in the current century + * @method int hoursInDay() Return the number of hours contained in the current day + * @method int hoursInDecade() Return the number of hours contained in the current decade + * @method int hoursInMillennium() Return the number of hours contained in the current millennium + * @method int hoursInMonth() Return the number of hours contained in the current month + * @method int hoursInQuarter() Return the number of hours contained in the current quarter + * @method int hoursInWeek() Return the number of hours contained in the current week + * @method int hoursInYear() Return the number of hours contained in the current year + * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value + * @method int microsecondsInCentury() Return the number of microseconds contained in the current century + * @method int microsecondsInDay() Return the number of microseconds contained in the current day + * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade + * @method int microsecondsInHour() Return the number of microseconds contained in the current hour + * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium + * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond + * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute + * @method int microsecondsInMonth() Return the number of microseconds contained in the current month + * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter + * @method int microsecondsInSecond() Return the number of microseconds contained in the current second + * @method int microsecondsInWeek() Return the number of microseconds contained in the current week + * @method int microsecondsInYear() Return the number of microseconds contained in the current year + * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value + * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century + * @method int millisecondsInDay() Return the number of milliseconds contained in the current day + * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade + * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour + * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium + * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute + * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month + * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter + * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second + * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week + * @method int millisecondsInYear() Return the number of milliseconds contained in the current year + * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value + * @method int minutesInCentury() Return the number of minutes contained in the current century + * @method int minutesInDay() Return the number of minutes contained in the current day + * @method int minutesInDecade() Return the number of minutes contained in the current decade + * @method int minutesInHour() Return the number of minutes contained in the current hour + * @method int minutesInMillennium() Return the number of minutes contained in the current millennium + * @method int minutesInMonth() Return the number of minutes contained in the current month + * @method int minutesInQuarter() Return the number of minutes contained in the current quarter + * @method int minutesInWeek() Return the number of minutes contained in the current week + * @method int minutesInYear() Return the number of minutes contained in the current year + * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value + * @method int monthsInCentury() Return the number of months contained in the current century + * @method int monthsInDecade() Return the number of months contained in the current decade + * @method int monthsInMillennium() Return the number of months contained in the current millennium + * @method int monthsInQuarter() Return the number of months contained in the current quarter + * @method int monthsInYear() Return the number of months contained in the current year + * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value + * @method int quartersInCentury() Return the number of quarters contained in the current century + * @method int quartersInDecade() Return the number of quarters contained in the current decade + * @method int quartersInMillennium() Return the number of quarters contained in the current millennium + * @method int quartersInYear() Return the number of quarters contained in the current year + * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value + * @method int secondsInCentury() Return the number of seconds contained in the current century + * @method int secondsInDay() Return the number of seconds contained in the current day + * @method int secondsInDecade() Return the number of seconds contained in the current decade + * @method int secondsInHour() Return the number of seconds contained in the current hour + * @method int secondsInMillennium() Return the number of seconds contained in the current millennium + * @method int secondsInMinute() Return the number of seconds contained in the current minute + * @method int secondsInMonth() Return the number of seconds contained in the current month + * @method int secondsInQuarter() Return the number of seconds contained in the current quarter + * @method int secondsInWeek() Return the number of seconds contained in the current week + * @method int secondsInYear() Return the number of seconds contained in the current year + * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value + * @method int weeksInCentury() Return the number of weeks contained in the current century + * @method int weeksInDecade() Return the number of weeks contained in the current decade + * @method int weeksInMillennium() Return the number of weeks contained in the current millennium + * @method int weeksInMonth() Return the number of weeks contained in the current month + * @method int weeksInQuarter() Return the number of weeks contained in the current quarter + * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value + * @method int yearsInCentury() Return the number of years contained in the current century + * @method int yearsInDecade() Return the number of years contained in the current decade + * @method int yearsInMillennium() Return the number of years contained in the current millennium + * + * + * + * @codeCoverageIgnore + */ +interface CarbonInterface extends DateTimeInterface, JsonSerializable +{ + /** + * Diff wording options(expressed in octal). + */ + public const NO_ZERO_DIFF = 01; + public const JUST_NOW = 02; + public const ONE_DAY_WORDS = 04; + public const TWO_DAY_WORDS = 010; + public const SEQUENTIAL_PARTS_ONLY = 020; + public const ROUND = 040; + public const FLOOR = 0100; + public const CEIL = 0200; + + /** + * Diff syntax options. + */ + public const DIFF_ABSOLUTE = 1; // backward compatibility with true + public const DIFF_RELATIVE_AUTO = 0; // backward compatibility with false + public const DIFF_RELATIVE_TO_NOW = 2; + public const DIFF_RELATIVE_TO_OTHER = 3; + + /** + * Translate string options. + */ + public const TRANSLATE_MONTHS = 1; + public const TRANSLATE_DAYS = 2; + public const TRANSLATE_UNITS = 4; + public const TRANSLATE_MERIDIEM = 8; + public const TRANSLATE_DIFF = 0x10; + public const TRANSLATE_ALL = self::TRANSLATE_MONTHS | self::TRANSLATE_DAYS | self::TRANSLATE_UNITS | self::TRANSLATE_MERIDIEM | self::TRANSLATE_DIFF; + + /** + * The day constants. + */ + public const SUNDAY = 0; + public const MONDAY = 1; + public const TUESDAY = 2; + public const WEDNESDAY = 3; + public const THURSDAY = 4; + public const FRIDAY = 5; + public const SATURDAY = 6; + + /** + * The month constants. + * These aren't used by Carbon itself but exist for + * convenience sake alone. + */ + public const JANUARY = 1; + public const FEBRUARY = 2; + public const MARCH = 3; + public const APRIL = 4; + public const MAY = 5; + public const JUNE = 6; + public const JULY = 7; + public const AUGUST = 8; + public const SEPTEMBER = 9; + public const OCTOBER = 10; + public const NOVEMBER = 11; + public const DECEMBER = 12; + + /** + * Number of X in Y. + */ + public const YEARS_PER_MILLENNIUM = 1_000; + public const YEARS_PER_CENTURY = 100; + public const YEARS_PER_DECADE = 10; + public const MONTHS_PER_YEAR = 12; + public const MONTHS_PER_QUARTER = 3; + public const QUARTERS_PER_YEAR = 4; + public const WEEKS_PER_YEAR = 52; + public const WEEKS_PER_MONTH = 4; + public const DAYS_PER_YEAR = 365; + public const DAYS_PER_WEEK = 7; + public const HOURS_PER_DAY = 24; + public const MINUTES_PER_HOUR = 60; + public const SECONDS_PER_MINUTE = 60; + public const MILLISECONDS_PER_SECOND = 1_000; + public const MICROSECONDS_PER_MILLISECOND = 1_000; + public const MICROSECONDS_PER_SECOND = 1_000_000; + + /** + * Special settings to get the start of week from current locale culture. + */ + public const WEEK_DAY_AUTO = 'auto'; + + /** + * RFC7231 DateTime format. + * + * @var string + */ + public const RFC7231_FORMAT = 'D, d M Y H:i:s \G\M\T'; + + /** + * Default format to use for __toString method when type juggling occurs. + * + * @var string + */ + public const DEFAULT_TO_STRING_FORMAT = 'Y-m-d H:i:s'; + + /** + * Format for converting mocked time, includes microseconds. + * + * @var string + */ + public const MOCK_DATETIME_FORMAT = 'Y-m-d H:i:s.u'; + + /** + * Pattern detection for ->isoFormat and ::createFromIsoFormat. + * + * @var string + */ + public const ISO_FORMAT_REGEXP = '(O[YMDHhms]|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY?|g{1,5}|G{1,5}|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?)'; + + /** + * Default locale (language and region). + * + * @var string + */ + public const DEFAULT_LOCALE = 'en'; + + // + + /** + * Dynamically handle calls to the class. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable + */ + public function __call(string $method, array $parameters): mixed; + + /** + * Dynamically handle calls to the class. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @throws BadMethodCallException + */ + public static function __callStatic(string $method, array $parameters): mixed; + + /** + * Update constructedObjectId on cloned. + */ + public function __clone(): void; + + /** + * Create a new Carbon instance. + * + * Please see the testing aids section (specifically static::setTestNow()) + * for more on the possibility of this constructor returning a test instance. + * + * @throws InvalidFormatException + */ + public function __construct(DateTimeInterface|WeekDay|Month|string|int|float|null $time = null, DateTimeZone|string|int|null $timezone = null); + + /** + * Show truthy properties on var_dump(). + */ + public function __debugInfo(): array; + + /** + * Get a part of the Carbon object. + * + * @throws UnknownGetterException + * + * @return string|int|bool|DateTimeZone|null + */ + public function __get(string $name): mixed; + + /** + * Check if an attribute exists on the object + * + * @param string $name + * + * @return bool + */ + public function __isset($name); + + /** + * Set a part of the Carbon object + * + * @param string $name + * @param string|int|DateTimeZone $value + * + * @throws UnknownSetterException|ReflectionException + * + * @return void + */ + public function __set($name, $value); + + /** + * The __set_state handler. + * + * @param string|array $dump + * + * @return static + */ + #[ReturnTypeWillChange] + public static function __set_state($dump): static; + + /** + * Returns the list of properties to dump on serialize() called on. + * + * Only used by PHP < 7.4. + * + * @return array + */ + public function __sleep(); + + /** + * Format the instance as a string using the set format + * + * @example + * ``` + * echo Carbon::now(); // Carbon instances can be cast to string + * ``` + */ + public function __toString(); + + /** + * Add given units or interval to the current instance. + * + * @example $date->add('hour', 3) + * @example $date->add(15, 'days') + * @example $date->add(CarbonInterval::days(4)) + * + * @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + #[ReturnTypeWillChange] + public function add($unit, $value = 1, ?bool $overflow = null): static; + + /** + * @deprecated Prefer to use add addUTCUnit() which more accurately defines what it's doing. + * + * Add seconds to the instance using timestamp. Positive $value travels + * forward while negative $value travels into the past. + * + * @param string $unit + * @param int|float|null $value + * + * @return static + */ + public function addRealUnit(string $unit, $value = 1): static; + + /** + * Add seconds to the instance using timestamp. Positive $value travels + * forward while negative $value travels into the past. + * + * @param string $unit + * @param int|float|null $value + * + * @return static + */ + public function addUTCUnit(string $unit, $value = 1): static; + + /** + * Add given units to the current instance. + */ + public function addUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static; + + /** + * Add any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value amount to add to the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given to now + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single part) + * @param int $options human diff options + * + * @return string + */ + public function ago($syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Modify the current instance to the average of a given instance (default now) and the current instance + * (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|null $date + * + * @return static + */ + public function average($date = null); + + /** + * Clone the current instance if it's mutable. + * + * This method is convenient to ensure you don't mutate the initial object + * but avoid to make a useless copy of it if it's already immutable. + * + * @return static + */ + public function avoidMutation(): static; + + /** + * Determines if the instance is between two others. + * + * The third argument allow you to specify if bounds are included or not (true by default) + * but for when you including/excluding bounds may produce different results in your application, + * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false + * ``` + * + * @param bool $equal Indicates if an equal to comparison should be done + */ + public function between(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool; + + /** + * Determines if the instance is between two others, bounds excluded. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false + * ``` + */ + public function betweenExcluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool; + + /** + * Determines if the instance is between two others, bounds included. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true + * ``` + */ + public function betweenIncluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool; + + /** + * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, + * or a calendar date (e.g. "10/29/2017") otherwise. + * + * Language, date and time formats will change according to the current locale. + * + * @param Carbon|\DateTimeInterface|string|null $referenceTime + * @param array $formats + * + * @return string + */ + public function calendar($referenceTime = null, array $formats = []); + + /** + * Checks if the (date)time string is in a given format and valid to create a + * new instance. + * + * @example + * ``` + * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true + * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false + * ``` + */ + public static function canBeCreatedFromFormat(?string $date, string $format): bool; + + /** + * Return the Carbon instance passed through, a now instance in the same timezone + * if null given or parse the input if string given. + * + * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date + * + * @return static + */ + public function carbonize($date = null); + + /** + * Cast the current instance into the given class. + * + * @template T + * + * @param class-string $className The $className::instance() method will be called to cast the current object. + * + * @return T + */ + public function cast(string $className): mixed; + + /** + * Ceil the current instance second with given precision if specified. + */ + public function ceil(DateInterval|string|int|float $precision = 1): static; + + /** + * Ceil the current instance at the given unit with given precision if specified. + */ + public function ceilUnit(string $unit, DateInterval|string|int|float $precision = 1): static; + + /** + * Ceil the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function ceilWeek(WeekDay|int|null $weekStartsAt = null): static; + + /** + * Similar to native modify() method of DateTime but can handle more grammars. + * + * @example + * ``` + * echo Carbon::now()->change('next 2pm'); + * ``` + * + * @link https://php.net/manual/en/datetime.modify.php + * + * @param string $modifier + * + * @return static + */ + public function change($modifier); + + /** + * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. + * foreach ($date as $_) {} + * serializer($date) + * var_export($date) + * get_object_vars($date) + */ + public function cleanupDumpProperties(); + + /** + * @alias copy + * + * Get a copy of the instance. + * + * @return static + */ + public function clone(); + + /** + * Get the closest date from the instance (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 + * + * @return static + */ + public function closest($date1, $date2); + + /** + * Get a copy of the instance. + * + * @return static + */ + public function copy(); + + /** + * Create a new Carbon instance from a specific date and time. + * + * If any of $year, $month or $day are set to null their now() values will + * be used. + * + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * + * If $hour is not null then the default values for $minute and $second + * will be 0. + * + * @param DateTimeInterface|string|int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null); + + /** + * Create a Carbon instance from just a date. The time portion is set to now. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createFromDate($year = null, $month = null, $day = null, $timezone = null); + + /** + * Create a Carbon instance from a specific format. + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + #[ReturnTypeWillChange] + public static function createFromFormat($format, $time, $timezone = null); + + /** + * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone optional timezone + * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) + * @param TranslatorInterface|null $translator optional custom translator to use for macro-formats + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null); + + /** + * Create a Carbon instance from a specific format and a string in a given language. + * + * @param string $format Datetime format + * @param string $locale + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null); + + /** + * Create a Carbon instance from a specific ISO format and a string in a given language. + * + * @param string $format Datetime ISO format + * @param string $locale + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null); + + /** + * Create a Carbon instance from just a time. The date portion is set to today. + * + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null): static; + + /** + * Create a Carbon instance from a time string. The date portion is set to today. + * + * @throws InvalidFormatException + */ + public static function createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Create a Carbon instance from a timestamp and set the timezone (UTC by default). + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public static function createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Create a Carbon instance from a timestamp in milliseconds. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public static function createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Create a Carbon instance from a timestamp in milliseconds. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + * + * @param float|int|string $timestamp + * + * @return static + */ + public static function createFromTimestampMsUTC($timestamp): static; + + /** + * Create a Carbon instance from a timestamp keeping the timezone to UTC. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public static function createFromTimestampUTC(string|int|float $timestamp): static; + + /** + * Create a Carbon instance from just a date. The time portion is set to midnight. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createMidnightDate($year = null, $month = null, $day = null, $timezone = null); + + /** + * Create a new safe Carbon instance from a specific date and time. + * + * If any of $year, $month or $day are set to null their now() values will + * be used. + * + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * + * If $hour is not null then the default values for $minute and $second + * will be 0. + * + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidDateException + * + * @return static|null + */ + public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null); + + /** + * Create a new Carbon instance from a specific date and time using strict validation. + * + * @see create() + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null): static; + + /** + * Get/set the day of year. + * + * @template T of int|null + * + * @param int|null $value new value for day of year if using as setter. + * + * @psalm-param T $value + * + * @return static|int + * + * @psalm-return (T is int ? static : int) + */ + public function dayOfYear(?int $value = null): static|int; + + /** + * Get the difference as a CarbonInterval instance. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return CarbonInterval + */ + public function diffAsCarbonInterval($date = null, bool $absolute = false, array $skip = []): CarbonInterval; + + /** + * Get the difference as a DateInterval instance. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return DateInterval + */ + public function diffAsDateInterval($date = null, bool $absolute = false): DateInterval; + + /** + * Get the difference by the given interval using a filter closure. + * + * @param CarbonInterval $ci An interval to traverse by + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false): int; + + /** + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + * + * @example + * ``` + * echo Carbon::tomorrow()->diffForHumans() . "\n"; + * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; + * ``` + * + * @param Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * ⦿ 'syntax' entry (see below) + * ⦿ 'short' entry (see below) + * ⦿ 'parts' entry (see below) + * ⦿ 'options' entry (see below) + * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true + * ⦿ 'altNumbers' entry, use alternative numbers if available + * ` (from the current language if true is passed, from the given language(s) + * ` if array or string is passed) + * ⦿ 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * ⦿ 'other' entry (see above) + * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) + * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) + * ⦿ 'translator' a custom translator to use to translator the output. + * if int passed, it adds modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + */ + public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null): string; + + /** + * Get the difference in days. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInDays($date = null, bool $absolute = false, bool $utc = false): float; + + /** + * Get the difference in days using a filter closure. + * + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInDaysFiltered(Closure $callback, $date = null, bool $absolute = false): int; + + /** + * Get the difference in hours. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInHours($date = null, bool $absolute = false): float; + + /** + * Get the difference in hours using a filter closure. + * + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInHoursFiltered(Closure $callback, $date = null, bool $absolute = false): int; + + /** + * Get the difference in microseconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMicroseconds($date = null, bool $absolute = false): float; + + /** + * Get the difference in milliseconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMilliseconds($date = null, bool $absolute = false): float; + + /** + * Get the difference in minutes. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMinutes($date = null, bool $absolute = false): float; + + /** + * Get the difference in months. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInMonths($date = null, bool $absolute = false, bool $utc = false): float; + + /** + * Get the difference in quarters. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInQuarters($date = null, bool $absolute = false, bool $utc = false): float; + + /** + * Get the difference in seconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInSeconds($date = null, bool $absolute = false): float; + + /** + * @param Unit|string $unit microsecond, millisecond, second, minute, + * hour, day, week, month, quarter, year, + * century, millennium + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInUnit(Unit|string $unit, $date = null, bool $absolute = false, bool $utc = false): float; + + /** + * Get the difference in weekdays. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInWeekdays($date = null, bool $absolute = false): int; + + /** + * Get the difference in weekend days using a filter. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInWeekendDays($date = null, bool $absolute = false): int; + + /** + * Get the difference in weeks. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInWeeks($date = null, bool $absolute = false, bool $utc = false): float; + + /** + * Get the difference in years + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInYears($date = null, bool $absolute = false, bool $utc = false): float; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function disableHumanDiffOption(int $humanDiffOption): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function enableHumanDiffOption(int $humanDiffOption): void; + + /** + * Modify to end of current given unit. + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOf(Unit::Month) + * ->endOf(Unit::Week, Carbon::FRIDAY); + * ``` + */ + public function endOf(Unit|string $unit, mixed ...$params): static; + + /** + * Resets the date to end of the century and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); + * ``` + * + * @return static + */ + public function endOfCentury(); + + /** + * Resets the time to 23:59:59.999999 end of day + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); + * ``` + * + * @return static + */ + public function endOfDay(); + + /** + * Resets the date to end of the decade and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); + * ``` + * + * @return static + */ + public function endOfDecade(); + + /** + * Modify to end of current hour, minutes and seconds become 59 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); + * ``` + */ + public function endOfHour(): static; + + /** + * Resets the date to end of the millennium and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); + * ``` + * + * @return static + */ + public function endOfMillennium(); + + /** + * Modify to end of current millisecond, microseconds such as 12345 become 123999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->endOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function endOfMillisecond(): static; + + /** + * Modify to end of current minute, seconds become 59 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); + * ``` + */ + public function endOfMinute(): static; + + /** + * Resets the date to end of the month and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); + * ``` + * + * @return static + */ + public function endOfMonth(); + + /** + * Resets the date to end of the quarter and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); + * ``` + * + * @return static + */ + public function endOfQuarter(); + + /** + * Modify to end of current second, microseconds become 999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->endOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function endOfSecond(): static; + + /** + * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; + * ``` + * + * @param WeekDay|int|null $weekEndsAt optional end allow you to specify the day of week to use to end the week + * + * @return static + */ + public function endOfWeek(WeekDay|int|null $weekEndsAt = null): static; + + /** + * Resets the date to end of the year and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); + * ``` + * + * @return static + */ + public function endOfYear(); + + /** + * Determines if the instance is equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true + * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false + * ``` + * + * @see equalTo() + */ + public function eq(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true + * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false + * ``` + */ + public function equalTo(DateTimeInterface|string $date): bool; + + /** + * Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * + * @param string $locale locale ex. en + * @param callable $func + * + * @return mixed + */ + public static function executeWithLocale(string $locale, callable $func): mixed; + + /** + * Get the farthest date from the instance (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 + * + * @return static + */ + public function farthest($date1, $date2); + + /** + * Modify to the first occurrence of a given day of the week + * in the current month. If no dayOfWeek is provided, modify to the + * first day of the current month. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek + * + * @return static + */ + public function firstOfMonth($dayOfWeek = null); + + /** + * Modify to the first occurrence of a given day of the week + * in the current quarter. If no dayOfWeek is provided, modify to the + * first day of the current quarter. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function firstOfQuarter($dayOfWeek = null); + + /** + * Modify to the first occurrence of a given day of the week + * in the current year. If no dayOfWeek is provided, modify to the + * first day of the current year. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function firstOfYear($dayOfWeek = null); + + /** + * Round the current instance second with given precision if specified. + */ + public function floor(DateInterval|string|int|float $precision = 1): static; + + /** + * Truncate the current instance at the given unit with given precision if specified. + */ + public function floorUnit(string $unit, DateInterval|string|int|float $precision = 1): static; + + /** + * Truncate the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function floorWeek(WeekDay|int|null $weekStartsAt = null): static; + + /** + * @alias diffForHumans + * + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Get the difference in a human readable format in the current locale from current + * instance to now. + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function fromNow($syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Create an instance from a serialized string. + * + * @param string $value + * + * @throws InvalidFormatException + * + * @return static + */ + public static function fromSerialized($value): static; + + /** + * Register a custom macro. + * + * @param callable $macro + * @param int $priority marco with higher priority is tried first + * + * @return void + */ + public static function genericMacro(callable $macro, int $priority = 0): void; + + /** + * Get a part of the Carbon object. + * + * @throws UnknownGetterException + * + * @return string|int|bool|DateTimeZone + */ + public function get(Unit|string $name): mixed; + + /** + * Returns the alternative number for a given date property if available in the current locale. + * + * @param string $key date property + */ + public function getAltNumber(string $key): string; + + /** + * Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * + * @return array + */ + public static function getAvailableLocales(); + + /** + * Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * + * @return Language[] + */ + public static function getAvailableLocalesInfo(); + + /** + * Returns list of calendar formats for ISO formatting. + * + * @param string|null $locale current locale used if null + */ + public function getCalendarFormats(?string $locale = null): array; + + public function getClock(): ?WrapperClock; + + /** + * Get the days of the week. + */ + public static function getDays(): array; + + /** + * Return the number of days since the start of the week (using the current locale or the first parameter + * if explicitly given). + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, + * if not provided, start of week is inferred from the locale + * (Sunday for en_US, Monday for de_DE, etc.) + */ + public function getDaysFromStartOfWeek(WeekDay|int|null $weekStartsAt = null): int; + + /** + * Get the fallback locale. + * + * @see https://symfony.com/doc/current/components/translation.html#fallback-locales + */ + public static function getFallbackLocale(): ?string; + + /** + * List of replacements from date() format to isoFormat(). + */ + public static function getFormatsToIsoReplacements(): array; + + /** + * Return default humanDiff() options (merged flags as integer). + */ + public static function getHumanDiffOptions(): int; + + /** + * Returns list of locale formats for ISO formatting. + * + * @param string|null $locale current locale used if null + */ + public function getIsoFormats(?string $locale = null): array; + + /** + * Returns list of locale units for ISO formatting. + */ + public static function getIsoUnits(): array; + + /** + * {@inheritdoc} + */ + public static function getLastErrors(): array|false; + + /** + * Get the raw callable macro registered globally or locally for a given name. + */ + public function getLocalMacro(string $name): ?callable; + + /** + * Get the translator of the current instance or the default if none set. + */ + public function getLocalTranslator(): TranslatorInterface; + + /** + * Get the current translator locale. + * + * @return string + */ + public static function getLocale(): string; + + /** + * Get the raw callable macro registered globally for a given name. + */ + public static function getMacro(string $name): ?callable; + + /** + * get midday/noon hour + * + * @return int + */ + public static function getMidDayAt(); + + /** + * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). + * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first + * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something + * like "-12:00". + * + * @param string $separator string to place between hours and minutes (":" by default) + */ + public function getOffsetString(string $separator = ':'): string; + + /** + * Returns a unit of the instance padded with 0 by default or any other string if specified. + * + * @param string $unit Carbon unit name + * @param int $length Length of the output (2 by default) + * @param string $padString String to use for padding ("0" by default) + * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) + */ + public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = 0): string; + + /** + * Returns a timestamp rounded with the given precision (6 by default). + * + * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) + * @example getPreciseTimestamp(6) 1532087464437474 + * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) + * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) + * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) + * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) + * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) + * @example getPreciseTimestamp(0) 1532087464 (second precision) + * @example getPreciseTimestamp(-1) 153208746 (10 second precision) + * @example getPreciseTimestamp(-2) 15320875 (100 second precision) + * + * @param int $precision + * + * @return float + */ + public function getPreciseTimestamp($precision = 6): float; + + /** + * Returns current local settings. + */ + public function getSettings(): array; + + /** + * Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * + * @return Closure|self|null the current instance used for testing + */ + public static function getTestNow(): Closure|self|null; + + /** + * Return a format from H:i to H:i:s.u according to given unit precision. + * + * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" + */ + public static function getTimeFormatByPrecision(string $unitPrecision): string; + + /** + * Returns the timestamp with millisecond precision. + * + * @return int + */ + public function getTimestampMs(): int; + + /** + * Get the translation of the current week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + * @param string $keySuffix "", "_short" or "_min" + * @param string|null $defaultValue default value if translation missing + */ + public function getTranslatedDayName(?string $context = null, string $keySuffix = '', ?string $defaultValue = null): string; + + /** + * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedMinDayName(?string $context = null): string; + + /** + * Get the translation of the current month day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + * @param string $keySuffix "" or "_short" + * @param string|null $defaultValue default value if translation missing + */ + public function getTranslatedMonthName(?string $context = null, string $keySuffix = '', ?string $defaultValue = null): string; + + /** + * Get the translation of the current short week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedShortDayName(?string $context = null): string; + + /** + * Get the translation of the current short month day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedShortMonthName(?string $context = null): string; + + /** + * Returns raw translation message for a given key. + * + * @param string $key key to find + * @param string|null $locale current locale used if null + * @param string|null $default default value if translation returns the key + * @param TranslatorInterface $translator an optional translator to use + * + * @return string + */ + public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null); + + /** + * Returns raw translation message for a given key. + * + * @param TranslatorInterface|null $translator the translator to use + * @param string $key key to find + * @param string|null $locale current locale used if null + * @param string|null $default default value if translation returns the key + * + * @return string|Closure|null + */ + public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null); + + /** + * Initialize the default translator instance if necessary. + */ + public static function getTranslator(): TranslatorInterface; + + /** + * Get the last day of week. + * + * @param string $locale local to consider the last day of week. + * + * @return int + */ + public static function getWeekEndsAt(?string $locale = null): int; + + /** + * Get the first day of week. + * + * @return int + */ + public static function getWeekStartsAt(?string $locale = null): int; + + /** + * Get weekend days + */ + public static function getWeekendDays(): array; + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false + * ``` + */ + public function greaterThan(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is greater (after) than or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false + * ``` + */ + public function greaterThanOrEqualTo(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThan() + */ + public function gt(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is greater (after) than or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThanOrEqualTo() + */ + public function gte(DateTimeInterface|string $date): bool; + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormat('11:12:45', 'h:i:s'); // true + * Carbon::hasFormat('13:12:45', 'h:i:s'); // false + * ``` + */ + public static function hasFormat(string $date, string $format): bool; + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true + * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false + * ``` + * + * @param string $date + * @param string $format + * + * @return bool + */ + public static function hasFormatWithModifiers(?string $date, string $format): bool; + + /** + * Checks if macro is registered globally or locally. + */ + public function hasLocalMacro(string $name): bool; + + /** + * Return true if the current instance has its own translator. + */ + public function hasLocalTranslator(): bool; + + /** + * Checks if macro is registered globally. + * + * @param string $name + * + * @return bool + */ + public static function hasMacro(string $name): bool; + + /** + * Determine if a time string will produce a relative date. + * + * @return bool true if time match a relative date, false if absolute or invalid time string + */ + public static function hasRelativeKeywords(?string $time): bool; + + /** + * Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * + * @return bool true if there is a test instance, otherwise false + */ + public static function hasTestNow(): bool; + + /** + * Create a Carbon instance from a DateTime one. + */ + public static function instance(DateTimeInterface $date): static; + + /** + * Returns true if the current date matches the given string. + * + * @example + * ``` + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true + * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true + * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false + * ``` + * + * @param string $tester day name, month name, hour, date, etc. as string + */ + public function is(WeekDay|Month|string $tester): bool; + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThan() + */ + public function isAfter(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThan() + */ + public function isBefore(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is between two others + * + * @example + * ``` + * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false + * ``` + * + * @param bool $equal Indicates if an equal to comparison should be done + */ + public function isBetween(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool; + + /** + * Check if its the birthday. Compares the date/month values of the two dates. + * + * @example + * ``` + * Carbon::now()->subYears(5)->isBirthday(); // true + * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false + * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true + * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false + * ``` + * + * @param DateTimeInterface|string|null $date The instance to compare with or null to use current day. + * + * @return bool + */ + public function isBirthday(DateTimeInterface|string|null $date = null): bool; + + /** + * Determines if the instance is in the current unit given. + * + * @example + * ``` + * Carbon::now()->isCurrentUnit('hour'); // true + * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false + * ``` + * + * @param string $unit The unit to test. + * + * @throws BadMethodCallException + */ + public function isCurrentUnit(string $unit): bool; + + /** + * Checks if this day is a specific day of the week. + * + * @example + * ``` + * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true + * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false + * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true + * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false + * ``` + * + * @param int|string $dayOfWeek + * + * @return bool + */ + public function isDayOfWeek($dayOfWeek): bool; + + /** + * Determines if the instance is end of century (last day by default but interval can be customized). + */ + public function isEndOfCentury(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Check if the instance is end of day. + * + * @example + * ``` + * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false + * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true + * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false + * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false + * ``` + * + * @param bool $checkMicroseconds check time at microseconds precision + * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision + * for instance with "15 minutes", it checks if current date-time + * is in the last 15 minutes of the day, with Unit::Hour, it + * checks if it's in the last hour of the day. + */ + public function isEndOfDay(Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of decade (last day by default but interval can be customized). + */ + public function isEndOfDecade(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of hour (last microsecond by default but interval can be customized). + */ + public function isEndOfHour(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of millennium (last day by default but interval can be customized). + */ + public function isEndOfMillennium(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of millisecond (last microsecond by default but interval can be customized). + */ + public function isEndOfMillisecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of minute (last microsecond by default but interval can be customized). + */ + public function isEndOfMinute(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of month (last day by default but interval can be customized). + */ + public function isEndOfMonth(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of quarter (last day by default but interval can be customized). + */ + public function isEndOfQuarter(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is end of second (last microsecond by default but interval can be customized). + */ + public function isEndOfSecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Returns true if the date was created using CarbonImmutable::endOfTime() + * + * @return bool + */ + public function isEndOfTime(): bool; + + /** + * Check if the instance is end of a given unit (tolerating a given interval). + * + * @example + * ``` + * // Check if a date-time is the last 15 minutes of the hour it's in + * Carbon::parse('2019-02-28 20:13:00')->isEndOfUnit(Unit::Hour, '15 minutes'); // false + * ``` + */ + public function isEndOfUnit(Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params): bool; + + /** + * Determines if the instance is end of week (last day by default but interval can be customized). + * + * @example + * ``` + * Carbon::parse('2024-08-31')->endOfWeek()->isEndOfWeek(); // true + * Carbon::parse('2024-08-31')->isEndOfWeek(); // false + * ``` + */ + public function isEndOfWeek(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekEndsAt = null): bool; + + /** + * Determines if the instance is end of year (last day by default but interval can be customized). + */ + public function isEndOfYear(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is in the future, ie. greater (after) than now. + * + * @example + * ``` + * Carbon::now()->addHours(5)->isFuture(); // true + * Carbon::now()->subHours(5)->isFuture(); // false + * ``` + */ + public function isFuture(): bool; + + /** + * Returns true if the current class/instance is immutable. + */ + public static function isImmutable(): bool; + + /** + * Check if today is the last day of the Month + * + * @example + * ``` + * Carbon::parse('2019-02-28')->isLastOfMonth(); // true + * Carbon::parse('2019-03-28')->isLastOfMonth(); // false + * Carbon::parse('2019-03-30')->isLastOfMonth(); // false + * Carbon::parse('2019-03-31')->isLastOfMonth(); // true + * Carbon::parse('2019-04-30')->isLastOfMonth(); // true + * ``` + */ + public function isLastOfMonth(): bool; + + /** + * Determines if the instance is a leap year. + * + * @example + * ``` + * Carbon::parse('2020-01-01')->isLeapYear(); // true + * Carbon::parse('2019-01-01')->isLeapYear(); // false + * ``` + */ + public function isLeapYear(): bool; + + /** + * Determines if the instance is a long year (using ISO 8601 year). + * + * @example + * ``` + * Carbon::parse('2015-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-03')->isLongIsoYear(); // false + * Carbon::parse('2019-12-29')->isLongIsoYear(); // false + * Carbon::parse('2019-12-30')->isLongIsoYear(); // true + * ``` + * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + */ + public function isLongIsoYear(): bool; + + /** + * Determines if the instance is a long year (using calendar year). + * + * ⚠️ This method completely ignores month and day to use the numeric year number, + * it's not correct if the exact date matters. For instance as `2019-12-30` is already + * in the first week of the 2020 year, if you want to know from this date if ISO week + * year 2020 is a long year, use `isLongIsoYear` instead. + * + * @example + * ``` + * Carbon::create(2015)->isLongYear(); // true + * Carbon::create(2016)->isLongYear(); // false + * ``` + * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + */ + public function isLongYear(): bool; + + /** + * Check if the instance is midday. + * + * @example + * ``` + * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false + * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true + * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true + * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false + * ``` + */ + public function isMidday(): bool; + + /** + * Check if the instance is start of day / midnight. + * + * @example + * ``` + * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true + * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true + * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false + * ``` + */ + public function isMidnight(): bool; + + /** + * Returns true if a property can be changed via setter. + * + * @param string $unit + * + * @return bool + */ + public static function isModifiableUnit($unit): bool; + + /** + * Returns true if the current class/instance is mutable. + */ + public static function isMutable(): bool; + + /** + * Determines if the instance is now or in the future, ie. greater (after) than or equal to now. + * + * @example + * ``` + * Carbon::now()->isNowOrFuture(); // true + * Carbon::now()->addHours(5)->isNowOrFuture(); // true + * Carbon::now()->subHours(5)->isNowOrFuture(); // false + * ``` + */ + public function isNowOrFuture(): bool; + + /** + * Determines if the instance is now or in the past, ie. less (before) than or equal to now. + * + * @example + * ``` + * Carbon::now()->isNowOrPast(); // true + * Carbon::now()->subHours(5)->isNowOrPast(); // true + * Carbon::now()->addHours(5)->isNowOrPast(); // false + * ``` + */ + public function isNowOrPast(): bool; + + /** + * Determines if the instance is in the past, ie. less (before) than now. + * + * @example + * ``` + * Carbon::now()->subHours(5)->isPast(); // true + * Carbon::now()->addHours(5)->isPast(); // false + * ``` + */ + public function isPast(): bool; + + /** + * Compares the formatted values of the two dates. + * + * @example + * ``` + * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true + * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false + * ``` + * + * @param string $format date formats to compare. + * @param DateTimeInterface|string $date instance to compare with or null to use current day. + */ + public function isSameAs(string $format, DateTimeInterface|string $date): bool; + + /** + * Checks if the passed in date is in the same month as the instance´s month. + * + * @example + * ``` + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true + * ``` + * + * @param DateTimeInterface|string $date The instance to compare with or null to use the current date. + * @param bool $ofSameYear Check if it is the same month in the same year. + * + * @return bool + */ + public function isSameMonth(DateTimeInterface|string $date, bool $ofSameYear = true): bool; + + /** + * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). + * + * @example + * ``` + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true + * ``` + * + * @param DateTimeInterface|string $date The instance to compare with or null to use current day. + * @param bool $ofSameYear Check if it is the same month in the same year. + * + * @return bool + */ + public function isSameQuarter(DateTimeInterface|string $date, bool $ofSameYear = true): bool; + + /** + * Determines if the instance is in the current unit given. + * + * @example + * ``` + * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true + * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false + * ``` + * + * @param string $unit singular unit string + * @param DateTimeInterface|string $date instance to compare with or null to use current day. + * + * @throws BadComparisonUnitException + * + * @return bool + */ + public function isSameUnit(string $unit, DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is start of century (first day by default but interval can be customized). + */ + public function isStartOfCentury(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Check if the instance is start of day / midnight. + * + * @example + * ``` + * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true + * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true + * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false + * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true + * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false + * ``` + * + * @param bool $checkMicroseconds check time at microseconds precision + * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision + * for instance with "15 minutes", it checks if current date-time + * is in the last 15 minutes of the day, with Unit::Hour, it + * checks if it's in the last hour of the day. + */ + public function isStartOfDay(Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of decade (first day by default but interval can be customized). + */ + public function isStartOfDecade(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of hour (first microsecond by default but interval can be customized). + */ + public function isStartOfHour(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of millennium (first day by default but interval can be customized). + */ + public function isStartOfMillennium(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of millisecond (first microsecond by default but interval can be customized). + */ + public function isStartOfMillisecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of minute (first microsecond by default but interval can be customized). + */ + public function isStartOfMinute(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of month (first day by default but interval can be customized). + */ + public function isStartOfMonth(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of quarter (first day by default but interval can be customized). + */ + public function isStartOfQuarter(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Determines if the instance is start of second (first microsecond by default but interval can be customized). + */ + public function isStartOfSecond(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Returns true if the date was created using CarbonImmutable::startOfTime() + * + * @return bool + */ + public function isStartOfTime(): bool; + + /** + * Check if the instance is start of a given unit (tolerating a given interval). + * + * @example + * ``` + * // Check if a date-time is the first 15 minutes of the hour it's in + * Carbon::parse('2019-02-28 20:13:00')->isStartOfUnit(Unit::Hour, '15 minutes'); // true + * ``` + */ + public function isStartOfUnit(Unit $unit, Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, mixed ...$params): bool; + + /** + * Determines if the instance is start of week (first day by default but interval can be customized). + * + * @example + * ``` + * Carbon::parse('2024-08-31')->startOfWeek()->isStartOfWeek(); // true + * Carbon::parse('2024-08-31')->isStartOfWeek(); // false + * ``` + */ + public function isStartOfWeek(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, WeekDay|int|null $weekStartsAt = null): bool; + + /** + * Determines if the instance is start of year (first day by default but interval can be customized). + */ + public function isStartOfYear(Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null): bool; + + /** + * Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * + * @return bool + */ + public static function isStrictModeEnabled(): bool; + + /** + * Determines if the instance is today. + * + * @example + * ``` + * Carbon::today()->isToday(); // true + * Carbon::tomorrow()->isToday(); // false + * ``` + */ + public function isToday(): bool; + + /** + * Determines if the instance is tomorrow. + * + * @example + * ``` + * Carbon::tomorrow()->isTomorrow(); // true + * Carbon::yesterday()->isTomorrow(); // false + * ``` + */ + public function isTomorrow(): bool; + + /** + * Determines if the instance is a weekday. + * + * @example + * ``` + * Carbon::parse('2019-07-14')->isWeekday(); // false + * Carbon::parse('2019-07-15')->isWeekday(); // true + * ``` + */ + public function isWeekday(): bool; + + /** + * Determines if the instance is a weekend day. + * + * @example + * ``` + * Carbon::parse('2019-07-14')->isWeekend(); // true + * Carbon::parse('2019-07-15')->isWeekend(); // false + * ``` + */ + public function isWeekend(): bool; + + /** + * Determines if the instance is yesterday. + * + * @example + * ``` + * Carbon::yesterday()->isYesterday(); // true + * Carbon::tomorrow()->isYesterday(); // false + * ``` + */ + public function isYesterday(): bool; + + /** + * Format in the current language using ISO replacement patterns. + * + * @param string|null $originalFormat provide context if a chunk has been passed alone + */ + public function isoFormat(string $format, ?string $originalFormat = null): string; + + /** + * Get/set the week number using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $week + * @param int|null $dayOfWeek + * @param int|null $dayOfYear + * + * @return int|static + */ + public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null); + + /** + * Set/get the week number of year using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int|static + */ + public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null); + + /** + * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). + * + * @param WeekDay|int|null $value new value for weekday if using as setter. + */ + public function isoWeekday(WeekDay|int|null $value = null): static|int; + + /** + * Get the number of weeks of the current week-year using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int + */ + public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null); + + /** + * Prepare the object for JSON serialization. + */ + public function jsonSerialize(): mixed; + + /** + * Modify to the last occurrence of a given day of the week + * in the current month. If no dayOfWeek is provided, modify to the + * last day of the current month. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek + * + * @return static + */ + public function lastOfMonth($dayOfWeek = null); + + /** + * Modify to the last occurrence of a given day of the week + * in the current quarter. If no dayOfWeek is provided, modify to the + * last day of the current quarter. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function lastOfQuarter($dayOfWeek = null); + + /** + * Modify to the last occurrence of a given day of the week + * in the current year. If no dayOfWeek is provided, modify to the + * last day of the current year. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function lastOfYear($dayOfWeek = null); + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true + * ``` + */ + public function lessThan(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is less (before) or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true + * ``` + */ + public function lessThanOrEqualTo(DateTimeInterface|string $date): bool; + + /** + * Get/set the locale for the current instance. + * + * @param string|null $locale + * @param string ...$fallbackLocales + * + * @return $this|string + */ + public function locale(?string $locale = null, string ...$fallbackLocales): static|string; + + /** + * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffOneDayWords(string $locale): bool; + + /** + * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffSyntax(string $locale): bool; + + /** + * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffTwoDayWords(string $locale): bool; + + /** + * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasPeriodSyntax($locale); + + /** + * Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasShortUnits(string $locale): bool; + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThan() + */ + public function lt(DateTimeInterface|string $date): bool; + + /** + * Determines if the instance is less (before) or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThanOrEqualTo() + */ + public function lte(DateTimeInterface|string $date): bool; + + /** + * Register a custom macro. + * + * Pass null macro to remove it. + * + * @example + * ``` + * $userSettings = [ + * 'locale' => 'pt', + * 'timezone' => 'America/Sao_Paulo', + * ]; + * Carbon::macro('userFormat', function () use ($userSettings) { + * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); + * }); + * echo Carbon::yesterday()->hours(11)->userFormat(); + * ``` + * + * @param-closure-this static $macro + */ + public static function macro(string $name, ?callable $macro): void; + + /** + * Make a Carbon instance from given variable if possible. + * + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * + * @param mixed $var + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function make($var, DateTimeZone|string|null $timezone = null); + + /** + * Get the maximum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @return static + */ + public function max($date = null); + + /** + * Get the maximum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @see max() + * + * @return static + */ + public function maximum($date = null); + + /** + * Return the meridiem of the current time in the current locale. + * + * @param bool $isLower if true, returns lowercase variant if available in the current locale. + */ + public function meridiem(bool $isLower = false): string; + + /** + * Modify to midday, default to self::$midDayAt + * + * @return static + */ + public function midDay(); + + /** + * Get the minimum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @return static + */ + public function min($date = null); + + /** + * Get the minimum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @see min() + * + * @return static + */ + public function minimum($date = null); + + /** + * Mix another object into the class. + * + * @example + * ``` + * Carbon::mixin(new class { + * public function addMoon() { + * return function () { + * return $this->addDays(30); + * }; + * } + * public function subMoon() { + * return function () { + * return $this->subDays(30); + * }; + * } + * }); + * $fullMoon = Carbon::create('2018-12-22'); + * $nextFullMoon = $fullMoon->addMoon(); + * $blackMoon = Carbon::create('2019-01-06'); + * $previousBlackMoon = $blackMoon->subMoon(); + * echo "$nextFullMoon\n"; + * echo "$previousBlackMoon\n"; + * ``` + * + * @throws ReflectionException + */ + public static function mixin(object|string $mixin): void; + + /** + * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. + * + * @see https://php.net/manual/en/datetime.modify.php + * + * @return static + */ + #[ReturnTypeWillChange] + public function modify($modify); + + /** + * Determines if the instance is not equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false + * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true + * ``` + * + * @see notEqualTo() + */ + public function ne(DateTimeInterface|string $date): bool; + + /** + * Modify to the next occurrence of a given modifier such as a day of + * the week. If no modifier is provided, modify to the next occurrence + * of the current day of the week. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param string|int|null $modifier + * + * @return static + */ + public function next($modifier = null); + + /** + * Go forward to the next weekday. + * + * @return static + */ + public function nextWeekday(); + + /** + * Go forward to the next weekend day. + * + * @return static + */ + public function nextWeekendDay(); + + /** + * Determines if the instance is not equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true + * ``` + */ + public function notEqualTo(DateTimeInterface|string $date): bool; + + /** + * Get a Carbon instance for the current date and time. + */ + public static function now(DateTimeZone|string|int|null $timezone = null): static; + + /** + * Returns a present instance in the same timezone. + * + * @return static + */ + public function nowWithSameTz(): static; + + /** + * Modify to the given occurrence of a given day of the week + * in the current month. If the calculated occurrence is outside the scope + * of the current month, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfMonth($nth, $dayOfWeek); + + /** + * Modify to the given occurrence of a given day of the week + * in the current quarter. If the calculated occurrence is outside the scope + * of the current quarter, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfQuarter($nth, $dayOfWeek); + + /** + * Modify to the given occurrence of a given day of the week + * in the current year. If the calculated occurrence is outside the scope + * of the current year, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfYear($nth, $dayOfWeek); + + /** + * Return a property with its ordinal. + */ + public function ordinal(string $key, ?string $period = null): string; + + /** + * Create a carbon instance from a string. + * + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * + * @throws InvalidFormatException + */ + public static function parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * + * @param string $time date/time string in the given language (may also contain English). + * @param string|null $locale if locale is null or not specified, current global locale will be + * used instead. + * @param DateTimeZone|string|int|null $timezone optional timezone for the new instance. + * + * @throws InvalidFormatException + */ + public static function parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Returns standardized plural of a given singular/plural unit name (in English). + */ + public static function pluralUnit(string $unit): string; + + /** + * Modify to the previous occurrence of a given modifier such as a day of + * the week. If no dayOfWeek is provided, modify to the previous occurrence + * of the current day of the week. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param string|int|null $modifier + * + * @return static + */ + public function previous($modifier = null); + + /** + * Go backward to the previous weekday. + * + * @return static + */ + public function previousWeekday(); + + /** + * Go backward to the previous weekend day. + * + * @return static + */ + public function previousWeekendDay(); + + /** + * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). + * + * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date + * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit + * @param string|null $unit if specified, $interval must be an integer + */ + public function range($end = null, $interval = null, $unit = null): CarbonPeriod; + + /** + * Call native PHP DateTime/DateTimeImmutable add() method. + * + * @param DateInterval $interval + * + * @return static + */ + public function rawAdd(DateInterval $interval): static; + + /** + * Create a Carbon instance from a specific format. + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function rawCreateFromFormat(string $format, string $time, $timezone = null); + + /** + * @see https://php.net/manual/en/datetime.format.php + */ + public function rawFormat(string $format): string; + + /** + * Create a carbon instance from a string. + * + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * + * @throws InvalidFormatException + */ + public static function rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null): static; + + /** + * Call native PHP DateTime/DateTimeImmutable sub() method. + */ + public function rawSub(DateInterval $interval): static; + + /** + * Remove all macros and generic macros. + */ + public static function resetMacros(): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Reset the month overflow behavior. + * + * @return void + */ + public static function resetMonthsOverflow(): void; + + /** + * Reset the format used to the default when type juggling a Carbon instance to a string + * + * @return void + */ + public static function resetToStringFormat(): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Reset the month overflow behavior. + * + * @return void + */ + public static function resetYearsOverflow(): void; + + /** + * Round the current instance second with given precision if specified. + */ + public function round(DateInterval|string|int|float $precision = 1, callable|string $function = 'round'): static; + + /** + * Round the current instance at the given unit with given precision if specified and the given function. + */ + public function roundUnit(string $unit, DateInterval|string|int|float $precision = 1, callable|string $function = 'round'): static; + + /** + * Round the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function roundWeek(WeekDay|int|null $weekStartsAt = null): static; + + /** + * The number of seconds since midnight. + * + * @return float + */ + public function secondsSinceMidnight(): float; + + /** + * The number of seconds until 23:59:59. + * + * @return float + */ + public function secondsUntilEndOfDay(): float; + + /** + * Return a serialized string of the instance. + */ + public function serialize(): string; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * + * JSON serialize all Carbon instances using the given callback. + */ + public static function serializeUsing(callable|string|null $format): void; + + /** + * Set a part of the Carbon object. + * + * @throws ImmutableException|UnknownSetterException + * + * @return $this + */ + public function set(Unit|array|string $name, DateTimeZone|Month|string|int|float|null $value = null): static; + + /** + * Set the date with gregorian year, month and day numbers. + * + * @see https://php.net/manual/en/datetime.setdate.php + */ + public function setDate(int $year, int $month, int $day): static; + + /** + * Set the year, month, and date for this instance to that of the passed instance. + */ + public function setDateFrom(DateTimeInterface|string $date): static; + + /** + * Set the date and time all together. + */ + public function setDateTime(int $year, int $month, int $day, int $hour, int $minute, int $second = 0, int $microseconds = 0): static; + + /** + * Set the date and time for this instance to that of the passed instance. + */ + public function setDateTimeFrom(DateTimeInterface|string $date): static; + + /** + * Set the day (keeping the current time) to the start of the week + the number of days passed as the first + * parameter. First day of week is driven by the locale unless explicitly set with the second parameter. + * + * @param int $numberOfDays number of days to add after the start of the current week + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, + * if not provided, start of week is inferred from the locale + * (Sunday for en_US, Monday for de_DE, etc.) + */ + public function setDaysFromStartOfWeek(int $numberOfDays, WeekDay|int|null $weekStartsAt = null): static; + + /** + * Set the fallback locale. + * + * @see https://symfony.com/doc/current/components/translation.html#fallback-locales + * + * @param string $locale + */ + public static function setFallbackLocale(string $locale): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function setHumanDiffOptions(int $humanDiffOptions): void; + + /** + * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. + * + * @see https://php.net/manual/en/datetime.setisodate.php + */ + public function setISODate(int $year, int $week, int $day = 1): static; + + /** + * Set the translator for the current instance. + */ + public function setLocalTranslator(TranslatorInterface $translator); + + /** + * Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. + * + * @param string $locale locale ex. en + */ + public static function setLocale(string $locale): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * + * Set midday/noon hour + * + * @param int $hour midday hour + * + * @return void + */ + public static function setMidDayAt($hour); + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNow(mixed $testNow = null): void; + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $timezone = null): void; + + /** + * Resets the current time of the DateTime object to a different time. + * + * @see https://php.net/manual/en/datetime.settime.php + */ + public function setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0): static; + + /** + * Set the hour, minute, second and microseconds for this instance to that of the passed instance. + */ + public function setTimeFrom(DateTimeInterface|string $date): static; + + /** + * Set the time by time string. + */ + public function setTimeFromTimeString(string $time): static; + + /** + * Set the instance's timestamp. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public function setTimestamp(string|int|float $timestamp): static; + + /** + * Set the instance's timezone from a string or object. + */ + public function setTimezone(DateTimeZone|string|int $timeZone): static; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump another string + * format. + * + * Set the default format used when type juggling a Carbon instance to a string. + * + * @param string|Closure|null $format + * + * @return void + */ + public static function setToStringFormat(Closure|string|null $format): void; + + /** + * Set the default translator instance to use. + * + * @param TranslatorInterface $translator + * + * @return void + */ + public static function setTranslator(TranslatorInterface $translator): void; + + /** + * Set specified unit to new given value. + * + * @param string $unit year, month, day, hour, minute, second or microsecond + * @param Month|int $value new value for given unit + */ + public function setUnit(string $unit, Month|int|float|null $value = null): static; + + /** + * Set any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value new value for the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * + * Set weekend days + */ + public static function setWeekendDays(array $days): void; + + /** + * Set specific options. + * - strictMode: true|false|null + * - monthOverflow: true|false|null + * - yearOverflow: true|false|null + * - humanDiffOptions: int|null + * - toStringFormat: string|Closure|null + * - toJsonFormat: string|Closure|null + * - locale: string|null + * - timezone: \DateTimeZone|string|int|null + * - macros: array|null + * - genericMacros: array|null + * + * @param array $settings + * + * @return $this|static + */ + public function settings(array $settings): static; + + /** + * Set the instance's timezone from a string or object and add/subtract the offset difference. + */ + public function shiftTimezone(DateTimeZone|string $value): static; + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + * + * @return bool + */ + public static function shouldOverflowMonths(): bool; + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + * + * @return bool + */ + public static function shouldOverflowYears(): bool; + + /** + * @alias diffForHumans + * + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + */ + public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Returns standardized singular of a given singular/plural unit name (in English). + */ + public static function singularUnit(string $unit): string; + + public static function sleep(int|float $seconds): void; + + /** + * Modify to start of current given unit. + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOf(Unit::Month) + * ->endOf(Unit::Week, Carbon::FRIDAY); + * ``` + */ + public function startOf(Unit|string $unit, mixed ...$params): static; + + /** + * Resets the date to the first day of the century and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); + * ``` + * + * @return static + */ + public function startOfCentury(); + + /** + * Resets the time to 00:00:00 start of day + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); + * ``` + * + * @return static + */ + public function startOfDay(); + + /** + * Resets the date to the first day of the decade and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); + * ``` + * + * @return static + */ + public function startOfDecade(); + + /** + * Modify to start of current hour, minutes and seconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); + * ``` + */ + public function startOfHour(): static; + + /** + * Resets the date to the first day of the millennium and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); + * ``` + * + * @return static + */ + public function startOfMillennium(); + + /** + * Modify to start of current millisecond, microseconds such as 12345 become 123000 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function startOfMillisecond(): static; + + /** + * Modify to start of current minute, seconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); + * ``` + */ + public function startOfMinute(): static; + + /** + * Resets the date to the first day of the month and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); + * ``` + * + * @return static + */ + public function startOfMonth(); + + /** + * Resets the date to the first day of the quarter and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); + * ``` + * + * @return static + */ + public function startOfQuarter(); + + /** + * Modify to start of current second, microseconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function startOfSecond(): static; + + /** + * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; + * ``` + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + * + * @return static + */ + public function startOfWeek(WeekDay|int|null $weekStartsAt = null): static; + + /** + * Resets the date to the first day of the year and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); + * ``` + * + * @return static + */ + public function startOfYear(); + + /** + * Subtract given units or interval to the current instance. + * + * @example $date->sub('hour', 3) + * @example $date->sub(15, 'days') + * @example $date->sub(CarbonInterval::days(4)) + * + * @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + #[ReturnTypeWillChange] + public function sub($unit, $value = 1, ?bool $overflow = null): static; + + /** + * @deprecated Prefer to use add subUTCUnit() which more accurately defines what it's doing. + * + * Subtract seconds to the instance using timestamp. Positive $value travels + * into the past while negative $value travels forward. + * + * @param string $unit + * @param int $value + * + * @return static + */ + public function subRealUnit($unit, $value = 1): static; + + /** + * Subtract seconds to the instance using timestamp. Positive $value travels + * into the past while negative $value travels forward. + * + * @param string $unit + * @param int $value + * + * @return static + */ + public function subUTCUnit($unit, $value = 1): static; + + /** + * Subtract given units to the current instance. + */ + public function subUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static; + + /** + * Subtract any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value amount to subtract to the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static; + + /** + * Subtract given units or interval to the current instance. + * + * @see sub() + * + * @param string|DateInterval $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + public function subtract($unit, $value = 1, ?bool $overflow = null): static; + + /** + * Get the difference in a human-readable format in the current locale from current instance to another + * instance given (or now if null given). + * + * @return string + */ + public function timespan($other = null, $timezone = null): string; + + /** + * Set the instance's timestamp. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public function timestamp(string|int|float $timestamp): static; + + /** + * @alias setTimezone + */ + public function timezone(DateTimeZone|string|int $value): static; + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given (or now if null given) to current instance. + * + * When comparing a value in the past to default now: + * 1 hour from now + * 5 months from now + * + * When comparing a value in the future to default now: + * 1 hour ago + * 5 months ago + * + * When comparing a value in the past to another value: + * 1 hour after + * 5 months after + * + * When comparing a value in the future to another value: + * 1 hour before + * 5 months before + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Get default array representation. + * + * @example + * ``` + * var_dump(Carbon::now()->toArray()); + * ``` + */ + public function toArray(): array; + + /** + * Format the instance as ATOM + * + * @example + * ``` + * echo Carbon::now()->toAtomString(); + * ``` + */ + public function toAtomString(): string; + + /** + * Format the instance as COOKIE + * + * @example + * ``` + * echo Carbon::now()->toCookieString(); + * ``` + */ + public function toCookieString(): string; + + /** + * @alias toDateTime + * + * Return native DateTime PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDate()); + * ``` + */ + public function toDate(): DateTime; + + /** + * Format the instance as date + * + * @example + * ``` + * echo Carbon::now()->toDateString(); + * ``` + */ + public function toDateString(): string; + + /** + * Return native DateTime PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDateTime()); + * ``` + */ + public function toDateTime(): DateTime; + + /** + * Return native toDateTimeImmutable PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDateTimeImmutable()); + * ``` + */ + public function toDateTimeImmutable(): DateTimeImmutable; + + /** + * Format the instance as date and time T-separated with no timezone + * + * @example + * ``` + * echo Carbon::now()->toDateTimeLocalString(); + * echo "\n"; + * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond + * ``` + */ + public function toDateTimeLocalString(string $unitPrecision = 'second'): string; + + /** + * Format the instance as date and time + * + * @example + * ``` + * echo Carbon::now()->toDateTimeString(); + * ``` + */ + public function toDateTimeString(string $unitPrecision = 'second'): string; + + /** + * Format the instance with day, date and time + * + * @example + * ``` + * echo Carbon::now()->toDayDateTimeString(); + * ``` + */ + public function toDayDateTimeString(): string; + + /** + * Format the instance as a readable date + * + * @example + * ``` + * echo Carbon::now()->toFormattedDateString(); + * ``` + */ + public function toFormattedDateString(): string; + + /** + * Format the instance with the day, and a readable date + * + * @example + * ``` + * echo Carbon::now()->toFormattedDayDateString(); + * ``` + */ + public function toFormattedDayDateString(): string; + + /** + * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: + * 1977-04-22T01:00:00-05:00). + * + * @example + * ``` + * echo Carbon::now('America/Toronto')->toISOString() . "\n"; + * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; + * ``` + * + * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. + */ + public function toISOString(bool $keepOffset = false): ?string; + + /** + * Return a immutable copy of the instance. + * + * @return CarbonImmutable + */ + public function toImmutable(); + + /** + * Format the instance as ISO8601 + * + * @example + * ``` + * echo Carbon::now()->toIso8601String(); + * ``` + */ + public function toIso8601String(): string; + + /** + * Convert the instance to UTC and return as Zulu ISO8601 + * + * @example + * ``` + * echo Carbon::now()->toIso8601ZuluString(); + * ``` + */ + public function toIso8601ZuluString(string $unitPrecision = 'second'): string; + + /** + * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. + * + * @example + * ``` + * echo Carbon::now('America/Toronto')->toJSON(); + * ``` + */ + public function toJSON(): ?string; + + /** + * Return a mutable copy of the instance. + * + * @return Carbon + */ + public function toMutable(); + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given to now + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single part) + * @param int $options human diff options + * + * @return string + */ + public function toNow($syntax = null, $short = false, $parts = 1, $options = null); + + /** + * Get default object representation. + * + * @example + * ``` + * var_dump(Carbon::now()->toObject()); + * ``` + */ + public function toObject(): object; + + /** + * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). + * + * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int + * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit + * @param string|null $unit if specified, $interval must be an integer + */ + public function toPeriod($end = null, $interval = null, $unit = null): CarbonPeriod; + + /** + * Format the instance as RFC1036 + * + * @example + * ``` + * echo Carbon::now()->toRfc1036String(); + * ``` + */ + public function toRfc1036String(): string; + + /** + * Format the instance as RFC1123 + * + * @example + * ``` + * echo Carbon::now()->toRfc1123String(); + * ``` + */ + public function toRfc1123String(): string; + + /** + * Format the instance as RFC2822 + * + * @example + * ``` + * echo Carbon::now()->toRfc2822String(); + * ``` + */ + public function toRfc2822String(): string; + + /** + * Format the instance as RFC3339. + * + * @example + * ``` + * echo Carbon::now()->toRfc3339String() . "\n"; + * echo Carbon::now()->toRfc3339String(true) . "\n"; + * ``` + */ + public function toRfc3339String(bool $extended = false): string; + + /** + * Format the instance as RFC7231 + * + * @example + * ``` + * echo Carbon::now()->toRfc7231String(); + * ``` + */ + public function toRfc7231String(): string; + + /** + * Format the instance as RFC822 + * + * @example + * ``` + * echo Carbon::now()->toRfc822String(); + * ``` + */ + public function toRfc822String(): string; + + /** + * Format the instance as RFC850 + * + * @example + * ``` + * echo Carbon::now()->toRfc850String(); + * ``` + */ + public function toRfc850String(): string; + + /** + * Format the instance as RSS + * + * @example + * ``` + * echo Carbon::now()->toRssString(); + * ``` + */ + public function toRssString(): string; + + /** + * Returns english human-readable complete date string. + * + * @example + * ``` + * echo Carbon::now()->toString(); + * ``` + */ + public function toString(): string; + + /** + * Format the instance as time + * + * @example + * ``` + * echo Carbon::now()->toTimeString(); + * ``` + */ + public function toTimeString(string $unitPrecision = 'second'): string; + + /** + * Format the instance as W3C + * + * @example + * ``` + * echo Carbon::now()->toW3cString(); + * ``` + */ + public function toW3cString(): string; + + /** + * Create a Carbon instance for today. + */ + public static function today(DateTimeZone|string|int|null $timezone = null): static; + + /** + * Create a Carbon instance for tomorrow. + */ + public static function tomorrow(DateTimeZone|string|int|null $timezone = null): static; + + /** + * Translate using translation string or callback available. + * + * @param string $key key to find + * @param array $parameters replacement parameters + * @param string|int|float|null $number number if plural + * @param TranslatorInterface|null $translator an optional translator to use + * @param bool $altNumbers pass true to use alternative numbers + * + * @return string + */ + public function translate(string $key, array $parameters = [], string|int|float|null $number = null, ?TranslatorInterface $translator = null, bool $altNumbers = false): string; + + /** + * Returns the alternative number for a given integer if available in the current locale. + * + * @param int $number + * + * @return string + */ + public function translateNumber(int $number): string; + + /** + * Translate a time string from a locale to an other. + * + * @param string $timeString date/time/duration string to translate (may also contain English) + * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) + * @param string|null $to output locale of the result returned (`"en"` by default) + * @param int $mode specify what to translate with options: + * - self::TRANSLATE_ALL (default) + * - CarbonInterface::TRANSLATE_MONTHS + * - CarbonInterface::TRANSLATE_DAYS + * - CarbonInterface::TRANSLATE_UNITS + * - CarbonInterface::TRANSLATE_MERIDIEM + * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS + * + * @return string + */ + public static function translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = self::TRANSLATE_ALL): string; + + /** + * Translate a time string from the current locale (`$date->locale()`) to an other. + * + * @param string $timeString time string to translate + * @param string|null $to output locale of the result returned ("en" by default) + * + * @return string + */ + public function translateTimeStringTo(string $timeString, ?string $to = null): string; + + /** + * Translate using translation string or callback available. + * + * @param TranslatorInterface $translator an optional translator to use + * @param string $key key to find + * @param array $parameters replacement parameters + * @param int|float|null $number number if plural + * + * @return string + */ + public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string; + + /** + * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) + * but translate words whenever possible (months, day names, etc.) using the current locale. + */ + public function translatedFormat(string $format): string; + + /** + * Set the timezone or returns the timezone name if no arguments passed. + */ + public function tz(DateTimeZone|string|int|null $value = null): static|string; + + /** + * @alias getTimestamp + * + * Returns the UNIX timestamp for the current date. + * + * @return int + */ + public function unix(): int; + + /** + * @alias to + * + * Get the difference in a human readable format in the current locale from an other + * instance given (or now if null given) to current instance. + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null); + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Indicates if months should be calculated with overflow. + * + * @param bool $monthsOverflow + * + * @return void + */ + public static function useMonthsOverflow(bool $monthsOverflow = true): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + * + * Enable the strict mode (or disable with passing false). + * + * @param bool $strictModeEnabled + */ + public static function useStrictMode(bool $strictModeEnabled = true): void; + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Indicates if years should be calculated with overflow. + * + * @param bool $yearsOverflow + * + * @return void + */ + public static function useYearsOverflow(bool $yearsOverflow = true): void; + + /** + * Set the instance's timezone to UTC. + */ + public function utc(): static; + + /** + * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. + */ + public function utcOffset(?int $minuteOffset = null): static|int; + + /** + * Returns the milliseconds timestamps used amongst other by Date javascript objects. + * + * @return float + */ + public function valueOf(): float; + + /** + * Get/set the week number using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $week + * @param int|null $dayOfWeek + * @param int|null $dayOfYear + * + * @return int|static + */ + public function week($week = null, $dayOfWeek = null, $dayOfYear = null); + + /** + * Set/get the week number of year using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int|static + */ + public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null); + + /** + * Get/set the weekday from 0 (Sunday) to 6 (Saturday). + * + * @param WeekDay|int|null $value new value for weekday if using as setter. + */ + public function weekday(WeekDay|int|null $value = null): static|int; + + /** + * Get the number of weeks of the current week-year using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int + */ + public function weeksInYear($dayOfWeek = null, $dayOfYear = null); + + /** + * Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * + * /!\ Use this method for unit tests only. + * + * @template T + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure(): T $callback + * + * @return T + */ + public static function withTestNow(mixed $testNow, callable $callback): mixed; + + /** + * Create a Carbon instance for yesterday. + */ + public static function yesterday(DateTimeZone|string|int|null $timezone = null): static; + + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php new file mode 100644 index 00000000..a582ddb1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonInterval.php @@ -0,0 +1,3572 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\BadFluentConstructorException; +use Carbon\Exceptions\BadFluentSetterException; +use Carbon\Exceptions\InvalidCastException; +use Carbon\Exceptions\InvalidFormatException; +use Carbon\Exceptions\InvalidIntervalException; +use Carbon\Exceptions\OutOfRangeException; +use Carbon\Exceptions\ParseErrorException; +use Carbon\Exceptions\UnitNotConfiguredException; +use Carbon\Exceptions\UnknownGetterException; +use Carbon\Exceptions\UnknownSetterException; +use Carbon\Exceptions\UnknownUnitException; +use Carbon\Traits\IntervalRounding; +use Carbon\Traits\IntervalStep; +use Carbon\Traits\LocalFactory; +use Carbon\Traits\MagicParameter; +use Carbon\Traits\Mixin; +use Carbon\Traits\Options; +use Carbon\Traits\ToStringFormat; +use Closure; +use DateInterval; +use DateTime; +use DateTimeInterface; +use DateTimeZone; +use Exception; +use InvalidArgumentException; +use ReflectionException; +use ReturnTypeWillChange; +use RuntimeException; +use Symfony\Contracts\Translation\TranslatorInterface; +use Throwable; + +/** + * A simple API extension for DateInterval. + * The implementation provides helpers to handle weeks but only days are saved. + * Weeks are calculated based on the total days of the current instance. + * + * @property int $years Year component of the current interval. (For P2Y6M, the value will be 2) + * @property int $months Month component of the current interval. (For P1Y6M10D, the value will be 6) + * @property int $weeks Week component of the current interval calculated from the days. (For P1Y6M17D, the value will be 2) + * @property int $dayz Day component of the current interval (weeks * 7 + days). (For P6M17DT20H, the value will be 17) + * @property int $hours Hour component of the current interval. (For P7DT20H5M, the value will be 20) + * @property int $minutes Minute component of the current interval. (For PT20H5M30S, the value will be 5) + * @property int $seconds Second component of the current interval. (CarbonInterval::minutes(2)->seconds(34)->microseconds(567_890)->seconds = 34) + * @property int $milliseconds Milliseconds component of the current interval. (CarbonInterval::seconds(34)->microseconds(567_890)->milliseconds = 567) + * @property int $microseconds Microseconds component of the current interval. (CarbonInterval::seconds(34)->microseconds(567_890)->microseconds = 567_890) + * @property int $microExcludeMilli Remaining microseconds without the milliseconds. + * @property int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7). + * @property int $daysExcludeWeeks alias of dayzExcludeWeeks + * @property-read float $totalYears Number of years equivalent to the interval. (For P1Y6M, the value will be 1.5) + * @property-read float $totalMonths Number of months equivalent to the interval. (For P1Y6M10D, the value will be ~12.357) + * @property-read float $totalWeeks Number of weeks equivalent to the interval. (For P6M17DT20H, the value will be ~26.548) + * @property-read float $totalDays Number of days equivalent to the interval. (For P17DT20H, the value will be ~17.833) + * @property-read float $totalDayz Alias for totalDays. + * @property-read float $totalHours Number of hours equivalent to the interval. (For P1DT20H5M, the value will be ~44.083) + * @property-read float $totalMinutes Number of minutes equivalent to the interval. (For PT20H5M30S, the value will be 1205.5) + * @property-read float $totalSeconds Number of seconds equivalent to the interval. (CarbonInterval::minutes(2)->seconds(34)->microseconds(567_890)->totalSeconds = 154.567_890) + * @property-read float $totalMilliseconds Number of milliseconds equivalent to the interval. (CarbonInterval::seconds(34)->microseconds(567_890)->totalMilliseconds = 34567.890) + * @property-read float $totalMicroseconds Number of microseconds equivalent to the interval. (CarbonInterval::seconds(34)->microseconds(567_890)->totalMicroseconds = 34567890) + * @property-read string $locale locale of the current instance + * + * @method static CarbonInterval years($years = 1) Create instance specifying a number of years or modify the number of years if called on an instance. + * @method static CarbonInterval year($years = 1) Alias for years() + * @method static CarbonInterval months($months = 1) Create instance specifying a number of months or modify the number of months if called on an instance. + * @method static CarbonInterval month($months = 1) Alias for months() + * @method static CarbonInterval weeks($weeks = 1) Create instance specifying a number of weeks or modify the number of weeks if called on an instance. + * @method static CarbonInterval week($weeks = 1) Alias for weeks() + * @method static CarbonInterval days($days = 1) Create instance specifying a number of days or modify the number of days if called on an instance. + * @method static CarbonInterval dayz($days = 1) Alias for days() + * @method static CarbonInterval daysExcludeWeeks($days = 1) Create instance specifying a number of days or modify the number of days (keeping the current number of weeks) if called on an instance. + * @method static CarbonInterval dayzExcludeWeeks($days = 1) Alias for daysExcludeWeeks() + * @method static CarbonInterval day($days = 1) Alias for days() + * @method static CarbonInterval hours($hours = 1) Create instance specifying a number of hours or modify the number of hours if called on an instance. + * @method static CarbonInterval hour($hours = 1) Alias for hours() + * @method static CarbonInterval minutes($minutes = 1) Create instance specifying a number of minutes or modify the number of minutes if called on an instance. + * @method static CarbonInterval minute($minutes = 1) Alias for minutes() + * @method static CarbonInterval seconds($seconds = 1) Create instance specifying a number of seconds or modify the number of seconds if called on an instance. + * @method static CarbonInterval second($seconds = 1) Alias for seconds() + * @method static CarbonInterval milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds or modify the number of milliseconds if called on an instance. + * @method static CarbonInterval millisecond($milliseconds = 1) Alias for milliseconds() + * @method static CarbonInterval microseconds($microseconds = 1) Create instance specifying a number of microseconds or modify the number of microseconds if called on an instance. + * @method static CarbonInterval microsecond($microseconds = 1) Alias for microseconds() + * @method $this addYears(int $years) Add given number of years to the current interval + * @method $this subYears(int $years) Subtract given number of years to the current interval + * @method $this addMonths(int $months) Add given number of months to the current interval + * @method $this subMonths(int $months) Subtract given number of months to the current interval + * @method $this addWeeks(int|float $weeks) Add given number of weeks to the current interval + * @method $this subWeeks(int|float $weeks) Subtract given number of weeks to the current interval + * @method $this addDays(int|float $days) Add given number of days to the current interval + * @method $this subDays(int|float $days) Subtract given number of days to the current interval + * @method $this addHours(int|float $hours) Add given number of hours to the current interval + * @method $this subHours(int|float $hours) Subtract given number of hours to the current interval + * @method $this addMinutes(int|float $minutes) Add given number of minutes to the current interval + * @method $this subMinutes(int|float $minutes) Subtract given number of minutes to the current interval + * @method $this addSeconds(int|float $seconds) Add given number of seconds to the current interval + * @method $this subSeconds(int|float $seconds) Subtract given number of seconds to the current interval + * @method $this addMilliseconds(int|float $milliseconds) Add given number of milliseconds to the current interval + * @method $this subMilliseconds(int|float $milliseconds) Subtract given number of milliseconds to the current interval + * @method $this addMicroseconds(int|float $microseconds) Add given number of microseconds to the current interval + * @method $this subMicroseconds(int|float $microseconds) Subtract given number of microseconds to the current interval + * @method $this roundYear(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this roundYears(int|float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this floorYear(int|float $precision = 1) Truncate the current instance year with given precision. + * @method $this floorYears(int|float $precision = 1) Truncate the current instance year with given precision. + * @method $this ceilYear(int|float $precision = 1) Ceil the current instance year with given precision. + * @method $this ceilYears(int|float $precision = 1) Ceil the current instance year with given precision. + * @method $this roundMonth(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this roundMonths(int|float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this floorMonth(int|float $precision = 1) Truncate the current instance month with given precision. + * @method $this floorMonths(int|float $precision = 1) Truncate the current instance month with given precision. + * @method $this ceilMonth(int|float $precision = 1) Ceil the current instance month with given precision. + * @method $this ceilMonths(int|float $precision = 1) Ceil the current instance month with given precision. + * @method $this roundWeek(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundWeeks(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorWeek(int|float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorWeeks(int|float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilWeek(int|float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilWeeks(int|float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundDay(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundDays(int|float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorDay(int|float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorDays(int|float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilDay(int|float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilDays(int|float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundHour(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this roundHours(int|float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this floorHour(int|float $precision = 1) Truncate the current instance hour with given precision. + * @method $this floorHours(int|float $precision = 1) Truncate the current instance hour with given precision. + * @method $this ceilHour(int|float $precision = 1) Ceil the current instance hour with given precision. + * @method $this ceilHours(int|float $precision = 1) Ceil the current instance hour with given precision. + * @method $this roundMinute(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this roundMinutes(int|float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this floorMinute(int|float $precision = 1) Truncate the current instance minute with given precision. + * @method $this floorMinutes(int|float $precision = 1) Truncate the current instance minute with given precision. + * @method $this ceilMinute(int|float $precision = 1) Ceil the current instance minute with given precision. + * @method $this ceilMinutes(int|float $precision = 1) Ceil the current instance minute with given precision. + * @method $this roundSecond(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this roundSeconds(int|float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this floorSecond(int|float $precision = 1) Truncate the current instance second with given precision. + * @method $this floorSeconds(int|float $precision = 1) Truncate the current instance second with given precision. + * @method $this ceilSecond(int|float $precision = 1) Ceil the current instance second with given precision. + * @method $this ceilSeconds(int|float $precision = 1) Ceil the current instance second with given precision. + * @method $this roundMillennium(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this roundMillennia(int|float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this floorMillennium(int|float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this floorMillennia(int|float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this ceilMillennium(int|float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this ceilMillennia(int|float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this roundCentury(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this roundCenturies(int|float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this floorCentury(int|float $precision = 1) Truncate the current instance century with given precision. + * @method $this floorCenturies(int|float $precision = 1) Truncate the current instance century with given precision. + * @method $this ceilCentury(int|float $precision = 1) Ceil the current instance century with given precision. + * @method $this ceilCenturies(int|float $precision = 1) Ceil the current instance century with given precision. + * @method $this roundDecade(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this roundDecades(int|float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this floorDecade(int|float $precision = 1) Truncate the current instance decade with given precision. + * @method $this floorDecades(int|float $precision = 1) Truncate the current instance decade with given precision. + * @method $this ceilDecade(int|float $precision = 1) Ceil the current instance decade with given precision. + * @method $this ceilDecades(int|float $precision = 1) Ceil the current instance decade with given precision. + * @method $this roundQuarter(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this roundQuarters(int|float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this floorQuarter(int|float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this floorQuarters(int|float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this ceilQuarter(int|float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this ceilQuarters(int|float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this roundMillisecond(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this roundMilliseconds(int|float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this floorMillisecond(int|float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this floorMilliseconds(int|float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this ceilMillisecond(int|float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this ceilMilliseconds(int|float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this roundMicrosecond(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this roundMicroseconds(int|float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this floorMicrosecond(int|float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this floorMicroseconds(int|float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this ceilMicrosecond(int|float $precision = 1) Ceil the current instance microsecond with given precision. + * @method $this ceilMicroseconds(int|float $precision = 1) Ceil the current instance microsecond with given precision. + */ +class CarbonInterval extends DateInterval implements CarbonConverterInterface +{ + use LocalFactory; + use IntervalRounding; + use IntervalStep; + use MagicParameter; + use Mixin { + Mixin::mixin as baseMixin; + } + use Options; + use ToStringFormat; + + /** + * Unlimited parts for forHumans() method. + * + * INF constant can be used instead. + */ + public const NO_LIMIT = -1; + + public const POSITIVE = 1; + public const NEGATIVE = -1; + + /** + * Interval spec period designators + */ + public const PERIOD_PREFIX = 'P'; + public const PERIOD_YEARS = 'Y'; + public const PERIOD_MONTHS = 'M'; + public const PERIOD_DAYS = 'D'; + public const PERIOD_TIME_PREFIX = 'T'; + public const PERIOD_HOURS = 'H'; + public const PERIOD_MINUTES = 'M'; + public const PERIOD_SECONDS = 'S'; + + public const SPECIAL_TRANSLATIONS = [ + 1 => [ + 'option' => CarbonInterface::ONE_DAY_WORDS, + 'future' => 'diff_tomorrow', + 'past' => 'diff_yesterday', + ], + 2 => [ + 'option' => CarbonInterface::TWO_DAY_WORDS, + 'future' => 'diff_after_tomorrow', + 'past' => 'diff_before_yesterday', + ], + ]; + + protected static ?array $cascadeFactors = null; + + protected static array $formats = [ + 'y' => 'y', + 'Y' => 'y', + 'o' => 'y', + 'm' => 'm', + 'n' => 'm', + 'W' => 'weeks', + 'd' => 'd', + 'j' => 'd', + 'z' => 'd', + 'h' => 'h', + 'g' => 'h', + 'H' => 'h', + 'G' => 'h', + 'i' => 'i', + 's' => 's', + 'u' => 'micro', + 'v' => 'milli', + ]; + + private static ?array $flipCascadeFactors = null; + + private static bool $floatSettersEnabled = false; + + /** + * The registered macros. + */ + protected static array $macros = []; + + /** + * Timezone handler for settings() method. + */ + protected DateTimeZone|string|int|null $timezoneSetting = null; + + /** + * The input used to create the interval. + */ + protected mixed $originalInput = null; + + /** + * Start date if interval was created from a difference between 2 dates. + */ + protected ?CarbonInterface $startDate = null; + + /** + * End date if interval was created from a difference between 2 dates. + */ + protected ?CarbonInterface $endDate = null; + + /** + * End date if interval was created from a difference between 2 dates. + */ + protected ?DateInterval $rawInterval = null; + + /** + * Flag if the interval was made from a diff with absolute flag on. + */ + protected bool $absolute = false; + + protected ?array $initialValues = null; + + /** + * Set the instance's timezone from a string or object. + */ + public function setTimezone(DateTimeZone|string|int $timezone): static + { + $this->timezoneSetting = $timezone; + $this->checkStartAndEnd(); + + if ($this->startDate) { + $this->startDate = $this->startDate + ->avoidMutation() + ->setTimezone($timezone); + $this->rawInterval = null; + } + + if ($this->endDate) { + $this->endDate = $this->endDate + ->avoidMutation() + ->setTimezone($timezone); + $this->rawInterval = null; + } + + return $this; + } + + /** + * Set the instance's timezone from a string or object and add/subtract the offset difference. + */ + public function shiftTimezone(DateTimeZone|string|int $timezone): static + { + $this->timezoneSetting = $timezone; + $this->checkStartAndEnd(); + + if ($this->startDate) { + $this->startDate = $this->startDate + ->avoidMutation() + ->shiftTimezone($timezone); + $this->rawInterval = null; + } + + if ($this->endDate) { + $this->endDate = $this->endDate + ->avoidMutation() + ->shiftTimezone($timezone); + $this->rawInterval = null; + } + + return $this; + } + + /** + * Mapping of units and factors for cascading. + * + * Should only be modified by changing the factors or referenced constants. + */ + public static function getCascadeFactors(): array + { + return static::$cascadeFactors ?: static::getDefaultCascadeFactors(); + } + + protected static function getDefaultCascadeFactors(): array + { + return [ + 'milliseconds' => [CarbonInterface::MICROSECONDS_PER_MILLISECOND, 'microseconds'], + 'seconds' => [CarbonInterface::MILLISECONDS_PER_SECOND, 'milliseconds'], + 'minutes' => [CarbonInterface::SECONDS_PER_MINUTE, 'seconds'], + 'hours' => [CarbonInterface::MINUTES_PER_HOUR, 'minutes'], + 'dayz' => [CarbonInterface::HOURS_PER_DAY, 'hours'], + 'weeks' => [CarbonInterface::DAYS_PER_WEEK, 'dayz'], + 'months' => [CarbonInterface::WEEKS_PER_MONTH, 'weeks'], + 'years' => [CarbonInterface::MONTHS_PER_YEAR, 'months'], + ]; + } + + /** + * Set default cascading factors for ->cascade() method. + * + * @param array $cascadeFactors + */ + public static function setCascadeFactors(array $cascadeFactors) + { + self::$flipCascadeFactors = null; + static::$cascadeFactors = $cascadeFactors; + } + + /** + * This option allow you to opt-in for the Carbon 3 behavior where float + * values will no longer be cast to integer (so truncated). + * + * ⚠️ This settings will be applied globally, which mean your whole application + * code including the third-party dependencies that also may use Carbon will + * adopt the new behavior. + */ + public static function enableFloatSetters(bool $floatSettersEnabled = true): void + { + self::$floatSettersEnabled = $floatSettersEnabled; + } + + /////////////////////////////////////////////////////////////////// + //////////////////////////// CONSTRUCTORS ///////////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Create a new CarbonInterval instance. + * + * @param Closure|DateInterval|string|int|null $years + * @param int|float|null $months + * @param int|float|null $weeks + * @param int|float|null $days + * @param int|float|null $hours + * @param int|float|null $minutes + * @param int|float|null $seconds + * @param int|float|null $microseconds + * + * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. + */ + public function __construct($years = null, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) + { + $this->originalInput = \func_num_args() === 1 ? $years : \func_get_args(); + + if ($years instanceof Closure) { + $this->step = $years; + $years = null; + } + + if ($years instanceof DateInterval) { + parent::__construct(static::getDateIntervalSpec($years)); + $this->f = $years->f; + self::copyNegativeUnits($years, $this); + + return; + } + + $spec = $years; + $isStringSpec = (\is_string($spec) && !preg_match('/^[\d.]/', $spec)); + + if (!$isStringSpec || (float) $years) { + $spec = static::PERIOD_PREFIX; + + $spec .= $years > 0 ? $years.static::PERIOD_YEARS : ''; + $spec .= $months > 0 ? $months.static::PERIOD_MONTHS : ''; + + $specDays = 0; + $specDays += $weeks > 0 ? $weeks * static::getDaysPerWeek() : 0; + $specDays += $days > 0 ? $days : 0; + + $spec .= $specDays > 0 ? $specDays.static::PERIOD_DAYS : ''; + + if ($hours > 0 || $minutes > 0 || $seconds > 0) { + $spec .= static::PERIOD_TIME_PREFIX; + $spec .= $hours > 0 ? $hours.static::PERIOD_HOURS : ''; + $spec .= $minutes > 0 ? $minutes.static::PERIOD_MINUTES : ''; + $spec .= $seconds > 0 ? $seconds.static::PERIOD_SECONDS : ''; + } + + if ($spec === static::PERIOD_PREFIX) { + // Allow the zero interval. + $spec .= '0'.static::PERIOD_YEARS; + } + } + + try { + parent::__construct($spec); + } catch (Throwable $exception) { + try { + parent::__construct('PT0S'); + + if ($isStringSpec) { + if (!preg_match('/^P + (?:(?[+-]?\d*(?:\.\d+)?)Y)? + (?:(?[+-]?\d*(?:\.\d+)?)M)? + (?:(?[+-]?\d*(?:\.\d+)?)W)? + (?:(?[+-]?\d*(?:\.\d+)?)D)? + (?:T + (?:(?[+-]?\d*(?:\.\d+)?)H)? + (?:(?[+-]?\d*(?:\.\d+)?)M)? + (?:(?[+-]?\d*(?:\.\d+)?)S)? + )? + $/x', $spec, $match)) { + throw new InvalidArgumentException("Invalid duration: $spec"); + } + + $years = (float) ($match['year'] ?? 0); + $this->assertSafeForInteger('year', $years); + $months = (float) ($match['month'] ?? 0); + $this->assertSafeForInteger('month', $months); + $weeks = (float) ($match['week'] ?? 0); + $this->assertSafeForInteger('week', $weeks); + $days = (float) ($match['day'] ?? 0); + $this->assertSafeForInteger('day', $days); + $hours = (float) ($match['hour'] ?? 0); + $this->assertSafeForInteger('hour', $hours); + $minutes = (float) ($match['minute'] ?? 0); + $this->assertSafeForInteger('minute', $minutes); + $seconds = (float) ($match['second'] ?? 0); + $this->assertSafeForInteger('second', $seconds); + $microseconds = (int) str_pad( + substr(explode('.', $match['second'] ?? '0.0')[1] ?? '0', 0, 6), + 6, + '0', + ); + } + + $totalDays = (($weeks * static::getDaysPerWeek()) + $days); + $this->assertSafeForInteger('days total (including weeks)', $totalDays); + + $this->y = (int) $years; + $this->m = (int) $months; + $this->d = (int) $totalDays; + $this->h = (int) $hours; + $this->i = (int) $minutes; + $this->s = (int) $seconds; + $secondFloatPart = (float) ($microseconds / CarbonInterface::MICROSECONDS_PER_SECOND); + $this->f = $secondFloatPart; + $intervalMicroseconds = (int) ($this->f * CarbonInterface::MICROSECONDS_PER_SECOND); + $intervalSeconds = $seconds - $secondFloatPart; + + if ( + ((float) $this->y) !== $years || + ((float) $this->m) !== $months || + ((float) $this->d) !== $totalDays || + ((float) $this->h) !== $hours || + ((float) $this->i) !== $minutes || + ((float) $this->s) !== $intervalSeconds || + $intervalMicroseconds !== ((int) $microseconds) + ) { + $this->add(static::fromString( + ($years - $this->y).' years '. + ($months - $this->m).' months '. + ($totalDays - $this->d).' days '. + ($hours - $this->h).' hours '. + ($minutes - $this->i).' minutes '. + number_format($intervalSeconds - $this->s, 6, '.', '').' seconds '. + ($microseconds - $intervalMicroseconds).' microseconds ', + )); + } + } catch (Throwable $secondException) { + throw $secondException instanceof OutOfRangeException ? $secondException : $exception; + } + } + + if ($microseconds !== null) { + $this->f = $microseconds / CarbonInterface::MICROSECONDS_PER_SECOND; + } + + foreach (['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds'] as $unit) { + if ($$unit < 0) { + $this->set($unit, $$unit); + } + } + } + + /** + * Returns the factor for a given source-to-target couple. + * + * @param string $source + * @param string $target + * + * @return int|float|null + */ + public static function getFactor($source, $target) + { + $source = self::standardizeUnit($source); + $target = self::standardizeUnit($target); + $factors = self::getFlipCascadeFactors(); + + if (isset($factors[$source])) { + [$to, $factor] = $factors[$source]; + + if ($to === $target) { + return $factor; + } + + return $factor * static::getFactor($to, $target); + } + + return null; + } + + /** + * Returns the factor for a given source-to-target couple if set, + * else try to find the appropriate constant as the factor, such as Carbon::DAYS_PER_WEEK. + * + * @param string $source + * @param string $target + * + * @return int|float|null + */ + public static function getFactorWithDefault($source, $target) + { + $factor = self::getFactor($source, $target); + + if ($factor) { + return $factor; + } + + static $defaults = [ + 'month' => ['year' => Carbon::MONTHS_PER_YEAR], + 'week' => ['month' => Carbon::WEEKS_PER_MONTH], + 'day' => ['week' => Carbon::DAYS_PER_WEEK], + 'hour' => ['day' => Carbon::HOURS_PER_DAY], + 'minute' => ['hour' => Carbon::MINUTES_PER_HOUR], + 'second' => ['minute' => Carbon::SECONDS_PER_MINUTE], + 'millisecond' => ['second' => Carbon::MILLISECONDS_PER_SECOND], + 'microsecond' => ['millisecond' => Carbon::MICROSECONDS_PER_MILLISECOND], + ]; + + return $defaults[$source][$target] ?? null; + } + + /** + * Returns current config for days per week. + * + * @return int|float + */ + public static function getDaysPerWeek() + { + return static::getFactor('dayz', 'weeks') ?: Carbon::DAYS_PER_WEEK; + } + + /** + * Returns current config for hours per day. + * + * @return int|float + */ + public static function getHoursPerDay() + { + return static::getFactor('hours', 'dayz') ?: Carbon::HOURS_PER_DAY; + } + + /** + * Returns current config for minutes per hour. + * + * @return int|float + */ + public static function getMinutesPerHour() + { + return static::getFactor('minutes', 'hours') ?: Carbon::MINUTES_PER_HOUR; + } + + /** + * Returns current config for seconds per minute. + * + * @return int|float + */ + public static function getSecondsPerMinute() + { + return static::getFactor('seconds', 'minutes') ?: Carbon::SECONDS_PER_MINUTE; + } + + /** + * Returns current config for microseconds per second. + * + * @return int|float + */ + public static function getMillisecondsPerSecond() + { + return static::getFactor('milliseconds', 'seconds') ?: Carbon::MILLISECONDS_PER_SECOND; + } + + /** + * Returns current config for microseconds per second. + * + * @return int|float + */ + public static function getMicrosecondsPerMillisecond() + { + return static::getFactor('microseconds', 'milliseconds') ?: Carbon::MICROSECONDS_PER_MILLISECOND; + } + + /** + * Create a new CarbonInterval instance from specific values. + * This is an alias for the constructor that allows better fluent + * syntax as it allows you to do CarbonInterval::create(1)->fn() rather than + * (new CarbonInterval(1))->fn(). + * + * @param int $years + * @param int $months + * @param int $weeks + * @param int $days + * @param int $hours + * @param int $minutes + * @param int $seconds + * @param int $microseconds + * + * @throws Exception when the interval_spec (passed as $years) cannot be parsed as an interval. + * + * @return static + */ + public static function create($years = null, $months = null, $weeks = null, $days = null, $hours = null, $minutes = null, $seconds = null, $microseconds = null) + { + return new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $microseconds); + } + + /** + * Parse a string into a new CarbonInterval object according to the specified format. + * + * @example + * ``` + * echo Carboninterval::createFromFormat('H:i', '1:30'); + * ``` + * + * @param string $format Format of the $interval input string + * @param string|null $interval Input string to convert into an interval + * + * @throws \Carbon\Exceptions\ParseErrorException when the $interval cannot be parsed as an interval. + * + * @return static + */ + public static function createFromFormat(string $format, ?string $interval): static + { + $instance = new static(0); + $length = mb_strlen($format); + + if (preg_match('/s([,.])([uv])$/', $format, $match)) { + $interval = explode($match[1], $interval); + $index = \count($interval) - 1; + $interval[$index] = str_pad($interval[$index], $match[2] === 'v' ? 3 : 6, '0'); + $interval = implode($match[1], $interval); + } + + $interval ??= ''; + + for ($index = 0; $index < $length; $index++) { + $expected = mb_substr($format, $index, 1); + $nextCharacter = mb_substr($interval, 0, 1); + $unit = static::$formats[$expected] ?? null; + + if ($unit) { + if (!preg_match('/^-?\d+/', $interval, $match)) { + throw new ParseErrorException('number', $nextCharacter); + } + + $interval = mb_substr($interval, mb_strlen($match[0])); + self::incrementUnit($instance, $unit, (int) ($match[0])); + + continue; + } + + if ($nextCharacter !== $expected) { + throw new ParseErrorException( + "'$expected'", + $nextCharacter, + 'Allowed substitutes for interval formats are '.implode(', ', array_keys(static::$formats))."\n". + 'See https://php.net/manual/en/function.date.php for their meaning', + ); + } + + $interval = mb_substr($interval, 1); + } + + if ($interval !== '') { + throw new ParseErrorException( + 'end of string', + $interval, + ); + } + + return $instance; + } + + /** + * Return the original source used to create the current interval. + * + * @return array|int|string|DateInterval|mixed|null + */ + public function original() + { + return $this->originalInput; + } + + /** + * Return the start date if interval was created from a difference between 2 dates. + * + * @return CarbonInterface|null + */ + public function start(): ?CarbonInterface + { + $this->checkStartAndEnd(); + + return $this->startDate; + } + + /** + * Return the end date if interval was created from a difference between 2 dates. + * + * @return CarbonInterface|null + */ + public function end(): ?CarbonInterface + { + $this->checkStartAndEnd(); + + return $this->endDate; + } + + /** + * Get rid of the original input, start date and end date that may be kept in memory. + * + * @return $this + */ + public function optimize(): static + { + $this->originalInput = null; + $this->startDate = null; + $this->endDate = null; + $this->rawInterval = null; + $this->absolute = false; + + return $this; + } + + /** + * Get a copy of the instance. + * + * @return static + */ + public function copy(): static + { + $date = new static(0); + $date->copyProperties($this); + $date->step = $this->step; + + return $date; + } + + /** + * Get a copy of the instance. + * + * @return static + */ + public function clone(): static + { + return $this->copy(); + } + + /** + * Provide static helpers to create instances. Allows CarbonInterval::years(3). + * + * Note: This is done using the magic method to allow static and instance methods to + * have the same names. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @return static|mixed|null + */ + public static function __callStatic(string $method, array $parameters) + { + try { + $interval = new static(0); + $localStrictModeEnabled = $interval->localStrictModeEnabled; + $interval->localStrictModeEnabled = true; + + $result = static::hasMacro($method) + ? static::bindMacroContext(null, function () use (&$method, &$parameters, &$interval) { + return $interval->callMacro($method, $parameters); + }) + : $interval->$method(...$parameters); + + $interval->localStrictModeEnabled = $localStrictModeEnabled; + + return $result; + } catch (BadFluentSetterException $exception) { + if (Carbon::isStrictModeEnabled()) { + throw new BadFluentConstructorException($method, 0, $exception); + } + + return null; + } + } + + /** + * Evaluate the PHP generated by var_export() and recreate the exported CarbonInterval instance. + * + * @param array $dump data as exported by var_export() + * + * @return static + */ + #[ReturnTypeWillChange] + public static function __set_state($dump) + { + /** @noinspection PhpVoidFunctionResultUsedInspection */ + /** @var DateInterval $dateInterval */ + $dateInterval = parent::__set_state($dump); + + return static::instance($dateInterval); + } + + /** + * Return the current context from inside a macro callee or a new one if static. + * + * @return static + */ + protected static function this(): static + { + return end(static::$macroContextStack) ?: new static(0); + } + + /** + * Creates a CarbonInterval from string. + * + * Format: + * + * Suffix | Unit | Example | DateInterval expression + * -------|---------|---------|------------------------ + * y | years | 1y | P1Y + * mo | months | 3mo | P3M + * w | weeks | 2w | P2W + * d | days | 28d | P28D + * h | hours | 4h | PT4H + * m | minutes | 12m | PT12M + * s | seconds | 59s | PT59S + * + * e. g. `1w 3d 4h 32m 23s` is converted to 10 days 4 hours 32 minutes and 23 seconds. + * + * Special cases: + * - An empty string will return a zero interval + * - Fractions are allowed for weeks, days, hours and minutes and will be converted + * and rounded to the next smaller value (caution: 0.5w = 4d) + * + * @param string $intervalDefinition + * + * @throws InvalidIntervalException + * + * @return static + */ + public static function fromString(string $intervalDefinition): static + { + if (empty($intervalDefinition)) { + return self::withOriginal(new static(0), $intervalDefinition); + } + + $years = 0; + $months = 0; + $weeks = 0; + $days = 0; + $hours = 0; + $minutes = 0; + $seconds = 0; + $milliseconds = 0; + $microseconds = 0; + + $pattern = '/(-?\d+(?:\.\d+)?)\h*([^\d\h]*)/i'; + preg_match_all($pattern, $intervalDefinition, $parts, PREG_SET_ORDER); + + while ([$part, $value, $unit] = array_shift($parts)) { + $intValue = (int) $value; + $fraction = (float) $value - $intValue; + + // Fix calculation precision + switch (round($fraction, 6)) { + case 1: + $fraction = 0; + $intValue++; + + break; + case 0: + $fraction = 0; + + break; + } + + switch ($unit === 'µs' ? 'µs' : strtolower($unit)) { + case 'millennia': + case 'millennium': + $years += $intValue * CarbonInterface::YEARS_PER_MILLENNIUM; + + break; + + case 'century': + case 'centuries': + $years += $intValue * CarbonInterface::YEARS_PER_CENTURY; + + break; + + case 'decade': + case 'decades': + $years += $intValue * CarbonInterface::YEARS_PER_DECADE; + + break; + + case 'year': + case 'years': + case 'y': + case 'yr': + case 'yrs': + $years += $intValue; + + break; + + case 'quarter': + case 'quarters': + $months += $intValue * CarbonInterface::MONTHS_PER_QUARTER; + + break; + + case 'month': + case 'months': + case 'mo': + case 'mos': + $months += $intValue; + + break; + + case 'week': + case 'weeks': + case 'w': + $weeks += $intValue; + + if ($fraction) { + $parts[] = [null, $fraction * static::getDaysPerWeek(), 'd']; + } + + break; + + case 'day': + case 'days': + case 'd': + $days += $intValue; + + if ($fraction) { + $parts[] = [null, $fraction * static::getHoursPerDay(), 'h']; + } + + break; + + case 'hour': + case 'hours': + case 'h': + $hours += $intValue; + + if ($fraction) { + $parts[] = [null, $fraction * static::getMinutesPerHour(), 'm']; + } + + break; + + case 'minute': + case 'minutes': + case 'm': + $minutes += $intValue; + + if ($fraction) { + $parts[] = [null, $fraction * static::getSecondsPerMinute(), 's']; + } + + break; + + case 'second': + case 'seconds': + case 's': + $seconds += $intValue; + + if ($fraction) { + $parts[] = [null, $fraction * static::getMillisecondsPerSecond(), 'ms']; + } + + break; + + case 'millisecond': + case 'milliseconds': + case 'milli': + case 'ms': + $milliseconds += $intValue; + + if ($fraction) { + $microseconds += round($fraction * static::getMicrosecondsPerMillisecond()); + } + + break; + + case 'microsecond': + case 'microseconds': + case 'micro': + case 'µs': + $microseconds += $intValue; + + break; + + default: + throw new InvalidIntervalException( + "Invalid part $part in definition $intervalDefinition", + ); + } + } + + return self::withOriginal( + new static($years, $months, $weeks, $days, $hours, $minutes, $seconds, $milliseconds * Carbon::MICROSECONDS_PER_MILLISECOND + $microseconds), + $intervalDefinition, + ); + } + + /** + * Creates a CarbonInterval from string using a different locale. + * + * @param string $interval interval string in the given language (may also contain English). + * @param string|null $locale if locale is null or not specified, current global locale will be used instead. + * + * @return static + */ + public static function parseFromLocale(string $interval, ?string $locale = null): static + { + return static::fromString(Carbon::translateTimeString($interval, $locale ?: static::getLocale(), CarbonInterface::DEFAULT_LOCALE)); + } + + /** + * Create an interval from the difference between 2 dates. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $start + * @param \Carbon\Carbon|\DateTimeInterface|mixed $end + * + * @return static + */ + public static function diff($start, $end = null, bool $absolute = false, array $skip = []): static + { + $start = $start instanceof CarbonInterface ? $start : Carbon::make($start); + $end = $end instanceof CarbonInterface ? $end : Carbon::make($end); + $rawInterval = $start->diffAsDateInterval($end, $absolute); + $interval = static::instance($rawInterval, $skip); + + $interval->absolute = $absolute; + $interval->rawInterval = $rawInterval; + $interval->startDate = $start; + $interval->endDate = $end; + $interval->initialValues = $interval->getInnerValues(); + + return $interval; + } + + /** + * Invert the interval if it's inverted. + * + * @param bool $absolute do nothing if set to false + * + * @return $this + */ + public function abs(bool $absolute = false): static + { + if ($absolute && $this->invert) { + $this->invert(); + } + + return $this; + } + + /** + * @alias abs + * + * Invert the interval if it's inverted. + * + * @param bool $absolute do nothing if set to false + * + * @return $this + */ + public function absolute(bool $absolute = true): static + { + return $this->abs($absolute); + } + + /** + * Cast the current instance into the given class. + * + * @template T of DateInterval + * + * @psalm-param class-string $className The $className::instance() method will be called to cast the current object. + * + * @return T + */ + public function cast(string $className): mixed + { + return self::castIntervalToClass($this, $className); + } + + /** + * Create a CarbonInterval instance from a DateInterval one. Can not instance + * DateInterval objects created from DateTime::diff() as you can't externally + * set the $days field. + * + * @param DateInterval $interval + * @param bool $skipCopy set to true to return the passed object + * (without copying it) if it's already of the + * current class + * + * @return static + */ + public static function instance(DateInterval $interval, array $skip = [], bool $skipCopy = false): static + { + if ($skipCopy && $interval instanceof static) { + return $interval; + } + + return self::castIntervalToClass($interval, static::class, $skip); + } + + /** + * Make a CarbonInterval instance from given variable if possible. + * + * Always return a new instance. Parse only strings and only these likely to be intervals (skip dates + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * + * @param mixed|int|DateInterval|string|Closure|Unit|null $interval interval or number of the given $unit + * @param Unit|string|null $unit if specified, $interval must be an integer + * @param bool $skipCopy set to true to return the passed object + * (without copying it) if it's already of the + * current class + * + * @return static|null + */ + public static function make($interval, $unit = null, bool $skipCopy = false): ?self + { + if ($interval instanceof Unit) { + $interval = $interval->interval(); + } + + if ($unit instanceof Unit) { + $unit = $unit->value; + } + + if ($unit) { + $interval = "$interval $unit"; + } + + if ($interval instanceof DateInterval) { + return static::instance($interval, [], $skipCopy); + } + + if ($interval instanceof Closure) { + return self::withOriginal(new static($interval), $interval); + } + + if (!\is_string($interval)) { + return null; + } + + return static::makeFromString($interval); + } + + protected static function makeFromString(string $interval): ?self + { + $interval = preg_replace('/\s+/', ' ', trim($interval)); + + if (preg_match('/^P[T\d]/', $interval)) { + return new static($interval); + } + + if (preg_match('/^(?:\h*-?\d+(?:\.\d+)?\h*[a-z]+)+$/i', $interval)) { + return static::fromString($interval); + } + + $intervalInstance = static::createFromDateString($interval); + + return $intervalInstance->isEmpty() ? null : $intervalInstance; + } + + protected function resolveInterval($interval): ?self + { + if (!($interval instanceof self)) { + return self::make($interval); + } + + return $interval; + } + + /** + * Sets up a DateInterval from the relative parts of the string. + * + * @param string $datetime + * + * @return static + * + * @link https://php.net/manual/en/dateinterval.createfromdatestring.php + */ + public static function createFromDateString(string $datetime): static + { + $string = strtr($datetime, [ + ',' => ' ', + ' and ' => ' ', + ]); + $previousException = null; + + try { + $interval = parent::createFromDateString($string); + } catch (Throwable $exception) { + $interval = null; + $previousException = $exception; + } + + $interval ?: throw new InvalidFormatException( + 'Could not create interval from: '.var_export($datetime, true), + previous: $previousException, + ); + + if (!($interval instanceof static)) { + $interval = static::instance($interval); + } + + return self::withOriginal($interval, $datetime); + } + + /////////////////////////////////////////////////////////////////// + ///////////////////////// GETTERS AND SETTERS ///////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Get a part of the CarbonInterval object. + */ + public function get(Unit|string $name): int|float|string|null + { + $name = Unit::toName($name); + + if (str_starts_with($name, 'total')) { + return $this->total(substr($name, 5)); + } + + $resolvedUnit = Carbon::singularUnit(rtrim($name, 'z')); + + return match ($resolvedUnit) { + 'tzname', 'tz_name' => match (true) { + ($this->timezoneSetting === null) => null, + \is_string($this->timezoneSetting) => $this->timezoneSetting, + ($this->timezoneSetting instanceof DateTimeZone) => $this->timezoneSetting->getName(), + default => CarbonTimeZone::instance($this->timezoneSetting)->getName(), + }, + 'year' => $this->y, + 'month' => $this->m, + 'day' => $this->d, + 'hour' => $this->h, + 'minute' => $this->i, + 'second' => $this->s, + 'milli', 'millisecond' => (int) (round($this->f * Carbon::MICROSECONDS_PER_SECOND) / + Carbon::MICROSECONDS_PER_MILLISECOND), + 'micro', 'microsecond' => (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND), + 'microexcludemilli' => (int) round($this->f * Carbon::MICROSECONDS_PER_SECOND) % + Carbon::MICROSECONDS_PER_MILLISECOND, + 'week' => (int) ($this->d / (int) static::getDaysPerWeek()), + 'daysexcludeweek', 'dayzexcludeweek' => $this->d % (int) static::getDaysPerWeek(), + 'locale' => $this->getTranslatorLocale(), + default => throw new UnknownGetterException($name, previous: new UnknownGetterException($resolvedUnit)), + }; + } + + /** + * Get a part of the CarbonInterval object. + */ + public function __get(string $name): int|float|string|null + { + return $this->get($name); + } + + /** + * Set a part of the CarbonInterval object. + * + * @param Unit|string|array $name + * @param int $value + * + * @throws UnknownSetterException + * + * @return $this + */ + public function set($name, $value = null): static + { + $properties = \is_array($name) ? $name : [$name => $value]; + + foreach ($properties as $key => $value) { + switch (Carbon::singularUnit($key instanceof Unit ? $key->value : rtrim((string) $key, 'z'))) { + case 'year': + $this->checkIntegerValue($key, $value); + $this->y = $value; + $this->handleDecimalPart('year', $value, $this->y); + + break; + + case 'month': + $this->checkIntegerValue($key, $value); + $this->m = $value; + $this->handleDecimalPart('month', $value, $this->m); + + break; + + case 'week': + $this->checkIntegerValue($key, $value); + $days = $value * (int) static::getDaysPerWeek(); + $this->assertSafeForInteger('days total (including weeks)', $days); + $this->d = $days; + $this->handleDecimalPart('day', $days, $this->d); + + break; + + case 'day': + if ($value === false) { + break; + } + + $this->checkIntegerValue($key, $value); + $this->d = $value; + $this->handleDecimalPart('day', $value, $this->d); + + break; + + case 'daysexcludeweek': + case 'dayzexcludeweek': + $this->checkIntegerValue($key, $value); + $days = $this->weeks * (int) static::getDaysPerWeek() + $value; + $this->assertSafeForInteger('days total (including weeks)', $days); + $this->d = $days; + $this->handleDecimalPart('day', $days, $this->d); + + break; + + case 'hour': + $this->checkIntegerValue($key, $value); + $this->h = $value; + $this->handleDecimalPart('hour', $value, $this->h); + + break; + + case 'minute': + $this->checkIntegerValue($key, $value); + $this->i = $value; + $this->handleDecimalPart('minute', $value, $this->i); + + break; + + case 'second': + $this->checkIntegerValue($key, $value); + $this->s = $value; + $this->handleDecimalPart('second', $value, $this->s); + + break; + + case 'milli': + case 'millisecond': + $this->microseconds = $value * Carbon::MICROSECONDS_PER_MILLISECOND + $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND; + + break; + + case 'micro': + case 'microsecond': + $this->f = $value / Carbon::MICROSECONDS_PER_SECOND; + + break; + + default: + if (str_starts_with($key, ' * ')) { + return $this->setSetting(substr($key, 3), $value); + } + + if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { + throw new UnknownSetterException($key); + } + + $this->$key = $value; + } + } + + return $this; + } + + /** + * Set a part of the CarbonInterval object. + * + * @param string $name + * @param int $value + * + * @throws UnknownSetterException + */ + public function __set(string $name, $value) + { + $this->set($name, $value); + } + + /** + * Allow setting of weeks and days to be cumulative. + * + * @param int $weeks Number of weeks to set + * @param int $days Number of days to set + * + * @return static + */ + public function weeksAndDays(int $weeks, int $days): static + { + $this->dayz = ($weeks * static::getDaysPerWeek()) + $days; + + return $this; + } + + /** + * Returns true if the interval is empty for each unit. + * + * @return bool + */ + public function isEmpty(): bool + { + return $this->years === 0 && + $this->months === 0 && + $this->dayz === 0 && + !$this->days && + $this->hours === 0 && + $this->minutes === 0 && + $this->seconds === 0 && + $this->microseconds === 0; + } + + /** + * Register a custom macro. + * + * Pass null macro to remove it. + * + * @example + * ``` + * CarbonInterval::macro('twice', function () { + * return $this->times(2); + * }); + * echo CarbonInterval::hours(2)->twice(); + * ``` + * + * @param-closure-this static $macro + */ + public static function macro(string $name, ?callable $macro): void + { + static::$macros[$name] = $macro; + } + + /** + * Register macros from a mixin object. + * + * @example + * ``` + * CarbonInterval::mixin(new class { + * public function daysToHours() { + * return function () { + * $this->hours += $this->days; + * $this->days = 0; + * + * return $this; + * }; + * } + * public function hoursToDays() { + * return function () { + * $this->days += $this->hours; + * $this->hours = 0; + * + * return $this; + * }; + * } + * }); + * echo CarbonInterval::hours(5)->hoursToDays() . "\n"; + * echo CarbonInterval::days(5)->daysToHours() . "\n"; + * ``` + * + * @param object|string $mixin + * + * @throws ReflectionException + * + * @return void + */ + public static function mixin($mixin): void + { + static::baseMixin($mixin); + } + + /** + * Check if macro is registered. + * + * @param string $name + * + * @return bool + */ + public static function hasMacro(string $name): bool + { + return isset(static::$macros[$name]); + } + + /** + * Call given macro. + * + * @param string $name + * @param array $parameters + * + * @return mixed + */ + protected function callMacro(string $name, array $parameters) + { + $macro = static::$macros[$name]; + + if ($macro instanceof Closure) { + $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); + + return ($boundMacro ?: $macro)(...$parameters); + } + + return $macro(...$parameters); + } + + /** + * Allow fluent calls on the setters... CarbonInterval::years(3)->months(5)->day(). + * + * Note: This is done using the magic method to allow static and instance methods to + * have the same names. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @throws BadFluentSetterException|Throwable + * + * @return static|int|float|string + */ + public function __call(string $method, array $parameters) + { + if (static::hasMacro($method)) { + return static::bindMacroContext($this, function () use (&$method, &$parameters) { + return $this->callMacro($method, $parameters); + }); + } + + $roundedValue = $this->callRoundMethod($method, $parameters); + + if ($roundedValue !== null) { + return $roundedValue; + } + + if (preg_match('/^(?add|sub)(?[A-Z].*)$/', $method, $match)) { + $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($match['unit']), 0); + + return $this->{$match['method']}($value, $match['unit']); + } + + $value = $this->getMagicParameter($parameters, 0, Carbon::pluralUnit($method), 1); + + try { + $this->set($method, $value); + } catch (UnknownSetterException $exception) { + if ($this->localStrictModeEnabled ?? Carbon::isStrictModeEnabled()) { + throw new BadFluentSetterException($method, 0, $exception); + } + } + + return $this; + } + + protected function getForHumansInitialVariables($syntax, $short): array + { + if (\is_array($syntax)) { + return $syntax; + } + + if (\is_int($short)) { + return [ + 'parts' => $short, + 'short' => false, + ]; + } + + if (\is_bool($syntax)) { + return [ + 'short' => $syntax, + 'syntax' => CarbonInterface::DIFF_ABSOLUTE, + ]; + } + + return []; + } + + /** + * @param mixed $syntax + * @param mixed $short + * @param mixed $parts + * @param mixed $options + * + * @return array + */ + protected function getForHumansParameters($syntax = null, $short = false, $parts = self::NO_LIMIT, $options = null): array + { + $optionalSpace = ' '; + $default = $this->getTranslationMessage('list.0') ?? $this->getTranslationMessage('list') ?? ' '; + /** @var bool|string $join */ + $join = $default === '' ? '' : ' '; + /** @var bool|array|string $altNumbers */ + $altNumbers = false; + $aUnit = false; + $minimumUnit = 's'; + $skip = []; + extract($this->getForHumansInitialVariables($syntax, $short)); + $skip = array_map( + static fn ($unit) => $unit instanceof Unit ? $unit->value : $unit, + (array) $skip, + ); + $skip = array_map( + 'strtolower', + array_filter($skip, static fn ($unit) => \is_string($unit) && $unit !== ''), + ); + + $syntax ??= CarbonInterface::DIFF_ABSOLUTE; + + if ($parts === self::NO_LIMIT) { + $parts = INF; + } + + $options ??= static::getHumanDiffOptions(); + + if ($join === false) { + $join = ' '; + } elseif ($join === true) { + $join = [ + $default, + $this->getTranslationMessage('list.1') ?? $default, + ]; + } + + if ($altNumbers && $altNumbers !== true) { + $language = new Language($this->locale); + $altNumbers = \in_array($language->getCode(), (array) $altNumbers, true); + } + + if (\is_array($join)) { + [$default, $last] = $join; + + if ($default !== ' ') { + $optionalSpace = ''; + } + + $join = function ($list) use ($default, $last) { + if (\count($list) < 2) { + return implode('', $list); + } + + $end = array_pop($list); + + return implode($default, $list).$last.$end; + }; + } + + if (\is_string($join)) { + if ($join !== ' ') { + $optionalSpace = ''; + } + + $glue = $join; + $join = static fn ($list) => implode($glue, $list); + } + + $interpolations = [ + ':optional-space' => $optionalSpace, + ]; + + $translator ??= isset($locale) ? Translator::get($locale) : null; + + return [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip, $translator]; + } + + protected static function getRoundingMethodFromOptions(int $options): ?string + { + if ($options & CarbonInterface::ROUND) { + return 'round'; + } + + if ($options & CarbonInterface::CEIL) { + return 'ceil'; + } + + if ($options & CarbonInterface::FLOOR) { + return 'floor'; + } + + return null; + } + + /** + * Returns interval values as an array where key are the unit names and values the counts. + * + * @return int[] + */ + public function toArray(): array + { + return [ + 'years' => $this->years, + 'months' => $this->months, + 'weeks' => $this->weeks, + 'days' => $this->daysExcludeWeeks, + 'hours' => $this->hours, + 'minutes' => $this->minutes, + 'seconds' => $this->seconds, + 'microseconds' => $this->microseconds, + ]; + } + + /** + * Returns interval non-zero values as an array where key are the unit names and values the counts. + * + * @return int[] + */ + public function getNonZeroValues(): array + { + return array_filter($this->toArray(), 'intval'); + } + + /** + * Returns interval values as an array where key are the unit names and values the counts + * from the biggest non-zero one the the smallest non-zero one. + * + * @return int[] + */ + public function getValuesSequence(): array + { + $nonZeroValues = $this->getNonZeroValues(); + + if ($nonZeroValues === []) { + return []; + } + + $keys = array_keys($nonZeroValues); + $firstKey = $keys[0]; + $lastKey = $keys[\count($keys) - 1]; + $values = []; + $record = false; + + foreach ($this->toArray() as $unit => $count) { + if ($unit === $firstKey) { + $record = true; + } + + if ($record) { + $values[$unit] = $count; + } + + if ($unit === $lastKey) { + $record = false; + } + } + + return $values; + } + + /** + * Get the current interval in a human readable format in the current locale. + * + * @example + * ``` + * echo CarbonInterval::fromString('4d 3h 40m')->forHumans() . "\n"; + * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 2]) . "\n"; + * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['parts' => 3, 'join' => true]) . "\n"; + * echo CarbonInterval::fromString('4d 3h 40m')->forHumans(['short' => true]) . "\n"; + * echo CarbonInterval::fromString('1d 24h')->forHumans(['join' => ' or ']) . "\n"; + * echo CarbonInterval::fromString('1d 24h')->forHumans(['minimumUnit' => 'hour']) . "\n"; + * ``` + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contain: + * ⦿ 'syntax' entry (see below) + * ⦿ 'short' entry (see below) + * ⦿ 'parts' entry (see below) + * ⦿ 'options' entry (see below) + * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true + * ⦿ 'altNumbers' entry, use alternative numbers if available + * ` (from the current language if true is passed, from the given language(s) + * ` if array or string is passed) + * ⦿ 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) + * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) + * ⦿ 'translator' a custom translator to use to translator the output. + * if int passed, it adds modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: -1: no limits) + * @param int $options human diff options + * + * @throws Exception + * + * @return string + */ + public function forHumans($syntax = null, $short = false, $parts = self::NO_LIMIT, $options = null): string + { + /* @var TranslatorInterface|null $translator */ + [$syntax, $short, $parts, $options, $join, $aUnit, $altNumbers, $interpolations, $minimumUnit, $skip, $translator] = $this + ->getForHumansParameters($syntax, $short, $parts, $options); + + $interval = []; + + $syntax = (int) ($syntax ?? CarbonInterface::DIFF_ABSOLUTE); + $absolute = $syntax === CarbonInterface::DIFF_ABSOLUTE; + $relativeToNow = $syntax === CarbonInterface::DIFF_RELATIVE_TO_NOW; + $count = 1; + $unit = $short ? 's' : 'second'; + $isFuture = $this->invert === 1; + $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); + $declensionMode = null; + + $translator ??= $this->getLocalTranslator(); + + $handleDeclensions = function ($unit, $count, $index = 0, $parts = 1) use ($interpolations, $transId, $translator, $altNumbers, $absolute, &$declensionMode) { + if (!$absolute) { + $declensionMode = $declensionMode ?? $this->translate($transId.'_mode'); + + if ($this->needsDeclension($declensionMode, $index, $parts)) { + // Some languages have special pluralization for past and future tense. + $key = $unit.'_'.$transId; + $result = $this->translate($key, $interpolations, $count, $translator, $altNumbers); + + if ($result !== $key) { + return $result; + } + } + } + + $result = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); + + if ($result !== $unit) { + return $result; + } + + return null; + }; + + $intervalValues = $this; + $method = static::getRoundingMethodFromOptions($options); + + if ($method) { + $previousCount = INF; + + while ( + \count($intervalValues->getNonZeroValues()) > $parts && + ($count = \count($keys = array_keys($intervalValues->getValuesSequence()))) > 1 + ) { + $index = min($count, $previousCount - 1) - 2; + + if ($index < 0) { + break; + } + + $intervalValues = $this->copy()->roundUnit( + $keys[$index], + 1, + $method, + ); + $previousCount = $count; + } + } + + $diffIntervalArray = [ + ['value' => $intervalValues->years, 'unit' => 'year', 'unitShort' => 'y'], + ['value' => $intervalValues->months, 'unit' => 'month', 'unitShort' => 'm'], + ['value' => $intervalValues->weeks, 'unit' => 'week', 'unitShort' => 'w'], + ['value' => $intervalValues->daysExcludeWeeks, 'unit' => 'day', 'unitShort' => 'd'], + ['value' => $intervalValues->hours, 'unit' => 'hour', 'unitShort' => 'h'], + ['value' => $intervalValues->minutes, 'unit' => 'minute', 'unitShort' => 'min'], + ['value' => $intervalValues->seconds, 'unit' => 'second', 'unitShort' => 's'], + ['value' => $intervalValues->milliseconds, 'unit' => 'millisecond', 'unitShort' => 'ms'], + ['value' => $intervalValues->microExcludeMilli, 'unit' => 'microsecond', 'unitShort' => 'µs'], + ]; + + if (!empty($skip)) { + foreach ($diffIntervalArray as $index => &$unitData) { + $nextIndex = $index + 1; + + if ($unitData['value'] && + isset($diffIntervalArray[$nextIndex]) && + \count(array_intersect([$unitData['unit'], $unitData['unit'].'s', $unitData['unitShort']], $skip)) + ) { + $diffIntervalArray[$nextIndex]['value'] += $unitData['value'] * + self::getFactorWithDefault($diffIntervalArray[$nextIndex]['unit'], $unitData['unit']); + $unitData['value'] = 0; + } + } + } + + $transChoice = function ($short, $unitData, $index, $parts) use ($absolute, $handleDeclensions, $translator, $aUnit, $altNumbers, $interpolations) { + $count = $unitData['value']; + + if ($short) { + $result = $handleDeclensions($unitData['unitShort'], $count, $index, $parts); + + if ($result !== null) { + return $result; + } + } elseif ($aUnit) { + $result = $handleDeclensions('a_'.$unitData['unit'], $count, $index, $parts); + + if ($result !== null) { + return $result; + } + } + + if (!$absolute) { + return $handleDeclensions($unitData['unit'], $count, $index, $parts); + } + + return $this->translate($unitData['unit'], $interpolations, $count, $translator, $altNumbers); + }; + + $fallbackUnit = ['second', 's']; + + foreach ($diffIntervalArray as $diffIntervalData) { + if ($diffIntervalData['value'] > 0) { + $unit = $short ? $diffIntervalData['unitShort'] : $diffIntervalData['unit']; + $count = $diffIntervalData['value']; + $interval[] = [$short, $diffIntervalData]; + } elseif ($options & CarbonInterface::SEQUENTIAL_PARTS_ONLY && \count($interval) > 0) { + break; + } + + // break the loop after we get the required number of parts in array + if (\count($interval) >= $parts) { + break; + } + + // break the loop after we have reached the minimum unit + if (\in_array($minimumUnit, [$diffIntervalData['unit'], $diffIntervalData['unitShort']], true)) { + $fallbackUnit = [$diffIntervalData['unit'], $diffIntervalData['unitShort']]; + + break; + } + } + + $actualParts = \count($interval); + + foreach ($interval as $index => &$item) { + $item = $transChoice($item[0], $item[1], $index, $actualParts); + } + + if (\count($interval) === 0) { + if ($relativeToNow && $options & CarbonInterface::JUST_NOW) { + $key = 'diff_now'; + $translation = $this->translate($key, $interpolations, null, $translator); + + if ($translation !== $key) { + return $translation; + } + } + + $count = $options & CarbonInterface::NO_ZERO_DIFF ? 1 : 0; + $unit = $fallbackUnit[$short ? 1 : 0]; + $interval[] = $this->translate($unit, $interpolations, $count, $translator, $altNumbers); + } + + // join the interval parts by a space + $time = $join($interval); + + unset($diffIntervalArray, $interval); + + if ($absolute) { + return $time; + } + + $isFuture = $this->invert === 1; + + $transId = $relativeToNow ? ($isFuture ? 'from_now' : 'ago') : ($isFuture ? 'after' : 'before'); + + if ($parts === 1) { + if ($relativeToNow && $unit === 'day') { + $specialTranslations = static::SPECIAL_TRANSLATIONS[$count] ?? null; + + if ($specialTranslations && $options & $specialTranslations['option']) { + $key = $specialTranslations[$isFuture ? 'future' : 'past']; + $translation = $this->translate($key, $interpolations, null, $translator); + + if ($translation !== $key) { + return $translation; + } + } + } + + $aTime = $aUnit ? $handleDeclensions('a_'.$unit, $count) : null; + + $time = $aTime ?: $handleDeclensions($unit, $count) ?: $time; + } + + $time = [':time' => $time]; + + return $this->translate($transId, array_merge($time, $interpolations, $time), null, $translator); + } + + public function format(string $format): string + { + $output = parent::format($format); + + if (!str_contains($format, '%a') || !isset($this->startDate, $this->endDate)) { + return $output; + } + + $this->rawInterval ??= $this->startDate->diffAsDateInterval($this->endDate); + + return str_replace('(unknown)', $this->rawInterval->format('%a'), $output); + } + + /** + * Format the instance as a string using the forHumans() function. + * + * @throws Exception + * + * @return string + */ + public function __toString(): string + { + $format = $this->localToStringFormat + ?? $this->getFactory()->getSettings()['toStringFormat'] + ?? null; + + if (!$format) { + return $this->forHumans(); + } + + if ($format instanceof Closure) { + return $format($this); + } + + return $this->format($format); + } + + /** + * Return native DateInterval PHP object matching the current instance. + * + * @example + * ``` + * var_dump(CarbonInterval::hours(2)->toDateInterval()); + * ``` + * + * @return DateInterval + */ + public function toDateInterval(): DateInterval + { + return self::castIntervalToClass($this, DateInterval::class); + } + + /** + * Convert the interval to a CarbonPeriod. + * + * @param DateTimeInterface|string|int ...$params Start date, [end date or recurrences] and optional settings. + * + * @return CarbonPeriod + */ + public function toPeriod(...$params): CarbonPeriod + { + if ($this->timezoneSetting) { + $timeZone = \is_string($this->timezoneSetting) + ? new DateTimeZone($this->timezoneSetting) + : $this->timezoneSetting; + + if ($timeZone instanceof DateTimeZone) { + array_unshift($params, $timeZone); + } + } + + $class = ($params[0] ?? null) instanceof DateTime ? CarbonPeriod::class : CarbonPeriodImmutable::class; + + return $class::create($this, ...$params); + } + + /** + * Decompose the current interval into + * + * @param mixed|int|DateInterval|string|Closure|Unit|null $interval interval or number of the given $unit + * @param Unit|string|null $unit if specified, $interval must be an integer + * + * @return CarbonPeriod + */ + public function stepBy($interval, Unit|string|null $unit = null): CarbonPeriod + { + $this->checkStartAndEnd(); + $start = $this->startDate ?? CarbonImmutable::make('now'); + $end = $this->endDate ?? $start->copy()->add($this); + + try { + $step = static::make($interval, $unit); + } catch (InvalidFormatException $exception) { + if ($unit || (\is_string($interval) ? preg_match('/(\s|\d)/', $interval) : !($interval instanceof Unit))) { + throw $exception; + } + + $step = static::make(1, $interval); + } + + $class = $start instanceof DateTime ? CarbonPeriod::class : CarbonPeriodImmutable::class; + + return $class::create($step, $start, $end); + } + + /** + * Invert the interval. + * + * @param bool|int $inverted if a parameter is passed, the passed value cast as 1 or 0 is used + * as the new value of the ->invert property. + * + * @return $this + */ + public function invert($inverted = null): static + { + $this->invert = (\func_num_args() === 0 ? !$this->invert : $inverted) ? 1 : 0; + + return $this; + } + + protected function solveNegativeInterval(): static + { + if (!$this->isEmpty() && $this->years <= 0 && $this->months <= 0 && $this->dayz <= 0 && $this->hours <= 0 && $this->minutes <= 0 && $this->seconds <= 0 && $this->microseconds <= 0) { + $this->years *= self::NEGATIVE; + $this->months *= self::NEGATIVE; + $this->dayz *= self::NEGATIVE; + $this->hours *= self::NEGATIVE; + $this->minutes *= self::NEGATIVE; + $this->seconds *= self::NEGATIVE; + $this->microseconds *= self::NEGATIVE; + $this->invert(); + } + + return $this; + } + + /** + * Add the passed interval to the current instance. + * + * @param string|DateInterval $unit + * @param int|float $value + * + * @return $this + */ + public function add($unit, $value = 1): static + { + if (is_numeric($unit)) { + [$value, $unit] = [$unit, $value]; + } + + if (\is_string($unit) && !preg_match('/^\s*-?\d/', $unit)) { + $unit = "$value $unit"; + $value = 1; + } + + $interval = static::make($unit); + + if (!$interval) { + throw new InvalidIntervalException('This type of data cannot be added/subtracted.'); + } + + if ($value !== 1) { + $interval->times($value); + } + + $sign = ($this->invert === 1) !== ($interval->invert === 1) ? self::NEGATIVE : self::POSITIVE; + $this->years += $interval->y * $sign; + $this->months += $interval->m * $sign; + $this->dayz += ($interval->days === false ? $interval->d : $interval->days) * $sign; + $this->hours += $interval->h * $sign; + $this->minutes += $interval->i * $sign; + $this->seconds += $interval->s * $sign; + $this->microseconds += $interval->microseconds * $sign; + + $this->solveNegativeInterval(); + + return $this; + } + + /** + * Subtract the passed interval to the current instance. + * + * @param string|DateInterval $unit + * @param int|float $value + * + * @return $this + */ + public function sub($unit, $value = 1): static + { + if (is_numeric($unit)) { + [$value, $unit] = [$unit, $value]; + } + + return $this->add($unit, -(float) $value); + } + + /** + * Subtract the passed interval to the current instance. + * + * @param string|DateInterval $unit + * @param int|float $value + * + * @return $this + */ + public function subtract($unit, $value = 1): static + { + return $this->sub($unit, $value); + } + + /** + * Add given parameters to the current interval. + * + * @param int $years + * @param int $months + * @param int|float $weeks + * @param int|float $days + * @param int|float $hours + * @param int|float $minutes + * @param int|float $seconds + * @param int|float $microseconds + * + * @return $this + */ + public function plus( + $years = 0, + $months = 0, + $weeks = 0, + $days = 0, + $hours = 0, + $minutes = 0, + $seconds = 0, + $microseconds = 0 + ): static { + return $this->add(" + $years years $months months $weeks weeks $days days + $hours hours $minutes minutes $seconds seconds $microseconds microseconds + "); + } + + /** + * Add given parameters to the current interval. + * + * @param int $years + * @param int $months + * @param int|float $weeks + * @param int|float $days + * @param int|float $hours + * @param int|float $minutes + * @param int|float $seconds + * @param int|float $microseconds + * + * @return $this + */ + public function minus( + $years = 0, + $months = 0, + $weeks = 0, + $days = 0, + $hours = 0, + $minutes = 0, + $seconds = 0, + $microseconds = 0 + ): static { + return $this->sub(" + $years years $months months $weeks weeks $days days + $hours hours $minutes minutes $seconds seconds $microseconds microseconds + "); + } + + /** + * Multiply current instance given number of times. times() is naive, it multiplies each unit + * (so day can be greater than 31, hour can be greater than 23, etc.) and the result is rounded + * separately for each unit. + * + * Use times() when you want a fast and approximated calculation that does not cascade units. + * + * For a precise and cascaded calculation, + * + * @see multiply() + * + * @param float|int $factor + * + * @return $this + */ + public function times($factor): static + { + if ($factor < 0) { + $this->invert = $this->invert ? 0 : 1; + $factor = -$factor; + } + + $this->years = (int) round($this->years * $factor); + $this->months = (int) round($this->months * $factor); + $this->dayz = (int) round($this->dayz * $factor); + $this->hours = (int) round($this->hours * $factor); + $this->minutes = (int) round($this->minutes * $factor); + $this->seconds = (int) round($this->seconds * $factor); + $this->microseconds = (int) round($this->microseconds * $factor); + + return $this; + } + + /** + * Divide current instance by a given divider. shares() is naive, it divides each unit separately + * and the result is rounded for each unit. So 5 hours and 20 minutes shared by 3 becomes 2 hours + * and 7 minutes. + * + * Use shares() when you want a fast and approximated calculation that does not cascade units. + * + * For a precise and cascaded calculation, + * + * @see divide() + * + * @param float|int $divider + * + * @return $this + */ + public function shares($divider): static + { + return $this->times(1 / $divider); + } + + protected function copyProperties(self $interval, $ignoreSign = false): static + { + $this->years = $interval->years; + $this->months = $interval->months; + $this->dayz = $interval->dayz; + $this->hours = $interval->hours; + $this->minutes = $interval->minutes; + $this->seconds = $interval->seconds; + $this->microseconds = $interval->microseconds; + + if (!$ignoreSign) { + $this->invert = $interval->invert; + } + + return $this; + } + + /** + * Multiply and cascade current instance by a given factor. + * + * @param float|int $factor + * + * @return $this + */ + public function multiply($factor): static + { + if ($factor < 0) { + $this->invert = $this->invert ? 0 : 1; + $factor = -$factor; + } + + $yearPart = (int) floor($this->years * $factor); // Split calculation to prevent imprecision + + if ($yearPart) { + $this->years -= $yearPart / $factor; + } + + return $this->copyProperties( + static::create($yearPart) + ->microseconds(abs($this->totalMicroseconds) * $factor) + ->cascade(), + true, + ); + } + + /** + * Divide and cascade current instance by a given divider. + * + * @param float|int $divider + * + * @return $this + */ + public function divide($divider): static + { + return $this->multiply(1 / $divider); + } + + /** + * Get the interval_spec string of a date interval. + * + * @param DateInterval $interval + * + * @return string + */ + public static function getDateIntervalSpec(DateInterval $interval, bool $microseconds = false, array $skip = []): string + { + $date = array_filter([ + static::PERIOD_YEARS => abs($interval->y), + static::PERIOD_MONTHS => abs($interval->m), + static::PERIOD_DAYS => abs($interval->d), + ]); + + $skip = array_map([Unit::class, 'toNameIfUnit'], $skip); + + if ( + $interval->days >= CarbonInterface::DAYS_PER_WEEK * CarbonInterface::WEEKS_PER_MONTH && + (!isset($date[static::PERIOD_YEARS]) || \count(array_intersect(['y', 'year', 'years'], $skip))) && + (!isset($date[static::PERIOD_MONTHS]) || \count(array_intersect(['m', 'month', 'months'], $skip))) + ) { + $date = [ + static::PERIOD_DAYS => abs($interval->days), + ]; + } + + $seconds = abs($interval->s); + if ($microseconds && $interval->f > 0) { + $seconds = \sprintf('%d.%06d', $seconds, abs($interval->f) * 1000000); + } + + $time = array_filter([ + static::PERIOD_HOURS => abs($interval->h), + static::PERIOD_MINUTES => abs($interval->i), + static::PERIOD_SECONDS => $seconds, + ]); + + $specString = static::PERIOD_PREFIX; + + foreach ($date as $key => $value) { + $specString .= $value.$key; + } + + if (\count($time) > 0) { + $specString .= static::PERIOD_TIME_PREFIX; + foreach ($time as $key => $value) { + $specString .= $value.$key; + } + } + + return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString; + } + + /** + * Get the interval_spec string. + * + * @return string + */ + public function spec(bool $microseconds = false): string + { + return static::getDateIntervalSpec($this, $microseconds); + } + + /** + * Comparing 2 date intervals. + * + * @param DateInterval $first + * @param DateInterval $second + * + * @return int 0, 1 or -1 + */ + public static function compareDateIntervals(DateInterval $first, DateInterval $second): int + { + $current = Carbon::now(); + $passed = $current->avoidMutation()->add($second); + $current->add($first); + + return $current <=> $passed; + } + + /** + * Comparing with passed interval. + * + * @param DateInterval $interval + * + * @return int 0, 1 or -1 + */ + public function compare(DateInterval $interval): int + { + return static::compareDateIntervals($this, $interval); + } + + /** + * Convert overflowed values into bigger units. + * + * @return $this + */ + public function cascade(): static + { + return $this->doCascade(false); + } + + public function hasNegativeValues(): bool + { + foreach ($this->toArray() as $value) { + if ($value < 0) { + return true; + } + } + + return false; + } + + public function hasPositiveValues(): bool + { + foreach ($this->toArray() as $value) { + if ($value > 0) { + return true; + } + } + + return false; + } + + /** + * Get amount of given unit equivalent to the interval. + * + * @param string $unit + * + * @throws UnknownUnitException|UnitNotConfiguredException + * + * @return float + */ + public function total(string $unit): float + { + $realUnit = $unit = strtolower($unit); + + if (\in_array($unit, ['days', 'weeks'])) { + $realUnit = 'dayz'; + } elseif (!\in_array($unit, ['microseconds', 'milliseconds', 'seconds', 'minutes', 'hours', 'dayz', 'months', 'years'])) { + throw new UnknownUnitException($unit); + } + + $this->checkStartAndEnd(); + + if ($this->startDate && $this->endDate) { + $diff = $this->startDate->diffInUnit($unit, $this->endDate); + + return $this->absolute ? abs($diff) : $diff; + } + + $result = 0; + $cumulativeFactor = 0; + $unitFound = false; + $factors = self::getFlipCascadeFactors(); + $daysPerWeek = (int) static::getDaysPerWeek(); + + $values = [ + 'years' => $this->years, + 'months' => $this->months, + 'weeks' => (int) ($this->d / $daysPerWeek), + 'dayz' => fmod($this->d, $daysPerWeek), + 'hours' => $this->hours, + 'minutes' => $this->minutes, + 'seconds' => $this->seconds, + 'milliseconds' => (int) ($this->microseconds / Carbon::MICROSECONDS_PER_MILLISECOND), + 'microseconds' => $this->microseconds % Carbon::MICROSECONDS_PER_MILLISECOND, + ]; + + if (isset($factors['dayz']) && $factors['dayz'][0] !== 'weeks') { + $values['dayz'] += $values['weeks'] * $daysPerWeek; + $values['weeks'] = 0; + } + + foreach ($factors as $source => [$target, $factor]) { + if ($source === $realUnit) { + $unitFound = true; + $value = $values[$source]; + $result += $value; + $cumulativeFactor = 1; + } + + if ($factor === false) { + if ($unitFound) { + break; + } + + $result = 0; + $cumulativeFactor = 0; + + continue; + } + + if ($target === $realUnit) { + $unitFound = true; + } + + if ($cumulativeFactor) { + $cumulativeFactor *= $factor; + $result += $values[$target] * $cumulativeFactor; + + continue; + } + + $value = $values[$source]; + + $result = ($result + $value) / $factor; + } + + if (isset($target) && !$cumulativeFactor) { + $result += $values[$target]; + } + + if (!$unitFound) { + throw new UnitNotConfiguredException($unit); + } + + if ($this->invert) { + $result *= self::NEGATIVE; + } + + if ($unit === 'weeks') { + $result /= $daysPerWeek; + } + + // Cast as int numbers with no decimal part + return fmod($result, 1) === 0.0 ? (int) $result : $result; + } + + /** + * Determines if the instance is equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see equalTo() + * + * @return bool + */ + public function eq($interval): bool + { + return $this->equalTo($interval); + } + + /** + * Determines if the instance is equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function equalTo($interval): bool + { + $interval = $this->resolveInterval($interval); + + if ($interval === null) { + return false; + } + + $step = $this->getStep(); + + if ($step) { + return $step === $interval->getStep(); + } + + if ($this->isEmpty()) { + return $interval->isEmpty(); + } + + $cascadedInterval = $this->copy()->cascade(); + $comparedInterval = $interval->copy()->cascade(); + + return $cascadedInterval->invert === $comparedInterval->invert && + $cascadedInterval->getNonZeroValues() === $comparedInterval->getNonZeroValues(); + } + + /** + * Determines if the instance is not equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see notEqualTo() + * + * @return bool + */ + public function ne($interval): bool + { + return $this->notEqualTo($interval); + } + + /** + * Determines if the instance is not equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function notEqualTo($interval): bool + { + return !$this->eq($interval); + } + + /** + * Determines if the instance is greater (longer) than another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see greaterThan() + * + * @return bool + */ + public function gt($interval): bool + { + return $this->greaterThan($interval); + } + + /** + * Determines if the instance is greater (longer) than another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function greaterThan($interval): bool + { + $interval = $this->resolveInterval($interval); + + return $interval === null || $this->totalMicroseconds > $interval->totalMicroseconds; + } + + /** + * Determines if the instance is greater (longer) than or equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see greaterThanOrEqualTo() + * + * @return bool + */ + public function gte($interval): bool + { + return $this->greaterThanOrEqualTo($interval); + } + + /** + * Determines if the instance is greater (longer) than or equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function greaterThanOrEqualTo($interval): bool + { + return $this->greaterThan($interval) || $this->equalTo($interval); + } + + /** + * Determines if the instance is less (shorter) than another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see lessThan() + * + * @return bool + */ + public function lt($interval): bool + { + return $this->lessThan($interval); + } + + /** + * Determines if the instance is less (shorter) than another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function lessThan($interval): bool + { + $interval = $this->resolveInterval($interval); + + return $interval !== null && $this->totalMicroseconds < $interval->totalMicroseconds; + } + + /** + * Determines if the instance is less (shorter) than or equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @see lessThanOrEqualTo() + * + * @return bool + */ + public function lte($interval): bool + { + return $this->lessThanOrEqualTo($interval); + } + + /** + * Determines if the instance is less (shorter) than or equal to another + * + * @param CarbonInterval|DateInterval|mixed $interval + * + * @return bool + */ + public function lessThanOrEqualTo($interval): bool + { + return $this->lessThan($interval) || $this->equalTo($interval); + } + + /** + * Determines if the instance is between two others. + * + * The third argument allow you to specify if bounds are included or not (true by default) + * but for when you including/excluding bounds may produce different results in your application, + * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. + * + * @example + * ``` + * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(3)); // true + * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::hours(36)); // false + * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2)); // true + * CarbonInterval::hours(48)->between(CarbonInterval::day(), CarbonInterval::days(2), false); // false + * ``` + * + * @param CarbonInterval|DateInterval|mixed $interval1 + * @param CarbonInterval|DateInterval|mixed $interval2 + * @param bool $equal Indicates if an equal to comparison should be done + * + * @return bool + */ + public function between($interval1, $interval2, bool $equal = true): bool + { + return $equal + ? $this->greaterThanOrEqualTo($interval1) && $this->lessThanOrEqualTo($interval2) + : $this->greaterThan($interval1) && $this->lessThan($interval2); + } + + /** + * Determines if the instance is between two others, bounds excluded. + * + * @example + * ``` + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // true + * ``` + * + * @param CarbonInterval|DateInterval|mixed $interval1 + * @param CarbonInterval|DateInterval|mixed $interval2 + * + * @return bool + */ + public function betweenIncluded($interval1, $interval2): bool + { + return $this->between($interval1, $interval2, true); + } + + /** + * Determines if the instance is between two others, bounds excluded. + * + * @example + * ``` + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(3)); // true + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::hours(36)); // false + * CarbonInterval::hours(48)->betweenExcluded(CarbonInterval::day(), CarbonInterval::days(2)); // false + * ``` + * + * @param CarbonInterval|DateInterval|mixed $interval1 + * @param CarbonInterval|DateInterval|mixed $interval2 + * + * @return bool + */ + public function betweenExcluded($interval1, $interval2): bool + { + return $this->between($interval1, $interval2, false); + } + + /** + * Determines if the instance is between two others + * + * @example + * ``` + * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(3)); // true + * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::hours(36)); // false + * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2)); // true + * CarbonInterval::hours(48)->isBetween(CarbonInterval::day(), CarbonInterval::days(2), false); // false + * ``` + * + * @param CarbonInterval|DateInterval|mixed $interval1 + * @param CarbonInterval|DateInterval|mixed $interval2 + * @param bool $equal Indicates if an equal to comparison should be done + * + * @return bool + */ + public function isBetween($interval1, $interval2, bool $equal = true): bool + { + return $this->between($interval1, $interval2, $equal); + } + + /** + * Round the current instance at the given unit with given precision if specified and the given function. + * + * @throws Exception + */ + public function roundUnit(string $unit, DateInterval|string|int|float $precision = 1, string $function = 'round'): static + { + if (static::getCascadeFactors() !== static::getDefaultCascadeFactors()) { + $value = $function($this->total($unit) / $precision) * $precision; + $inverted = $value < 0; + + return $this->copyProperties(self::fromString( + number_format(abs($value), 12, '.', '').' '.$unit + )->invert($inverted)->cascade()); + } + + $base = CarbonImmutable::parse('2000-01-01 00:00:00', 'UTC') + ->roundUnit($unit, $precision, $function); + $next = $base->add($this); + $inverted = $next < $base; + + if ($inverted) { + $next = $base->sub($this); + } + + $this->copyProperties( + $next + ->roundUnit($unit, $precision, $function) + ->diff($base), + ); + + return $this->invert($inverted); + } + + /** + * Truncate the current instance at the given unit with given precision if specified. + * + * @param string $unit + * @param float|int|string|DateInterval|null $precision + * + * @throws Exception + * + * @return $this + */ + public function floorUnit(string $unit, $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'floor'); + } + + /** + * Ceil the current instance at the given unit with given precision if specified. + * + * @param string $unit + * @param float|int|string|DateInterval|null $precision + * + * @throws Exception + * + * @return $this + */ + public function ceilUnit(string $unit, $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'ceil'); + } + + /** + * Round the current instance second with given precision if specified. + * + * @param float|int|string|DateInterval|null $precision + * @param string $function + * + * @throws Exception + * + * @return $this + */ + public function round($precision = 1, string $function = 'round'): static + { + return $this->roundWith($precision, $function); + } + + /** + * Round the current instance second with given precision if specified. + * + * @throws Exception + * + * @return $this + */ + public function floor(DateInterval|string|float|int $precision = 1): static + { + return $this->round($precision, 'floor'); + } + + /** + * Ceil the current instance second with given precision if specified. + * + * @throws Exception + * + * @return $this + */ + public function ceil(DateInterval|string|float|int $precision = 1): static + { + return $this->round($precision, 'ceil'); + } + + public function __unserialize(array $data): void + { + $properties = array_combine( + array_map( + static fn (mixed $key) => \is_string($key) + ? str_replace('tzName', 'timezoneSetting', $key) + : $key, + array_keys($data), + ), + $data, + ); + + if (method_exists(parent::class, '__unserialize')) { + // PHP >= 8.2 + parent::__unserialize($properties); + + return; + } + + // PHP <= 8.1 + // @codeCoverageIgnoreStart + $properties = array_combine( + array_map( + static fn (string $property) => preg_replace('/^\0.+\0/', '', $property), + array_keys($data), + ), + $data, + ); + $localStrictMode = $this->localStrictModeEnabled; + $this->localStrictModeEnabled = false; + $days = $properties['days'] ?? false; + $this->days = $days === false ? false : (int) $days; + $this->y = (int) ($properties['y'] ?? 0); + $this->m = (int) ($properties['m'] ?? 0); + $this->d = (int) ($properties['d'] ?? 0); + $this->h = (int) ($properties['h'] ?? 0); + $this->i = (int) ($properties['i'] ?? 0); + $this->s = (int) ($properties['s'] ?? 0); + $this->f = (float) ($properties['f'] ?? 0.0); + // @phpstan-ignore-next-line + $this->weekday = (int) ($properties['weekday'] ?? 0); + // @phpstan-ignore-next-line + $this->weekday_behavior = (int) ($properties['weekday_behavior'] ?? 0); + // @phpstan-ignore-next-line + $this->first_last_day_of = (int) ($properties['first_last_day_of'] ?? 0); + $this->invert = (int) ($properties['invert'] ?? 0); + // @phpstan-ignore-next-line + $this->special_type = (int) ($properties['special_type'] ?? 0); + // @phpstan-ignore-next-line + $this->special_amount = (int) ($properties['special_amount'] ?? 0); + // @phpstan-ignore-next-line + $this->have_weekday_relative = (int) ($properties['have_weekday_relative'] ?? 0); + // @phpstan-ignore-next-line + $this->have_special_relative = (int) ($properties['have_special_relative'] ?? 0); + parent::__construct(self::getDateIntervalSpec($this)); + + foreach ($properties as $property => $value) { + if ($property === 'localStrictModeEnabled') { + continue; + } + + $this->$property = $value; + } + + $this->localStrictModeEnabled = $properties['localStrictModeEnabled'] ?? $localStrictMode; + // @codeCoverageIgnoreEnd + } + + /** + * @template T + * + * @param T $interval + * @param mixed $original + * + * @return T + */ + private static function withOriginal(mixed $interval, mixed $original): mixed + { + if ($interval instanceof self) { + $interval->originalInput = $original; + } + + return $interval; + } + + private static function standardizeUnit(string $unit): string + { + $unit = rtrim($unit, 'sz').'s'; + + return $unit === 'days' ? 'dayz' : $unit; + } + + private static function getFlipCascadeFactors(): array + { + if (!self::$flipCascadeFactors) { + self::$flipCascadeFactors = []; + + foreach (self::getCascadeFactors() as $to => [$factor, $from]) { + self::$flipCascadeFactors[self::standardizeUnit($from)] = [self::standardizeUnit($to), $factor]; + } + } + + return self::$flipCascadeFactors; + } + + /** + * @template T of DateInterval + * + * @param DateInterval $interval + * + * @psalm-param class-string $className + * + * @return T + */ + private static function castIntervalToClass(DateInterval $interval, string $className, array $skip = []): object + { + $mainClass = DateInterval::class; + + if (!is_a($className, $mainClass, true)) { + throw new InvalidCastException("$className is not a sub-class of $mainClass."); + } + + $microseconds = $interval->f; + $instance = self::buildInstance($interval, $className, $skip); + + if ($instance instanceof self) { + $instance->originalInput = $interval; + } + + if ($microseconds) { + $instance->f = $microseconds; + } + + if ($interval instanceof self && is_a($className, self::class, true)) { + self::copyStep($interval, $instance); + } + + self::copyNegativeUnits($interval, $instance); + + return self::withOriginal($instance, $interval); + } + + /** + * @template T of DateInterval + * + * @param DateInterval $interval + * + * @psalm-param class-string $className + * + * @return T + */ + private static function buildInstance( + DateInterval $interval, + string $className, + array $skip = [], + ): object { + $serialization = self::buildSerializationString($interval, $className, $skip); + + return match ($serialization) { + null => new $className(static::getDateIntervalSpec($interval, false, $skip)), + default => unserialize($serialization), + }; + } + + /** + * As demonstrated by rlanvin (https://github.com/rlanvin) in + * https://github.com/briannesbitt/Carbon/issues/3018#issuecomment-2888538438 + * + * Modifying the output of serialize() to change the class name and unserializing + * the tweaked string allows creating new interval instances where the ->days + * property can be set. It's not possible neither with `new` nto with `__set_state`. + * + * It has a non-negligible performance cost, so we'll use this method only if + * $interval->days !== false. + */ + private static function buildSerializationString( + DateInterval $interval, + string $className, + array $skip = [], + ): ?string { + if ($interval->days === false || PHP_VERSION_ID < 8_02_00 || $skip !== []) { + return null; + } + + // De-enhance CarbonInterval objects to be serializable back to DateInterval + if ($interval instanceof self && !is_a($className, self::class, true)) { + $interval = clone $interval; + unset($interval->timezoneSetting); + unset($interval->originalInput); + unset($interval->startDate); + unset($interval->endDate); + unset($interval->rawInterval); + unset($interval->absolute); + unset($interval->initialValues); + unset($interval->clock); + unset($interval->step); + unset($interval->localMonthsOverflow); + unset($interval->localYearsOverflow); + unset($interval->localStrictModeEnabled); + unset($interval->localHumanDiffOptions); + unset($interval->localToStringFormat); + unset($interval->localSerializer); + unset($interval->localMacros); + unset($interval->localGenericMacros); + unset($interval->localFormatFunction); + unset($interval->localTranslator); + } + + $serialization = serialize($interval); + $inputClass = $interval::class; + $expectedStart = 'O:'.\strlen($inputClass).':"'.$inputClass.'":'; + + if (!str_starts_with($serialization, $expectedStart)) { + return null; // @codeCoverageIgnore + } + + return 'O:'.\strlen($className).':"'.$className.'":'.substr($serialization, \strlen($expectedStart)); + } + + private static function copyStep(self $from, self $to): void + { + $to->setStep($from->getStep()); + } + + private static function copyNegativeUnits(DateInterval $from, DateInterval $to): void + { + $to->invert = $from->invert; + + foreach (['y', 'm', 'd', 'h', 'i', 's'] as $unit) { + if ($from->$unit < 0) { + self::setIntervalUnit($to, $unit, $to->$unit * self::NEGATIVE); + } + } + } + + private function invertCascade(array $values): static + { + return $this->set(array_map(function ($value) { + return -$value; + }, $values))->doCascade(true)->invert(); + } + + private function doCascade(bool $deep): static + { + $originalData = $this->toArray(); + $originalData['milliseconds'] = (int) ($originalData['microseconds'] / static::getMicrosecondsPerMillisecond()); + $originalData['microseconds'] = $originalData['microseconds'] % static::getMicrosecondsPerMillisecond(); + $originalData['weeks'] = (int) ($this->d / static::getDaysPerWeek()); + $originalData['daysExcludeWeeks'] = fmod($this->d, static::getDaysPerWeek()); + unset($originalData['days']); + $newData = $originalData; + $previous = []; + + foreach (self::getFlipCascadeFactors() as $source => [$target, $factor]) { + foreach (['source', 'target'] as $key) { + if ($$key === 'dayz') { + $$key = 'daysExcludeWeeks'; + } + } + + $value = $newData[$source]; + $modulo = fmod($factor + fmod($value, $factor), $factor); + $newData[$source] = $modulo; + $newData[$target] += ($value - $modulo) / $factor; + + $decimalPart = fmod($newData[$source], 1); + + if ($decimalPart !== 0.0) { + $unit = $source; + + foreach ($previous as [$subUnit, $subFactor]) { + $newData[$unit] -= $decimalPart; + $newData[$subUnit] += $decimalPart * $subFactor; + $decimalPart = fmod($newData[$subUnit], 1); + + if ($decimalPart === 0.0) { + break; + } + + $unit = $subUnit; + } + } + + array_unshift($previous, [$source, $factor]); + } + + $positive = null; + + if (!$deep) { + foreach ($newData as $value) { + if ($value) { + if ($positive === null) { + $positive = ($value > 0); + + continue; + } + + if (($value > 0) !== $positive) { + return $this->invertCascade($originalData) + ->solveNegativeInterval(); + } + } + } + } + + return $this->set($newData) + ->solveNegativeInterval(); + } + + private function needsDeclension(string $mode, int $index, int $parts): bool + { + return match ($mode) { + 'last' => $index === $parts - 1, + default => true, + }; + } + + private function checkIntegerValue(string $name, mixed $value): void + { + if (\is_int($value)) { + return; + } + + $this->assertSafeForInteger($name, $value); + + if (\is_float($value) && (((float) (int) $value) === $value)) { + return; + } + + if (!self::$floatSettersEnabled) { + $type = \gettype($value); + @trigger_error( + "Since 2.70.0, it's deprecated to pass $type value for $name.\n". + "It's truncated when stored as an integer interval unit.\n". + "From 3.0.0, decimal part will no longer be truncated and will be cascaded to smaller units.\n". + "- To maintain the current behavior, use explicit cast: $name((int) \$value)\n". + "- To adopt the new behavior globally, call CarbonInterval::enableFloatSetters()\n", + \E_USER_DEPRECATED, + ); + } + } + + /** + * Throw an exception if precision loss when storing the given value as an integer would be >= 1.0. + */ + private function assertSafeForInteger(string $name, mixed $value): void + { + if ($value && !\is_int($value) && ($value >= 0x7fffffffffffffff || $value <= -0x7fffffffffffffff)) { + throw new OutOfRangeException($name, -0x7fffffffffffffff, 0x7fffffffffffffff, $value); + } + } + + private function handleDecimalPart(string $unit, mixed $value, mixed $integerValue): void + { + if (self::$floatSettersEnabled) { + $floatValue = (float) $value; + $base = (float) $integerValue; + + if ($floatValue === $base) { + return; + } + + $units = [ + 'y' => 'year', + 'm' => 'month', + 'd' => 'day', + 'h' => 'hour', + 'i' => 'minute', + 's' => 'second', + ]; + $upper = true; + + foreach ($units as $property => $name) { + if ($name === $unit) { + $upper = false; + + continue; + } + + if (!$upper && $this->$property !== 0) { + throw new RuntimeException( + "You cannot set $unit to a float value as $name would be overridden, ". + 'set it first to 0 explicitly if you really want to erase its value' + ); + } + } + + $this->add($unit, $floatValue - $base); + } + } + + private function getInnerValues(): array + { + return [$this->y, $this->m, $this->d, $this->h, $this->i, $this->s, $this->f, $this->invert, $this->days]; + } + + private function checkStartAndEnd(): void + { + if ( + $this->initialValues !== null + && ($this->startDate !== null || $this->endDate !== null) + && $this->initialValues !== $this->getInnerValues() + ) { + $this->absolute = false; + $this->startDate = null; + $this->endDate = null; + $this->rawInterval = null; + } + } + + /** @return $this */ + private function setSetting(string $setting, mixed $value): self + { + switch ($setting) { + case 'timezoneSetting': + return $value === null ? $this : $this->setTimezone($value); + + case 'step': + $this->setStep($value); + + return $this; + + case 'localMonthsOverflow': + return $value === null ? $this : $this->settings(['monthOverflow' => $value]); + + case 'localYearsOverflow': + return $value === null ? $this : $this->settings(['yearOverflow' => $value]); + + case 'localStrictModeEnabled': + case 'localHumanDiffOptions': + case 'localToStringFormat': + case 'localSerializer': + case 'localMacros': + case 'localGenericMacros': + case 'localFormatFunction': + case 'localTranslator': + $this->$setting = $value; + + return $this; + + default: + // Drop unknown settings + return $this; + } + } + + private static function incrementUnit(DateInterval $instance, string $unit, int $value): void + { + if ($value === 0) { + return; + } + + // @codeCoverageIgnoreStart + if (PHP_VERSION_ID !== 8_03_20) { + $instance->$unit += $value; + + return; + } + + // Cannot use +=, nor set to a negative value directly as it segfaults in PHP 8.3.20 + self::setIntervalUnit($instance, $unit, ($instance->$unit ?? 0) + $value); + // @codeCoverageIgnoreEnd + } + + /** @codeCoverageIgnore */ + private static function setIntervalUnit(DateInterval $instance, string $unit, mixed $value): void + { + switch ($unit) { + case 'y': + $instance->y = $value; + + break; + + case 'm': + $instance->m = $value; + + break; + + case 'd': + $instance->d = $value; + + break; + + case 'h': + $instance->h = $value; + + break; + + case 'i': + $instance->i = $value; + + break; + + case 's': + $instance->s = $value; + + break; + + default: + $instance->$unit = $value; + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php new file mode 100644 index 00000000..7ae64ebf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriod.php @@ -0,0 +1,2717 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\EndLessPeriodException; +use Carbon\Exceptions\InvalidCastException; +use Carbon\Exceptions\InvalidIntervalException; +use Carbon\Exceptions\InvalidPeriodDateException; +use Carbon\Exceptions\InvalidPeriodParameterException; +use Carbon\Exceptions\NotACarbonClassException; +use Carbon\Exceptions\NotAPeriodException; +use Carbon\Exceptions\UnknownGetterException; +use Carbon\Exceptions\UnknownMethodException; +use Carbon\Exceptions\UnreachableException; +use Carbon\Traits\DeprecatedPeriodProperties; +use Carbon\Traits\IntervalRounding; +use Carbon\Traits\LocalFactory; +use Carbon\Traits\Mixin; +use Carbon\Traits\Options; +use Carbon\Traits\ToStringFormat; +use Closure; +use Countable; +use DateInterval; +use DatePeriod; +use DateTime; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use Generator; +use InvalidArgumentException; +use JsonSerializable; +use ReflectionException; +use ReturnTypeWillChange; +use RuntimeException; +use Throwable; + +// @codeCoverageIgnoreStart +require PHP_VERSION < 8.2 + ? __DIR__.'/../../lazy/Carbon/ProtectedDatePeriod.php' + : __DIR__.'/../../lazy/Carbon/UnprotectedDatePeriod.php'; +// @codeCoverageIgnoreEnd + +/** + * Substitution of DatePeriod with some modifications and many more features. + * + * @method static static|CarbonInterface start($date = null, $inclusive = null) Create instance specifying start date or modify the start date if called on an instance. + * @method static static since($date = null, $inclusive = null) Alias for start(). + * @method static static sinceNow($inclusive = null) Create instance with start date set to now or set the start date to now if called on an instance. + * @method static static|CarbonInterface end($date = null, $inclusive = null) Create instance specifying end date or modify the end date if called on an instance. + * @method static static until($date = null, $inclusive = null) Alias for end(). + * @method static static untilNow($inclusive = null) Create instance with end date set to now or set the end date to now if called on an instance. + * @method static static dates($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. + * @method static static between($start, $end = null) Create instance with start and end dates or modify the start and end dates if called on an instance. + * @method static static recurrences($recurrences = null) Create instance with maximum number of recurrences or modify the number of recurrences if called on an instance. + * @method static static times($recurrences = null) Alias for recurrences(). + * @method static static|int|null options($options = null) Create instance with options or modify the options if called on an instance. + * @method static static toggle($options, $state = null) Create instance with options toggled on or off, or toggle options if called on an instance. + * @method static static filter($callback, $name = null) Create instance with filter added to the stack or append a filter if called on an instance. + * @method static static push($callback, $name = null) Alias for filter(). + * @method static static prepend($callback, $name = null) Create instance with filter prepended to the stack or prepend a filter if called on an instance. + * @method static static|array filters(array $filters = []) Create instance with filters stack or replace the whole filters stack if called on an instance. + * @method static static|CarbonInterval interval($interval = null) Create instance with given date interval or modify the interval if called on an instance. + * @method static static each($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static every($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static step($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static stepBy($interval) Create instance with given date interval or modify the interval if called on an instance. + * @method static static invert() Create instance with inverted date interval or invert the interval if called on an instance. + * @method static static years($years = 1) Create instance specifying a number of years for date interval or replace the interval by the given a number of years if called on an instance. + * @method static static year($years = 1) Alias for years(). + * @method static static months($months = 1) Create instance specifying a number of months for date interval or replace the interval by the given a number of months if called on an instance. + * @method static static month($months = 1) Alias for months(). + * @method static static weeks($weeks = 1) Create instance specifying a number of weeks for date interval or replace the interval by the given a number of weeks if called on an instance. + * @method static static week($weeks = 1) Alias for weeks(). + * @method static static days($days = 1) Create instance specifying a number of days for date interval or replace the interval by the given a number of days if called on an instance. + * @method static static dayz($days = 1) Alias for days(). + * @method static static day($days = 1) Alias for days(). + * @method static static hours($hours = 1) Create instance specifying a number of hours for date interval or replace the interval by the given a number of hours if called on an instance. + * @method static static hour($hours = 1) Alias for hours(). + * @method static static minutes($minutes = 1) Create instance specifying a number of minutes for date interval or replace the interval by the given a number of minutes if called on an instance. + * @method static static minute($minutes = 1) Alias for minutes(). + * @method static static seconds($seconds = 1) Create instance specifying a number of seconds for date interval or replace the interval by the given a number of seconds if called on an instance. + * @method static static second($seconds = 1) Alias for seconds(). + * @method static static milliseconds($milliseconds = 1) Create instance specifying a number of milliseconds for date interval or replace the interval by the given a number of milliseconds if called on an instance. + * @method static static millisecond($milliseconds = 1) Alias for milliseconds(). + * @method static static microseconds($microseconds = 1) Create instance specifying a number of microseconds for date interval or replace the interval by the given a number of microseconds if called on an instance. + * @method static static microsecond($microseconds = 1) Alias for microseconds(). + * @method $this roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method $this floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method $this floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method $this ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method $this ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method $this roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method $this floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method $this floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method $this ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method $this ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method $this roundWeek(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundWeeks(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorWeek(float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorWeeks(float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilWeek(float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilWeeks(float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method $this floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method $this floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method $this ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method $this ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method $this roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method $this floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method $this ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method $this roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method $this floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method $this ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method $this roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method $this floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method $this floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method $this ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method $this ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method $this roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method $this floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method $this ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method $this roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method $this floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method $this floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method $this ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method $this ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method $this roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method $this floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method $this ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method $this roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method $this floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method $this ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method $this roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method $this floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method $this ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method $this roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method $this floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method $this ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method $this ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * + * @mixin DeprecatedPeriodProperties + * + * @SuppressWarnings(TooManyFields) + * @SuppressWarnings(CamelCasePropertyName) + * @SuppressWarnings(CouplingBetweenObjects) + */ +class CarbonPeriod extends DatePeriodBase implements Countable, JsonSerializable +{ + use LocalFactory; + use IntervalRounding; + use Mixin { + Mixin::mixin as baseMixin; + } + use Options { + Options::__debugInfo as baseDebugInfo; + } + use ToStringFormat; + + /** + * Built-in filter for limit by recurrences. + * + * @var callable + */ + public const RECURRENCES_FILTER = [self::class, 'filterRecurrences']; + + /** + * Built-in filter for limit to an end. + * + * @var callable + */ + public const END_DATE_FILTER = [self::class, 'filterEndDate']; + + /** + * Special value which can be returned by filters to end iteration. Also a filter. + * + * @var callable + */ + public const END_ITERATION = [self::class, 'endIteration']; + + /** + * Exclude end date from iteration. + * + * @var int + */ + public const EXCLUDE_END_DATE = 8; + + /** + * Yield CarbonImmutable instances. + * + * @var int + */ + public const IMMUTABLE = 4; + + /** + * Number of maximum attempts before giving up on finding next valid date. + * + * @var int + */ + public const NEXT_MAX_ATTEMPTS = 1000; + + /** + * Number of maximum attempts before giving up on finding end date. + * + * @var int + */ + public const END_MAX_ATTEMPTS = 10000; + + /** + * Default date class of iteration items. + * + * @var string + */ + protected const DEFAULT_DATE_CLASS = Carbon::class; + + /** + * The registered macros. + */ + protected static array $macros = []; + + /** + * Date class of iteration items. + */ + protected string $dateClass = Carbon::class; + + /** + * Underlying date interval instance. Always present, one day by default. + */ + protected ?CarbonInterval $dateInterval = null; + + /** + * True once __construct is finished. + */ + protected bool $constructed = false; + + /** + * Whether current date interval was set by default. + */ + protected bool $isDefaultInterval = false; + + /** + * The filters stack. + */ + protected array $filters = []; + + /** + * Period start date. Applied on rewind. Always present, now by default. + */ + protected ?CarbonInterface $startDate = null; + + /** + * Period end date. For inverted interval should be before the start date. Applied via a filter. + */ + protected ?CarbonInterface $endDate = null; + + /** + * Limit for number of recurrences. Applied via a filter. + */ + protected int|float|null $carbonRecurrences = null; + + /** + * Iteration options. + */ + protected ?int $options = null; + + /** + * Index of current date. Always sequential, even if some dates are skipped by filters. + * Equal to null only before the first iteration. + */ + protected int $key = 0; + + /** + * Current date. May temporarily hold unaccepted value when looking for a next valid date. + * Equal to null only before the first iteration. + */ + protected ?CarbonInterface $carbonCurrent = null; + + /** + * Timezone of current date. Taken from the start date. + */ + protected ?DateTimeZone $timezone = null; + + /** + * The cached validation result for current date. + */ + protected array|string|bool|null $validationResult = null; + + /** + * Timezone handler for settings() method. + */ + protected DateTimeZone|string|int|null $timezoneSetting = null; + + public function getIterator(): Generator + { + $this->rewind(); + + while ($this->valid()) { + $key = $this->key(); + $value = $this->current(); + + yield $key => $value; + + $this->next(); + } + } + + /** + * Make a CarbonPeriod instance from given variable if possible. + */ + public static function make(mixed $var): ?static + { + try { + return static::instance($var); + } catch (NotAPeriodException) { + return static::create($var); + } + } + + /** + * Create a new instance from a DatePeriod or CarbonPeriod object. + */ + public static function instance(mixed $period): static + { + if ($period instanceof static) { + return $period->copy(); + } + + if ($period instanceof self) { + return new static( + $period->getStartDate(), + $period->getEndDate() ?? $period->getRecurrences(), + $period->getDateInterval(), + $period->getOptions(), + ); + } + + if ($period instanceof DatePeriod) { + return new static( + $period->start, + $period->end ?: ($period->recurrences - 1), + $period->interval, + $period->include_start_date ? 0 : static::EXCLUDE_START_DATE, + ); + } + + $class = static::class; + $type = \gettype($period); + $chunks = explode('::', __METHOD__); + + throw new NotAPeriodException( + 'Argument 1 passed to '.$class.'::'.end($chunks).'() '. + 'must be an instance of DatePeriod or '.$class.', '. + ($type === 'object' ? 'instance of '.\get_class($period) : $type).' given.', + ); + } + + /** + * Create a new instance. + */ + public static function create(...$params): static + { + return static::createFromArray($params); + } + + /** + * Create a new instance from an array of parameters. + */ + public static function createFromArray(array $params): static + { + return new static(...$params); + } + + /** + * Create CarbonPeriod from ISO 8601 string. + */ + public static function createFromIso(string $iso, ?int $options = null): static + { + $params = static::parseIso8601($iso); + + $instance = static::createFromArray($params); + + $instance->options = ($instance instanceof CarbonPeriodImmutable ? static::IMMUTABLE : 0) | $options; + $instance->handleChangedParameters(); + + return $instance; + } + + public static function createFromISO8601String(string $iso, ?int $options = null): static + { + return self::createFromIso($iso, $options); + } + + /** + * Return whether the given interval contains non-zero value of any time unit. + */ + protected static function intervalHasTime(DateInterval $interval): bool + { + return $interval->h || $interval->i || $interval->s || $interval->f; + } + + /** + * Return whether given variable is an ISO 8601 specification. + * + * Note: Check is very basic, as actual validation will be done later when parsing. + * We just want to ensure that variable is not any other type of valid parameter. + */ + protected static function isIso8601(mixed $var): bool + { + if (!\is_string($var)) { + return false; + } + + // Match slash but not within a timezone name. + $part = '[a-z]+(?:[_-][a-z]+)*'; + + preg_match("#\b$part/$part\b|(/)#i", $var, $match); + + return isset($match[1]); + } + + /** + * Parse given ISO 8601 string into an array of arguments. + * + * @SuppressWarnings(ElseExpression) + */ + protected static function parseIso8601(string $iso): array + { + $result = []; + + $interval = null; + $start = null; + $end = null; + $dateClass = static::DEFAULT_DATE_CLASS; + + foreach (explode('/', $iso) as $key => $part) { + if ($key === 0 && preg_match('/^R(\d*|INF)$/', $part, $match)) { + $parsed = \strlen($match[1]) ? (($match[1] !== 'INF') ? (int) $match[1] : INF) : null; + } elseif ($interval === null && $parsed = self::makeInterval($part)) { + $interval = $part; + } elseif ($start === null && $parsed = $dateClass::make($part)) { + $start = $part; + } elseif ($end === null && $parsed = $dateClass::make(static::addMissingParts($start ?? '', $part))) { + $end = $part; + } else { + throw new InvalidPeriodParameterException("Invalid ISO 8601 specification: $iso."); + } + + $result[] = $parsed; + } + + return $result; + } + + /** + * Add missing parts of the target date from the source date. + */ + protected static function addMissingParts(string $source, string $target): string + { + $pattern = '/'.preg_replace('/\d+/', '[0-9]+', preg_quote($target, '/')).'$/'; + + $result = preg_replace($pattern, $target, $source, 1, $count); + + return $count ? $result : $target; + } + + private static function makeInterval(mixed $input): ?CarbonInterval + { + try { + return CarbonInterval::make($input); + } catch (Throwable) { + return null; + } + } + + private static function makeTimezone(mixed $input): ?CarbonTimeZone + { + if (!\is_string($input)) { + return null; + } + + try { + return CarbonTimeZone::create($input); + } catch (Throwable) { + return null; + } + } + + /** + * Register a custom macro. + * + * Pass null macro to remove it. + * + * @example + * ``` + * CarbonPeriod::macro('middle', function () { + * return $this->getStartDate()->average($this->getEndDate()); + * }); + * echo CarbonPeriod::since('2011-05-12')->until('2011-06-03')->middle(); + * ``` + * + * @param-closure-this static $macro + */ + public static function macro(string $name, ?callable $macro): void + { + static::$macros[$name] = $macro; + } + + /** + * Register macros from a mixin object. + * + * @example + * ``` + * CarbonPeriod::mixin(new class { + * public function addDays() { + * return function ($count = 1) { + * return $this->setStartDate( + * $this->getStartDate()->addDays($count) + * )->setEndDate( + * $this->getEndDate()->addDays($count) + * ); + * }; + * } + * public function subDays() { + * return function ($count = 1) { + * return $this->setStartDate( + * $this->getStartDate()->subDays($count) + * )->setEndDate( + * $this->getEndDate()->subDays($count) + * ); + * }; + * } + * }); + * echo CarbonPeriod::create('2000-01-01', '2000-02-01')->addDays(5)->subDays(3); + * ``` + * + * @throws ReflectionException + */ + public static function mixin(object|string $mixin): void + { + static::baseMixin($mixin); + } + + /** + * Check if macro is registered. + */ + public static function hasMacro(string $name): bool + { + return isset(static::$macros[$name]); + } + + /** + * Provide static proxy for instance aliases. + */ + public static function __callStatic(string $method, array $parameters): mixed + { + $date = new static(); + + if (static::hasMacro($method)) { + return static::bindMacroContext(null, static fn () => $date->callMacro($method, $parameters)); + } + + return $date->$method(...$parameters); + } + + /** + * CarbonPeriod constructor. + * + * @SuppressWarnings(ElseExpression) + * + * @throws InvalidArgumentException + */ + public function __construct(...$arguments) + { + $raw = null; + + if (isset($arguments['raw'])) { + $raw = $arguments['raw']; + $this->isDefaultInterval = $arguments['isDefaultInterval'] ?? false; + + if (isset($arguments['dateClass'])) { + $this->dateClass = $arguments['dateClass']; + } + + $arguments = $raw; + } + + // Parse and assign arguments one by one. First argument may be an ISO 8601 spec, + // which will be first parsed into parts and then processed the same way. + + $argumentsCount = \count($arguments); + + if ($argumentsCount && static::isIso8601($iso = $arguments[0])) { + array_splice($arguments, 0, 1, static::parseIso8601($iso)); + } + + if ($argumentsCount === 1) { + if ($arguments[0] instanceof self) { + $arguments = [ + $arguments[0]->getStartDate(), + $arguments[0]->getEndDate() ?? $arguments[0]->getRecurrences(), + $arguments[0]->getDateInterval(), + $arguments[0]->getOptions(), + ]; + } elseif ($arguments[0] instanceof DatePeriod) { + $arguments = [ + $arguments[0]->start, + $arguments[0]->end ?: ($arguments[0]->recurrences - 1), + $arguments[0]->interval, + $arguments[0]->include_start_date ? 0 : static::EXCLUDE_START_DATE, + ]; + } + } + + if (is_a($this->dateClass, DateTimeImmutable::class, true)) { + $this->options = static::IMMUTABLE; + } + + $optionsSet = false; + $originalArguments = []; + $sortedArguments = []; + + foreach ($arguments as $argument) { + $parsedDate = null; + + if ($argument instanceof DateTimeZone) { + $sortedArguments = $this->configureTimezone($argument, $sortedArguments, $originalArguments); + } elseif (!isset($sortedArguments['interval']) && + ( + (\is_string($argument) && preg_match( + '/^(-?\d(\d(?![\/-])|[^\d\/-]([\/-])?)*|P[T\d].*|(?:\h*\d+(?:\.\d+)?\h*[a-z]+)+)$/i', + $argument, + )) || + $argument instanceof DateInterval || + $argument instanceof Closure || + $argument instanceof Unit + ) && + $parsedInterval = self::makeInterval($argument) + ) { + $sortedArguments['interval'] = $parsedInterval; + } elseif (!isset($sortedArguments['start']) && $parsedDate = $this->makeDateTime($argument)) { + $sortedArguments['start'] = $parsedDate; + $originalArguments['start'] = $argument; + } elseif (!isset($sortedArguments['end']) && ($parsedDate = $parsedDate ?? $this->makeDateTime($argument))) { + $sortedArguments['end'] = $parsedDate; + $originalArguments['end'] = $argument; + } elseif (!isset($sortedArguments['recurrences']) && + !isset($sortedArguments['end']) && + (\is_int($argument) || \is_float($argument)) + && $argument >= 0 + ) { + $sortedArguments['recurrences'] = $argument; + } elseif (!$optionsSet && (\is_int($argument) || $argument === null)) { + $optionsSet = true; + $sortedArguments['options'] = (((int) $this->options) | ((int) $argument)); + } elseif ($parsedTimezone = self::makeTimezone($argument)) { + $sortedArguments = $this->configureTimezone($parsedTimezone, $sortedArguments, $originalArguments); + } else { + throw new InvalidPeriodParameterException('Invalid constructor parameters.'); + } + } + + if ($raw === null && isset($sortedArguments['start'])) { + $end = $sortedArguments['end'] ?? max(1, $sortedArguments['recurrences'] ?? 1); + + if (\is_float($end)) { + $end = $end === INF ? PHP_INT_MAX : (int) round($end); + } + + $raw = [ + $sortedArguments['start'], + $sortedArguments['interval'] ?? CarbonInterval::day(), + $end, + ]; + } + + $this->setFromAssociativeArray($sortedArguments); + + if ($this->startDate === null) { + $dateClass = $this->dateClass; + $this->setStartDate($dateClass::now()); + } + + if ($this->dateInterval === null) { + $this->setDateInterval(CarbonInterval::day()); + + $this->isDefaultInterval = true; + } + + if ($this->options === null) { + $this->setOptions(0); + } + + parent::__construct( + $this->startDate, + $this->dateInterval, + $this->endDate ?? max(1, min(2147483639, $this->recurrences ?? 1)), + $this->options, + ); + + $this->constructed = true; + } + + /** + * Get a copy of the instance. + */ + public function copy(): static + { + return clone $this; + } + + /** + * Prepare the instance to be set (self if mutable to be mutated, + * copy if immutable to generate a new instance). + */ + protected function copyIfImmutable(): static + { + return $this; + } + + /** + * Get the getter for a property allowing both `DatePeriod` snakeCase and camelCase names. + */ + protected function getGetter(string $name): ?callable + { + return match (strtolower(preg_replace('/[A-Z]/', '_$0', $name))) { + 'start', 'start_date' => [$this, 'getStartDate'], + 'end', 'end_date' => [$this, 'getEndDate'], + 'interval', 'date_interval' => [$this, 'getDateInterval'], + 'recurrences' => [$this, 'getRecurrences'], + 'include_start_date' => [$this, 'isStartIncluded'], + 'include_end_date' => [$this, 'isEndIncluded'], + 'current' => [$this, 'current'], + 'locale' => [$this, 'locale'], + 'tzname', 'tz_name' => fn () => match (true) { + $this->timezoneSetting === null => null, + \is_string($this->timezoneSetting) => $this->timezoneSetting, + $this->timezoneSetting instanceof DateTimeZone => $this->timezoneSetting->getName(), + default => CarbonTimeZone::instance($this->timezoneSetting)->getName(), + }, + default => null, + }; + } + + /** + * Get a property allowing both `DatePeriod` snakeCase and camelCase names. + * + * @param string $name + * + * @return bool|CarbonInterface|CarbonInterval|int|null + */ + public function get(string $name) + { + $getter = $this->getGetter($name); + + if ($getter) { + return $getter(); + } + + throw new UnknownGetterException($name); + } + + /** + * Get a property allowing both `DatePeriod` snakeCase and camelCase names. + * + * @param string $name + * + * @return bool|CarbonInterface|CarbonInterval|int|null + */ + public function __get(string $name) + { + return $this->get($name); + } + + /** + * Check if an attribute exists on the object + * + * @param string $name + * + * @return bool + */ + public function __isset(string $name): bool + { + return $this->getGetter($name) !== null; + } + + /** + * @alias copy + * + * Get a copy of the instance. + * + * @return static + */ + public function clone() + { + return clone $this; + } + + /** + * Set the iteration item class. + * + * @param string $dateClass + * + * @return static + */ + public function setDateClass(string $dateClass) + { + if (!is_a($dateClass, CarbonInterface::class, true)) { + throw new NotACarbonClassException($dateClass); + } + + $self = $this->copyIfImmutable(); + $self->dateClass = $dateClass; + + if (is_a($dateClass, Carbon::class, true)) { + $self->options = $self->options & ~static::IMMUTABLE; + } elseif (is_a($dateClass, CarbonImmutable::class, true)) { + $self->options = $self->options | static::IMMUTABLE; + } + + return $self; + } + + /** + * Returns iteration item date class. + * + * @return string + */ + public function getDateClass(): string + { + return $this->dateClass; + } + + /** + * Change the period date interval. + * + * @param DateInterval|Unit|string|int $interval + * @param Unit|string $unit the unit of $interval if it's a number + * + * @throws InvalidIntervalException + * + * @return static + */ + public function setDateInterval(mixed $interval, Unit|string|null $unit = null): static + { + if ($interval instanceof Unit) { + $interval = $interval->interval(); + } + + if ($unit instanceof Unit) { + $unit = $unit->name; + } + + if (!$interval = CarbonInterval::make($interval, $unit)) { + throw new InvalidIntervalException('Invalid interval.'); + } + + if ($interval->spec() === 'PT0S' && !$interval->f && !$interval->getStep()) { + throw new InvalidIntervalException('Empty interval is not accepted.'); + } + + $self = $this->copyIfImmutable(); + $self->dateInterval = $interval; + + $self->isDefaultInterval = false; + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Reset the date interval to the default value. + * + * Difference with simply setting interval to 1-day is that P1D will not appear when calling toIso8601String() + * and also next adding to the interval won't include the default 1-day. + */ + public function resetDateInterval(): static + { + $self = $this->copyIfImmutable(); + $self->setDateInterval(CarbonInterval::day()); + + $self->isDefaultInterval = true; + + return $self; + } + + /** + * Invert the period date interval. + */ + public function invertDateInterval(): static + { + return $this->setDateInterval($this->dateInterval->invert()); + } + + /** + * Set start and end date. + * + * @param DateTime|DateTimeInterface|string $start + * @param DateTime|DateTimeInterface|string|null $end + * + * @return static + */ + public function setDates(mixed $start, mixed $end): static + { + return $this->setStartDate($start)->setEndDate($end); + } + + /** + * Change the period options. + * + * @param int|null $options + * + * @return static + */ + public function setOptions(?int $options): static + { + $self = $this->copyIfImmutable(); + $self->options = $options ?? 0; + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Get the period options. + */ + public function getOptions(): int + { + return $this->options ?? 0; + } + + /** + * Toggle given options on or off. + * + * @param int $options + * @param bool|null $state + * + * @throws InvalidArgumentException + * + * @return static + */ + public function toggleOptions(int $options, ?bool $state = null): static + { + $self = $this->copyIfImmutable(); + + if ($state === null) { + $state = ($this->options & $options) !== $options; + } + + return $self->setOptions( + $state ? + $this->options | $options : + $this->options & ~$options, + ); + } + + /** + * Toggle EXCLUDE_START_DATE option. + */ + public function excludeStartDate(bool $state = true): static + { + return $this->toggleOptions(static::EXCLUDE_START_DATE, $state); + } + + /** + * Toggle EXCLUDE_END_DATE option. + */ + public function excludeEndDate(bool $state = true): static + { + return $this->toggleOptions(static::EXCLUDE_END_DATE, $state); + } + + /** + * Get the underlying date interval. + */ + public function getDateInterval(): CarbonInterval + { + return $this->dateInterval->copy(); + } + + /** + * Get start date of the period. + * + * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. + */ + public function getStartDate(?string $rounding = null): CarbonInterface + { + $date = $this->startDate->avoidMutation(); + + return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; + } + + /** + * Get end date of the period. + * + * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. + */ + public function getEndDate(?string $rounding = null): ?CarbonInterface + { + if (!$this->endDate) { + return null; + } + + $date = $this->endDate->avoidMutation(); + + return $rounding ? $date->round($this->getDateInterval(), $rounding) : $date; + } + + /** + * Get number of recurrences. + */ + #[ReturnTypeWillChange] + public function getRecurrences(): int|float|null + { + return $this->carbonRecurrences; + } + + /** + * Returns true if the start date should be excluded. + */ + public function isStartExcluded(): bool + { + return ($this->options & static::EXCLUDE_START_DATE) !== 0; + } + + /** + * Returns true if the end date should be excluded. + */ + public function isEndExcluded(): bool + { + return ($this->options & static::EXCLUDE_END_DATE) !== 0; + } + + /** + * Returns true if the start date should be included. + */ + public function isStartIncluded(): bool + { + return !$this->isStartExcluded(); + } + + /** + * Returns true if the end date should be included. + */ + public function isEndIncluded(): bool + { + return !$this->isEndExcluded(); + } + + /** + * Return the start if it's included by option, else return the start + 1 period interval. + */ + public function getIncludedStartDate(): CarbonInterface + { + $start = $this->getStartDate(); + + if ($this->isStartExcluded()) { + return $start->add($this->getDateInterval()); + } + + return $start; + } + + /** + * Return the end if it's included by option, else return the end - 1 period interval. + * Warning: if the period has no fixed end, this method will iterate the period to calculate it. + */ + public function getIncludedEndDate(): CarbonInterface + { + $end = $this->getEndDate(); + + if (!$end) { + return $this->calculateEnd(); + } + + if ($this->isEndExcluded()) { + return $end->sub($this->getDateInterval()); + } + + return $end; + } + + /** + * Add a filter to the stack. + * + * @SuppressWarnings(UnusedFormalParameter) + */ + public function addFilter(callable|string $callback, ?string $name = null): static + { + $self = $this->copyIfImmutable(); + $tuple = $self->createFilterTuple(\func_get_args()); + + $self->filters[] = $tuple; + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Prepend a filter to the stack. + * + * @SuppressWarnings(UnusedFormalParameter) + */ + public function prependFilter(callable|string $callback, ?string $name = null): static + { + $self = $this->copyIfImmutable(); + $tuple = $self->createFilterTuple(\func_get_args()); + + array_unshift($self->filters, $tuple); + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Remove a filter by instance or name. + */ + public function removeFilter(callable|string $filter): static + { + $self = $this->copyIfImmutable(); + $key = \is_callable($filter) ? 0 : 1; + + $self->filters = array_values(array_filter( + $this->filters, + static fn ($tuple) => $tuple[$key] !== $filter, + )); + + $self->updateInternalState(); + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Return whether given instance or name is in the filter stack. + */ + public function hasFilter(callable|string $filter): bool + { + $key = \is_callable($filter) ? 0 : 1; + + foreach ($this->filters as $tuple) { + if ($tuple[$key] === $filter) { + return true; + } + } + + return false; + } + + /** + * Get filters stack. + */ + public function getFilters(): array + { + return $this->filters; + } + + /** + * Set filters stack. + */ + public function setFilters(array $filters): static + { + $self = $this->copyIfImmutable(); + $self->filters = $filters; + + $self->updateInternalState(); + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Reset filters stack. + */ + public function resetFilters(): static + { + $self = $this->copyIfImmutable(); + $self->filters = []; + + if ($self->endDate !== null) { + $self->filters[] = [static::END_DATE_FILTER, null]; + } + + if ($self->carbonRecurrences !== null) { + $self->filters[] = [static::RECURRENCES_FILTER, null]; + } + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Add a recurrences filter (set maximum number of recurrences). + * + * @throws InvalidArgumentException + */ + public function setRecurrences(int|float|null $recurrences): static + { + if ($recurrences === null) { + return $this->removeFilter(static::RECURRENCES_FILTER); + } + + if ($recurrences < 0) { + throw new InvalidPeriodParameterException('Invalid number of recurrences.'); + } + + /** @var self $self */ + $self = $this->copyIfImmutable(); + $self->carbonRecurrences = $recurrences === INF ? INF : (int) $recurrences; + + if (!$self->hasFilter(static::RECURRENCES_FILTER)) { + return $self->addFilter(static::RECURRENCES_FILTER); + } + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Change the period start date. + * + * @param DateTime|DateTimeInterface|string $date + * @param bool|null $inclusive + * + * @throws InvalidPeriodDateException + * + * @return static + */ + public function setStartDate(mixed $date, ?bool $inclusive = null): static + { + if (!$this->isInfiniteDate($date) && !($date = ([$this->dateClass, 'make'])($date, $this->timezone))) { + throw new InvalidPeriodDateException('Invalid start date.'); + } + + $self = $this->copyIfImmutable(); + $self->startDate = $date; + + if ($inclusive !== null) { + $self = $self->toggleOptions(static::EXCLUDE_START_DATE, !$inclusive); + } + + return $self; + } + + /** + * Change the period end date. + * + * @param DateTime|DateTimeInterface|string|null $date + * @param bool|null $inclusive + * + * @throws \InvalidArgumentException + * + * @return static + */ + public function setEndDate(mixed $date, ?bool $inclusive = null): static + { + if ($date !== null && !$this->isInfiniteDate($date) && !$date = ([$this->dateClass, 'make'])($date, $this->timezone)) { + throw new InvalidPeriodDateException('Invalid end date.'); + } + + if (!$date) { + return $this->removeFilter(static::END_DATE_FILTER); + } + + $self = $this->copyIfImmutable(); + $self->endDate = $date; + + if ($inclusive !== null) { + $self = $self->toggleOptions(static::EXCLUDE_END_DATE, !$inclusive); + } + + if (!$self->hasFilter(static::END_DATE_FILTER)) { + return $self->addFilter(static::END_DATE_FILTER); + } + + $self->handleChangedParameters(); + + return $self; + } + + /** + * Check if the current position is valid. + */ + public function valid(): bool + { + return $this->validateCurrentDate() === true; + } + + /** + * Return the current key. + */ + public function key(): ?int + { + return $this->valid() + ? $this->key + : null; + } + + /** + * Return the current date. + */ + public function current(): ?CarbonInterface + { + return $this->valid() + ? $this->prepareForReturn($this->carbonCurrent) + : null; + } + + /** + * Move forward to the next date. + * + * @throws RuntimeException + */ + public function next(): void + { + if ($this->carbonCurrent === null) { + $this->rewind(); + } + + if ($this->validationResult !== static::END_ITERATION) { + $this->key++; + + $this->incrementCurrentDateUntilValid(); + } + } + + /** + * Rewind to the start date. + * + * Iterating over a date in the UTC timezone avoids bug during backward DST change. + * + * @see https://bugs.php.net/bug.php?id=72255 + * @see https://bugs.php.net/bug.php?id=74274 + * @see https://wiki.php.net/rfc/datetime_and_daylight_saving_time + * + * @throws RuntimeException + */ + public function rewind(): void + { + $this->key = 0; + $this->carbonCurrent = ([$this->dateClass, 'make'])($this->startDate); + $settings = $this->getSettings(); + + if ($this->hasLocalTranslator()) { + $settings['locale'] = $this->getTranslatorLocale(); + } + + $this->carbonCurrent->settings($settings); + $this->timezone = static::intervalHasTime($this->dateInterval) ? $this->carbonCurrent->getTimezone() : null; + + if ($this->timezone) { + $this->carbonCurrent = $this->carbonCurrent->utc(); + } + + $this->validationResult = null; + + if ($this->isStartExcluded() || $this->validateCurrentDate() === false) { + $this->incrementCurrentDateUntilValid(); + } + } + + /** + * Skip iterations and returns iteration state (false if ended, true if still valid). + * + * @param int $count steps number to skip (1 by default) + * + * @return bool + */ + public function skip(int $count = 1): bool + { + for ($i = $count; $this->valid() && $i > 0; $i--) { + $this->next(); + } + + return $this->valid(); + } + + /** + * Format the date period as ISO 8601. + */ + public function toIso8601String(): string + { + $parts = []; + + if ($this->carbonRecurrences !== null) { + $parts[] = 'R'.$this->carbonRecurrences; + } + + $parts[] = $this->startDate->toIso8601String(); + + if (!$this->isDefaultInterval) { + $parts[] = $this->dateInterval->spec(); + } + + if ($this->endDate !== null) { + $parts[] = $this->endDate->toIso8601String(); + } + + return implode('/', $parts); + } + + /** + * Convert the date period into a string. + */ + public function toString(): string + { + $format = $this->localToStringFormat + ?? $this->getFactory()->getSettings()['toStringFormat'] + ?? null; + + if ($format instanceof Closure) { + return $format($this); + } + + $translator = ([$this->dateClass, 'getTranslator'])(); + + $parts = []; + + $format = $format ?? ( + !$this->startDate->isStartOfDay() || ($this->endDate && !$this->endDate->isStartOfDay()) + ? 'Y-m-d H:i:s' + : 'Y-m-d' + ); + + if ($this->carbonRecurrences !== null) { + $parts[] = $this->translate('period_recurrences', [], $this->carbonRecurrences, $translator); + } + + $parts[] = $this->translate('period_interval', [':interval' => $this->dateInterval->forHumans([ + 'join' => true, + ])], null, $translator); + + $parts[] = $this->translate('period_start_date', [':date' => $this->startDate->rawFormat($format)], null, $translator); + + if ($this->endDate !== null) { + $parts[] = $this->translate('period_end_date', [':date' => $this->endDate->rawFormat($format)], null, $translator); + } + + $result = implode(' ', $parts); + + return mb_strtoupper(mb_substr($result, 0, 1)).mb_substr($result, 1); + } + + /** + * Format the date period as ISO 8601. + */ + public function spec(): string + { + return $this->toIso8601String(); + } + + /** + * Cast the current instance into the given class. + * + * @param string $className The $className::instance() method will be called to cast the current object. + * + * @return DatePeriod|object + */ + public function cast(string $className): object + { + if (!method_exists($className, 'instance')) { + if (is_a($className, DatePeriod::class, true)) { + return new $className( + $this->rawDate($this->getStartDate()), + $this->getDateInterval(), + $this->getEndDate() ? $this->rawDate($this->getIncludedEndDate()) : $this->getRecurrences(), + $this->isStartExcluded() ? DatePeriod::EXCLUDE_START_DATE : 0, + ); + } + + throw new InvalidCastException("$className has not the instance() method needed to cast the date."); + } + + return $className::instance($this); + } + + /** + * Return native DatePeriod PHP object matching the current instance. + * + * @example + * ``` + * var_dump(CarbonPeriod::create('2021-01-05', '2021-02-15')->toDatePeriod()); + * ``` + */ + public function toDatePeriod(): DatePeriod + { + return $this->cast(DatePeriod::class); + } + + /** + * Return `true` if the period has no custom filter and is guaranteed to be endless. + * + * Note that we can't check if a period is endless as soon as it has custom filters + * because filters can emit `CarbonPeriod::END_ITERATION` to stop the iteration in + * a way we can't predict without actually iterating the period. + */ + public function isUnfilteredAndEndLess(): bool + { + foreach ($this->filters as $filter) { + switch ($filter) { + case [static::RECURRENCES_FILTER, null]: + if ($this->carbonRecurrences !== null && is_finite($this->carbonRecurrences)) { + return false; + } + + break; + + case [static::END_DATE_FILTER, null]: + if ($this->endDate !== null && !$this->endDate->isEndOfTime()) { + return false; + } + + break; + + default: + return false; + } + } + + return true; + } + + /** + * Convert the date period into an array without changing current iteration state. + * + * @return CarbonInterface[] + */ + public function toArray(): array + { + if ($this->isUnfilteredAndEndLess()) { + throw new EndLessPeriodException("Endless period can't be converted to array nor counted."); + } + + $state = [ + $this->key, + $this->carbonCurrent ? $this->carbonCurrent->avoidMutation() : null, + $this->validationResult, + ]; + + $result = iterator_to_array($this); + + [$this->key, $this->carbonCurrent, $this->validationResult] = $state; + + return $result; + } + + /** + * Count dates in the date period. + */ + public function count(): int + { + return \count($this->toArray()); + } + + /** + * Return the first date in the date period. + */ + public function first(): ?CarbonInterface + { + if ($this->isUnfilteredAndEndLess()) { + foreach ($this as $date) { + $this->rewind(); + + return $date; + } + + return null; + } + + return ($this->toArray() ?: [])[0] ?? null; + } + + /** + * Return the last date in the date period. + */ + public function last(): ?CarbonInterface + { + $array = $this->toArray(); + + return $array ? $array[\count($array) - 1] : null; + } + + /** + * Convert the date period into a string. + */ + public function __toString(): string + { + return $this->toString(); + } + + /** + * Add aliases for setters. + * + * CarbonPeriod::days(3)->hours(5)->invert() + * ->sinceNow()->until('2010-01-10') + * ->filter(...) + * ->count() + * + * Note: We use magic method to let static and instance aliases with the same names. + */ + public function __call(string $method, array $parameters): mixed + { + if (static::hasMacro($method)) { + return static::bindMacroContext($this, fn () => $this->callMacro($method, $parameters)); + } + + $roundedValue = $this->callRoundMethod($method, $parameters); + + if ($roundedValue !== null) { + return $roundedValue; + } + + $count = \count($parameters); + + switch ($method) { + case 'start': + case 'since': + if ($count === 0) { + return $this->getStartDate(); + } + + self::setDefaultParameters($parameters, [ + [0, 'date', null], + ]); + + return $this->setStartDate(...$parameters); + + case 'sinceNow': + return $this->setStartDate(new Carbon(), ...$parameters); + + case 'end': + case 'until': + if ($count === 0) { + return $this->getEndDate(); + } + + self::setDefaultParameters($parameters, [ + [0, 'date', null], + ]); + + return $this->setEndDate(...$parameters); + + case 'untilNow': + return $this->setEndDate(new Carbon(), ...$parameters); + + case 'dates': + case 'between': + self::setDefaultParameters($parameters, [ + [0, 'start', null], + [1, 'end', null], + ]); + + return $this->setDates(...$parameters); + + case 'recurrences': + case 'times': + if ($count === 0) { + return $this->getRecurrences(); + } + + self::setDefaultParameters($parameters, [ + [0, 'recurrences', null], + ]); + + return $this->setRecurrences(...$parameters); + + case 'options': + if ($count === 0) { + return $this->getOptions(); + } + + self::setDefaultParameters($parameters, [ + [0, 'options', null], + ]); + + return $this->setOptions(...$parameters); + + case 'toggle': + self::setDefaultParameters($parameters, [ + [0, 'options', null], + ]); + + return $this->toggleOptions(...$parameters); + + case 'filter': + case 'push': + return $this->addFilter(...$parameters); + + case 'prepend': + return $this->prependFilter(...$parameters); + + case 'filters': + if ($count === 0) { + return $this->getFilters(); + } + + self::setDefaultParameters($parameters, [ + [0, 'filters', []], + ]); + + return $this->setFilters(...$parameters); + + case 'interval': + case 'each': + case 'every': + case 'step': + case 'stepBy': + if ($count === 0) { + return $this->getDateInterval(); + } + + return $this->setDateInterval(...$parameters); + + case 'invert': + return $this->invertDateInterval(); + + case 'years': + case 'year': + case 'months': + case 'month': + case 'weeks': + case 'week': + case 'days': + case 'dayz': + case 'day': + case 'hours': + case 'hour': + case 'minutes': + case 'minute': + case 'seconds': + case 'second': + case 'milliseconds': + case 'millisecond': + case 'microseconds': + case 'microsecond': + return $this->setDateInterval(( + // Override default P1D when instantiating via fluent setters. + [$this->isDefaultInterval ? new CarbonInterval('PT0S') : $this->dateInterval, $method] + )(...$parameters)); + } + + $dateClass = $this->dateClass; + + if ($this->localStrictModeEnabled ?? $dateClass::isStrictModeEnabled()) { + throw new UnknownMethodException($method); + } + + return $this; + } + + /** + * Set the instance's timezone from a string or object and apply it to start/end. + */ + public function setTimezone(DateTimeZone|string|int $timezone): static + { + $self = $this->copyIfImmutable(); + $self->timezoneSetting = $timezone; + $self->timezone = CarbonTimeZone::instance($timezone); + + if ($self->startDate) { + $self = $self->setStartDate($self->startDate->setTimezone($timezone)); + } + + if ($self->endDate) { + $self = $self->setEndDate($self->endDate->setTimezone($timezone)); + } + + return $self; + } + + /** + * Set the instance's timezone from a string or object and add/subtract the offset difference to start/end. + */ + public function shiftTimezone(DateTimeZone|string|int $timezone): static + { + $self = $this->copyIfImmutable(); + $self->timezoneSetting = $timezone; + $self->timezone = CarbonTimeZone::instance($timezone); + + if ($self->startDate) { + $self = $self->setStartDate($self->startDate->shiftTimezone($timezone)); + } + + if ($self->endDate) { + $self = $self->setEndDate($self->endDate->shiftTimezone($timezone)); + } + + return $self; + } + + /** + * Returns the end is set, else calculated from start and recurrences. + * + * @param string|null $rounding Optional rounding 'floor', 'ceil', 'round' using the period interval. + * + * @return CarbonInterface + */ + public function calculateEnd(?string $rounding = null): CarbonInterface + { + if ($end = $this->getEndDate($rounding)) { + return $end; + } + + if ($this->dateInterval->isEmpty()) { + return $this->getStartDate($rounding); + } + + $date = $this->getEndFromRecurrences() ?? $this->iterateUntilEnd(); + + if ($date && $rounding) { + $date = $date->avoidMutation()->round($this->getDateInterval(), $rounding); + } + + return $date; + } + + private function getEndFromRecurrences(): ?CarbonInterface + { + if ($this->carbonRecurrences === null) { + throw new UnreachableException( + "Could not calculate period end without either explicit end or recurrences.\n". + "If you're looking for a forever-period, use ->setRecurrences(INF).", + ); + } + + if ($this->carbonRecurrences === INF) { + $start = $this->getStartDate(); + + return $start < $start->avoidMutation()->add($this->getDateInterval()) + ? CarbonImmutable::endOfTime() + : CarbonImmutable::startOfTime(); + } + + if ($this->filters === [[static::RECURRENCES_FILTER, null]]) { + return $this->getStartDate()->avoidMutation()->add( + $this->getDateInterval()->times( + $this->carbonRecurrences - ($this->isStartExcluded() ? 0 : 1), + ), + ); + } + + return null; + } + + private function iterateUntilEnd(): ?CarbonInterface + { + $attempts = 0; + $date = null; + + foreach ($this as $date) { + if (++$attempts > static::END_MAX_ATTEMPTS) { + throw new UnreachableException( + 'Could not calculate period end after iterating '.static::END_MAX_ATTEMPTS.' times.', + ); + } + } + + return $date; + } + + /** + * Returns true if the current period overlaps the given one (if 1 parameter passed) + * or the period between 2 dates (if 2 parameters passed). + * + * @param CarbonPeriod|\DateTimeInterface|Carbon|CarbonImmutable|string $rangeOrRangeStart + * @param \DateTimeInterface|Carbon|CarbonImmutable|string|null $rangeEnd + * + * @return bool + */ + public function overlaps(mixed $rangeOrRangeStart, mixed $rangeEnd = null): bool + { + $range = $rangeEnd ? static::create($rangeOrRangeStart, $rangeEnd) : $rangeOrRangeStart; + + if (!($range instanceof self)) { + $range = static::create($range); + } + + [$start, $end] = $this->orderCouple($this->getStartDate(), $this->calculateEnd()); + [$rangeStart, $rangeEnd] = $this->orderCouple($range->getStartDate(), $range->calculateEnd()); + + return $end > $rangeStart && $rangeEnd > $start; + } + + /** + * Execute a given function on each date of the period. + * + * @example + * ``` + * Carbon::create('2020-11-29')->daysUntil('2020-12-24')->forEach(function (Carbon $date) { + * echo $date->diffInDays('2020-12-25')." days before Christmas!\n"; + * }); + * ``` + */ + public function forEach(callable $callback): void + { + foreach ($this as $date) { + $callback($date); + } + } + + /** + * Execute a given function on each date of the period and yield the result of this function. + * + * @example + * ``` + * $period = Carbon::create('2020-11-29')->daysUntil('2020-12-24'); + * echo implode("\n", iterator_to_array($period->map(function (Carbon $date) { + * return $date->diffInDays('2020-12-25').' days before Christmas!'; + * }))); + * ``` + */ + public function map(callable $callback): Generator + { + foreach ($this as $date) { + yield $callback($date); + } + } + + /** + * Determines if the instance is equal to another. + * Warning: if options differ, instances will never be equal. + * + * @see equalTo() + */ + public function eq(mixed $period): bool + { + return $this->equalTo($period); + } + + /** + * Determines if the instance is equal to another. + * Warning: if options differ, instances will never be equal. + */ + public function equalTo(mixed $period): bool + { + if (!($period instanceof self)) { + $period = self::make($period); + } + + $end = $this->getEndDate(); + + return $period !== null + && $this->getDateInterval()->eq($period->getDateInterval()) + && $this->getStartDate()->eq($period->getStartDate()) + && ($end ? $end->eq($period->getEndDate()) : $this->getRecurrences() === $period->getRecurrences()) + && ($this->getOptions() & (~static::IMMUTABLE)) === ($period->getOptions() & (~static::IMMUTABLE)); + } + + /** + * Determines if the instance is not equal to another. + * Warning: if options differ, instances will never be equal. + * + * @see notEqualTo() + */ + public function ne(mixed $period): bool + { + return $this->notEqualTo($period); + } + + /** + * Determines if the instance is not equal to another. + * Warning: if options differ, instances will never be equal. + */ + public function notEqualTo(mixed $period): bool + { + return !$this->eq($period); + } + + /** + * Determines if the start date is before another given date. + * (Rather start/end are included by options is ignored.) + */ + public function startsBefore(mixed $date = null): bool + { + return $this->getStartDate()->lessThan($this->resolveCarbon($date)); + } + + /** + * Determines if the start date is before or the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function startsBeforeOrAt(mixed $date = null): bool + { + return $this->getStartDate()->lessThanOrEqualTo($this->resolveCarbon($date)); + } + + /** + * Determines if the start date is after another given date. + * (Rather start/end are included by options is ignored.) + */ + public function startsAfter(mixed $date = null): bool + { + return $this->getStartDate()->greaterThan($this->resolveCarbon($date)); + } + + /** + * Determines if the start date is after or the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function startsAfterOrAt(mixed $date = null): bool + { + return $this->getStartDate()->greaterThanOrEqualTo($this->resolveCarbon($date)); + } + + /** + * Determines if the start date is the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function startsAt(mixed $date = null): bool + { + return $this->getStartDate()->equalTo($this->resolveCarbon($date)); + } + + /** + * Determines if the end date is before another given date. + * (Rather start/end are included by options is ignored.) + */ + public function endsBefore(mixed $date = null): bool + { + return $this->calculateEnd()->lessThan($this->resolveCarbon($date)); + } + + /** + * Determines if the end date is before or the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function endsBeforeOrAt(mixed $date = null): bool + { + return $this->calculateEnd()->lessThanOrEqualTo($this->resolveCarbon($date)); + } + + /** + * Determines if the end date is after another given date. + * (Rather start/end are included by options is ignored.) + */ + public function endsAfter(mixed $date = null): bool + { + return $this->calculateEnd()->greaterThan($this->resolveCarbon($date)); + } + + /** + * Determines if the end date is after or the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function endsAfterOrAt(mixed $date = null): bool + { + return $this->calculateEnd()->greaterThanOrEqualTo($this->resolveCarbon($date)); + } + + /** + * Determines if the end date is the same as a given date. + * (Rather start/end are included by options is ignored.) + */ + public function endsAt(mixed $date = null): bool + { + return $this->calculateEnd()->equalTo($this->resolveCarbon($date)); + } + + /** + * Return true if start date is now or later. + * (Rather start/end are included by options is ignored.) + */ + public function isStarted(): bool + { + return $this->startsBeforeOrAt(); + } + + /** + * Return true if end date is now or later. + * (Rather start/end are included by options is ignored.) + */ + public function isEnded(): bool + { + return $this->endsBeforeOrAt(); + } + + /** + * Return true if now is between start date (included) and end date (excluded). + * (Rather start/end are included by options is ignored.) + */ + public function isInProgress(): bool + { + return $this->isStarted() && !$this->isEnded(); + } + + /** + * Round the current instance at the given unit with given precision if specified and the given function. + */ + public function roundUnit( + string $unit, + DateInterval|float|int|string|null $precision = 1, + callable|string $function = 'round', + ): static { + $self = $this->copyIfImmutable(); + $self = $self->setStartDate($self->getStartDate()->roundUnit($unit, $precision, $function)); + + if ($self->endDate) { + $self = $self->setEndDate($self->getEndDate()->roundUnit($unit, $precision, $function)); + } + + return $self->setDateInterval($self->getDateInterval()->roundUnit($unit, $precision, $function)); + } + + /** + * Truncate the current instance at the given unit with given precision if specified. + */ + public function floorUnit(string $unit, DateInterval|float|int|string|null $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'floor'); + } + + /** + * Ceil the current instance at the given unit with given precision if specified. + */ + public function ceilUnit(string $unit, DateInterval|float|int|string|null $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'ceil'); + } + + /** + * Round the current instance second with given precision if specified (else period interval is used). + */ + public function round( + DateInterval|float|int|string|null $precision = null, + callable|string $function = 'round', + ): static { + return $this->roundWith( + $precision ?? $this->getDateInterval()->setLocalTranslator(TranslatorImmutable::get('en'))->forHumans(), + $function + ); + } + + /** + * Round the current instance second with given precision if specified (else period interval is used). + */ + public function floor(DateInterval|float|int|string|null $precision = null): static + { + return $this->round($precision, 'floor'); + } + + /** + * Ceil the current instance second with given precision if specified (else period interval is used). + */ + public function ceil(DateInterval|float|int|string|null $precision = null): static + { + return $this->round($precision, 'ceil'); + } + + /** + * Specify data which should be serialized to JSON. + * + * @link https://php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return CarbonInterface[] + */ + public function jsonSerialize(): array + { + return $this->toArray(); + } + + /** + * Return true if the given date is between start and end. + */ + public function contains(mixed $date = null): bool + { + $startMethod = 'startsBefore'.($this->isStartIncluded() ? 'OrAt' : ''); + $endMethod = 'endsAfter'.($this->isEndIncluded() ? 'OrAt' : ''); + + return $this->$startMethod($date) && $this->$endMethod($date); + } + + /** + * Return true if the current period follows a given other period (with no overlap). + * For instance, [2019-08-01 -> 2019-08-12] follows [2019-07-29 -> 2019-07-31] + * Note than in this example, follows() would be false if 2019-08-01 or 2019-07-31 was excluded by options. + */ + public function follows(mixed $period, mixed ...$arguments): bool + { + $period = $this->resolveCarbonPeriod($period, ...$arguments); + + return $this->getIncludedStartDate()->equalTo($period->getIncludedEndDate()->add($period->getDateInterval())); + } + + /** + * Return true if the given other period follows the current one (with no overlap). + * For instance, [2019-07-29 -> 2019-07-31] is followed by [2019-08-01 -> 2019-08-12] + * Note than in this example, isFollowedBy() would be false if 2019-08-01 or 2019-07-31 was excluded by options. + */ + public function isFollowedBy(mixed $period, mixed ...$arguments): bool + { + $period = $this->resolveCarbonPeriod($period, ...$arguments); + + return $period->follows($this); + } + + /** + * Return true if the given period either follows or is followed by the current one. + * + * @see follows() + * @see isFollowedBy() + */ + public function isConsecutiveWith(mixed $period, mixed ...$arguments): bool + { + return $this->follows($period, ...$arguments) || $this->isFollowedBy($period, ...$arguments); + } + + public function __debugInfo(): array + { + $info = $this->baseDebugInfo(); + unset( + $info['start'], + $info['end'], + $info['interval'], + $info['include_start_date'], + $info['include_end_date'], + $info['constructed'], + $info["\0*\0constructed"], + ); + + return $info; + } + + public function __unserialize(array $data): void + { + try { + $values = array_combine( + array_map( + static fn (string $key): string => preg_replace('/^\0\*\0/', '', $key), + array_keys($data), + ), + $data, + ); + + $this->initializeSerialization($values); + + foreach ($values as $key => $value) { + if ($value === null) { + continue; + } + + $property = match ($key) { + 'tzName' => $this->setTimezone(...), + 'options' => $this->setOptions(...), + 'recurrences' => $this->setRecurrences(...), + 'current' => function (mixed $current): void { + if (!($current instanceof CarbonInterface)) { + $current = $this->resolveCarbon($current); + } + + $this->carbonCurrent = $current; + }, + 'start' => 'startDate', + 'interval' => $this->setDateInterval(...), + 'end' => 'endDate', + 'key' => null, + 'include_start_date' => function (bool $included): void { + $this->excludeStartDate(!$included); + }, + 'include_end_date' => function (bool $included): void { + $this->excludeEndDate(!$included); + }, + default => $key, + }; + + if ($property === null) { + continue; + } + + if (\is_callable($property)) { + $property($value); + + continue; + } + + if ($value instanceof DateTimeInterface && !($value instanceof CarbonInterface)) { + $value = ($value instanceof DateTime) + ? Carbon::instance($value) + : CarbonImmutable::instance($value); + } + + try { + $this->$property = $value; + } catch (Throwable) { + // Must be ignored for backward-compatibility + } + } + + if (\array_key_exists('carbonRecurrences', $values)) { + $this->carbonRecurrences = $values['carbonRecurrences']; + } elseif (((int) ($values['recurrences'] ?? 0)) <= 1 && $this->endDate !== null) { + $this->carbonRecurrences = null; + } + } catch (Throwable $e) { + // @codeCoverageIgnoreStart + if (!method_exists(parent::class, '__unserialize')) { + throw $e; + } + + parent::__unserialize($data); + // @codeCoverageIgnoreEnd + } + } + + /** + * Update properties after removing built-in filters. + */ + protected function updateInternalState(): void + { + if (!$this->hasFilter(static::END_DATE_FILTER)) { + $this->endDate = null; + } + + if (!$this->hasFilter(static::RECURRENCES_FILTER)) { + $this->carbonRecurrences = null; + } + } + + /** + * Create a filter tuple from raw parameters. + * + * Will create an automatic filter callback for one of Carbon's is* methods. + */ + protected function createFilterTuple(array $parameters): array + { + $method = array_shift($parameters); + + if (!$this->isCarbonPredicateMethod($method)) { + return [$method, array_shift($parameters)]; + } + + return [static fn ($date) => ([$date, $method])(...$parameters), $method]; + } + + /** + * Return whether given callable is a string pointing to one of Carbon's is* methods + * and should be automatically converted to a filter callback. + */ + protected function isCarbonPredicateMethod(callable|string $callable): bool + { + return \is_string($callable) && str_starts_with($callable, 'is') && + (method_exists($this->dateClass, $callable) || ([$this->dateClass, 'hasMacro'])($callable)); + } + + /** + * Recurrences filter callback (limits number of recurrences). + * + * @SuppressWarnings(UnusedFormalParameter) + */ + protected function filterRecurrences(CarbonInterface $current, int $key): bool|callable + { + if ($key < $this->carbonRecurrences) { + return true; + } + + return static::END_ITERATION; + } + + /** + * End date filter callback. + * + * @return bool|static::END_ITERATION + */ + protected function filterEndDate(CarbonInterface $current): bool|callable + { + if (!$this->isEndExcluded() && $current == $this->endDate) { + return true; + } + + if ($this->dateInterval->invert ? $current > $this->endDate : $current < $this->endDate) { + return true; + } + + return static::END_ITERATION; + } + + /** + * End iteration filter callback. + * + * @return static::END_ITERATION + */ + protected function endIteration(): callable + { + return static::END_ITERATION; + } + + /** + * Handle change of the parameters. + */ + protected function handleChangedParameters(): void + { + if (($this->getOptions() & static::IMMUTABLE) && $this->dateClass === Carbon::class) { + $this->dateClass = CarbonImmutable::class; + } elseif (!($this->getOptions() & static::IMMUTABLE) && $this->dateClass === CarbonImmutable::class) { + $this->dateClass = Carbon::class; + } + + $this->validationResult = null; + } + + /** + * Validate current date and stop iteration when necessary. + * + * Returns true when current date is valid, false if it is not, or static::END_ITERATION + * when iteration should be stopped. + * + * @return bool|static::END_ITERATION + */ + protected function validateCurrentDate(): bool|callable + { + if ($this->carbonCurrent === null) { + $this->rewind(); + } + + // Check after the first rewind to avoid repeating the initial validation. + return $this->validationResult ?? ($this->validationResult = $this->checkFilters()); + } + + /** + * Check whether current value and key pass all the filters. + * + * @return bool|static::END_ITERATION + */ + protected function checkFilters(): bool|callable + { + $current = $this->prepareForReturn($this->carbonCurrent); + + foreach ($this->filters as $tuple) { + $result = \call_user_func($tuple[0], $current->avoidMutation(), $this->key, $this); + + if ($result === static::END_ITERATION) { + return static::END_ITERATION; + } + + if (!$result) { + return false; + } + } + + return true; + } + + /** + * Prepare given date to be returned to the external logic. + * + * @param CarbonInterface $date + * + * @return CarbonInterface + */ + protected function prepareForReturn(CarbonInterface $date) + { + $date = ([$this->dateClass, 'make'])($date); + + if ($this->timezone) { + return $date->setTimezone($this->timezone); + } + + return $date; + } + + /** + * Keep incrementing the current date until a valid date is found or the iteration is ended. + * + * @throws RuntimeException + */ + protected function incrementCurrentDateUntilValid(): void + { + $attempts = 0; + + do { + $this->carbonCurrent = $this->carbonCurrent->add($this->dateInterval); + + $this->validationResult = null; + + if (++$attempts > static::NEXT_MAX_ATTEMPTS) { + throw new UnreachableException('Could not find next valid date.'); + } + } while ($this->validateCurrentDate() === false); + } + + /** + * Call given macro. + */ + protected function callMacro(string $name, array $parameters): mixed + { + $macro = static::$macros[$name]; + + if ($macro instanceof Closure) { + $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); + + return ($boundMacro ?: $macro)(...$parameters); + } + + return $macro(...$parameters); + } + + /** + * Return the Carbon instance passed through, a now instance in the same timezone + * if null given or parse the input if string given. + * + * @param \Carbon\Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|\DateTimeInterface|string|null $date + * + * @return \Carbon\CarbonInterface + */ + protected function resolveCarbon($date = null) + { + return $this->getStartDate()->nowWithSameTz()->carbonize($date); + } + + /** + * Resolve passed arguments or DatePeriod to a CarbonPeriod object. + */ + protected function resolveCarbonPeriod(mixed $period, mixed ...$arguments): self + { + if ($period instanceof self) { + return $period; + } + + return $period instanceof DatePeriod + ? static::instance($period) + : static::create($period, ...$arguments); + } + + private function orderCouple($first, $second): array + { + return $first > $second ? [$second, $first] : [$first, $second]; + } + + private function makeDateTime($value): ?DateTimeInterface + { + if ($value instanceof DateTimeInterface) { + return $value; + } + + if ($value instanceof WeekDay || $value instanceof Month) { + $dateClass = $this->dateClass; + + return new $dateClass($value, $this->timezoneSetting); + } + + if (\is_string($value)) { + $value = trim($value); + + if (!preg_match('/^P[\dT]/', $value) && + !preg_match('/^R\d/', $value) && + preg_match('/[a-z\d]/i', $value) + ) { + $dateClass = $this->dateClass; + + return $dateClass::parse($value, $this->timezoneSetting); + } + } + + return null; + } + + private function isInfiniteDate($date): bool + { + return $date instanceof CarbonInterface && ($date->isEndOfTime() || $date->isStartOfTime()); + } + + private function rawDate($date): ?DateTimeInterface + { + if ($date === false || $date === null) { + return null; + } + + if ($date instanceof CarbonInterface) { + return $date->isMutable() + ? $date->toDateTime() + : $date->toDateTimeImmutable(); + } + + if (\in_array(\get_class($date), [DateTime::class, DateTimeImmutable::class], true)) { + return $date; + } + + $class = $date instanceof DateTime ? DateTime::class : DateTimeImmutable::class; + + return new $class($date->format('Y-m-d H:i:s.u'), $date->getTimezone()); + } + + private static function setDefaultParameters(array &$parameters, array $defaults): void + { + foreach ($defaults as [$index, $name, $value]) { + if (!\array_key_exists($index, $parameters) && !\array_key_exists($name, $parameters)) { + $parameters[$index] = $value; + } + } + } + + private function setFromAssociativeArray(array $parameters): void + { + if (isset($parameters['start'])) { + $this->setStartDate($parameters['start']); + } + + if (isset($parameters['start'])) { + $this->setStartDate($parameters['start']); + } + + if (isset($parameters['end'])) { + $this->setEndDate($parameters['end']); + } + + if (isset($parameters['recurrences'])) { + $this->setRecurrences($parameters['recurrences']); + } + + if (isset($parameters['interval'])) { + $this->setDateInterval($parameters['interval']); + } + + if (isset($parameters['options'])) { + $this->setOptions($parameters['options']); + } + } + + private function configureTimezone(DateTimeZone $timezone, array $sortedArguments, array $originalArguments): array + { + $this->setTimezone($timezone); + + if (\is_string($originalArguments['start'] ?? null)) { + $sortedArguments['start'] = $this->makeDateTime($originalArguments['start']); + } + + if (\is_string($originalArguments['end'] ?? null)) { + $sortedArguments['end'] = $this->makeDateTime($originalArguments['end']); + } + + return $sortedArguments; + } + + private function initializeSerialization(array $values): void + { + $serializationBase = [ + 'start' => $values['start'] ?? $values['startDate'] ?? null, + 'current' => $values['current'] ?? $values['carbonCurrent'] ?? null, + 'end' => $values['end'] ?? $values['endDate'] ?? null, + 'interval' => $values['interval'] ?? $values['dateInterval'] ?? null, + 'recurrences' => max(1, (int) ($values['recurrences'] ?? $values['carbonRecurrences'] ?? 1)), + 'include_start_date' => $values['include_start_date'] ?? true, + 'include_end_date' => $values['include_end_date'] ?? false, + ]; + + foreach (['start', 'current', 'end'] as $dateProperty) { + if ($serializationBase[$dateProperty] instanceof Carbon) { + $serializationBase[$dateProperty] = $serializationBase[$dateProperty]->toDateTime(); + } elseif ($serializationBase[$dateProperty] instanceof CarbonInterface) { + $serializationBase[$dateProperty] = $serializationBase[$dateProperty]->toDateTimeImmutable(); + } + } + + if ($serializationBase['interval'] instanceof CarbonInterval) { + $serializationBase['interval'] = $serializationBase['interval']->toDateInterval(); + } + + // @codeCoverageIgnoreStart + if (method_exists(parent::class, '__unserialize')) { + parent::__unserialize($serializationBase); + + return; + } + + $excludeStart = !($values['include_start_date'] ?? true); + $includeEnd = $values['include_end_date'] ?? true; + + parent::__construct( + $serializationBase['start'], + $serializationBase['interval'], + $serializationBase['end'] ?? $serializationBase['recurrences'], + ($excludeStart ? self::EXCLUDE_START_DATE : 0) | ($includeEnd && \defined('DatePeriod::INCLUDE_END_DATE') ? self::INCLUDE_END_DATE : 0), + ); + // @codeCoverageIgnoreEnd + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php new file mode 100644 index 00000000..0e8ff28e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonPeriodImmutable.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +class CarbonPeriodImmutable extends CarbonPeriod +{ + /** + * Default date class of iteration items. + * + * @var string + */ + protected const DEFAULT_DATE_CLASS = CarbonImmutable::class; + + /** + * Date class of iteration items. + */ + protected string $dateClass = CarbonImmutable::class; + + /** + * Prepare the instance to be set (self if mutable to be mutated, + * copy if immutable to generate a new instance). + */ + protected function copyIfImmutable(): static + { + return $this->constructed ? clone $this : $this; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php new file mode 100644 index 00000000..45a46d17 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php @@ -0,0 +1,336 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\InvalidCastException; +use Carbon\Exceptions\InvalidTimeZoneException; +use Carbon\Traits\LocalFactory; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use Exception; +use Throwable; + +class CarbonTimeZone extends DateTimeZone +{ + use LocalFactory; + + public const MAXIMUM_TIMEZONE_OFFSET = 99; + + public function __construct(string|int|float $timezone) + { + $this->initLocalFactory(); + + parent::__construct(static::getDateTimeZoneNameFromMixed($timezone)); + } + + protected static function parseNumericTimezone(string|int|float $timezone): string + { + if (abs((float) $timezone) > static::MAXIMUM_TIMEZONE_OFFSET) { + throw new InvalidTimeZoneException( + 'Absolute timezone offset cannot be greater than '. + static::MAXIMUM_TIMEZONE_OFFSET.'.', + ); + } + + return ($timezone >= 0 ? '+' : '').ltrim((string) $timezone, '+').':00'; + } + + protected static function getDateTimeZoneNameFromMixed(string|int|float $timezone): string + { + if (\is_string($timezone)) { + $timezone = preg_replace('/^\s*([+-]\d+)(\d{2})\s*$/', '$1:$2', $timezone); + } + + if (is_numeric($timezone)) { + return static::parseNumericTimezone($timezone); + } + + return $timezone; + } + + /** + * Cast the current instance into the given class. + * + * @param class-string $className The $className::instance() method will be called to cast the current object. + * + * @return DateTimeZone|mixed + */ + public function cast(string $className): mixed + { + if (!method_exists($className, 'instance')) { + if (is_a($className, DateTimeZone::class, true)) { + return new $className($this->getName()); + } + + throw new InvalidCastException("$className has not the instance() method needed to cast the date."); + } + + return $className::instance($this); + } + + /** + * Create a CarbonTimeZone from mixed input. + * + * @param DateTimeZone|string|int|false|null $object original value to get CarbonTimeZone from it. + * @param DateTimeZone|string|int|false|null $objectDump dump of the object for error messages. + * + * @throws InvalidTimeZoneException + * + * @return static|null + */ + public static function instance( + DateTimeZone|string|int|false|null $object, + DateTimeZone|string|int|false|null $objectDump = null, + ): ?self { + $timezone = $object; + + if ($timezone instanceof static) { + return $timezone; + } + + if ($timezone === null || $timezone === false) { + return null; + } + + try { + if (!($timezone instanceof DateTimeZone)) { + $name = static::getDateTimeZoneNameFromMixed($object); + $timezone = new static($name); + } + + return $timezone instanceof static ? $timezone : new static($timezone->getName()); + } catch (Exception $exception) { + throw new InvalidTimeZoneException( + 'Unknown or bad timezone ('.($objectDump ?: $object).')', + previous: $exception, + ); + } + } + + /** + * Returns abbreviated name of the current timezone according to DST setting. + * + * @param bool $dst + * + * @return string + */ + public function getAbbreviatedName(bool $dst = false): string + { + $name = $this->getName(); + + $date = new DateTimeImmutable($dst ? 'July 1' : 'January 1', $this); + $timezone = $date->format('T'); + $abbreviations = $this->listAbbreviations(); + $matchingZones = array_merge($abbreviations[$timezone] ?? [], $abbreviations[strtolower($timezone)] ?? []); + + if ($matchingZones !== []) { + foreach ($matchingZones as $zone) { + if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { + return $timezone; + } + } + } + + foreach ($abbreviations as $abbreviation => $zones) { + foreach ($zones as $zone) { + if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) { + return strtoupper($abbreviation); + } + } + } + + return 'unknown'; + } + + /** + * @alias getAbbreviatedName + * + * Returns abbreviated name of the current timezone according to DST setting. + * + * @param bool $dst + * + * @return string + */ + public function getAbbr(bool $dst = false): string + { + return $this->getAbbreviatedName($dst); + } + + /** + * Get the offset as string "sHH:MM" (such as "+00:00" or "-12:30"). + */ + public function toOffsetName(?DateTimeInterface $date = null): string + { + return static::getOffsetNameFromMinuteOffset( + $this->getOffset($this->resolveCarbon($date)) / 60, + ); + } + + /** + * Returns a new CarbonTimeZone object using the offset string instead of region string. + */ + public function toOffsetTimeZone(?DateTimeInterface $date = null): static + { + return new static($this->toOffsetName($date)); + } + + /** + * Returns the first region string (such as "America/Toronto") that matches the current timezone or + * false if no match is found. + * + * @see timezone_name_from_abbr native PHP function. + */ + public function toRegionName(?DateTimeInterface $date = null, int $isDST = 1): ?string + { + $name = $this->getName(); + $firstChar = substr($name, 0, 1); + + if ($firstChar !== '+' && $firstChar !== '-') { + return $name; + } + + $date = $this->resolveCarbon($date); + + // Integer construction no longer supported since PHP 8 + // @codeCoverageIgnoreStart + try { + $offset = @$this->getOffset($date) ?: 0; + } catch (Throwable) { + $offset = 0; + } + // @codeCoverageIgnoreEnd + + $name = @timezone_name_from_abbr('', $offset, $isDST); + + if ($name) { + return $name; + } + + foreach (timezone_identifiers_list() as $timezone) { + if (Carbon::instance($date)->setTimezone($timezone)->getOffset() === $offset) { + return $timezone; + } + } + + return null; + } + + /** + * Returns a new CarbonTimeZone object using the region string instead of offset string. + */ + public function toRegionTimeZone(?DateTimeInterface $date = null): ?self + { + $timezone = $this->toRegionName($date); + + if ($timezone !== null) { + return new static($timezone); + } + + if (Carbon::isStrictModeEnabled()) { + throw new InvalidTimeZoneException('Unknown timezone for offset '.$this->getOffset($this->resolveCarbon($date)).' seconds.'); + } + + return null; + } + + /** + * Cast to string (get timezone name). + * + * @return string + */ + public function __toString() + { + return $this->getName(); + } + + /** + * Return the type number: + * + * Type 1; A UTC offset, such as -0300 + * Type 2; A timezone abbreviation, such as GMT + * Type 3: A timezone identifier, such as Europe/London + */ + public function getType(): int + { + return preg_match('/"timezone_type";i:(\d)/', serialize($this), $match) ? (int) $match[1] : 3; + } + + /** + * Create a CarbonTimeZone from mixed input. + * + * @param DateTimeZone|string|int|null $object + * + * @return false|static + */ + public static function create($object = null) + { + return static::instance($object); + } + + /** + * Create a CarbonTimeZone from int/float hour offset. + * + * @param float $hourOffset number of hour of the timezone shift (can be decimal). + * + * @return false|static + */ + public static function createFromHourOffset(float $hourOffset) + { + return static::createFromMinuteOffset($hourOffset * Carbon::MINUTES_PER_HOUR); + } + + /** + * Create a CarbonTimeZone from int/float minute offset. + * + * @param float $minuteOffset number of total minutes of the timezone shift. + * + * @return false|static + */ + public static function createFromMinuteOffset(float $minuteOffset) + { + return static::instance(static::getOffsetNameFromMinuteOffset($minuteOffset)); + } + + /** + * Convert a total minutes offset into a standardized timezone offset string. + * + * @param float $minutes number of total minutes of the timezone shift. + * + * @return string + */ + public static function getOffsetNameFromMinuteOffset(float $minutes): string + { + $minutes = round($minutes); + $unsignedMinutes = abs($minutes); + + return ($minutes < 0 ? '-' : '+'). + str_pad((string) floor($unsignedMinutes / 60), 2, '0', STR_PAD_LEFT). + ':'. + str_pad((string) ($unsignedMinutes % 60), 2, '0', STR_PAD_LEFT); + } + + private function resolveCarbon(?DateTimeInterface $date): DateTimeInterface + { + if ($date) { + return $date; + } + + if (isset($this->clock)) { + return $this->clock->now()->setTimezone($this); + } + + return Carbon::now($this); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php b/plugins/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php new file mode 100644 index 00000000..3aabe3f6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Cli/Invoker.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Cli; + +class Invoker +{ + public const CLI_CLASS_NAME = 'Carbon\\Cli'; + + protected function runWithCli(string $className, array $parameters): bool + { + $cli = new $className(); + + return $cli(...$parameters); + } + + public function __invoke(...$parameters): bool + { + if (class_exists(self::CLI_CLASS_NAME)) { + return $this->runWithCli(self::CLI_CLASS_NAME, $parameters); + } + + $function = (($parameters[1] ?? '') === 'install' ? ($parameters[2] ?? null) : null) ?: 'shell_exec'; + $function('composer require carbon-cli/carbon-cli --no-interaction'); + + echo 'Installation succeeded.'; + + return true; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php new file mode 100644 index 00000000..db1ea8e9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadComparisonUnitException.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use Throwable; + +class BadComparisonUnitException extends UnitException +{ + /** + * The unit. + * + * @var string + */ + protected $unit; + + /** + * Constructor. + * + * @param string $unit + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($unit, $code = 0, ?Throwable $previous = null) + { + $this->unit = $unit; + + parent::__construct("Bad comparison unit: '$unit'", $code, $previous); + } + + /** + * Get the unit. + * + * @return string + */ + public function getUnit(): string + { + return $this->unit; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php new file mode 100644 index 00000000..e8cded03 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentConstructorException.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use BadMethodCallException as BaseBadMethodCallException; +use Throwable; + +class BadFluentConstructorException extends BaseBadMethodCallException implements BadMethodCallException +{ + /** + * The method. + * + * @var string + */ + protected $method; + + /** + * Constructor. + * + * @param string $method + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($method, $code = 0, ?Throwable $previous = null) + { + $this->method = $method; + + parent::__construct(\sprintf("Unknown fluent constructor '%s'.", $method), $code, $previous); + } + + /** + * Get the method. + * + * @return string + */ + public function getMethod(): string + { + return $this->method; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php new file mode 100644 index 00000000..b3111bff --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadFluentSetterException.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use BadMethodCallException as BaseBadMethodCallException; +use Throwable; + +class BadFluentSetterException extends BaseBadMethodCallException implements BadMethodCallException +{ + /** + * The setter. + * + * @var string + */ + protected $setter; + + /** + * Constructor. + * + * @param string $setter + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($setter, $code = 0, ?Throwable $previous = null) + { + $this->setter = $setter; + + parent::__construct(\sprintf("Unknown fluent setter '%s'", $setter), $code, $previous); + } + + /** + * Get the setter. + * + * @return string + */ + public function getSetter(): string + { + return $this->setter; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php new file mode 100644 index 00000000..3f10af99 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/BadMethodCallException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +interface BadMethodCallException extends Exception +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php new file mode 100644 index 00000000..a3d764ed --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/EndLessPeriodException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use RuntimeException as BaseRuntimeException; + +final class EndLessPeriodException extends BaseRuntimeException implements RuntimeException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php new file mode 100644 index 00000000..ee42fd60 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/Exception.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +interface Exception +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php new file mode 100644 index 00000000..e8550a52 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ImmutableException.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use RuntimeException as BaseRuntimeException; +use Throwable; + +class ImmutableException extends BaseRuntimeException implements RuntimeException +{ + /** + * The value. + * + * @var string + */ + protected $value; + + /** + * Constructor. + * + * @param string $value the immutable type/value + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($value, $code = 0, ?Throwable $previous = null) + { + $this->value = $value; + parent::__construct("$value is immutable.", $code, $previous); + } + + /** + * Get the value. + * + * @return string + */ + public function getValue(): string + { + return $this->value; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php new file mode 100644 index 00000000..7fb5a991 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidArgumentException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +interface InvalidArgumentException extends Exception +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php new file mode 100644 index 00000000..c0ebe499 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidCastException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidCastException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php new file mode 100644 index 00000000..8396fdc1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class InvalidDateException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * The invalid field. + * + * @var string + */ + private $field; + + /** + * The invalid value. + * + * @var mixed + */ + private $value; + + /** + * Constructor. + * + * @param string $field + * @param mixed $value + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($field, $value, $code = 0, ?Throwable $previous = null) + { + $this->field = $field; + $this->value = $value; + parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous); + } + + /** + * Get the invalid field. + * + * @return string + */ + public function getField() + { + return $this->field; + } + + /** + * Get the invalid value. + * + * @return mixed + */ + public function getValue() + { + return $this->value; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php new file mode 100644 index 00000000..ffc5f212 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidFormatException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidFormatException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php new file mode 100644 index 00000000..7390f410 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidIntervalException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidIntervalException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php new file mode 100644 index 00000000..dc2f8ad0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodDateException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidPeriodDateException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php new file mode 100644 index 00000000..f6c33fd2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidPeriodParameterException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php new file mode 100644 index 00000000..33052e2e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTimeZoneException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidTimeZoneException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php new file mode 100644 index 00000000..1cd485fb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidTypeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class InvalidTypeException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php new file mode 100644 index 00000000..fcc0c2c0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotACarbonClassException.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use Carbon\CarbonInterface; +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class NotACarbonClassException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * The className. + * + * @var string + */ + protected $className; + + /** + * Constructor. + * + * @param string $className + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($className, $code = 0, ?Throwable $previous = null) + { + $this->className = $className; + + parent::__construct(\sprintf( + 'Given class does not implement %s: %s', + CarbonInterface::class, + $className, + ), $code, $previous); + } + + /** + * Get the className. + * + * @return string + */ + public function getClassName(): string + { + return $this->className; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php new file mode 100644 index 00000000..23e09a28 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotAPeriodException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class NotAPeriodException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php new file mode 100644 index 00000000..76158ebf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/NotLocaleAwareException.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class NotLocaleAwareException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * Constructor. + * + * @param mixed $object + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($object, $code = 0, ?Throwable $previous = null) + { + $dump = \is_object($object) ? \get_class($object) : \gettype($object); + + parent::__construct("$dump does neither implements Symfony\Contracts\Translation\LocaleAwareInterface nor getLocale() method.", $code, $previous); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php new file mode 100644 index 00000000..8fd44fd1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/OutOfRangeException.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +// This will extends OutOfRangeException instead of InvalidArgumentException since 3.0.0 +// use OutOfRangeException as BaseOutOfRangeException; + +class OutOfRangeException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * The unit or name of the value. + * + * @var string + */ + private $unit; + + /** + * The range minimum. + * + * @var mixed + */ + private $min; + + /** + * The range maximum. + * + * @var mixed + */ + private $max; + + /** + * The invalid value. + * + * @var mixed + */ + private $value; + + /** + * Constructor. + * + * @param string $unit + * @param mixed $min + * @param mixed $max + * @param mixed $value + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($unit, $min, $max, $value, $code = 0, ?Throwable $previous = null) + { + $this->unit = $unit; + $this->min = $min; + $this->max = $max; + $this->value = $value; + + parent::__construct("$unit must be between $min and $max, $value given", $code, $previous); + } + + /** + * @return mixed + */ + public function getMax() + { + return $this->max; + } + + /** + * @return mixed + */ + public function getMin() + { + return $this->min; + } + + /** + * @return mixed + */ + public function getUnit() + { + return $this->unit; + } + + /** + * @return mixed + */ + public function getValue() + { + return $this->value; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php new file mode 100644 index 00000000..556bfede --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/ParseErrorException.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class ParseErrorException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * The expected. + * + * @var string + */ + protected $expected; + + /** + * The actual. + * + * @var string + */ + protected $actual; + + /** + * The help message. + * + * @var string + */ + protected $help; + + /** + * Constructor. + * + * @param string $expected + * @param string $actual + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($expected, $actual, $help = '', $code = 0, ?Throwable $previous = null) + { + $this->expected = $expected; + $this->actual = $actual; + $this->help = $help; + + $actual = $actual === '' ? 'data is missing' : "get '$actual'"; + + parent::__construct(trim("Format expected $expected but $actual\n$help"), $code, $previous); + } + + /** + * Get the expected. + * + * @return string + */ + public function getExpected(): string + { + return $this->expected; + } + + /** + * Get the actual. + * + * @return string + */ + public function getActual(): string + { + return $this->actual; + } + + /** + * Get the help message. + * + * @return string + */ + public function getHelp(): string + { + return $this->help; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php new file mode 100644 index 00000000..85bfb142 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/RuntimeException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +interface RuntimeException extends Exception +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php new file mode 100644 index 00000000..4f410c15 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; + +class UnitException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php new file mode 100644 index 00000000..b95784de --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitNotConfiguredException.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use Throwable; + +class UnitNotConfiguredException extends UnitException +{ + /** + * The unit. + * + * @var string + */ + protected $unit; + + /** + * Constructor. + * + * @param string $unit + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($unit, $code = 0, ?Throwable $previous = null) + { + $this->unit = $unit; + + parent::__construct("Unit $unit have no configuration to get total from other units.", $code, $previous); + } + + /** + * Get the unit. + * + * @return string + */ + public function getUnit(): string + { + return $this->unit; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php new file mode 100644 index 00000000..982a3082 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownGetterException.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class UnknownGetterException extends BaseInvalidArgumentException implements InvalidArgumentException +{ + /** + * The getter. + * + * @var string + */ + protected $getter; + + /** + * Constructor. + * + * @param string $getter getter name + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($getter, $code = 0, ?Throwable $previous = null) + { + $this->getter = $getter; + + parent::__construct("Unknown getter '$getter'", $code, $previous); + } + + /** + * Get the getter. + * + * @return string + */ + public function getGetter(): string + { + return $this->getter; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php new file mode 100644 index 00000000..c72c368c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownMethodException.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use BadMethodCallException as BaseBadMethodCallException; +use Throwable; + +class UnknownMethodException extends BaseBadMethodCallException implements BadMethodCallException +{ + /** + * The method. + * + * @var string + */ + protected $method; + + /** + * Constructor. + * + * @param string $method + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($method, $code = 0, ?Throwable $previous = null) + { + $this->method = $method; + + parent::__construct("Method $method does not exist.", $code, $previous); + } + + /** + * Get the method. + * + * @return string + */ + public function getMethod(): string + { + return $this->method; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php new file mode 100644 index 00000000..e97db4bb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownSetterException.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use InvalidArgumentException as BaseInvalidArgumentException; +use Throwable; + +class UnknownSetterException extends BaseInvalidArgumentException implements BadMethodCallException +{ + /** + * The setter. + * + * @var string + */ + protected $setter; + + /** + * Constructor. + * + * @param string $setter setter name + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($setter, $code = 0, ?Throwable $previous = null) + { + $this->setter = $setter; + + parent::__construct("Unknown setter '$setter'", $code, $previous); + } + + /** + * Get the setter. + * + * @return string + */ + public function getSetter(): string + { + return $this->setter; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php new file mode 100644 index 00000000..833c4d73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnknownUnitException.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use Throwable; + +class UnknownUnitException extends UnitException +{ + /** + * The unit. + * + * @var string + */ + protected $unit; + + /** + * Constructor. + * + * @param string $unit + * @param int $code + * @param Throwable|null $previous + */ + public function __construct($unit, $code = 0, ?Throwable $previous = null) + { + $this->unit = $unit; + + parent::__construct("Unknown unit '$unit'.", $code, $previous); + } + + /** + * Get the unit. + * + * @return string + */ + public function getUnit(): string + { + return $this->unit; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php new file mode 100644 index 00000000..c637d3b2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnreachableException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use RuntimeException as BaseRuntimeException; + +class UnreachableException extends BaseRuntimeException implements RuntimeException +{ + // +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnsupportedUnitException.php b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnsupportedUnitException.php new file mode 100644 index 00000000..52a546ca --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Exceptions/UnsupportedUnitException.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Exceptions; + +use Exception; + +/** + * @codeCoverageIgnore + */ +class UnsupportedUnitException extends UnitException +{ + public function __construct(string $unit, int $code = 0, ?Exception $previous = null) + { + parent::__construct("Unsupported unit '$unit'", $code, $previous); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Factory.php b/plugins/vendor/nesbot/carbon/src/Carbon/Factory.php new file mode 100644 index 00000000..7831c158 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Factory.php @@ -0,0 +1,848 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Closure; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use InvalidArgumentException; +use ReflectionMethod; +use RuntimeException; +use Symfony\Contracts\Translation\TranslatorInterface; +use Throwable; + +/** + * A factory to generate Carbon instances with common settings. + * + * + * + * @method bool canBeCreatedFromFormat(?string $date, string $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method ?Carbon create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method Carbon createFromDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method ?Carbon createFromFormat($format, $time, $timezone = null) Create a Carbon instance from a specific format. + * @method ?Carbon createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method ?Carbon createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific format and a string in a given language. + * @method ?Carbon createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method Carbon createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method Carbon createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method Carbon createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp and set the timezone (UTC by default). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createFromTimestampUTC(string|int|float $timestamp) Create a Carbon instance from a timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method Carbon createMidnightDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method ?Carbon createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method Carbon createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method Carbon fromSerialized($value) Create an instance from a serialized string. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week. + * @method ?string getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array|false getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method int getMidDayAt() get midday/noon hour + * @method string getTimeFormatByPrecision(string $unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method int getWeekEndsAt(?string $locale = null) Get the last day of week. + * @method int getWeekStartsAt(?string $locale = null) Get the first day of week. + * @method bool hasRelativeKeywords(?string $time) Determine if a time string will produce a relative date. + * @method Carbon instance(DateTimeInterface $date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool localeHasDiffOneDayWords(string $locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax(string $locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords(string $locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits(string $locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method ?Carbon make($var, DateTimeZone|string|null $timezone = null) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method void mixin(object|string $mixin) Mix another object into the class. + * @method Carbon now(DateTimeZone|string|int|null $timezone = null) Get a Carbon instance for the current date and time. + * @method Carbon parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method Carbon parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method ?Carbon rawCreateFromFormat(string $format, string $time, $timezone = null) Create a Carbon instance from a specific format. + * @method Carbon rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method void setFallbackLocale(string $locale) Set the fallback locale. + * @method void setLocale(string $locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method void sleep(int|float $seconds) + * @method Carbon today(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for today. + * @method Carbon tomorrow(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method Carbon yesterday(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for yesterday. + * + * + */ +class Factory +{ + protected string $className = Carbon::class; + + protected array $settings = []; + + /** + * A test Carbon instance to be returned when now instances are created. + */ + protected Closure|CarbonInterface|null $testNow = null; + + /** + * The timezone to restore to when clearing the time mock. + */ + protected ?string $testDefaultTimezone = null; + + /** + * Is true when test-now is generated by a closure and timezone should be taken on the fly from it. + */ + protected bool $useTimezoneFromTestNow = false; + + /** + * Default translator. + */ + protected TranslatorInterface $translator; + + /** + * Days of weekend. + */ + protected array $weekendDays = [ + CarbonInterface::SATURDAY, + CarbonInterface::SUNDAY, + ]; + + /** + * Format regex patterns. + * + * @var array + */ + protected array $regexFormats = [ + 'd' => '(3[01]|[12][0-9]|0[1-9])', + 'D' => '(Sun|Mon|Tue|Wed|Thu|Fri|Sat)', + 'j' => '([123][0-9]|[1-9])', + 'l' => '([a-zA-Z]{2,})', + 'N' => '([1-7])', + 'S' => '(st|nd|rd|th)', + 'w' => '([0-6])', + 'z' => '(36[0-5]|3[0-5][0-9]|[12][0-9]{2}|[1-9]?[0-9])', + 'W' => '(5[012]|[1-4][0-9]|0?[1-9])', + 'F' => '([a-zA-Z]{2,})', + 'm' => '(1[012]|0[1-9])', + 'M' => '([a-zA-Z]{3})', + 'n' => '(1[012]|[1-9])', + 't' => '(2[89]|3[01])', + 'L' => '(0|1)', + 'o' => '([1-9][0-9]{0,4})', + 'Y' => '([1-9]?[0-9]{4})', + 'y' => '([0-9]{2})', + 'a' => '(am|pm)', + 'A' => '(AM|PM)', + 'B' => '([0-9]{3})', + 'g' => '(1[012]|[1-9])', + 'G' => '(2[0-3]|1?[0-9])', + 'h' => '(1[012]|0[1-9])', + 'H' => '(2[0-3]|[01][0-9])', + 'i' => '([0-5][0-9])', + 's' => '([0-5][0-9])', + 'u' => '([0-9]{1,6})', + 'v' => '([0-9]{1,3})', + 'e' => '([a-zA-Z]{1,5})|([a-zA-Z]*\\/[a-zA-Z]*)', + 'I' => '(0|1)', + 'O' => '([+-](1[0123]|0[0-9])[0134][05])', + 'P' => '([+-](1[0123]|0[0-9]):[0134][05])', + 'p' => '(Z|[+-](1[0123]|0[0-9]):[0134][05])', + 'T' => '([a-zA-Z]{1,5})', + 'Z' => '(-?[1-5]?[0-9]{1,4})', + 'U' => '([0-9]*)', + + // The formats below are combinations of the above formats. + 'c' => '(([1-9]?[0-9]{4})-(1[012]|0[1-9])-(3[01]|[12][0-9]|0[1-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])[+-](1[012]|0[0-9]):([0134][05]))', // Y-m-dTH:i:sP + 'r' => '(([a-zA-Z]{3}), ([123][0-9]|0[1-9]) ([a-zA-Z]{3}) ([1-9]?[0-9]{4}) (2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9]) [+-](1[012]|0[0-9])([0134][05]))', // D, d M Y H:i:s O + ]; + + /** + * Format modifiers (such as available in createFromFormat) regex patterns. + * + * @var array + */ + protected array $regexFormatModifiers = [ + '*' => '.+', + ' ' => '[ ]', + '#' => '[;:\\/.,()-]', + '?' => '([^a]|[a])', + '!' => '', + '|' => '', + '+' => '', + ]; + + public function __construct(array $settings = [], ?string $className = null) + { + if ($className) { + $this->className = $className; + } + + $this->settings = $settings; + } + + public function getClassName(): string + { + return $this->className; + } + + public function setClassName(string $className): self + { + $this->className = $className; + + return $this; + } + + public function className(?string $className = null): self|string + { + return $className === null ? $this->getClassName() : $this->setClassName($className); + } + + public function getSettings(): array + { + return $this->settings; + } + + public function setSettings(array $settings): self + { + $this->settings = $settings; + + return $this; + } + + public function settings(?array $settings = null): self|array + { + return $settings === null ? $this->getSettings() : $this->setSettings($settings); + } + + public function mergeSettings(array $settings): self + { + $this->settings = array_merge($this->settings, $settings); + + return $this; + } + + public function setHumanDiffOptions(int $humanDiffOptions): void + { + $this->mergeSettings([ + 'humanDiffOptions' => $humanDiffOptions, + ]); + } + + public function enableHumanDiffOption($humanDiffOption): void + { + $this->setHumanDiffOptions($this->getHumanDiffOptions() | $humanDiffOption); + } + + public function disableHumanDiffOption(int $humanDiffOption): void + { + $this->setHumanDiffOptions($this->getHumanDiffOptions() & ~$humanDiffOption); + } + + public function getHumanDiffOptions(): int + { + return (int) ($this->getSettings()['humanDiffOptions'] ?? 0); + } + + /** + * Register a custom macro. + * + * Pass null macro to remove it. + * + * @example + * ``` + * $userSettings = [ + * 'locale' => 'pt', + * 'timezone' => 'America/Sao_Paulo', + * ]; + * $factory->macro('userFormat', function () use ($userSettings) { + * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); + * }); + * echo $factory->yesterday()->hours(11)->userFormat(); + * ``` + * + * @param-closure-this static $macro + */ + public function macro(string $name, ?callable $macro): void + { + $macros = $this->getSettings()['macros'] ?? []; + $macros[$name] = $macro; + + $this->mergeSettings([ + 'macros' => $macros, + ]); + } + + /** + * Remove all macros and generic macros. + */ + public function resetMacros(): void + { + $this->mergeSettings([ + 'macros' => null, + 'genericMacros' => null, + ]); + } + + /** + * Register a custom macro. + * + * @param callable $macro + * @param int $priority marco with higher priority is tried first + * + * @return void + */ + public function genericMacro(callable $macro, int $priority = 0): void + { + $genericMacros = $this->getSettings()['genericMacros'] ?? []; + + if (!isset($genericMacros[$priority])) { + $genericMacros[$priority] = []; + krsort($genericMacros, SORT_NUMERIC); + } + + $genericMacros[$priority][] = $macro; + + $this->mergeSettings([ + 'genericMacros' => $genericMacros, + ]); + } + + /** + * Checks if macro is registered globally. + */ + public function hasMacro(string $name): bool + { + return isset($this->getSettings()['macros'][$name]); + } + + /** + * Get the raw callable macro registered globally for a given name. + */ + public function getMacro(string $name): ?callable + { + return $this->getSettings()['macros'][$name] ?? null; + } + + /** + * Set the default translator instance to use. + */ + public function setTranslator(TranslatorInterface $translator): void + { + $this->translator = $translator; + } + + /** + * Initialize the default translator instance if necessary. + */ + public function getTranslator(): TranslatorInterface + { + return $this->translator ??= Translator::get(); + } + + /** + * Reset the format used to the default when type juggling a Carbon instance to a string + * + * @return void + */ + public function resetToStringFormat(): void + { + $this->setToStringFormat(null); + } + + /** + * Set the default format used when type juggling a Carbon instance to a string. + */ + public function setToStringFormat(string|Closure|null $format): void + { + $this->mergeSettings([ + 'toStringFormat' => $format, + ]); + } + + /** + * JSON serialize all Carbon instances using the given callback. + */ + public function serializeUsing(string|callable|null $format): void + { + $this->mergeSettings([ + 'toJsonFormat' => $format, + ]); + } + + /** + * Enable the strict mode (or disable with passing false). + */ + public function useStrictMode(bool $strictModeEnabled = true): void + { + $this->mergeSettings([ + 'strictMode' => $strictModeEnabled, + ]); + } + + /** + * Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + */ + public function isStrictModeEnabled(): bool + { + return $this->getSettings()['strictMode'] ?? true; + } + + /** + * Indicates if months should be calculated with overflow. + */ + public function useMonthsOverflow(bool $monthsOverflow = true): void + { + $this->mergeSettings([ + 'monthOverflow' => $monthsOverflow, + ]); + } + + /** + * Reset the month overflow behavior. + */ + public function resetMonthsOverflow(): void + { + $this->useMonthsOverflow(); + } + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + */ + public function shouldOverflowMonths(): bool + { + return $this->getSettings()['monthOverflow'] ?? true; + } + + /** + * Indicates if years should be calculated with overflow. + */ + public function useYearsOverflow(bool $yearsOverflow = true): void + { + $this->mergeSettings([ + 'yearOverflow' => $yearsOverflow, + ]); + } + + /** + * Reset the month overflow behavior. + */ + public function resetYearsOverflow(): void + { + $this->useYearsOverflow(); + } + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + */ + public function shouldOverflowYears(): bool + { + return $this->getSettings()['yearOverflow'] ?? true; + } + + /** + * Get weekend days + * + * @return array + */ + public function getWeekendDays(): array + { + return $this->weekendDays; + } + + /** + * Set weekend days + */ + public function setWeekendDays(array $days): void + { + $this->weekendDays = $days; + } + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormat('11:12:45', 'h:i:s'); // true + * Carbon::hasFormat('13:12:45', 'h:i:s'); // false + * ``` + */ + public function hasFormat(string $date, string $format): bool + { + // createFromFormat() is known to handle edge cases silently. + // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format. + // To ensure we're really testing against our desired format, perform an additional regex validation. + + return $this->matchFormatPattern($date, preg_quote($format, '/'), $this->regexFormats); + } + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true + * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false + * ``` + */ + public function hasFormatWithModifiers(string $date, string $format): bool + { + return $this->matchFormatPattern($date, $format, array_merge($this->regexFormats, $this->regexFormatModifiers)); + } + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public function setTestNow(mixed $testNow = null): void + { + $this->useTimezoneFromTestNow = false; + $this->testNow = $testNow instanceof self || $testNow instanceof Closure + ? $testNow + : $this->make($testNow); + } + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public function setTestNowAndTimezone(mixed $testNow = null, $timezone = null): void + { + if ($testNow) { + $this->testDefaultTimezone ??= date_default_timezone_get(); + } + + $useDateInstanceTimezone = $testNow instanceof DateTimeInterface; + + if ($useDateInstanceTimezone) { + $this->setDefaultTimezone($testNow->getTimezone()->getName(), $testNow); + } + + $this->setTestNow($testNow); + $this->useTimezoneFromTestNow = ($timezone === null && $testNow instanceof Closure); + + if (!$useDateInstanceTimezone) { + $now = $this->getMockedTestNow(\func_num_args() === 1 ? null : $timezone); + $this->setDefaultTimezone($now?->tzName ?? $this->testDefaultTimezone ?? 'UTC', $now); + } + + if (!$testNow) { + $this->testDefaultTimezone = null; + } + } + + /** + * Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * + * /!\ Use this method for unit tests only. + * + * @template T + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure(): T $callback + * + * @return T + */ + public function withTestNow(mixed $testNow, callable $callback): mixed + { + $this->setTestNow($testNow); + + try { + $result = $callback(); + } finally { + $this->setTestNow(); + } + + return $result; + } + + /** + * Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * + * @return Closure|CarbonInterface|null the current instance used for testing + */ + public function getTestNow(): Closure|CarbonInterface|null + { + if ($this->testNow === null) { + $factory = FactoryImmutable::getDefaultInstance(); + + if ($factory !== $this) { + return $factory->getTestNow(); + } + } + + return $this->testNow; + } + + public function handleTestNowClosure( + Closure|CarbonInterface|null $testNow, + DateTimeZone|string|int|null $timezone = null, + ): ?CarbonInterface { + if ($testNow instanceof Closure) { + $callback = Callback::fromClosure($testNow); + $realNow = new DateTimeImmutable('now'); + $testNow = $testNow($callback->prepareParameter($this->parse( + $realNow->format('Y-m-d H:i:s.u'), + $timezone ?? $realNow->getTimezone(), + ))); + + if ($testNow !== null && !($testNow instanceof DateTimeInterface)) { + $function = $callback->getReflectionFunction(); + $type = \is_object($testNow) ? $testNow::class : \gettype($testNow); + + throw new RuntimeException( + 'The test closure defined in '.$function->getFileName(). + ' at line '.$function->getStartLine().' returned '.$type. + '; expected '.CarbonInterface::class.'|null', + ); + } + + if (!($testNow instanceof CarbonInterface)) { + $timezone ??= $this->useTimezoneFromTestNow ? $testNow->getTimezone() : null; + $testNow = $this->__call('instance', [$testNow, $timezone]); + } + } + + return $testNow; + } + + /** + * Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * + * @return bool true if there is a test instance, otherwise false + */ + public function hasTestNow(): bool + { + return $this->getTestNow() !== null; + } + + public function withTimeZone(DateTimeZone|string|int|null $timezone): static + { + $factory = clone $this; + $factory->settings['timezone'] = $timezone; + + return $factory; + } + + public function __call(string $name, array $arguments): mixed + { + $method = new ReflectionMethod($this->className, $name); + $settings = $this->settings; + + if ($settings && isset($settings['timezone'])) { + $timezoneParameters = array_filter($method->getParameters(), function ($parameter) { + return \in_array($parameter->getName(), ['tz', 'timezone'], true); + }); + $timezoneSetting = $settings['timezone']; + + if (isset($arguments[0]) && \in_array($name, ['instance', 'make', 'create', 'parse'], true)) { + if ($arguments[0] instanceof DateTimeInterface) { + $settings['innerTimezone'] = $settings['timezone']; + } elseif (\is_string($arguments[0]) && date_parse($arguments[0])['is_localtime']) { + unset($settings['timezone'], $settings['innerTimezone']); + } + } + + if (\count($timezoneParameters)) { + $index = key($timezoneParameters); + + if (!isset($arguments[$index])) { + array_splice($arguments, key($timezoneParameters), 0, [$timezoneSetting]); + } + + unset($settings['timezone']); + } + } + + $clock = FactoryImmutable::getCurrentClock(); + FactoryImmutable::setCurrentClock($this); + + try { + $result = $this->className::$name(...$arguments); + } finally { + FactoryImmutable::setCurrentClock($clock); + } + + if (isset($this->translator)) { + $settings['translator'] = $this->translator; + } + + return $result instanceof CarbonInterface && !empty($settings) + ? $result->settings($settings) + : $result; + } + + /** + * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. + */ + protected function getMockedTestNow(DateTimeZone|string|int|null $timezone): ?CarbonInterface + { + $testNow = $this->handleTestNowClosure($this->getTestNow()); + + if ($testNow instanceof CarbonInterface) { + $testNow = $testNow->avoidMutation(); + + if ($timezone !== null) { + return $testNow->setTimezone($timezone); + } + } + + return $testNow; + } + + /** + * Checks if the (date)time string is in a given format with + * given list of pattern replacements. + * + * @example + * ``` + * Carbon::hasFormat('11:12:45', 'h:i:s'); // true + * Carbon::hasFormat('13:12:45', 'h:i:s'); // false + * ``` + * + * @param string $date + * @param string $format + * @param array $replacements + * + * @return bool + */ + private function matchFormatPattern(string $date, string $format, array $replacements): bool + { + // Preg quote, but remove escaped backslashes since we'll deal with escaped characters in the format string. + $regex = str_replace('\\\\', '\\', $format); + // Replace not-escaped letters + $regex = preg_replace_callback( + '/(? $match[1].strtr($match[2], $replacements), + $regex, + ); + // Replace escaped letters by the letter itself + $regex = preg_replace('/(?toRegionName($date); + + throw new InvalidArgumentException( + "Timezone ID '$timezone' is invalid". + ($suggestion && $suggestion !== $timezone ? ", did you mean '$suggestion'?" : '.')."\n". + "It must be one of the IDs from DateTimeZone::listIdentifiers(),\n". + 'For the record, hours/minutes offset are relevant only for a particular moment, '. + 'but not as a default timezone.', + 0, + $previous + ); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php b/plugins/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php new file mode 100644 index 00000000..e1d6f03e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/FactoryImmutable.php @@ -0,0 +1,192 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Closure; +use DateTimeInterface; +use DateTimeZone; +use Symfony\Component\Clock\ClockInterface; +use Symfony\Component\Clock\NativeClock; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * A factory to generate CarbonImmutable instances with common settings. + * + * + * + * @method bool canBeCreatedFromFormat(?string $date, string $format) Checks if the (date)time string is in a given format and valid to create a + * new instance. + * @method ?CarbonImmutable create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * @method CarbonImmutable createFromDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to now. + * @method ?CarbonImmutable createFromFormat($format, $time, $timezone = null) Create a Carbon instance from a specific format. + * @method ?CarbonImmutable createFromIsoFormat(string $format, string $time, $timezone = null, ?string $locale = 'en', ?TranslatorInterface $translator = null) Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * @method ?CarbonImmutable createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific format and a string in a given language. + * @method ?CarbonImmutable createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null) Create a Carbon instance from a specific ISO format and a string in a given language. + * @method CarbonImmutable createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null) Create a Carbon instance from just a time. The date portion is set to today. + * @method CarbonImmutable createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a time string. The date portion is set to today. + * @method CarbonImmutable createFromTimestamp(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp and set the timezone (UTC by default). + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMs(string|int|float $timestamp, DateTimeZone|string|int|null $timezone = null) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampMsUTC($timestamp) Create a Carbon instance from a timestamp in milliseconds. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createFromTimestampUTC(string|int|float $timestamp) Create a Carbon instance from a timestamp keeping the timezone to UTC. + * Timestamp input can be given as int, float or a string containing one or more numbers. + * @method CarbonImmutable createMidnightDate($year = null, $month = null, $day = null, $timezone = null) Create a Carbon instance from just a date. The time portion is set to midnight. + * @method ?CarbonImmutable createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null) Create a new safe Carbon instance from a specific date and time. + * If any of $year, $month or $day are set to null their now() values will + * be used. + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * If $hour is not null then the default values for $minute and $second + * will be 0. + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * @method CarbonImmutable createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null) Create a new Carbon instance from a specific date and time using strict validation. + * @method mixed executeWithLocale(string $locale, callable $func) Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * @method CarbonImmutable fromSerialized($value) Create an instance from a serialized string. + * @method array getAvailableLocales() Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * @method Language[] getAvailableLocalesInfo() Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * @method array getDays() Get the days of the week. + * @method ?string getFallbackLocale() Get the fallback locale. + * @method array getFormatsToIsoReplacements() List of replacements from date() format to isoFormat(). + * @method array getIsoUnits() Returns list of locale units for ISO formatting. + * @method array|false getLastErrors() {@inheritdoc} + * @method string getLocale() Get the current translator locale. + * @method int getMidDayAt() get midday/noon hour + * @method string getTimeFormatByPrecision(string $unitPrecision) Return a format from H:i to H:i:s.u according to given unit precision. + * @method string|Closure|null getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) Returns raw translation message for a given key. + * @method int getWeekEndsAt(?string $locale = null) Get the last day of week. + * @method int getWeekStartsAt(?string $locale = null) Get the first day of week. + * @method bool hasRelativeKeywords(?string $time) Determine if a time string will produce a relative date. + * @method CarbonImmutable instance(DateTimeInterface $date) Create a Carbon instance from a DateTime one. + * @method bool isImmutable() Returns true if the current class/instance is immutable. + * @method bool isModifiableUnit($unit) Returns true if a property can be changed via setter. + * @method bool isMutable() Returns true if the current class/instance is mutable. + * @method bool localeHasDiffOneDayWords(string $locale) Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * @method bool localeHasDiffSyntax(string $locale) Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasDiffTwoDayWords(string $locale) Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * @method bool localeHasPeriodSyntax($locale) Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * @method bool localeHasShortUnits(string $locale) Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * @method ?CarbonImmutable make($var, DateTimeZone|string|null $timezone = null) Make a Carbon instance from given variable if possible. + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * @method void mixin(object|string $mixin) Mix another object into the class. + * @method CarbonImmutable parse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method CarbonImmutable parseFromLocale(string $time, ?string $locale = null, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * @method string pluralUnit(string $unit) Returns standardized plural of a given singular/plural unit name (in English). + * @method ?CarbonImmutable rawCreateFromFormat(string $format, string $time, $timezone = null) Create a Carbon instance from a specific format. + * @method CarbonImmutable rawParse(DateTimeInterface|WeekDay|Month|string|int|float|null $time, DateTimeZone|string|int|null $timezone = null) Create a carbon instance from a string. + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * @method void setFallbackLocale(string $locale) Set the fallback locale. + * @method void setLocale(string $locale) Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. + * @method void setMidDayAt($hour) @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * Set midday/noon hour + * @method string singularUnit(string $unit) Returns standardized singular of a given singular/plural unit name (in English). + * @method CarbonImmutable today(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for today. + * @method CarbonImmutable tomorrow(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for tomorrow. + * @method string translateTimeString(string $timeString, ?string $from = null, ?string $to = null, int $mode = CarbonInterface::TRANSLATE_ALL) Translate a time string from a locale to an other. + * @method string translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null) Translate using translation string or callback available. + * @method CarbonImmutable yesterday(DateTimeZone|string|int|null $timezone = null) Create a Carbon instance for yesterday. + * + * + */ +class FactoryImmutable extends Factory implements ClockInterface +{ + protected string $className = CarbonImmutable::class; + + private static ?self $defaultInstance = null; + + private static ?WrapperClock $currentClock = null; + + /** + * @internal Instance used for static calls, such as Carbon::getTranslator(), CarbonImmutable::setTestNow(), etc. + */ + public static function getDefaultInstance(): self + { + return self::$defaultInstance ??= new self(); + } + + /** + * @internal Instance used for static calls possibly called by non-static methods. + */ + public static function getInstance(): Factory + { + return self::$currentClock?->getFactory() ?? self::getDefaultInstance(); + } + + /** + * @internal Set instance before creating new dates. + */ + public static function setCurrentClock(ClockInterface|Factory|DateTimeInterface|null $currentClock): void + { + if ($currentClock && !($currentClock instanceof WrapperClock)) { + $currentClock = new WrapperClock($currentClock); + } + + self::$currentClock = $currentClock; + } + + /** + * @internal Instance used to link new object to their factory creator. + */ + public static function getCurrentClock(): ?WrapperClock + { + return self::$currentClock; + } + + /** + * Get a Carbon instance for the current date and time. + */ + public function now(DateTimeZone|string|int|null $timezone = null): CarbonImmutable + { + return $this->__call('now', [$timezone]); + } + + public function sleep(int|float $seconds): void + { + if ($this->hasTestNow()) { + $this->setTestNow($this->getTestNow()->avoidMutation()->addSeconds($seconds)); + + return; + } + + (new NativeClock('UTC'))->sleep($seconds); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa.php new file mode 100644 index 00000000..f3431e4b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/aa_DJ.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php new file mode 100644 index 00000000..c6e23c0d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_DJ.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], + 'months_short' => ['qun', 'nah', 'cig', 'agd', 'cax', 'qas', 'qad', 'leq', 'way', 'dit', 'xim', 'kax'], + 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], + 'weekdays_short' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], + 'weekdays_min' => ['aca', 'etl', 'tal', 'arb', 'kam', 'gum', 'sab'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['saaku', 'carra'], + + 'year' => ':count gaqambo', // less reliable + 'y' => ':count gaqambo', // less reliable + 'a_year' => ':count gaqambo', // less reliable + + 'month' => ':count àlsa', + 'm' => ':count àlsa', + 'a_month' => ':count àlsa', + + 'day' => ':count saaku', // less reliable + 'd' => ':count saaku', // less reliable + 'a_day' => ':count saaku', // less reliable + + 'hour' => ':count ayti', // less reliable + 'h' => ':count ayti', // less reliable + 'a_hour' => ':count ayti', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php new file mode 100644 index 00000000..f8f395b7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], + 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], + 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], + 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], + 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['saaku', 'carra'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php new file mode 100644 index 00000000..64612253 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ER@saaho.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Qunxa Garablu', 'Naharsi Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Leqeeni', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], + 'months_short' => ['Qun', 'Nah', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], + 'weekdays' => ['Naba Sambat', 'Sani', 'Salus', 'Rabuq', 'Camus', 'Jumqata', 'Qunxa Sambat'], + 'weekdays_short' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], + 'weekdays_min' => ['Nab', 'San', 'Sal', 'Rab', 'Cam', 'Jum', 'Qun'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['saaku', 'carra'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php new file mode 100644 index 00000000..b6f7d0b3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/aa_ET.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Qunxa Garablu', 'Kudo', 'Ciggilta Kudo', 'Agda Baxisso', 'Caxah Alsa', 'Qasa Dirri', 'Qado Dirri', 'Liiqen', 'Waysu', 'Diteli', 'Ximoli', 'Kaxxa Garablu'], + 'months_short' => ['Qun', 'Kud', 'Cig', 'Agd', 'Cax', 'Qas', 'Qad', 'Leq', 'Way', 'Dit', 'Xim', 'Kax'], + 'weekdays' => ['Acaada', 'Etleeni', 'Talaata', 'Arbaqa', 'Kamiisi', 'Gumqata', 'Sabti'], + 'weekdays_short' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], + 'weekdays_min' => ['Aca', 'Etl', 'Tal', 'Arb', 'Kam', 'Gum', 'Sab'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['saaku', 'carra'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af.php new file mode 100644 index 00000000..87592fe1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - JD Isaacks + * - Pierre du Plessis + */ +return [ + 'year' => ':count jaar', + 'a_year' => '\'n jaar|:count jaar', + 'y' => ':count j.', + 'month' => ':count maand|:count maande', + 'a_month' => '\'n maand|:count maande', + 'm' => ':count maa.', + 'week' => ':count week|:count weke', + 'a_week' => '\'n week|:count weke', + 'w' => ':count w.', + 'day' => ':count dag|:count dae', + 'a_day' => '\'n dag|:count dae', + 'd' => ':count d.', + 'hour' => ':count uur', + 'a_hour' => '\'n uur|:count uur', + 'h' => ':count u.', + 'minute' => ':count minuut|:count minute', + 'a_minute' => '\'n minuut|:count minute', + 'min' => ':count min.', + 'second' => ':count sekond|:count sekondes', + 'a_second' => '\'n paar sekondes|:count sekondes', + 's' => ':count s.', + 'ago' => ':time gelede', + 'from_now' => 'oor :time', + 'after' => ':time na', + 'before' => ':time voor', + 'diff_now' => 'Nou', + 'diff_today' => 'Vandag', + 'diff_today_regexp' => 'Vandag(?:\\s+om)?', + 'diff_yesterday' => 'Gister', + 'diff_yesterday_regexp' => 'Gister(?:\\s+om)?', + 'diff_tomorrow' => 'Môre', + 'diff_tomorrow_regexp' => 'Môre(?:\\s+om)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Vandag om] LT', + 'nextDay' => '[Môre om] LT', + 'nextWeek' => 'dddd [om] LT', + 'lastDay' => '[Gister om] LT', + 'lastWeek' => '[Laas] dddd [om] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static fn ($number) => $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'), + 'meridiem' => ['VM', 'NM'], + 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], + 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mei', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], + 'weekdays_short' => ['Son', 'Maa', 'Din', 'Woe', 'Don', 'Vry', 'Sat'], + 'weekdays_min' => ['So', 'Ma', 'Di', 'Wo', 'Do', 'Vr', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' en '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php new file mode 100644 index 00000000..f2fcf053 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_NA.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/af.php', [ + 'meridiem' => ['v', 'n'], + 'weekdays' => ['Sondag', 'Maandag', 'Dinsdag', 'Woensdag', 'Donderdag', 'Vrydag', 'Saterdag'], + 'weekdays_short' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], + 'weekdays_min' => ['So.', 'Ma.', 'Di.', 'Wo.', 'Do.', 'Vr.', 'Sa.'], + 'months' => ['Januarie', 'Februarie', 'Maart', 'April', 'Mei', 'Junie', 'Julie', 'Augustus', 'September', 'Oktober', 'November', 'Desember'], + 'months_short' => ['Jan.', 'Feb.', 'Mrt.', 'Apr.', 'Mei', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Des.'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'DD MMM YYYY', + 'LLL' => 'DD MMMM YYYY HH:mm', + 'LLLL' => 'dddd, DD MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php new file mode 100644 index 00000000..27896bd0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/af_ZA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/af.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agq.php new file mode 100644 index 00000000..70114649 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agq.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['a.g', 'a.k'], + 'weekdays' => ['tsuʔntsɨ', 'tsuʔukpà', 'tsuʔughɔe', 'tsuʔutɔ̀mlò', 'tsuʔumè', 'tsuʔughɨ̂m', 'tsuʔndzɨkɔʔɔ'], + 'weekdays_short' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], + 'weekdays_min' => ['nts', 'kpa', 'ghɔ', 'tɔm', 'ume', 'ghɨ', 'dzk'], + 'months' => ['ndzɔ̀ŋɔ̀nùm', 'ndzɔ̀ŋɔ̀kƗ̀zùʔ', 'ndzɔ̀ŋɔ̀tƗ̀dʉ̀ghà', 'ndzɔ̀ŋɔ̀tǎafʉ̄ghā', 'ndzɔ̀ŋèsèe', 'ndzɔ̀ŋɔ̀nzùghò', 'ndzɔ̀ŋɔ̀dùmlo', 'ndzɔ̀ŋɔ̀kwîfɔ̀e', 'ndzɔ̀ŋɔ̀tƗ̀fʉ̀ghàdzughù', 'ndzɔ̀ŋɔ̀ghǔuwelɔ̀m', 'ndzɔ̀ŋɔ̀chwaʔàkaa wo', 'ndzɔ̀ŋèfwòo'], + 'months_short' => ['nùm', 'kɨz', 'tɨd', 'taa', 'see', 'nzu', 'dum', 'fɔe', 'dzu', 'lɔm', 'kaa', 'fwo'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr.php new file mode 100644 index 00000000..8f036ae8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/agr_PE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php new file mode 100644 index 00000000..54a326af --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/agr_PE.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - somosazucar.org libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Petsatin', 'Kupitin', 'Uyaitin', 'Tayutin', 'Kegketin', 'Tegmatin', 'Kuntutin', 'Yagkujutin', 'Daiktatin', 'Ipamtatin', 'Shinutin', 'Sakamtin'], + 'months_short' => ['Pet', 'Kup', 'Uya', 'Tay', 'Keg', 'Teg', 'Kun', 'Yag', 'Dait', 'Ipam', 'Shin', 'Sak'], + 'weekdays' => ['Tuntuamtin', 'Achutin', 'Kugkuktin', 'Saketin', 'Shimpitin', 'Imaptin', 'Bataetin'], + 'weekdays_short' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], + 'weekdays_min' => ['Tun', 'Ach', 'Kug', 'Sak', 'Shim', 'Im', 'Bat'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 7, + 'meridiem' => ['VM', 'NM'], + + 'year' => ':count yaya', // less reliable + 'y' => ':count yaya', // less reliable + 'a_year' => ':count yaya', // less reliable + + 'month' => ':count nantu', // less reliable + 'm' => ':count nantu', // less reliable + 'a_month' => ':count nantu', // less reliable + + 'day' => ':count nayaim', // less reliable + 'd' => ':count nayaim', // less reliable + 'a_day' => ':count nayaim', // less reliable + + 'hour' => ':count kuwiš', // less reliable + 'h' => ':count kuwiš', // less reliable + 'a_hour' => ':count kuwiš', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak.php new file mode 100644 index 00000000..5a64be37 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ak_GH.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php new file mode 100644 index 00000000..13819467 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ak_GH.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY/MM/DD', + ], + 'months' => ['Sanda-Ɔpɛpɔn', 'Kwakwar-Ɔgyefuo', 'Ebɔw-Ɔbenem', 'Ebɔbira-Oforisuo', 'Esusow Aketseaba-Kɔtɔnimba', 'Obirade-Ayɛwohomumu', 'Ayɛwoho-Kitawonsa', 'Difuu-Ɔsandaa', 'Fankwa-Ɛbɔ', 'Ɔbɛsɛ-Ahinime', 'Ɔberɛfɛw-Obubuo', 'Mumu-Ɔpɛnimba'], + 'months_short' => ['S-Ɔ', 'K-Ɔ', 'E-Ɔ', 'E-O', 'E-K', 'O-A', 'A-K', 'D-Ɔ', 'F-Ɛ', 'Ɔ-A', 'Ɔ-O', 'M-Ɔ'], + 'weekdays' => ['Kwesida', 'Dwowda', 'Benada', 'Wukuda', 'Yawda', 'Fida', 'Memeneda'], + 'weekdays_short' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], + 'weekdays_min' => ['Kwe', 'Dwo', 'Ben', 'Wuk', 'Yaw', 'Fia', 'Mem'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['AN', 'EW'], + + 'year' => ':count afe', + 'y' => ':count afe', + 'a_year' => ':count afe', + + 'month' => ':count bosume', + 'm' => ':count bosume', + 'a_month' => ':count bosume', + + 'day' => ':count ɛda', + 'd' => ':count ɛda', + 'a_day' => ':count ɛda', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am.php new file mode 100644 index 00000000..63bf72d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/am_ET.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php new file mode 100644 index 00000000..7cc676b3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/am_ET.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕሪል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክቶበር', 'ኖቬምበር', 'ዲሴምበር'], + 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], + 'weekdays' => ['እሑድ', 'ሰኞ', 'ማክሰኞ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], + 'weekdays_short' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], + 'weekdays_min' => ['እሑድ', 'ሰኞ ', 'ማክሰ', 'ረቡዕ', 'ሐሙስ', 'ዓርብ', 'ቅዳሜ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ጡዋት', 'ከሰዓት'], + + 'year' => ':count አመት', + 'y' => ':count አመት', + 'a_year' => ':count አመት', + + 'month' => ':count ወር', + 'm' => ':count ወር', + 'a_month' => ':count ወር', + + 'week' => ':count ሳምንት', + 'w' => ':count ሳምንት', + 'a_week' => ':count ሳምንት', + + 'day' => ':count ቀን', + 'd' => ':count ቀን', + 'a_day' => ':count ቀን', + + 'hour' => ':count ሰዓት', + 'h' => ':count ሰዓት', + 'a_hour' => ':count ሰዓት', + + 'minute' => ':count ደቂቃ', + 'min' => ':count ደቂቃ', + 'a_minute' => ':count ደቂቃ', + + 'second' => ':count ሴኮንድ', + 's' => ':count ሴኮንድ', + 'a_second' => ':count ሴኮንድ', + + 'ago' => 'ከ:time በፊት', + 'from_now' => 'በ:time ውስጥ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an.php new file mode 100644 index 00000000..565abf26 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/an_ES.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php new file mode 100644 index 00000000..faf8ae07 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/an_ES.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Softaragones Jordi Mallach Pérez, Juan Pablo Martínez bug-glibc-locales@gnu.org, softaragones@softaragones.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['chinero', 'febrero', 'marzo', 'abril', 'mayo', 'chunyo', 'chuliol', 'agosto', 'setiembre', 'octubre', 'noviembre', 'aviento'], + 'months_short' => ['chi', 'feb', 'mar', 'abr', 'may', 'chn', 'chl', 'ago', 'set', 'oct', 'nov', 'avi'], + 'weekdays' => ['domingo', 'luns', 'martes', 'mierques', 'chueves', 'viernes', 'sabado'], + 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], + 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'chu', 'vie', 'sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count año', + 'y' => ':count año', + 'a_year' => ':count año', + + 'month' => ':count mes', + 'm' => ':count mes', + 'a_month' => ':count mes', + + 'week' => ':count semana', + 'w' => ':count semana', + 'a_week' => ':count semana', + + 'day' => ':count día', + 'd' => ':count día', + 'a_day' => ':count día', + + 'hour' => ':count reloch', // less reliable + 'h' => ':count reloch', // less reliable + 'a_hour' => ':count reloch', // less reliable + + 'minute' => ':count minuto', + 'min' => ':count minuto', + 'a_minute' => ':count minuto', + + 'second' => ':count segundo', + 's' => ':count segundo', + 'a_second' => ':count segundo', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp.php new file mode 100644 index 00000000..b56c67bb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/anp_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php new file mode 100644 index 00000000..00baa980 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/anp_IN.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bhashaghar@googlegroups.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर"'], + 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], + 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], + 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar.php new file mode 100644 index 00000000..5f73f639 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Atef Ben Ali (atefBB) + * - Ibrahim AshShohail + * - MLTDev + * - Mohamed Sabil (mohamedsabil83) + * - Yazan Alnugnugh (yazan-alnugnugh) + */ +$months = [ + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => ':time من الآن', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم عند الساعة] LT', + 'nextDay' => '[غدًا عند الساعة] LT', + 'nextWeek' => 'dddd [عند الساعة] LT', + 'lastDay' => '[أمس عند الساعة] LT', + 'lastWeek' => 'dddd [عند الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php new file mode 100644 index 00000000..35a22b1d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_AE.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت '], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php new file mode 100644 index 00000000..35180965 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_BH.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DJ.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php new file mode 100644 index 00000000..aea4eeec --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_DZ.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - Josh Soref + * - Noureddine LOUAHEDJ + * - JD Isaacks + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + */ +$months = [ + 'جانفي', + 'فيفري', + 'مارس', + 'أفريل', + 'ماي', + 'جوان', + 'جويلية', + 'أوت', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => 'في :time', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['أح', 'إث', 'ثلا', 'أر', 'خم', 'جم', 'سب'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 4, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم على الساعة] LT', + 'nextDay' => '[غدا على الساعة] LT', + 'nextWeek' => 'dddd [على الساعة] LT', + 'lastDay' => '[أمس على الساعة] LT', + 'lastWeek' => 'dddd [على الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php new file mode 100644 index 00000000..35180965 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EG.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_EH.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_ER.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IL.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php new file mode 100644 index 00000000..5fecf70f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IN.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php new file mode 100644 index 00000000..2d420084 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_IQ.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php new file mode 100644 index 00000000..2d420084 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_JO.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KM.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php new file mode 100644 index 00000000..b3fb1cfe --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_KW.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - Josh Soref + * - Nusret Parlak + * - JD Isaacks + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + * - Abdullah-Alhariri + */ +$months = [ + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'ماي', + 'يونيو', + 'يوليوز', + 'غشت', + 'شتنبر', + 'أكتوبر', + 'نونبر', + 'دجنبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => 'في :time', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم على الساعة] LT', + 'nextDay' => '[غدا على الساعة] LT', + 'nextWeek' => 'dddd [على الساعة] LT', + 'lastDay' => '[أمس على الساعة] LT', + 'lastWeek' => 'dddd [على الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php new file mode 100644 index 00000000..2792745c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LB.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php new file mode 100644 index 00000000..1f0af49d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_LY.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Atef Ben Ali (atefBB) + * - Ibrahim AshShohail + * - MLTDev + */ + +$months = [ + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), + 'a_year' => implode('|', [':count سنة', 'سنة', 'سنتين', ':count سنوات', ':count سنة']), + 'month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), + 'a_month' => implode('|', [':count شهر', 'شهر', 'شهرين', ':count أشهر', ':count شهر']), + 'week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), + 'a_week' => implode('|', [':count أسبوع', 'أسبوع', 'أسبوعين', ':count أسابيع', ':count أسبوع']), + 'day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), + 'a_day' => implode('|', [':count يوم', 'يوم', 'يومين', ':count أيام', ':count يوم']), + 'hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), + 'a_hour' => implode('|', [':count ساعة', 'ساعة', 'ساعتين', ':count ساعات', ':count ساعة']), + 'minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), + 'a_minute' => implode('|', [':count دقيقة', 'دقيقة', 'دقيقتين', ':count دقائق', ':count دقيقة']), + 'second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), + 'a_second' => implode('|', [':count ثانية', 'ثانية', 'ثانيتين', ':count ثواني', ':count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => ':time من الآن', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['مرة', 'مرة', ':count مرتين', ':count مرات', ':count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم عند الساعة] LT', + 'nextDay' => '[غدًا عند الساعة] LT', + 'nextWeek' => 'dddd [عند الساعة] LT', + 'lastDay' => '[أمس عند الساعة] LT', + 'lastWeek' => 'dddd [عند الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php new file mode 100644 index 00000000..047ae05a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MA.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - Josh Soref + * - JD Isaacks + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + */ +$months = [ + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'ماي', + 'يونيو', + 'يوليوز', + 'غشت', + 'شتنبر', + 'أكتوبر', + 'نونبر', + 'دجنبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => 'في :time', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم على الساعة] LT', + 'nextDay' => '[غدا على الساعة] LT', + 'nextWeek' => 'dddd [على الساعة] LT', + 'lastDay' => '[أمس على الساعة] LT', + 'lastWeek' => 'dddd [على الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_MR.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php new file mode 100644 index 00000000..35180965 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_OM.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php new file mode 100644 index 00000000..503c60d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_PS.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php new file mode 100644 index 00000000..35180965 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_QA.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php new file mode 100644 index 00000000..550b0c73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SA.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - Josh Soref + * - JD Isaacks + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + * - Abdullah-Alhariri + */ +$months = [ + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => 'في :time', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم على الساعة] LT', + 'nextDay' => '[غدا على الساعة] LT', + 'nextWeek' => 'dddd [على الساعة] LT', + 'lastDay' => '[أمس على الساعة] LT', + 'lastWeek' => 'dddd [على الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php new file mode 100644 index 00000000..35180965 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SD.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SO.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php new file mode 100644 index 00000000..32f32825 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SS.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php new file mode 100644 index 00000000..2d420084 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_SY.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'months_short' => ['كانون الثاني', 'شباط', 'آذار', 'نيسان', 'أيار', 'حزيران', 'تموز', 'آب', 'أيلول', 'تشرين الأول', 'تشرين الثاني', 'كانون الأول'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php new file mode 100644 index 00000000..c2d4b43d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_Shakl.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Abdellah Chadidi + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + */ +// Same for long and short +$months = [ + // @TODO add shakl to months + 'يناير', + 'فبراير', + 'مارس', + 'أبريل', + 'مايو', + 'يونيو', + 'يوليو', + 'أغسطس', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), + 'a_year' => implode('|', ['{0}:count سَنَة', '{1}سَنَة', '{2}سَنَتَيْن', ']2,11[:count سَنَوَات', ']10,Inf[:count سَنَة']), + 'month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), + 'a_month' => implode('|', ['{0}:count شَهْرَ', '{1}شَهْرَ', '{2}شَهْرَيْن', ']2,11[:count أَشْهُر', ']10,Inf[:count شَهْرَ']), + 'week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), + 'a_week' => implode('|', ['{0}:count أُسْبُوع', '{1}أُسْبُوع', '{2}أُسْبُوعَيْن', ']2,11[:count أَسَابِيع', ']10,Inf[:count أُسْبُوع']), + 'day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), + 'a_day' => implode('|', ['{0}:count يَوْم', '{1}يَوْم', '{2}يَوْمَيْن', ']2,11[:count أَيَّام', ']10,Inf[:count يَوْم']), + 'hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), + 'a_hour' => implode('|', ['{0}:count سَاعَة', '{1}سَاعَة', '{2}سَاعَتَيْن', ']2,11[:count سَاعَات', ']10,Inf[:count سَاعَة']), + 'minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), + 'a_minute' => implode('|', ['{0}:count دَقِيقَة', '{1}دَقِيقَة', '{2}دَقِيقَتَيْن', ']2,11[:count دَقَائِق', ']10,Inf[:count دَقِيقَة']), + 'second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), + 'a_second' => implode('|', ['{0}:count ثَانِيَة', '{1}ثَانِيَة', '{2}ثَانِيَتَيْن', ']2,11[:count ثَوَان', ']10,Inf[:count ثَانِيَة']), + 'ago' => 'مُنْذُ :time', + 'from_now' => 'مِنَ الْآن :time', + 'after' => 'بَعْدَ :time', + 'before' => 'قَبْلَ :time', + + // @TODO add shakl to translations below + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدًا(?:\\s+عند)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'اث', 'ثل', 'أر', 'خم', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم عند الساعة] LT', + 'nextDay' => '[غدًا عند الساعة] LT', + 'nextWeek' => 'dddd [عند الساعة] LT', + 'lastDay' => '[أمس عند الساعة] LT', + 'lastWeek' => 'dddd [عند الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php new file mode 100644 index 00000000..e790b99e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TD.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ar.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php new file mode 100644 index 00000000..f096678f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_TN.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - JD Isaacks + * - Atef Ben Ali (atefBB) + * - Mohamed Sabil (mohamedsabil83) + */ +$months = [ + 'جانفي', + 'فيفري', + 'مارس', + 'أفريل', + 'ماي', + 'جوان', + 'جويلية', + 'أوت', + 'سبتمبر', + 'أكتوبر', + 'نوفمبر', + 'ديسمبر', +]; + +return [ + 'year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'a_year' => implode('|', ['{0}:count سنة', '{1}سنة', '{2}سنتين', ']2,11[:count سنوات', ']10,Inf[:count سنة']), + 'month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'a_month' => implode('|', ['{0}:count شهر', '{1}شهر', '{2}شهرين', ']2,11[:count أشهر', ']10,Inf[:count شهر']), + 'week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'a_week' => implode('|', ['{0}:count أسبوع', '{1}أسبوع', '{2}أسبوعين', ']2,11[:count أسابيع', ']10,Inf[:count أسبوع']), + 'day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'a_day' => implode('|', ['{0}:count يوم', '{1}يوم', '{2}يومين', ']2,11[:count أيام', ']10,Inf[:count يوم']), + 'hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'a_hour' => implode('|', ['{0}:count ساعة', '{1}ساعة', '{2}ساعتين', ']2,11[:count ساعات', ']10,Inf[:count ساعة']), + 'minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'a_minute' => implode('|', ['{0}:count دقيقة', '{1}دقيقة', '{2}دقيقتين', ']2,11[:count دقائق', ']10,Inf[:count دقيقة']), + 'second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'a_second' => implode('|', ['{0}:count ثانية', '{1}ثانية', '{2}ثانيتين', ']2,11[:count ثواني', ']10,Inf[:count ثانية']), + 'ago' => 'منذ :time', + 'from_now' => 'في :time', + 'after' => 'بعد :time', + 'before' => 'قبل :time', + 'diff_now' => 'الآن', + 'diff_today' => 'اليوم', + 'diff_today_regexp' => 'اليوم(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_yesterday' => 'أمس', + 'diff_yesterday_regexp' => 'أمس(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_tomorrow' => 'غداً', + 'diff_tomorrow_regexp' => 'غدا(?:\\s+على)?(?:\\s+الساعة)?', + 'diff_before_yesterday' => 'قبل الأمس', + 'diff_after_tomorrow' => 'بعد غد', + 'period_recurrences' => implode('|', ['{0}مرة', '{1}مرة', '{2}:count مرتين', ']2,11[:count مرات', ']10,Inf[:count مرة']), + 'period_interval' => 'كل :interval', + 'period_start_date' => 'من :date', + 'period_end_date' => 'إلى :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['أحد', 'اثنين', 'ثلاثاء', 'أربعاء', 'خميس', 'جمعة', 'سبت'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اليوم على الساعة] LT', + 'nextDay' => '[غدا على الساعة] LT', + 'nextWeek' => 'dddd [على الساعة] LT', + 'lastDay' => '[أمس على الساعة] LT', + 'lastWeek' => 'dddd [على الساعة] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ص', 'م'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php new file mode 100644 index 00000000..169fe88a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ar_YE.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + * - Abdullah-Alhariri + */ +return array_replace_recursive(require __DIR__.'/ar.php', [ + 'formats' => [ + 'L' => 'DD MMM, YYYY', + ], + 'months' => ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر'], + 'months_short' => ['ينا', 'فبر', 'مار', 'أبر', 'ماي', 'يون', 'يول', 'أغس', 'سبت', 'أكت', 'نوف', 'ديس'], + 'weekdays' => ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + 'weekdays_short' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'weekdays_min' => ['ح', 'ن', 'ث', 'ر', 'خ', 'ج', 'س'], + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰٤', '۰٥', '۰٦', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱٤', '۱٥', '۱٦', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲٤', '۲٥', '۲٦', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳٤', '۳٥', '۳٦', '۳۷', '۳۸', '۳۹', '٤۰', '٤۱', '٤۲', '٤۳', '٤٤', '٤٥', '٤٦', '٤۷', '٤۸', '٤۹', '٥۰', '٥۱', '٥۲', '٥۳', '٥٤', '٥٥', '٥٦', '٥۷', '٥۸', '٥۹', '٦۰', '٦۱', '٦۲', '٦۳', '٦٤', '٦٥', '٦٦', '٦۷', '٦۸', '٦۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷٤', '۷٥', '۷٦', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸٤', '۸٥', '۸٦', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹٤', '۹٥', '۹٦', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as.php new file mode 100644 index 00000000..04bc3dfd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/as_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php new file mode 100644 index 00000000..f2499abf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/as_IN.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Amitakhya Phukan, Red Hat bug-glibc@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D-MM-YYYY', + ], + 'months' => ['জানুৱাৰী', 'ফেব্ৰুৱাৰী', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'ছেপ্তেম্বৰ', 'অক্টোবৰ', 'নৱেম্বৰ', 'ডিচেম্বৰ'], + 'months_short' => ['জানু', 'ফেব্ৰু', 'মাৰ্চ', 'এপ্ৰিল', 'মে', 'জুন', 'জুলাই', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], + 'weekdays' => ['দেওবাৰ', 'সোমবাৰ', 'মঙ্গলবাৰ', 'বুধবাৰ', 'বৃহষ্পতিবাৰ', 'শুক্ৰবাৰ', 'শনিবাৰ'], + 'weekdays_short' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], + 'weekdays_min' => ['দেও', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহষ্পতি', 'শুক্ৰ', 'শনি'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['পূৰ্ব্বাহ্ন', 'অপৰাহ্ন'], + + 'year' => ':count বছৰ', + 'y' => ':count বছৰ', + 'a_year' => ':count বছৰ', + + 'month' => ':count মাহ', + 'm' => ':count মাহ', + 'a_month' => ':count মাহ', + + 'week' => ':count সপ্তাহ', + 'w' => ':count সপ্তাহ', + 'a_week' => ':count সপ্তাহ', + + 'day' => ':count বাৰ', + 'd' => ':count বাৰ', + 'a_day' => ':count বাৰ', + + 'hour' => ':count ঘণ্টা', + 'h' => ':count ঘণ্টা', + 'a_hour' => ':count ঘণ্টা', + + 'minute' => ':count মিনিট', + 'min' => ':count মিনিট', + 'a_minute' => ':count মিনিট', + + 'second' => ':count দ্বিতীয়', + 's' => ':count দ্বিতীয়', + 'a_second' => ':count দ্বিতীয়', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/asa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/asa.php new file mode 100644 index 00000000..03bb4839 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/asa.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['icheheavo', 'ichamthi'], + 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Ijm', 'Jmo'], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Dec'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast.php new file mode 100644 index 00000000..d9bdebe5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Jordi Mallach jordi@gnu.org + * - Adolfo Jayme-Barrientos (fitojb) + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['de xineru', 'de febreru', 'de marzu', 'd’abril', 'de mayu', 'de xunu', 'de xunetu', 'd’agostu', 'de setiembre', 'd’ochobre', 'de payares', 'd’avientu'], + 'months_short' => ['xin', 'feb', 'mar', 'abr', 'may', 'xun', 'xnt', 'ago', 'set', 'och', 'pay', 'avi'], + 'weekdays' => ['domingu', 'llunes', 'martes', 'miércoles', 'xueves', 'vienres', 'sábadu'], + 'weekdays_short' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], + 'weekdays_min' => ['dom', 'llu', 'mar', 'mié', 'xue', 'vie', 'sáb'], + + 'year' => ':count añu|:count años', + 'y' => ':count añu|:count años', + 'a_year' => 'un añu|:count años', + + 'month' => ':count mes', + 'm' => ':count mes', + 'a_month' => 'un mes|:count mes', + + 'week' => ':count selmana|:count selmanes', + 'w' => ':count selmana|:count selmanes', + 'a_week' => 'una selmana|:count selmanes', + + 'day' => ':count día|:count díes', + 'd' => ':count día|:count díes', + 'a_day' => 'un día|:count díes', + + 'hour' => ':count hora|:count hores', + 'h' => ':count hora|:count hores', + 'a_hour' => 'una hora|:count hores', + + 'minute' => ':count minutu|:count minutos', + 'min' => ':count minutu|:count minutos', + 'a_minute' => 'un minutu|:count minutos', + + 'second' => ':count segundu|:count segundos', + 's' => ':count segundu|:count segundos', + 'a_second' => 'un segundu|:count segundos', + + 'ago' => 'hai :time', + 'from_now' => 'en :time', + 'after' => ':time dempués', + 'before' => ':time enantes', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php new file mode 100644 index 00000000..04d75621 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ast_ES.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ast.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php new file mode 100644 index 00000000..d6a6f638 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ayc_PE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php new file mode 100644 index 00000000..22374e00 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ayc_PE.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - runasimipi.org libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['inïru', 'phiwriru', 'marsu', 'awrila', 'mayu', 'junyu', 'julyu', 'awustu', 'sitimri', 'uktuwri', 'nuwimri', 'risimri'], + 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'jun', 'jul', 'awu', 'sit', 'ukt', 'nuw', 'ris'], + 'weekdays' => ['tuminku', 'lunisa', 'martisa', 'mirkulisa', 'juywisa', 'wirnisa', 'sawäru'], + 'weekdays_short' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], + 'weekdays_min' => ['tum', 'lun', 'mar', 'mir', 'juy', 'wir', 'saw'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['VM', 'NM'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az.php new file mode 100644 index 00000000..1d71d1da --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Kunal Marwaha + * - François B + * - JD Isaacks + * - Orxan + * - Şəhriyar İmanov + * - Baran Şengül + * - Novruz Rahimov + */ +return [ + 'year' => ':count il', + 'a_year' => '{1}bir il|[-Inf,Inf]:count il', + 'y' => ':count il', + 'month' => ':count ay', + 'a_month' => '{1}bir ay|[-Inf,Inf]:count ay', + 'm' => ':count ay', + 'week' => ':count həftə', + 'a_week' => '{1}bir həftə|[-Inf,Inf]:count həftə', + 'w' => ':count h.', + 'day' => ':count gün', + 'a_day' => '{1}bir gün|[-Inf,Inf]:count gün', + 'd' => ':count g.', + 'hour' => ':count saat', + 'a_hour' => '{1}bir saat|[-Inf,Inf]:count saat', + 'h' => ':count s.', + 'minute' => ':count dəqiqə', + 'a_minute' => '{1}bir dəqiqə|[-Inf,Inf]:count dəqiqə', + 'min' => ':count d.', + 'second' => ':count saniyə', + 'a_second' => '{1}birneçə saniyə|[-Inf,Inf]:count saniyə', + 's' => ':count san.', + 'ago' => ':time əvvəl', + 'from_now' => ':time sonra', + 'after' => ':time sonra', + 'before' => ':time əvvəl', + 'diff_now' => 'indi', + 'diff_today' => 'bugün', + 'diff_today_regexp' => 'bugün(?:\\s+saat)?', + 'diff_yesterday' => 'dünən', + 'diff_tomorrow' => 'sabah', + 'diff_tomorrow_regexp' => 'sabah(?:\\s+saat)?', + 'diff_before_yesterday' => 'srağagün', + 'diff_after_tomorrow' => 'birisi gün', + 'period_recurrences' => ':count dəfədən bir', + 'period_interval' => 'hər :interval', + 'period_start_date' => ':date tarixindən başlayaraq', + 'period_end_date' => ':date tarixinədək', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[bugün saat] LT', + 'nextDay' => '[sabah saat] LT', + 'nextWeek' => '[gələn həftə] dddd [saat] LT', + 'lastDay' => '[dünən] LT', + 'lastWeek' => '[keçən həftə] dddd [saat] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + if ($number === 0) { // special case for zero + return "$number-ıncı"; + } + + static $suffixes = [ + 1 => '-inci', + 5 => '-inci', + 8 => '-inci', + 70 => '-inci', + 80 => '-inci', + 2 => '-nci', + 7 => '-nci', + 20 => '-nci', + 50 => '-nci', + 3 => '-üncü', + 4 => '-üncü', + 100 => '-üncü', + 6 => '-ncı', + 9 => '-uncu', + 10 => '-uncu', + 30 => '-uncu', + 60 => '-ıncı', + 90 => '-ıncı', + ]; + + $lastDigit = $number % 10; + + return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'gecə'; + } + if ($hour < 12) { + return 'səhər'; + } + if ($hour < 17) { + return 'gündüz'; + } + + return 'axşam'; + }, + 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], + 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], + 'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'], + 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], + 'weekdays_short' => ['baz', 'bze', 'çax', 'çər', 'cax', 'cüm', 'şən'], + 'weekdays_min' => ['bz', 'be', 'ça', 'çə', 'ca', 'cü', 'şə'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' və '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php new file mode 100644 index 00000000..2acf881a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_AZ.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pablo Saratxaga pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/az.php', [ + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['bazar günü', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], + 'weekdays_short' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], + 'weekdays_min' => ['baz', 'ber', 'çax', 'çər', 'cax', 'cüm', 'şnb'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php new file mode 100644 index 00000000..28fc62fe --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Cyrl.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/az.php', [ + 'weekdays' => ['базар', 'базар ертәси', 'чәршәнбә ахшамы', 'чәршәнбә', 'ҹүмә ахшамы', 'ҹүмә', 'шәнбә'], + 'weekdays_short' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], + 'weekdays_min' => ['Б.', 'Б.Е.', 'Ч.А.', 'Ч.', 'Ҹ.А.', 'Ҹ.', 'Ш.'], + 'months' => ['јанвар', 'феврал', 'март', 'апрел', 'май', 'ијун', 'ијул', 'август', 'сентјабр', 'октјабр', 'нојабр', 'декабр'], + 'months_short' => ['јан', 'фев', 'мар', 'апр', 'май', 'ијн', 'ијл', 'авг', 'сен', 'окт', 'ној', 'дек'], + 'months_standalone' => ['Јанвар', 'Феврал', 'Март', 'Апрел', 'Май', 'Ијун', 'Ијул', 'Август', 'Сентјабр', 'Октјабр', 'Нојабр', 'Декабр'], + 'meridiem' => ['а', 'п'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php new file mode 100644 index 00000000..991a0efb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_IR.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Mousa Moradi mousamk@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'OY/OM/OD', + ], + 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], + 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مئی', 'ژوئن', 'جولای', 'آقۇست', 'سپتامبر', 'اوْکتوْبر', 'نوْوامبر', 'دسامبر'], + 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], + 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], + 'weekdays_min' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چارشنبه', 'جۆمعه آخشامی', 'جۆمعه', 'شنبه'], + 'first_day_of_week' => 6, + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php new file mode 100644 index 00000000..0be33914 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/az_Latn.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/az.php', [ + 'meridiem' => ['a', 'p'], + 'weekdays' => ['bazar', 'bazar ertəsi', 'çərşənbə axşamı', 'çərşənbə', 'cümə axşamı', 'cümə', 'şənbə'], + 'weekdays_short' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], + 'weekdays_min' => ['B.', 'B.E.', 'Ç.A.', 'Ç.', 'C.A.', 'C.', 'Ş.'], + 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], + 'months_short' => ['yan', 'fev', 'mar', 'apr', 'may', 'iyn', 'iyl', 'avq', 'sen', 'okt', 'noy', 'dek'], + 'months_standalone' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'İyun', 'İyul', 'Avqust', 'Sentyabr', 'Oktyabr', 'Noyabr', 'Dekabr'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'D MMMM YYYY, dddd HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bas.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bas.php new file mode 100644 index 00000000..41bfa1d8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bas.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['I bikɛ̂glà', 'I ɓugajɔp'], + 'weekdays' => ['ŋgwà nɔ̂y', 'ŋgwà njaŋgumba', 'ŋgwà ûm', 'ŋgwà ŋgê', 'ŋgwà mbɔk', 'ŋgwà kɔɔ', 'ŋgwà jôn'], + 'weekdays_short' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], + 'weekdays_min' => ['nɔy', 'nja', 'uum', 'ŋge', 'mbɔ', 'kɔɔ', 'jon'], + 'months' => ['Kɔndɔŋ', 'Màcɛ̂l', 'Màtùmb', 'Màtop', 'M̀puyɛ', 'Hìlòndɛ̀', 'Njèbà', 'Hìkaŋ', 'Dìpɔ̀s', 'Bìòôm', 'Màyɛsèp', 'Lìbuy li ńyèe'], + 'months_short' => ['kɔn', 'mac', 'mat', 'mto', 'mpu', 'hil', 'nje', 'hik', 'dip', 'bio', 'may', 'liɓ'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'second' => ':count móndî', // less reliable + 's' => ':count móndî', // less reliable + 'a_second' => ':count móndî', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be.php new file mode 100644 index 00000000..06f4043d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); + }, 'be'); +} +// @codeCoverageIgnoreEnd + +/* + * Authors: + * - Josh Soref + * - SobakaSlava + * - François B + * - Serhan Apaydın + * - JD Isaacks + * - AbadonnaAbbys + * - Siomkin Alexander + */ +return [ + 'year' => ':count год|:count гады|:count гадоў', + 'a_year' => '{1}год|:count год|:count гады|:count гадоў', + 'y' => ':count год|:count гады|:count гадоў', + 'month' => ':count месяц|:count месяцы|:count месяцаў', + 'a_month' => '{1}месяц|:count месяц|:count месяцы|:count месяцаў', + 'm' => ':count месяц|:count месяцы|:count месяцаў', + 'week' => ':count тыдзень|:count тыдні|:count тыдняў', + 'a_week' => '{1}тыдзень|:count тыдзень|:count тыдні|:count тыдняў', + 'w' => ':count тыдзень|:count тыдні|:count тыдняў', + 'day' => ':count дзень|:count дні|:count дзён', + 'a_day' => '{1}дзень|:count дзень|:count дні|:count дзён', + 'd' => ':count дн', + 'hour' => ':count гадзіну|:count гадзіны|:count гадзін', + 'a_hour' => '{1}гадзіна|:count гадзіна|:count гадзіны|:count гадзін', + 'h' => ':count гадзіна|:count гадзіны|:count гадзін', + 'minute' => ':count хвіліна|:count хвіліны|:count хвілін', + 'a_minute' => '{1}хвіліна|:count хвіліна|:count хвіліны|:count хвілін', + 'min' => ':count хв', + 'second' => ':count секунда|:count секунды|:count секунд', + 'a_second' => '{1}некалькі секунд|:count секунда|:count секунды|:count секунд', + 's' => ':count сек', + + 'hour_ago' => ':count гадзіну|:count гадзіны|:count гадзін', + 'a_hour_ago' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', + 'h_ago' => ':count гадзіну|:count гадзіны|:count гадзін', + 'minute_ago' => ':count хвіліну|:count хвіліны|:count хвілін', + 'a_minute_ago' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', + 'min_ago' => ':count хвіліну|:count хвіліны|:count хвілін', + 'second_ago' => ':count секунду|:count секунды|:count секунд', + 'a_second_ago' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', + 's_ago' => ':count секунду|:count секунды|:count секунд', + + 'hour_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', + 'a_hour_from_now' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', + 'h_from_now' => ':count гадзіну|:count гадзіны|:count гадзін', + 'minute_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', + 'a_minute_from_now' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', + 'min_from_now' => ':count хвіліну|:count хвіліны|:count хвілін', + 'second_from_now' => ':count секунду|:count секунды|:count секунд', + 'a_second_from_now' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', + 's_from_now' => ':count секунду|:count секунды|:count секунд', + + 'hour_after' => ':count гадзіну|:count гадзіны|:count гадзін', + 'a_hour_after' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', + 'h_after' => ':count гадзіну|:count гадзіны|:count гадзін', + 'minute_after' => ':count хвіліну|:count хвіліны|:count хвілін', + 'a_minute_after' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', + 'min_after' => ':count хвіліну|:count хвіліны|:count хвілін', + 'second_after' => ':count секунду|:count секунды|:count секунд', + 'a_second_after' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', + 's_after' => ':count секунду|:count секунды|:count секунд', + + 'hour_before' => ':count гадзіну|:count гадзіны|:count гадзін', + 'a_hour_before' => '{1}гадзіну|:count гадзіну|:count гадзіны|:count гадзін', + 'h_before' => ':count гадзіну|:count гадзіны|:count гадзін', + 'minute_before' => ':count хвіліну|:count хвіліны|:count хвілін', + 'a_minute_before' => '{1}хвіліну|:count хвіліну|:count хвіліны|:count хвілін', + 'min_before' => ':count хвіліну|:count хвіліны|:count хвілін', + 'second_before' => ':count секунду|:count секунды|:count секунд', + 'a_second_before' => '{1}некалькі секунд|:count секунду|:count секунды|:count секунд', + 's_before' => ':count секунду|:count секунды|:count секунд', + + 'ago' => ':time таму', + 'from_now' => 'праз :time', + 'after' => ':time пасля', + 'before' => ':time да', + 'diff_now' => 'цяпер', + 'diff_today' => 'Сёння', + 'diff_today_regexp' => 'Сёння(?:\\s+ў)?', + 'diff_yesterday' => 'учора', + 'diff_yesterday_regexp' => 'Учора(?:\\s+ў)?', + 'diff_tomorrow' => 'заўтра', + 'diff_tomorrow_regexp' => 'Заўтра(?:\\s+ў)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY г.', + 'LLL' => 'D MMMM YYYY г., HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY г., HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Сёння ў] LT', + 'nextDay' => '[Заўтра ў] LT', + 'nextWeek' => '[У] dddd [ў] LT', + 'lastDay' => '[Учора ў] LT', + 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { + 1, 2, 4 => '[У мінулы] dddd [ў] LT', + default => '[У мінулую] dddd [ў] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => static fn ($number, $period) => match ($period) { + 'M', 'd', 'DDD', 'w', 'W' => ($number % 10 === 2 || $number % 10 === 3) && + ($number % 100 !== 12 && $number % 100 !== 13) ? $number.'-і' : $number.'-ы', + 'D' => $number.'-га', + default => $number, + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'ночы'; + } + + if ($hour < 12) { + return 'раніцы'; + } + + if ($hour < 17) { + return 'дня'; + } + + return 'вечара'; + }, + 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'траўня', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], + 'months_standalone' => ['студзень', 'люты', 'сакавік', 'красавік', 'травень', 'чэрвень', 'ліпень', 'жнівень', 'верасень', 'кастрычнік', 'лістапад', 'снежань'], + 'months_short' => ['студ', 'лют', 'сак', 'крас', 'трав', 'чэрв', 'ліп', 'жнів', 'вер', 'каст', 'ліст', 'снеж'], + 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['нядзелю', 'панядзелак', 'аўторак', 'сераду', 'чацвер', 'пятніцу', 'суботу'], + 'weekdays_standalone' => ['нядзеля', 'панядзелак', 'аўторак', 'серада', 'чацвер', 'пятніца', 'субота'], + 'weekdays_short' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], + 'weekdays_min' => ['нд', 'пн', 'ат', 'ср', 'чц', 'пт', 'сб'], + 'weekdays_regexp' => '/\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' і '], + 'months_short_standalone' => ['сту', 'лют', 'сак', 'кра', 'май', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php new file mode 100644 index 00000000..26684b40 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/be.php', [ + 'months' => ['студзеня', 'лютага', 'сакавіка', 'красавіка', 'мая', 'чэрвеня', 'ліпеня', 'жніўня', 'верасня', 'кастрычніка', 'лістапада', 'снежня'], + 'months_short' => ['сту', 'лют', 'сак', 'кра', 'мая', 'чэр', 'ліп', 'жні', 'вер', 'кас', 'ліс', 'сне'], + 'weekdays' => ['Нядзеля', 'Панядзелак', 'Аўторак', 'Серада', 'Чацвер', 'Пятніца', 'Субота'], + 'weekdays_short' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], + 'weekdays_min' => ['Няд', 'Пан', 'Аўт', 'Срд', 'Чцв', 'Пят', 'Суб'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php new file mode 100644 index 00000000..517ce83a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/be_BY@latin.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['studzienia', 'lutaha', 'sakavika', 'krasavika', 'maja', 'červienia', 'lipienia', 'žniŭnia', 'vieraśnia', 'kastryčnika', 'listapada', 'śniežnia'], + 'months_short' => ['Stu', 'Lut', 'Sak', 'Kra', 'Maj', 'Čer', 'Lip', 'Žni', 'Vie', 'Kas', 'Lis', 'Śni'], + 'weekdays' => ['Niadziela', 'Paniadziełak', 'Aŭtorak', 'Sierada', 'Čaćvier', 'Piatnica', 'Subota'], + 'weekdays_short' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], + 'weekdays_min' => ['Nia', 'Pan', 'Aŭt', 'Sie', 'Čać', 'Pia', 'Sub'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem.php new file mode 100644 index 00000000..1c3ef039 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/bem_ZM.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php new file mode 100644 index 00000000..620b5795 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bem_ZM.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - ANLoc Martin Benjamin locales@africanlocalization.net + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'MM/DD/YYYY', + ], + 'months' => ['Januari', 'Februari', 'Machi', 'Epreo', 'Mei', 'Juni', 'Julai', 'Ogasti', 'Septemba', 'Oktoba', 'Novemba', 'Disemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Epr', 'Mei', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Dis'], + 'weekdays' => ['Pa Mulungu', 'Palichimo', 'Palichibuli', 'Palichitatu', 'Palichine', 'Palichisano', 'Pachibelushi'], + 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['uluchelo', 'akasuba'], + + 'year' => 'myaka :count', + 'y' => 'myaka :count', + 'a_year' => 'myaka :count', + + 'month' => 'myeshi :count', + 'm' => 'myeshi :count', + 'a_month' => 'myeshi :count', + + 'week' => 'umulungu :count', + 'w' => 'umulungu :count', + 'a_week' => 'umulungu :count', + + 'day' => 'inshiku :count', + 'd' => 'inshiku :count', + 'a_day' => 'inshiku :count', + + 'hour' => 'awala :count', + 'h' => 'awala :count', + 'a_hour' => 'awala :count', + + 'minute' => 'miniti :count', + 'min' => 'miniti :count', + 'a_minute' => 'miniti :count', + + 'second' => 'sekondi :count', + 's' => 'sekondi :count', + 'a_second' => 'sekondi :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber.php new file mode 100644 index 00000000..685603c0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ber_DZ.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php new file mode 100644 index 00000000..38de10ab --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_DZ.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pablo Saratxaga pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], + 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], + 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php new file mode 100644 index 00000000..38de10ab --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ber_MA.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pablo Saratxaga pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['yanvar', 'fevral', 'mart', 'aprel', 'may', 'iyun', 'iyul', 'avqust', 'sentyabr', 'oktyabr', 'noyabr', 'dekabr'], + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avq', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['bazar günü', 'birinci gün', 'ikinci gün', 'üçüncü gün', 'dördüncü gün', 'beşinci gün', 'altıncı gün'], + 'weekdays_short' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], + 'weekdays_min' => ['baz', 'bir', 'iki', 'üçü', 'dör', 'beş', 'alt'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bez.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bez.php new file mode 100644 index 00000000..d59c5ef5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bez.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['pamilau', 'pamunyi'], + 'weekdays' => ['pa mulungu', 'pa shahuviluha', 'pa hivili', 'pa hidatu', 'pa hitayi', 'pa hihanu', 'pa shahulembela'], + 'weekdays_short' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], + 'weekdays_min' => ['Mul', 'Vil', 'Hiv', 'Hid', 'Hit', 'Hih', 'Lem'], + 'months' => ['pa mwedzi gwa hutala', 'pa mwedzi gwa wuvili', 'pa mwedzi gwa wudatu', 'pa mwedzi gwa wutai', 'pa mwedzi gwa wuhanu', 'pa mwedzi gwa sita', 'pa mwedzi gwa saba', 'pa mwedzi gwa nane', 'pa mwedzi gwa tisa', 'pa mwedzi gwa kumi', 'pa mwedzi gwa kumi na moja', 'pa mwedzi gwa kumi na mbili'], + 'months_short' => ['Hut', 'Vil', 'Dat', 'Tai', 'Han', 'Sit', 'Sab', 'Nan', 'Tis', 'Kum', 'Kmj', 'Kmb'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg.php new file mode 100644 index 00000000..c793ab7c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Serhan Apaydın + * - JD Isaacks + * - Glavić + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count година|:count години', + 'a_year' => 'година|:count години', + 'y' => ':count година|:count години', + 'month' => ':count месец|:count месеца', + 'a_month' => 'месец|:count месеца', + 'm' => ':count месец|:count месеца', + 'week' => ':count седмица|:count седмици', + 'a_week' => 'седмица|:count седмици', + 'w' => ':count седмица|:count седмици', + 'day' => ':count ден|:count дни', + 'a_day' => 'ден|:count дни', + 'd' => ':count ден|:count дни', + 'hour' => ':count час|:count часа', + 'a_hour' => 'час|:count часа', + 'h' => ':count час|:count часа', + 'minute' => ':count минута|:count минути', + 'a_minute' => 'минута|:count минути', + 'min' => ':count минута|:count минути', + 'second' => ':count секунда|:count секунди', + 'a_second' => 'няколко секунди|:count секунди', + 's' => ':count секунда|:count секунди', + 'ago' => 'преди :time', + 'from_now' => 'след :time', + 'after' => 'след :time', + 'before' => 'преди :time', + 'diff_now' => 'сега', + 'diff_today' => 'Днес', + 'diff_today_regexp' => 'Днес(?:\\s+в)?', + 'diff_yesterday' => 'вчера', + 'diff_yesterday_regexp' => 'Вчера(?:\\s+в)?', + 'diff_tomorrow' => 'утре', + 'diff_tomorrow_regexp' => 'Утре(?:\\s+в)?', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'D.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY H:mm', + 'LLLL' => 'dddd, D MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[Днес в] LT', + 'nextDay' => '[Утре в] LT', + 'nextWeek' => 'dddd [в] LT', + 'lastDay' => '[Вчера в] LT', + 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { + 0, 3, 6 => '[В изминалата] dddd [в] LT', + default => '[В изминалия] dddd [в] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + $lastDigit = $number % 10; + $last2Digits = $number % 100; + if ($number === 0) { + return "$number-ев"; + } + if ($last2Digits === 0) { + return "$number-ен"; + } + if ($last2Digits > 10 && $last2Digits < 20) { + return "$number-ти"; + } + if ($lastDigit === 1) { + return "$number-ви"; + } + if ($lastDigit === 2) { + return "$number-ри"; + } + if ($lastDigit === 7 || $lastDigit === 8) { + return "$number-ми"; + } + + return "$number-ти"; + }, + 'months' => ['януари', 'февруари', 'март', 'април', 'май', 'юни', 'юли', 'август', 'септември', 'октомври', 'ноември', 'декември'], + 'months_short' => ['яну', 'фев', 'мар', 'апр', 'май', 'юни', 'юли', 'авг', 'сеп', 'окт', 'ное', 'дек'], + 'weekdays' => ['неделя', 'понеделник', 'вторник', 'сряда', 'четвъртък', 'петък', 'събота'], + 'weekdays_short' => ['нед', 'пон', 'вто', 'сря', 'чет', 'пет', 'съб'], + 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' и '], + 'meridiem' => ['преди обяд', 'следобед'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php new file mode 100644 index 00000000..b53874d3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bg_BG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/bg.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php new file mode 100644 index 00000000..49f08032 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/bhb_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php new file mode 100644 index 00000000..fadbf77f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bhb_IN.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + 'weekdays_min' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho.php new file mode 100644 index 00000000..e9ed0b68 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/bho_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php new file mode 100644 index 00000000..2f4cdfa0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bho_IN.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bhashaghar@googlegroups.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], + 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर"'], + 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरुवार', 'शुक्रवार', 'शनिवार'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], + 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरु', 'शुक्र', 'शनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], + + 'hour' => ':count मौसम', + 'h' => ':count मौसम', + 'a_hour' => ':count मौसम', + + 'minute' => ':count कला', + 'min' => ':count कला', + 'a_minute' => ':count कला', + + 'second' => ':count सोमार', + 's' => ':count सोमार', + 'a_second' => ':count सोमार', + + 'year' => ':count साल', + 'y' => ':count साल', + 'a_year' => ':count साल', + + 'month' => ':count महिना', + 'm' => ':count महिना', + 'a_month' => ':count महिना', + + 'week' => ':count सप्ताह', + 'w' => ':count सप्ताह', + 'a_week' => ':count सप्ताह', + + 'day' => ':count दिन', + 'd' => ':count दिन', + 'a_day' => ':count दिन', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi.php new file mode 100644 index 00000000..dd08128e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/bi_VU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php new file mode 100644 index 00000000..15d335c8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bi_VU.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com & maninder1.s@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'dddd DD MMM YYYY', + ], + 'months' => ['jenuware', 'febwari', 'maj', 'epril', 'mei', 'jun', 'julae', 'ogis', 'septemba', 'oktoba', 'novemba', 'disemba'], + 'months_short' => ['jen', 'feb', 'maj', 'epr', 'mei', 'jun', 'jul', 'ogi', 'sep', 'okt', 'nov', 'dis'], + 'weekdays' => ['sande', 'mande', 'maj', 'wota', 'fraede', 'sarede'], + 'weekdays_short' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], + 'weekdays_min' => ['san', 'man', 'maj', 'wot', 'fra', 'sar'], + + 'year' => ':count seven', // less reliable + 'y' => ':count seven', // less reliable + 'a_year' => ':count seven', // less reliable + + 'month' => ':count mi', // less reliable + 'm' => ':count mi', // less reliable + 'a_month' => ':count mi', // less reliable + + 'week' => ':count sarede', // less reliable + 'w' => ':count sarede', // less reliable + 'a_week' => ':count sarede', // less reliable + + 'day' => ':count betde', // less reliable + 'd' => ':count betde', // less reliable + 'a_day' => ':count betde', // less reliable + + 'hour' => ':count klok', // less reliable + 'h' => ':count klok', // less reliable + 'a_hour' => ':count klok', // less reliable + + 'minute' => ':count smol', // less reliable + 'min' => ':count smol', // less reliable + 'a_minute' => ':count smol', // less reliable + + 'second' => ':count tu', // less reliable + 's' => ':count tu', // less reliable + 'a_second' => ':count tu', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bm.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bm.php new file mode 100644 index 00000000..92822d29 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bm.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Estelle Comment + */ +return [ + 'year' => 'san :count', + 'a_year' => '{1}san kelen|san :count', + 'y' => 'san :count', + 'month' => 'kalo :count', + 'a_month' => '{1}kalo kelen|kalo :count', + 'm' => 'k. :count', + 'week' => 'dɔgɔkun :count', + 'a_week' => 'dɔgɔkun kelen', + 'w' => 'd. :count', + 'day' => 'tile :count', + 'd' => 't. :count', + 'a_day' => '{1}tile kelen|tile :count', + 'hour' => 'lɛrɛ :count', + 'a_hour' => '{1}lɛrɛ kelen|lɛrɛ :count', + 'h' => 'l. :count', + 'minute' => 'miniti :count', + 'a_minute' => '{1}miniti kelen|miniti :count', + 'min' => 'm. :count', + 'second' => 'sekondi :count', + 'a_second' => '{1}sanga dama dama|sekondi :count', + 's' => 'sek. :count', + 'ago' => 'a bɛ :time bɔ', + 'from_now' => ':time kɔnɔ', + 'diff_today' => 'Bi', + 'diff_yesterday' => 'Kunu', + 'diff_yesterday_regexp' => 'Kunu(?:\\s+lɛrɛ)?', + 'diff_tomorrow' => 'Sini', + 'diff_tomorrow_regexp' => 'Sini(?:\\s+lɛrɛ)?', + 'diff_today_regexp' => 'Bi(?:\\s+lɛrɛ)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'MMMM [tile] D [san] YYYY', + 'LLL' => 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', + 'LLLL' => 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Bi lɛrɛ] LT', + 'nextDay' => '[Sini lɛrɛ] LT', + 'nextWeek' => 'dddd [don lɛrɛ] LT', + 'lastDay' => '[Kunu lɛrɛ] LT', + 'lastWeek' => 'dddd [tɛmɛnen lɛrɛ] LT', + 'sameElse' => 'L', + ], + 'months' => ['Zanwuyekalo', 'Fewuruyekalo', 'Marisikalo', 'Awirilikalo', 'Mɛkalo', 'Zuwɛnkalo', 'Zuluyekalo', 'Utikalo', 'Sɛtanburukalo', 'ɔkutɔburukalo', 'Nowanburukalo', 'Desanburukalo'], + 'months_short' => ['Zan', 'Few', 'Mar', 'Awi', 'Mɛ', 'Zuw', 'Zul', 'Uti', 'Sɛt', 'ɔku', 'Now', 'Des'], + 'weekdays' => ['Kari', 'Ntɛnɛn', 'Tarata', 'Araba', 'Alamisa', 'Juma', 'Sibiri'], + 'weekdays_short' => ['Kar', 'Ntɛ', 'Tar', 'Ara', 'Ala', 'Jum', 'Sib'], + 'weekdays_min' => ['Ka', 'Nt', 'Ta', 'Ar', 'Al', 'Ju', 'Si'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' ni '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn.php new file mode 100644 index 00000000..663cf25a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Shakib Hossain + * - Raju + * - Aniruddha Adhikary + * - JD Isaacks + * - Saiful Islam + * - Faisal Islam + */ +return [ + 'year' => ':count বছর', + 'a_year' => 'এক বছর|:count বছর', + 'y' => '১ বছর|:count বছর', + 'month' => ':count মাস', + 'a_month' => 'এক মাস|:count মাস', + 'm' => '১ মাস|:count মাস', + 'week' => ':count সপ্তাহ', + 'a_week' => '১ সপ্তাহ|:count সপ্তাহ', + 'w' => '১ সপ্তাহ|:count সপ্তাহ', + 'day' => ':count দিন', + 'a_day' => 'এক দিন|:count দিন', + 'd' => '১ দিন|:count দিন', + 'hour' => ':count ঘন্টা', + 'a_hour' => 'এক ঘন্টা|:count ঘন্টা', + 'h' => '১ ঘন্টা|:count ঘন্টা', + 'minute' => ':count মিনিট', + 'a_minute' => 'এক মিনিট|:count মিনিট', + 'min' => '১ মিনিট|:count মিনিট', + 'second' => ':count সেকেন্ড', + 'a_second' => 'কয়েক সেকেন্ড|:count সেকেন্ড', + 's' => '১ সেকেন্ড|:count সেকেন্ড', + 'ago' => ':time আগে', + 'from_now' => ':time পরে', + 'after' => ':time পরে', + 'before' => ':time আগে', + 'diff_now' => 'এখন', + 'diff_today' => 'আজ', + 'diff_yesterday' => 'গতকাল', + 'diff_tomorrow' => 'আগামীকাল', + 'period_recurrences' => ':count বার|:count বার', + 'period_interval' => 'প্রতি :interval', + 'period_start_date' => ':date থেকে', + 'period_end_date' => ':date পর্যন্ত', + 'formats' => [ + 'LT' => 'A Oh:Om সময়', + 'LTS' => 'A Oh:Om:Os সময়', + 'L' => 'OD/OM/OY', + 'LL' => 'OD MMMM OY', + 'LLL' => 'OD MMMM OY, A Oh:Om সময়', + 'LLLL' => 'dddd, OD MMMM OY, A Oh:Om সময়', + ], + 'calendar' => [ + 'sameDay' => '[আজ] LT', + 'nextDay' => '[আগামীকাল] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[গতকাল] LT', + 'lastWeek' => '[গত] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'রাত'; + } + if ($hour < 10) { + return 'সকাল'; + } + if ($hour < 17) { + return 'দুপুর'; + } + if ($hour < 20) { + return 'বিকাল'; + } + + return 'রাত'; + }, + 'months' => ['জানুয়ারী', 'ফেব্রুয়ারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্র', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ্ট', 'অক্টো', 'নভে', 'ডিসে'], + 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], + 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], + 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গ', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], + 'list' => [', ', ' এবং '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekdays_standalone' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহষ্পতিবার', 'শুক্রবার', 'শনিবার'], + 'weekdays_min_standalone' => ['রঃ', 'সোঃ', 'মঃ', 'বুঃ', 'বৃঃ', 'শুঃ', 'শনি'], + 'months_short_standalone' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'alt_numbers' => ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php new file mode 100644 index 00000000..b5b28dd1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_BD.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ankur Group, Taneem Ahmed, Jamil Ahmed + */ +return array_replace_recursive(require __DIR__.'/bn.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], + 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], + 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহঃ', 'শুক্র', 'শনি'], + 'first_day_of_week' => 5, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php new file mode 100644 index 00000000..8b3a50e5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bn_IN.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/bn.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['জানুয়ারী', 'ফেব্রুয়ারী', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'months_short' => ['জানু', 'ফেব', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগস্ট', 'সেপ্টেম্বর', 'অক্টোবর', 'নভেম্বর', 'ডিসেম্বর'], + 'weekdays' => ['রবিবার', 'সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার'], + 'weekdays_short' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], + 'weekdays_min' => ['রবি', 'সোম', 'মঙ্গল', 'বুধ', 'বৃহস্পতি', 'শুক্র', 'শনি'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo.php new file mode 100644 index 00000000..21cc90d1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - JD Isaacks + */ +return [ + 'year' => 'ལོ:count', + 'a_year' => '{1}ལོ་གཅིག|[-Inf,Inf]ལོ:count', + 'month' => 'ཟླ་བ:count', + 'a_month' => '{1}ཟླ་བ་གཅིག|[-Inf,Inf]ཟླ་བ:count', + 'week' => 'གཟའ་འཁོར་:count', + 'a_week' => 'གཟའ་འཁོར་གཅིག', + 'day' => 'ཉིན:count་', + 'a_day' => '{1}ཉིན་གཅིག|[-Inf,Inf]ཉིན:count', + 'hour' => 'ཆུ་ཚོད:count', + 'a_hour' => '{1}ཆུ་ཚོད་གཅིག|[-Inf,Inf]ཆུ་ཚོད:count', + 'minute' => 'སྐར་མ་:count', + 'a_minute' => '{1}སྐར་མ་གཅིག|[-Inf,Inf]སྐར་མ་:count', + 'second' => 'སྐར་ཆ:count', + 'a_second' => '{01}ལམ་སང|[-Inf,Inf]སྐར་ཆ:count', + 'ago' => ':time སྔན་ལ', + 'from_now' => ':time ལ་', + 'diff_yesterday' => 'ཁ་སང', + 'diff_today' => 'དི་རིང', + 'diff_tomorrow' => 'སང་ཉིན', + 'formats' => [ + 'LT' => 'A h:mm', + 'LTS' => 'A h:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', + ], + 'calendar' => [ + 'sameDay' => '[དི་རིང] LT', + 'nextDay' => '[སང་ཉིན] LT', + 'nextWeek' => '[བདུན་ཕྲག་རྗེས་མ], LT', + 'lastDay' => '[ཁ་སང] LT', + 'lastWeek' => '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'མཚན་མོ'; + } + if ($hour < 10) { + return 'ཞོགས་ཀས'; + } + if ($hour < 17) { + return 'ཉིན་གུང'; + } + if ($hour < 20) { + return 'དགོང་དག'; + } + + return 'མཚན་མོ'; + }, + 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], + 'months_short' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], + 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], + 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], + 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ', 'པ་སངས་', 'སྤེན་པ་'], + 'list' => [', ', ' ཨནད་ '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php new file mode 100644 index 00000000..380abb1e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_CN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/bo.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php new file mode 100644 index 00000000..ca50d049 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bo_IN.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/bo.php', [ + 'meridiem' => ['སྔ་དྲོ་', 'ཕྱི་དྲོ་'], + 'weekdays' => ['གཟའ་ཉི་མ་', 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་'], + 'weekdays_short' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], + 'weekdays_min' => ['ཉི་མ་', 'ཟླ་བ་', 'མིག་དམར་', 'ལྷག་པ་', 'ཕུར་བུ་', 'པ་སངས་', 'སྤེན་པ་'], + 'months' => ['ཟླ་བ་དང་པོ', 'ཟླ་བ་གཉིས་པ', 'ཟླ་བ་གསུམ་པ', 'ཟླ་བ་བཞི་པ', 'ཟླ་བ་ལྔ་པ', 'ཟླ་བ་དྲུག་པ', 'ཟླ་བ་བདུན་པ', 'ཟླ་བ་བརྒྱད་པ', 'ཟླ་བ་དགུ་པ', 'ཟླ་བ་བཅུ་པ', 'ཟླ་བ་བཅུ་གཅིག་པ', 'ཟླ་བ་བཅུ་གཉིས་པ'], + 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], + 'months_standalone' => ['ཟླ་བ་དང་པོ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་པ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུན་པ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], + 'weekend' => [0, 0], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'YYYY-MM-DD', + 'LL' => 'YYYY ལོའི་MMMཚེས་D', + 'LLL' => 'སྤྱི་ལོ་YYYY MMMMའི་ཚེས་D h:mm a', + 'LLLL' => 'YYYY MMMMའི་ཚེས་D, dddd h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br.php new file mode 100644 index 00000000..cdc0545b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Serhan Apaydın + * - JD Isaacks + */ +return [ + 'year' => '{1}:count bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', + 'a_year' => '{1}ur bloaz|{3,4,5,9}:count bloaz|[0,Inf[:count vloaz', + 'month' => '{1}:count miz|{2}:count viz|[0,Inf[:count miz', + 'a_month' => '{1}ur miz|{2}:count viz|[0,Inf[:count miz', + 'week' => ':count sizhun', + 'a_week' => '{1}ur sizhun|:count sizhun', + 'day' => '{1}:count devezh|{2}:count zevezh|[0,Inf[:count devezh', + 'a_day' => '{1}un devezh|{2}:count zevezh|[0,Inf[:count devezh', + 'hour' => ':count eur', + 'a_hour' => '{1}un eur|:count eur', + 'minute' => '{1}:count vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', + 'a_minute' => '{1}ur vunutenn|{2}:count vunutenn|[0,Inf[:count munutenn', + 'second' => ':count eilenn', + 'a_second' => '{1}un nebeud segondennoù|[0,Inf[:count eilenn', + 'ago' => ':time \'zo', + 'from_now' => 'a-benn :time', + 'diff_now' => 'bremañ', + 'diff_today' => 'Hiziv', + 'diff_today_regexp' => 'Hiziv(?:\\s+da)?', + 'diff_yesterday' => 'decʼh', + 'diff_yesterday_regexp' => 'Dec\'h(?:\\s+da)?', + 'diff_tomorrow' => 'warcʼhoazh', + 'diff_tomorrow_regexp' => 'Warc\'hoazh(?:\\s+da)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D [a viz] MMMM YYYY', + 'LLL' => 'D [a viz] MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D [a viz] MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Hiziv da] LT', + 'nextDay' => '[Warc\'hoazh da] LT', + 'nextWeek' => 'dddd [da] LT', + 'lastDay' => '[Dec\'h da] LT', + 'lastWeek' => 'dddd [paset da] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static fn ($number) => $number.($number === 1 ? 'añ' : 'vet'), + 'months' => ['Genver', 'C\'hwevrer', 'Meurzh', 'Ebrel', 'Mae', 'Mezheven', 'Gouere', 'Eost', 'Gwengolo', 'Here', 'Du', 'Kerzu'], + 'months_short' => ['Gen', 'C\'hwe', 'Meu', 'Ebr', 'Mae', 'Eve', 'Gou', 'Eos', 'Gwe', 'Her', 'Du', 'Ker'], + 'weekdays' => ['Sul', 'Lun', 'Meurzh', 'Merc\'her', 'Yaou', 'Gwener', 'Sadorn'], + 'weekdays_short' => ['Sul', 'Lun', 'Meu', 'Mer', 'Yao', 'Gwe', 'Sad'], + 'weekdays_min' => ['Su', 'Lu', 'Me', 'Mer', 'Ya', 'Gw', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' hag '], + 'meridiem' => ['A.M.', 'G.M.'], + + 'y' => ':count bl.', + 'd' => ':count d', + 'h' => ':count e', + 'min' => ':count min', + 's' => ':count s', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php new file mode 100644 index 00000000..7f541858 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/br_FR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/br.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx.php new file mode 100644 index 00000000..a0a7bf9b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/brx_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php new file mode 100644 index 00000000..e678aa96 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/brx_IN.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'M/D/YY', + ], + 'months' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एफ्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], + 'months_short' => ['जानुवारी', 'फेब्रुवारी', 'मार्स', 'एप्रिल', 'मे', 'जुन', 'जुलाइ', 'आगस्थ', 'सेबथेज्ब़र', 'अखथबर', 'नबेज्ब़र', 'दिसेज्ब़र'], + 'weekdays' => ['रबिबार', 'सोबार', 'मंगलबार', 'बुदबार', 'बिसथिबार', 'सुखुरबार', 'सुनिबार'], + 'weekdays_short' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], + 'weekdays_min' => ['रबि', 'सम', 'मंगल', 'बुद', 'बिसथि', 'सुखुर', 'सुनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['फुं.', 'बेलासे.'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs.php new file mode 100644 index 00000000..52b6d12a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bokideckonja + * - Josh Soref + * - François B + * - shaishavgandhi05 + * - Serhan Apaydın + * - JD Isaacks + * - Ademir Šehić + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count godina|:count godine|:count godina', + 'y' => ':count godina|:count godine|:count godina', + 'month' => ':count mjesec|:count mjeseca|:count mjeseci', + 'm' => ':count mjesec|:count mjeseca|:count mjeseci', + 'week' => ':count sedmica|:count sedmice|:count sedmica', + 'w' => ':count sedmica|:count sedmice|:count sedmica', + 'day' => ':count dan|:count dana|:count dana', + 'd' => ':count dan|:count dana|:count dana', + 'hour' => ':count sat|:count sata|:count sati', + 'h' => ':count sat|:count sata|:count sati', + 'minute' => ':count minut|:count minuta|:count minuta', + 'min' => ':count minut|:count minuta|:count minuta', + 'second' => ':count sekund|:count sekunda|:count sekundi', + 's' => ':count sekund|:count sekunda|:count sekundi', + + 'ago' => 'prije :time', + 'from_now' => 'za :time', + 'after' => 'nakon :time', + 'before' => ':time ranije', + + 'year_ago' => ':count godinu|:count godine|:count godina', + 'year_from_now' => ':count godinu|:count godine|:count godina', + 'week_ago' => ':count sedmicu|:count sedmice|:count sedmica', + 'week_from_now' => ':count sedmicu|:count sedmice|:count sedmica', + + 'diff_now' => 'sada', + 'diff_today' => 'danas', + 'diff_today_regexp' => 'danas(?:\\s+u)?', + 'diff_yesterday' => 'jučer', + 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', + 'diff_tomorrow' => 'sutra', + 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[danas u] LT', + 'nextDay' => '[sutra u] LT', + 'nextWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { + 0 => '[u] [nedjelju] [u] LT', + 3 => '[u] [srijedu] [u] LT', + 6 => '[u] [subotu] [u] LT', + default => '[u] dddd [u] LT', + }, + 'lastDay' => '[jučer u] LT', + 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { + 0, 3 => '[prošlu] dddd [u] LT', + 6 => '[prošle] [subote] [u] LT', + default => '[prošli] dddd [u] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'juni', 'juli', 'august', 'septembar', 'oktobar', 'novembar', 'decembar'], + 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj.', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], + 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], + 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' i '], + 'meridiem' => ['prijepodne', 'popodne'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php new file mode 100644 index 00000000..0a591176 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_BA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/bs.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php new file mode 100644 index 00000000..e1a17447 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Cyrl.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/bs.php', [ + 'meridiem' => ['пре подне', 'поподне'], + 'weekdays' => ['недјеља', 'понедјељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], + 'weekdays_short' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], + 'weekdays_min' => ['нед', 'пон', 'уто', 'сри', 'чет', 'пет', 'суб'], + 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јуни', 'јули', 'аугуст', 'септембар', 'октобар', 'новембар', 'децембар'], + 'months_short' => ['јан', 'феб', 'мар', 'апр', 'мај', 'јун', 'јул', 'ауг', 'сеп', 'окт', 'нов', 'дец'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D.M.YYYY.', + 'LL' => 'DD.MM.YYYY.', + 'LLL' => 'DD. MMMM YYYY. HH:mm', + 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php new file mode 100644 index 00000000..b4e363e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/bs_Latn.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/bs.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn.php new file mode 100644 index 00000000..7125f3d6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/byn_ER.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php new file mode 100644 index 00000000..ad675334 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/byn_ER.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ልደትሪ', 'ካብኽብቲ', 'ክብላ', 'ፋጅኺሪ', 'ክቢቅሪ', 'ምኪኤል ትጓ̅ኒሪ', 'ኰርኩ', 'ማርያም ትሪ', 'ያኸኒ መሳቅለሪ', 'መተሉ', 'ምኪኤል መሽወሪ', 'ተሕሳስሪ'], + 'months_short' => ['ልደት', 'ካብኽ', 'ክብላ', 'ፋጅኺ', 'ክቢቅ', 'ም/ት', 'ኰር', 'ማርያ', 'ያኸኒ', 'መተሉ', 'ም/ም', 'ተሕሳ'], + 'weekdays' => ['ሰንበር ቅዳዅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ ወሪ ለብዋ', 'ኣምድ', 'ኣርብ', 'ሰንበር ሽጓዅ'], + 'weekdays_short' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], + 'weekdays_min' => ['ሰ/ቅ', 'ሰኑ', 'ሰሊጝ', 'ለጓ', 'ኣምድ', 'ኣርብ', 'ሰ/ሽ'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ፋዱስ ጃብ', 'ፋዱስ ደምቢ'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca.php new file mode 100644 index 00000000..824c9ce7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - mestremuten + * - François B + * - Marc Ordinas i Llopis + * - Pere Orga + * - JD Isaacks + * - Quentí + * - Víctor Díaz + * - Xavi + * - qcardona + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count any|:count anys', + 'a_year' => 'un any|:count anys', + 'y' => ':count any|:count anys', + 'month' => ':count mes|:count mesos', + 'a_month' => 'un mes|:count mesos', + 'm' => ':count mes|:count mesos', + 'week' => ':count setmana|:count setmanes', + 'a_week' => 'una setmana|:count setmanes', + 'w' => ':count setmana|:count setmanes', + 'day' => ':count dia|:count dies', + 'a_day' => 'un dia|:count dies', + 'd' => ':count d', + 'hour' => ':count hora|:count hores', + 'a_hour' => 'una hora|:count hores', + 'h' => ':count h', + 'minute' => ':count minut|:count minuts', + 'a_minute' => 'un minut|:count minuts', + 'min' => ':count min', + 'second' => ':count segon|:count segons', + 'a_second' => 'uns segons|:count segons', + 's' => ':count s', + 'ago' => 'fa :time', + 'from_now' => 'd\'aquí a :time', + 'after' => ':time després', + 'before' => ':time abans', + 'diff_now' => 'ara mateix', + 'diff_today' => 'avui', + 'diff_today_regexp' => 'avui(?:\\s+a)?(?:\\s+les)?', + 'diff_yesterday' => 'ahir', + 'diff_yesterday_regexp' => 'ahir(?:\\s+a)?(?:\\s+les)?', + 'diff_tomorrow' => 'demà', + 'diff_tomorrow_regexp' => 'demà(?:\\s+a)?(?:\\s+les)?', + 'diff_before_yesterday' => 'abans d\'ahir', + 'diff_after_tomorrow' => 'demà passat', + 'period_recurrences' => ':count cop|:count cops', + 'period_interval' => 'cada :interval', + 'period_start_date' => 'de :date', + 'period_end_date' => 'fins a :date', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM [de] YYYY', + 'LLL' => 'D MMMM [de] YYYY [a les] H:mm', + 'LLLL' => 'dddd D MMMM [de] YYYY [a les] H:mm', + ], + 'calendar' => [ + 'sameDay' => static function (CarbonInterface $current) { + return '[avui a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; + }, + 'nextDay' => static function (CarbonInterface $current) { + return '[demà a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; + }, + 'nextWeek' => static function (CarbonInterface $current) { + return 'dddd [a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; + }, + 'lastDay' => static function (CarbonInterface $current) { + return '[ahir a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; + }, + 'lastWeek' => static function (CarbonInterface $current) { + return '[el] dddd [passat a '.($current->hour !== 1 ? 'les' : 'la').'] LT'; + }, + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return $number.( + ($period === 'w' || $period === 'W') ? 'a' : ( + ($number === 1) ? 'r' : ( + ($number === 2) ? 'n' : ( + ($number === 3) ? 'r' : ( + ($number === 4) ? 't' : 'è' + ) + ) + ) + ) + ); + }, + 'months' => ['de gener', 'de febrer', 'de març', 'd\'abril', 'de maig', 'de juny', 'de juliol', 'd\'agost', 'de setembre', 'd\'octubre', 'de novembre', 'de desembre'], + 'months_standalone' => ['gener', 'febrer', 'març', 'abril', 'maig', 'juny', 'juliol', 'agost', 'setembre', 'octubre', 'novembre', 'desembre'], + 'months_short' => ['de gen.', 'de febr.', 'de març', 'd\'abr.', 'de maig', 'de juny', 'de jul.', 'd\'ag.', 'de set.', 'd\'oct.', 'de nov.', 'de des.'], + 'months_short_standalone' => ['gen.', 'febr.', 'març', 'abr.', 'maig', 'juny', 'jul.', 'ag.', 'set.', 'oct.', 'nov.', 'des.'], + 'months_regexp' => '/(D[oD]?[\s,]+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['diumenge', 'dilluns', 'dimarts', 'dimecres', 'dijous', 'divendres', 'dissabte'], + 'weekdays_short' => ['dg.', 'dl.', 'dt.', 'dc.', 'dj.', 'dv.', 'ds.'], + 'weekdays_min' => ['dg', 'dl', 'dt', 'dc', 'dj', 'dv', 'ds'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' i '], + 'meridiem' => ['a. m.', 'p. m.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php new file mode 100644 index 00000000..861acd2a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_AD.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ca.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php new file mode 100644 index 00000000..50049786 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ca.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php new file mode 100644 index 00000000..1c16421a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_ES_Valencia.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'ca'); + }, 'ca_ES_Valencia'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/ca.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php new file mode 100644 index 00000000..861acd2a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_FR.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ca.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php new file mode 100644 index 00000000..861acd2a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ca_IT.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ca.php', [ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php new file mode 100644 index 00000000..b536d4bf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['𑄢𑄧𑄝𑄨𑄝𑄢𑄴', '𑄥𑄧𑄟𑄴𑄝𑄢𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴', '𑄝𑄪𑄖𑄴𑄝𑄢𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴', '𑄥𑄧𑄚𑄨𑄝𑄢𑄴'], + 'weekdays_short' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], + 'weekdays_min' => ['𑄢𑄧𑄝𑄨', '𑄥𑄧𑄟𑄴', '𑄟𑄧𑄁𑄉𑄧𑄣𑄴', '𑄝𑄪𑄖𑄴', '𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴', '𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴', '𑄥𑄧𑄚𑄨'], + 'months' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], + 'months_short' => ['𑄎𑄚𑄪', '𑄜𑄬𑄛𑄴', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴'], + 'months_short_standalone' => ['𑄎𑄚𑄪𑄠𑄢𑄨', '𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨', '𑄟𑄢𑄴𑄌𑄧', '𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴', '𑄟𑄬', '𑄎𑄪𑄚𑄴', '𑄎𑄪𑄣𑄭', '𑄃𑄉𑄧𑄌𑄴𑄑𑄴', '𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴', '𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴', '𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴'], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM, YYYY h:mm a', + 'LLLL' => 'dddd, D MMMM, YYYY h:mm a', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php new file mode 100644 index 00000000..c1fa8af0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ccp_IN.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ccp.php', [ + 'weekend' => [0, 0], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce.php new file mode 100644 index 00000000..f99f6ffd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ce_RU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php new file mode 100644 index 00000000..f7698562 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ce_RU.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - ANCHR + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY.DD.MM', + ], + 'months' => ['Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'], + 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'weekdays' => ['КӀиранан де', 'Оршотан де', 'Шинарин де', 'Кхаарин де', 'Еарин де', 'ПӀераскан де', 'Шот де'], + 'weekdays_short' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], + 'weekdays_min' => ['КӀ', 'Ор', 'Ши', 'Кх', 'Еа', 'ПӀ', 'Шо'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count шо', + 'y' => ':count шо', + 'a_year' => ':count шо', + + 'month' => ':count бутт', + 'm' => ':count бутт', + 'a_month' => ':count бутт', + + 'week' => ':count кӏира', + 'w' => ':count кӏира', + 'a_week' => ':count кӏира', + + 'day' => ':count де', + 'd' => ':count де', + 'a_day' => ':count де', + + 'hour' => ':count сахьт', + 'h' => ':count сахьт', + 'a_hour' => ':count сахьт', + + 'minute' => ':count минот', + 'min' => ':count минот', + 'a_minute' => ':count минот', + + 'second' => ':count секунд', + 's' => ':count секунд', + 'a_second' => ':count секунд', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php new file mode 100644 index 00000000..09bcc1c7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cgg.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], + 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], + 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], + 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], + 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'day' => ':count ruhanga', // less reliable + 'd' => ':count ruhanga', // less reliable + 'a_day' => ':count ruhanga', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr.php new file mode 100644 index 00000000..e26190f1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/chr_US.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php new file mode 100644 index 00000000..3fb02219 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/chr_US.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Cherokee Nation Joseph Erb josepherb7@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'MM/DD/YYYY', + ], + 'months' => ['ᎤᏃᎸᏔᏅ', 'ᎧᎦᎵ', 'ᎠᏅᏱ', 'ᎧᏬᏂ', 'ᎠᏂᏍᎬᏘ', 'ᏕᎭᎷᏱ', 'ᎫᏰᏉᏂ', 'ᎦᎶᏂ', 'ᏚᎵᏍᏗ', 'ᏚᏂᏅᏗ', 'ᏅᏓᏕᏆ', 'ᎥᏍᎩᏱ'], + 'months_short' => ['ᎤᏃ', 'ᎧᎦ', 'ᎠᏅ', 'ᎧᏬ', 'ᎠᏂ', 'ᏕᎭ', 'ᎫᏰ', 'ᎦᎶ', 'ᏚᎵ', 'ᏚᏂ', 'ᏅᏓ', 'ᎥᏍ'], + 'weekdays' => ['ᎤᎾᏙᏓᏆᏍᎬ', 'ᎤᎾᏙᏓᏉᏅᎯ', 'ᏔᎵᏁᎢᎦ', 'ᏦᎢᏁᎢᎦ', 'ᏅᎩᏁᎢᎦ', 'ᏧᎾᎩᎶᏍᏗ', 'ᎤᎾᏙᏓᏈᏕᎾ'], + 'weekdays_short' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], + 'weekdays_min' => ['ᏆᏍᎬ', 'ᏉᏅᎯ', 'ᏔᎵᏁ', 'ᏦᎢᏁ', 'ᏅᎩᏁ', 'ᏧᎾᎩ', 'ᏈᏕᎾ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ᏌᎾᎴ', 'ᏒᎯᏱᎢᏗᏢ', 'ꮜꮎꮄ', 'ꮢꭿᏹꭲꮧꮲ'], + + 'second' => ':count ᏐᎢ', // less reliable + 's' => ':count ᏐᎢ', // less reliable + 'a_second' => ':count ᏐᎢ', // less reliable + + 'year' => ':count ᏑᏕᏘᏴᏓ', + 'y' => ':count ᏑᏕᏘᏴᏓ', + 'a_year' => ':count ᏑᏕᏘᏴᏓ', + + 'month' => ':count ᏏᏅᏙ', + 'm' => ':count ᏏᏅᏙ', + 'a_month' => ':count ᏏᏅᏙ', + + 'week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', + 'w' => ':count ᏑᎾᏙᏓᏆᏍᏗ', + 'a_week' => ':count ᏑᎾᏙᏓᏆᏍᏗ', + + 'day' => ':count ᎢᎦ', + 'd' => ':count ᎢᎦ', + 'a_day' => ':count ᎢᎦ', + + 'hour' => ':count ᏑᏟᎶᏛ', + 'h' => ':count ᏑᏟᎶᏛ', + 'a_hour' => ':count ᏑᏟᎶᏛ', + + 'minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', + 'min' => ':count ᎢᏯᏔᏬᏍᏔᏅ', + 'a_minute' => ':count ᎢᏯᏔᏬᏍᏔᏅ', + + 'ago' => ':time ᏥᎨᏒ', + 'from_now' => 'ᎾᎿ :time', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php new file mode 100644 index 00000000..35ac60a9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ckb.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Swara Mohammed + * - Kawan Pshtiwan + */ +$months = [ + 'کانونی دووەم', + 'شوبات', + 'ئازار', + 'نیسان', + 'ئایار', + 'حوزەیران', + 'تەمموز', + 'ئاب', + 'ئەیلوول', + 'تشرینی یەکەم', + 'تشرینی دووەم', + 'کانونی یەکەم', +]; + +return [ + 'year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), + 'a_year' => implode('|', ['{0}:count ساڵێک', '{1}ساڵێک', '{2}دوو ساڵ', ']2,11[:count ساڵ', ']10,Inf[:count ساڵ']), + 'month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), + 'a_month' => implode('|', ['{0}:count مانگێک', '{1}مانگێک', '{2}دوو مانگ', ']2,11[:count مانگ', ']10,Inf[:count مانگ']), + 'week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), + 'a_week' => implode('|', ['{0}:count هەفتەیەک', '{1}هەفتەیەک', '{2}دوو هەفتە', ']2,11[:count هەفتە', ']10,Inf[:count هەفتە']), + 'day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), + 'a_day' => implode('|', ['{0}:count ڕۆژێک', '{1}ڕۆژێک', '{2}دوو ڕۆژ', ']2,11[:count ڕۆژ', ']10,Inf[:count ڕۆژ']), + 'hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), + 'a_hour' => implode('|', ['{0}:count کاتژمێرێک', '{1}کاتژمێرێک', '{2}دوو کاتژمێر', ']2,11[:count کاتژمێر', ']10,Inf[:count کاتژمێر']), + 'minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), + 'a_minute' => implode('|', ['{0}:count خولەکێک', '{1}خولەکێک', '{2}دوو خولەک', ']2,11[:count خولەک', ']10,Inf[:count خولەک']), + 'second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), + 'a_second' => implode('|', ['{0}:count چرکەیەک', '{1}چرکەیەک', '{2}دوو چرکە', ']2,11[:count چرکە', ']10,Inf[:count چرکە']), + 'ago' => 'پێش :time', + 'from_now' => ':time لە ئێستاوە', + 'after' => 'دوای :time', + 'before' => 'پێش :time', + 'diff_now' => 'ئێستا', + 'diff_today' => 'ئەمڕۆ', + 'diff_today_regexp' => 'ڕۆژ(?:\\s+لە)?(?:\\s+کاتژمێر)?', + 'diff_yesterday' => 'دوێنێ', + 'diff_yesterday_regexp' => 'دوێنێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', + 'diff_tomorrow' => 'سبەینێ', + 'diff_tomorrow_regexp' => 'سبەینێ(?:\\s+لە)?(?:\\s+کاتژمێر)?', + 'diff_before_yesterday' => 'پێش دوێنێ', + 'diff_after_tomorrow' => 'دوای سبەینێ', + 'period_recurrences' => implode('|', ['{0}جار', '{1}جار', '{2}:count دووجار', ']2,11[:count جار', ']10,Inf[:count جار']), + 'period_interval' => 'هەموو :interval', + 'period_start_date' => 'لە :date', + 'period_end_date' => 'بۆ :date', + 'months' => $months, + 'months_short' => $months, + 'weekdays' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], + 'weekdays_short' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], + 'weekdays_min' => ['یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'هەینی', 'شەممە'], + 'list' => ['، ', ' و '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[ئەمڕۆ لە کاتژمێر] LT', + 'nextDay' => '[سبەینێ لە کاتژمێر] LT', + 'nextWeek' => 'dddd [لە کاتژمێر] LT', + 'lastDay' => '[دوێنێ لە کاتژمێر] LT', + 'lastWeek' => 'dddd [لە کاتژمێر] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['پ.ن', 'د.ن'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php new file mode 100644 index 00000000..80b1d694 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/cmn_TW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php new file mode 100644 index 00000000..eee9c806 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cmn_TW.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'YYYY年MM月DD號', + ], + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], + 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'meridiem' => ['上午', '下午'], + + 'year' => ':count 年', + 'y' => ':count 年', + 'a_year' => ':count 年', + + 'month' => ':count 月', + 'm' => ':count 月', + 'a_month' => ':count 月', + + 'week' => ':count 周', + 'w' => ':count 周', + 'a_week' => ':count 周', + + 'day' => ':count 白天', + 'd' => ':count 白天', + 'a_day' => ':count 白天', + + 'hour' => ':count 小时', + 'h' => ':count 小时', + 'a_hour' => ':count 小时', + + 'minute' => ':count 分钟', + 'min' => ':count 分钟', + 'a_minute' => ':count 分钟', + + 'second' => ':count 秒', + 's' => ':count 秒', + 'a_second' => ':count 秒', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh.php new file mode 100644 index 00000000..a1d7ce63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/crh_UA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php new file mode 100644 index 00000000..05139331 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/crh_UA.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Reşat SABIQ tilde.birlik@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'Mayıs', 'İyun', 'İyul', 'Avgust', 'Sentâbr', 'Oktâbr', 'Noyabr', 'Dekabr'], + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'İyn', 'İyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['Bazar', 'Bazarertesi', 'Salı', 'Çarşembe', 'Cumaaqşamı', 'Cuma', 'Cumaertesi'], + 'weekdays_short' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], + 'weekdays_min' => ['Baz', 'Ber', 'Sal', 'Çar', 'Caq', 'Cum', 'Cer'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ÜE', 'ÜS'], + + 'year' => ':count yıl', + 'y' => ':count yıl', + 'a_year' => ':count yıl', + + 'month' => ':count ay', + 'm' => ':count ay', + 'a_month' => ':count ay', + + 'week' => ':count afta', + 'w' => ':count afta', + 'a_week' => ':count afta', + + 'day' => ':count kün', + 'd' => ':count kün', + 'a_day' => ':count kün', + + 'hour' => ':count saat', + 'h' => ':count saat', + 'a_hour' => ':count saat', + + 'minute' => ':count daqqa', + 'min' => ':count daqqa', + 'a_minute' => ':count daqqa', + + 'second' => ':count ekinci', + 's' => ':count ekinci', + 'a_second' => ':count ekinci', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs.php new file mode 100644 index 00000000..9530d363 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Jakub Tesinsky + * - Martin Suja + * - Nikos Timiopulos + * - Bohuslav Blín + * - Tsutomu Kuroda + * - tjku + * - Lukas Svoboda + * - Max Melentiev + * - Juanito Fatas + * - Akira Matsuda + * - Christopher Dell + * - Václav Pávek + * - CodeSkills + * - Tlapi + * - newman101 + * - Petr Kadlec + * - tommaskraus + * - Karel Sommer (calvera) + */ +$za = function ($time) { + return 'za '.strtr($time, [ + 'hodina' => 'hodinu', + 'minuta' => 'minutu', + 'sekunda' => 'sekundu', + ]); +}; + +$pred = function ($time) { + $time = strtr($time, [ + 'hodina' => 'hodinou', + 'minuta' => 'minutou', + 'sekunda' => 'sekundou', + ]); + $time = preg_replace('/hodiny?(?!\w)/', 'hodinami', $time); + $time = preg_replace('/minuty?(?!\w)/', 'minutami', $time); + $time = preg_replace('/sekundy?(?!\w)/', 'sekundami', $time); + + return "před $time"; +}; + +return [ + 'year' => ':count rok|:count roky|:count let', + 'y' => ':count rok|:count roky|:count let', + 'a_year' => 'rok|:count roky|:count let', + 'month' => ':count měsíc|:count měsíce|:count měsíců', + 'm' => ':count měs.', + 'a_month' => 'měsíc|:count měsíce|:count měsíců', + 'week' => ':count týden|:count týdny|:count týdnů', + 'w' => ':count týd.', + 'a_week' => 'týden|:count týdny|:count týdnů', + 'day' => ':count den|:count dny|:count dní', + 'd' => ':count den|:count dny|:count dní', + 'a_day' => 'den|:count dny|:count dní', + 'hour' => ':count hodina|:count hodiny|:count hodin', + 'h' => ':count hod.', + 'a_hour' => 'hodina|:count hodiny|:count hodin', + 'minute' => ':count minuta|:count minuty|:count minut', + 'min' => ':count min.', + 'a_minute' => 'minuta|:count minuty|:count minut', + 'second' => ':count sekunda|:count sekundy|:count sekund', + 's' => ':count sek.', + 'a_second' => 'pár sekund|:count sekundy|:count sekund', + + 'month_ago' => ':count měsícem|:count měsíci|:count měsíci', + 'a_month_ago' => 'měsícem|:count měsíci|:count měsíci', + 'day_ago' => ':count dnem|:count dny|:count dny', + 'a_day_ago' => 'dnem|:count dny|:count dny', + 'week_ago' => ':count týdnem|:count týdny|:count týdny', + 'a_week_ago' => 'týdnem|:count týdny|:count týdny', + 'year_ago' => ':count rokem|:count roky|:count lety', + 'y_ago' => ':count rok.|:count rok.|:count let.', + 'a_year_ago' => 'rokem|:count roky|:count lety', + + 'month_before' => ':count měsícem|:count měsíci|:count měsíci', + 'a_month_before' => 'měsícem|:count měsíci|:count měsíci', + 'day_before' => ':count dnem|:count dny|:count dny', + 'a_day_before' => 'dnem|:count dny|:count dny', + 'week_before' => ':count týdnem|:count týdny|:count týdny', + 'a_week_before' => 'týdnem|:count týdny|:count týdny', + 'year_before' => ':count rokem|:count roky|:count lety', + 'y_before' => ':count rok.|:count rok.|:count let.', + 'a_year_before' => 'rokem|:count roky|:count lety', + + 'ago' => $pred, + 'from_now' => $za, + 'before' => $pred, + 'after' => $za, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'months' => ['ledna', 'února', 'března', 'dubna', 'května', 'června', 'července', 'srpna', 'září', 'října', 'listopadu', 'prosince'], + 'months_standalone' => ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'], + 'months_short' => ['led', 'úno', 'bře', 'dub', 'kvě', 'čvn', 'čvc', 'srp', 'zář', 'říj', 'lis', 'pro'], + 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['neděle', 'pondělí', 'úterý', 'středa', 'čtvrtek', 'pátek', 'sobota'], + 'weekdays_short' => ['ned', 'pon', 'úte', 'stř', 'čtv', 'pát', 'sob'], + 'weekdays_min' => ['ne', 'po', 'út', 'st', 'čt', 'pá', 'so'], + 'list' => [', ', ' a '], + 'diff_now' => 'nyní', + 'diff_yesterday' => 'včera', + 'diff_tomorrow' => 'zítra', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD. MM. YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd D. MMMM YYYY HH:mm', + ], + 'meridiem' => ['dopoledne', 'odpoledne'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php new file mode 100644 index 00000000..ea2517e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cs_CZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/cs.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb.php new file mode 100644 index 00000000..a35d2815 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/csb_PL.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php new file mode 100644 index 00000000..25e0ca89 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/csb_PL.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - csb_PL locale Michal Ostrowski bug-glibc-locales@gnu.org + */ +return [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'MMMM DD, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], + 'months' => ['stëcznika', 'gromicznika', 'strëmiannika', 'łżëkwiata', 'maja', 'czerwińca', 'lëpińca', 'zélnika', 'séwnika', 'rujana', 'lëstopadnika', 'gòdnika'], + 'months_short' => ['stë', 'gro', 'str', 'łżë', 'maj', 'cze', 'lëp', 'zél', 'séw', 'ruj', 'lës', 'gòd'], + 'weekdays' => ['niedzela', 'pòniedzôłk', 'wtórk', 'strzoda', 'czwiôrtk', 'piątk', 'sobòta'], + 'weekdays_short' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], + 'weekdays_min' => ['nie', 'pòn', 'wtó', 'str', 'czw', 'pią', 'sob'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' a téż '], + 'two_words_connector' => ' a téż ', + 'year' => ':count rok', + 'month' => ':count miesiąc', + 'week' => ':count tidzéń', + 'day' => ':count dzéń', + 'hour' => ':count gòdzëna', + 'minute' => ':count minuta', + 'second' => ':count sekunda', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cu.php new file mode 100644 index 00000000..d6d13128 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cu.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], + + 'year' => ':count лѣто', + 'y' => ':count лѣто', + 'a_year' => ':count лѣто', + + 'month' => ':count мѣсѧць', + 'm' => ':count мѣсѧць', + 'a_month' => ':count мѣсѧць', + + 'week' => ':count сєдмица', + 'w' => ':count сєдмица', + 'a_week' => ':count сєдмица', + + 'day' => ':count дьнь', + 'd' => ':count дьнь', + 'a_day' => ':count дьнь', + + 'hour' => ':count година', + 'h' => ':count година', + 'a_hour' => ':count година', + + 'minute' => ':count малъ', // less reliable + 'min' => ':count малъ', // less reliable + 'a_minute' => ':count малъ', // less reliable + + 'second' => ':count въторъ', + 's' => ':count въторъ', + 'a_second' => ':count въторъ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv.php new file mode 100644 index 00000000..fe769685 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - JD Isaacks + */ +return [ + 'year' => ':count ҫул', + 'a_year' => '{1}пӗр ҫул|:count ҫул', + 'month' => ':count уйӑх', + 'a_month' => '{1}пӗр уйӑх|:count уйӑх', + 'week' => ':count эрне', + 'a_week' => '{1}пӗр эрне|:count эрне', + 'day' => ':count кун', + 'a_day' => '{1}пӗр кун|:count кун', + 'hour' => ':count сехет', + 'a_hour' => '{1}пӗр сехет|:count сехет', + 'minute' => ':count минут', + 'a_minute' => '{1}пӗр минут|:count минут', + 'second' => ':count ҫеккунт', + 'a_second' => '{1}пӗр-ик ҫеккунт|:count ҫеккунт', + 'ago' => ':time каялла', + 'from_now' => static function ($time) { + return $time.(preg_match('/сехет$/u', $time) ? 'рен' : (preg_match('/ҫул/', $time) ? 'тан' : 'ран')); + }, + 'diff_yesterday' => 'Ӗнер', + 'diff_today' => 'Паян', + 'diff_tomorrow' => 'Ыран', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD-MM-YYYY', + 'LL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', + 'LLL' => 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', + 'LLLL' => 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Паян] LT [сехетре]', + 'nextDay' => '[Ыран] LT [сехетре]', + 'nextWeek' => '[Ҫитес] dddd LT [сехетре]', + 'lastDay' => '[Ӗнер] LT [сехетре]', + 'lastWeek' => '[Иртнӗ] dddd LT [сехетре]', + 'sameElse' => 'L', + ], + 'ordinal' => ':number-мӗш', + 'months' => ['кӑрлач', 'нарӑс', 'пуш', 'ака', 'май', 'ҫӗртме', 'утӑ', 'ҫурла', 'авӑн', 'юпа', 'чӳк', 'раштав'], + 'months_short' => ['кӑр', 'нар', 'пуш', 'ака', 'май', 'ҫӗр', 'утӑ', 'ҫур', 'авн', 'юпа', 'чӳк', 'раш'], + 'weekdays' => ['вырсарникун', 'тунтикун', 'ытларикун', 'юнкун', 'кӗҫнерникун', 'эрнекун', 'шӑматкун'], + 'weekdays_short' => ['выр', 'тун', 'ытл', 'юн', 'кӗҫ', 'эрн', 'шӑм'], + 'weekdays_min' => ['вр', 'тн', 'ыт', 'юн', 'кҫ', 'эр', 'шм'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' тата '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php new file mode 100644 index 00000000..197bd8d3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cv_RU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/cv.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy.php new file mode 100644 index 00000000..d769d2f5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - JD Isaacks + * - Daniel Monaghan + */ +return [ + 'year' => '{1}:count flwyddyn|[-Inf,Inf]:count flynedd', + 'a_year' => '{1}blwyddyn|[-Inf,Inf]:count flynedd', + 'y' => ':countbl', + 'month' => ':count mis', + 'a_month' => '{1}mis|[-Inf,Inf]:count mis', + 'm' => ':countmi', + 'week' => ':count wythnos', + 'a_week' => '{1}wythnos|[-Inf,Inf]:count wythnos', + 'w' => ':countw', + 'day' => ':count diwrnod', + 'a_day' => '{1}diwrnod|[-Inf,Inf]:count diwrnod', + 'd' => ':countd', + 'hour' => ':count awr', + 'a_hour' => '{1}awr|[-Inf,Inf]:count awr', + 'h' => ':counth', + 'minute' => ':count munud', + 'a_minute' => '{1}munud|[-Inf,Inf]:count munud', + 'min' => ':countm', + 'second' => ':count eiliad', + 'a_second' => '{0,1}ychydig eiliadau|[-Inf,Inf]:count eiliad', + 's' => ':counts', + 'ago' => ':time yn ôl', + 'from_now' => 'mewn :time', + 'after' => ':time ar ôl', + 'before' => ':time o\'r blaen', + 'diff_now' => 'nawr', + 'diff_today' => 'Heddiw', + 'diff_today_regexp' => 'Heddiw(?:\\s+am)?', + 'diff_yesterday' => 'ddoe', + 'diff_yesterday_regexp' => 'Ddoe(?:\\s+am)?', + 'diff_tomorrow' => 'yfory', + 'diff_tomorrow_regexp' => 'Yfory(?:\\s+am)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Heddiw am] LT', + 'nextDay' => '[Yfory am] LT', + 'nextWeek' => 'dddd [am] LT', + 'lastDay' => '[Ddoe am] LT', + 'lastWeek' => 'dddd [diwethaf am] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + return $number.( + $number > 20 + ? (\in_array((int) $number, [40, 50, 60, 80, 100], true) ? 'fed' : 'ain') + : ([ + '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed + 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed', // 11eg to 20fed + ])[$number] ?? '' + ); + }, + 'months' => ['Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr'], + 'months_short' => ['Ion', 'Chwe', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Aws', 'Med', 'Hyd', 'Tach', 'Rhag'], + 'weekdays' => ['Dydd Sul', 'Dydd Llun', 'Dydd Mawrth', 'Dydd Mercher', 'Dydd Iau', 'Dydd Gwener', 'Dydd Sadwrn'], + 'weekdays_short' => ['Sul', 'Llun', 'Maw', 'Mer', 'Iau', 'Gwe', 'Sad'], + 'weekdays_min' => ['Su', 'Ll', 'Ma', 'Me', 'Ia', 'Gw', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' a '], + 'meridiem' => ['yb', 'yh'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php new file mode 100644 index 00000000..2c8148d0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/cy_GB.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/cy.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da.php new file mode 100644 index 00000000..d0e7168e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Rune Mønnike + * - François B + * - codenhagen + * - JD Isaacks + * - Jens Herlevsen + * - Ulrik McArdle (mcardle) + * - Frederik Sauer (FrittenKeeZ) + * - Janus Bahs Jacquet (kokoshneta) + */ +return [ + 'year' => ':count år|:count år', + 'a_year' => 'et år|:count år', + 'y' => ':count år|:count år', + 'month' => ':count måned|:count måneder', + 'a_month' => 'en måned|:count måneder', + 'm' => ':count mdr.', + 'week' => ':count uge|:count uger', + 'a_week' => 'en uge|:count uger', + 'w' => ':count u.', + 'day' => ':count dag|:count dage', + 'a_day' => ':count dag|:count dage', + 'd' => ':count d.', + 'hour' => ':count time|:count timer', + 'a_hour' => 'en time|:count timer', + 'h' => ':count t.', + 'minute' => ':count minut|:count minutter', + 'a_minute' => 'et minut|:count minutter', + 'min' => ':count min.', + 'second' => ':count sekund|:count sekunder', + 'a_second' => 'få sekunder|:count sekunder', + 's' => ':count s.', + 'ago' => 'for :time siden', + 'from_now' => 'om :time', + 'after' => ':time efter', + 'before' => ':time før', + 'diff_now' => 'nu', + 'diff_today' => 'i dag', + 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', + 'diff_yesterday' => 'i går', + 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', + 'diff_tomorrow' => 'i morgen', + 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[i dag kl.] LT', + 'nextDay' => '[i morgen kl.] LT', + 'nextWeek' => 'på dddd [kl.] LT', + 'lastDay' => '[i går kl.] LT', + 'lastWeek' => '[i] dddd[s kl.] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['januar', 'februar', 'marts', 'april', 'maj', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun.', 'jul.', 'aug.', 'sep.', 'okt.', 'nov.', 'dec.'], + 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], + 'weekdays_short' => ['søn.', 'man.', 'tir.', 'ons.', 'tor.', 'fre.', 'lør.'], + 'weekdays_min' => ['sø.', 'ma.', 'ti.', 'on.', 'to.', 'fr.', 'lø.'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' og '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php new file mode 100644 index 00000000..392c4841 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_DK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/da.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php new file mode 100644 index 00000000..ea5698b9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/da_GL.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/da.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + 'LL' => 'D. MMM YYYY', + 'LLL' => 'D. MMMM YYYY HH.mm', + 'LLLL' => 'dddd [den] D. MMMM YYYY HH.mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dav.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dav.php new file mode 100644 index 00000000..4f8d1e73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dav.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Luma lwa K', 'luma lwa p'], + 'weekdays' => ['Ituku ja jumwa', 'Kuramuka jimweri', 'Kuramuka kawi', 'Kuramuka kadadu', 'Kuramuka kana', 'Kuramuka kasanu', 'Kifula nguwo'], + 'weekdays_short' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], + 'weekdays_min' => ['Jum', 'Jim', 'Kaw', 'Kad', 'Kan', 'Kas', 'Ngu'], + 'months' => ['Mori ghwa imbiri', 'Mori ghwa kawi', 'Mori ghwa kadadu', 'Mori ghwa kana', 'Mori ghwa kasanu', 'Mori ghwa karandadu', 'Mori ghwa mfungade', 'Mori ghwa wunyanya', 'Mori ghwa ikenda', 'Mori ghwa ikumi', 'Mori ghwa ikumi na imweri', 'Mori ghwa ikumi na iwi'], + 'months_short' => ['Imb', 'Kaw', 'Kad', 'Kan', 'Kas', 'Kar', 'Mfu', 'Wun', 'Ike', 'Iku', 'Imw', 'Iwi'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de.php new file mode 100644 index 00000000..90b1e350 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Michael Hohl + * - sheriffmarley + * - dennisoderwald + * - Timo + * - Karag2006 + * - Pete Scopes (pdscopes) + */ +return [ + 'year' => ':count Jahr|:count Jahre', + 'a_year' => 'ein Jahr|:count Jahre', + 'y' => ':count J.', + 'month' => ':count Monat|:count Monate', + 'a_month' => 'ein Monat|:count Monate', + 'm' => ':count Mon.', + 'week' => ':count Woche|:count Wochen', + 'a_week' => 'eine Woche|:count Wochen', + 'w' => ':count Wo.', + 'day' => ':count Tag|:count Tage', + 'a_day' => 'ein Tag|:count Tage', + 'd' => ':count Tg.', + 'hour' => ':count Stunde|:count Stunden', + 'a_hour' => 'eine Stunde|:count Stunden', + 'h' => ':count Std.', + 'minute' => ':count Minute|:count Minuten', + 'a_minute' => 'eine Minute|:count Minuten', + 'min' => ':count Min.', + 'second' => ':count Sekunde|:count Sekunden', + 'a_second' => 'ein paar Sekunden|:count Sekunden', + 's' => ':count Sek.', + 'millisecond' => ':count Millisekunde|:count Millisekunden', + 'a_millisecond' => 'eine Millisekunde|:count Millisekunden', + 'ms' => ':countms', + 'microsecond' => ':count Mikrosekunde|:count Mikrosekunden', + 'a_microsecond' => 'eine Mikrosekunde|:count Mikrosekunden', + 'µs' => ':countµs', + 'ago' => 'vor :time', + 'from_now' => 'in :time', + 'after' => ':time später', + 'before' => ':time zuvor', + + 'year_from_now' => ':count Jahr|:count Jahren', + 'month_from_now' => ':count Monat|:count Monaten', + 'week_from_now' => ':count Woche|:count Wochen', + 'day_from_now' => ':count Tag|:count Tagen', + 'year_ago' => ':count Jahr|:count Jahren', + 'month_ago' => ':count Monat|:count Monaten', + 'week_ago' => ':count Woche|:count Wochen', + 'day_ago' => ':count Tag|:count Tagen', + 'a_year_from_now' => 'ein Jahr|:count Jahren', + 'a_month_from_now' => 'ein Monat|:count Monaten', + 'a_week_from_now' => 'eine Woche|:count Wochen', + 'a_day_from_now' => 'ein Tag|:count Tagen', + 'a_year_ago' => 'ein Jahr|:count Jahren', + 'a_month_ago' => 'ein Monat|:count Monaten', + 'a_week_ago' => 'eine Woche|:count Wochen', + 'a_day_ago' => 'ein Tag|:count Tagen', + + 'diff_now' => 'Gerade eben', + 'diff_today' => 'heute', + 'diff_today_regexp' => 'heute(?:\\s+um)?', + 'diff_yesterday' => 'Gestern', + 'diff_yesterday_regexp' => 'gestern(?:\\s+um)?', + 'diff_tomorrow' => 'Morgen', + 'diff_tomorrow_regexp' => 'morgen(?:\\s+um)?', + 'diff_before_yesterday' => 'Vorgestern', + 'diff_after_tomorrow' => 'Übermorgen', + + 'period_recurrences' => 'einmal|:count mal', + 'period_interval' => static function (string $interval = '') { + /** @var string $output */ + $output = preg_replace('/^(ein|eine|1)\s+/u', '', $interval); + + if (preg_match('/^(ein|1)( Monat| Mon.| Tag| Tg.)/u', $interval)) { + return "jeden $output"; + } + + if (preg_match('/^(ein|1)( Jahr| J.)/u', $interval)) { + return "jedes $output"; + } + + return "jede $output"; + }, + 'period_start_date' => 'von :date', + 'period_end_date' => 'bis :date', + + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', + ], + + 'calendar' => [ + 'sameDay' => '[heute um] LT [Uhr]', + 'nextDay' => '[morgen um] LT [Uhr]', + 'nextWeek' => 'dddd [um] LT [Uhr]', + 'lastDay' => '[gestern um] LT [Uhr]', + 'lastWeek' => '[letzten] dddd [um] LT [Uhr]', + 'sameElse' => 'L', + ], + + 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + 'weekdays' => ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'], + 'weekdays_short' => ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'], + 'weekdays_min' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], + 'ordinal' => ':number.', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' und '], + 'ordinal_words' => [ + 'of' => 'im', + 'first' => 'erster', + 'second' => 'zweiter', + 'third' => 'dritter', + 'fourth' => 'vierten', + 'fifth' => 'fünfter', + 'last' => 'letzten', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php new file mode 100644 index 00000000..a2ea4c08 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_AT.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - sheriffmarley + * - Timo + * - Michael Hohl + * - Namoshek + * - Bernhard Baumrock (BernhardBaumrock) + */ +return array_replace_recursive(require __DIR__.'/de.php', [ + 'months' => [ + 0 => 'Jänner', + ], + 'months_short' => [ + 0 => 'Jän', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php new file mode 100644 index 00000000..8ed8dc62 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_BE.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/de.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php new file mode 100644 index 00000000..a869ab48 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_CH.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - sheriffmarley + * - Timo + * - Michael Hohl + */ +return array_replace_recursive(require __DIR__.'/de.php', [ + 'weekdays_short' => ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php new file mode 100644 index 00000000..fb1209d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_DE.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return require __DIR__.'/de.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php new file mode 100644 index 00000000..604a8568 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_IT.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Matthias Dieter Wallno:fer libc-locales@sourceware.org + */ +return require __DIR__.'/de.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php new file mode 100644 index 00000000..03e606a6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/de.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php new file mode 100644 index 00000000..8ed8dc62 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/de_LU.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/de.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dje.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dje.php new file mode 100644 index 00000000..74b7ac12 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dje.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Subbaahi', 'Zaarikay b'], + 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamisi', 'Alzuma', 'Asibti'], + 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], + 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], + 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], + 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'year' => ':count hari', // less reliable + 'y' => ':count hari', // less reliable + 'a_year' => ':count hari', // less reliable + + 'week' => ':count alzuma', // less reliable + 'w' => ':count alzuma', // less reliable + 'a_week' => ':count alzuma', // less reliable + + 'second' => ':count atinni', // less reliable + 's' => ':count atinni', // less reliable + 'a_second' => ':count atinni', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi.php new file mode 100644 index 00000000..cb679c58 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/doi_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php new file mode 100644 index 00000000..f3d43ce3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/doi_IN.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat Pune libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], + 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'एप्रैल', 'मेई', 'जून', 'जूलै', 'अगस्त', 'सितंबर', 'अक्तूबर', 'नवंबर', 'दिसंबर'], + 'weekdays' => ['ऐतबार', 'सोमबार', 'मंगलबर', 'बुधबार', 'बीरबार', 'शुक्करबार', 'श्नीचरबार'], + 'weekdays_short' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], + 'weekdays_min' => ['ऐत', 'सोम', 'मंगल', 'बुध', 'बीर', 'शुक्कर', 'श्नीचर'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['सञं', 'सबेर'], + + 'second' => ':count सङार', // less reliable + 's' => ':count सङार', // less reliable + 'a_second' => ':count सङार', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php new file mode 100644 index 00000000..1d214d56 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/dsb_DE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php new file mode 100644 index 00000000..1b941870 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dsb_DE.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Information from Michael Wolf bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'DD. MMMM YYYY', + 'LLL' => 'DD. MMMM, HH:mm [góź.]', + 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [góź.]', + ], + 'months' => ['januara', 'februara', 'měrca', 'apryla', 'maja', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], + 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Maj', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], + 'weekdays' => ['Njeźela', 'Pónjeźele', 'Wałtora', 'Srjoda', 'Stwórtk', 'Pětk', 'Sobota'], + 'weekdays_short' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], + 'weekdays_min' => ['Nj', 'Pó', 'Wa', 'Sr', 'St', 'Pě', 'So'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count lěto', + 'y' => ':count lěto', + 'a_year' => ':count lěto', + + 'month' => ':count mjasec', + 'm' => ':count mjasec', + 'a_month' => ':count mjasec', + + 'week' => ':count tyźeń', + 'w' => ':count tyźeń', + 'a_week' => ':count tyźeń', + + 'day' => ':count źeń', + 'd' => ':count źeń', + 'a_day' => ':count źeń', + + 'hour' => ':count góźina', + 'h' => ':count góźina', + 'a_hour' => ':count góźina', + + 'minute' => ':count minuta', + 'min' => ':count minuta', + 'a_minute' => ':count minuta', + + 'second' => ':count drugi', + 's' => ':count drugi', + 'a_second' => ':count drugi', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dua.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dua.php new file mode 100644 index 00000000..55e5c7c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dua.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['idiɓa', 'ebyámu'], + 'weekdays' => ['éti', 'mɔ́sú', 'kwasú', 'mukɔ́sú', 'ŋgisú', 'ɗónɛsú', 'esaɓasú'], + 'weekdays_short' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], + 'weekdays_min' => ['ét', 'mɔ́s', 'kwa', 'muk', 'ŋgi', 'ɗón', 'esa'], + 'months' => ['dimɔ́di', 'ŋgɔndɛ', 'sɔŋɛ', 'diɓáɓá', 'emiasele', 'esɔpɛsɔpɛ', 'madiɓɛ́díɓɛ́', 'diŋgindi', 'nyɛtɛki', 'mayésɛ́', 'tiníní', 'eláŋgɛ́'], + 'months_short' => ['di', 'ŋgɔn', 'sɔŋ', 'diɓ', 'emi', 'esɔ', 'mad', 'diŋ', 'nyɛt', 'may', 'tin', 'elá'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'year' => ':count ma mbu', // less reliable + 'y' => ':count ma mbu', // less reliable + 'a_year' => ':count ma mbu', // less reliable + + 'month' => ':count myo̱di', // less reliable + 'm' => ':count myo̱di', // less reliable + 'a_month' => ':count myo̱di', // less reliable + + 'week' => ':count woki', // less reliable + 'w' => ':count woki', // less reliable + 'a_week' => ':count woki', // less reliable + + 'day' => ':count buńa', // less reliable + 'd' => ':count buńa', // less reliable + 'a_day' => ':count buńa', // less reliable + + 'hour' => ':count ma awa', // less reliable + 'h' => ':count ma awa', // less reliable + 'a_hour' => ':count ma awa', // less reliable + + 'minute' => ':count minuti', // less reliable + 'min' => ':count minuti', // less reliable + 'a_minute' => ':count minuti', // less reliable + + 'second' => ':count maba', // less reliable + 's' => ':count maba', // less reliable + 'a_second' => ':count maba', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv.php new file mode 100644 index 00000000..b2062eb6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$months = [ + 'ޖަނަވަރީ', + 'ފެބުރުވަރީ', + 'މާރިޗު', + 'އެޕްރީލް', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޮގަސްޓު', + 'ސެޕްޓެންބަރު', + 'އޮކްޓޫބަރު', + 'ނޮވެންބަރު', + 'ޑިސެންބަރު', +]; + +$weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު', +]; + +/* + * Authors: + * - Josh Soref + * - Jawish Hameed + * - Saiph Muhammad + */ +return [ + 'year' => ':count '.'އަހަރު', + 'a_year' => '{1}'.'އަހަރެއް'.'|:count '.'އަހަރު', + 'month' => ':count '.'މަސް', + 'a_month' => '{1}'.'މަހެއް'.'|:count '.'މަސް', + 'week' => ':count '.'ހަފްތާ', + 'a_week' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ހަފްތާ', + 'day' => ':count '.'ދުވަސް', + 'a_day' => '{1}'.'ދުވަހެއް'.'|:count '.'ދުވަސް', + 'hour' => ':count '.'ގަޑިއިރު', + 'a_hour' => '{1}'.'ގަޑިއިރެއް'.'|:count '.'ގަޑިއިރު', + 'minute' => ':count '.'މިނިޓު', + 'a_minute' => '{1}'.'މިނިޓެއް'.'|:count '.'މިނިޓު', + 'second' => ':count '.'ސިކުންތު', + 'a_second' => '{1}'.'ސިކުންތުކޮޅެއް'.'|:count '.'ސިކުންތު', + 'ago' => 'ކުރިން :time', + 'from_now' => 'ތެރޭގައި :time', + 'after' => ':time ފަހުން', + 'before' => ':time ކުރި', + 'diff_yesterday' => 'އިއްޔެ', + 'diff_today' => 'މިއަދު', + 'diff_tomorrow' => 'މާދަމާ', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[މިއަދު] LT', + 'nextDay' => '[މާދަމާ] LT', + 'nextWeek' => 'dddd LT', + 'lastDay' => '[އިއްޔެ] LT', + 'lastWeek' => '[ފާއިތުވި] dddd LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['މކ', 'މފ'], + 'months' => $months, + 'months_short' => $months, + 'weekdays' => $weekdays, + 'weekdays_short' => $weekdays, + 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], + 'list' => [', ', ' އަދި '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php new file mode 100644 index 00000000..2668d5b0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dv_MV.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ahmed Ali + */ + +$months = [ + 'ޖެނުއަރީ', + 'ފެބްރުއަރީ', + 'މާރިޗު', + 'އޭޕްރީލު', + 'މޭ', + 'ޖޫން', + 'ޖުލައި', + 'އޯގަސްޓު', + 'ސެޕްޓެމްބަރު', + 'އޮކްޓޯބަރު', + 'ނޮވެމްބަރު', + 'ޑިސެމްބަރު', +]; + +$weekdays = [ + 'އާދިއްތަ', + 'ހޯމަ', + 'އަންގާރަ', + 'ބުދަ', + 'ބުރާސްފަތި', + 'ހުކުރު', + 'ހޮނިހިރު', +]; + +return [ + 'year' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', + 'y' => '{0}އަހަރެއް|[1,Inf]:count އަހަރު', + 'month' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', + 'm' => '{0}މައްސަރެއް|[1,Inf]:count މަސް', + 'week' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', + 'w' => '{0}ހަފްތާއެއް|[1,Inf]:count ހަފްތާ', + 'day' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', + 'd' => '{0}ދުވަސް|[1,Inf]:count ދުވަސް', + 'hour' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', + 'h' => '{0}ގަޑިއިރެއް|[1,Inf]:count ގަޑި', + 'minute' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', + 'min' => '{0}މިނެޓެއް|[1,Inf]:count މިނެޓް', + 'second' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', + 's' => '{0}ސިކުންތެއް|[1,Inf]:count ސިކުންތު', + 'ago' => ':time ކުރިން', + 'from_now' => ':time ފަހުން', + 'after' => ':time ފަހުން', + 'before' => ':time ކުރި', + 'diff_yesterday' => 'އިއްޔެ', + 'diff_today' => 'މިއަދު', + 'diff_tomorrow' => 'މާދަމާ', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[މިއަދު] LT', + 'nextDay' => '[މާދަމާ] LT', + 'nextWeek' => 'dddd LT', + 'lastDay' => '[އިއްޔެ] LT', + 'lastWeek' => '[ފާއިތުވި] dddd LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['މކ', 'މފ'], + 'months' => $months, + 'months_short' => $months, + 'weekdays' => $weekdays, + 'weekdays_short' => $weekdays, + 'weekdays_min' => ['އާދި', 'ހޯމަ', 'އަން', 'ބުދަ', 'ބުރާ', 'ހުކު', 'ހޮނި'], + 'list' => [', ', ' އަދި '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php new file mode 100644 index 00000000..33082e67 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dyo.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['Dimas', 'Teneŋ', 'Talata', 'Alarbay', 'Aramisay', 'Arjuma', 'Sibiti'], + 'weekdays_short' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], + 'weekdays_min' => ['Dim', 'Ten', 'Tal', 'Ala', 'Ara', 'Arj', 'Sib'], + 'months' => ['Sanvie', 'Fébirie', 'Mars', 'Aburil', 'Mee', 'Sueŋ', 'Súuyee', 'Ut', 'Settembar', 'Oktobar', 'Novembar', 'Disambar'], + 'months_short' => ['Sa', 'Fe', 'Ma', 'Ab', 'Me', 'Su', 'Sú', 'Ut', 'Se', 'Ok', 'No', 'De'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz.php new file mode 100644 index 00000000..cc17e69e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/dz_BT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php new file mode 100644 index 00000000..5c40142d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/dz_BT.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sherubtse College bug-glibc@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'པསྱི་ལོYYཟལMMཚེསDD', + ], + 'months' => ['ཟླ་བ་དང་པ་', 'ཟླ་བ་གཉིས་པ་', 'ཟླ་བ་གསུམ་པ་', 'ཟླ་བ་བཞི་པ་', 'ཟླ་བ་ལྔ་ཕ་', 'ཟླ་བ་དྲུག་པ་', 'ཟླ་བ་བདུནཔ་', 'ཟླ་བ་བརྒྱད་པ་', 'ཟླ་བ་དགུ་པ་', 'ཟླ་བ་བཅུ་པ་', 'ཟླ་བ་བཅུ་གཅིག་པ་', 'ཟླ་བ་བཅུ་གཉིས་པ་'], + 'months_short' => ['ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥', 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠', 'ཟླ་༡༡', 'ཟླ་༡༢'], + 'weekdays' => ['གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་', 'གཟའ་ལྷག་ཕ་', 'གཟའ་པུར་བུ་', 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་ཕ་', 'གཟའ་ཉི་མ་'], + 'weekdays_short' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], + 'weekdays_min' => ['ཟླ་', 'མིར་', 'ལྷག་', 'པུར་', 'སངས་', 'སྤེན་', 'ཉི་'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ངས་ཆ', 'ཕྱི་ཆ'], + + 'year' => ':count ཆརཔ', // less reliable + 'y' => ':count ཆརཔ', // less reliable + 'a_year' => ':count ཆརཔ', // less reliable + + 'month' => ':count ཟླ་བ', // less reliable + 'm' => ':count ཟླ་བ', // less reliable + 'a_month' => ':count ཟླ་བ', // less reliable + + 'day' => ':count ཉི', // less reliable + 'd' => ':count ཉི', // less reliable + 'a_day' => ':count ཉི', // less reliable + + 'second' => ':count ཆ', // less reliable + 's' => ':count ཆ', // less reliable + 'a_second' => ':count ཆ', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php new file mode 100644 index 00000000..9e7d9577 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ebu.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['KI', 'UT'], + 'weekdays' => ['Kiumia', 'Njumatatu', 'Njumaine', 'Njumatano', 'Aramithi', 'Njumaa', 'NJumamothii'], + 'weekdays_short' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], + 'weekdays_min' => ['Kma', 'Tat', 'Ine', 'Tan', 'Arm', 'Maa', 'NMM'], + 'months' => ['Mweri wa mbere', 'Mweri wa kaĩri', 'Mweri wa kathatũ', 'Mweri wa kana', 'Mweri wa gatano', 'Mweri wa gatantatũ', 'Mweri wa mũgwanja', 'Mweri wa kanana', 'Mweri wa kenda', 'Mweri wa ikũmi', 'Mweri wa ikũmi na ũmwe', 'Mweri wa ikũmi na Kaĩrĩ'], + 'months_short' => ['Mbe', 'Kai', 'Kat', 'Kan', 'Gat', 'Gan', 'Mug', 'Knn', 'Ken', 'Iku', 'Imw', 'Igi'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee.php new file mode 100644 index 00000000..f96c5c9d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['ŋ', 'ɣ'], + 'weekdays' => ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'], + 'weekdays_short' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], + 'weekdays_min' => ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'], + 'months' => ['dzove', 'dzodze', 'tedoxe', 'afɔfĩe', 'dama', 'masa', 'siamlɔm', 'deasiamime', 'anyɔnyɔ', 'kele', 'adeɛmekpɔxe', 'dzome'], + 'months_short' => ['dzv', 'dzd', 'ted', 'afɔ', 'dam', 'mas', 'sia', 'dea', 'any', 'kel', 'ade', 'dzm'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'a [ga] h:mm', + 'LTS' => 'a [ga] h:mm:ss', + 'L' => 'M/D/YYYY', + 'LL' => 'MMM D [lia], YYYY', + 'LLL' => 'a [ga] h:mm MMMM D [lia] YYYY', + 'LLLL' => 'a [ga] h:mm dddd, MMMM D [lia] YYYY', + ], + + 'year' => 'ƒe :count', + 'y' => 'ƒe :count', + 'a_year' => 'ƒe :count', + + 'month' => 'ɣleti :count', + 'm' => 'ɣleti :count', + 'a_month' => 'ɣleti :count', + + 'week' => 'kwasiɖa :count', + 'w' => 'kwasiɖa :count', + 'a_week' => 'kwasiɖa :count', + + 'day' => 'ŋkeke :count', + 'd' => 'ŋkeke :count', + 'a_day' => 'ŋkeke :count', + + 'hour' => 'gaƒoƒo :count', + 'h' => 'gaƒoƒo :count', + 'a_hour' => 'gaƒoƒo :count', + + 'minute' => 'miniti :count', // less reliable + 'min' => 'miniti :count', // less reliable + 'a_minute' => 'miniti :count', // less reliable + + 'second' => 'sɛkɛnd :count', // less reliable + 's' => 'sɛkɛnd :count', // less reliable + 'a_second' => 'sɛkɛnd :count', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php new file mode 100644 index 00000000..7a8b36c9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ee_TG.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ee.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'LLL' => 'HH:mm MMMM D [lia] YYYY', + 'LLLL' => 'HH:mm dddd, MMMM D [lia] YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el.php new file mode 100644 index 00000000..8711fa2b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Alessandro Di Felice + * - François B + * - Tim Fish + * - Gabriel Monteagudo + * - JD Isaacks + * - yiannisdesp + * - Ilias Kasmeridis (iliaskasm) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count χρόνος|:count χρόνια', + 'a_year' => 'ένας χρόνος|:count χρόνια', + 'y' => ':count χρ.', + 'month' => ':count μήνας|:count μήνες', + 'a_month' => 'ένας μήνας|:count μήνες', + 'm' => ':count μήν.', + 'week' => ':count εβδομάδα|:count εβδομάδες', + 'a_week' => 'μια εβδομάδα|:count εβδομάδες', + 'w' => ':count εβδ.', + 'day' => ':count μέρα|:count μέρες', + 'a_day' => 'μία μέρα|:count μέρες', + 'd' => ':count μέρ.', + 'hour' => ':count ώρα|:count ώρες', + 'a_hour' => 'μία ώρα|:count ώρες', + 'h' => ':count ώρα|:count ώρες', + 'minute' => ':count λεπτό|:count λεπτά', + 'a_minute' => 'ένα λεπτό|:count λεπτά', + 'min' => ':count λεπ.', + 'second' => ':count δευτερόλεπτο|:count δευτερόλεπτα', + 'a_second' => 'λίγα δευτερόλεπτα|:count δευτερόλεπτα', + 's' => ':count δευ.', + 'ago' => 'πριν :time', + 'from_now' => 'σε :time', + 'after' => ':time μετά', + 'before' => ':time πριν', + 'diff_now' => 'τώρα', + 'diff_today' => 'Σήμερα', + 'diff_today_regexp' => 'Σήμερα(?:\\s+{})?', + 'diff_yesterday' => 'χθες', + 'diff_yesterday_regexp' => 'Χθες(?:\\s+{})?', + 'diff_tomorrow' => 'αύριο', + 'diff_tomorrow_regexp' => 'Αύριο(?:\\s+{})?', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm A', + 'LLLL' => 'dddd, D MMMM YYYY h:mm A', + ], + 'calendar' => [ + 'sameDay' => '[Σήμερα {}] LT', + 'nextDay' => '[Αύριο {}] LT', + 'nextWeek' => 'dddd [{}] LT', + 'lastDay' => '[Χθες {}] LT', + 'lastWeek' => static fn (CarbonInterface $current) => match ($current->dayOfWeek) { + 6 => '[το προηγούμενο] dddd [{}] LT', + default => '[την προηγούμενη] dddd [{}] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':numberη', + 'meridiem' => ['ΠΜ', 'ΜΜ', 'πμ', 'μμ'], + 'months' => ['Ιανουαρίου', 'Φεβρουαρίου', 'Μαρτίου', 'Απριλίου', 'Μαΐου', 'Ιουνίου', 'Ιουλίου', 'Αυγούστου', 'Σεπτεμβρίου', 'Οκτωβρίου', 'Νοεμβρίου', 'Δεκεμβρίου'], + 'months_standalone' => ['Ιανουάριος', 'Φεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'Ιούνιος', 'Ιούλιος', 'Αύγουστος', 'Σεπτέμβριος', 'Οκτώβριος', 'Νοέμβριος', 'Δεκέμβριος'], + 'months_regexp' => '/(D[oD]?[\s,]+MMMM|L{2,4}|l{2,4})/', + 'months_short' => ['Ιαν', 'Φεβ', 'Μαρ', 'Απρ', 'Μαϊ', 'Ιουν', 'Ιουλ', 'Αυγ', 'Σεπ', 'Οκτ', 'Νοε', 'Δεκ'], + 'weekdays' => ['Κυριακή', 'Δευτέρα', 'Τρίτη', 'Τετάρτη', 'Πέμπτη', 'Παρασκευή', 'Σάββατο'], + 'weekdays_short' => ['Κυρ', 'Δευ', 'Τρι', 'Τετ', 'Πεμ', 'Παρ', 'Σαβ'], + 'weekdays_min' => ['Κυ', 'Δε', 'Τρ', 'Τε', 'Πε', 'Πα', 'Σα'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' και '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php new file mode 100644 index 00000000..8a693c15 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_CY.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Greek Debian Translation Team bug-glibc@gnu.org + */ +return array_replace_recursive(require __DIR__.'/el.php', [ + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php new file mode 100644 index 00000000..df196af9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/el_GR.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/el.php', [ + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en.php new file mode 100644 index 00000000..79f50aad --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Milos Sakovic + * - Paul + * - Pete Scopes (pdscopes) + */ +return [ + /* + * {1}, {0} and [-Inf,Inf] are not needed as it's the default for English pluralization. + * But as some languages are using en.php as a fallback, it's better to specify it + * explicitly so those languages also fallback to English pluralization when a unit + * is missing. + */ + 'year' => '{1}:count year|{0}:count years|[-Inf,Inf]:count years', + 'a_year' => '{1}a year|{0}:count years|[-Inf,Inf]:count years', + 'y' => '{1}:countyr|{0}:countyrs|[-Inf,Inf]:countyrs', + 'month' => '{1}:count month|{0}:count months|[-Inf,Inf]:count months', + 'a_month' => '{1}a month|{0}:count months|[-Inf,Inf]:count months', + 'm' => '{1}:countmo|{0}:countmos|[-Inf,Inf]:countmos', + 'week' => '{1}:count week|{0}:count weeks|[-Inf,Inf]:count weeks', + 'a_week' => '{1}a week|{0}:count weeks|[-Inf,Inf]:count weeks', + 'w' => ':countw', + 'day' => '{1}:count day|{0}:count days|[-Inf,Inf]:count days', + 'a_day' => '{1}a day|{0}:count days|[-Inf,Inf]:count days', + 'd' => ':countd', + 'hour' => '{1}:count hour|{0}:count hours|[-Inf,Inf]:count hours', + 'a_hour' => '{1}an hour|{0}:count hours|[-Inf,Inf]:count hours', + 'h' => ':counth', + 'minute' => '{1}:count minute|{0}:count minutes|[-Inf,Inf]:count minutes', + 'a_minute' => '{1}a minute|{0}:count minutes|[-Inf,Inf]:count minutes', + 'min' => ':countm', + 'second' => '{1}:count second|{0}:count seconds|[-Inf,Inf]:count seconds', + 'a_second' => '{0,1}a few seconds|[-Inf,Inf]:count seconds', + 's' => ':counts', + 'millisecond' => '{1}:count millisecond|{0}:count milliseconds|[-Inf,Inf]:count milliseconds', + 'a_millisecond' => '{1}a millisecond|{0}:count milliseconds|[-Inf,Inf]:count milliseconds', + 'ms' => ':countms', + 'microsecond' => '{1}:count microsecond|{0}:count microseconds|[-Inf,Inf]:count microseconds', + 'a_microsecond' => '{1}a microsecond|{0}:count microseconds|[-Inf,Inf]:count microseconds', + 'µs' => ':countµs', + 'ago' => ':time ago', + 'from_now' => ':time from now', + 'after' => ':time after', + 'before' => ':time before', + 'diff_now' => 'just now', + 'diff_today' => 'today', + 'diff_yesterday' => 'yesterday', + 'diff_tomorrow' => 'tomorrow', + 'diff_before_yesterday' => 'before yesterday', + 'diff_after_tomorrow' => 'after tomorrow', + 'period_recurrences' => '{1}once|{0}:count times|[-Inf,Inf]:count times', + 'period_interval' => 'every :interval', + 'period_start_date' => 'from :date', + 'period_end_date' => 'to :date', + 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + 'weekdays' => ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + 'weekdays_short' => ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + 'weekdays_min' => ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + 'ordinal' => static function ($number) { + $lastDigit = $number % 10; + + return $number.( + ((int) ($number % 100 / 10) === 1) ? 'th' : ( + ($lastDigit === 1) ? 'st' : ( + ($lastDigit === 2) ? 'nd' : ( + ($lastDigit === 3) ? 'rd' : 'th' + ) + ) + ) + ); + }, + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'MM/DD/YYYY', + 'LL' => 'MMMM D, YYYY', + 'LLL' => 'MMMM D, YYYY h:mm A', + 'LLLL' => 'dddd, MMMM D, YYYY h:mm A', + ], + 'list' => [', ', ' and '], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_001.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_150.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php new file mode 100644 index 00000000..06c6e1ac --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AG.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AS.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AT.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php new file mode 100644 index 00000000..d1df6144 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_AU.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - François B + * - Mayank Badola + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm A', + 'LLLL' => 'dddd, D MMMM YYYY h:mm A', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BB.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BS.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BW.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_BZ.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php new file mode 100644 index 00000000..824571e0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CA.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Zhan Tong Zhang + * - Mayank Badola + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'YYYY-MM-DD', + 'LL' => 'MMMM D, YYYY', + 'LLL' => 'MMMM D, YYYY h:mm A', + 'LLLL' => 'dddd, MMMM D, YYYY h:mm A', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php new file mode 100644 index 00000000..16668ffd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CH.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CX.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php new file mode 100644 index 00000000..7dfb7210 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_CY.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - NehaGautam + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD-MM-YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php new file mode 100644 index 00000000..9615e043 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DK.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Danish Standards Association bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_DM.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ER.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FJ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_FM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php new file mode 100644 index 00000000..6ba71015 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GB.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Mayank Badola + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GD.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GU.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_GY.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php new file mode 100644 index 00000000..d0963b4e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_HK.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php new file mode 100644 index 00000000..62e5092f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IE.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Martin McWhorter + * - François B + * - Chris Cartlidge + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD-MM-YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php new file mode 100644 index 00000000..b6107a96 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IL.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Yoav Amit + * - François B + * - Mayank Badola + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php new file mode 100644 index 00000000..4a3f0314 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IN.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YY', + 'LL' => 'MMMM DD, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_IO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php new file mode 100644 index 00000000..6688b137 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ISO.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_JM.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KE.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_KY.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_LS.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MH.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MO.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MP.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MS.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MT.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_MY.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php new file mode 100644 index 00000000..c337cfc0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NG.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php new file mode 100644 index 00000000..be65cd3e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_NZ.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Mayank Badola + * - Luke McGregor + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm A', + 'LLLL' => 'dddd, D MMMM YYYY h:mm A', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php new file mode 100644 index 00000000..d0963b4e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PH.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PK.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PR.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_PW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_RW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SB.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php new file mode 100644 index 00000000..c4e2557e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SD.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 6, + 'weekend' => [5, 6], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php new file mode 100644 index 00000000..e31e8264 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SG.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'from_now' => 'in :time', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SS.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SX.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_SZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TT.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TV.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_TZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_UM.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php new file mode 100644 index 00000000..135bc0c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_US_Posix.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en_US.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VI.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php new file mode 100644 index 00000000..f086dc63 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_VU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/en.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_WS.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php new file mode 100644 index 00000000..54d8d881 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZA.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YY', + 'LL' => 'MMMM DD, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php new file mode 100644 index 00000000..c6bc0b2f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZM.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - ANLoc Martin Benjamin locales@africanlocalization.net + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/en_ZW.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eo.php new file mode 100644 index 00000000..7c2efba2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eo.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Mia Nordentoft + * - JD Isaacks + */ +return [ + 'year' => ':count jaro|:count jaroj', + 'a_year' => 'jaro|:count jaroj', + 'y' => ':count j.', + 'month' => ':count monato|:count monatoj', + 'a_month' => 'monato|:count monatoj', + 'm' => ':count mo.', + 'week' => ':count semajno|:count semajnoj', + 'a_week' => 'semajno|:count semajnoj', + 'w' => ':count sem.', + 'day' => ':count tago|:count tagoj', + 'a_day' => 'tago|:count tagoj', + 'd' => ':count t.', + 'hour' => ':count horo|:count horoj', + 'a_hour' => 'horo|:count horoj', + 'h' => ':count h.', + 'minute' => ':count minuto|:count minutoj', + 'a_minute' => 'minuto|:count minutoj', + 'min' => ':count min.', + 'second' => ':count sekundo|:count sekundoj', + 'a_second' => 'sekundoj|:count sekundoj', + 's' => ':count sek.', + 'ago' => 'antaŭ :time', + 'from_now' => 'post :time', + 'after' => ':time poste', + 'before' => ':time antaŭe', + 'diff_yesterday' => 'Hieraŭ', + 'diff_yesterday_regexp' => 'Hieraŭ(?:\\s+je)?', + 'diff_today' => 'Hodiaŭ', + 'diff_today_regexp' => 'Hodiaŭ(?:\\s+je)?', + 'diff_tomorrow' => 'Morgaŭ', + 'diff_tomorrow_regexp' => 'Morgaŭ(?:\\s+je)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'D[-a de] MMMM, YYYY', + 'LLL' => 'D[-a de] MMMM, YYYY HH:mm', + 'LLLL' => 'dddd, [la] D[-a de] MMMM, YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Hodiaŭ je] LT', + 'nextDay' => '[Morgaŭ je] LT', + 'nextWeek' => 'dddd [je] LT', + 'lastDay' => '[Hieraŭ je] LT', + 'lastWeek' => '[pasinta] dddd [je] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numbera', + 'meridiem' => ['a.t.m.', 'p.t.m.'], + 'months' => ['januaro', 'februaro', 'marto', 'aprilo', 'majo', 'junio', 'julio', 'aŭgusto', 'septembro', 'oktobro', 'novembro', 'decembro'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aŭg', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['dimanĉo', 'lundo', 'mardo', 'merkredo', 'ĵaŭdo', 'vendredo', 'sabato'], + 'weekdays_short' => ['dim', 'lun', 'mard', 'merk', 'ĵaŭ', 'ven', 'sab'], + 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'ĵa', 've', 'sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' kaj '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es.php new file mode 100644 index 00000000..dc24945c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es.php @@ -0,0 +1,125 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - kostas + * - François B + * - Tim Fish + * - Claire Coloma + * - Steven Heinrich + * - JD Isaacks + * - Raphael Amorim + * - Jorge Y. Castillo + * - Víctor Díaz + * - Diego + * - Sebastian Thierer + * - quinterocesar + * - Daniel Commesse Liévanos (danielcommesse) + * - Pete Scopes (pdscopes) + * - gam04 + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count año|:count años', + 'a_year' => 'un año|:count años', + 'y' => ':count año|:count años', + 'month' => ':count mes|:count meses', + 'a_month' => 'un mes|:count meses', + 'm' => ':count mes|:count meses', + 'week' => ':count semana|:count semanas', + 'a_week' => 'una semana|:count semanas', + 'w' => ':countsem', + 'day' => ':count día|:count días', + 'a_day' => 'un día|:count días', + 'd' => ':countd', + 'hour' => ':count hora|:count horas', + 'a_hour' => 'una hora|:count horas', + 'h' => ':counth', + 'minute' => ':count minuto|:count minutos', + 'a_minute' => 'un minuto|:count minutos', + 'min' => ':countm', + 'second' => ':count segundo|:count segundos', + 'a_second' => 'unos segundos|:count segundos', + 's' => ':counts', + 'millisecond' => ':count milisegundo|:count milisegundos', + 'a_millisecond' => 'un milisegundo|:count milisegundos', + 'ms' => ':countms', + 'microsecond' => ':count microsegundo|:count microsegundos', + 'a_microsecond' => 'un microsegundo|:count microsegundos', + 'µs' => ':countµs', + 'ago' => 'hace :time', + 'from_now' => 'en :time', + 'after' => ':time después', + 'before' => ':time antes', + 'diff_now' => 'ahora mismo', + 'diff_today' => 'hoy', + 'diff_today_regexp' => 'hoy(?:\\s+a)?(?:\\s+las)?', + 'diff_yesterday' => 'ayer', + 'diff_yesterday_regexp' => 'ayer(?:\\s+a)?(?:\\s+las)?', + 'diff_tomorrow' => 'mañana', + 'diff_tomorrow_regexp' => 'mañana(?:\\s+a)?(?:\\s+las)?', + 'diff_before_yesterday' => 'anteayer', + 'diff_after_tomorrow' => 'pasado mañana', + 'period_recurrences' => 'una vez|:count veces', + 'period_interval' => 'cada :interval', + 'period_start_date' => 'de :date', + 'period_end_date' => 'a :date', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D [de] MMMM [de] YYYY', + 'LLL' => 'D [de] MMMM [de] YYYY H:mm', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => static function (CarbonInterface $current) { + return '[hoy a la'.($current->hour !== 1 ? 's' : '').'] LT'; + }, + 'nextDay' => static function (CarbonInterface $current) { + return '[mañana a la'.($current->hour !== 1 ? 's' : '').'] LT'; + }, + 'nextWeek' => static function (CarbonInterface $current) { + return 'dddd [a la'.($current->hour !== 1 ? 's' : '').'] LT'; + }, + 'lastDay' => static function (CarbonInterface $current) { + return '[ayer a la'.($current->hour !== 1 ? 's' : '').'] LT'; + }, + 'lastWeek' => static function (CarbonInterface $current) { + return '[el] dddd [pasado a la'.($current->hour !== 1 ? 's' : '').'] LT'; + }, + 'sameElse' => 'L', + ], + 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], + 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], + 'mmm_suffix' => '.', + 'ordinal' => ':numberº', + 'weekdays' => ['domingo', 'lunes', 'martes', 'miércoles', 'jueves', 'viernes', 'sábado'], + 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mié.', 'jue.', 'vie.', 'sáb.'], + 'weekdays_min' => ['do', 'lu', 'ma', 'mi', 'ju', 'vi', 'sá'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' y '], + 'meridiem' => ['a. m.', 'p. m.'], + 'ordinal_words' => [ + 'of' => 'de', + 'first' => 'primer', + 'second' => 'segundo', + 'third' => 'tercer', + 'fourth' => 'cuarto', + 'fifth' => 'quinto', + 'last' => 'último', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_419.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_AR.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php new file mode 100644 index 00000000..c9b8432e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BO.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php new file mode 100644 index 00000000..378d0547 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BR.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php new file mode 100644 index 00000000..378d0547 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_BZ.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CL.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CO.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php new file mode 100644 index 00000000..553fc09f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CR.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php new file mode 100644 index 00000000..f02e1a66 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_CU.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php new file mode 100644 index 00000000..0f855bac --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_DO.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - kostas + * - François B + * - Tim Fish + * - Chiel Robben + * - Claire Coloma + * - Steven Heinrich + * - JD Isaacks + * - Raphael Amorim + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'diff_before_yesterday' => 'anteayer', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'LLL' => 'D [de] MMMM [de] YYYY h:mm A', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm A', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php new file mode 100644 index 00000000..f02e1a66 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EA.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_EC.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php new file mode 100644 index 00000000..19217c27 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_ES.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return require __DIR__.'/es.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php new file mode 100644 index 00000000..f02e1a66 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GQ.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_GT.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_HN.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php new file mode 100644 index 00000000..f02e1a66 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_IC.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php new file mode 100644 index 00000000..61e14cfa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_MX.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'diff_before_yesterday' => 'antier', + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php new file mode 100644 index 00000000..6b964c14 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_NI.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PA.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PE.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php new file mode 100644 index 00000000..deae06a1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PH.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/M/yy', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D [de] MMMM [de] YYYY h:mm a', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php new file mode 100644 index 00000000..6b964c14 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PR.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_PY.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php new file mode 100644 index 00000000..00db08e2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_SV.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], + 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php new file mode 100644 index 00000000..f333136f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_US.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - Josh Soref + * - Jørn Ølmheim + * - Craig Patik + * - bustta + * - François B + * - Tim Fish + * - Claire Coloma + * - Steven Heinrich + * - JD Isaacks + * - Raphael Amorim + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'diff_before_yesterday' => 'anteayer', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'MM/DD/YYYY', + 'LL' => 'MMMM [de] D [de] YYYY', + 'LLL' => 'MMMM [de] D [de] YYYY h:mm A', + 'LLLL' => 'dddd, MMMM [de] D [de] YYYY h:mm A', + ], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php new file mode 100644 index 00000000..39baff8b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_UY.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'setiembre', 'octubre', 'noviembre', 'diciembre'], + 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'set', 'oct', 'nov', 'dic'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php new file mode 100644 index 00000000..a74806e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/es_VE.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/es.php', [ + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et.php new file mode 100644 index 00000000..f49c8806 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Andres Ivanov + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Juanito Fatas + * - RM87 + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Esko Lehtme + * - Mart Karu + * - Nicolás Hock Isaza + * - Kevin Valdek + * - Zahhar Kirillov + * - João Magalhães + * - Ingmar + * - Illimar Tambek + * - Mihkel + */ +return [ + 'year' => ':count aasta|:count aastat', + 'y' => ':count a', + 'month' => ':count kuu|:count kuud', + 'm' => ':count k', + 'week' => ':count nädal|:count nädalat', + 'w' => ':count näd', + 'day' => ':count päev|:count päeva', + 'd' => ':count p', + 'hour' => ':count tund|:count tundi', + 'h' => ':count t', + 'minute' => ':count minut|:count minutit', + 'min' => ':count min', + 'second' => ':count sekund|:count sekundit', + 's' => ':count s', + 'ago' => ':time tagasi', + 'from_now' => ':time pärast', + 'after' => ':time pärast', + 'before' => ':time enne', + 'year_from_now' => ':count aasta', + 'month_from_now' => ':count kuu', + 'week_from_now' => ':count nädala', + 'day_from_now' => ':count päeva', + 'hour_from_now' => ':count tunni', + 'minute_from_now' => ':count minuti', + 'second_from_now' => ':count sekundi', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'diff_now' => 'nüüd', + 'diff_today' => 'täna', + 'diff_yesterday' => 'eile', + 'diff_tomorrow' => 'homme', + 'diff_before_yesterday' => 'üleeile', + 'diff_after_tomorrow' => 'ülehomme', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[täna] LT', + 'nextDay' => '[homme] LT', + 'lastDay' => '[eile] LT', + 'nextWeek' => 'dddd LT', + 'lastWeek' => '[eelmine] dddd LT', + 'sameElse' => 'L', + ], + 'months' => ['jaanuar', 'veebruar', 'märts', 'aprill', 'mai', 'juuni', 'juuli', 'august', 'september', 'oktoober', 'november', 'detsember'], + 'months_short' => ['jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets'], + 'weekdays' => ['pühapäev', 'esmaspäev', 'teisipäev', 'kolmapäev', 'neljapäev', 'reede', 'laupäev'], + 'weekdays_short' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], + 'weekdays_min' => ['P', 'E', 'T', 'K', 'N', 'R', 'L'], + 'list' => [', ', ' ja '], + 'meridiem' => ['enne lõunat', 'pärast lõunat'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php new file mode 100644 index 00000000..0f112b34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/et_EE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/et.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu.php new file mode 100644 index 00000000..a543f1a6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - JD Isaacks + */ +return [ + 'year' => 'urte bat|:count urte', + 'y' => 'Urte 1|:count urte', + 'month' => 'hilabete bat|:count hilabete', + 'm' => 'Hile 1|:count hile', + 'week' => 'Aste 1|:count aste', + 'w' => 'Aste 1|:count aste', + 'day' => 'egun bat|:count egun', + 'd' => 'Egun 1|:count egun', + 'hour' => 'ordu bat|:count ordu', + 'h' => 'Ordu 1|:count ordu', + 'minute' => 'minutu bat|:count minutu', + 'min' => 'Minutu 1|:count minutu', + 'second' => 'segundo batzuk|:count segundo', + 's' => 'Segundu 1|:count segundu', + 'ago' => 'duela :time', + 'from_now' => ':time barru', + 'after' => ':time geroago', + 'before' => ':time lehenago', + 'diff_now' => 'orain', + 'diff_today' => 'gaur', + 'diff_yesterday' => 'atzo', + 'diff_tomorrow' => 'bihar', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'YYYY[ko] MMMM[ren] D[a]', + 'LLL' => 'YYYY[ko] MMMM[ren] D[a] HH:mm', + 'LLLL' => 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[gaur] LT[etan]', + 'nextDay' => '[bihar] LT[etan]', + 'nextWeek' => 'dddd LT[etan]', + 'lastDay' => '[atzo] LT[etan]', + 'lastWeek' => '[aurreko] dddd LT[etan]', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['urtarrila', 'otsaila', 'martxoa', 'apirila', 'maiatza', 'ekaina', 'uztaila', 'abuztua', 'iraila', 'urria', 'azaroa', 'abendua'], + 'months_short' => ['urt.', 'ots.', 'mar.', 'api.', 'mai.', 'eka.', 'uzt.', 'abu.', 'ira.', 'urr.', 'aza.', 'abe.'], + 'weekdays' => ['igandea', 'astelehena', 'asteartea', 'asteazkena', 'osteguna', 'ostirala', 'larunbata'], + 'weekdays_short' => ['ig.', 'al.', 'ar.', 'az.', 'og.', 'ol.', 'lr.'], + 'weekdays_min' => ['ig', 'al', 'ar', 'az', 'og', 'ol', 'lr'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' eta '], + 'meridiem' => ['g', 'a'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php new file mode 100644 index 00000000..0d1e82a9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/eu_ES.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/eu.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php new file mode 100644 index 00000000..7808ab50 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ewo.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['kíkíríg', 'ngəgógəle'], + 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndi', 'sɔ́ndɔ məlú mə́bɛ̌', 'sɔ́ndɔ məlú mə́lɛ́', 'sɔ́ndɔ məlú mə́nyi', 'fúladé', 'séradé'], + 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], + 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'fúl', 'sér'], + 'months' => ['ngɔn osú', 'ngɔn bɛ̌', 'ngɔn lála', 'ngɔn nyina', 'ngɔn tána', 'ngɔn saməna', 'ngɔn zamgbála', 'ngɔn mwom', 'ngɔn ebulú', 'ngɔn awóm', 'ngɔn awóm ai dziá', 'ngɔn awóm ai bɛ̌'], + 'months_short' => ['ngo', 'ngb', 'ngl', 'ngn', 'ngt', 'ngs', 'ngz', 'ngm', 'nge', 'nga', 'ngad', 'ngab'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + // Too unreliable + /* + 'year' => ':count mbu', // less reliable + 'y' => ':count mbu', // less reliable + 'a_year' => ':count mbu', // less reliable + + 'month' => ':count ngòn', // less reliable + 'm' => ':count ngòn', // less reliable + 'a_month' => ':count ngòn', // less reliable + + 'week' => ':count mësë', // less reliable + 'w' => ':count mësë', // less reliable + 'a_week' => ':count mësë', // less reliable + + 'day' => ':count mësë', // less reliable + 'd' => ':count mësë', // less reliable + 'a_day' => ':count mësë', // less reliable + + 'hour' => ':count awola', // less reliable + 'h' => ':count awola', // less reliable + 'a_hour' => ':count awola', // less reliable + + 'minute' => ':count awola', // less reliable + 'min' => ':count awola', // less reliable + 'a_minute' => ':count awola', // less reliable + */ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa.php new file mode 100644 index 00000000..72e03085 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Nasser Ghiasi + * - JD Isaacks + * - Hossein Jabbari + * - nimamo + * - hafezdivandari + * - Hassan Pezeshk (hpez) + */ +return [ + 'year' => ':count سال', + 'a_year' => 'یک سال'.'|:count '.'سال', + 'y' => ':count سال', + 'month' => ':count ماه', + 'a_month' => 'یک ماه'.'|:count '.'ماه', + 'm' => ':count ماه', + 'week' => ':count هفته', + 'a_week' => 'یک هفته'.'|:count '.'هفته', + 'w' => ':count هفته', + 'day' => ':count روز', + 'a_day' => 'یک روز'.'|:count '.'روز', + 'd' => ':count روز', + 'hour' => ':count ساعت', + 'a_hour' => 'یک ساعت'.'|:count '.'ساعت', + 'h' => ':count ساعت', + 'minute' => ':count دقیقه', + 'a_minute' => 'یک دقیقه'.'|:count '.'دقیقه', + 'min' => ':count دقیقه', + 'second' => ':count ثانیه', + 's' => ':count ثانیه', + 'ago' => ':time پیش', + 'from_now' => ':time دیگر', + 'after' => ':time پس از', + 'before' => ':time پیش از', + 'diff_now' => 'اکنون', + 'diff_today' => 'امروز', + 'diff_today_regexp' => 'امروز(?:\\s+ساعت)?', + 'diff_yesterday' => 'دیروز', + 'diff_yesterday_regexp' => 'دیروز(?:\\s+ساعت)?', + 'diff_tomorrow' => 'فردا', + 'diff_tomorrow_regexp' => 'فردا(?:\\s+ساعت)?', + 'formats' => [ + 'LT' => 'OH:Om', + 'LTS' => 'OH:Om:Os', + 'L' => 'OD/OM/OY', + 'LL' => 'OD MMMM OY', + 'LLL' => 'OD MMMM OY OH:Om', + 'LLLL' => 'dddd, OD MMMM OY OH:Om', + ], + 'calendar' => [ + 'sameDay' => '[امروز ساعت] LT', + 'nextDay' => '[فردا ساعت] LT', + 'nextWeek' => 'dddd [ساعت] LT', + 'lastDay' => '[دیروز ساعت] LT', + 'lastWeek' => 'dddd [پیش] [ساعت] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':timeم', + 'meridiem' => ['قبل از ظهر', 'بعد از ظهر'], + 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], + 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], + 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], + 'weekdays_short' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], + 'weekdays_min' => ['ی', 'د', 'س', 'چ', 'پ', 'ج', 'ش'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'list' => ['، ', ' و '], + 'alt_numbers' => ['۰۰', '۰۱', '۰۲', '۰۳', '۰۴', '۰۵', '۰۶', '۰۷', '۰۸', '۰۹', '۱۰', '۱۱', '۱۲', '۱۳', '۱۴', '۱۵', '۱۶', '۱۷', '۱۸', '۱۹', '۲۰', '۲۱', '۲۲', '۲۳', '۲۴', '۲۵', '۲۶', '۲۷', '۲۸', '۲۹', '۳۰', '۳۱', '۳۲', '۳۳', '۳۴', '۳۵', '۳۶', '۳۷', '۳۸', '۳۹', '۴۰', '۴۱', '۴۲', '۴۳', '۴۴', '۴۵', '۴۶', '۴۷', '۴۸', '۴۹', '۵۰', '۵۱', '۵۲', '۵۳', '۵۴', '۵۵', '۵۶', '۵۷', '۵۸', '۵۹', '۶۰', '۶۱', '۶۲', '۶۳', '۶۴', '۶۵', '۶۶', '۶۷', '۶۸', '۶۹', '۷۰', '۷۱', '۷۲', '۷۳', '۷۴', '۷۵', '۷۶', '۷۷', '۷۸', '۷۹', '۸۰', '۸۱', '۸۲', '۸۳', '۸۴', '۸۵', '۸۶', '۸۷', '۸۸', '۸۹', '۹۰', '۹۱', '۹۲', '۹۳', '۹۴', '۹۵', '۹۶', '۹۷', '۹۸', '۹۹'], + 'months_short_standalone' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], + 'weekend' => [5, 5], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php new file mode 100644 index 00000000..69471004 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_AF.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fa.php', [ + 'meridiem' => ['ق', 'ب'], + 'weekend' => [4, 5], + 'formats' => [ + 'L' => 'OY/OM/OD', + 'LL' => 'OD MMM OY', + 'LLL' => 'OD MMMM OY،‏ H:mm', + 'LLLL' => 'dddd OD MMMM OY،‏ H:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php new file mode 100644 index 00000000..08d01825 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fa_IR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fa.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff.php new file mode 100644 index 00000000..9525c95a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'months' => ['siilo', 'colte', 'mbooy', 'seeɗto', 'duujal', 'korse', 'morso', 'juko', 'siilto', 'yarkomaa', 'jolal', 'bowte'], + 'months_short' => ['sii', 'col', 'mbo', 'see', 'duu', 'kor', 'mor', 'juk', 'slt', 'yar', 'jol', 'bow'], + 'weekdays' => ['dewo', 'aaɓnde', 'mawbaare', 'njeslaare', 'naasaande', 'mawnde', 'hoore-biir'], + 'weekdays_short' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], + 'weekdays_min' => ['dew', 'aaɓ', 'maw', 'nje', 'naa', 'mwd', 'hbi'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['subaka', 'kikiiɗe'], + + 'year' => ':count baret', // less reliable + 'y' => ':count baret', // less reliable + 'a_year' => ':count baret', // less reliable + + 'month' => ':count lewru', // less reliable + 'm' => ':count lewru', // less reliable + 'a_month' => ':count lewru', // less reliable + + 'week' => ':count naange', // less reliable + 'w' => ':count naange', // less reliable + 'a_week' => ':count naange', // less reliable + + 'day' => ':count dian', // less reliable + 'd' => ':count dian', // less reliable + 'a_day' => ':count dian', // less reliable + + 'hour' => ':count montor', // less reliable + 'h' => ':count montor', // less reliable + 'a_hour' => ':count montor', // less reliable + + 'minute' => ':count tokossuoum', // less reliable + 'min' => ':count tokossuoum', // less reliable + 'a_minute' => ':count tokossuoum', // less reliable + + 'second' => ':count tenen', // less reliable + 's' => ':count tenen', // less reliable + 'a_second' => ':count tenen', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php new file mode 100644 index 00000000..b797ac09 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_CM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ff.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php new file mode 100644 index 00000000..b797ac09 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_GN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ff.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php new file mode 100644 index 00000000..2f4c29f6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_MR.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ff.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php new file mode 100644 index 00000000..1e4c8b6c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ff_SN.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pular-Fulfulde.org Ibrahima Sarr admin@pulaar-fulfulde.org + */ +return require __DIR__.'/ff.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi.php new file mode 100644 index 00000000..edf2d6d3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Janne Warén + * - digitalfrost + * - Tsutomu Kuroda + * - Roope Salmi + * - tjku + * - Max Melentiev + * - Sami Haahtinen + * - Teemu Leisti + * - Artem Ignatyev + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Robert Bjarnason + * - Aaron Patterson + * - Nicolás Hock Isaza + * - Tom Hughes + * - Sven Fuchs + * - Petri Kivikangas + * - Nizar Jouini + * - Marko Seppae + * - Tomi Mynttinen (Pikseli) + * - Petteri (powergrip) + */ +return [ + 'year' => ':count vuosi|:count vuotta', + 'y' => ':count v', + 'month' => ':count kuukausi|:count kuukautta', + 'm' => ':count kk', + 'week' => ':count viikko|:count viikkoa', + 'w' => ':count vk', + 'day' => ':count päivä|:count päivää', + 'd' => ':count pv', + 'hour' => ':count tunti|:count tuntia', + 'h' => ':count t', + 'minute' => ':count minuutti|:count minuuttia', + 'min' => ':count min', + 'second' => ':count sekunti|:count sekuntia', + 'a_second' => 'muutama sekunti|:count sekuntia', + 's' => ':count s', + 'ago' => ':time sitten', + 'from_now' => ':time päästä', + 'year_from_now' => ':count vuoden', + 'month_from_now' => ':count kuukauden', + 'week_from_now' => ':count viikon', + 'day_from_now' => ':count päivän', + 'hour_from_now' => ':count tunnin', + 'minute_from_now' => ':count minuutin', + 'second_from_now' => ':count sekunnin', + 'after' => ':time sen jälkeen', + 'before' => ':time ennen', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' ja '], + 'diff_now' => 'nyt', + 'diff_yesterday' => 'eilen', + 'diff_tomorrow' => 'huomenna', + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm:ss', + 'L' => 'D.M.YYYY', + 'LL' => 'dddd D. MMMM[ta] YYYY', + 'll' => 'ddd D. MMM YYYY', + 'LLL' => 'D.MM. HH.mm', + 'LLLL' => 'D. MMMM[ta] YYYY HH.mm', + 'llll' => 'D. MMM YY HH.mm', + ], + 'weekdays' => ['sunnuntai', 'maanantai', 'tiistai', 'keskiviikko', 'torstai', 'perjantai', 'lauantai'], + 'weekdays_short' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], + 'weekdays_min' => ['su', 'ma', 'ti', 'ke', 'to', 'pe', 'la'], + 'months' => ['tammikuu', 'helmikuu', 'maaliskuu', 'huhtikuu', 'toukokuu', 'kesäkuu', 'heinäkuu', 'elokuu', 'syyskuu', 'lokakuu', 'marraskuu', 'joulukuu'], + 'months_short' => ['tammi', 'helmi', 'maalis', 'huhti', 'touko', 'kesä', 'heinä', 'elo', 'syys', 'loka', 'marras', 'joulu'], + 'meridiem' => ['aamupäivä', 'iltapäivä'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php new file mode 100644 index 00000000..920f1caa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fi_FI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fi.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil.php new file mode 100644 index 00000000..61114e3a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/fil_PH.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php new file mode 100644 index 00000000..60751dd5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fil_PH.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Rene Torres Rene Torres, Pablo Saratxaga rgtorre@rocketmail.com, pablo@mandrakesoft.com + * - Jaycee Mariano (alohajaycee) + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'MM/DD/YY', + ], + 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], + 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], + 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkoles', 'Huwebes', 'Biyernes', 'Sabado'], + 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], + 'weekdays_min' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['N.U.', 'N.H.'], + + 'before' => ':time bago', + 'after' => ':time pagkatapos', + + 'year' => ':count taon', + 'y' => ':count taon', + 'a_year' => ':count taon', + + 'month' => ':count buwan', + 'm' => ':count buwan', + 'a_month' => ':count buwan', + + 'week' => ':count linggo', + 'w' => ':count linggo', + 'a_week' => ':count linggo', + + 'day' => ':count araw', + 'd' => ':count araw', + 'a_day' => ':count araw', + + 'hour' => ':count oras', + 'h' => ':count oras', + 'a_hour' => ':count oras', + + 'minute' => ':count minuto', + 'min' => ':count minuto', + 'a_minute' => ':count minuto', + + 'second' => ':count segundo', + 's' => ':count segundo', + 'a_second' => ':count segundo', + + 'ago' => ':time ang nakalipas', + 'from_now' => 'sa :time', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo.php new file mode 100644 index 00000000..6a14a6fb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kristian Sakarisson + * - François B + * - JD Isaacks + * - Sverri Mohr Olsen + */ +return [ + 'year' => 'eitt ár|:count ár', + 'y' => ':count ár|:count ár', + 'month' => 'ein mánaði|:count mánaðir', + 'm' => ':count mánaður|:count mánaðir', + 'week' => ':count vika|:count vikur', + 'w' => ':count vika|:count vikur', + 'day' => 'ein dagur|:count dagar', + 'd' => ':count dag|:count dagar', + 'hour' => 'ein tími|:count tímar', + 'h' => ':count tími|:count tímar', + 'minute' => 'ein minutt|:count minuttir', + 'min' => ':count minutt|:count minuttir', + 'second' => 'fá sekund|:count sekundir', + 's' => ':count sekund|:count sekundir', + 'ago' => ':time síðani', + 'from_now' => 'um :time', + 'after' => ':time aftaná', + 'before' => ':time áðrenn', + 'diff_today' => 'Í', + 'diff_yesterday' => 'Í', + 'diff_yesterday_regexp' => 'Í(?:\\s+gjár)?(?:\\s+kl.)?', + 'diff_tomorrow' => 'Í', + 'diff_tomorrow_regexp' => 'Í(?:\\s+morgin)?(?:\\s+kl.)?', + 'diff_today_regexp' => 'Í(?:\\s+dag)?(?:\\s+kl.)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D. MMMM, YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Í dag kl.] LT', + 'nextDay' => '[Í morgin kl.] LT', + 'nextWeek' => 'dddd [kl.] LT', + 'lastDay' => '[Í gjár kl.] LT', + 'lastWeek' => '[síðstu] dddd [kl] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['januar', 'februar', 'mars', 'apríl', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['sunnudagur', 'mánadagur', 'týsdagur', 'mikudagur', 'hósdagur', 'fríggjadagur', 'leygardagur'], + 'weekdays_short' => ['sun', 'mán', 'týs', 'mik', 'hós', 'frí', 'ley'], + 'weekdays_min' => ['su', 'má', 'tý', 'mi', 'hó', 'fr', 'le'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' og '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php new file mode 100644 index 00000000..657f2c5b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_DK.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fo.php', [ + 'formats' => [ + 'L' => 'DD.MM.yy', + 'LL' => 'DD.MM.YYYY', + 'LLL' => 'D. MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY, HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php new file mode 100644 index 00000000..6d736167 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fo_FO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fo.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr.php new file mode 100644 index 00000000..da696e79 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Dieter Sting + * - François B + * - Maxime VALY + * - JD Isaacks + * - Dieter Sting + * - François B + * - JD Isaacks + * - Sebastian Thierer + * - Fastfuel + * - Pete Scopes (pdscopes) + */ +return [ + 'millennium' => ':count millénaire|:count millénaires', + 'a_millennium' => 'un millénaire|:count millénaires', + 'century' => ':count siècle|:count siècles', + 'a_century' => 'un siècle|:count siècles', + 'decade' => ':count décennie|:count décennies', + 'a_decade' => 'une décennie|:count décennies', + 'year' => ':count an|:count ans', + 'a_year' => 'un an|:count ans', + 'y' => ':count an|:count ans', + 'month' => ':count mois|:count mois', + 'a_month' => 'un mois|:count mois', + 'm' => ':count mois', + 'week' => ':count semaine|:count semaines', + 'a_week' => 'une semaine|:count semaines', + 'w' => ':count sem.', + 'day' => ':count jour|:count jours', + 'a_day' => 'un jour|:count jours', + 'd' => ':count j', + 'hour' => ':count heure|:count heures', + 'a_hour' => 'une heure|:count heures', + 'h' => ':count h', + 'minute' => ':count minute|:count minutes', + 'a_minute' => 'une minute|:count minutes', + 'min' => ':count min', + 'second' => ':count seconde|:count secondes', + 'a_second' => 'quelques secondes|:count secondes', + 's' => ':count s', + 'millisecond' => ':count milliseconde|:count millisecondes', + 'a_millisecond' => 'une milliseconde|:count millisecondes', + 'ms' => ':countms', + 'microsecond' => ':count microseconde|:count microsecondes', + 'a_microsecond' => 'une microseconde|:count microsecondes', + 'µs' => ':countµs', + 'ago' => 'il y a :time', + 'from_now' => 'dans :time', + 'after' => ':time après', + 'before' => ':time avant', + 'diff_now' => "à l'instant", + 'diff_today' => "aujourd'hui", + 'diff_today_regexp' => "aujourd'hui(?:\s+à)?", + 'diff_yesterday' => 'hier', + 'diff_yesterday_regexp' => 'hier(?:\s+à)?', + 'diff_tomorrow' => 'demain', + 'diff_tomorrow_regexp' => 'demain(?:\s+à)?', + 'diff_before_yesterday' => 'avant-hier', + 'diff_after_tomorrow' => 'après-demain', + 'period_recurrences' => ':count fois', + 'period_interval' => 'tous les :interval', + 'period_start_date' => 'de :date', + 'period_end_date' => 'à :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Aujourd’hui à] LT', + 'nextDay' => '[Demain à] LT', + 'nextWeek' => 'dddd [à] LT', + 'lastDay' => '[Hier à] LT', + 'lastWeek' => 'dddd [dernier à] LT', + 'sameElse' => 'L', + ], + 'months' => ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], + 'months_short' => ['janv.', 'févr.', 'mars', 'avr.', 'mai', 'juin', 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], + 'weekdays' => ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], + 'weekdays_short' => ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], + 'weekdays_min' => ['di', 'lu', 'ma', 'me', 'je', 've', 'sa'], + 'ordinal' => static function ($number, $period) { + return match ($period) { + // In French, only the first has to be ordinal, other number remains cardinal + // @link https://fr.wikihow.com/%C3%A9crire-la-date-en-fran%C3%A7ais + 'D' => $number.($number === 1 ? 'er' : ''), + default => $number.($number === 1 ? 'er' : 'e'), + 'w', 'W' => $number.($number === 1 ? 're' : 'e'), + }; + }, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' et '], + 'ordinal_words' => [ + 'of' => 'de', + 'first' => 'premier', + 'second' => 'deuxième', + 'third' => 'troisième', + 'fourth' => 'quatrième', + 'fifth' => 'cinquième', + 'last' => 'dernier', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php new file mode 100644 index 00000000..8ed03284 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BE.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BJ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_BL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php new file mode 100644 index 00000000..c9f6346f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CA.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Dieter Sting + * - François B + * - Maxime VALY + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CD.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php new file mode 100644 index 00000000..8674c27d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CH.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Dieter Sting + * - François B + * - Gaspard Bucher + * - Maxime VALY + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php new file mode 100644 index 00000000..67d37878 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_CM.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'meridiem' => ['mat.', 'soir'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php new file mode 100644 index 00000000..2f060869 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DJ.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'first_day_of_week' => 6, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php new file mode 100644 index 00000000..ae8db5fa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_DZ.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'first_day_of_week' => 6, + 'weekend' => [5, 6], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_FR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GP.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_GQ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_HT.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_KM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php new file mode 100644 index 00000000..6dda7722 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_LU.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php new file mode 100644 index 00000000..1bf034dc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MA.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'first_day_of_week' => 6, + 'weekend' => [5, 6], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_ML.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MQ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php new file mode 100644 index 00000000..37cf83f0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MR.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_MU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_NE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_PM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_RW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SC.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php new file mode 100644 index 00000000..ae8db5fa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_SY.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'first_day_of_week' => 6, + 'weekend' => [5, 6], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php new file mode 100644 index 00000000..37cf83f0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TD.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php new file mode 100644 index 00000000..6905e7a8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_TN.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'weekend' => [5, 6], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php new file mode 100644 index 00000000..37cf83f0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_VU.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fr.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_WF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php new file mode 100644 index 00000000..ec3ee359 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fr_YT.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/fr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur.php new file mode 100644 index 00000000..36c2564f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/fur_IT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php new file mode 100644 index 00000000..0147a596 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fur_IT.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pablo Saratxaga pablo@mandrakesoft.com + */ +return [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD. MM. YY', + 'LL' => 'DD di MMMM dal YYYY', + 'LLL' => 'DD di MMM HH:mm', + 'LLLL' => 'DD di MMMM dal YYYY HH:mm', + ], + 'months' => ['zenâr', 'fevrâr', 'març', 'avrîl', 'mai', 'jugn', 'lui', 'avost', 'setembar', 'otubar', 'novembar', 'dicembar'], + 'months_short' => ['zen', 'fev', 'mar', 'avr', 'mai', 'jug', 'lui', 'avo', 'set', 'otu', 'nov', 'dic'], + 'weekdays' => ['domenie', 'lunis', 'martars', 'miercus', 'joibe', 'vinars', 'sabide'], + 'weekdays_short' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], + 'weekdays_min' => ['dom', 'lun', 'mar', 'mie', 'joi', 'vin', 'sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'year' => ':count an', + 'month' => ':count mês', + 'week' => ':count setemane', + 'day' => ':count zornade', + 'hour' => ':count ore', + 'minute' => ':count minût', + 'second' => ':count secont', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy.php new file mode 100644 index 00000000..42ecaed1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Tim Fish + * - JD Isaacks + */ +return [ + 'year' => ':count jier|:count jierren', + 'a_year' => 'ien jier|:count jierren', + 'y' => ':count j', + 'month' => ':count moanne|:count moannen', + 'a_month' => 'ien moanne|:count moannen', + 'm' => ':count moa.', + 'week' => ':count wike|:count wiken', + 'a_week' => 'in wike|:count wiken', + 'a' => ':count w.', + 'day' => ':count dei|:count dagen', + 'a_day' => 'ien dei|:count dagen', + 'd' => ':count d.', + 'hour' => ':count oere|:count oeren', + 'a_hour' => 'ien oere|:count oeren', + 'h' => ':count o.', + 'minute' => ':count minút|:count minuten', + 'a_minute' => 'ien minút|:count minuten', + 'min' => ':count min.', + 'second' => ':count sekonde|:count sekonden', + 'a_second' => 'in pear sekonden|:count sekonden', + 's' => ':count s.', + 'ago' => ':time lyn', + 'from_now' => 'oer :time', + 'diff_yesterday' => 'juster', + 'diff_yesterday_regexp' => 'juster(?:\\s+om)?', + 'diff_today' => 'hjoed', + 'diff_today_regexp' => 'hjoed(?:\\s+om)?', + 'diff_tomorrow' => 'moarn', + 'diff_tomorrow_regexp' => 'moarn(?:\\s+om)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD-MM-YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[hjoed om] LT', + 'nextDay' => '[moarn om] LT', + 'nextWeek' => 'dddd [om] LT', + 'lastDay' => '[juster om] LT', + 'lastWeek' => '[ôfrûne] dddd [om] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); + }, + 'months' => ['jannewaris', 'febrewaris', 'maart', 'april', 'maaie', 'juny', 'july', 'augustus', 'septimber', 'oktober', 'novimber', 'desimber'], + 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], + 'mmm_suffix' => '.', + 'weekdays' => ['snein', 'moandei', 'tiisdei', 'woansdei', 'tongersdei', 'freed', 'sneon'], + 'weekdays_short' => ['si.', 'mo.', 'ti.', 'wo.', 'to.', 'fr.', 'so.'], + 'weekdays_min' => ['Si', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'So'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' en '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php new file mode 100644 index 00000000..8559d5c2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_DE.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], + 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], + 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], + 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], + 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php new file mode 100644 index 00000000..01cc96c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/fy_NL.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/fy.php', [ + 'formats' => [ + 'L' => 'DD-MM-YY', + ], + 'months' => ['Jannewaris', 'Febrewaris', 'Maart', 'April', 'Maaie', 'Juny', 'July', 'Augustus', 'Septimber', 'Oktober', 'Novimber', 'Desimber'], + 'months_short' => ['Jan', 'Feb', 'Mrt', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Snein', 'Moandei', 'Tiisdei', 'Woansdei', 'Tongersdei', 'Freed', 'Sneon'], + 'weekdays_short' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], + 'weekdays_min' => ['Sn', 'Mo', 'Ti', 'Wo', 'To', 'Fr', 'Sn'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga.php new file mode 100644 index 00000000..013367bd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Thanks to André Silva : https://github.com/askpt + */ + +return [ + 'year' => ':count bliain', + 'a_year' => '{1}bliain|:count bliain', + 'y' => ':countb', + 'month' => ':count mí', + 'a_month' => '{1}mí|:count mí', + 'm' => ':countm', + 'week' => ':count sheachtain', + 'a_week' => '{1}sheachtain|:count sheachtain', + 'w' => ':countsh', + 'day' => ':count lá', + 'a_day' => '{1}lá|:count lá', + 'd' => ':countl', + 'hour' => ':count uair an chloig', + 'a_hour' => '{1}uair an chloig|:count uair an chloig', + 'h' => ':countu', + 'minute' => ':count nóiméad', + 'a_minute' => '{1}nóiméad|:count nóiméad', + 'min' => ':countn', + 'second' => ':count soicind', + 'a_second' => '{1}cúpla soicind|:count soicind', + 's' => ':countso', + 'ago' => ':time ó shin', + 'from_now' => 'i :time', + 'after' => ':time tar éis', + 'before' => ':time roimh', + 'diff_now' => 'anois', + 'diff_today' => 'Inniu', + 'diff_today_regexp' => 'Inniu(?:\\s+ag)?', + 'diff_yesterday' => 'inné', + 'diff_yesterday_regexp' => 'Inné(?:\\s+aig)?', + 'diff_tomorrow' => 'amárach', + 'diff_tomorrow_regexp' => 'Amárach(?:\\s+ag)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Inniu ag] LT', + 'nextDay' => '[Amárach ag] LT', + 'nextWeek' => 'dddd [ag] LT', + 'lastDay' => '[Inné aig] LT', + 'lastWeek' => 'dddd [seo caite] [ag] LT', + 'sameElse' => 'L', + ], + 'months' => ['Eanáir', 'Feabhra', 'Márta', 'Aibreán', 'Bealtaine', 'Méitheamh', 'Iúil', 'Lúnasa', 'Meán Fómhair', 'Deaireadh Fómhair', 'Samhain', 'Nollaig'], + 'months_short' => ['Eaná', 'Feab', 'Márt', 'Aibr', 'Beal', 'Méit', 'Iúil', 'Lúna', 'Meán', 'Deai', 'Samh', 'Noll'], + 'weekdays' => ['Dé Domhnaigh', 'Dé Luain', 'Dé Máirt', 'Dé Céadaoin', 'Déardaoin', 'Dé hAoine', 'Dé Satharn'], + 'weekdays_short' => ['Dom', 'Lua', 'Mái', 'Céa', 'Déa', 'hAo', 'Sat'], + 'weekdays_min' => ['Do', 'Lu', 'Má', 'Ce', 'Dé', 'hA', 'Sa'], + 'ordinal' => static fn ($number) => $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')), + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' agus '], + 'meridiem' => ['r.n.', 'i.n.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php new file mode 100644 index 00000000..57b0c4fb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ga_IE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ga.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd.php new file mode 100644 index 00000000..05437bff --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Jon Ashdown + */ +return [ + 'year' => ':count bliadhna', + 'a_year' => '{1}bliadhna|:count bliadhna', + 'y' => ':count b.', + 'month' => ':count mìosan', + 'a_month' => '{1}mìos|:count mìosan', + 'm' => ':count ms.', + 'week' => ':count seachdainean', + 'a_week' => '{1}seachdain|:count seachdainean', + 'w' => ':count s.', + 'day' => ':count latha', + 'a_day' => '{1}latha|:count latha', + 'd' => ':count l.', + 'hour' => ':count uairean', + 'a_hour' => '{1}uair|:count uairean', + 'h' => ':count u.', + 'minute' => ':count mionaidean', + 'a_minute' => '{1}mionaid|:count mionaidean', + 'min' => ':count md.', + 'second' => ':count diogan', + 'a_second' => '{1}beagan diogan|:count diogan', + 's' => ':count d.', + 'ago' => 'bho chionn :time', + 'from_now' => 'ann an :time', + 'diff_yesterday' => 'An-dè', + 'diff_yesterday_regexp' => 'An-dè(?:\\s+aig)?', + 'diff_today' => 'An-diugh', + 'diff_today_regexp' => 'An-diugh(?:\\s+aig)?', + 'diff_tomorrow' => 'A-màireach', + 'diff_tomorrow_regexp' => 'A-màireach(?:\\s+aig)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[An-diugh aig] LT', + 'nextDay' => '[A-màireach aig] LT', + 'nextWeek' => 'dddd [aig] LT', + 'lastDay' => '[An-dè aig] LT', + 'lastWeek' => 'dddd [seo chaidh] [aig] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + return $number.($number === 1 ? 'd' : ($number % 10 === 2 ? 'na' : 'mh')); + }, + 'months' => ['Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd'], + 'months_short' => ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh'], + 'weekdays' => ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne'], + 'weekdays_short' => ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'], + 'weekdays_min' => ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' agus '], + 'meridiem' => ['m', 'f'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php new file mode 100644 index 00000000..4fc26b3d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gd_GB.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/gd.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez.php new file mode 100644 index 00000000..b8a2f0eb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/gez_ER.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php new file mode 100644 index 00000000..f19d1df1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ER.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባት', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], + 'months_short' => ['ጠሐረ', 'ከተተ', 'መገበ', 'አኀዘ', 'ግንባ', 'ሠንየ', 'ሐመለ', 'ነሐሰ', 'ከረመ', 'ጠቀመ', 'ኀደረ', 'ኀሠሠ'], + 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], + 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], + 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ጽባሕ', 'ምሴት'], + + 'month' => ':count ወርሕ', // less reliable + 'm' => ':count ወርሕ', // less reliable + 'a_month' => ':count ወርሕ', // less reliable + + 'week' => ':count ሰብዑ', // less reliable + 'w' => ':count ሰብዑ', // less reliable + 'a_week' => ':count ሰብዑ', // less reliable + + 'hour' => ':count አንትሙ', // less reliable + 'h' => ':count አንትሙ', // less reliable + 'a_hour' => ':count አንትሙ', // less reliable + + 'minute' => ':count ንኡስ', // less reliable + 'min' => ':count ንኡስ', // less reliable + 'a_minute' => ':count ንኡስ', // less reliable + + 'year' => ':count ዓመት', + 'y' => ':count ዓመት', + 'a_year' => ':count ዓመት', + + 'day' => ':count ዕለት', + 'd' => ':count ዕለት', + 'a_day' => ':count ዕለት', + + 'second' => ':count ካልእ', + 's' => ':count ካልእ', + 'a_second' => ':count ካልእ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php new file mode 100644 index 00000000..85795498 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gez_ET.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], + 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], + 'weekdays' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚት'], + 'weekdays_short' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], + 'weekdays_min' => ['እኁድ', 'ሰኑይ', 'ሠሉስ', 'ራብዕ', 'ሐሙስ', 'ዓርበ', 'ቀዳሚ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ጽባሕ', 'ምሴት'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl.php new file mode 100644 index 00000000..96bf1456 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Fidel Pita + * - JD Isaacks + * - Diego Vilariño + * - Sebastian Thierer + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count ano|:count anos', + 'a_year' => 'un ano|:count anos', + 'y' => ':count a.', + 'month' => ':count mes|:count meses', + 'a_month' => 'un mes|:count meses', + 'm' => ':count mes.', + 'week' => ':count semana|:count semanas', + 'a_week' => 'unha semana|:count semanas', + 'w' => ':count sem.', + 'day' => ':count día|:count días', + 'a_day' => 'un día|:count días', + 'd' => ':count d.', + 'hour' => ':count hora|:count horas', + 'a_hour' => 'unha hora|:count horas', + 'h' => ':count h.', + 'minute' => ':count minuto|:count minutos', + 'a_minute' => 'un minuto|:count minutos', + 'min' => ':count min.', + 'second' => ':count segundo|:count segundos', + 'a_second' => 'uns segundos|:count segundos', + 's' => ':count seg.', + 'ago' => 'hai :time', + 'from_now' => static function ($time) { + if (str_starts_with($time, 'un')) { + return "n$time"; + } + + return "en $time"; + }, + 'diff_now' => 'agora', + 'diff_today' => 'hoxe', + 'diff_today_regexp' => 'hoxe(?:\\s+ás)?', + 'diff_yesterday' => 'onte', + 'diff_yesterday_regexp' => 'onte(?:\\s+á)?', + 'diff_tomorrow' => 'mañá', + 'diff_tomorrow_regexp' => 'mañá(?:\\s+ás)?', + 'after' => ':time despois', + 'before' => ':time antes', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D [de] MMMM [de] YYYY', + 'LLL' => 'D [de] MMMM [de] YYYY H:mm', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => static function (CarbonInterface $current) { + return '[hoxe '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; + }, + 'nextDay' => static function (CarbonInterface $current) { + return '[mañá '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; + }, + 'nextWeek' => static function (CarbonInterface $current) { + return 'dddd ['.($current->hour !== 1 ? 'ás' : 'á').'] LT'; + }, + 'lastDay' => static function (CarbonInterface $current) { + return '[onte '.($current->hour !== 1 ? 'á' : 'a').'] LT'; + }, + 'lastWeek' => static function (CarbonInterface $current) { + return '[o] dddd [pasado '.($current->hour !== 1 ? 'ás' : 'á').'] LT'; + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['xaneiro', 'febreiro', 'marzo', 'abril', 'maio', 'xuño', 'xullo', 'agosto', 'setembro', 'outubro', 'novembro', 'decembro'], + 'months_short' => ['xan.', 'feb.', 'mar.', 'abr.', 'mai.', 'xuñ.', 'xul.', 'ago.', 'set.', 'out.', 'nov.', 'dec.'], + 'weekdays' => ['domingo', 'luns', 'martes', 'mércores', 'xoves', 'venres', 'sábado'], + 'weekdays_short' => ['dom.', 'lun.', 'mar.', 'mér.', 'xov.', 'ven.', 'sáb.'], + 'weekdays_min' => ['do', 'lu', 'ma', 'mé', 'xo', 've', 'sá'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' e '], + 'meridiem' => ['a.m.', 'p.m.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php new file mode 100644 index 00000000..9d6c1d96 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gl_ES.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/gl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom.php new file mode 100644 index 00000000..2a0584f8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/gom_Latn.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php new file mode 100644 index 00000000..ef50d96e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gom_Latn.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'year' => ':count voros|:count vorsam', + 'y' => ':countv', + 'month' => ':count mhoino|:count mhoine', + 'm' => ':countmh', + 'week' => ':count satolleacho|:count satolleache', + 'w' => ':countsa|:countsa', + 'day' => ':count dis', + 'd' => ':countd', + 'hour' => ':count hor|:count horam', + 'h' => ':counth', + 'minute' => ':count minute|:count mintam', + 'min' => ':countm', + 'second' => ':count second', + 's' => ':counts', + + 'diff_today' => 'Aiz', + 'diff_yesterday' => 'Kal', + 'diff_tomorrow' => 'Faleam', + 'formats' => [ + 'LT' => 'A h:mm [vazta]', + 'LTS' => 'A h:mm:ss [vazta]', + 'L' => 'DD-MM-YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY A h:mm [vazta]', + 'LLLL' => 'dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]', + 'llll' => 'ddd, D MMM YYYY, A h:mm [vazta]', + ], + + 'calendar' => [ + 'sameDay' => '[Aiz] LT', + 'nextDay' => '[Faleam] LT', + 'nextWeek' => '[Ieta to] dddd[,] LT', + 'lastDay' => '[Kal] LT', + 'lastWeek' => '[Fatlo] dddd[,] LT', + 'sameElse' => 'L', + ], + + 'months' => ['Janer', 'Febrer', 'Mars', 'Abril', 'Mai', 'Jun', 'Julai', 'Agost', 'Setembr', 'Otubr', 'Novembr', 'Dezembr'], + 'months_short' => ['Jan.', 'Feb.', 'Mars', 'Abr.', 'Mai', 'Jun', 'Jul.', 'Ago.', 'Set.', 'Otu.', 'Nov.', 'Dez.'], + 'weekdays' => ['Aitar', 'Somar', 'Mongllar', 'Budvar', 'Brestar', 'Sukrar', 'Son\'var'], + 'weekdays_short' => ['Ait.', 'Som.', 'Mon.', 'Bud.', 'Bre.', 'Suk.', 'Son.'], + 'weekdays_min' => ['Ai', 'Sm', 'Mo', 'Bu', 'Br', 'Su', 'Sn'], + + 'ordinal' => static fn ($number, $period) => $number.($period === 'D' ? 'er' : ''), + + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'rati'; + } + if ($hour < 12) { + return 'sokalli'; + } + if ($hour < 16) { + return 'donparam'; + } + if ($hour < 20) { + return 'sanje'; + } + + return 'rati'; + }, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' ani '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php new file mode 100644 index 00000000..c5c850ed --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Christopher Dell + * - Akira Matsuda + * - Enrique Vidal + * - Simone Carletti + * - Henning Kiel + * - Aaron Patterson + * - Florian Hanke + */ +return [ + 'year' => ':count Johr', + 'month' => ':count Monet', + 'week' => ':count Woche', + 'day' => ':count Tag', + 'hour' => ':count Schtund', + 'minute' => ':count Minute', + 'second' => ':count Sekunde', + 'weekdays' => ['Sunntig', 'Mäntig', 'Ziischtig', 'Mittwuch', 'Dunschtig', 'Friitig', 'Samschtig'], + 'weekdays_short' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], + 'weekdays_min' => ['Su', 'Mä', 'Zi', 'Mi', 'Du', 'Fr', 'Sa'], + 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'September', 'Oktober', 'November', 'Dezember'], + 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + 'meridiem' => ['am Vormittag', 'am Namittag'], + 'ordinal' => ':number.', + 'list' => [', ', ' und '], + 'diff_now' => 'now', + 'diff_yesterday' => 'geschter', + 'diff_tomorrow' => 'moorn', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'Do MMMM YYYY', + 'LLL' => 'Do MMMM, HH:mm [Uhr]', + 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php new file mode 100644 index 00000000..594eb25d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_CH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/gsw.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php new file mode 100644 index 00000000..3581dcfb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_FR.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/gsw.php', [ + 'meridiem' => ['vorm.', 'nam.'], + 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LLL' => 'Do MMMM YYYY HH:mm', + 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php new file mode 100644 index 00000000..3581dcfb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gsw_LI.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/gsw.php', [ + 'meridiem' => ['vorm.', 'nam.'], + 'months' => ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'Auguscht', 'Septämber', 'Oktoober', 'Novämber', 'Dezämber'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LLL' => 'Do MMMM YYYY HH:mm', + 'LLLL' => 'dddd, Do MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu.php new file mode 100644 index 00000000..16455ede --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Kaushik Thanki + * - Josh Soref + */ +return [ + 'year' => 'એક વર્ષ|:count વર્ષ', + 'y' => ':countવર્ષ|:countવર્ષો', + 'month' => 'એક મહિનો|:count મહિના', + 'm' => ':countમહિનો|:countમહિના', + 'week' => ':count અઠવાડિયું|:count અઠવાડિયા', + 'w' => ':countઅઠ.|:countઅઠ.', + 'day' => 'એક દિવસ|:count દિવસ', + 'd' => ':countદિ.|:countદિ.', + 'hour' => 'એક કલાક|:count કલાક', + 'h' => ':countક.|:countક.', + 'minute' => 'એક મિનિટ|:count મિનિટ', + 'min' => ':countમિ.|:countમિ.', + 'second' => 'અમુક પળો|:count સેકંડ', + 's' => ':countસે.|:countસે.', + 'ago' => ':time પેહલા', + 'from_now' => ':time મા', + 'after' => ':time પછી', + 'before' => ':time પહેલા', + 'diff_now' => 'હમણાં', + 'diff_today' => 'આજ', + 'diff_yesterday' => 'ગઇકાલે', + 'diff_tomorrow' => 'કાલે', + 'formats' => [ + 'LT' => 'A h:mm વાગ્યે', + 'LTS' => 'A h:mm:ss વાગ્યે', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm વાગ્યે', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm વાગ્યે', + ], + 'calendar' => [ + 'sameDay' => '[આજ] LT', + 'nextDay' => '[કાલે] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[ગઇકાલે] LT', + 'lastWeek' => '[પાછલા] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'રાત'; + } + if ($hour < 10) { + return 'સવાર'; + } + if ($hour < 17) { + return 'બપોર'; + } + if ($hour < 20) { + return 'સાંજ'; + } + + return 'રાત'; + }, + 'months' => ['જાન્યુઆરી', 'ફેબ્રુઆરી', 'માર્ચ', 'એપ્રિલ', 'મે', 'જૂન', 'જુલાઈ', 'ઑગસ્ટ', 'સપ્ટેમ્બર', 'ઑક્ટ્બર', 'નવેમ્બર', 'ડિસેમ્બર'], + 'months_short' => ['જાન્યુ.', 'ફેબ્રુ.', 'માર્ચ', 'એપ્રિ.', 'મે', 'જૂન', 'જુલા.', 'ઑગ.', 'સપ્ટે.', 'ઑક્ટ્.', 'નવે.', 'ડિસે.'], + 'weekdays' => ['રવિવાર', 'સોમવાર', 'મંગળવાર', 'બુધ્વાર', 'ગુરુવાર', 'શુક્રવાર', 'શનિવાર'], + 'weekdays_short' => ['રવિ', 'સોમ', 'મંગળ', 'બુધ્', 'ગુરુ', 'શુક્ર', 'શનિ'], + 'weekdays_min' => ['ર', 'સો', 'મં', 'બુ', 'ગુ', 'શુ', 'શ'], + 'list' => [', ', ' અને '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php new file mode 100644 index 00000000..02654b1f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gu_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/gu.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/guz.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/guz.php new file mode 100644 index 00000000..d39e9ca3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/guz.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Ma', 'Mo'], + 'weekdays' => ['Chumapiri', 'Chumatato', 'Chumaine', 'Chumatano', 'Aramisi', 'Ichuma', 'Esabato'], + 'weekdays_short' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], + 'weekdays_min' => ['Cpr', 'Ctt', 'Cmn', 'Cmt', 'Ars', 'Icm', 'Est'], + 'months' => ['Chanuari', 'Feburari', 'Machi', 'Apiriri', 'Mei', 'Juni', 'Chulai', 'Agosti', 'Septemba', 'Okitoba', 'Nobemba', 'Disemba'], + 'months_short' => ['Can', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Cul', 'Agt', 'Sep', 'Okt', 'Nob', 'Dis'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'month' => ':count omotunyi', // less reliable + 'm' => ':count omotunyi', // less reliable + 'a_month' => ':count omotunyi', // less reliable + + 'week' => ':count isano naibere', // less reliable + 'w' => ':count isano naibere', // less reliable + 'a_week' => ':count isano naibere', // less reliable + + 'second' => ':count ibere', // less reliable + 's' => ':count ibere', // less reliable + 'a_second' => ':count ibere', // less reliable + + 'year' => ':count omwaka', + 'y' => ':count omwaka', + 'a_year' => ':count omwaka', + + 'day' => ':count rituko', + 'd' => ':count rituko', + 'a_day' => ':count rituko', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv.php new file mode 100644 index 00000000..7c52b940 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/gv_GB.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php new file mode 100644 index 00000000..6b1168f9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/gv_GB.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Alastair McKinstry bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Jerrey-geuree', 'Toshiaght-arree', 'Mayrnt', 'Averil', 'Boaldyn', 'Mean-souree', 'Jerrey-souree', 'Luanistyn', 'Mean-fouyir', 'Jerrey-fouyir', 'Mee Houney', 'Mee ny Nollick'], + 'months_short' => ['J-guer', 'T-arree', 'Mayrnt', 'Avrril', 'Boaldyn', 'M-souree', 'J-souree', 'Luanistyn', 'M-fouyir', 'J-fouyir', 'M.Houney', 'M.Nollick'], + 'weekdays' => ['Jedoonee', 'Jelhein', 'Jemayrt', 'Jercean', 'Jerdein', 'Jeheiney', 'Jesarn'], + 'weekdays_short' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], + 'weekdays_min' => ['Jed', 'Jel', 'Jem', 'Jerc', 'Jerd', 'Jeh', 'Jes'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count blein', + 'y' => ':count blein', + 'a_year' => ':count blein', + + 'month' => ':count mee', + 'm' => ':count mee', + 'a_month' => ':count mee', + + 'week' => ':count shiaghtin', + 'w' => ':count shiaghtin', + 'a_week' => ':count shiaghtin', + + 'day' => ':count laa', + 'd' => ':count laa', + 'a_day' => ':count laa', + + 'hour' => ':count oor', + 'h' => ':count oor', + 'a_hour' => ':count oor', + + 'minute' => ':count feer veg', + 'min' => ':count feer veg', + 'a_minute' => ':count feer veg', + + 'second' => ':count derrey', + 's' => ':count derrey', + 'a_second' => ':count derrey', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha.php new file mode 100644 index 00000000..cd8e34d0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM, YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', + ], + 'months' => ['Janairu', 'Faburairu', 'Maris', 'Afirilu', 'Mayu', 'Yuni', 'Yuli', 'Agusta', 'Satumba', 'Oktoba', 'Nuwamba', 'Disamba'], + 'months_short' => ['Jan', 'Fab', 'Mar', 'Afi', 'May', 'Yun', 'Yul', 'Agu', 'Sat', 'Okt', 'Nuw', 'Dis'], + 'weekdays' => ['Lahadi', 'Litini', 'Talata', 'Laraba', 'Alhamis', 'Jumaʼa', 'Asabar'], + 'weekdays_short' => ['Lah', 'Lit', 'Tal', 'Lar', 'Alh', 'Jum', 'Asa'], + 'weekdays_min' => ['Lh', 'Li', 'Ta', 'Lr', 'Al', 'Ju', 'As'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => 'shekara :count', + 'y' => 'shekara :count', + 'a_year' => 'shekara :count', + + 'month' => ':count wátàa', + 'm' => ':count wátàa', + 'a_month' => ':count wátàa', + + 'week' => ':count mako', + 'w' => ':count mako', + 'a_week' => ':count mako', + + 'day' => ':count rana', + 'd' => ':count rana', + 'a_day' => ':count rana', + + 'hour' => ':count áwàa', + 'h' => ':count áwàa', + 'a_hour' => ':count áwàa', + + 'minute' => 'minti :count', + 'min' => 'minti :count', + 'a_minute' => 'minti :count', + + 'second' => ':count ná bíyú', + 's' => ':count ná bíyú', + 'a_second' => ':count ná bíyú', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php new file mode 100644 index 00000000..f9f99a73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_GH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ha.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php new file mode 100644 index 00000000..f9f99a73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ha.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php new file mode 100644 index 00000000..f9f99a73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ha_NG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ha.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak.php new file mode 100644 index 00000000..6c3260e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/hak_TW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php new file mode 100644 index 00000000..2a3bc961 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hak_TW.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY年MM月DD日', + ], + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], + 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['上晝', '下晝'], + + 'year' => ':count ngien11', + 'y' => ':count ngien11', + 'a_year' => ':count ngien11', + + 'month' => ':count ngie̍t', + 'm' => ':count ngie̍t', + 'a_month' => ':count ngie̍t', + + 'week' => ':count lî-pai', + 'w' => ':count lî-pai', + 'a_week' => ':count lî-pai', + + 'day' => ':count ngit', + 'd' => ':count ngit', + 'a_day' => ':count ngit', + + 'hour' => ':count sṳ̀', + 'h' => ':count sṳ̀', + 'a_hour' => ':count sṳ̀', + + 'minute' => ':count fûn', + 'min' => ':count fûn', + 'a_minute' => ':count fûn', + + 'second' => ':count miéu', + 's' => ':count miéu', + 'a_second' => ':count miéu', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/haw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/haw.php new file mode 100644 index 00000000..e46993a3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/haw.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'months' => ['Ianuali', 'Pepeluali', 'Malaki', 'ʻApelila', 'Mei', 'Iune', 'Iulai', 'ʻAukake', 'Kepakemapa', 'ʻOkakopa', 'Nowemapa', 'Kekemapa'], + 'months_short' => ['Ian.', 'Pep.', 'Mal.', 'ʻAp.', 'Mei', 'Iun.', 'Iul.', 'ʻAu.', 'Kep.', 'ʻOk.', 'Now.', 'Kek.'], + 'weekdays' => ['Lāpule', 'Poʻakahi', 'Poʻalua', 'Poʻakolu', 'Poʻahā', 'Poʻalima', 'Poʻaono'], + 'weekdays_short' => ['LP', 'P1', 'P2', 'P3', 'P4', 'P5', 'P6'], + 'weekdays_min' => ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY h:mm a', + ], + + 'year' => ':count makahiki', + 'y' => ':count makahiki', + 'a_year' => ':count makahiki', + + 'month' => ':count mahina', + 'm' => ':count mahina', + 'a_month' => ':count mahina', + + 'week' => ':count pule', + 'w' => ':count pule', + 'a_week' => ':count pule', + + 'day' => ':count lā', + 'd' => ':count lā', + 'a_day' => ':count lā', + + 'hour' => ':count hola', + 'h' => ':count hola', + 'a_hour' => ':count hola', + + 'minute' => ':count minuke', + 'min' => ':count minuke', + 'a_minute' => ':count minuke', + + 'second' => ':count lua', + 's' => ':count lua', + 'a_second' => ':count lua', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he.php new file mode 100644 index 00000000..6d8f01ee --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Daniel Cohen Gindi + * - JD Isaacks + * - Itai Nathaniel + * - GabMic + * - Yaakov Dahan (yakidahan) + */ +return [ + 'year' => 'שנה|{2}שנתיים|:count שנים', + 'y' => 'שנה|:count שנ׳', + 'month' => 'חודש|{2}חודשיים|:count חודשים', + 'm' => 'חודש|:count חו׳', + 'week' => 'שבוע|{2}שבועיים|:count שבועות', + 'w' => 'שבוע|:count שב׳', + 'day' => 'יום|{2}יומיים|:count ימים', + 'd' => 'יום|:count ימ׳', + 'hour' => 'שעה|{2}שעתיים|:count שעות', + 'h' => 'שעה|:count שע׳', + 'minute' => 'דקה|{2}שתי דקות|:count דקות', + 'min' => 'דקה|:count דק׳', + 'second' => 'שנייה|:count שניות', + 'a_second' => 'כמה שניות|:count שניות', + 's' => 'שניה|:count שנ׳', + 'ago' => 'לפני :time', + 'from_now' => 'בעוד :time מעכשיו', + 'after' => 'אחרי :time', + 'before' => 'לפני :time', + 'diff_now' => 'עכשיו', + 'diff_today' => 'היום', + 'diff_today_regexp' => 'היום(?:\\s+ב־)?', + 'diff_yesterday' => 'אתמול', + 'diff_yesterday_regexp' => 'אתמול(?:\\s+ב־)?', + 'diff_tomorrow' => 'מחר', + 'diff_tomorrow_regexp' => 'מחר(?:\\s+ב־)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D [ב]MMMM YYYY', + 'LLL' => 'D [ב]MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D [ב]MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[היום ב־]LT', + 'nextDay' => '[מחר ב־]LT', + 'nextWeek' => 'dddd [בשעה] LT', + 'lastDay' => '[אתמול ב־]LT', + 'lastWeek' => '[ביום] dddd [האחרון בשעה] LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour, $minute, $isLower) { + if ($hour < 5) { + return 'לפנות בוקר'; + } + if ($hour < 10) { + return 'בבוקר'; + } + if ($hour < 12) { + return $isLower ? 'לפנה"צ' : 'לפני הצהריים'; + } + if ($hour < 18) { + return $isLower ? 'אחה"צ' : 'אחרי הצהריים'; + } + + return 'בערב'; + }, + 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], + 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], + 'weekdays' => ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], + 'weekdays_short' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], + 'weekdays_min' => ['א', 'ב', 'ג', 'ד', 'ה', 'ו', 'ש'], + 'list' => [', ', ' ו -'], + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php new file mode 100644 index 00000000..14fab3e9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/he_IL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/he.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi.php new file mode 100644 index 00000000..1fc18010 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - abhimanyu003 + * - Josh Soref + * - JD Isaacks + */ +return [ + 'year' => 'एक वर्ष|:count वर्ष', + 'y' => '1 वर्ष|:count वर्षों', + 'month' => 'एक महीने|:count महीने', + 'm' => '1 माह|:count महीने', + 'week' => '1 सप्ताह|:count सप्ताह', + 'w' => '1 सप्ताह|:count सप्ताह', + 'day' => 'एक दिन|:count दिन', + 'd' => '1 दिन|:count दिनों', + 'hour' => 'एक घंटा|:count घंटे', + 'h' => '1 घंटा|:count घंटे', + 'minute' => 'एक मिनट|:count मिनट', + 'min' => '1 मिनट|:count मिनटों', + 'second' => 'कुछ ही क्षण|:count सेकंड', + 's' => '1 सेकंड|:count सेकंड', + 'ago' => ':time पहले', + 'from_now' => ':time में', + 'after' => ':time के बाद', + 'before' => ':time के पहले', + 'diff_now' => 'अब', + 'diff_today' => 'आज', + 'diff_yesterday' => 'कल', + 'diff_tomorrow' => 'कल', + 'formats' => [ + 'LT' => 'A h:mm बजे', + 'LTS' => 'A h:mm:ss बजे', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm बजे', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm बजे', + ], + 'calendar' => [ + 'sameDay' => '[आज] LT', + 'nextDay' => '[कल] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[कल] LT', + 'lastWeek' => '[पिछले] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'रात'; + } + if ($hour < 10) { + return 'सुबह'; + } + if ($hour < 17) { + return 'दोपहर'; + } + if ($hour < 20) { + return 'शाम'; + } + + return 'रात'; + }, + 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जन.', 'फ़र.', 'मार्च', 'अप्रै.', 'मई', 'जून', 'जुल.', 'अग.', 'सित.', 'अक्टू.', 'नव.', 'दिस.'], + 'weekdays' => ['रविवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'गुरू', 'शुक्र', 'शनि'], + 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], + 'list' => [', ', ' और '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php new file mode 100644 index 00000000..749dd97c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hi_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/hi.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif.php new file mode 100644 index 00000000..65791dd4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/hif_FJ.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php new file mode 100644 index 00000000..54e880e3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hif_FJ.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'dddd DD MMM YYYY', + ], + 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + 'weekdays' => ['Ravivar', 'Somvar', 'Mangalvar', 'Budhvar', 'Guruvar', 'Shukravar', 'Shanivar'], + 'weekdays_short' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], + 'weekdays_min' => ['Ravi', 'Som', 'Mangal', 'Budh', 'Guru', 'Shukra', 'Shani'], + 'meridiem' => ['Purvahan', 'Aparaahna'], + + 'hour' => ':count minit', // less reliable + 'h' => ':count minit', // less reliable + 'a_hour' => ':count minit', // less reliable + + 'year' => ':count saal', + 'y' => ':count saal', + 'a_year' => ':count saal', + + 'month' => ':count Mahina', + 'm' => ':count Mahina', + 'a_month' => ':count Mahina', + + 'week' => ':count Hafta', + 'w' => ':count Hafta', + 'a_week' => ':count Hafta', + + 'day' => ':count Din', + 'd' => ':count Din', + 'a_day' => ':count Din', + + 'minute' => ':count Minit', + 'min' => ':count Minit', + 'a_minute' => ':count Minit', + + 'second' => ':count Second', + 's' => ':count Second', + 'a_second' => ':count Second', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne.php new file mode 100644 index 00000000..4bcb05c7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/hne_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php new file mode 100644 index 00000000..27b3b396 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hne_IN.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अपरेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितमबर', 'अकटूबर', 'नवमबर', 'दिसमबर'], + 'months_short' => ['जन', 'फर', 'मार्च', 'अप', 'मई', 'जून', 'जुला', 'अग', 'सित', 'अकटू', 'नव', 'दिस'], + 'weekdays' => ['इतवार', 'सोमवार', 'मंगलवार', 'बुधवार', 'बिरसपत', 'सुकरवार', 'सनिवार'], + 'weekdays_short' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], + 'weekdays_min' => ['इत', 'सोम', 'मंग', 'बुध', 'बिर', 'सुक', 'सनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['बिहिनियाँ', 'मंझनियाँ'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr.php new file mode 100644 index 00000000..dcf77565 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr.php @@ -0,0 +1,99 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Tim Fish + * - shaishavgandhi05 + * - Serhan Apaydın + * - JD Isaacks + * - tomhorvat + * - Josh Soref + * - François B + * - shaishavgandhi05 + * - Serhan Apaydın + * - JD Isaacks + * - tomhorvat + * - Stjepan Majdak + * - Vanja Retkovac (vr00) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count godinu|:count godine|:count godina', + 'y' => ':count god.|:count god.|:count god.', + 'month' => ':count mjesec|:count mjeseca|:count mjeseci', + 'm' => ':count mj.|:count mj.|:count mj.', + 'week' => ':count tjedan|:count tjedna|:count tjedana', + 'w' => ':count tj.|:count tj.|:count tj.', + 'day' => ':count dan|:count dana|:count dana', + 'd' => ':count d.|:count d.|:count d.', + 'hour' => ':count sat|:count sata|:count sati', + 'h' => ':count sat|:count sata|:count sati', + 'minute' => ':count minutu|:count minute|:count minuta', + 'min' => ':count min.|:count min.|:count min.', + 'second' => ':count sekundu|:count sekunde|:count sekundi', + 'a_second' => 'nekoliko sekundi|:count sekunde|:count sekundi', + 's' => ':count sek.|:count sek.|:count sek.', + 'ago' => 'prije :time', + 'from_now' => 'za :time', + 'after' => ':time poslije', + 'before' => ':time prije', + 'diff_now' => 'sad', + 'diff_today' => 'danas', + 'diff_today_regexp' => 'danas(?:\\s+u)?', + 'diff_yesterday' => 'jučer', + 'diff_yesterday_regexp' => 'jučer(?:\\s+u)?', + 'diff_tomorrow' => 'sutra', + 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', + 'diff_before_yesterday' => 'prekjučer', + 'diff_after_tomorrow' => 'prekosutra', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'D. M. YYYY.', + 'LL' => 'D. MMMM YYYY.', + 'LLL' => 'D. MMMM YYYY. H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY. H:mm', + ], + 'calendar' => [ + 'sameDay' => '[danas u] LT', + 'nextDay' => '[sutra u] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[u] [nedjelju] [u] LT', + 3 => '[u] [srijedu] [u] LT', + 6 => '[u] [subotu] [u] LT', + default => '[u] dddd [u] LT', + }, + 'lastDay' => '[jučer u] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0, 3 => '[prošlu] dddd [u] LT', + 6 => '[prošle] [subote] [u] LT', + default => '[prošli] dddd [u] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], + 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], + 'months_short' => ['sij.', 'velj.', 'ožu.', 'tra.', 'svi.', 'lip.', 'srp.', 'kol.', 'ruj.', 'lis.', 'stu.', 'pro.'], + 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['nedjelju', 'ponedjeljak', 'utorak', 'srijedu', 'četvrtak', 'petak', 'subotu'], + 'weekdays_standalone' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], + 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' i '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php new file mode 100644 index 00000000..7763a458 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_BA.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - DarkoDevelop + */ +return array_replace_recursive(require __DIR__.'/hr.php', [ + 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], + 'weekdays_min' => ['ned', 'pon', 'uto', 'sri', 'čet', 'pet', 'sub'], + 'months' => ['siječnja', 'veljače', 'ožujka', 'travnja', 'svibnja', 'lipnja', 'srpnja', 'kolovoza', 'rujna', 'listopada', 'studenoga', 'prosinca'], + 'months_short' => ['sij', 'velj', 'ožu', 'tra', 'svi', 'lip', 'srp', 'kol', 'ruj', 'lis', 'stu', 'pro'], + 'months_standalone' => ['siječanj', 'veljača', 'ožujak', 'travanj', 'svibanj', 'lipanj', 'srpanj', 'kolovoz', 'rujan', 'listopad', 'studeni', 'prosinac'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D. M. yy.', + 'LL' => 'D. MMM YYYY.', + 'LLL' => 'D. MMMM YYYY. HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY. HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php new file mode 100644 index 00000000..db74d8c7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hr_HR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/hr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php new file mode 100644 index 00000000..3537b8ba --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/hsb_DE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php new file mode 100644 index 00000000..6ba22716 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hsb_DE.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Information from Michael Wolf Andrzej Krzysztofowicz ankry@mif.pg.gda.pl + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'DD. MMMM YYYY', + 'LLL' => 'DD. MMMM, HH:mm [hodź.]', + 'LLLL' => 'dddd, DD. MMMM YYYY, HH:mm [hodź.]', + ], + 'months' => ['januara', 'februara', 'měrca', 'apryla', 'meje', 'junija', 'julija', 'awgusta', 'septembra', 'oktobra', 'nowembra', 'decembra'], + 'months_short' => ['Jan', 'Feb', 'Měr', 'Apr', 'Mej', 'Jun', 'Jul', 'Awg', 'Sep', 'Okt', 'Now', 'Dec'], + 'weekdays' => ['Njedźela', 'Póndźela', 'Wutora', 'Srjeda', 'Štvórtk', 'Pjatk', 'Sobota'], + 'weekdays_short' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], + 'weekdays_min' => ['Nj', 'Pó', 'Wu', 'Sr', 'Št', 'Pj', 'So'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count lěto', + 'y' => ':count lěto', + 'a_year' => ':count lěto', + + 'month' => ':count měsac', + 'm' => ':count měsac', + 'a_month' => ':count měsac', + + 'week' => ':count tydźeń', + 'w' => ':count tydźeń', + 'a_week' => ':count tydźeń', + + 'day' => ':count dźeń', + 'd' => ':count dźeń', + 'a_day' => ':count dźeń', + + 'hour' => ':count hodźina', + 'h' => ':count hodźina', + 'a_hour' => ':count hodźina', + + 'minute' => ':count chwila', + 'min' => ':count chwila', + 'a_minute' => ':count chwila', + + 'second' => ':count druhi', + 's' => ':count druhi', + 'a_second' => ':count druhi', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht.php new file mode 100644 index 00000000..ebd12ad1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ht_HT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php new file mode 100644 index 00000000..139b813b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ht_HT.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['janvye', 'fevriye', 'mas', 'avril', 'me', 'jen', 'jiyè', 'out', 'septanm', 'oktòb', 'novanm', 'desanm'], + 'months_short' => ['jan', 'fev', 'mas', 'avr', 'me', 'jen', 'jiy', 'out', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['dimanch', 'lendi', 'madi', 'mèkredi', 'jedi', 'vandredi', 'samdi'], + 'weekdays_short' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], + 'weekdays_min' => ['dim', 'len', 'mad', 'mèk', 'jed', 'van', 'sam'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count lane', + 'y' => ':count lane', + 'a_year' => ':count lane', + + 'month' => 'mwa :count', + 'm' => 'mwa :count', + 'a_month' => 'mwa :count', + + 'week' => 'semèn :count', + 'w' => 'semèn :count', + 'a_week' => 'semèn :count', + + 'day' => ':count jou', + 'd' => ':count jou', + 'a_day' => ':count jou', + + 'hour' => ':count lè', + 'h' => ':count lè', + 'a_hour' => ':count lè', + + 'minute' => ':count minit', + 'min' => ':count minit', + 'a_minute' => ':count minit', + + 'second' => ':count segonn', + 's' => ':count segonn', + 'a_second' => ':count segonn', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu.php new file mode 100644 index 00000000..635a30cf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu.php @@ -0,0 +1,118 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Adam Brunner + * - Brett Johnson + * - balping + */ + +use Carbon\CarbonInterface; + +$huWeekEndings = ['vasárnap', 'hétfőn', 'kedden', 'szerdán', 'csütörtökön', 'pénteken', 'szombaton']; + +return [ + 'year' => ':count év', + 'y' => ':count év', + 'month' => ':count hónap', + 'm' => ':count hónap', + 'week' => ':count hét', + 'w' => ':count hét', + 'day' => ':count nap', + 'd' => ':count nap', + 'hour' => ':count óra', + 'h' => ':count óra', + 'minute' => ':count perc', + 'min' => ':count perc', + 'second' => ':count másodperc', + 's' => ':count másodperc', + 'ago' => ':time', + 'from_now' => ':time múlva', + 'after' => ':time később', + 'before' => ':time korábban', + 'year_ago' => ':count éve', + 'y_ago' => ':count éve', + 'month_ago' => ':count hónapja', + 'm_ago' => ':count hónapja', + 'week_ago' => ':count hete', + 'w_ago' => ':count hete', + 'day_ago' => ':count napja', + 'd_ago' => ':count napja', + 'hour_ago' => ':count órája', + 'h_ago' => ':count órája', + 'minute_ago' => ':count perce', + 'min_ago' => ':count perce', + 'second_ago' => ':count másodperce', + 's_ago' => ':count másodperce', + 'year_after' => ':count évvel', + 'y_after' => ':count évvel', + 'month_after' => ':count hónappal', + 'm_after' => ':count hónappal', + 'week_after' => ':count héttel', + 'w_after' => ':count héttel', + 'day_after' => ':count nappal', + 'd_after' => ':count nappal', + 'hour_after' => ':count órával', + 'h_after' => ':count órával', + 'minute_after' => ':count perccel', + 'min_after' => ':count perccel', + 'second_after' => ':count másodperccel', + 's_after' => ':count másodperccel', + 'year_before' => ':count évvel', + 'y_before' => ':count évvel', + 'month_before' => ':count hónappal', + 'm_before' => ':count hónappal', + 'week_before' => ':count héttel', + 'w_before' => ':count héttel', + 'day_before' => ':count nappal', + 'd_before' => ':count nappal', + 'hour_before' => ':count órával', + 'h_before' => ':count órával', + 'minute_before' => ':count perccel', + 'min_before' => ':count perccel', + 'second_before' => ':count másodperccel', + 's_before' => ':count másodperccel', + 'months' => ['január', 'február', 'március', 'április', 'május', 'június', 'július', 'augusztus', 'szeptember', 'október', 'november', 'december'], + 'months_short' => ['jan.', 'febr.', 'márc.', 'ápr.', 'máj.', 'jún.', 'júl.', 'aug.', 'szept.', 'okt.', 'nov.', 'dec.'], + 'weekdays' => ['vasárnap', 'hétfő', 'kedd', 'szerda', 'csütörtök', 'péntek', 'szombat'], + 'weekdays_short' => ['vas', 'hét', 'kedd', 'sze', 'csüt', 'pén', 'szo'], + 'weekdays_min' => ['v', 'h', 'k', 'sze', 'cs', 'p', 'sz'], + 'ordinal' => ':number.', + 'diff_now' => 'most', + 'diff_today' => 'ma', + 'diff_yesterday' => 'tegnap', + 'diff_tomorrow' => 'holnap', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'YYYY.MM.DD.', + 'LL' => 'YYYY. MMMM D.', + 'LLL' => 'YYYY. MMMM D. H:mm', + 'LLLL' => 'YYYY. MMMM D., dddd H:mm', + ], + 'calendar' => [ + 'sameDay' => '[ma] LT[-kor]', + 'nextDay' => '[holnap] LT[-kor]', + 'nextWeek' => static function (CarbonInterface $date) use ($huWeekEndings) { + return '['.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; + }, + 'lastDay' => '[tegnap] LT[-kor]', + 'lastWeek' => static function (CarbonInterface $date) use ($huWeekEndings) { + return '[múlt '.$huWeekEndings[$date->dayOfWeek].'] LT[-kor]'; + }, + 'sameElse' => 'L', + ], + 'meridiem' => ['DE', 'DU'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' és '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php new file mode 100644 index 00000000..b1c48541 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hu_HU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/hu.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy.php new file mode 100644 index 00000000..8145ba31 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy.php @@ -0,0 +1,90 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - mhamlet + */ +return [ + 'year' => ':count տարի', + 'a_year' => 'տարի|:count տարի', + 'y' => ':countտ', + 'month' => ':count ամիս', + 'a_month' => 'ամիս|:count ամիս', + 'm' => ':countամ', + 'week' => ':count շաբաթ', + 'a_week' => 'շաբաթ|:count շաբաթ', + 'w' => ':countշ', + 'day' => ':count օր', + 'a_day' => 'օր|:count օր', + 'd' => ':countօր', + 'hour' => ':count ժամ', + 'a_hour' => 'ժամ|:count ժամ', + 'h' => ':countժ', + 'minute' => ':count րոպե', + 'a_minute' => 'րոպե|:count րոպե', + 'min' => ':countր', + 'second' => ':count վայրկյան', + 'a_second' => 'մի քանի վայրկյան|:count վայրկյան', + 's' => ':countվրկ', + 'ago' => ':time առաջ', + 'from_now' => ':timeից', + 'after' => ':time հետո', + 'before' => ':time առաջ', + 'diff_now' => 'հիմա', + 'diff_today' => 'այսօր', + 'diff_yesterday' => 'երեկ', + 'diff_tomorrow' => 'վաղը', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY թ.', + 'LLL' => 'D MMMM YYYY թ., HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY թ., HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[այսօր] LT', + 'nextDay' => '[վաղը] LT', + 'nextWeek' => 'dddd [օրը ժամը] LT', + 'lastDay' => '[երեկ] LT', + 'lastWeek' => '[անցած] dddd [օրը ժամը] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'DDD', 'w', 'W', 'DDDo' => $number.($number === 1 ? '-ին' : '-րդ'), + default => $number, + }; + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'գիշերվա'; + } + if ($hour < 12) { + return 'առավոտվա'; + } + if ($hour < 17) { + return 'ցերեկվա'; + } + + return 'երեկոյան'; + }, + 'months' => ['հունվարի', 'փետրվարի', 'մարտի', 'ապրիլի', 'մայիսի', 'հունիսի', 'հուլիսի', 'օգոստոսի', 'սեպտեմբերի', 'հոկտեմբերի', 'նոյեմբերի', 'դեկտեմբերի'], + 'months_standalone' => ['հունվար', 'փետրվար', 'մարտ', 'ապրիլ', 'մայիս', 'հունիս', 'հուլիս', 'օգոստոս', 'սեպտեմբեր', 'հոկտեմբեր', 'նոյեմբեր', 'դեկտեմբեր'], + 'months_short' => ['հնվ', 'փտր', 'մրտ', 'ապր', 'մյս', 'հնս', 'հլս', 'օգս', 'սպտ', 'հկտ', 'նմբ', 'դկտ'], + 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['կիրակի', 'երկուշաբթի', 'երեքշաբթի', 'չորեքշաբթի', 'հինգշաբթի', 'ուրբաթ', 'շաբաթ'], + 'weekdays_short' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], + 'weekdays_min' => ['կրկ', 'երկ', 'երք', 'չրք', 'հնգ', 'ուրբ', 'շբթ'], + 'list' => [', ', ' եւ '], + 'first_day_of_week' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php new file mode 100644 index 00000000..4587df56 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/hy_AM.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Tim Fish + * - Serhan Apaydın + * - JD Isaacks + */ +return array_replace_recursive(require __DIR__.'/hy.php', [ + 'from_now' => ':time հետո', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php new file mode 100644 index 00000000..e65449b8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/i18n.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], + 'months' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], + 'months_short' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], + 'weekdays' => ['1', '2', '3', '4', '5', '6', '7'], + 'weekdays_short' => ['1', '2', '3', '4', '5', '6', '7'], + 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia.php new file mode 100644 index 00000000..0a0d5e61 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ia_FR.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php new file mode 100644 index 00000000..de4b2fa0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ia_FR.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Fedora Project Nik Kalach nikka@fedoraproject.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['januario', 'februario', 'martio', 'april', 'maio', 'junio', 'julio', 'augusto', 'septembre', 'octobre', 'novembre', 'decembre'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'], + 'weekdays' => ['dominica', 'lunedi', 'martedi', 'mercuridi', 'jovedi', 'venerdi', 'sabbato'], + 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], + 'weekdays_min' => ['dom', 'lun', 'mar', 'mer', 'jov', 'ven', 'sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => 'anno :count', + 'y' => 'anno :count', + 'a_year' => 'anno :count', + + 'month' => ':count mense', + 'm' => ':count mense', + 'a_month' => ':count mense', + + 'week' => ':count septimana', + 'w' => ':count septimana', + 'a_week' => ':count septimana', + + 'day' => ':count die', + 'd' => ':count die', + 'a_day' => ':count die', + + 'hour' => ':count hora', + 'h' => ':count hora', + 'a_hour' => ':count hora', + + 'minute' => ':count minuscule', + 'min' => ':count minuscule', + 'a_minute' => ':count minuscule', + + 'second' => ':count secunda', + 's' => ':count secunda', + 'a_second' => ':count secunda', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id.php new file mode 100644 index 00000000..a49a2932 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - du + * - JD Isaacks + * - Nafies Luthfi + * - Raymundus Jati Primanda (mundusjp) + * - diankur313 + * - a-wip0 + */ +return [ + 'year' => ':count tahun', + 'a_year' => '{1}setahun|[-Inf,Inf]:count tahun', + 'y' => ':countthn', + 'month' => ':count bulan', + 'a_month' => '{1}sebulan|[-Inf,Inf]:count bulan', + 'm' => ':countbln', + 'week' => ':count minggu', + 'a_week' => '{1}seminggu|[-Inf,Inf]:count minggu', + 'w' => ':countmgg', + 'day' => ':count hari', + 'a_day' => '{1}sehari|[-Inf,Inf]:count hari', + 'd' => ':counthr', + 'hour' => ':count jam', + 'a_hour' => '{1}sejam|[-Inf,Inf]:count jam', + 'h' => ':countj', + 'minute' => ':count menit', + 'a_minute' => '{1}semenit|[-Inf,Inf]:count menit', + 'min' => ':countmnt', + 'second' => ':count detik', + 'a_second' => '{1}beberapa detik|[-Inf,Inf]:count detik', + 's' => ':countdt', + 'ago' => ':time yang lalu', + 'from_now' => ':time dari sekarang', + 'after' => ':time setelahnya', + 'before' => ':time sebelumnya', + 'diff_now' => 'sekarang', + 'diff_today' => 'Hari', + 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', + 'diff_yesterday' => 'kemarin', + 'diff_yesterday_regexp' => 'Kemarin(?:\\s+pukul)?', + 'diff_tomorrow' => 'besok', + 'diff_tomorrow_regexp' => 'Besok(?:\\s+pukul)?', + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm.ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY [pukul] HH.mm', + 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', + ], + 'calendar' => [ + 'sameDay' => '[Hari ini pukul] LT', + 'nextDay' => '[Besok pukul] LT', + 'nextWeek' => 'dddd [pukul] LT', + 'lastDay' => '[Kemarin pukul] LT', + 'lastWeek' => 'dddd [lalu pukul] LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 11) { + return 'pagi'; + } + if ($hour < 15) { + return 'siang'; + } + if ($hour < 19) { + return 'sore'; + } + + return 'malam'; + }, + 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Agt', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jumat', 'Sabtu'], + 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'], + 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' dan '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php new file mode 100644 index 00000000..d5953a14 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/id_ID.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/id.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig.php new file mode 100644 index 00000000..de51e9cc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ig_NG.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php new file mode 100644 index 00000000..0034e35d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ig_NG.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Jenụwarị', 'Febrụwarị', 'Maachị', 'Eprel', 'Mee', 'Juun', 'Julaị', 'Ọgọọst', 'Septemba', 'Ọktoba', 'Novemba', 'Disemba'], + 'months_short' => ['Jen', 'Feb', 'Maa', 'Epr', 'Mee', 'Juu', 'Jul', 'Ọgọ', 'Sep', 'Ọkt', 'Nov', 'Dis'], + 'weekdays' => ['sọnde', 'mọnde', 'tuzde', 'wenzde', 'tọsde', 'fraịde', 'satọde'], + 'weekdays_short' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], + 'weekdays_min' => ['sọn', 'mọn', 'tuz', 'wen', 'tọs', 'fra', 'sat'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => 'afo :count', + 'y' => 'afo :count', + 'a_year' => 'afo :count', + + 'month' => 'önwa :count', + 'm' => 'önwa :count', + 'a_month' => 'önwa :count', + + 'week' => 'izu :count', + 'w' => 'izu :count', + 'a_week' => 'izu :count', + + 'day' => 'ụbọchị :count', + 'd' => 'ụbọchị :count', + 'a_day' => 'ụbọchị :count', + + 'hour' => 'awa :count', + 'h' => 'awa :count', + 'a_hour' => 'awa :count', + + 'minute' => 'minit :count', + 'min' => 'minit :count', + 'a_minute' => 'minit :count', + + 'second' => 'sekọnd :count', + 's' => 'sekọnd :count', + 'a_second' => 'sekọnd :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ii.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ii.php new file mode 100644 index 00000000..592a53f4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ii.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['ꎸꄑ', 'ꁯꋒ'], + 'weekdays' => ['ꑭꆏꑍ', 'ꆏꊂꋍ', 'ꆏꊂꑍ', 'ꆏꊂꌕ', 'ꆏꊂꇖ', 'ꆏꊂꉬ', 'ꆏꊂꃘ'], + 'weekdays_short' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], + 'weekdays_min' => ['ꑭꆏ', 'ꆏꋍ', 'ꆏꑍ', 'ꆏꌕ', 'ꆏꇖ', 'ꆏꉬ', 'ꆏꃘ'], + 'months' => null, + 'months_short' => ['ꋍꆪ', 'ꑍꆪ', 'ꌕꆪ', 'ꇖꆪ', 'ꉬꆪ', 'ꃘꆪ', 'ꏃꆪ', 'ꉆꆪ', 'ꈬꆪ', 'ꊰꆪ', 'ꊰꊪꆪ', 'ꊰꑋꆪ'], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D h:mm a', + 'LLLL' => 'YYYY MMMM D, dddd h:mm a', + ], + + 'year' => ':count ꒉ', // less reliable + 'y' => ':count ꒉ', // less reliable + 'a_year' => ':count ꒉ', // less reliable + + 'month' => ':count ꆪ', + 'm' => ':count ꆪ', + 'a_month' => ':count ꆪ', + + 'week' => ':count ꏃ', // less reliable + 'w' => ':count ꏃ', // less reliable + 'a_week' => ':count ꏃ', // less reliable + + 'day' => ':count ꏜ', // less reliable + 'd' => ':count ꏜ', // less reliable + 'a_day' => ':count ꏜ', // less reliable + + 'hour' => ':count ꄮꈉ', + 'h' => ':count ꄮꈉ', + 'a_hour' => ':count ꄮꈉ', + + 'minute' => ':count ꀄꊭ', // less reliable + 'min' => ':count ꀄꊭ', // less reliable + 'a_minute' => ':count ꀄꊭ', // less reliable + + 'second' => ':count ꇅ', // less reliable + 's' => ':count ꇅ', // less reliable + 'a_second' => ':count ꇅ', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik.php new file mode 100644 index 00000000..7a13aa2d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ik_CA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php new file mode 100644 index 00000000..02dbbef2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ik_CA.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Siqiññaatchiaq', 'Siqiññaasrugruk', 'Paniqsiqsiivik', 'Qilġich Tatqiat', 'Suppivik', 'Iġñivik', 'Itchavik', 'Tiññivik', 'Amiġaiqsivik', 'Sikkuvik', 'Nippivik', 'Siqiñġiḷaq'], + 'months_short' => ['Sñt', 'Sñs', 'Pan', 'Qil', 'Sup', 'Iġñ', 'Itc', 'Tiñ', 'Ami', 'Sik', 'Nip', 'Siq'], + 'weekdays' => ['Minġuiqsioiq', 'Savałłiq', 'Ilaqtchiioiq', 'Qitchiioiq', 'Sisamiioiq', 'Tallimmiioiq', 'Maqinġuoiq'], + 'weekdays_short' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], + 'weekdays_min' => ['Min', 'Sav', 'Ila', 'Qit', 'Sis', 'Tal', 'Maq'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count ukiuq', + 'y' => ':count ukiuq', + 'a_year' => ':count ukiuq', + + 'month' => ':count Tatqiat', + 'm' => ':count Tatqiat', + 'a_month' => ':count Tatqiat', + + 'week' => ':count tatqiat', // less reliable + 'w' => ':count tatqiat', // less reliable + 'a_week' => ':count tatqiat', // less reliable + + 'day' => ':count siqiñiq', // less reliable + 'd' => ':count siqiñiq', // less reliable + 'a_day' => ':count siqiñiq', // less reliable + + 'hour' => ':count Siḷa', // less reliable + 'h' => ':count Siḷa', // less reliable + 'a_hour' => ':count Siḷa', // less reliable + + 'second' => ':count iġñiq', // less reliable + 's' => ':count iġñiq', // less reliable + 'a_second' => ':count iġñiq', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/in.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/in.php new file mode 100644 index 00000000..d5953a14 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/in.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/id.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is.php new file mode 100644 index 00000000..9990168c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kristján Ingi Geirsson + */ +return [ + 'year' => '1 ár|:count ár', + 'y' => '1 ár|:count ár', + 'month' => '1 mánuður|:count mánuðir', + 'm' => '1 mánuður|:count mánuðir', + 'week' => '1 vika|:count vikur', + 'w' => '1 vika|:count vikur', + 'day' => '1 dagur|:count dagar', + 'd' => '1 dagur|:count dagar', + 'hour' => '1 klukkutími|:count klukkutímar', + 'h' => '1 klukkutími|:count klukkutímar', + 'minute' => '1 mínúta|:count mínútur', + 'min' => '1 mínúta|:count mínútur', + 'second' => '1 sekúnda|:count sekúndur', + 's' => '1 sekúnda|:count sekúndur', + 'ago' => ':time síðan', + 'from_now' => ':time síðan', + 'after' => ':time eftir', + 'before' => ':time fyrir', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' og '], + 'meridiem' => ['fh', 'eh'], + 'diff_now' => 'núna', + 'diff_yesterday' => 'í gær', + 'diff_tomorrow' => 'á morgun', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM [kl.] HH:mm', + 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', + ], + 'weekdays' => ['sunnudaginn', 'mánudaginn', 'þriðjudaginn', 'miðvikudaginn', 'fimmtudaginn', 'föstudaginn', 'laugardaginn'], + 'weekdays_short' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], + 'weekdays_min' => ['sun', 'mán', 'þri', 'mið', 'fim', 'fös', 'lau'], + 'months' => ['janúar', 'febrúar', 'mars', 'apríl', 'maí', 'júní', 'júlí', 'ágúst', 'september', 'október', 'nóvember', 'desember'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maí', 'jún', 'júl', 'ágú', 'sep', 'okt', 'nóv', 'des'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php new file mode 100644 index 00000000..4d35c448 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/is_IS.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/is.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it.php new file mode 100644 index 00000000..c4836951 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ash + * - François B + * - Marco Perrando + * - Massimiliano Caniparoli + * - JD Isaacks + * - Andrea Martini + * - Francesco Marasco + * - Tizianoz93 + * - Davide Casiraghi (davide-casiraghi) + * - Pete Scopes (pdscopes) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count anno|:count anni', + 'a_year' => 'un anno|:count anni', + 'y' => ':count anno|:count anni', + 'month' => ':count mese|:count mesi', + 'a_month' => 'un mese|:count mesi', + 'm' => ':count mese|:count mesi', + 'week' => ':count settimana|:count settimane', + 'a_week' => 'una settimana|:count settimane', + 'w' => ':count set.', + 'day' => ':count giorno|:count giorni', + 'a_day' => 'un giorno|:count giorni', + 'd' => ':count g|:count gg', + 'hour' => ':count ora|:count ore', + 'a_hour' => 'un\'ora|:count ore', + 'h' => ':count h', + 'minute' => ':count minuto|:count minuti', + 'a_minute' => 'un minuto|:count minuti', + 'min' => ':count min.', + 'second' => ':count secondo|:count secondi', + 'a_second' => 'alcuni secondi|:count secondi', + 's' => ':count sec.', + 'millisecond' => ':count millisecondo|:count millisecondi', + 'a_millisecond' => 'un millisecondo|:count millisecondi', + 'ms' => ':countms', + 'microsecond' => ':count microsecondo|:count microsecondi', + 'a_microsecond' => 'un microsecondo|:count microsecondi', + 'µs' => ':countµs', + 'ago' => ':time fa', + 'from_now' => static function ($time) { + return (preg_match('/^\d.+$/', $time) ? 'tra' : 'in')." $time"; + }, + 'after' => ':time dopo', + 'before' => ':time prima', + 'diff_now' => 'proprio ora', + 'diff_today' => 'Oggi', + 'diff_today_regexp' => 'Oggi(?:\\s+alle)?', + 'diff_yesterday' => 'ieri', + 'diff_yesterday_regexp' => 'Ieri(?:\\s+alle)?', + 'diff_tomorrow' => 'domani', + 'diff_tomorrow_regexp' => 'Domani(?:\\s+alle)?', + 'diff_before_yesterday' => 'l\'altro ieri', + 'diff_after_tomorrow' => 'dopodomani', + 'period_interval' => 'ogni :interval', + 'period_start_date' => 'dal :date', + 'period_end_date' => 'al :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Oggi alle] LT', + 'nextDay' => '[Domani alle] LT', + 'nextWeek' => 'dddd [alle] LT', + 'lastDay' => '[Ieri alle] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[la scorsa] dddd [alle] LT', + default => '[lo scorso] dddd [alle] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['gennaio', 'febbraio', 'marzo', 'aprile', 'maggio', 'giugno', 'luglio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dicembre'], + 'months_short' => ['gen', 'feb', 'mar', 'apr', 'mag', 'giu', 'lug', 'ago', 'set', 'ott', 'nov', 'dic'], + 'weekdays' => ['domenica', 'lunedì', 'martedì', 'mercoledì', 'giovedì', 'venerdì', 'sabato'], + 'weekdays_short' => ['dom', 'lun', 'mar', 'mer', 'gio', 'ven', 'sab'], + 'weekdays_min' => ['do', 'lu', 'ma', 'me', 'gi', 've', 'sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' e '], + 'ordinal_words' => [ + 'of' => 'di', + 'first' => 'primo', + 'second' => 'secondo', + 'third' => 'terzo', + 'fourth' => 'quarto', + 'fifth' => 'quinto', + 'last' => 'ultimo', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php new file mode 100644 index 00000000..c23cc50e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_CH.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Propaganistas + */ +return array_replace_recursive(require __DIR__.'/it.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php new file mode 100644 index 00000000..a5d19818 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_IT.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return require __DIR__.'/it.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php new file mode 100644 index 00000000..5e8fc92f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_SM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/it.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php new file mode 100644 index 00000000..5e8fc92f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/it_VA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/it.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu.php new file mode 100644 index 00000000..4fa97427 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/iu_CA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php new file mode 100644 index 00000000..5acee939 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iu_CA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Pablo Saratxaga pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'MM/DD/YY', + ], + 'months' => ['ᔮᓄᐊᓕ', 'ᕕᕗᐊᓕ', 'ᒪᔅᓯ', 'ᐃᐳᓗ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚᐃ', 'ᐊᒋᓯ', 'ᓯᑎᕙ', 'ᐊᑦᑐᕙ', 'ᓄᕕᕙ', 'ᑎᓯᕝᕙ'], + 'months_short' => ['ᔮᓄ', 'ᕕᕗ', 'ᒪᔅ', 'ᐃᐳ', 'ᒪᐃ', 'ᔪᓂ', 'ᔪᓚ', 'ᐊᒋ', 'ᓯᑎ', 'ᐊᑦ', 'ᓄᕕ', 'ᑎᓯ'], + 'weekdays' => ['ᓈᑦᑎᖑᔭᕐᕕᒃ', 'ᓇᒡᒐᔾᔭᐅ', 'ᓇᒡᒐᔾᔭᐅᓕᖅᑭᑦ', 'ᐱᖓᓲᓕᖅᓯᐅᑦ', 'ᕿᑎᖅᑰᑦ', 'ᐅᓪᓗᕈᓘᑐᐃᓇᖅ', 'ᓯᕙᑖᕕᒃ'], + 'weekdays_short' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], + 'weekdays_min' => ['ᓈ', 'ᓇ', 'ᓕ', 'ᐱ', 'ᕿ', 'ᐅ', 'ᓯ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count ᐅᑭᐅᖅ', + 'y' => ':count ᐅᑭᐅᖅ', + 'a_year' => ':count ᐅᑭᐅᖅ', + + 'month' => ':count qaammat', + 'm' => ':count qaammat', + 'a_month' => ':count qaammat', + + 'week' => ':count sapaatip akunnera', + 'w' => ':count sapaatip akunnera', + 'a_week' => ':count sapaatip akunnera', + + 'day' => ':count ulloq', + 'd' => ':count ulloq', + 'a_day' => ':count ulloq', + + 'hour' => ':count ikarraq', + 'h' => ':count ikarraq', + 'a_hour' => ':count ikarraq', + + 'minute' => ':count titiqqaralaaq', // less reliable + 'min' => ':count titiqqaralaaq', // less reliable + 'a_minute' => ':count titiqqaralaaq', // less reliable + + 'second' => ':count marluk', // less reliable + 's' => ':count marluk', // less reliable + 'a_second' => ':count marluk', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iw.php new file mode 100644 index 00000000..5dedd3c0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/iw.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'months' => ['ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'], + 'months_short' => ['ינו׳', 'פבר׳', 'מרץ', 'אפר׳', 'מאי', 'יוני', 'יולי', 'אוג׳', 'ספט׳', 'אוק׳', 'נוב׳', 'דצמ׳'], + 'weekdays' => ['יום ראשון', 'יום שני', 'יום שלישי', 'יום רביעי', 'יום חמישי', 'יום שישי', 'יום שבת'], + 'weekdays_short' => ['יום א׳', 'יום ב׳', 'יום ג׳', 'יום ד׳', 'יום ה׳', 'יום ו׳', 'שבת'], + 'weekdays_min' => ['א׳', 'ב׳', 'ג׳', 'ד׳', 'ה׳', 'ו׳', 'ש׳'], + 'meridiem' => ['לפנה״צ', 'אחה״צ'], + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'D.M.YYYY', + 'LL' => 'D בMMM YYYY', + 'LLL' => 'D בMMMM YYYY H:mm', + 'LLLL' => 'dddd, D בMMMM YYYY H:mm', + ], + + 'year' => ':count שנה', + 'y' => ':count שנה', + 'a_year' => ':count שנה', + + 'month' => ':count חודש', + 'm' => ':count חודש', + 'a_month' => ':count חודש', + + 'week' => ':count שבוע', + 'w' => ':count שבוע', + 'a_week' => ':count שבוע', + + 'day' => ':count יום', + 'd' => ':count יום', + 'a_day' => ':count יום', + + 'hour' => ':count שעה', + 'h' => ':count שעה', + 'a_hour' => ':count שעה', + + 'minute' => ':count דקה', + 'min' => ':count דקה', + 'a_minute' => ':count דקה', + + 'second' => ':count שניה', + 's' => ':count שניה', + 'a_second' => ':count שניה', + + 'ago' => 'לפני :time', + 'from_now' => 'בעוד :time', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja.php new file mode 100644 index 00000000..a857db5c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Takuya Sawada + * - Atsushi Tanaka + * - François B + * - Jason Katz-Brown + * - Serhan Apaydın + * - XueWei + * - JD Isaacks + * - toyama satoshi + * - atakigawa + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count年', + 'y' => ':count年', + 'month' => ':countヶ月', + 'm' => ':countヶ月', + 'week' => ':count週間', + 'w' => ':count週間', + 'day' => ':count日', + 'd' => ':count日', + 'hour' => ':count時間', + 'h' => ':count時間', + 'minute' => ':count分', + 'min' => ':count分', + 'second' => ':count秒', + 'a_second' => '{1}数秒|[-Inf,Inf]:count秒', + 's' => ':count秒', + 'ago' => ':time前', + 'from_now' => ':time後', + 'after' => ':time後', + 'before' => ':time前', + 'diff_now' => '今', + 'diff_today' => '今日', + 'diff_yesterday' => '昨日', + 'diff_tomorrow' => '明日', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY年M月D日', + 'LLL' => 'YYYY年M月D日 HH:mm', + 'LLLL' => 'YYYY年M月D日 dddd HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[今日] LT', + 'nextDay' => '[明日] LT', + 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { + if ($other->week !== $current->week) { + return '[来週]dddd LT'; + } + + return 'dddd LT'; + }, + 'lastDay' => '[昨日] LT', + 'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { + if ($other->week !== $current->week) { + return '[先週]dddd LT'; + } + + return 'dddd LT'; + }, + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'd', 'D', 'DDD' => $number.'日', + default => $number, + }; + }, + 'meridiem' => ['午前', '午後'], + 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'weekdays' => ['日曜日', '月曜日', '火曜日', '水曜日', '木曜日', '金曜日', '土曜日'], + 'weekdays_short' => ['日', '月', '火', '水', '木', '金', '土'], + 'weekdays_min' => ['日', '月', '火', '水', '木', '金', '土'], + 'list' => '、', + 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '二十', '二十一', '二十二', '二十三', '二十四', '二十五', '二十六', '二十七', '二十八', '二十九', '三十', '三十一', '三十二', '三十三', '三十四', '三十五', '三十六', '三十七', '三十八', '三十九', '四十', '四十一', '四十二', '四十三', '四十四', '四十五', '四十六', '四十七', '四十八', '四十九', '五十', '五十一', '五十二', '五十三', '五十四', '五十五', '五十六', '五十七', '五十八', '五十九', '六十', '六十一', '六十二', '六十三', '六十四', '六十五', '六十六', '六十七', '六十八', '六十九', '七十', '七十一', '七十二', '七十三', '七十四', '七十五', '七十六', '七十七', '七十八', '七十九', '八十', '八十一', '八十二', '八十三', '八十四', '八十五', '八十六', '八十七', '八十八', '八十九', '九十', '九十一', '九十二', '九十三', '九十四', '九十五', '九十六', '九十七', '九十八', '九十九'], + 'alt_numbers_pow' => [ + 10000 => '万', + 1000 => '千', + 100 => '百', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php new file mode 100644 index 00000000..c2836253 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ja_JP.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ja.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jgo.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php new file mode 100644 index 00000000..ed92e8e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jmc.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['utuko', 'kyiukonyi'], + 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jv.php new file mode 100644 index 00000000..10fe5383 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/jv.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - tgfjt + * - JD Isaacks + */ +return [ + 'year' => ':count taun', + 'a_year' => '{1}setaun|[-Inf,Inf]:count taun', + 'month' => ':count wulan', + 'a_month' => '{1}sewulan|[-Inf,Inf]:count wulan', + 'week' => ':count minggu', + 'a_week' => '{1}sakminggu|[-Inf,Inf]:count minggu', + 'day' => ':count dina', + 'a_day' => '{1}sedina|[-Inf,Inf]:count dina', + 'hour' => ':count jam', + 'a_hour' => '{1}setunggal jam|[-Inf,Inf]:count jam', + 'minute' => ':count menit', + 'a_minute' => '{1}setunggal menit|[-Inf,Inf]:count menit', + 'second' => ':count detik', + 'a_second' => '{0,1}sawetawis detik|[-Inf,Inf]:count detik', + 'ago' => ':time ingkang kepengker', + 'from_now' => 'wonten ing :time', + 'diff_today' => 'Dinten', + 'diff_yesterday' => 'Kala', + 'diff_yesterday_regexp' => 'Kala(?:\\s+wingi)?(?:\\s+pukul)?', + 'diff_tomorrow' => 'Mbenjang', + 'diff_tomorrow_regexp' => 'Mbenjang(?:\\s+pukul)?', + 'diff_today_regexp' => 'Dinten(?:\\s+puniko)?(?:\\s+pukul)?', + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm.ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY [pukul] HH.mm', + 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', + ], + 'calendar' => [ + 'sameDay' => '[Dinten puniko pukul] LT', + 'nextDay' => '[Mbenjang pukul] LT', + 'nextWeek' => 'dddd [pukul] LT', + 'lastDay' => '[Kala wingi pukul] LT', + 'lastWeek' => 'dddd [kepengker pukul] LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 11) { + return 'enjing'; + } + if ($hour < 15) { + return 'siyang'; + } + if ($hour < 19) { + return 'sonten'; + } + + return 'ndalu'; + }, + 'months' => ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'Nopember', 'Desember'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nop', 'Des'], + 'weekdays' => ['Minggu', 'Senen', 'Seloso', 'Rebu', 'Kemis', 'Jemuwah', 'Septu'], + 'weekdays_short' => ['Min', 'Sen', 'Sel', 'Reb', 'Kem', 'Jem', 'Sep'], + 'weekdays_min' => ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sp'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' lan '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka.php new file mode 100644 index 00000000..b3051d59 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka.php @@ -0,0 +1,204 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Tornike Razmadze + * - François B + * - Lasha Dolidze + * - Tim Fish + * - JD Isaacks + * - Tornike Razmadze + * - François B + * - Lasha Dolidze + * - JD Isaacks + * - LONGMAN + * - Avtandil Kikabidze (akalongman) + * - Levan Velijanashvili (Stichoza) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count წელი', + 'y' => ':count წელი', + 'a_year' => '{1}წელი|[-Inf,Inf]:count წელი', + 'month' => ':count თვე', + 'm' => ':count თვე', + 'a_month' => '{1}თვე|[-Inf,Inf]:count თვე', + 'week' => ':count კვირა', + 'w' => ':count კვირა', + 'a_week' => '{1}კვირა|[-Inf,Inf]:count კვირა', + 'day' => ':count დღე', + 'd' => ':count დღე', + 'a_day' => '{1}დღე|[-Inf,Inf]:count დღე', + 'hour' => ':count საათი', + 'h' => ':count საათი', + 'a_hour' => '{1}საათი|[-Inf,Inf]:count საათი', + 'minute' => ':count წუთი', + 'min' => ':count წუთი', + 'a_minute' => '{1}წუთი|[-Inf,Inf]:count წუთი', + 'second' => ':count წამი', + 's' => ':count წამი', + 'a_second' => '{1}რამდენიმე წამი|[-Inf,Inf]:count წამი', + 'ago' => static function ($time) { + $replacements = [ + // year + 'წელი' => 'წლის', + // month + 'თვე' => 'თვის', + // week + 'კვირა' => 'კვირის', + // day + 'დღე' => 'დღის', + // hour + 'საათი' => 'საათის', + // minute + 'წუთი' => 'წუთის', + // second + 'წამი' => 'წამის', + ]; + $time = strtr($time, array_flip($replacements)); + $time = strtr($time, $replacements); + + return "$time წინ"; + }, + 'from_now' => static function ($time) { + $replacements = [ + // year + 'წელი' => 'წელიწადში', + // week + 'კვირა' => 'კვირაში', + // day + 'დღე' => 'დღეში', + // month + 'თვე' => 'თვეში', + // hour + 'საათი' => 'საათში', + // minute + 'წუთი' => 'წუთში', + // second + 'წამი' => 'წამში', + ]; + $time = strtr($time, array_flip($replacements)); + $time = strtr($time, $replacements); + + return $time; + }, + 'after' => static function ($time) { + $replacements = [ + // year + 'წელი' => 'წლის', + // month + 'თვე' => 'თვის', + // week + 'კვირა' => 'კვირის', + // day + 'დღე' => 'დღის', + // hour + 'საათი' => 'საათის', + // minute + 'წუთი' => 'წუთის', + // second + 'წამი' => 'წამის', + ]; + $time = strtr($time, array_flip($replacements)); + $time = strtr($time, $replacements); + + return "$time შემდეგ"; + }, + 'before' => static function ($time) { + $replacements = [ + // year + 'წელი' => 'წლით', + // month + 'თვე' => 'თვით', + // week + 'კვირა' => 'კვირით', + // day + 'დღე' => 'დღით', + // hour + 'საათი' => 'საათით', + // minute + 'წუთი' => 'წუთით', + // second + 'წამი' => 'წამით', + ]; + $time = strtr($time, array_flip($replacements)); + $time = strtr($time, $replacements); + + return "$time ადრე"; + }, + 'diff_now' => 'ახლა', + 'diff_today' => 'დღეს', + 'diff_yesterday' => 'გუშინ', + 'diff_tomorrow' => 'ხვალ', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[დღეს], LT[-ზე]', + 'nextDay' => '[ხვალ], LT[-ზე]', + 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { + return ($current->isSameWeek($other) ? '' : '[შემდეგ] ').'dddd, LT[-ზე]'; + }, + 'lastDay' => '[გუშინ], LT[-ზე]', + 'lastWeek' => '[წინა] dddd, LT-ზე', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + if ($number === 0) { + return $number; + } + if ($number === 1) { + return $number.'-ლი'; + } + if (($number < 20) || ($number <= 100 && ($number % 20 === 0)) || ($number % 100 === 0)) { + return 'მე-'.$number; + } + + return $number.'-ე'; + }, + 'months' => ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'], + 'months_standalone' => ['იანვარს', 'თებერვალს', 'მარტს', 'აპრილს', 'მაისს', 'ივნისს', 'ივლისს', 'აგვისტოს', 'სექტემბერს', 'ოქტომბერს', 'ნოემბერს', 'დეკემბერს'], + 'months_short' => ['იან', 'თებ', 'მარ', 'აპრ', 'მაი', 'ივნ', 'ივლ', 'აგვ', 'სექ', 'ოქტ', 'ნოე', 'დეკ'], + 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['კვირას', 'ორშაბათს', 'სამშაბათს', 'ოთხშაბათს', 'ხუთშაბათს', 'პარასკევს', 'შაბათს'], + 'weekdays_standalone' => ['კვირა', 'ორშაბათი', 'სამშაბათი', 'ოთხშაბათი', 'ხუთშაბათი', 'პარასკევი', 'შაბათი'], + 'weekdays_short' => ['კვი', 'ორშ', 'სამ', 'ოთხ', 'ხუთ', 'პარ', 'შაბ'], + 'weekdays_min' => ['კვ', 'ორ', 'სა', 'ოთ', 'ხუ', 'პა', 'შა'], + 'weekdays_regexp' => '/^([^d].*|.*[^d])$/', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' და '], + 'meridiem' => static function ($hour) { + if ($hour >= 4) { + if ($hour < 11) { + return 'დილის'; + } + + if ($hour < 16) { + return 'შუადღის'; + } + + if ($hour < 22) { + return 'საღამოს'; + } + } + + return 'ღამის'; + }, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php new file mode 100644 index 00000000..a26d9305 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ka_GE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ka.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab.php new file mode 100644 index 00000000..94d64737 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/kab_DZ.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php new file mode 100644 index 00000000..796660be --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kab_DZ.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - belkacem77@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Yennayer', 'Fuṛar', 'Meɣres', 'Yebrir', 'Mayyu', 'Yunyu', 'Yulyu', 'ɣuct', 'Ctembeṛ', 'Tubeṛ', 'Wambeṛ', 'Dujembeṛ'], + 'months_short' => ['Yen', 'Fur', 'Meɣ', 'Yeb', 'May', 'Yun', 'Yul', 'ɣuc', 'Cte', 'Tub', 'Wam', 'Duj'], + 'weekdays' => ['Acer', 'Arim', 'Aram', 'Ahad', 'Amhad', 'Sem', 'Sed'], + 'weekdays_short' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], + 'weekdays_min' => ['Ace', 'Ari', 'Ara', 'Aha', 'Amh', 'Sem', 'Sed'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['FT', 'MD'], + + 'year' => ':count n yiseggasen', + 'y' => ':count n yiseggasen', + 'a_year' => ':count n yiseggasen', + + 'month' => ':count n wayyuren', + 'm' => ':count n wayyuren', + 'a_month' => ':count n wayyuren', + + 'week' => ':count n ledwaṛ', // less reliable + 'w' => ':count n ledwaṛ', // less reliable + 'a_week' => ':count n ledwaṛ', // less reliable + + 'day' => ':count n wussan', + 'd' => ':count n wussan', + 'a_day' => ':count n wussan', + + 'hour' => ':count n tsaɛtin', + 'h' => ':count n tsaɛtin', + 'a_hour' => ':count n tsaɛtin', + + 'minute' => ':count n tedqiqin', + 'min' => ':count n tedqiqin', + 'a_minute' => ':count n tedqiqin', + + 'second' => ':count tasdidt', // less reliable + 's' => ':count tasdidt', // less reliable + 'a_second' => ':count tasdidt', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kam.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kam.php new file mode 100644 index 00000000..4d3a3b25 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kam.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Ĩyakwakya', 'Ĩyawĩoo'], + 'weekdays' => ['Wa kyumwa', 'Wa kwambĩlĩlya', 'Wa kelĩ', 'Wa katatũ', 'Wa kana', 'Wa katano', 'Wa thanthatũ'], + 'weekdays_short' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], + 'weekdays_min' => ['Wky', 'Wkw', 'Wkl', 'Wtũ', 'Wkn', 'Wtn', 'Wth'], + 'months' => ['Mwai wa mbee', 'Mwai wa kelĩ', 'Mwai wa katatũ', 'Mwai wa kana', 'Mwai wa katano', 'Mwai wa thanthatũ', 'Mwai wa muonza', 'Mwai wa nyaanya', 'Mwai wa kenda', 'Mwai wa ĩkumi', 'Mwai wa ĩkumi na ĩmwe', 'Mwai wa ĩkumi na ilĩ'], + 'months_short' => ['Mbe', 'Kel', 'Ktũ', 'Kan', 'Ktn', 'Tha', 'Moo', 'Nya', 'Knd', 'Ĩku', 'Ĩkm', 'Ĩkl'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + // Too unreliable + /* + 'year' => ':count mbua', // less reliable + 'y' => ':count mbua', // less reliable + 'a_year' => ':count mbua', // less reliable + + 'month' => ':count ndakitali', // less reliable + 'm' => ':count ndakitali', // less reliable + 'a_month' => ':count ndakitali', // less reliable + + 'day' => ':count wia', // less reliable + 'd' => ':count wia', // less reliable + 'a_day' => ':count wia', // less reliable + + 'hour' => ':count orasan', // less reliable + 'h' => ':count orasan', // less reliable + 'a_hour' => ':count orasan', // less reliable + + 'minute' => ':count orasan', // less reliable + 'min' => ':count orasan', // less reliable + 'a_minute' => ':count orasan', // less reliable + */ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kde.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kde.php new file mode 100644 index 00000000..fbcc9f3d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kde.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Muhi', 'Chilo'], + 'weekdays' => ['Liduva lyapili', 'Liduva lyatatu', 'Liduva lyanchechi', 'Liduva lyannyano', 'Liduva lyannyano na linji', 'Liduva lyannyano na mavili', 'Liduva litandi'], + 'weekdays_short' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], + 'weekdays_min' => ['Ll2', 'Ll3', 'Ll4', 'Ll5', 'Ll6', 'Ll7', 'Ll1'], + 'months' => ['Mwedi Ntandi', 'Mwedi wa Pili', 'Mwedi wa Tatu', 'Mwedi wa Nchechi', 'Mwedi wa Nnyano', 'Mwedi wa Nnyano na Umo', 'Mwedi wa Nnyano na Mivili', 'Mwedi wa Nnyano na Mitatu', 'Mwedi wa Nnyano na Nchechi', 'Mwedi wa Nnyano na Nnyano', 'Mwedi wa Nnyano na Nnyano na U', 'Mwedi wa Nnyano na Nnyano na M'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kea.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kea.php new file mode 100644 index 00000000..8b6c21b9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kea.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['a', 'p'], + 'weekdays' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sabadu'], + 'weekdays_short' => ['dum', 'sig', 'ter', 'kua', 'kin', 'ses', 'sab'], + 'weekdays_min' => ['du', 'si', 'te', 'ku', 'ki', 'se', 'sa'], + 'weekdays_standalone' => ['dumingu', 'sigunda-fera', 'tersa-fera', 'kuarta-fera', 'kinta-fera', 'sesta-fera', 'sábadu'], + 'months' => ['Janeru', 'Febreru', 'Marsu', 'Abril', 'Maiu', 'Junhu', 'Julhu', 'Agostu', 'Setenbru', 'Otubru', 'Nuvenbru', 'Dizenbru'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Otu', 'Nuv', 'Diz'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D [di] MMMM [di] YYYY HH:mm', + 'LLLL' => 'dddd, D [di] MMMM [di] YYYY HH:mm', + ], + + 'year' => ':count otunu', // less reliable + 'y' => ':count otunu', // less reliable + 'a_year' => ':count otunu', // less reliable + + 'week' => ':count día dumingu', // less reliable + 'w' => ':count día dumingu', // less reliable + 'a_week' => ':count día dumingu', // less reliable + + 'day' => ':count diâ', // less reliable + 'd' => ':count diâ', // less reliable + 'a_day' => ':count diâ', // less reliable + + 'minute' => ':count sugundu', // less reliable + 'min' => ':count sugundu', // less reliable + 'a_minute' => ':count sugundu', // less reliable + + 'second' => ':count dós', // less reliable + 's' => ':count dós', // less reliable + 'a_second' => ':count dós', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/khq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/khq.php new file mode 100644 index 00000000..7a834cf0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/khq.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Adduha', 'Aluula'], + 'weekdays' => ['Alhadi', 'Atini', 'Atalata', 'Alarba', 'Alhamiisa', 'Aljuma', 'Assabdu'], + 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], + 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alj', 'Ass'], + 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], + 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ki.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ki.php new file mode 100644 index 00000000..868fd61a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ki.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Kiroko', 'Hwaĩ-inĩ'], + 'weekdays' => ['Kiumia', 'Njumatatũ', 'Njumaine', 'Njumatana', 'Aramithi', 'Njumaa', 'Njumamothi'], + 'weekdays_short' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], + 'weekdays_min' => ['KMA', 'NTT', 'NMN', 'NMT', 'ART', 'NMA', 'NMM'], + 'months' => ['Njenuarĩ', 'Mwere wa kerĩ', 'Mwere wa gatatũ', 'Mwere wa kana', 'Mwere wa gatano', 'Mwere wa gatandatũ', 'Mwere wa mũgwanja', 'Mwere wa kanana', 'Mwere wa kenda', 'Mwere wa ikũmi', 'Mwere wa ikũmi na ũmwe', 'Ndithemba'], + 'months_short' => ['JEN', 'WKR', 'WGT', 'WKN', 'WTN', 'WTD', 'WMJ', 'WNN', 'WKD', 'WIK', 'WMW', 'DIT'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => ':count mĩaka', // less reliable + 'y' => ':count mĩaka', // less reliable + 'a_year' => ':count mĩaka', // less reliable + + 'month' => ':count mweri', // less reliable + 'm' => ':count mweri', // less reliable + 'a_month' => ':count mweri', // less reliable + + 'week' => ':count kiumia', // less reliable + 'w' => ':count kiumia', // less reliable + 'a_week' => ':count kiumia', // less reliable + + 'day' => ':count mũthenya', // less reliable + 'd' => ':count mũthenya', // less reliable + 'a_day' => ':count mũthenya', // less reliable + + 'hour' => ':count thaa', // less reliable + 'h' => ':count thaa', // less reliable + 'a_hour' => ':count thaa', // less reliable + + 'minute' => ':count mundu', // less reliable + 'min' => ':count mundu', // less reliable + 'a_minute' => ':count mundu', // less reliable + + 'second' => ':count igego', // less reliable + 's' => ':count igego', // less reliable + 'a_second' => ':count igego', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk.php new file mode 100644 index 00000000..23452dd2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - Talat Uspanov + * - Нурлан Рахимжанов + * - Toleugazy Kali + */ +return [ + 'year' => ':count жыл', + 'a_year' => '{1}бір жыл|:count жыл', + 'y' => ':count ж.', + 'month' => ':count ай', + 'a_month' => '{1}бір ай|:count ай', + 'm' => ':count ай', + 'week' => ':count апта', + 'a_week' => '{1}бір апта', + 'w' => ':count ап.', + 'day' => ':count күн', + 'a_day' => '{1}бір күн|:count күн', + 'd' => ':count к.', + 'hour' => ':count сағат', + 'a_hour' => '{1}бір сағат|:count сағат', + 'h' => ':count са.', + 'minute' => ':count минут', + 'a_minute' => '{1}бір минут|:count минут', + 'min' => ':count м.', + 'second' => ':count секунд', + 'a_second' => '{1}бірнеше секунд|:count секунд', + 's' => ':count се.', + 'ago' => ':time бұрын', + 'from_now' => ':time ішінде', + 'after' => ':time кейін', + 'before' => ':time бұрын', + 'diff_now' => 'қазір', + 'diff_today' => 'Бүгін', + 'diff_today_regexp' => 'Бүгін(?:\\s+сағат)?', + 'diff_yesterday' => 'кеше', + 'diff_yesterday_regexp' => 'Кеше(?:\\s+сағат)?', + 'diff_tomorrow' => 'ертең', + 'diff_tomorrow_regexp' => 'Ертең(?:\\s+сағат)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Бүгін сағат] LT', + 'nextDay' => '[Ертең сағат] LT', + 'nextWeek' => 'dddd [сағат] LT', + 'lastDay' => '[Кеше сағат] LT', + 'lastWeek' => '[Өткен аптаның] dddd [сағат] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + static $suffixes = [ + 0 => '-ші', + 1 => '-ші', + 2 => '-ші', + 3 => '-ші', + 4 => '-ші', + 5 => '-ші', + 6 => '-шы', + 7 => '-ші', + 8 => '-ші', + 9 => '-шы', + 10 => '-шы', + 20 => '-шы', + 30 => '-шы', + 40 => '-шы', + 50 => '-ші', + 60 => '-шы', + 70 => '-ші', + 80 => '-ші', + 90 => '-шы', + 100 => '-ші', + ]; + + return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); + }, + 'months' => ['қаңтар', 'ақпан', 'наурыз', 'сәуір', 'мамыр', 'маусым', 'шілде', 'тамыз', 'қыркүйек', 'қазан', 'қараша', 'желтоқсан'], + 'months_short' => ['қаң', 'ақп', 'нау', 'сәу', 'мам', 'мау', 'шіл', 'там', 'қыр', 'қаз', 'қар', 'жел'], + 'weekdays' => ['жексенбі', 'дүйсенбі', 'сейсенбі', 'сәрсенбі', 'бейсенбі', 'жұма', 'сенбі'], + 'weekdays_short' => ['жек', 'дүй', 'сей', 'сәр', 'бей', 'жұм', 'сен'], + 'weekdays_min' => ['жк', 'дй', 'сй', 'ср', 'бй', 'жм', 'сн'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' және '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php new file mode 100644 index 00000000..7dc5ebcc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kk_KZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/kk.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php new file mode 100644 index 00000000..f4cdb67e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kkj.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl.php new file mode 100644 index 00000000..7329a075 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/kl_GL.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php new file mode 100644 index 00000000..64c4ae9c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kl_GL.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Danish Standards Association bug-glibc-locales@gnu.org + * - John Eyðstein Johannesen (mashema) + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd [d.] D. MMMM YYYY [kl.] HH:mm', + ], + 'months' => ['januaarip', 'februaarip', 'marsip', 'apriilip', 'maajip', 'juunip', 'juulip', 'aggustip', 'septembarip', 'oktobarip', 'novembarip', 'decembarip'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['sapaat', 'ataasinngorneq', 'marlunngorneq', 'pingasunngorneq', 'sisamanngorneq', 'tallimanngorneq', 'arfininngorneq'], + 'weekdays_short' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], + 'weekdays_min' => ['sap', 'ata', 'mar', 'pin', 'sis', 'tal', 'arf'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => '{1}ukioq :count|{0}:count ukiut|[-Inf,Inf]ukiut :count', + 'a_year' => '{1}ukioq|{0}:count ukiut|[-Inf,Inf]ukiut :count', + 'y' => '{1}:countyr|{0}:countyrs|[-Inf,Inf]:countyrs', + + 'month' => '{1}qaammat :count|{0}:count qaammatit|[-Inf,Inf]qaammatit :count', + 'a_month' => '{1}qaammat|{0}:count qaammatit|[-Inf,Inf]qaammatit :count', + 'm' => '{1}:countmo|{0}:countmos|[-Inf,Inf]:countmos', + + 'week' => '{1}:count sap. ak.|{0}:count sap. ak.|[-Inf,Inf]:count sap. ak.', + 'a_week' => '{1}a sap. ak.|{0}:count sap. ak.|[-Inf,Inf]:count sap. ak.', + 'w' => ':countw', + + 'day' => '{1}:count ulloq|{0}:count ullut|[-Inf,Inf]:count ullut', + 'a_day' => '{1}a ulloq|{0}:count ullut|[-Inf,Inf]:count ullut', + 'd' => ':countd', + + 'hour' => '{1}:count tiimi|{0}:count tiimit|[-Inf,Inf]:count tiimit', + 'a_hour' => '{1}tiimi|{0}:count tiimit|[-Inf,Inf]:count tiimit', + 'h' => ':counth', + + 'minute' => '{1}:count minutsi|{0}:count minutsit|[-Inf,Inf]:count minutsit', + 'a_minute' => '{1}a minutsi|{0}:count minutsit|[-Inf,Inf]:count minutsit', + 'min' => ':countm', + + 'second' => '{1}:count sikunti|{0}:count sikuntit|[-Inf,Inf]:count sikuntit', + 'a_second' => '{1}sikunti|{0}:count sikuntit|[-Inf,Inf]:count sikuntit', + 's' => ':counts', + + 'ago' => ':time matuma siorna', + +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kln.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kln.php new file mode 100644 index 00000000..de3f44fc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kln.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['krn', 'koosk'], + 'weekdays' => ['Kotisap', 'Kotaai', 'Koaeng’', 'Kosomok', 'Koang’wan', 'Komuut', 'Kolo'], + 'weekdays_short' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], + 'weekdays_min' => ['Kts', 'Kot', 'Koo', 'Kos', 'Koa', 'Kom', 'Kol'], + 'months' => ['Mulgul', 'Ng’atyaato', 'Kiptaamo', 'Iwootkuut', 'Mamuut', 'Paagi', 'Ng’eiyeet', 'Rooptui', 'Bureet', 'Epeeso', 'Kipsuunde ne taai', 'Kipsuunde nebo aeng’'], + 'months_short' => ['Mul', 'Ngat', 'Taa', 'Iwo', 'Mam', 'Paa', 'Nge', 'Roo', 'Bur', 'Epe', 'Kpt', 'Kpa'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => ':count maghatiat', // less reliable + 'y' => ':count maghatiat', // less reliable + 'a_year' => ':count maghatiat', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km.php new file mode 100644 index 00000000..570703e2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kruy Vanna + * - Sereysethy Touch + * - JD Isaacks + * - Sovichet Tep + */ +return [ + 'year' => ':count ឆ្នាំ', + 'a_year' => '{1}មួយឆ្នាំ|[-Inf,Inf]:count ឆ្នាំ', + 'y' => ':count ឆ្នាំ', + 'month' => ':count ខែ', + 'a_month' => '{1}មួយខែ|[-Inf,Inf]:count ខែ', + 'm' => ':count ខែ', + 'week' => ':count សប្តាហ៍', + 'w' => ':count សប្តាហ៍', + 'day' => ':count ថ្ងៃ', + 'a_day' => '{1}មួយថ្ងៃ|[-Inf,Inf]:count ថ្ងៃ', + 'd' => ':count ថ្ងៃ', + 'hour' => ':count ម៉ោង', + 'a_hour' => '{1}មួយម៉ោង|[-Inf,Inf]:count ម៉ោង', + 'h' => ':count ម៉ោង', + 'minute' => ':count នាទី', + 'a_minute' => '{1}មួយនាទី|[-Inf,Inf]:count នាទី', + 'min' => ':count នាទី', + 'second' => ':count វិនាទី', + 'a_second' => '{0,1}ប៉ុន្មានវិនាទី|[-Inf,Inf]:count វិនាទី', + 's' => ':count វិនាទី', + 'ago' => ':timeមុន', + 'from_now' => ':timeទៀត', + 'after' => 'នៅ​ក្រោយ :time', + 'before' => 'នៅ​មុន :time', + 'diff_now' => 'ឥឡូវ', + 'diff_today' => 'ថ្ងៃនេះ', + 'diff_today_regexp' => 'ថ្ងៃនេះ(?:\\s+ម៉ោង)?', + 'diff_yesterday' => 'ម្សិលមិញ', + 'diff_yesterday_regexp' => 'ម្សិលមិញ(?:\\s+ម៉ោង)?', + 'diff_tomorrow' => 'ថ្ងៃ​ស្អែក', + 'diff_tomorrow_regexp' => 'ស្អែក(?:\\s+ម៉ោង)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[ថ្ងៃនេះ ម៉ោង] LT', + 'nextDay' => '[ស្អែក ម៉ោង] LT', + 'nextWeek' => 'dddd [ម៉ោង] LT', + 'lastDay' => '[ម្សិលមិញ ម៉ោង] LT', + 'lastWeek' => 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', + 'sameElse' => 'L', + ], + 'ordinal' => 'ទី:number', + 'meridiem' => ['ព្រឹក', 'ល្ងាច'], + 'months' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], + 'months_short' => ['មករា', 'កុម្ភៈ', 'មីនា', 'មេសា', 'ឧសភា', 'មិថុនា', 'កក្កដា', 'សីហា', 'កញ្ញា', 'តុលា', 'វិច្ឆិកា', 'ធ្នូ'], + 'weekdays' => ['អាទិត្យ', 'ច័ន្ទ', 'អង្គារ', 'ពុធ', 'ព្រហស្បតិ៍', 'សុក្រ', 'សៅរ៍'], + 'weekdays_short' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], + 'weekdays_min' => ['អា', 'ច', 'អ', 'ព', 'ព្រ', 'សុ', 'ស'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', 'និង '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php new file mode 100644 index 00000000..92e5fdbd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/km_KH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/km.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn.php new file mode 100644 index 00000000..51660e57 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - MOHAN M U + * - François B + * - rajeevnaikte + */ +return [ + 'year' => '{1}:count ವರ್ಷ|[-Inf,Inf]:count ವರ್ಷಗಳು', + 'a_year' => '{1}ಒಂದು ವರ್ಷ|[-Inf,Inf]:count ವರ್ಷಗಳು', + 'month' => ':count ತಿಂಗಳು', + 'a_month' => '{1}ಒಂದು ತಿಂಗಳು|[-Inf,Inf]:count ತಿಂಗಳು', + 'week' => '{1}:count ವಾರ|[-Inf,Inf]:count ವಾರಗಳು', + 'a_week' => '{1}ಒಂದು ವಾರ|[-Inf,Inf]:count ವಾರಗಳು', + 'day' => '{1}:count ದಿನ|[-Inf,Inf]:count ದಿನಗಳು', + 'a_day' => '{1}ಒಂದು ದಿನ|[-Inf,Inf]:count ದಿನಗಳು', + 'hour' => '{1}:count ಗಂಟೆ|[-Inf,Inf]:count ಗಂಟೆಗಳು', + 'a_hour' => '{1}ಒಂದು ಗಂಟೆ|[-Inf,Inf]:count ಗಂಟೆಗಳು', + 'minute' => '{1}:count ನಿಮಿಷ|[-Inf,Inf]:count ನಿಮಿಷಗಳು', + 'a_minute' => '{1}ಒಂದು ನಿಮಿಷ|[-Inf,Inf]:count ನಿಮಿಷಗಳು', + 'second' => '{0,1}:count ಸೆಕೆಂಡ್|[-Inf,Inf]:count ಸೆಕೆಂಡುಗಳು', + 'a_second' => '{0,1}ಕೆಲವು ಕ್ಷಣಗಳು|[-Inf,Inf]:count ಸೆಕೆಂಡುಗಳು', + 'ago' => ':time ಹಿಂದೆ', + 'from_now' => ':time ನಂತರ', + 'diff_now' => 'ಈಗ', + 'diff_today' => 'ಇಂದು', + 'diff_yesterday' => 'ನಿನ್ನೆ', + 'diff_tomorrow' => 'ನಾಳೆ', + 'formats' => [ + 'LT' => 'A h:mm', + 'LTS' => 'A h:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', + ], + 'calendar' => [ + 'sameDay' => '[ಇಂದು] LT', + 'nextDay' => '[ನಾಳೆ] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[ನಿನ್ನೆ] LT', + 'lastWeek' => '[ಕೊನೆಯ] dddd, LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberನೇ', + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'ರಾತ್ರಿ'; + } + if ($hour < 10) { + return 'ಬೆಳಿಗ್ಗೆ'; + } + if ($hour < 17) { + return 'ಮಧ್ಯಾಹ್ನ'; + } + if ($hour < 20) { + return 'ಸಂಜೆ'; + } + + return 'ರಾತ್ರಿ'; + }, + 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], + 'months_short' => ['ಜನ', 'ಫೆಬ್ರ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂ', 'ಅಕ್ಟೋ', 'ನವೆಂ', 'ಡಿಸೆಂ'], + 'weekdays' => ['ಭಾನುವಾರ', 'ಸೋಮವಾರ', 'ಮಂಗಳವಾರ', 'ಬುಧವಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರವಾರ', 'ಶನಿವಾರ'], + 'weekdays_short' => ['ಭಾನು', 'ಸೋಮ', 'ಮಂಗಳ', 'ಬುಧ', 'ಗುರು', 'ಶುಕ್ರ', 'ಶನಿ'], + 'weekdays_min' => ['ಭಾ', 'ಸೋ', 'ಮಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], + 'list' => ', ', + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php new file mode 100644 index 00000000..30e3d886 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kn_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/kn.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko.php new file mode 100644 index 00000000..8581b716 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - FourwingsY + * - François B + * - Jason Katz-Brown + * - Seokjun Kim + * - Junho Kim + * - JD Isaacks + * - Juwon Kim + */ +return [ + 'year' => ':count년', + 'a_year' => '{1}일년|[-Inf,Inf]:count년', + 'y' => ':count년', + 'month' => ':count개월', + 'a_month' => '{1}한달|[-Inf,Inf]:count개월', + 'm' => ':count개월', + 'week' => ':count주', + 'a_week' => '{1}일주일|[-Inf,Inf]:count 주', + 'w' => ':count주일', + 'day' => ':count일', + 'a_day' => '{1}하루|[-Inf,Inf]:count일', + 'd' => ':count일', + 'hour' => ':count시간', + 'a_hour' => '{1}한시간|[-Inf,Inf]:count시간', + 'h' => ':count시간', + 'minute' => ':count분', + 'a_minute' => '{1}일분|[-Inf,Inf]:count분', + 'min' => ':count분', + 'second' => ':count초', + 'a_second' => '{1}몇초|[-Inf,Inf]:count초', + 's' => ':count초', + 'ago' => ':time 전', + 'from_now' => ':time 후', + 'after' => ':time 후', + 'before' => ':time 전', + 'diff_now' => '지금', + 'diff_today' => '오늘', + 'diff_yesterday' => '어제', + 'diff_tomorrow' => '내일', + 'formats' => [ + 'LT' => 'A h:mm', + 'LTS' => 'A h:mm:ss', + 'L' => 'YYYY.MM.DD.', + 'LL' => 'YYYY년 MMMM D일', + 'LLL' => 'YYYY년 MMMM D일 A h:mm', + 'LLLL' => 'YYYY년 MMMM D일 dddd A h:mm', + ], + 'calendar' => [ + 'sameDay' => '오늘 LT', + 'nextDay' => '내일 LT', + 'nextWeek' => 'dddd LT', + 'lastDay' => '어제 LT', + 'lastWeek' => '지난주 dddd LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'd', 'D', 'DDD' => $number.'일', + 'M' => $number.'월', + 'w', 'W' => $number.'주', + default => $number, + }; + }, + 'meridiem' => ['오전', '오후'], + 'months' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + 'months_short' => ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], + 'weekdays' => ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'], + 'weekdays_short' => ['일', '월', '화', '수', '목', '금', '토'], + 'weekdays_min' => ['일', '월', '화', '수', '목', '금', '토'], + 'list' => ' ', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php new file mode 100644 index 00000000..4ba802b3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KP.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ko.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php new file mode 100644 index 00000000..9d873a27 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ko_KR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ko.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok.php new file mode 100644 index 00000000..4adcddcc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/kok_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php new file mode 100644 index 00000000..c6110d59 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kok_IN.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D-M-YY', + ], + 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], + 'months_short' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ओगस्ट', 'सेप्टेंबर', 'ओक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], + 'weekdays' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], + 'weekdays_short' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], + 'weekdays_min' => ['आयतार', 'सोमार', 'मंगळवार', 'बुधवार', 'बेरेसतार', 'शुकरार', 'शेनवार'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['म.पू.', 'म.नं.'], + + 'year' => ':count वैशाकु', // less reliable + 'y' => ':count वैशाकु', // less reliable + 'a_year' => ':count वैशाकु', // less reliable + + 'week' => ':count आदित्यवार', // less reliable + 'w' => ':count आदित्यवार', // less reliable + 'a_week' => ':count आदित्यवार', // less reliable + + 'minute' => ':count नोंद', // less reliable + 'min' => ':count नोंद', // less reliable + 'a_minute' => ':count नोंद', // less reliable + + 'second' => ':count तेंको', // less reliable + 's' => ':count तेंको', // less reliable + 'a_second' => ':count तेंको', // less reliable + + 'month' => ':count मैनो', + 'm' => ':count मैनो', + 'a_month' => ':count मैनो', + + 'day' => ':count दिवसु', + 'd' => ':count दिवसु', + 'a_day' => ':count दिवसु', + + 'hour' => ':count घंते', + 'h' => ':count घंते', + 'a_hour' => ':count घंते', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks.php new file mode 100644 index 00000000..98760790 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ks_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php new file mode 100644 index 00000000..4ec598fd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'M/D/YY', + ], + 'months' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنؤری', 'فرؤری', 'مارٕچ', 'اپریل', 'میٔ', 'جوٗن', 'جوٗلایی', 'اگست', 'ستمبر', 'اکتوٗبر', 'نومبر', 'دسمبر'], + 'weekdays' => ['آتهوار', 'ژءندروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], + 'weekdays_short' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], + 'weekdays_min' => ['آتهوار', 'ژءنتروار', 'بوءںوار', 'بودهوار', 'برىسوار', 'جمع', 'بٹوار'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['دوپھربرونھ', 'دوپھرپتھ'], + + 'year' => ':count آب', // less reliable + 'y' => ':count آب', // less reliable + 'a_year' => ':count آب', // less reliable + + 'month' => ':count रान्', // less reliable + 'm' => ':count रान्', // less reliable + 'a_month' => ':count रान्', // less reliable + + 'week' => ':count آتھٕوار', // less reliable + 'w' => ':count آتھٕوار', // less reliable + 'a_week' => ':count آتھٕوار', // less reliable + + 'hour' => ':count سۄن', // less reliable + 'h' => ':count سۄن', // less reliable + 'a_hour' => ':count سۄن', // less reliable + + 'minute' => ':count فَن', // less reliable + 'min' => ':count فَن', // less reliable + 'a_minute' => ':count فَن', // less reliable + + 'second' => ':count दोʼयुम', // less reliable + 's' => ':count दोʼयुम', // less reliable + 'a_second' => ':count दोʼयुम', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php new file mode 100644 index 00000000..0708f3ff --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ks_IN@devanagari.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - ks-gnome-trans-commits@lists.code.indlinux.net + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'M/D/YY', + ], + 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'weekdays' => ['आथवार', 'चॅ़दुरवार', 'बोमवार', 'ब्वदवार', 'ब्रसवार', 'शोकुरवार', 'बटुवार'], + 'weekdays_short' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], + 'weekdays_min' => ['आथ ', 'चॅ़दुर', 'बोम', 'ब्वद', 'ब्रस', 'शोकुर', 'बटु'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php new file mode 100644 index 00000000..aaa00614 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksb.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['makeo', 'nyiaghuo'], + 'weekdays' => ['Jumaapii', 'Jumaatatu', 'Jumaane', 'Jumaatano', 'Alhamisi', 'Ijumaa', 'Jumaamosi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jmn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Januali', 'Febluali', 'Machi', 'Aplili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php new file mode 100644 index 00000000..84a59672 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksf.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['sárúwá', 'cɛɛ́nko'], + 'weekdays' => ['sɔ́ndǝ', 'lǝndí', 'maadí', 'mɛkrɛdí', 'jǝǝdí', 'júmbá', 'samdí'], + 'weekdays_short' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], + 'weekdays_min' => ['sɔ́n', 'lǝn', 'maa', 'mɛk', 'jǝǝ', 'júm', 'sam'], + 'months' => ['ŋwíí a ntɔ́ntɔ', 'ŋwíí akǝ bɛ́ɛ', 'ŋwíí akǝ ráá', 'ŋwíí akǝ nin', 'ŋwíí akǝ táan', 'ŋwíí akǝ táafɔk', 'ŋwíí akǝ táabɛɛ', 'ŋwíí akǝ táaraa', 'ŋwíí akǝ táanin', 'ŋwíí akǝ ntɛk', 'ŋwíí akǝ ntɛk di bɔ́k', 'ŋwíí akǝ ntɛk di bɛ́ɛ'], + 'months_short' => ['ŋ1', 'ŋ2', 'ŋ3', 'ŋ4', 'ŋ5', 'ŋ6', 'ŋ7', 'ŋ8', 'ŋ9', 'ŋ10', 'ŋ11', 'ŋ12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php new file mode 100644 index 00000000..95457e24 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ksh.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['v.M.', 'n.M.'], + 'weekdays' => ['Sunndaach', 'Mohndaach', 'Dinnsdaach', 'Metwoch', 'Dunnersdaach', 'Friidaach', 'Samsdaach'], + 'weekdays_short' => ['Su.', 'Mo.', 'Di.', 'Me.', 'Du.', 'Fr.', 'Sa.'], + 'weekdays_min' => ['Su', 'Mo', 'Di', 'Me', 'Du', 'Fr', 'Sa'], + 'months' => ['Jannewa', 'Fäbrowa', 'Määz', 'Aprell', 'Mai', 'Juuni', 'Juuli', 'Oujoß', 'Septämber', 'Oktohber', 'Novämber', 'Dezämber'], + 'months_short' => ['Jan', 'Fäb', 'Mäz', 'Apr', 'Mai', 'Jun', 'Jul', 'Ouj', 'Säp', 'Okt', 'Nov', 'Dez'], + 'months_short_standalone' => ['Jan.', 'Fäb.', 'Mäz.', 'Apr.', 'Mai', 'Jun.', 'Jul.', 'Ouj.', 'Säp.', 'Okt.', 'Nov.', 'Dez.'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D. M. YYYY', + 'LL' => 'D. MMM. YYYY', + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd, [dä] D. MMMM YYYY HH:mm', + ], + + 'year' => ':count Johr', + 'y' => ':count Johr', + 'a_year' => ':count Johr', + + 'month' => ':count Moohnd', + 'm' => ':count Moohnd', + 'a_month' => ':count Moohnd', + + 'week' => ':count woch', + 'w' => ':count woch', + 'a_week' => ':count woch', + + 'day' => ':count Daach', + 'd' => ':count Daach', + 'a_day' => ':count Daach', + + 'hour' => ':count Uhr', + 'h' => ':count Uhr', + 'a_hour' => ':count Uhr', + + 'minute' => ':count Menutt', + 'min' => ':count Menutt', + 'a_minute' => ':count Menutt', + + 'second' => ':count Sekůndt', + 's' => ':count Sekůndt', + 'a_second' => ':count Sekůndt', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku.php new file mode 100644 index 00000000..074b0760 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Unicode, Inc. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'ago' => 'berî :time', + 'from_now' => 'di :time de', + 'after' => ':time piştî', + 'before' => ':time berê', + 'year' => ':count sal', + 'a_year' => ':count sal', + 'y' => ':count sal', + 'year_ago' => ':count salê|:count salan', + 'y_ago' => ':count salê|:count salan', + 'year_from_now' => 'salekê|:count salan', + 'y_from_now' => 'salekê|:count salan', + 'month' => ':count meh', + 'a_month' => ':count meh', + 'm' => ':count meh', + 'week' => ':count hefte', + 'a_week' => ':count hefte', + 'w' => ':count hefte', + 'day' => ':count roj', + 'a_day' => ':count roj', + 'd' => ':count roj', + 'hour' => ':count saet', + 'a_hour' => ':count saet', + 'h' => ':count saet', + 'minute' => ':count deqîqe', + 'a_minute' => ':count deqîqe', + 'min' => ':count deqîqe', + 'second' => ':count saniye', + 'a_second' => ':count saniye', + 's' => ':count saniye', + 'months' => ['rêbendanê', 'reşemiyê', 'adarê', 'avrêlê', 'gulanê', 'pûşperê', 'tîrmehê', 'gelawêjê', 'rezberê', 'kewçêrê', 'sermawezê', 'berfanbarê'], + 'months_standalone' => ['rêbendan', 'reşemî', 'adar', 'avrêl', 'gulan', 'pûşper', 'tîrmeh', 'gelawêj', 'rezber', 'kewçêr', 'sermawez', 'berfanbar'], + 'months_short' => ['rêb', 'reş', 'ada', 'avr', 'gul', 'pûş', 'tîr', 'gel', 'rez', 'kew', 'ser', 'ber'], + 'weekdays' => ['yekşem', 'duşem', 'sêşem', 'çarşem', 'pêncşem', 'în', 'şemî'], + 'weekdays_short' => ['yş', 'dş', 'sş', 'çş', 'pş', 'în', 'ş'], + 'weekdays_min' => ['Y', 'D', 'S', 'Ç', 'P', 'Î', 'Ş'], + 'list' => [', ', ' û '], + 'ordinal' => ':number', + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php new file mode 100644 index 00000000..4243a82f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ku_TR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ku.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw.php new file mode 100644 index 00000000..26e242e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/kw_GB.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php new file mode 100644 index 00000000..00bf52bd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/kw_GB.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Alastair McKinstry bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['mis Genver', 'mis Hwevrer', 'mis Meurth', 'mis Ebrel', 'mis Me', 'mis Metheven', 'mis Gortheren', 'mis Est', 'mis Gwynngala', 'mis Hedra', 'mis Du', 'mis Kevardhu'], + 'months_short' => ['Gen', 'Hwe', 'Meu', 'Ebr', 'Me', 'Met', 'Gor', 'Est', 'Gwn', 'Hed', 'Du', 'Kev'], + 'weekdays' => ['De Sul', 'De Lun', 'De Merth', 'De Merher', 'De Yow', 'De Gwener', 'De Sadorn'], + 'weekdays_short' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], + 'weekdays_min' => ['Sul', 'Lun', 'Mth', 'Mhr', 'Yow', 'Gwe', 'Sad'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count bledhen', + 'y' => ':count bledhen', + 'a_year' => ':count bledhen', + + 'month' => ':count mis', + 'm' => ':count mis', + 'a_month' => ':count mis', + + 'week' => ':count seythen', + 'w' => ':count seythen', + 'a_week' => ':count seythen', + + 'day' => ':count dydh', + 'd' => ':count dydh', + 'a_day' => ':count dydh', + + 'hour' => ':count eur', + 'h' => ':count eur', + 'a_hour' => ':count eur', + + 'minute' => ':count mynysen', + 'min' => ':count mynysen', + 'a_minute' => ':count mynysen', + + 'second' => ':count pryjwyth', + 's' => ':count pryjwyth', + 'a_second' => ':count pryjwyth', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky.php new file mode 100644 index 00000000..2cb85039 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - acutexyz + * - Josh Soref + * - François B + * - Chyngyz Arystan uulu + * - Chyngyz + * - acutexyz + * - Josh Soref + * - François B + * - Chyngyz Arystan uulu + */ +return [ + 'year' => ':count жыл', + 'a_year' => '{1}бир жыл|:count жыл', + 'y' => ':count жыл', + 'month' => ':count ай', + 'a_month' => '{1}бир ай|:count ай', + 'm' => ':count ай', + 'week' => ':count апта', + 'a_week' => '{1}бир апта|:count апта', + 'w' => ':count апт.', + 'day' => ':count күн', + 'a_day' => '{1}бир күн|:count күн', + 'd' => ':count күн', + 'hour' => ':count саат', + 'a_hour' => '{1}бир саат|:count саат', + 'h' => ':count саат.', + 'minute' => ':count мүнөт', + 'a_minute' => '{1}бир мүнөт|:count мүнөт', + 'min' => ':count мүн.', + 'second' => ':count секунд', + 'a_second' => '{1}бирнече секунд|:count секунд', + 's' => ':count сек.', + 'ago' => ':time мурун', + 'from_now' => ':time ичинде', + 'diff_now' => 'азыр', + 'diff_today' => 'Бүгүн', + 'diff_today_regexp' => 'Бүгүн(?:\\s+саат)?', + 'diff_yesterday' => 'кечээ', + 'diff_yesterday_regexp' => 'Кече(?:\\s+саат)?', + 'diff_tomorrow' => 'эртең', + 'diff_tomorrow_regexp' => 'Эртең(?:\\s+саат)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Бүгүн саат] LT', + 'nextDay' => '[Эртең саат] LT', + 'nextWeek' => 'dddd [саат] LT', + 'lastDay' => '[Кече саат] LT', + 'lastWeek' => '[Өткен аптанын] dddd [күнү] [саат] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + static $suffixes = [ + 0 => '-чү', + 1 => '-чи', + 2 => '-чи', + 3 => '-чү', + 4 => '-чү', + 5 => '-чи', + 6 => '-чы', + 7 => '-чи', + 8 => '-чи', + 9 => '-чу', + 10 => '-чу', + 20 => '-чы', + 30 => '-чу', + 40 => '-чы', + 50 => '-чү', + 60 => '-чы', + 70 => '-чи', + 80 => '-чи', + 90 => '-чу', + 100 => '-чү', + ]; + + return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); + }, + 'months' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], + 'months_short' => ['янв', 'фев', 'март', 'апр', 'май', 'июнь', 'июль', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'weekdays' => ['Жекшемби', 'Дүйшөмбү', 'Шейшемби', 'Шаршемби', 'Бейшемби', 'Жума', 'Ишемби'], + 'weekdays_short' => ['Жек', 'Дүй', 'Шей', 'Шар', 'Бей', 'Жум', 'Ише'], + 'weekdays_min' => ['Жк', 'Дй', 'Шй', 'Шр', 'Бй', 'Жм', 'Иш'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => ' ', + 'meridiem' => ['таңкы', 'түштөн кийинки'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php new file mode 100644 index 00000000..9923a31e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ky_KG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ky.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lag.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lag.php new file mode 100644 index 00000000..f3f57f6a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lag.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['TOO', 'MUU'], + 'weekdays' => ['Jumapíiri', 'Jumatátu', 'Jumaíne', 'Jumatáano', 'Alamíisi', 'Ijumáa', 'Jumamóosi'], + 'weekdays_short' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], + 'weekdays_min' => ['Píili', 'Táatu', 'Íne', 'Táano', 'Alh', 'Ijm', 'Móosi'], + 'months' => ['Kʉfúngatɨ', 'Kʉnaanɨ', 'Kʉkeenda', 'Kwiikumi', 'Kwiinyambála', 'Kwiidwaata', 'Kʉmʉʉnchɨ', 'Kʉvɨɨrɨ', 'Kʉsaatʉ', 'Kwiinyi', 'Kʉsaano', 'Kʉsasatʉ'], + 'months_short' => ['Fúngatɨ', 'Naanɨ', 'Keenda', 'Ikúmi', 'Inyambala', 'Idwaata', 'Mʉʉnchɨ', 'Vɨɨrɨ', 'Saatʉ', 'Inyi', 'Saano', 'Sasatʉ'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb.php new file mode 100644 index 00000000..72267b73 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - dan-nl + * - Simon Lelorrain (slelorrain) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count Joer', + 'y' => ':countJ', + 'month' => ':count Mount|:count Méint', + 'm' => ':countMo', + 'week' => ':count Woch|:count Wochen', + 'w' => ':countWo|:countWo', + 'day' => ':count Dag|:count Deeg', + 'd' => ':countD', + 'hour' => ':count Stonn|:count Stonnen', + 'h' => ':countSto', + 'minute' => ':count Minutt|:count Minutten', + 'min' => ':countM', + 'second' => ':count Sekonn|:count Sekonnen', + 's' => ':countSek', + + 'ago' => 'virun :time', + 'from_now' => 'an :time', + 'before' => ':time virdrun', + 'after' => ':time duerno', + + 'diff_today' => 'Haut', + 'diff_yesterday' => 'Gëschter', + 'diff_yesterday_regexp' => 'Gëschter(?:\\s+um)?', + 'diff_tomorrow' => 'Muer', + 'diff_tomorrow_regexp' => 'Muer(?:\\s+um)?', + 'diff_today_regexp' => 'Haut(?:\\s+um)?', + 'formats' => [ + 'LT' => 'H:mm [Auer]', + 'LTS' => 'H:mm:ss [Auer]', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm [Auer]', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm [Auer]', + ], + + 'calendar' => [ + 'sameDay' => '[Haut um] LT', + 'nextDay' => '[Muer um] LT', + 'nextWeek' => 'dddd [um] LT', + 'lastDay' => '[Gëschter um] LT', + 'lastWeek' => static function (CarbonInterface $date) { + // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule + return match ($date->dayOfWeek) { + 2, 4 => '[Leschten] dddd [um] LT', + default => '[Leschte] dddd [um] LT', + }; + }, + 'sameElse' => 'L', + ], + + 'months' => ['Januar', 'Februar', 'Mäerz', 'Abrëll', 'Mee', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + 'months_short' => ['Jan.', 'Febr.', 'Mrz.', 'Abr.', 'Mee', 'Jun.', 'Jul.', 'Aug.', 'Sept.', 'Okt.', 'Nov.', 'Dez.'], + 'weekdays' => ['Sonndeg', 'Méindeg', 'Dënschdeg', 'Mëttwoch', 'Donneschdeg', 'Freideg', 'Samschdeg'], + 'weekdays_short' => ['So.', 'Mé.', 'Dë.', 'Më.', 'Do.', 'Fr.', 'Sa.'], + 'weekdays_min' => ['So', 'Mé', 'Dë', 'Më', 'Do', 'Fr', 'Sa'], + 'ordinal' => ':number.', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' an '], + 'meridiem' => ['moies', 'mëttes'], + 'weekdays_short_standalone' => ['Son', 'Méi', 'Dën', 'Mët', 'Don', 'Fre', 'Sam'], + 'months_short_standalone' => ['Jan', 'Feb', 'Mäe', 'Abr', 'Mee', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php new file mode 100644 index 00000000..414bd4d0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lb_LU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/lb.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg.php new file mode 100644 index 00000000..48bc68be --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/lg_UG.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php new file mode 100644 index 00000000..aa022140 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lg_UG.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Akademe ya Luganda Kizito Birabwa kompyuta@kizito.uklinux.net + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], + 'weekdays' => ['Sabiiti', 'Balaza', 'Lwakubiri', 'Lwakusatu', 'Lwakuna', 'Lwakutaano', 'Lwamukaaga'], + 'weekdays_short' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], + 'weekdays_min' => ['Sab', 'Bal', 'Lw2', 'Lw3', 'Lw4', 'Lw5', 'Lw6'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'month' => ':count njuba', // less reliable + 'm' => ':count njuba', // less reliable + 'a_month' => ':count njuba', // less reliable + + 'year' => ':count mwaaka', + 'y' => ':count mwaaka', + 'a_year' => ':count mwaaka', + + 'week' => ':count sabbiiti', + 'w' => ':count sabbiiti', + 'a_week' => ':count sabbiiti', + + 'day' => ':count lunaku', + 'd' => ':count lunaku', + 'a_day' => ':count lunaku', + + 'hour' => 'saawa :count', + 'h' => 'saawa :count', + 'a_hour' => 'saawa :count', + + 'minute' => 'ddakiika :count', + 'min' => 'ddakiika :count', + 'a_minute' => 'ddakiika :count', + + 'second' => ':count kyʼokubiri', + 's' => ':count kyʼokubiri', + 'a_second' => ':count kyʼokubiri', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li.php new file mode 100644 index 00000000..86c3009e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/li_NL.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php new file mode 100644 index 00000000..6c5feb79 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/li_NL.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandriva.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['jannewarie', 'fibberwarie', 'miert', 'eprèl', 'meij', 'junie', 'julie', 'augustus', 'september', 'oktober', 'november', 'desember'], + 'months_short' => ['jan', 'fib', 'mie', 'epr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['zóndig', 'maondig', 'daensdig', 'goonsdig', 'dónderdig', 'vriedig', 'zaoterdig'], + 'weekdays_short' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], + 'weekdays_min' => ['zón', 'mao', 'dae', 'goo', 'dón', 'vri', 'zao'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'minute' => ':count momênt', // less reliable + 'min' => ':count momênt', // less reliable + 'a_minute' => ':count momênt', // less reliable + + 'year' => ':count jaor', + 'y' => ':count jaor', + 'a_year' => ':count jaor', + + 'month' => ':count maond', + 'm' => ':count maond', + 'a_month' => ':count maond', + + 'week' => ':count waek', + 'w' => ':count waek', + 'a_week' => ':count waek', + + 'day' => ':count daag', + 'd' => ':count daag', + 'a_day' => ':count daag', + + 'hour' => ':count oer', + 'h' => ':count oer', + 'a_hour' => ':count oer', + + 'second' => ':count Secónd', + 's' => ':count Secónd', + 'a_second' => ':count Secónd', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij.php new file mode 100644 index 00000000..45732b55 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/lij_IT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php new file mode 100644 index 00000000..f8726fd2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lij_IT.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Gastaldi alessio.gastaldi@libero.it + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['zenâ', 'fevrâ', 'marzo', 'avrî', 'mazzo', 'zûgno', 'lûggio', 'agosto', 'settembre', 'ottobre', 'novembre', 'dixembre'], + 'months_short' => ['zen', 'fev', 'mar', 'arv', 'maz', 'zûg', 'lûg', 'ago', 'set', 'ött', 'nov', 'dix'], + 'weekdays' => ['domenega', 'lûnedì', 'martedì', 'mercUrdì', 'zêggia', 'venardì', 'sabbo'], + 'weekdays_short' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], + 'weekdays_min' => ['dom', 'lûn', 'mar', 'mer', 'zêu', 'ven', 'sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count etæ', // less reliable + 'y' => ':count etæ', // less reliable + 'a_year' => ':count etæ', // less reliable + + 'month' => ':count meize', + 'm' => ':count meize', + 'a_month' => ':count meize', + + 'week' => ':count settemannha', + 'w' => ':count settemannha', + 'a_week' => ':count settemannha', + + 'day' => ':count giorno', + 'd' => ':count giorno', + 'a_day' => ':count giorno', + + 'hour' => ':count reléuio', // less reliable + 'h' => ':count reléuio', // less reliable + 'a_hour' => ':count reléuio', // less reliable + + 'minute' => ':count menûo', + 'min' => ':count menûo', + 'a_minute' => ':count menûo', + + 'second' => ':count segondo', + 's' => ':count segondo', + 'a_second' => ':count segondo', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php new file mode 100644 index 00000000..a5485fb3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lkt.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + + 'month' => ':count haŋwí', // less reliable + 'm' => ':count haŋwí', // less reliable + 'a_month' => ':count haŋwí', // less reliable + + 'week' => ':count šakówiŋ', // less reliable + 'w' => ':count šakówiŋ', // less reliable + 'a_week' => ':count šakówiŋ', // less reliable + + 'hour' => ':count maza škaŋškaŋ', // less reliable + 'h' => ':count maza škaŋškaŋ', // less reliable + 'a_hour' => ':count maza škaŋškaŋ', // less reliable + + 'minute' => ':count číkʼala', // less reliable + 'min' => ':count číkʼala', // less reliable + 'a_minute' => ':count číkʼala', // less reliable + + 'year' => ':count waníyetu', + 'y' => ':count waníyetu', + 'a_year' => ':count waníyetu', + + 'day' => ':count aŋpétu', + 'd' => ':count aŋpétu', + 'a_day' => ':count aŋpétu', + + 'second' => ':count icinuŋpa', + 's' => ':count icinuŋpa', + 'a_second' => ':count icinuŋpa', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln.php new file mode 100644 index 00000000..9d5c35dd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'months' => ['sánzá ya yambo', 'sánzá ya míbalé', 'sánzá ya mísáto', 'sánzá ya mínei', 'sánzá ya mítáno', 'sánzá ya motóbá', 'sánzá ya nsambo', 'sánzá ya mwambe', 'sánzá ya libwa', 'sánzá ya zómi', 'sánzá ya zómi na mɔ̌kɔ́', 'sánzá ya zómi na míbalé'], + 'months_short' => ['yan', 'fbl', 'msi', 'apl', 'mai', 'yun', 'yul', 'agt', 'stb', 'ɔtb', 'nvb', 'dsb'], + 'weekdays' => ['Lomíngo', 'Mosálá mɔ̌kɔ́', 'Misálá míbalé', 'Misálá mísáto', 'Misálá mínei', 'Misálá mítáno', 'Mpɔ́sɔ'], + 'weekdays_short' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], + 'weekdays_min' => ['m1.', 'm2.', 'm3.', 'm4.', 'm5.', 'm6.', 'm7.'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => 'mbula :count', + 'y' => 'mbula :count', + 'a_year' => 'mbula :count', + + 'month' => 'sánzá :count', + 'm' => 'sánzá :count', + 'a_month' => 'sánzá :count', + + 'week' => 'mpɔ́sɔ :count', + 'w' => 'mpɔ́sɔ :count', + 'a_week' => 'mpɔ́sɔ :count', + + 'day' => 'mokɔlɔ :count', + 'd' => 'mokɔlɔ :count', + 'a_day' => 'mokɔlɔ :count', + + 'hour' => 'ngonga :count', + 'h' => 'ngonga :count', + 'a_hour' => 'ngonga :count', + + 'minute' => 'miniti :count', + 'min' => 'miniti :count', + 'a_minute' => 'miniti :count', + + 'second' => 'segɔnde :count', + 's' => 'segɔnde :count', + 'a_second' => 'segɔnde :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php new file mode 100644 index 00000000..7fdb7f1b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_AO.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ln.php', [ + 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], + 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php new file mode 100644 index 00000000..13635fcc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CD.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ubuntu René Manassé GALEKWA renemanasse@gmail.com + */ +return require __DIR__.'/ln.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php new file mode 100644 index 00000000..7fdb7f1b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CF.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ln.php', [ + 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], + 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php new file mode 100644 index 00000000..7fdb7f1b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ln_CG.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ln.php', [ + 'weekdays' => ['eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi', 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'], + 'weekdays_short' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'weekdays_min' => ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'], + 'meridiem' => ['ntɔ́ngɔ́', 'mpókwa'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo.php new file mode 100644 index 00000000..a5cc0242 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - ryanhart2 + */ +return [ + 'year' => ':count ປີ', + 'y' => ':count ປີ', + 'month' => ':count ເດືອນ', + 'm' => ':count ດ. ', + 'week' => ':count ອາທິດ', + 'w' => ':count ອທ. ', + 'day' => ':count ມື້', + 'd' => ':count ມື້', + 'hour' => ':count ຊົ່ວໂມງ', + 'h' => ':count ຊມ. ', + 'minute' => ':count ນາທີ', + 'min' => ':count ນທ. ', + 'second' => ':count ວິນາທີ', + 'a_second' => '{0,1}ບໍ່ເທົ່າໃດວິນາທີ|[-Inf,Inf]:count ວິນາທີ', + 's' => ':count ວິ. ', + 'ago' => ':timeຜ່ານມາ', + 'from_now' => 'ອີກ :time', + 'diff_now' => 'ຕອນນີ້', + 'diff_today' => 'ມື້ນີ້ເວລາ', + 'diff_yesterday' => 'ມື້ວານນີ້ເວລາ', + 'diff_tomorrow' => 'ມື້ອື່ນເວລາ', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'ວັນdddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[ມື້ນີ້ເວລາ] LT', + 'nextDay' => '[ມື້ອື່ນເວລາ] LT', + 'nextWeek' => '[ວັນ]dddd[ໜ້າເວລາ] LT', + 'lastDay' => '[ມື້ວານນີ້ເວລາ] LT', + 'lastWeek' => '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', + 'sameElse' => 'L', + ], + 'ordinal' => 'ທີ່:number', + 'meridiem' => ['ຕອນເຊົ້າ', 'ຕອນແລງ'], + 'months' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], + 'months_short' => ['ມັງກອນ', 'ກຸມພາ', 'ມີນາ', 'ເມສາ', 'ພຶດສະພາ', 'ມິຖຸນາ', 'ກໍລະກົດ', 'ສິງຫາ', 'ກັນຍາ', 'ຕຸລາ', 'ພະຈິກ', 'ທັນວາ'], + 'weekdays' => ['ອາທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], + 'weekdays_short' => ['ທິດ', 'ຈັນ', 'ອັງຄານ', 'ພຸດ', 'ພະຫັດ', 'ສຸກ', 'ເສົາ'], + 'weekdays_min' => ['ທ', 'ຈ', 'ອຄ', 'ພ', 'ພຫ', 'ສກ', 'ສ'], + 'list' => [', ', 'ແລະ '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php new file mode 100644 index 00000000..9b7fd9bf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lo_LA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/lo.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php new file mode 100644 index 00000000..31cfc844 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + + 'minute' => ':count هنر', // less reliable + 'min' => ':count هنر', // less reliable + 'a_minute' => ':count هنر', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php new file mode 100644 index 00000000..1ae546b0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lrc_IQ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/lrc.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt.php new file mode 100644 index 00000000..2cfa7d84 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt.php @@ -0,0 +1,141 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - tjku + * - valdas406 + * - Justas Palumickas + * - Max Melentiev + * - Andrius Janauskas + * - Juanito Fatas + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Nicolás Hock Isaza + * - Laurynas Butkus + * - Sven Fuchs + * - Dominykas Tijūnaitis + * - Justinas Bolys + * - Ričardas + * - Kirill Chalkin + * - Rolandas + * - Justinas (Gamesh) + * - Sam Axe + */ +return [ + 'year' => ':count metai|:count metai|:count metų', + 'y' => ':count m.', + 'month' => ':count mėnuo|:count mėnesiai|:count mėnesį', + 'm' => ':count mėn.', + 'week' => ':count savaitė|:count savaitės|:count savaitę', + 'w' => ':count sav.', + 'day' => ':count diena|:count dienos|:count dienų', + 'd' => ':count d.', + 'hour' => ':count valanda|:count valandos|:count valandų', + 'h' => ':count val.', + 'minute' => ':count minutė|:count minutės|:count minutę', + 'min' => ':count min.', + 'second' => ':count sekundė|:count sekundės|:count sekundžių', + 's' => ':count sek.', + + 'year_ago' => ':count metus|:count metus|:count metų', + 'month_ago' => ':count mėnesį|:count mėnesius|:count mėnesių', + 'week_ago' => ':count savaitę|:count savaites|:count savaičių', + 'day_ago' => ':count dieną|:count dienas|:count dienų', + 'hour_ago' => ':count valandą|:count valandas|:count valandų', + 'minute_ago' => ':count minutę|:count minutes|:count minučių', + 'second_ago' => ':count sekundę|:count sekundes|:count sekundžių', + + 'year_from_now' => ':count metai|:count metai|:count metų', + 'month_from_now' => ':count mėnuo|:count mėnesiai|:count mėnesių', + 'week_from_now' => ':count savaitė|:count savaitės|:count savaičių', + 'day_from_now' => ':count diena|:count dienos|:count dienų', + 'hour_from_now' => ':count valanda|:count valandos|:count valandų', + 'minute_from_now' => ':count minutė|:count minutės|:count minučių', + 'second_from_now' => ':count sekundė|:count sekundės|:count sekundžių', + + 'year_after' => ':count metai|:count metai|:count metų', + 'month_after' => ':count mėnuo|:count mėnesiai|:count mėnesių', + 'week_after' => ':count savaitė|:count savaitės|:count savaičių', + 'day_after' => ':count diena|:count dienos|:count dienų', + 'hour_after' => ':count valanda|:count valandos|:count valandų', + 'minute_after' => ':count minutė|:count minutės|:count minučių', + 'second_after' => ':count sekundė|:count sekundės|:count sekundžių', + + 'year_before' => ':count metų', + 'month_before' => ':count mėnesio|:count mėnesių|:count mėnesių', + 'week_before' => ':count savaitės|:count savaičių|:count savaičių', + 'day_before' => ':count dienos|:count dienų|:count dienų', + 'hour_before' => ':count valandos|:count valandų|:count valandų', + 'minute_before' => ':count minutės|:count minučių|:count minučių', + 'second_before' => ':count sekundės|:count sekundžių|:count sekundžių', + + 'ago' => 'prieš :time', + 'from_now' => ':time nuo dabar', + 'after' => 'po :time', + 'before' => 'už :time', + + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'diff_now' => 'ką tik', + 'diff_today' => 'Šiandien', + 'diff_yesterday' => 'vakar', + 'diff_yesterday_regexp' => 'Vakar', + 'diff_tomorrow' => 'rytoj', + 'diff_tomorrow_regexp' => 'Rytoj', + 'diff_before_yesterday' => 'užvakar', + 'diff_after_tomorrow' => 'poryt', + + 'period_recurrences' => 'kartą|:count kartų', + 'period_interval' => 'kiekvieną :interval', + 'period_start_date' => 'nuo :date', + 'period_end_date' => 'iki :date', + + 'months' => ['sausio', 'vasario', 'kovo', 'balandžio', 'gegužės', 'birželio', 'liepos', 'rugpjūčio', 'rugsėjo', 'spalio', 'lapkričio', 'gruodžio'], + 'months_standalone' => ['sausis', 'vasaris', 'kovas', 'balandis', 'gegužė', 'birželis', 'liepa', 'rugpjūtis', 'rugsėjis', 'spalis', 'lapkritis', 'gruodis'], + 'months_regexp' => '/(L{2,4}|D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?)/', + 'months_short' => ['sau', 'vas', 'kov', 'bal', 'geg', 'bir', 'lie', 'rgp', 'rgs', 'spa', 'lap', 'gru'], + 'weekdays' => ['sekmadienį', 'pirmadienį', 'antradienį', 'trečiadienį', 'ketvirtadienį', 'penktadienį', 'šeštadienį'], + 'weekdays_standalone' => ['sekmadienis', 'pirmadienis', 'antradienis', 'trečiadienis', 'ketvirtadienis', 'penktadienis', 'šeštadienis'], + 'weekdays_short' => ['sek', 'pir', 'ant', 'tre', 'ket', 'pen', 'šeš'], + 'weekdays_min' => ['se', 'pi', 'an', 'tr', 'ke', 'pe', 'še'], + 'list' => [', ', ' ir '], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'MMMM DD, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Šiandien] LT', + 'nextDay' => '[Rytoj] LT', + 'nextWeek' => 'dddd LT', + 'lastDay' => '[Vakar] LT', + 'lastWeek' => '[Paskutinį] dddd LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + return match ($number) { + 0 => '0-is', + 3 => '3-ias', + default => "$number-as", + }; + }, + 'meridiem' => ['priešpiet', 'popiet'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php new file mode 100644 index 00000000..f772d38b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lt_LT.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/lt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lu.php new file mode 100644 index 00000000..c8cd83af --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lu.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Dinda', 'Dilolo'], + 'weekdays' => ['Lumingu', 'Nkodya', 'Ndàayà', 'Ndangù', 'Njòwa', 'Ngòvya', 'Lubingu'], + 'weekdays_short' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], + 'weekdays_min' => ['Lum', 'Nko', 'Ndy', 'Ndg', 'Njw', 'Ngv', 'Lub'], + 'months' => ['Ciongo', 'Lùishi', 'Lusòlo', 'Mùuyà', 'Lumùngùlù', 'Lufuimi', 'Kabàlàshìpù', 'Lùshìkà', 'Lutongolo', 'Lungùdi', 'Kaswèkèsè', 'Ciswà'], + 'months_short' => ['Cio', 'Lui', 'Lus', 'Muu', 'Lum', 'Luf', 'Kab', 'Lush', 'Lut', 'Lun', 'Kas', 'Cis'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luo.php new file mode 100644 index 00000000..5d6ec7c9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luo.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['OD', 'OT'], + 'weekdays' => ['Jumapil', 'Wuok Tich', 'Tich Ariyo', 'Tich Adek', 'Tich Ang’wen', 'Tich Abich', 'Ngeso'], + 'weekdays_short' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], + 'weekdays_min' => ['JMP', 'WUT', 'TAR', 'TAD', 'TAN', 'TAB', 'NGS'], + 'months' => ['Dwe mar Achiel', 'Dwe mar Ariyo', 'Dwe mar Adek', 'Dwe mar Ang’wen', 'Dwe mar Abich', 'Dwe mar Auchiel', 'Dwe mar Abiriyo', 'Dwe mar Aboro', 'Dwe mar Ochiko', 'Dwe mar Apar', 'Dwe mar gi achiel', 'Dwe mar Apar gi ariyo'], + 'months_short' => ['DAC', 'DAR', 'DAD', 'DAN', 'DAH', 'DAU', 'DAO', 'DAB', 'DOC', 'DAP', 'DGI', 'DAG'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => 'higni :count', + 'y' => 'higni :count', + 'a_year' => ':higni :count', + + 'month' => 'dweche :count', + 'm' => 'dweche :count', + 'a_month' => 'dweche :count', + + 'week' => 'jumbe :count', + 'w' => 'jumbe :count', + 'a_week' => 'jumbe :count', + + 'day' => 'ndalo :count', + 'd' => 'ndalo :count', + 'a_day' => 'ndalo :count', + + 'hour' => 'seche :count', + 'h' => 'seche :count', + 'a_hour' => 'seche :count', + + 'minute' => 'dakika :count', + 'min' => 'dakika :count', + 'a_minute' => 'dakika :count', + + 'second' => 'nus dakika :count', + 's' => 'nus dakika :count', + 'a_second' => 'nus dakika :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luy.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luy.php new file mode 100644 index 00000000..ab92e842 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/luy.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'weekdays' => ['Jumapiri', 'Jumatatu', 'Jumanne', 'Jumatano', 'Murwa wa Kanne', 'Murwa wa Katano', 'Jumamosi'], + 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], + 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + // Too unreliable + /* + 'year' => ':count liliino', // less reliable + 'y' => ':count liliino', // less reliable + 'a_year' => ':count liliino', // less reliable + + 'month' => ':count kumwesi', // less reliable + 'm' => ':count kumwesi', // less reliable + 'a_month' => ':count kumwesi', // less reliable + + 'week' => ':count olutambi', // less reliable + 'w' => ':count olutambi', // less reliable + 'a_week' => ':count olutambi', // less reliable + + 'day' => ':count luno', // less reliable + 'd' => ':count luno', // less reliable + 'a_day' => ':count luno', // less reliable + + 'hour' => ':count ekengele', // less reliable + 'h' => ':count ekengele', // less reliable + 'a_hour' => ':count ekengele', // less reliable + + 'minute' => ':count omundu', // less reliable + 'min' => ':count omundu', // less reliable + 'a_minute' => ':count omundu', // less reliable + + 'second' => ':count liliino', // less reliable + 's' => ':count liliino', // less reliable + 'a_second' => ':count liliino', // less reliable + */ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv.php new file mode 100644 index 00000000..6ff35512 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv.php @@ -0,0 +1,177 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Carbon\CarbonInterface; + +/** + * This file is part of the Carbon package. + * + * (c) Brian Nesbitt + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - pirminis + * - Tsutomu Kuroda + * - tjku + * - Andris Zāģeris + * - Max Melentiev + * - Edgars Beigarts + * - Juanito Fatas + * - Vitauts Stočka + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Kaspars Bankovskis + * - Nicolás Hock Isaza + * - Viesturs Kavacs (Kavacky) + * - zakse + * - Janis Eglitis (janiseglitis) + * - Guntars + * - Juris Sudmalis + */ +$daysOfWeek = ['svētdiena', 'pirmdiena', 'otrdiena', 'trešdiena', 'ceturtdiena', 'piektdiena', 'sestdiena']; +$daysOfWeekLocativum = ['svētdien', 'pirmdien', 'otrdien', 'trešdien', 'ceturtdien', 'piektdien', 'sestdien']; + +$transformDiff = static fn (string $input) => strtr($input, [ + // Nominative => "pirms/pēc" Dative + 'gads' => 'gada', + 'gadi' => 'gadiem', + 'gadu' => 'gadiem', + 'mēnesis' => 'mēneša', + 'mēneši' => 'mēnešiem', + 'mēnešu' => 'mēnešiem', + 'nedēļa' => 'nedēļas', + 'nedēļas' => 'nedēļām', + 'nedēļu' => 'nedēļām', + 'diena' => 'dienas', + 'dienas' => 'dienām', + 'dienu' => 'dienām', + 'stunda' => 'stundas', + 'stundas' => 'stundām', + 'stundu' => 'stundām', + 'minūte' => 'minūtes', + 'minūtes' => 'minūtēm', + 'minūšu' => 'minūtēm', + 'sekunde' => 'sekundes', + 'sekundes' => 'sekundēm', + 'sekunžu' => 'sekundēm', +]); + +return [ + 'ago' => static fn (string $time) => 'pirms '.$transformDiff($time), + 'from_now' => static fn (string $time) => 'pēc '.$transformDiff($time), + + 'year' => '0 gadu|:count gads|:count gadi', + 'y' => ':count g.', + 'a_year' => '{1}gads|0 gadu|:count gads|:count gadi', + 'month' => '0 mēnešu|:count mēnesis|:count mēneši', + 'm' => ':count mēn.', + 'a_month' => '{1}mēnesis|0 mēnešu|:count mēnesis|:count mēneši', + 'week' => '0 nedēļu|:count nedēļa|:count nedēļas', + 'w' => ':count ned.', + 'a_week' => '{1}nedēļa|0 nedēļu|:count nedēļa|:count nedēļas', + 'day' => '0 dienu|:count diena|:count dienas', + 'd' => ':count d.', + 'a_day' => '{1}diena|0 dienu|:count diena|:count dienas', + 'hour' => '0 stundu|:count stunda|:count stundas', + 'h' => ':count st.', + 'a_hour' => '{1}stunda|0 stundu|:count stunda|:count stundas', + 'minute' => '0 minūšu|:count minūte|:count minūtes', + 'min' => ':count min.', + 'a_minute' => '{1}minūte|0 minūšu|:count minūte|:count minūtes', + 'second' => '0 sekunžu|:count sekunde|:count sekundes', + 's' => ':count sek.', + 'a_second' => '{1}sekunde|0 sekunžu|:count sekunde|:count sekundes', + + 'after' => ':time vēlāk', + 'year_after' => '0 gadus|:count gadu|:count gadus', + 'a_year_after' => '{1}gadu|0 gadus|:count gadu|:count gadus', + 'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus', + 'a_month_after' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', + 'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas', + 'a_week_after' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', + 'day_after' => '0 dienas|:count dienu|:count dienas', + 'a_day_after' => '{1}dienu|0 dienas|:count dienu|:count dienas', + 'hour_after' => '0 stundas|:count stundu|:count stundas', + 'a_hour_after' => '{1}stundu|0 stundas|:count stundu|:count stundas', + 'minute_after' => '0 minūtes|:count minūti|:count minūtes', + 'a_minute_after' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', + 'second_after' => '0 sekundes|:count sekundi|:count sekundes', + 'a_second_after' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', + + 'before' => ':time agrāk', + 'year_before' => '0 gadus|:count gadu|:count gadus', + 'a_year_before' => '{1}gadu|0 gadus|:count gadu|:count gadus', + 'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus', + 'a_month_before' => '{1}mēnesi|0 mēnešus|:count mēnesi|:count mēnešus', + 'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas', + 'a_week_before' => '{1}nedēļu|0 nedēļas|:count nedēļu|:count nedēļas', + 'day_before' => '0 dienas|:count dienu|:count dienas', + 'a_day_before' => '{1}dienu|0 dienas|:count dienu|:count dienas', + 'hour_before' => '0 stundas|:count stundu|:count stundas', + 'a_hour_before' => '{1}stundu|0 stundas|:count stundu|:count stundas', + 'minute_before' => '0 minūtes|:count minūti|:count minūtes', + 'a_minute_before' => '{1}minūti|0 minūtes|:count minūti|:count minūtes', + 'second_before' => '0 sekundes|:count sekundi|:count sekundes', + 'a_second_before' => '{1}sekundi|0 sekundes|:count sekundi|:count sekundes', + + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' un '], + + 'diff_now' => 'tagad', + 'diff_today' => 'šodien', + 'diff_yesterday' => 'vakar', + 'diff_before_yesterday' => 'aizvakar', + 'diff_tomorrow' => 'rīt', + 'diff_after_tomorrow' => 'parīt', + + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY.', + 'LL' => 'YYYY. [gada] D. MMMM', + 'LLL' => 'DD.MM.YYYY., HH:mm', + 'LLLL' => 'YYYY. [gada] D. MMMM, HH:mm', + ], + + 'calendar' => [ + 'sameDay' => '[šodien] [plkst.] LT', + 'nextDay' => '[rīt] [plkst.] LT', + 'nextWeek' => static function (CarbonInterface $current, CarbonInterface $other) use ($daysOfWeekLocativum) { + if ($current->week !== $other->week) { + return '[nākošo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; + } + + return '['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; + }, + 'lastDay' => '[vakar] [plkst.] LT', + 'lastWeek' => static function (CarbonInterface $current) use ($daysOfWeekLocativum) { + return '[pagājušo] ['.$daysOfWeekLocativum[$current->dayOfWeek].'] [plkst.] LT'; + }, + 'sameElse' => 'L', + ], + + 'weekdays' => $daysOfWeek, + 'weekdays_short' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], + 'weekdays_min' => ['Sv.', 'P.', 'O.', 'T.', 'C.', 'Pk.', 'S.'], + 'months' => ['janvāris', 'februāris', 'marts', 'aprīlis', 'maijs', 'jūnijs', 'jūlijs', 'augusts', 'septembris', 'oktobris', 'novembris', 'decembris'], + 'months_standalone' => ['janvārī', 'februārī', 'martā', 'aprīlī', 'maijā', 'jūnijā', 'jūlijā', 'augustā', 'septembrī', 'oktobrī', 'novembrī', 'decembrī'], + 'months_short' => ['janv.', 'febr.', 'martā', 'apr.', 'maijā', 'jūn.', 'jūl.', 'aug.', 'sept.', 'okt.', 'nov.', 'dec.'], + 'meridiem' => ['priekšpusdiena', 'pēcpusdiena'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php new file mode 100644 index 00000000..ee91c369 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lv_LV.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/lv.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php new file mode 100644 index 00000000..1180c6bb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/lzh_TW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php new file mode 100644 index 00000000..771394e8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/lzh_TW.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'OY[年]MMMMOD[日]', + ], + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => [' 一 ', ' 二 ', ' 三 ', ' 四 ', ' 五 ', ' 六 ', ' 七 ', ' 八 ', ' 九 ', ' 十 ', '十一', '十二'], + 'weekdays' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['〇', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十', '十一', '十二', '十三', '十四', '十五', '十六', '十七', '十八', '十九', '廿', '廿一', '廿二', '廿三', '廿四', '廿五', '廿六', '廿七', '廿八', '廿九', '卅', '卅一'], + 'meridiem' => ['朝', '暮'], + + 'year' => ':count 夏', // less reliable + 'y' => ':count 夏', // less reliable + 'a_year' => ':count 夏', // less reliable + + 'month' => ':count 月', // less reliable + 'm' => ':count 月', // less reliable + 'a_month' => ':count 月', // less reliable + + 'hour' => ':count 氧', // less reliable + 'h' => ':count 氧', // less reliable + 'a_hour' => ':count 氧', // less reliable + + 'minute' => ':count 點', // less reliable + 'min' => ':count 點', // less reliable + 'a_minute' => ':count 點', // less reliable + + 'second' => ':count 楚', // less reliable + 's' => ':count 楚', // less reliable + 'a_second' => ':count 楚', // less reliable + + 'week' => ':count 星期', + 'w' => ':count 星期', + 'a_week' => ':count 星期', + + 'day' => ':count 日(曆法)', + 'd' => ':count 日(曆法)', + 'a_day' => ':count 日(曆法)', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag.php new file mode 100644 index 00000000..7532436d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mag_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php new file mode 100644 index 00000000..87977654 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mag_IN.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bhashaghar@googlegroups.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'weekdays' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], + 'weekdays_short' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], + 'weekdays_min' => ['एतवार', 'सोमार', 'मंगर', 'बुध', 'बिफे', 'सूक', 'सनिचर'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai.php new file mode 100644 index 00000000..792b9739 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mai_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php new file mode 100644 index 00000000..3f9bba77 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mai_IN.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Maithili Computing Research Center, Pune, India rajeshkajha@yahoo.com,akhilesh.k@samusng.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], + 'months_short' => ['बैसाख', 'जेठ', 'अषाढ़', 'सावोन', 'भादो', 'आसिन', 'कातिक', 'अगहन', 'पूस', 'माघ', 'फागुन', 'चैति'], + 'weekdays' => ['रविदिन', 'सोमदिन', 'मंगलदिन', 'बुधदिन', 'बृहस्पतीदिन', 'शुक्रदिन', 'शनीदिन'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], + 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पती', 'शुक्र', 'शनी'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], + + 'year' => ':count ऋतु', // less reliable + 'y' => ':count ऋतु', // less reliable + 'a_year' => ':count ऋतु', // less reliable + + 'month' => ':count महिना', + 'm' => ':count महिना', + 'a_month' => ':count महिना', + + 'week' => ':count श्रेणी:क्यालेन्डर', // less reliable + 'w' => ':count श्रेणी:क्यालेन्डर', // less reliable + 'a_week' => ':count श्रेणी:क्यालेन्डर', // less reliable + + 'day' => ':count दिन', + 'd' => ':count दिन', + 'a_day' => ':count दिन', + + 'hour' => ':count घण्टा', + 'h' => ':count घण्टा', + 'a_hour' => ':count घण्टा', + + 'minute' => ':count समय', // less reliable + 'min' => ':count समय', // less reliable + 'a_minute' => ':count समय', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas.php new file mode 100644 index 00000000..ba99156e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Ɛnkakɛnyá', 'Ɛndámâ'], + 'weekdays' => ['Jumapílí', 'Jumatátu', 'Jumane', 'Jumatánɔ', 'Alaámisi', 'Jumáa', 'Jumamósi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Oladalʉ́', 'Arát', 'Ɔɛnɨ́ɔɨŋɔk', 'Olodoyíóríê inkókúâ', 'Oloilépūnyīē inkókúâ', 'Kújúɔrɔk', 'Mórusásin', 'Ɔlɔ́ɨ́bɔ́rárɛ', 'Kúshîn', 'Olgísan', 'Pʉshʉ́ka', 'Ntʉ́ŋʉ́s'], + 'months_short' => ['Dal', 'Ará', 'Ɔɛn', 'Doy', 'Lép', 'Rok', 'Sás', 'Bɔ́r', 'Kús', 'Gís', 'Shʉ́', 'Ntʉ́'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => ':count olameyu', // less reliable + 'y' => ':count olameyu', // less reliable + 'a_year' => ':count olameyu', // less reliable + + 'week' => ':count engolongeare orwiki', // less reliable + 'w' => ':count engolongeare orwiki', // less reliable + 'a_week' => ':count engolongeare orwiki', // less reliable + + 'hour' => ':count esahabu', // less reliable + 'h' => ':count esahabu', // less reliable + 'a_hour' => ':count esahabu', // less reliable + + 'second' => ':count are', // less reliable + 's' => ':count are', // less reliable + 'a_second' => ':count are', // less reliable + + 'month' => ':count olapa', + 'm' => ':count olapa', + 'a_month' => ':count olapa', + + 'day' => ':count enkolongʼ', + 'd' => ':count enkolongʼ', + 'a_day' => ':count enkolongʼ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php new file mode 100644 index 00000000..56e29053 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mas_TZ.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/mas.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mer.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mer.php new file mode 100644 index 00000000..9b4ad3be --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mer.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['RŨ', 'ŨG'], + 'weekdays' => ['Kiumia', 'Muramuko', 'Wairi', 'Wethatu', 'Wena', 'Wetano', 'Jumamosi'], + 'weekdays_short' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], + 'weekdays_min' => ['KIU', 'MRA', 'WAI', 'WET', 'WEN', 'WTN', 'JUM'], + 'months' => ['Januarĩ', 'Feburuarĩ', 'Machi', 'Ĩpurũ', 'Mĩĩ', 'Njuni', 'Njuraĩ', 'Agasti', 'Septemba', 'Oktũba', 'Novemba', 'Dicemba'], + 'months_short' => ['JAN', 'FEB', 'MAC', 'ĨPU', 'MĨĨ', 'NJU', 'NJR', 'AGA', 'SPT', 'OKT', 'NOV', 'DEC'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => ':count murume', // less reliable + 'y' => ':count murume', // less reliable + 'a_year' => ':count murume', // less reliable + + 'month' => ':count muchaara', // less reliable + 'm' => ':count muchaara', // less reliable + 'a_month' => ':count muchaara', // less reliable + + 'minute' => ':count monto', // less reliable + 'min' => ':count monto', // less reliable + 'a_minute' => ':count monto', // less reliable + + 'second' => ':count gikeno', // less reliable + 's' => ':count gikeno', // less reliable + 'a_second' => ':count gikeno', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php new file mode 100644 index 00000000..4d6e6b69 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mfe_MU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php new file mode 100644 index 00000000..ef51ce7d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mfe_MU.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['zanvie', 'fevriye', 'mars', 'avril', 'me', 'zin', 'zilye', 'out', 'septam', 'oktob', 'novam', 'desam'], + 'months_short' => ['zan', 'fev', 'mar', 'avr', 'me', 'zin', 'zil', 'out', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['dimans', 'lindi', 'mardi', 'merkredi', 'zedi', 'vandredi', 'samdi'], + 'weekdays_short' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], + 'weekdays_min' => ['dim', 'lin', 'mar', 'mer', 'ze', 'van', 'sam'], + + 'year' => ':count banané', + 'y' => ':count banané', + 'a_year' => ':count banané', + + 'month' => ':count mwa', + 'm' => ':count mwa', + 'a_month' => ':count mwa', + + 'week' => ':count sémenn', + 'w' => ':count sémenn', + 'a_week' => ':count sémenn', + + 'day' => ':count zour', + 'd' => ':count zour', + 'a_day' => ':count zour', + + 'hour' => ':count -er-tan', + 'h' => ':count -er-tan', + 'a_hour' => ':count -er-tan', + + 'minute' => ':count minitt', + 'min' => ':count minitt', + 'a_minute' => ':count minitt', + + 'second' => ':count déziém', + 's' => ':count déziém', + 'a_second' => ':count déziém', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg.php new file mode 100644 index 00000000..40bc2a82 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mg_MG.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php new file mode 100644 index 00000000..6a14535a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mg_MG.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - The Debian Project modified by GNU//Linux Malagasy Rado Ramarotafika,Do-Risika RAFIEFERANTSIARONJY rado@linuxmg.org,dourix@free.fr + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Janoary', 'Febroary', 'Martsa', 'Aprily', 'Mey', 'Jona', 'Jolay', 'Aogositra', 'Septambra', 'Oktobra', 'Novambra', 'Desambra'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Mey', 'Jon', 'Jol', 'Aog', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['alahady', 'alatsinainy', 'talata', 'alarobia', 'alakamisy', 'zoma', 'sabotsy'], + 'weekdays_short' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], + 'weekdays_min' => ['lhd', 'lts', 'tlt', 'lrb', 'lkm', 'zom', 'sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'minute' => ':count minitra', // less reliable + 'min' => ':count minitra', // less reliable + 'a_minute' => ':count minitra', // less reliable + + 'year' => ':count taona', + 'y' => ':count taona', + 'a_year' => ':count taona', + + 'month' => ':count volana', + 'm' => ':count volana', + 'a_month' => ':count volana', + + 'week' => ':count herinandro', + 'w' => ':count herinandro', + 'a_week' => ':count herinandro', + + 'day' => ':count andro', + 'd' => ':count andro', + 'a_day' => ':count andro', + + 'hour' => ':count ora', + 'h' => ':count ora', + 'a_hour' => ':count ora', + + 'second' => ':count segondra', + 's' => ':count segondra', + 'a_second' => ':count segondra', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php new file mode 100644 index 00000000..a4b624c4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgh.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['wichishu', 'mchochil’l'], + 'weekdays' => ['Sabato', 'Jumatatu', 'Jumanne', 'Jumatano', 'Arahamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], + 'weekdays_min' => ['Sab', 'Jtt', 'Jnn', 'Jtn', 'Ara', 'Iju', 'Jmo'], + 'months' => ['Mweri wo kwanza', 'Mweri wo unayeli', 'Mweri wo uneraru', 'Mweri wo unecheshe', 'Mweri wo unethanu', 'Mweri wo thanu na mocha', 'Mweri wo saba', 'Mweri wo nane', 'Mweri wo tisa', 'Mweri wo kumi', 'Mweri wo kumi na moja', 'Mweri wo kumi na yel’li'], + 'months_short' => ['Kwa', 'Una', 'Rar', 'Che', 'Tha', 'Moc', 'Sab', 'Nan', 'Tis', 'Kum', 'Moj', 'Yel'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php new file mode 100644 index 00000000..a126c9ff --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mgo.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], + 'weekdays_short' => ['Aneg 1', 'Aneg 2', 'Aneg 3', 'Aneg 4', 'Aneg 5', 'Aneg 6', 'Aneg 7'], + 'weekdays_min' => ['1', '2', '3', '4', '5', '6', '7'], + 'months' => ['iməg mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], + 'months_short' => ['mbegtug', 'imeg àbùbì', 'imeg mbəŋchubi', 'iməg ngwə̀t', 'iməg fog', 'iməg ichiibɔd', 'iməg àdùmbə̀ŋ', 'iməg ichika', 'iməg kud', 'iməg tèsiʼe', 'iməg zò', 'iməg krizmed'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'dddd, YYYY MMMM DD HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php new file mode 100644 index 00000000..6bbc9f6d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mhr_RU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php new file mode 100644 index 00000000..309ead9d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mhr_RU.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - PeshSajSoft Ltd. Vyacheslav Kileev slavakileev@yandex.ru + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY.MM.DD', + ], + 'months' => ['Шорыкйол', 'Пургыж', 'Ӱярня', 'Вӱдшор', 'Ага', 'Пеледыш', 'Сӱрем', 'Сорла', 'Идым', 'Шыжа', 'Кылме', 'Теле'], + 'months_short' => ['Шрк', 'Пгж', 'Ӱрн', 'Вшр', 'Ага', 'Пдш', 'Срм', 'Срл', 'Идм', 'Шыж', 'Клм', 'Тел'], + 'weekdays' => ['Рушарня', 'Шочмо', 'Кушкыжмо', 'Вӱргече', 'Изарня', 'Кугарня', 'Шуматкече'], + 'weekdays_short' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], + 'weekdays_min' => ['Ршр', 'Шчм', 'Кжм', 'Вгч', 'Изр', 'Кгр', 'Шмт'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count идалык', + 'y' => ':count идалык', + 'a_year' => ':count идалык', + + 'month' => ':count Тылзе', + 'm' => ':count Тылзе', + 'a_month' => ':count Тылзе', + + 'week' => ':count арня', + 'w' => ':count арня', + 'a_week' => ':count арня', + + 'day' => ':count кече', + 'd' => ':count кече', + 'a_day' => ':count кече', + + 'hour' => ':count час', + 'h' => ':count час', + 'a_hour' => ':count час', + + 'minute' => ':count минут', + 'min' => ':count минут', + 'a_minute' => ':count минут', + + 'second' => ':count кокымшан', + 's' => ':count кокымшан', + 'a_second' => ':count кокымшан', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi.php new file mode 100644 index 00000000..b7f51ec2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - John Corrigan + * - François B + */ +return [ + 'year' => ':count tau', + 'a_year' => '{1}he tau|:count tau', + 'month' => ':count marama', + 'a_month' => '{1}he marama|:count marama', + 'week' => ':count wiki', + 'a_week' => '{1}he wiki|:count wiki', + 'day' => ':count ra', + 'a_day' => '{1}he ra|:count ra', + 'hour' => ':count haora', + 'a_hour' => '{1}te haora|:count haora', + 'minute' => ':count meneti', + 'a_minute' => '{1}he meneti|:count meneti', + 'second' => ':count hēkona', + 'a_second' => '{1}te hēkona ruarua|:count hēkona', + 'ago' => ':time i mua', + 'from_now' => 'i roto i :time', + 'diff_yesterday' => 'inanahi', + 'diff_yesterday_regexp' => 'inanahi(?:\\s+i)?', + 'diff_today' => 'i teie', + 'diff_today_regexp' => 'i teie(?:\\s+mahana,)?(?:\\s+i)?', + 'diff_tomorrow' => 'apopo', + 'diff_tomorrow_regexp' => 'apopo(?:\\s+i)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY [i] HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY [i] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[i teie mahana, i] LT', + 'nextDay' => '[apopo i] LT', + 'nextWeek' => 'dddd [i] LT', + 'lastDay' => '[inanahi i] LT', + 'lastWeek' => 'dddd [whakamutunga i] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['Kohi-tāte', 'Hui-tanguru', 'Poutū-te-rangi', 'Paenga-whāwhā', 'Haratua', 'Pipiri', 'Hōngoingoi', 'Here-turi-kōkā', 'Mahuru', 'Whiringa-ā-nuku', 'Whiringa-ā-rangi', 'Hakihea'], + 'months_short' => ['Kohi', 'Hui', 'Pou', 'Pae', 'Hara', 'Pipi', 'Hōngoi', 'Here', 'Mahu', 'Whi-nu', 'Whi-ra', 'Haki'], + 'weekdays' => ['Rātapu', 'Mane', 'Tūrei', 'Wenerei', 'Tāite', 'Paraire', 'Hātarei'], + 'weekdays_short' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], + 'weekdays_min' => ['Ta', 'Ma', 'Tū', 'We', 'Tāi', 'Pa', 'Hā'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' me te '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php new file mode 100644 index 00000000..6b964e3a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mi_NZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/mi.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq.php new file mode 100644 index 00000000..51e5a985 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/miq_NI.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php new file mode 100644 index 00000000..57faa318 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/miq_NI.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], + 'months_short' => ['siakwa kati', 'kuswa kati', 'kakamuk kati', 'lî wainhka kati', 'lih mairin kati', 'lî kati', 'pastara kati', 'sikla kati', 'wîs kati', 'waupasa kati', 'yahbra kati', 'trisu kati'], + 'weekdays' => ['sandi', 'mundi', 'tiusdi', 'wensde', 'tausde', 'praidi', 'satadi'], + 'weekdays_short' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], + 'weekdays_min' => ['san', 'mun', 'tius', 'wens', 'taus', 'prai', 'sat'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 7, + 'meridiem' => ['VM', 'NM'], + + 'month' => ':count kati', // less reliable + 'm' => ':count kati', // less reliable + 'a_month' => ':count kati', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php new file mode 100644 index 00000000..617154cd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mjw_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php new file mode 100644 index 00000000..58ed0d18 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mjw_IN.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Jor Teron bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['Arkoi', 'Thangthang', 'There', 'Jangmi', 'Aru', 'Vosik', 'Jakhong', 'Paipai', 'Chiti', 'Phere', 'Phaikuni', 'Matijong'], + 'months_short' => ['Ark', 'Thang', 'The', 'Jang', 'Aru', 'Vos', 'Jak', 'Pai', 'Chi', 'Phe', 'Phai', 'Mati'], + 'weekdays' => ['Bhomkuru', 'Urmi', 'Durmi', 'Thelang', 'Theman', 'Bhomta', 'Bhomti'], + 'weekdays_short' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], + 'weekdays_min' => ['Bhom', 'Ur', 'Dur', 'Tkel', 'Tkem', 'Bhta', 'Bhti'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk.php new file mode 100644 index 00000000..38fe6d04 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sashko Todorov + * - Josh Soref + * - François B + * - Serhan Apaydın + * - Borislav Mickov + * - JD Isaacks + * - Tomi Atanasoski + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count година|:count години', + 'a_year' => 'година|:count години', + 'y' => ':count год.', + 'month' => ':count месец|:count месеци', + 'a_month' => 'месец|:count месеци', + 'm' => ':count месец|:count месеци', + 'week' => ':count седмица|:count седмици', + 'a_week' => 'седмица|:count седмици', + 'w' => ':count седмица|:count седмици', + 'day' => ':count ден|:count дена', + 'a_day' => 'ден|:count дена', + 'd' => ':count ден|:count дена', + 'hour' => ':count час|:count часа', + 'a_hour' => 'час|:count часа', + 'h' => ':count час|:count часа', + 'minute' => ':count минута|:count минути', + 'a_minute' => 'минута|:count минути', + 'min' => ':count мин.', + 'second' => ':count секунда|:count секунди', + 'a_second' => 'неколку секунди|:count секунди', + 's' => ':count сек.', + 'ago' => 'пред :time', + 'from_now' => 'после :time', + 'after' => 'по :time', + 'before' => 'пред :time', + 'diff_now' => 'сега', + 'diff_today' => 'Денес', + 'diff_today_regexp' => 'Денес(?:\\s+во)?', + 'diff_yesterday' => 'вчера', + 'diff_yesterday_regexp' => 'Вчера(?:\\s+во)?', + 'diff_tomorrow' => 'утре', + 'diff_tomorrow_regexp' => 'Утре(?:\\s+во)?', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'D.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY H:mm', + 'LLLL' => 'dddd, D MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[Денес во] LT', + 'nextDay' => '[Утре во] LT', + 'nextWeek' => '[Во] dddd [во] LT', + 'lastDay' => '[Вчера во] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0, 3, 6 => '[Изминатата] dddd [во] LT', + default => '[Изминатиот] dddd [во] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + $lastDigit = $number % 10; + $last2Digits = $number % 100; + if ($number === 0) { + return $number.'-ев'; + } + if ($last2Digits === 0) { + return $number.'-ен'; + } + if ($last2Digits > 10 && $last2Digits < 20) { + return $number.'-ти'; + } + if ($lastDigit === 1) { + return $number.'-ви'; + } + if ($lastDigit === 2) { + return $number.'-ри'; + } + if ($lastDigit === 7 || $lastDigit === 8) { + return $number.'-ми'; + } + + return $number.'-ти'; + }, + 'months' => ['јануари', 'февруари', 'март', 'април', 'мај', 'јуни', 'јули', 'август', 'септември', 'октомври', 'ноември', 'декември'], + 'months_short' => ['јан', 'фев', 'мар', 'апр', 'мај', 'јун', 'јул', 'авг', 'сеп', 'окт', 'ное', 'дек'], + 'weekdays' => ['недела', 'понеделник', 'вторник', 'среда', 'четврток', 'петок', 'сабота'], + 'weekdays_short' => ['нед', 'пон', 'вто', 'сре', 'чет', 'пет', 'саб'], + 'weekdays_min' => ['нe', 'пo', 'вт', 'ср', 'че', 'пе', 'сa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' и '], + 'meridiem' => ['АМ', 'ПМ'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php new file mode 100644 index 00000000..95e2ff9c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mk_MK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/mk.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml.php new file mode 100644 index 00000000..a35f96f5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - JD Isaacks + */ +return [ + 'year' => ':count വർഷം', + 'a_year' => 'ഒരു വർഷം|:count വർഷം', + 'month' => ':count മാസം', + 'a_month' => 'ഒരു മാസം|:count മാസം', + 'week' => ':count ആഴ്ച', + 'a_week' => 'ഒരാഴ്ച|:count ആഴ്ച', + 'day' => ':count ദിവസം', + 'a_day' => 'ഒരു ദിവസം|:count ദിവസം', + 'hour' => ':count മണിക്കൂർ', + 'a_hour' => 'ഒരു മണിക്കൂർ|:count മണിക്കൂർ', + 'minute' => ':count മിനിറ്റ്', + 'a_minute' => 'ഒരു മിനിറ്റ്|:count മിനിറ്റ്', + 'second' => ':count സെക്കൻഡ്', + 'a_second' => 'അൽപ നിമിഷങ്ങൾ|:count സെക്കൻഡ്', + 'ago' => ':time മുൻപ്', + 'from_now' => ':time കഴിഞ്ഞ്', + 'diff_now' => 'ഇപ്പോൾ', + 'diff_today' => 'ഇന്ന്', + 'diff_yesterday' => 'ഇന്നലെ', + 'diff_tomorrow' => 'നാളെ', + 'formats' => [ + 'LT' => 'A h:mm -നു', + 'LTS' => 'A h:mm:ss -നു', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm -നു', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm -നു', + ], + 'calendar' => [ + 'sameDay' => '[ഇന്ന്] LT', + 'nextDay' => '[നാളെ] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[ഇന്നലെ] LT', + 'lastWeek' => '[കഴിഞ്ഞ] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'രാത്രി'; + } + if ($hour < 12) { + return 'രാവിലെ'; + } + if ($hour < 17) { + return 'ഉച്ച കഴിഞ്ഞ്'; + } + if ($hour < 20) { + return 'വൈകുന്നേരം'; + } + + return 'രാത്രി'; + }, + 'months' => ['ജനുവരി', 'ഫെബ്രുവരി', 'മാർച്ച്', 'ഏപ്രിൽ', 'മേയ്', 'ജൂൺ', 'ജൂലൈ', 'ഓഗസ്റ്റ്', 'സെപ്റ്റംബർ', 'ഒക്ടോബർ', 'നവംബർ', 'ഡിസംബർ'], + 'months_short' => ['ജനു.', 'ഫെബ്രു.', 'മാർ.', 'ഏപ്രി.', 'മേയ്', 'ജൂൺ', 'ജൂലൈ.', 'ഓഗ.', 'സെപ്റ്റ.', 'ഒക്ടോ.', 'നവം.', 'ഡിസം.'], + 'weekdays' => ['ഞായറാഴ്ച', 'തിങ്കളാഴ്ച', 'ചൊവ്വാഴ്ച', 'ബുധനാഴ്ച', 'വ്യാഴാഴ്ച', 'വെള്ളിയാഴ്ച', 'ശനിയാഴ്ച'], + 'weekdays_short' => ['ഞായർ', 'തിങ്കൾ', 'ചൊവ്വ', 'ബുധൻ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], + 'weekdays_min' => ['ഞാ', 'തി', 'ചൊ', 'ബു', 'വ്യാ', 'വെ', 'ശ'], + 'list' => ', ', + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php new file mode 100644 index 00000000..000e7958 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ml_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ml.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn.php new file mode 100644 index 00000000..38c6434d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Zolzaya Erdenebaatar + * - Tom Hughes + * - Akira Matsuda + * - Christopher Dell + * - Michael Kessler + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Nicolás Hock Isaza + * - Ochirkhuyag + * - Batmandakh + * - lucifer-crybaby + */ +return [ + 'year' => ':count жил', + 'y' => ':count жил', + 'month' => ':count сар', + 'm' => ':count сар', + 'week' => ':count долоо хоног', + 'w' => ':count долоо хоног', + 'day' => ':count өдөр', + 'd' => ':count өдөр', + 'hour' => ':count цаг', + 'h' => ':countц', + 'minute' => ':count минут', + 'min' => ':countм', + 'second' => ':count секунд', + 's' => ':countс', + + 'ago_mode' => 'last', + 'ago' => ':time өмнө', + 'year_ago' => ':count жилийн', + 'y_ago' => ':count жилийн', + 'month_ago' => ':count сарын', + 'm_ago' => ':count сарын', + 'day_ago' => ':count хоногийн', + 'd_ago' => ':count хоногийн', + 'week_ago' => ':count долоо хоногийн', + 'w_ago' => ':count долоо хоногийн', + 'hour_ago' => ':count цагийн', + 'minute_ago' => ':count минутын', + 'second_ago' => ':count секундын', + + 'from_now_mode' => 'last', + 'from_now' => 'одоогоос :time', + 'year_from_now' => ':count жилийн дараа', + 'y_from_now' => ':count жилийн дараа', + 'month_from_now' => ':count сарын дараа', + 'm_from_now' => ':count сарын дараа', + 'day_from_now' => ':count хоногийн дараа', + 'd_from_now' => ':count хоногийн дараа', + 'hour_from_now' => ':count цагийн дараа', + 'minute_from_now' => ':count минутын дараа', + 'second_from_now' => ':count секундын дараа', + + 'after_mode' => 'last', + 'after' => ':time дараа', + 'year_after' => ':count жилийн', + 'y_after' => ':count жилийн', + 'month_after' => ':count сарын', + 'm_after' => ':count сарын', + 'day_after' => ':count хоногийн', + 'd_after' => ':count хоногийн', + 'hour_after' => ':count цагийн', + 'minute_after' => ':count минутын', + 'second_after' => ':count секундын', + + 'before_mode' => 'last', + 'before' => ':time өмнө', + 'year_before' => ':count жилийн', + 'y_before' => ':count жилийн', + 'month_before' => ':count сарын', + 'm_before' => ':count сарын', + 'day_before' => ':count хоногийн', + 'd_before' => ':count хоногийн', + 'hour_before' => ':count цагийн', + 'minute_before' => ':count минутын', + 'second_before' => ':count секундын', + + 'list' => ', ', + 'diff_now' => 'одоо', + 'diff_yesterday' => 'өчигдөр', + 'diff_tomorrow' => 'маргааш', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'YYYY MMMM DD', + 'LLL' => 'YY-MM-DD, HH:mm', + 'LLLL' => 'YYYY MMMM DD, HH:mm', + ], + 'weekdays' => ['Ням', 'Даваа', 'Мягмар', 'Лхагва', 'Пүрэв', 'Баасан', 'Бямба'], + 'weekdays_short' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], + 'weekdays_min' => ['Ня', 'Да', 'Мя', 'Лх', 'Пү', 'Ба', 'Бя'], + 'months' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], + 'months_short' => ['1 сар', '2 сар', '3 сар', '4 сар', '5 сар', '6 сар', '7 сар', '8 сар', '9 сар', '10 сар', '11 сар', '12 сар'], + 'meridiem' => ['өглөө', 'орой'], + 'first_day_of_week' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php new file mode 100644 index 00000000..e5ce426c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mn_MN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/mn.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni.php new file mode 100644 index 00000000..cafa2f87 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/mni_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php new file mode 100644 index 00000000..4dc577c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mni_IN.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat Pune libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['জানুৱারি', 'ফেব্রুৱারি', 'মার্চ', 'এপ্রিল', 'মে', 'জুন', 'জুলাই', 'আগষ্ট', 'সেপ্তেম্বর', 'ওক্তোবর', 'নবেম্বর', 'ডিসেম্বর'], + 'months_short' => ['জান', 'ফেব', 'মার', 'এপ্রি', 'মে', 'জুন', 'জুল', 'আগ', 'সেপ', 'ওক্ত', 'নবে', 'ডিস'], + 'weekdays' => ['নোংমাইজিং', 'নিংথৌকাবা', 'লৈবাকপোকপা', 'য়ুমশকৈশা', 'শগোলশেন', 'ইরাই', 'থাংজ'], + 'weekdays_short' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], + 'weekdays_min' => ['নোং', 'নিং', 'লৈবাক', 'য়ুম', 'শগোল', 'ইরা', 'থাং'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['এ.ম.', 'প.ম.'], + + 'year' => ':count ইসিং', // less reliable + 'y' => ':count ইসিং', // less reliable + 'a_year' => ':count ইসিং', // less reliable + + 'second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable + 's' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable + 'a_second' => ':count ꯅꯤꯡꯊꯧꯀꯥꯕ', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mo.php new file mode 100644 index 00000000..102afcde --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mo.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ro.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr.php new file mode 100644 index 00000000..e57e6f51 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Vikram-enyota + */ +return [ + 'year' => ':count वर्ष', + 'y' => ':count वर्ष', + 'month' => ':count महिना|:count महिने', + 'm' => ':count महिना|:count महिने', + 'week' => ':count आठवडा|:count आठवडे', + 'w' => ':count आठवडा|:count आठवडे', + 'day' => ':count दिवस', + 'd' => ':count दिवस', + 'hour' => ':count तास', + 'h' => ':count तास', + 'minute' => ':count मिनिटे', + 'min' => ':count मिनिटे', + 'second' => ':count सेकंद', + 's' => ':count सेकंद', + + 'ago' => ':timeपूर्वी', + 'from_now' => ':timeमध्ये', + 'before' => ':timeपूर्वी', + 'after' => ':timeनंतर', + + 'diff_now' => 'आत्ता', + 'diff_today' => 'आज', + 'diff_yesterday' => 'काल', + 'diff_tomorrow' => 'उद्या', + + 'formats' => [ + 'LT' => 'A h:mm वाजता', + 'LTS' => 'A h:mm:ss वाजता', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm वाजता', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm वाजता', + ], + + 'calendar' => [ + 'sameDay' => '[आज] LT', + 'nextDay' => '[उद्या] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[काल] LT', + 'lastWeek' => '[मागील] dddd, LT', + 'sameElse' => 'L', + ], + + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'रात्री'; + } + if ($hour < 10) { + return 'सकाळी'; + } + if ($hour < 17) { + return 'दुपारी'; + } + if ($hour < 20) { + return 'सायंकाळी'; + } + + return 'रात्री'; + }, + + 'months' => ['जानेवारी', 'फेब्रुवारी', 'मार्च', 'एप्रिल', 'मे', 'जून', 'जुलै', 'ऑगस्ट', 'सप्टेंबर', 'ऑक्टोबर', 'नोव्हेंबर', 'डिसेंबर'], + 'months_short' => ['जाने.', 'फेब्रु.', 'मार्च.', 'एप्रि.', 'मे.', 'जून.', 'जुलै.', 'ऑग.', 'सप्टें.', 'ऑक्टो.', 'नोव्हें.', 'डिसें.'], + 'weekdays' => ['रविवार', 'सोमवार', 'मंगळवार', 'बुधवार', 'गुरूवार', 'शुक्रवार', 'शनिवार'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगळ', 'बुध', 'गुरू', 'शुक्र', 'शनि'], + 'weekdays_min' => ['र', 'सो', 'मं', 'बु', 'गु', 'शु', 'श'], + 'list' => [', ', ' आणि '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php new file mode 100644 index 00000000..7bca919f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mr_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/mr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms.php new file mode 100644 index 00000000..fc53ab98 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Azri Jamil + * - JD Isaacks + * - Josh Soref + * - Azri Jamil + * - Hariadi Hinta + * - Ashraf Kamarudin + */ +return [ + 'year' => ':count tahun', + 'a_year' => '{1}setahun|[-Inf,Inf]:count tahun', + 'y' => ':count tahun', + 'month' => ':count bulan', + 'a_month' => '{1}sebulan|[-Inf,Inf]:count bulan', + 'm' => ':count bulan', + 'week' => ':count minggu', + 'a_week' => '{1}seminggu|[-Inf,Inf]:count minggu', + 'w' => ':count minggu', + 'day' => ':count hari', + 'a_day' => '{1}sehari|[-Inf,Inf]:count hari', + 'd' => ':count hari', + 'hour' => ':count jam', + 'a_hour' => '{1}sejam|[-Inf,Inf]:count jam', + 'h' => ':count jam', + 'minute' => ':count minit', + 'a_minute' => '{1}seminit|[-Inf,Inf]:count minit', + 'min' => ':count minit', + 'second' => ':count saat', + 'a_second' => '{1}beberapa saat|[-Inf,Inf]:count saat', + 'millisecond' => ':count milisaat', + 'a_millisecond' => '{1}semilisaat|[-Inf,Inf]:count milliseconds', + 'microsecond' => ':count mikrodetik', + 'a_microsecond' => '{1}semikrodetik|[-Inf,Inf]:count mikrodetik', + 's' => ':count saat', + 'ago' => ':time yang lepas', + 'from_now' => ':time dari sekarang', + 'after' => ':time kemudian', + 'before' => ':time sebelum', + 'diff_now' => 'sekarang', + 'diff_today' => 'Hari', + 'diff_today_regexp' => 'Hari(?:\\s+ini)?(?:\\s+pukul)?', + 'diff_yesterday' => 'semalam', + 'diff_yesterday_regexp' => 'Semalam(?:\\s+pukul)?', + 'diff_tomorrow' => 'esok', + 'diff_tomorrow_regexp' => 'Esok(?:\\s+pukul)?', + 'diff_before_yesterday' => 'kelmarin', + 'diff_after_tomorrow' => 'lusa', + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm.ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY [pukul] HH.mm', + 'LLLL' => 'dddd, D MMMM YYYY [pukul] HH.mm', + ], + 'calendar' => [ + 'sameDay' => '[Hari ini pukul] LT', + 'nextDay' => '[Esok pukul] LT', + 'nextWeek' => 'dddd [pukul] LT', + 'lastDay' => '[Kelmarin pukul] LT', + 'lastWeek' => 'dddd [lepas pukul] LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 1) { + return 'tengah malam'; + } + + if ($hour < 12) { + return 'pagi'; + } + + if ($hour < 13) { + return 'tengah hari'; + } + + if ($hour < 19) { + return 'petang'; + } + + return 'malam'; + }, + 'months' => ['Januari', 'Februari', 'Mac', 'April', 'Mei', 'Jun', 'Julai', 'Ogos', 'September', 'Oktober', 'November', 'Disember'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ogs', 'Sep', 'Okt', 'Nov', 'Dis'], + 'weekdays' => ['Ahad', 'Isnin', 'Selasa', 'Rabu', 'Khamis', 'Jumaat', 'Sabtu'], + 'weekdays_short' => ['Ahd', 'Isn', 'Sel', 'Rab', 'Kha', 'Jum', 'Sab'], + 'weekdays_min' => ['Ah', 'Is', 'Sl', 'Rb', 'Km', 'Jm', 'Sb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' dan '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php new file mode 100644 index 00000000..ef837a2d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_BN.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ms.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/MM/yy', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, h:mm a', + 'LLLL' => 'dd MMMM YYYY, h:mm a', + ], + 'meridiem' => ['a', 'p'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php new file mode 100644 index 00000000..970d6048 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_MY.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Azri Jamil + * - JD Isaacks + */ +return require __DIR__.'/ms.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php new file mode 100644 index 00000000..77cb83d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ms_SG.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ms.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/MM/yy', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', + ], + 'meridiem' => ['a', 'p'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt.php new file mode 100644 index 00000000..e8aadcc9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Alessandro Maruccia + */ +return [ + 'year' => 'sena|:count sni|:count sni|:count sni', + 'y' => 'sa sena|:count snin|:count snin|:count snin', + 'month' => 'xahar|:count xhur|:count xhur|:count xhur', + 'm' => ':count xahar|:count xhur|:count xhur|:count xhur', + 'week' => 'gimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', + 'w' => 'ġimgħa|:count ġimgħat|:count ġimgħat|:count ġimgħat', + 'day' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', + 'd' => 'ġurnata|:count ġranet|:count ġranet|:count ġranet', + 'hour' => 'siegħa|:count siegħat|:count siegħat|:count siegħat', + 'h' => 'siegħa|:count sigħat|:count sigħat|:count sigħat', + 'minute' => 'minuta|:count minuti|:count minuti|:count minuti', + 'min' => 'min.|:count min.|:count min.|:count min.', + 'second' => 'ftit sekondi|:count sekondi|:count sekondi|:count sekondi', + 's' => 'sek.|:count sek.|:count sek.|:count sek.', + 'ago' => ':time ilu', + 'from_now' => 'f’ :time', + 'diff_now' => 'issa', + 'diff_today' => 'Illum', + 'diff_today_regexp' => 'Illum(?:\\s+fil-)?', + 'diff_yesterday' => 'lbieraħ', + 'diff_yesterday_regexp' => 'Il-bieraħ(?:\\s+fil-)?', + 'diff_tomorrow' => 'għada', + 'diff_tomorrow_regexp' => 'Għada(?:\\s+fil-)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Illum fil-]LT', + 'nextDay' => '[Għada fil-]LT', + 'nextWeek' => 'dddd [fil-]LT', + 'lastDay' => '[Il-bieraħ fil-]LT', + 'lastWeek' => 'dddd [li għadda] [fil-]LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['Jannar', 'Frar', 'Marzu', 'April', 'Mejju', 'Ġunju', 'Lulju', 'Awwissu', 'Settembru', 'Ottubru', 'Novembru', 'Diċembru'], + 'months_short' => ['Jan', 'Fra', 'Mar', 'Apr', 'Mej', 'Ġun', 'Lul', 'Aww', 'Set', 'Ott', 'Nov', 'Diċ'], + 'weekdays' => ['Il-Ħadd', 'It-Tnejn', 'It-Tlieta', 'L-Erbgħa', 'Il-Ħamis', 'Il-Ġimgħa', 'Is-Sibt'], + 'weekdays_short' => ['Ħad', 'Tne', 'Tli', 'Erb', 'Ħam', 'Ġim', 'Sib'], + 'weekdays_min' => ['Ħa', 'Tn', 'Tl', 'Er', 'Ħa', 'Ġi', 'Si'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' u '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php new file mode 100644 index 00000000..9534f687 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mt_MT.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/mt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mua.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mua.php new file mode 100644 index 00000000..a3a3c6fd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mua.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['comme', 'lilli'], + 'weekdays' => ['Com’yakke', 'Comlaaɗii', 'Comzyiiɗii', 'Comkolle', 'Comkaldǝɓlii', 'Comgaisuu', 'Comzyeɓsuu'], + 'weekdays_short' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], + 'weekdays_min' => ['Cya', 'Cla', 'Czi', 'Cko', 'Cka', 'Cga', 'Cze'], + 'months' => ['Fĩi Loo', 'Cokcwaklaŋne', 'Cokcwaklii', 'Fĩi Marfoo', 'Madǝǝuutǝbijaŋ', 'Mamǝŋgwãafahbii', 'Mamǝŋgwãalii', 'Madǝmbii', 'Fĩi Dǝɓlii', 'Fĩi Mundaŋ', 'Fĩi Gwahlle', 'Fĩi Yuru'], + 'months_short' => ['FLO', 'CLA', 'CKI', 'FMF', 'MAD', 'MBI', 'MLI', 'MAM', 'FDE', 'FMU', 'FGW', 'FYU'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my.php new file mode 100644 index 00000000..fe0b252b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - JD Isaacks + * - Nay Lin Aung + */ +return [ + 'year' => ':count နှစ်', + 'a_year' => '{1}တစ်နှစ်|[-Inf,Inf]:count နှစ်', + 'y' => ':count နှစ်', + 'month' => ':count လ', + 'a_month' => '{1}တစ်လ|[-Inf,Inf]:count လ', + 'm' => ':count လ', + 'week' => ':count ပတ်', + 'w' => ':count ပတ်', + 'day' => ':count ရက်', + 'a_day' => '{1}တစ်ရက်|[-Inf,Inf]:count ရက်', + 'd' => ':count ရက်', + 'hour' => ':count နာရီ', + 'a_hour' => '{1}တစ်နာရီ|[-Inf,Inf]:count နာရီ', + 'h' => ':count နာရီ', + 'minute' => ':count မိနစ်', + 'a_minute' => '{1}တစ်မိနစ်|[-Inf,Inf]:count မိနစ်', + 'min' => ':count မိနစ်', + 'second' => ':count စက္ကန့်', + 'a_second' => '{0,1}စက္ကန်.အနည်းငယ်|[-Inf,Inf]:count စက္ကန့်', + 's' => ':count စက္ကန့်', + 'ago' => 'လွန်ခဲ့သော :time က', + 'from_now' => 'လာမည့် :time မှာ', + 'after' => ':time ကြာပြီးနောက်', + 'before' => ':time မတိုင်ခင်', + 'diff_now' => 'အခုလေးတင်', + 'diff_today' => 'ယနေ.', + 'diff_yesterday' => 'မနေ့က', + 'diff_yesterday_regexp' => 'မနေ.က', + 'diff_tomorrow' => 'မနက်ဖြန်', + 'diff_before_yesterday' => 'တမြန်နေ့က', + 'diff_after_tomorrow' => 'တဘက်ခါ', + 'period_recurrences' => ':count ကြိမ်', + 'formats' => [ + 'LT' => 'Oh:Om A', + 'LTS' => 'Oh:Om:Os A', + 'L' => 'OD/OM/OY', + 'LL' => 'OD MMMM OY', + 'LLL' => 'OD MMMM OY Oh:Om A', + 'LLLL' => 'dddd OD MMMM OY Oh:Om A', + ], + 'calendar' => [ + 'sameDay' => '[ယနေ.] LT [မှာ]', + 'nextDay' => '[မနက်ဖြန်] LT [မှာ]', + 'nextWeek' => 'dddd LT [မှာ]', + 'lastDay' => '[မနေ.က] LT [မှာ]', + 'lastWeek' => '[ပြီးခဲ့သော] dddd LT [မှာ]', + 'sameElse' => 'L', + ], + 'months' => ['ဇန်နဝါရီ', 'ဖေဖော်ဝါရီ', 'မတ်', 'ဧပြီ', 'မေ', 'ဇွန်', 'ဇူလိုင်', 'သြဂုတ်', 'စက်တင်ဘာ', 'အောက်တိုဘာ', 'နိုဝင်ဘာ', 'ဒီဇင်ဘာ'], + 'months_short' => ['ဇန်', 'ဖေ', 'မတ်', 'ပြီ', 'မေ', 'ဇွန်', 'လိုင်', 'သြ', 'စက်', 'အောက်', 'နို', 'ဒီ'], + 'weekdays' => ['တနင်္ဂနွေ', 'တနင်္လာ', 'အင်္ဂါ', 'ဗုဒ္ဓဟူး', 'ကြာသပတေး', 'သောကြာ', 'စနေ'], + 'weekdays_short' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], + 'weekdays_min' => ['နွေ', 'လာ', 'ဂါ', 'ဟူး', 'ကြာ', 'သော', 'နေ'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'alt_numbers' => ['၀၀', '၀၁', '၀၂', '၀၃', '၀၄', '၀၅', '၀၆', '၀၇', '၀၈', '၀၉', '၁၀', '၁၁', '၁၂', '၁၃', '၁၄', '၁၅', '၁၆', '၁၇', '၁၈', '၁၉', '၂၀', '၂၁', '၂၂', '၂၃', '၂၄', '၂၅', '၂၆', '၂၇', '၂၈', '၂၉', '၃၀', '၃၁', '၃၂', '၃၃', '၃၄', '၃၅', '၃၆', '၃၇', '၃၈', '၃၉', '၄၀', '၄၁', '၄၂', '၄၃', '၄၄', '၄၅', '၄၆', '၄၇', '၄၈', '၄၉', '၅၀', '၅၁', '၅၂', '၅၃', '၅၄', '၅၅', '၅၆', '၅၇', '၅၈', '၅၉', '၆၀', '၆၁', '၆၂', '၆၃', '၆၄', '၆၅', '၆၆', '၆၇', '၆၈', '၆၉', '၇၀', '၇၁', '၇၂', '၇၃', '၇၄', '၇၅', '၇၆', '၇၇', '၇၈', '၇၉', '၈၀', '၈၁', '၈၂', '၈၃', '၈၄', '၈၅', '၈၆', '၈၇', '၈၈', '၈၉', '၉၀', '၉၁', '၉၂', '၉၃', '၉၄', '၉၅', '၉၆', '၉၇', '၉၈', '၉၉'], + 'meridiem' => ['နံနက်', 'ညနေ'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php new file mode 100644 index 00000000..a0108dd4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/my_MM.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/my.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php new file mode 100644 index 00000000..70f5f23c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/mzn.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fa.php', [ + 'months' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], + 'months_short' => ['ژانویه', 'فوریه', 'مارس', 'آوریل', 'مه', 'ژوئن', 'ژوئیه', 'اوت', 'سپتامبر', 'اکتبر', 'نوامبر', 'دسامبر'], + 'first_day_of_week' => 6, + 'weekend' => [5, 5], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan.php new file mode 100644 index 00000000..0affece8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/nan_TW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php new file mode 100644 index 00000000..4fc65481 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY年MM月DD日', + ], + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => [' 1月', ' 2月', ' 3月', ' 4月', ' 5月', ' 6月', ' 7月', ' 8月', ' 9月', '10月', '11月', '12月'], + 'weekdays' => ['禮拜日', '禮拜一', '禮拜二', '禮拜三', '禮拜四', '禮拜五', '禮拜六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['頂晡', '下晡'], + + 'year' => ':count 年', + 'y' => ':count 年', + 'a_year' => ':count 年', + + 'month' => ':count goe̍h', + 'm' => ':count goe̍h', + 'a_month' => ':count goe̍h', + + 'week' => ':count lé-pài', + 'w' => ':count lé-pài', + 'a_week' => ':count lé-pài', + + 'day' => ':count 日', + 'd' => ':count 日', + 'a_day' => ':count 日', + + 'hour' => ':count tiám-cheng', + 'h' => ':count tiám-cheng', + 'a_hour' => ':count tiám-cheng', + + 'minute' => ':count Hun-cheng', + 'min' => ':count Hun-cheng', + 'a_minute' => ':count Hun-cheng', + + 'second' => ':count Bió', + 's' => ':count Bió', + 'a_second' => ':count Bió', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php new file mode 100644 index 00000000..5eecc63a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nan_TW@latin.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Arne Goetje arne@canonical.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], + 'months' => ['1goe̍h', '2goe̍h', '3goe̍h', '4goe̍h', '5goe̍h', '6goe̍h', '7goe̍h', '8goe̍h', '9goe̍h', '10goe̍h', '11goe̍h', '12goe̍h'], + 'months_short' => ['1g', '2g', '3g', '4g', '5g', '6g', '7g', '8g', '9g', '10g', '11g', '12g'], + 'weekdays' => ['lé-pài-ji̍t', 'pài-it', 'pài-jī', 'pài-saⁿ', 'pài-sì', 'pài-gō͘', 'pài-la̍k'], + 'weekdays_short' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], + 'weekdays_min' => ['lp', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['téng-po͘', 'ē-po͘'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/naq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/naq.php new file mode 100644 index 00000000..fbd9be91 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/naq.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['ǁgoagas', 'ǃuias'], + 'weekdays' => ['Sontaxtsees', 'Mantaxtsees', 'Denstaxtsees', 'Wunstaxtsees', 'Dondertaxtsees', 'Fraitaxtsees', 'Satertaxtsees'], + 'weekdays_short' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], + 'weekdays_min' => ['Son', 'Ma', 'De', 'Wu', 'Do', 'Fr', 'Sat'], + 'months' => ['ǃKhanni', 'ǃKhanǀgôab', 'ǀKhuuǁkhâb', 'ǃHôaǂkhaib', 'ǃKhaitsâb', 'Gamaǀaeb', 'ǂKhoesaob', 'Aoǁkhuumûǁkhâb', 'Taraǀkhuumûǁkhâb', 'ǂNûǁnâiseb', 'ǀHooǂgaeb', 'Hôasoreǁkhâb'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY h:mm a', + ], + + 'year' => ':count kurigu', + 'y' => ':count kurigu', + 'a_year' => ':count kurigu', + + 'month' => ':count ǁaub', // less reliable + 'm' => ':count ǁaub', // less reliable + 'a_month' => ':count ǁaub', // less reliable + + 'week' => ':count hû', // less reliable + 'w' => ':count hû', // less reliable + 'a_week' => ':count hû', // less reliable + + 'day' => ':count ǀhobas', // less reliable + 'd' => ':count ǀhobas', // less reliable + 'a_day' => ':count ǀhobas', // less reliable + + 'hour' => ':count ǂgaes', // less reliable + 'h' => ':count ǂgaes', // less reliable + 'a_hour' => ':count ǂgaes', // less reliable + + 'minute' => ':count minutga', // less reliable + 'min' => ':count minutga', // less reliable + 'a_minute' => ':count minutga', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb.php new file mode 100644 index 00000000..371ee840 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Alexander Tømmerås + * - Sigurd Gartmann + * - JD Isaacks + */ +return [ + 'year' => ':count år|:count år', + 'a_year' => 'ett år|:count år', + 'y' => ':count år|:count år', + 'month' => ':count måned|:count måneder', + 'a_month' => 'en måned|:count måneder', + 'm' => ':count md.', + 'week' => ':count uke|:count uker', + 'a_week' => 'en uke|:count uker', + 'w' => ':count u.', + 'day' => ':count dag|:count dager', + 'a_day' => 'en dag|:count dager', + 'd' => ':count d.', + 'hour' => ':count time|:count timer', + 'a_hour' => 'en time|:count timer', + 'h' => ':count t', + 'minute' => ':count minutt|:count minutter', + 'a_minute' => 'ett minutt|:count minutter', + 'min' => ':count min', + 'second' => ':count sekund|:count sekunder', + 'a_second' => 'noen sekunder|:count sekunder', + 's' => ':count sek', + 'ago' => ':time siden', + 'from_now' => 'om :time', + 'after' => ':time etter', + 'before' => ':time før', + 'diff_now' => 'akkurat nå', + 'diff_today' => 'i dag', + 'diff_today_regexp' => 'i dag(?:\\s+kl.)?', + 'diff_yesterday' => 'i går', + 'diff_yesterday_regexp' => 'i går(?:\\s+kl.)?', + 'diff_tomorrow' => 'i morgen', + 'diff_tomorrow_regexp' => 'i morgen(?:\\s+kl.)?', + 'diff_before_yesterday' => 'i forgårs', + 'diff_after_tomorrow' => 'i overmorgen', + 'period_recurrences' => 'en gang|:count ganger', + 'period_interval' => 'hver :interval', + 'period_start_date' => 'fra :date', + 'period_end_date' => 'til :date', + 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['søndag', 'mandag', 'tirsdag', 'onsdag', 'torsdag', 'fredag', 'lørdag'], + 'weekdays_short' => ['søn', 'man', 'tir', 'ons', 'tor', 'fre', 'lør'], + 'weekdays_min' => ['sø', 'ma', 'ti', 'on', 'to', 'fr', 'lø'], + 'ordinal' => ':number.', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY [kl.] HH:mm', + 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[i dag kl.] LT', + 'nextDay' => '[i morgen kl.] LT', + 'nextWeek' => 'dddd [kl.] LT', + 'lastDay' => '[i går kl.] LT', + 'lastWeek' => '[forrige] dddd [kl.] LT', + 'sameElse' => 'L', + ], + 'list' => [', ', ' og '], + 'meridiem' => ['a.m.', 'p.m.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php new file mode 100644 index 00000000..31678c53 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_NO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nb.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php new file mode 100644 index 00000000..ce0210bc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nb_SJ.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/nb.php', [ + 'formats' => [ + 'LL' => 'D. MMM YYYY', + 'LLL' => 'D. MMMM YYYY, HH:mm', + 'LLLL' => 'dddd D. MMMM YYYY, HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nd.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nd.php new file mode 100644 index 00000000..d88633c2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nd.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'weekdays' => ['Sonto', 'Mvulo', 'Sibili', 'Sithathu', 'Sine', 'Sihlanu', 'Mgqibelo'], + 'weekdays_short' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], + 'weekdays_min' => ['Son', 'Mvu', 'Sib', 'Sit', 'Sin', 'Sih', 'Mgq'], + 'months' => ['Zibandlela', 'Nhlolanja', 'Mbimbitho', 'Mabasa', 'Nkwenkwezi', 'Nhlangula', 'Ntulikazi', 'Ncwabakazi', 'Mpandula', 'Mfumfu', 'Lwezi', 'Mpalakazi'], + 'months_short' => ['Zib', 'Nhlo', 'Mbi', 'Mab', 'Nkw', 'Nhla', 'Ntu', 'Ncw', 'Mpan', 'Mfu', 'Lwe', 'Mpal'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + + 'year' => 'okweminyaka engu-:count', // less reliable + 'y' => 'okweminyaka engu-:count', // less reliable + 'a_year' => 'okweminyaka engu-:count', // less reliable + + 'month' => 'inyanga ezingu-:count', + 'm' => 'inyanga ezingu-:count', + 'a_month' => 'inyanga ezingu-:count', + + 'week' => 'amaviki angu-:count', + 'w' => 'amaviki angu-:count', + 'a_week' => 'amaviki angu-:count', + + 'day' => 'kwamalanga angu-:count', + 'd' => 'kwamalanga angu-:count', + 'a_day' => 'kwamalanga angu-:count', + + 'hour' => 'amahola angu-:count', + 'h' => 'amahola angu-:count', + 'a_hour' => 'amahola angu-:count', + + 'minute' => 'imizuzu engu-:count', + 'min' => 'imizuzu engu-:count', + 'a_minute' => 'imizuzu engu-:count', + + 'second' => 'imizuzwana engu-:count', + 's' => 'imizuzwana engu-:count', + 'a_second' => 'imizuzwana engu-:count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds.php new file mode 100644 index 00000000..c0b3775e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/nds_DE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php new file mode 100644 index 00000000..a6c57a91 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_DE.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Jannuaar', 'Feberwaar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'], + 'months_short' => ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'], + 'weekdays' => ['Sünndag', 'Maandag', 'Dingsdag', 'Middeweek', 'Dunnersdag', 'Freedag', 'Sünnavend'], + 'weekdays_short' => ['Sdag', 'Maan', 'Ding', 'Midd', 'Dunn', 'Free', 'Svd.'], + 'weekdays_min' => ['Sd', 'Ma', 'Di', 'Mi', 'Du', 'Fr', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count Johr', + 'y' => ':countJ', + 'a_year' => '{1}een Johr|:count Johr', + + 'month' => ':count Maand', + 'm' => ':countM', + 'a_month' => '{1}een Maand|:count Maand', + + 'week' => ':count Week|:count Weken', + 'w' => ':countW', + 'a_week' => '{1}een Week|:count Week|:count Weken', + + 'day' => ':count Dag|:count Daag', + 'd' => ':countD', + 'a_day' => '{1}een Dag|:count Dag|:count Daag', + + 'hour' => ':count Stünn|:count Stünnen', + 'h' => ':countSt', + 'a_hour' => '{1}een Stünn|:count Stünn|:count Stünnen', + + 'minute' => ':count Minuut|:count Minuten', + 'min' => ':countm', + 'a_minute' => '{1}een Minuut|:count Minuut|:count Minuten', + + 'second' => ':count Sekunn|:count Sekunnen', + 's' => ':counts', + 'a_second' => 'en poor Sekunnen|:count Sekunn|:count Sekunnen', + + 'ago' => 'vör :time', + 'from_now' => 'in :time', + 'before' => ':time vörher', + 'after' => ':time later', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php new file mode 100644 index 00000000..de2c57bc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nds_NL.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from Kenneth Christiansen Kenneth Christiansen, Pablo Saratxaga kenneth@gnu.org, pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Jaunuwoa', 'Februwoa', 'Moaz', 'Aprell', 'Mai', 'Juni', 'Juli', 'August', 'Septamba', 'Oktoba', 'Nowamba', 'Dezamba'], + 'months_short' => ['Jan', 'Feb', 'Moz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Now', 'Dez'], + 'weekdays' => ['Sinndag', 'Mondag', 'Dingsdag', 'Meddwäakj', 'Donnadag', 'Friedag', 'Sinnowend'], + 'weekdays_short' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], + 'weekdays_min' => ['Sdg', 'Mdg', 'Dsg', 'Mwk', 'Ddg', 'Fdg', 'Swd'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne.php new file mode 100644 index 00000000..998d13f6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - nootanghimire + * - Josh Soref + * - Nj Subedi + * - JD Isaacks + */ +return [ + 'year' => 'एक बर्ष|:count बर्ष', + 'y' => ':count वर्ष', + 'month' => 'एक महिना|:count महिना', + 'm' => ':count महिना', + 'week' => ':count हप्ता', + 'w' => ':count हप्ता', + 'day' => 'एक दिन|:count दिन', + 'd' => ':count दिन', + 'hour' => 'एक घण्टा|:count घण्टा', + 'h' => ':count घण्टा', + 'minute' => 'एक मिनेट|:count मिनेट', + 'min' => ':count मिनेट', + 'second' => 'केही क्षण|:count सेकेण्ड', + 's' => ':count सेकेण्ड', + 'ago' => ':time अगाडि', + 'from_now' => ':timeमा', + 'after' => ':time पछि', + 'before' => ':time अघि', + 'diff_now' => 'अहिले', + 'diff_today' => 'आज', + 'diff_yesterday' => 'हिजो', + 'diff_tomorrow' => 'भोलि', + 'formats' => [ + 'LT' => 'Aको h:mm बजे', + 'LTS' => 'Aको h:mm:ss बजे', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, Aको h:mm बजे', + 'LLLL' => 'dddd, D MMMM YYYY, Aको h:mm बजे', + ], + 'calendar' => [ + 'sameDay' => '[आज] LT', + 'nextDay' => '[भोलि] LT', + 'nextWeek' => '[आउँदो] dddd[,] LT', + 'lastDay' => '[हिजो] LT', + 'lastWeek' => '[गएको] dddd[,] LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 3) { + return 'राति'; + } + if ($hour < 12) { + return 'बिहान'; + } + if ($hour < 16) { + return 'दिउँसो'; + } + if ($hour < 20) { + return 'साँझ'; + } + + return 'राति'; + }, + 'months' => ['जनवरी', 'फेब्रुवरी', 'मार्च', 'अप्रिल', 'मई', 'जुन', 'जुलाई', 'अगष्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], + 'months_short' => ['जन.', 'फेब्रु.', 'मार्च', 'अप्रि.', 'मई', 'जुन', 'जुलाई.', 'अग.', 'सेप्ट.', 'अक्टो.', 'नोभे.', 'डिसे.'], + 'weekdays' => ['आइतबार', 'सोमबार', 'मङ्गलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], + 'weekdays_short' => ['आइत.', 'सोम.', 'मङ्गल.', 'बुध.', 'बिहि.', 'शुक्र.', 'शनि.'], + 'weekdays_min' => ['आ.', 'सो.', 'मं.', 'बु.', 'बि.', 'शु.', 'श.'], + 'list' => [', ', ' र '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php new file mode 100644 index 00000000..f68d00e3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_IN.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ne.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'yy/M/d', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D, h:mm a', + 'LLLL' => 'YYYY MMMM D, dddd, h:mm a', + ], + 'months' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], + 'months_short' => ['जनवरी', 'फेब्रुअरी', 'मार्च', 'अप्रिल', 'मे', 'जुन', 'जुलाई', 'अगस्ट', 'सेप्टेम्बर', 'अक्टोबर', 'नोभेम्बर', 'डिसेम्बर'], + 'weekend' => [0, 0], + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php new file mode 100644 index 00000000..27840c0f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ne_NP.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ne.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php new file mode 100644 index 00000000..5a858315 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/nhn_MX.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php new file mode 100644 index 00000000..8d06d509 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nhn_MX.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['enero', 'febrero', 'marzo', 'abril', 'mayo', 'junio', 'julio', 'agosto', 'septiembre', 'octubre', 'noviembre', 'diciembre'], + 'months_short' => ['ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'sep', 'oct', 'nov', 'dic'], + 'weekdays' => ['teoilhuitl', 'ceilhuitl', 'omeilhuitl', 'yeilhuitl', 'nahuilhuitl', 'macuililhuitl', 'chicuaceilhuitl'], + 'weekdays_short' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], + 'weekdays_min' => ['teo', 'cei', 'ome', 'yei', 'nau', 'mac', 'chi'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'month' => ':count metztli', // less reliable + 'm' => ':count metztli', // less reliable + 'a_month' => ':count metztli', // less reliable + + 'week' => ':count tonalli', // less reliable + 'w' => ':count tonalli', // less reliable + 'a_week' => ':count tonalli', // less reliable + + 'day' => ':count tonatih', // less reliable + 'd' => ':count tonatih', // less reliable + 'a_day' => ':count tonatih', // less reliable + + 'minute' => ':count toltecayotl', // less reliable + 'min' => ':count toltecayotl', // less reliable + 'a_minute' => ':count toltecayotl', // less reliable + + 'second' => ':count ome', // less reliable + 's' => ':count ome', // less reliable + 'a_second' => ':count ome', // less reliable + + 'year' => ':count xihuitl', + 'y' => ':count xihuitl', + 'a_year' => ':count xihuitl', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu.php new file mode 100644 index 00000000..bd9be8aa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/niu_NU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php new file mode 100644 index 00000000..6e7a697b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/niu_NU.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RockET Systems Emani Fakaotimanava-Lui emani@niue.nu + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Ianuali', 'Fepuali', 'Masi', 'Apelila', 'Me', 'Iuni', 'Iulai', 'Aokuso', 'Sepetema', 'Oketopa', 'Novema', 'Tesemo'], + 'months_short' => ['Ian', 'Fep', 'Mas', 'Ape', 'Me', 'Iun', 'Iul', 'Aok', 'Sep', 'Oke', 'Nov', 'Tes'], + 'weekdays' => ['Aho Tapu', 'Aho Gofua', 'Aho Ua', 'Aho Lotu', 'Aho Tuloto', 'Aho Falaile', 'Aho Faiumu'], + 'weekdays_short' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], + 'weekdays_min' => ['Tapu', 'Gofua', 'Ua', 'Lotu', 'Tuloto', 'Falaile', 'Faiumu'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count tau', + 'y' => ':count tau', + 'a_year' => ':count tau', + + 'month' => ':count mahina', + 'm' => ':count mahina', + 'a_month' => ':count mahina', + + 'week' => ':count faahi tapu', + 'w' => ':count faahi tapu', + 'a_week' => ':count faahi tapu', + + 'day' => ':count aho', + 'd' => ':count aho', + 'a_day' => ':count aho', + + 'hour' => ':count e tulā', + 'h' => ':count e tulā', + 'a_hour' => ':count e tulā', + + 'minute' => ':count minuti', + 'min' => ':count minuti', + 'a_minute' => ':count minuti', + + 'second' => ':count sekone', + 's' => ':count sekone', + 'a_second' => ':count sekone', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl.php new file mode 100644 index 00000000..ccf19257 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Roy + * - Stephan + * - François B + * - Tim Fish + * - Kevin Huang + * - Jacob Middag + * - JD Isaacks + * - Roy + * - Stephan + * - François B + * - Tim Fish + * - Jacob Middag + * - JD Isaacks + * - Propaganistas + * - MegaXLR + * - adriaanzon + * - MonkeyPhysics + * - JeroenG + * - RikSomers + * - proclame + * - Rik de Groot (hwdegroot) + */ +return [ + 'year' => ':count jaar|:count jaar', + 'a_year' => 'een jaar|:count jaar', + 'y' => ':countj', + 'month' => ':count maand|:count maanden', + 'a_month' => 'een maand|:count maanden', + 'm' => ':countmnd', + 'week' => ':count week|:count weken', + 'a_week' => 'een week|:count weken', + 'w' => ':countw', + 'day' => ':count dag|:count dagen', + 'a_day' => 'een dag|:count dagen', + 'd' => ':countd', + 'hour' => ':count uur|:count uur', + 'a_hour' => 'een uur|:count uur', + 'h' => ':countu', + 'minute' => ':count minuut|:count minuten', + 'a_minute' => 'een minuut|:count minuten', + 'min' => ':countmin', + 'second' => ':count seconde|:count seconden', + 'a_second' => 'een paar seconden|:count seconden', + 's' => ':counts', + 'ago' => ':time geleden', + 'from_now' => 'over :time', + 'after' => ':time later', + 'before' => ':time eerder', + 'diff_now' => 'nu', + 'diff_today' => 'vandaag', + 'diff_today_regexp' => 'vandaag(?:\\s+om)?', + 'diff_yesterday' => 'gisteren', + 'diff_yesterday_regexp' => 'gisteren(?:\\s+om)?', + 'diff_tomorrow' => 'morgen', + 'diff_tomorrow_regexp' => 'morgen(?:\\s+om)?', + 'diff_after_tomorrow' => 'overmorgen', + 'diff_before_yesterday' => 'eergisteren', + 'period_recurrences' => ':count keer', + 'period_interval' => static function (string $interval = '') { + /** @var string $output */ + $output = preg_replace('/^(een|één|1)\s+/u', '', $interval); + + if (preg_match('/^(een|één|1)( jaar|j| uur|u)/u', $interval)) { + return "elk $output"; + } + + return "elke $output"; + }, + 'period_start_date' => 'van :date', + 'period_end_date' => 'tot :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD-MM-YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[vandaag om] LT', + 'nextDay' => '[morgen om] LT', + 'nextWeek' => 'dddd [om] LT', + 'lastDay' => '[gisteren om] LT', + 'lastWeek' => '[afgelopen] dddd [om] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + return $number.(($number === 1 || $number === 8 || $number >= 20) ? 'ste' : 'de'); + }, + 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'mmm_suffix' => '.', + 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + 'weekdays_short' => ['zo.', 'ma.', 'di.', 'wo.', 'do.', 'vr.', 'za.'], + 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' en '], + 'meridiem' => ['\'s ochtends', '\'s middags'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php new file mode 100644 index 00000000..5ec136d1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_AW.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Free Software Foundation, Inc. bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/nl.php', [ + 'formats' => [ + 'L' => 'DD-MM-YY', + ], + 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php new file mode 100644 index 00000000..037f5b4a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BE.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Roy + * - Stephan + * - François B + * - Tim Fish + * - Kevin Huang + * - Jacob Middag + * - JD Isaacks + * - Propaganistas + */ +return array_replace_recursive(require __DIR__.'/nl.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php new file mode 100644 index 00000000..c269197b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_BQ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php new file mode 100644 index 00000000..c269197b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_CW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php new file mode 100644 index 00000000..14e4853e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_NL.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/nl.php', [ + 'months' => ['januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mrt', 'apr', 'mei', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['zondag', 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag'], + 'weekdays_short' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + 'weekdays_min' => ['zo', 'ma', 'di', 'wo', 'do', 'vr', 'za'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php new file mode 100644 index 00000000..c269197b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php new file mode 100644 index 00000000..c269197b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nl_SX.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php new file mode 100644 index 00000000..4d1df6e5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nmg.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['maná', 'kugú'], + 'weekdays' => ['sɔ́ndɔ', 'mɔ́ndɔ', 'sɔ́ndɔ mafú mába', 'sɔ́ndɔ mafú málal', 'sɔ́ndɔ mafú mána', 'mabágá má sukul', 'sásadi'], + 'weekdays_short' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], + 'weekdays_min' => ['sɔ́n', 'mɔ́n', 'smb', 'sml', 'smn', 'mbs', 'sas'], + 'months' => ['ngwɛn matáhra', 'ngwɛn ńmba', 'ngwɛn ńlal', 'ngwɛn ńna', 'ngwɛn ńtan', 'ngwɛn ńtuó', 'ngwɛn hɛmbuɛrí', 'ngwɛn lɔmbi', 'ngwɛn rɛbvuâ', 'ngwɛn wum', 'ngwɛn wum navǔr', 'krísimin'], + 'months_short' => ['ng1', 'ng2', 'ng3', 'ng4', 'ng5', 'ng6', 'ng7', 'ng8', 'ng9', 'ng10', 'ng11', 'kris'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn.php new file mode 100644 index 00000000..041f7b29 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Alexander Tømmerås + * - Øystein + * - JD Isaacks + * - Gaute Hvoslef Kvalnes (gaute) + */ +return [ + 'year' => ':count år', + 'a_year' => 'eit år|:count år', + 'y' => ':count år', + 'month' => ':count månad|:count månader', + 'a_month' => 'ein månad|:count månader', + 'm' => ':count md', + 'week' => ':count veke|:count veker', + 'a_week' => 'ei veke|:count veker', + 'w' => ':countv', + 'day' => ':count dag|:count dagar', + 'a_day' => 'ein dag|:count dagar', + 'd' => ':countd', + 'hour' => ':count time|:count timar', + 'a_hour' => 'ein time|:count timar', + 'h' => ':countt', + 'minute' => ':count minutt', + 'a_minute' => 'eit minutt|:count minutt', + 'min' => ':countm', + 'second' => ':count sekund', + 'a_second' => 'nokre sekund|:count sekund', + 's' => ':counts', + 'ago' => ':time sidan', + 'from_now' => 'om :time', + 'after' => ':time etter', + 'before' => ':time før', + 'diff_today' => 'I dag', + 'diff_yesterday' => 'I går', + 'diff_yesterday_regexp' => 'I går(?:\\s+klokka)?', + 'diff_tomorrow' => 'I morgon', + 'diff_tomorrow_regexp' => 'I morgon(?:\\s+klokka)?', + 'diff_today_regexp' => 'I dag(?:\\s+klokka)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY [kl.] H:mm', + 'LLLL' => 'dddd D. MMMM YYYY [kl.] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[I dag klokka] LT', + 'nextDay' => '[I morgon klokka] LT', + 'nextWeek' => 'dddd [klokka] LT', + 'lastDay' => '[I går klokka] LT', + 'lastWeek' => '[Føregåande] dddd [klokka] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['januar', 'februar', 'mars', 'april', 'mai', 'juni', 'juli', 'august', 'september', 'oktober', 'november', 'desember'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'mai', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'des'], + 'weekdays' => ['sundag', 'måndag', 'tysdag', 'onsdag', 'torsdag', 'fredag', 'laurdag'], + 'weekdays_short' => ['sun', 'mån', 'tys', 'ons', 'tor', 'fre', 'lau'], + 'weekdays_min' => ['su', 'må', 'ty', 'on', 'to', 'fr', 'la'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' og '], + 'meridiem' => ['f.m.', 'e.m.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php new file mode 100644 index 00000000..8e168711 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nn_NO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/nn.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php new file mode 100644 index 00000000..007d2399 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nnh.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['mbaʼámbaʼ', 'ncwònzém'], + 'weekdays' => null, + 'weekdays_short' => ['lyɛʼɛ́ sẅíŋtè', 'mvfò lyɛ̌ʼ', 'mbɔ́ɔntè mvfò lyɛ̌ʼ', 'tsètsɛ̀ɛ lyɛ̌ʼ', 'mbɔ́ɔntè tsetsɛ̀ɛ lyɛ̌ʼ', 'mvfò màga lyɛ̌ʼ', 'màga lyɛ̌ʼ'], + 'weekdays_min' => null, + 'months' => null, + 'months_short' => ['saŋ tsetsɛ̀ɛ lùm', 'saŋ kàg ngwóŋ', 'saŋ lepyè shúm', 'saŋ cÿó', 'saŋ tsɛ̀ɛ cÿó', 'saŋ njÿoláʼ', 'saŋ tyɛ̀b tyɛ̀b mbʉ̀ŋ', 'saŋ mbʉ̀ŋ', 'saŋ ngwɔ̀ʼ mbÿɛ', 'saŋ tàŋa tsetsáʼ', 'saŋ mejwoŋó', 'saŋ lùm'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/yy', + 'LL' => 'D MMM, YYYY', + 'LLL' => '[lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', + 'LLLL' => 'dddd , [lyɛ]̌ʼ d [na] MMMM, YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/no.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/no.php new file mode 100644 index 00000000..f4497c75 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/no.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Daniel S. Billing + * - Paul + * - Jimmie Johansson + * - Jens Herlevsen + */ +return array_replace_recursive(require __DIR__.'/nb.php', [ + 'formats' => [ + 'LLL' => 'D. MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D. MMMM YYYY [kl.] HH:mm', + ], + 'calendar' => [ + 'nextWeek' => 'på dddd [kl.] LT', + 'lastWeek' => '[i] dddd[s kl.] LT', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr.php new file mode 100644 index 00000000..1bc999f9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/nr_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php new file mode 100644 index 00000000..50937598 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nr_ZA.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Janabari', 'uFeberbari', 'uMatjhi', 'u-Apreli', 'Meyi', 'Juni', 'Julayi', 'Arhostosi', 'Septemba', 'Oktoba', 'Usinyikhaba', 'Disemba'], + 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mey', 'Jun', 'Jul', 'Arh', 'Sep', 'Okt', 'Usi', 'Dis'], + 'weekdays' => ['uSonto', 'uMvulo', 'uLesibili', 'lesithathu', 'uLesine', 'ngoLesihlanu', 'umGqibelo'], + 'weekdays_short' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], + 'weekdays_min' => ['Son', 'Mvu', 'Bil', 'Tha', 'Ne', 'Hla', 'Gqi'], + 'day_of_first_week_of_year' => 1, + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso.php new file mode 100644 index 00000000..2a6cabbf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/nso_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php new file mode 100644 index 00000000..93da1e78 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nso_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Janaware', 'Febereware', 'Matšhe', 'Aprele', 'Mei', 'June', 'Julae', 'Agostose', 'Setemere', 'Oktobere', 'Nofemere', 'Disemere'], + 'months_short' => ['Jan', 'Feb', 'Mat', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Set', 'Okt', 'Nof', 'Dis'], + 'weekdays' => ['LaMorena', 'Mošupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Mokibelo'], + 'weekdays_short' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], + 'weekdays_min' => ['Son', 'Moš', 'Bed', 'Rar', 'Ne', 'Hla', 'Mok'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count ngwaga', + 'y' => ':count ngwaga', + 'a_year' => ':count ngwaga', + + 'month' => ':count Kgwedi', + 'm' => ':count Kgwedi', + 'a_month' => ':count Kgwedi', + + 'week' => ':count Beke', + 'w' => ':count Beke', + 'a_week' => ':count Beke', + + 'day' => ':count Letšatši', + 'd' => ':count Letšatši', + 'a_day' => ':count Letšatši', + + 'hour' => ':count Iri', + 'h' => ':count Iri', + 'a_hour' => ':count Iri', + + 'minute' => ':count Motsotso', + 'min' => ':count Motsotso', + 'a_minute' => ':count Motsotso', + + 'second' => ':count motsotswana', + 's' => ':count motsotswana', + 'a_second' => ':count motsotswana', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nus.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nus.php new file mode 100644 index 00000000..789bc391 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nus.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['RW', 'TŊ'], + 'weekdays' => ['Cäŋ kuɔth', 'Jiec la̱t', 'Rɛw lätni', 'Diɔ̱k lätni', 'Ŋuaan lätni', 'Dhieec lätni', 'Bäkɛl lätni'], + 'weekdays_short' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], + 'weekdays_min' => ['Cäŋ', 'Jiec', 'Rɛw', 'Diɔ̱k', 'Ŋuaan', 'Dhieec', 'Bäkɛl'], + 'months' => ['Tiop thar pɛt', 'Pɛt', 'Duɔ̱ɔ̱ŋ', 'Guak', 'Duät', 'Kornyoot', 'Pay yie̱tni', 'Tho̱o̱r', 'Tɛɛr', 'Laath', 'Kur', 'Tio̱p in di̱i̱t'], + 'months_short' => ['Tiop', 'Pɛt', 'Duɔ̱ɔ̱', 'Guak', 'Duä', 'Kor', 'Pay', 'Thoo', 'Tɛɛ', 'Laa', 'Kur', 'Tid'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd D MMMM YYYY h:mm a', + ], + + 'year' => ':count jiök', // less reliable + 'y' => ':count jiök', // less reliable + 'a_year' => ':count jiök', // less reliable + + 'month' => ':count pay', // less reliable + 'm' => ':count pay', // less reliable + 'a_month' => ':count pay', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php new file mode 100644 index 00000000..8660ea42 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/nyn.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['Sande', 'Orwokubanza', 'Orwakabiri', 'Orwakashatu', 'Orwakana', 'Orwakataano', 'Orwamukaaga'], + 'weekdays_short' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], + 'weekdays_min' => ['SAN', 'ORK', 'OKB', 'OKS', 'OKN', 'OKT', 'OMK'], + 'months' => ['Okwokubanza', 'Okwakabiri', 'Okwakashatu', 'Okwakana', 'Okwakataana', 'Okwamukaaga', 'Okwamushanju', 'Okwamunaana', 'Okwamwenda', 'Okwaikumi', 'Okwaikumi na kumwe', 'Okwaikumi na ibiri'], + 'months_short' => ['KBZ', 'KBR', 'KST', 'KKN', 'KTN', 'KMK', 'KMS', 'KMN', 'KMW', 'KKM', 'KNK', 'KNB'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc.php new file mode 100644 index 00000000..858cf77b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Quentí + * - Quentin PAGÈS + */ +// @codeCoverageIgnoreStart +use Symfony\Component\Translation\PluralizationRules; + +if (class_exists('Symfony\\Component\\Translation\\PluralizationRules')) { + PluralizationRules::set(static function ($number) { + return $number == 1 ? 0 : 1; + }, 'oc'); +} +// @codeCoverageIgnoreEnd + +return [ + 'year' => ':count an|:count ans', + 'a_year' => 'un an|:count ans', + 'y' => ':count an|:count ans', + 'month' => ':count mes|:count meses', + 'a_month' => 'un mes|:count meses', + 'm' => ':count mes|:count meses', + 'week' => ':count setmana|:count setmanas', + 'a_week' => 'una setmana|:count setmanas', + 'w' => ':count setmana|:count setmanas', + 'day' => ':count jorn|:count jorns', + 'a_day' => 'un jorn|:count jorns', + 'd' => ':count jorn|:count jorns', + 'hour' => ':count ora|:count oras', + 'a_hour' => 'una ora|:count oras', + 'h' => ':count ora|:count oras', + 'minute' => ':count minuta|:count minutas', + 'a_minute' => 'una minuta|:count minutas', + 'min' => ':count minuta|:count minutas', + 'second' => ':count segonda|:count segondas', + 'a_second' => 'una segonda|:count segondas', + 's' => ':count segonda|:count segondas', + 'ago' => 'fa :time', + 'from_now' => 'd\'aquí :time', + 'after' => ':time aprèp', + 'before' => ':time abans', + 'diff_now' => 'ara meteis', + 'diff_today' => 'Uèi', + 'diff_today_regexp' => 'Uèi(?:\\s+a)?', + 'diff_yesterday' => 'ièr', + 'diff_yesterday_regexp' => 'Ièr(?:\\s+a)?', + 'diff_tomorrow' => 'deman', + 'diff_tomorrow_regexp' => 'Deman(?:\\s+a)?', + 'diff_before_yesterday' => 'ièr delà', + 'diff_after_tomorrow' => 'deman passat', + 'period_recurrences' => ':count còp|:count còps', + 'period_interval' => 'cada :interval', + 'period_start_date' => 'de :date', + 'period_end_date' => 'fins a :date', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM [de] YYYY', + 'LLL' => 'D MMMM [de] YYYY [a] H:mm', + 'LLLL' => 'dddd D MMMM [de] YYYY [a] H:mm', + ], + 'calendar' => [ + 'sameDay' => '[Uèi a] LT', + 'nextDay' => '[Deman a] LT', + 'nextWeek' => 'dddd [a] LT', + 'lastDay' => '[Ièr a] LT', + 'lastWeek' => 'dddd [passat a] LT', + 'sameElse' => 'L', + ], + 'months' => ['de genièr', 'de febrièr', 'de març', 'd\'abrial', 'de mai', 'de junh', 'de julhet', 'd\'agost', 'de setembre', 'd’octòbre', 'de novembre', 'de decembre'], + 'months_standalone' => ['genièr', 'febrièr', 'març', 'abrial', 'mai', 'junh', 'julh', 'agost', 'setembre', 'octòbre', 'novembre', 'decembre'], + 'months_short' => ['gen.', 'feb.', 'març', 'abr.', 'mai', 'junh', 'julh', 'ago.', 'sep.', 'oct.', 'nov.', 'dec.'], + 'weekdays' => ['dimenge', 'diluns', 'dimars', 'dimècres', 'dijòus', 'divendres', 'dissabte'], + 'weekdays_short' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], + 'weekdays_min' => ['dg', 'dl', 'dm', 'dc', 'dj', 'dv', 'ds'], + 'ordinal' => static function ($number, string $period = '') { + $ordinal = [1 => 'èr', 2 => 'nd'][(int) $number] ?? 'en'; + + // feminine for week, hour, minute, second + if (preg_match('/^[wWhHgGis]$/', $period)) { + $ordinal .= 'a'; + } + + return $number.$ordinal; + }, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' e '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php new file mode 100644 index 00000000..01eb5c14 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/oc_FR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/oc.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om.php new file mode 100644 index 00000000..3c72dc9e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation & Sagalee Oromoo Publishing Co. Inc. locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'dd-MMM-YYYY', + 'LLL' => 'dd MMMM YYYY HH:mm', + 'LLLL' => 'dddd, MMMM D, YYYY HH:mm', + ], + 'months' => ['Amajjii', 'Guraandhala', 'Bitooteessa', 'Elba', 'Caamsa', 'Waxabajjii', 'Adooleessa', 'Hagayya', 'Fuulbana', 'Onkololeessa', 'Sadaasa', 'Muddee'], + 'months_short' => ['Ama', 'Gur', 'Bit', 'Elb', 'Cam', 'Wax', 'Ado', 'Hag', 'Ful', 'Onk', 'Sad', 'Mud'], + 'weekdays' => ['Dilbata', 'Wiixata', 'Qibxata', 'Roobii', 'Kamiisa', 'Jimaata', 'Sanbata'], + 'weekdays_short' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], + 'weekdays_min' => ['Dil', 'Wix', 'Qib', 'Rob', 'Kam', 'Jim', 'San'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['WD', 'WB'], + + 'year' => 'wggoota :count', + 'y' => 'wggoota :count', + 'a_year' => 'wggoota :count', + + 'month' => 'ji’a :count', + 'm' => 'ji’a :count', + 'a_month' => 'ji’a :count', + + 'week' => 'torban :count', + 'w' => 'torban :count', + 'a_week' => 'torban :count', + + 'day' => 'guyyaa :count', + 'd' => 'guyyaa :count', + 'a_day' => 'guyyaa :count', + + 'hour' => 'saʼaatii :count', + 'h' => 'saʼaatii :count', + 'a_hour' => 'saʼaatii :count', + + 'minute' => 'daqiiqaa :count', + 'min' => 'daqiiqaa :count', + 'a_minute' => 'daqiiqaa :count', + + 'second' => 'sekoondii :count', + 's' => 'sekoondii :count', + 'a_second' => 'sekoondii :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php new file mode 100644 index 00000000..044760e3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_ET.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/om.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php new file mode 100644 index 00000000..f5a4d1c9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/om_KE.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/om.php', [ + 'day_of_first_week_of_year' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or.php new file mode 100644 index 00000000..3aa71732 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/or_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php new file mode 100644 index 00000000..57a89f5d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/or_IN.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM AP Linux Technology Center, Yamato Software Laboratory bug-glibc@gnu.org + */ +return [ + 'diff_now' => 'ବର୍ତ୍ତମାନ', + 'diff_yesterday' => 'ଗତକାଲି', + 'diff_tomorrow' => 'ଆସନ୍ତାକାଲି', + 'formats' => [ + 'LT' => 'Oh:Om A', + 'LTS' => 'Oh:Om:Os A', + 'L' => 'OD-OM-OY', + 'LL' => 'OD MMMM OY', + 'LLL' => 'OD MMMM OY Oh:Om A', + 'LLLL' => 'dddd OD MMMM OY Oh:Om A', + ], + 'months' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], + 'months_short' => ['ଜାନୁଆରୀ', 'ଫେବୃଆରୀ', 'ମାର୍ଚ୍ଚ', 'ଅପ୍ରେଲ', 'ମଇ', 'ଜୁନ', 'ଜୁଲାଇ', 'ଅଗଷ୍ଟ', 'ସେପ୍ଟେମ୍ବର', 'ଅକ୍ଟୋବର', 'ନଭେମ୍ବର', 'ଡିସେମ୍ବର'], + 'weekdays' => ['ରବିବାର', 'ସୋମବାର', 'ମଙ୍ଗଳବାର', 'ବୁଧବାର', 'ଗୁରୁବାର', 'ଶୁକ୍ରବାର', 'ଶନିବାର'], + 'weekdays_short' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], + 'weekdays_min' => ['ରବି', 'ସୋମ', 'ମଙ୍ଗଳ', 'ବୁଧ', 'ଗୁରୁ', 'ଶୁକ୍ର', 'ଶନି'], + 'day_of_first_week_of_year' => 1, + 'alt_numbers' => ['୦', '୧', '୨', '୩', '୪', '୫', '୬', '୭', '୮', '୯', '୧୦', '୧୧', '୧୨', '୧୩', '୧୪', '୧୫', '୧୬', '୧୭', '୧୮', '୧୯', '୨୦', '୨୧', '୨୨', '୨୩', '୨୪', '୨୫', '୨୬', '୨୭', '୨୮', '୨୯', '୩୦', '୩୧', '୩୨', '୩୩', '୩୪', '୩୫', '୩୬', '୩୭', '୩୮', '୩୯', '୪୦', '୪୧', '୪୨', '୪୩', '୪୪', '୪୫', '୪୬', '୪୭', '୪୮', '୪୯', '୫୦', '୫୧', '୫୨', '୫୩', '୫୪', '୫୫', '୫୬', '୫୭', '୫୮', '୫୯', '୬୦', '୬୧', '୬୨', '୬୩', '୬୪', '୬୫', '୬୬', '୬୭', '୬୮', '୬୯', '୭୦', '୭୧', '୭୨', '୭୩', '୭୪', '୭୫', '୭୬', '୭୭', '୭୮', '୭୯', '୮୦', '୮୧', '୮୨', '୮୩', '୮୪', '୮୫', '୮୬', '୮୭', '୮୮', '୮୯', '୯୦', '୯୧', '୯୨', '୯୩', '୯୪', '୯୫', '୯୬', '୯୭', '୯୮', '୯୯'], + 'year' => ':count ବର୍ଷ', + 'y' => ':count ବ.', + 'month' => ':count ମାସ', + 'm' => ':count ମା.', + 'week' => ':count ସପ୍ତାହ', + 'w' => ':count ସପ୍ତା.', + 'day' => ':count ଦିନ', + 'd' => ':count ଦିନ', + 'hour' => ':count ଘଣ୍ତ', + 'h' => ':count ଘ.', + 'minute' => ':count ମିନଟ', + 'min' => ':count ମି.', + 'second' => ':count ସେକଣ୍ଢ', + 's' => ':count ସେ.', + 'ago' => ':time ପୂର୍ବେ', + 'from_now' => ':timeରେ', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os.php new file mode 100644 index 00000000..5f55e8a2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/os_RU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php new file mode 100644 index 00000000..9592d15d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/os_RU.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['январы', 'февралы', 'мартъийы', 'апрелы', 'майы', 'июны', 'июлы', 'августы', 'сентябры', 'октябры', 'ноябры', 'декабры'], + 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], + 'weekdays' => ['Хуыцаубон', 'Къуырисæр', 'Дыццæг', 'Æртыццæг', 'Цыппæрæм', 'Майрæмбон', 'Сабат'], + 'weekdays_short' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], + 'weekdays_min' => ['Хцб', 'Крс', 'Дцг', 'Æрт', 'Цпр', 'Мрб', 'Сбт'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'minute' => ':count гыццыл', // less reliable + 'min' => ':count гыццыл', // less reliable + 'a_minute' => ':count гыццыл', // less reliable + + 'second' => ':count æндæр', // less reliable + 's' => ':count æндæр', // less reliable + 'a_second' => ':count æндæр', // less reliable + + 'year' => ':count аз', + 'y' => ':count аз', + 'a_year' => ':count аз', + + 'month' => ':count мӕй', + 'm' => ':count мӕй', + 'a_month' => ':count мӕй', + + 'week' => ':count къуыри', + 'w' => ':count къуыри', + 'a_week' => ':count къуыри', + + 'day' => ':count бон', + 'd' => ':count бон', + 'a_day' => ':count бон', + + 'hour' => ':count сахат', + 'h' => ':count сахат', + 'a_hour' => ':count сахат', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa.php new file mode 100644 index 00000000..23c2f9e4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - Punjab + */ +return [ + 'year' => 'ਇੱਕ ਸਾਲ|:count ਸਾਲ', + 'month' => 'ਇੱਕ ਮਹੀਨਾ|:count ਮਹੀਨੇ', + 'week' => 'ਹਫਤਾ|:count ਹਫ਼ਤੇ', + 'day' => 'ਇੱਕ ਦਿਨ|:count ਦਿਨ', + 'hour' => 'ਇੱਕ ਘੰਟਾ|:count ਘੰਟੇ', + 'minute' => 'ਇਕ ਮਿੰਟ|:count ਮਿੰਟ', + 'second' => 'ਕੁਝ ਸਕਿੰਟ|:count ਸਕਿੰਟ', + 'ago' => ':time ਪਹਿਲਾਂ', + 'from_now' => ':time ਵਿੱਚ', + 'before' => ':time ਤੋਂ ਪਹਿਲਾਂ', + 'after' => ':time ਤੋਂ ਬਾਅਦ', + 'diff_now' => 'ਹੁਣ', + 'diff_today' => 'ਅਜ', + 'diff_yesterday' => 'ਕਲ', + 'diff_tomorrow' => 'ਕਲ', + 'formats' => [ + 'LT' => 'A h:mm ਵਜੇ', + 'LTS' => 'A h:mm:ss ਵਜੇ', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm ਵਜੇ', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm ਵਜੇ', + ], + 'calendar' => [ + 'sameDay' => '[ਅਜ] LT', + 'nextDay' => '[ਕਲ] LT', + 'nextWeek' => '[ਅਗਲਾ] dddd, LT', + 'lastDay' => '[ਕਲ] LT', + 'lastWeek' => '[ਪਿਛਲੇ] dddd, LT', + 'sameElse' => 'L', + ], + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'ਰਾਤ'; + } + if ($hour < 10) { + return 'ਸਵੇਰ'; + } + if ($hour < 17) { + return 'ਦੁਪਹਿਰ'; + } + if ($hour < 20) { + return 'ਸ਼ਾਮ'; + } + + return 'ਰਾਤ'; + }, + 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], + 'months_short' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], + 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨੀਚਰਵਾਰ'], + 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], + 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁਧ', 'ਵੀਰ', 'ਸ਼ੁਕਰ', 'ਸ਼ਨੀ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' ਅਤੇ '], + 'weekend' => [0, 0], + 'alt_numbers' => ['੦', '੧', '੨', '੩', '੪', '੫', '੬', '੭', '੮', '੯'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php new file mode 100644 index 00000000..39b06532 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Arab.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ur.php', [ + 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], + 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], + 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بُدھ', 'جمعرات', 'جمعہ', 'ہفتہ'], + 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئ', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd, DD MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php new file mode 100644 index 00000000..7adff5c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_Guru.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/pa.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D/M/yy', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY, h:mm a', + ], + 'months' => ['ਜਨਵਰੀ', 'ਫ਼ਰਵਰੀ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈਲ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾਈ', 'ਅਗਸਤ', 'ਸਤੰਬਰ', 'ਅਕਤੂਬਰ', 'ਨਵੰਬਰ', 'ਦਸੰਬਰ'], + 'months_short' => ['ਜਨ', 'ਫ਼ਰ', 'ਮਾਰਚ', 'ਅਪ੍ਰੈ', 'ਮਈ', 'ਜੂਨ', 'ਜੁਲਾ', 'ਅਗ', 'ਸਤੰ', 'ਅਕਤੂ', 'ਨਵੰ', 'ਦਸੰ'], + 'weekdays' => ['ਐਤਵਾਰ', 'ਸੋਮਵਾਰ', 'ਮੰਗਲਵਾਰ', 'ਬੁੱਧਵਾਰ', 'ਵੀਰਵਾਰ', 'ਸ਼ੁੱਕਰਵਾਰ', 'ਸ਼ਨਿੱਚਰਵਾਰ'], + 'weekdays_short' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗਲ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕਰ', 'ਸ਼ਨਿੱਚਰ'], + 'weekdays_min' => ['ਐਤ', 'ਸੋਮ', 'ਮੰਗ', 'ਬੁੱਧ', 'ਵੀਰ', 'ਸ਼ੁੱਕ', 'ਸ਼ਨਿੱ'], + 'weekend' => [0, 0], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php new file mode 100644 index 00000000..ca67642a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_IN.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Guo Xiang Tan + * - Josh Soref + * - Ash + * - harpreetkhalsagtbit + */ +return require __DIR__.'/pa.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php new file mode 100644 index 00000000..494a8776 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pa_PK.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنوري', 'فروري', 'مارچ', 'اپريل', 'مٓی', 'جون', 'جولاي', 'اگست', 'ستمبر', 'اكتوبر', 'نومبر', 'دسمبر'], + 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ص', 'ش'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap.php new file mode 100644 index 00000000..b4c1706f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return [ + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm:ss', + 'L' => 'DD-MM-YY', + 'LL' => 'MMMM [di] DD, YYYY', + 'LLL' => 'DD MMM HH.mm', + 'LLLL' => 'MMMM DD, YYYY HH.mm', + ], + 'months' => ['yanüari', 'febrüari', 'mart', 'aprel', 'mei', 'yüni', 'yüli', 'ougùstùs', 'sèptèmber', 'oktober', 'novèmber', 'desèmber'], + 'months_short' => ['yan', 'feb', 'mar', 'apr', 'mei', 'yün', 'yül', 'oug', 'sèp', 'okt', 'nov', 'des'], + 'weekdays' => ['djadomingo', 'djaluna', 'djamars', 'djawebs', 'djarason', 'djabierne', 'djasabra'], + 'weekdays_short' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], + 'weekdays_min' => ['do', 'lu', 'ma', 'we', 'ra', 'bi', 'sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'year' => ':count aña', + 'month' => ':count luna', + 'week' => ':count siman', + 'day' => ':count dia', + 'hour' => ':count ora', + 'minute' => ':count minüt', + 'second' => ':count sekònde', + 'list' => [', ', ' i '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php new file mode 100644 index 00000000..e9a48ffc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_AW.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com + */ +return require __DIR__.'/pap.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php new file mode 100644 index 00000000..e9a48ffc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pap_CW.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - information from native speaker Pablo Saratxaga pablo@mandrakesoft.com + */ +return require __DIR__.'/pap.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl.php new file mode 100644 index 00000000..35381f33 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl.php @@ -0,0 +1,113 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Wacław Jacek + * - François B + * - Tim Fish + * - Serhan Apaydın + * - Massimiliano Caniparoli + * - JD Isaacks + * - Jakub Szwacz + * - Jan + * - Paul + * - damlys + * - Marek (marast78) + * - Peter (UnrulyNatives) + * - Qrzysio + * - Jan (aso824) + * - diverpl + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count rok|:count lata|:count lat', + 'a_year' => 'rok|:count lata|:count lat', + 'y' => ':count r|:count l|:count l', + 'month' => ':count miesiąc|:count miesiące|:count miesięcy', + 'a_month' => 'miesiąc|:count miesiące|:count miesięcy', + 'm' => ':count mies.', + 'week' => ':count tydzień|:count tygodnie|:count tygodni', + 'a_week' => 'tydzień|:count tygodnie|:count tygodni', + 'w' => ':count tyg.', + 'day' => ':count dzień|:count dni|:count dni', + 'a_day' => 'dzień|:count dni|:count dni', + 'd' => ':count d', + 'hour' => ':count godzina|:count godziny|:count godzin', + 'a_hour' => 'godzina|:count godziny|:count godzin', + 'h' => ':count godz.', + 'minute' => ':count minuta|:count minuty|:count minut', + 'a_minute' => 'minuta|:count minuty|:count minut', + 'min' => ':count min', + 'second' => ':count sekunda|:count sekundy|:count sekund', + 'a_second' => '{1}kilka sekund|:count sekunda|:count sekundy|:count sekund', + 's' => ':count sek.', + 'ago' => ':time temu', + 'from_now' => static function ($time) { + return 'za '.strtr($time, [ + 'godzina' => 'godzinę', + 'minuta' => 'minutę', + 'sekunda' => 'sekundę', + ]); + }, + 'after' => ':time po', + 'before' => ':time przed', + 'diff_now' => 'teraz', + 'diff_today' => 'Dziś', + 'diff_today_regexp' => 'Dziś(?:\\s+o)?', + 'diff_yesterday' => 'wczoraj', + 'diff_yesterday_regexp' => 'Wczoraj(?:\\s+o)?', + 'diff_tomorrow' => 'jutro', + 'diff_tomorrow_regexp' => 'Jutro(?:\\s+o)?', + 'diff_before_yesterday' => 'przedwczoraj', + 'diff_after_tomorrow' => 'pojutrze', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Dziś o] LT', + 'nextDay' => '[Jutro o] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[W niedzielę o] LT', + 2 => '[We wtorek o] LT', + 3 => '[W środę o] LT', + 6 => '[W sobotę o] LT', + default => '[W] dddd [o] LT', + }, + 'lastDay' => '[Wczoraj o] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[W zeszłą niedzielę o] LT', + 3 => '[W zeszłą środę o] LT', + 6 => '[W zeszłą sobotę o] LT', + default => '[W zeszły] dddd [o] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['stycznia', 'lutego', 'marca', 'kwietnia', 'maja', 'czerwca', 'lipca', 'sierpnia', 'września', 'października', 'listopada', 'grudnia'], + 'months_standalone' => ['styczeń', 'luty', 'marzec', 'kwiecień', 'maj', 'czerwiec', 'lipiec', 'sierpień', 'wrzesień', 'październik', 'listopad', 'grudzień'], + 'months_short' => ['sty', 'lut', 'mar', 'kwi', 'maj', 'cze', 'lip', 'sie', 'wrz', 'paź', 'lis', 'gru'], + 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['niedziela', 'poniedziałek', 'wtorek', 'środa', 'czwartek', 'piątek', 'sobota'], + 'weekdays_short' => ['ndz', 'pon', 'wt', 'śr', 'czw', 'pt', 'sob'], + 'weekdays_min' => ['Nd', 'Pn', 'Wt', 'Śr', 'Cz', 'Pt', 'So'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' i '], + 'meridiem' => ['przed południem', 'po południu'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php new file mode 100644 index 00000000..222bcdb4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pl_PL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/prg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/prg.php new file mode 100644 index 00000000..6e63f4ad --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/prg.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], + + 'year' => ':count meta', + 'y' => ':count meta', + 'a_year' => ':count meta', + + 'month' => ':count mēniks', // less reliable + 'm' => ':count mēniks', // less reliable + 'a_month' => ':count mēniks', // less reliable + + 'week' => ':count sawaītin', // less reliable + 'w' => ':count sawaītin', // less reliable + 'a_week' => ':count sawaītin', // less reliable + + 'day' => ':count di', + 'd' => ':count di', + 'a_day' => ':count di', + + 'hour' => ':count bruktēt', // less reliable + 'h' => ':count bruktēt', // less reliable + 'a_hour' => ':count bruktēt', // less reliable + + 'minute' => ':count līkuts', // less reliable + 'min' => ':count līkuts', // less reliable + 'a_minute' => ':count līkuts', // less reliable + + 'second' => ':count kitan', // less reliable + 's' => ':count kitan', // less reliable + 'a_second' => ':count kitan', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps.php new file mode 100644 index 00000000..a928b28e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Muhammad Nasir Rahimi + * - Nassim Nasibullah (spinzar) + */ +return [ + 'year' => ':count کال|:count کاله', + 'y' => ':countکال|:countکاله', + 'month' => ':count مياشت|:count مياشتي', + 'm' => ':countمياشت|:countمياشتي', + 'week' => ':count اونۍ|:count اونۍ', + 'w' => ':countاونۍ|:countاونۍ', + 'day' => ':count ورځ|:count ورځي', + 'd' => ':countورځ|:countورځي', + 'hour' => ':count ساعت|:count ساعته', + 'h' => ':countساعت|:countساعته', + 'minute' => ':count دقيقه|:count دقيقې', + 'min' => ':countدقيقه|:countدقيقې', + 'second' => ':count ثانيه|:count ثانيې', + 's' => ':countثانيه|:countثانيې', + 'ago' => ':time دمخه', + 'from_now' => ':time له اوس څخه', + 'after' => ':time وروسته', + 'before' => ':time دمخه', + 'list' => ['، ', ' او '], + 'meridiem' => ['غ.م.', 'غ.و.'], + 'weekdays' => ['اتوار', 'ګل', 'نهه', 'شورو', 'زيارت', 'جمعه', 'خالي'], + 'weekdays_short' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], + 'weekdays_min' => ['ا', 'ګ', 'ن', 'ش', 'ز', 'ج', 'خ'], + 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سېپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_standalone' => ['جنوري', 'فېبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short_standalone' => ['جنوري', 'فبروري', 'مارچ', 'اپریل', 'مۍ', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'first_day_of_week' => 6, + 'weekend' => [4, 5], + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'YYYY/M/d', + 'LL' => 'YYYY MMM D', + 'LLL' => 'د YYYY د MMMM D H:mm', + 'LLLL' => 'dddd د YYYY د MMMM D H:mm', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php new file mode 100644 index 00000000..6ec51804 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ps_AF.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ps.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt.php new file mode 100644 index 00000000..85dbddcc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Cassiano Montanari + * - Matt Pope + * - François B + * - Prodis + * - JD Isaacks + * - Raphael Amorim + * - João Magalhães + * - victortobias + * - Paulo Freitas + * - Sebastian Thierer + * - Claudson Martins (claudsonm) + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count ano|:count anos', + 'a_year' => 'um ano|:count anos', + 'y' => ':counta', + 'month' => ':count mês|:count meses', + 'a_month' => 'um mês|:count meses', + 'm' => ':countm', + 'week' => ':count semana|:count semanas', + 'a_week' => 'uma semana|:count semanas', + 'w' => ':countsem', + 'day' => ':count dia|:count dias', + 'a_day' => 'um dia|:count dias', + 'd' => ':countd', + 'hour' => ':count hora|:count horas', + 'a_hour' => 'uma hora|:count horas', + 'h' => ':counth', + 'minute' => ':count minuto|:count minutos', + 'a_minute' => 'um minuto|:count minutos', + 'min' => ':countmin', + 'second' => ':count segundo|:count segundos', + 'a_second' => 'alguns segundos|:count segundos', + 's' => ':counts', + 'millisecond' => ':count milissegundo|:count milissegundos', + 'a_millisecond' => 'um milissegundo|:count milissegundos', + 'ms' => ':countms', + 'microsecond' => ':count microssegundo|:count microssegundos', + 'a_microsecond' => 'um microssegundo|:count microssegundos', + 'µs' => ':countµs', + 'ago' => 'há :time', + 'from_now' => 'em :time', + 'after' => ':time depois', + 'before' => ':time antes', + 'diff_now' => 'agora', + 'diff_today' => 'Hoje', + 'diff_today_regexp' => 'Hoje(?:\\s+às)?', + 'diff_yesterday' => 'ontem', + 'diff_yesterday_regexp' => 'Ontem(?:\\s+às)?', + 'diff_tomorrow' => 'amanhã', + 'diff_tomorrow_regexp' => 'Amanhã(?:\\s+às)?', + 'diff_before_yesterday' => 'anteontem', + 'diff_after_tomorrow' => 'depois de amanhã', + 'period_recurrences' => 'uma vez|:count vezes', + 'period_interval' => 'cada :interval', + 'period_start_date' => 'de :date', + 'period_end_date' => 'até :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D [de] MMMM [de] YYYY', + 'LLL' => 'D [de] MMMM [de] YYYY HH:mm', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Hoje às] LT', + 'nextDay' => '[Amanhã às] LT', + 'nextWeek' => 'dddd [às] LT', + 'lastDay' => '[Ontem às] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0, 6 => '[Último] dddd [às] LT', + default => '[Última] dddd [às] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], + 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], + 'weekdays' => ['domingo', 'segunda-feira', 'terça-feira', 'quarta-feira', 'quinta-feira', 'sexta-feira', 'sábado'], + 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], + 'weekdays_min' => ['Do', '2ª', '3ª', '4ª', '5ª', '6ª', 'Sá'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' e '], + 'ordinal_words' => [ + 'of' => 'de', + 'first' => 'primeira', + 'second' => 'segunda', + 'third' => 'terceira', + 'fourth' => 'quarta', + 'fifth' => 'quinta', + 'last' => 'última', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_AO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php new file mode 100644 index 00000000..e917c5cd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Cassiano Montanari + * - Eduardo Dalla Vecchia + * - David Rodrigues + * - Matt Pope + * - François B + * - Prodis + * - Marlon Maxwel + * - JD Isaacks + * - Raphael Amorim + * - Rafael Raupp + * - felipeleite1 + * - swalker + * - Lucas Macedo + * - Paulo Freitas + * - Sebastian Thierer + */ +return array_replace_recursive(require __DIR__.'/pt.php', [ + 'period_recurrences' => 'uma|:count vez', + 'period_interval' => 'toda :interval', + 'formats' => [ + 'LLL' => 'D [de] MMMM [de] YYYY [às] HH:mm', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY [às] HH:mm', + ], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_CV.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GQ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_GW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_LU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php new file mode 100644 index 00000000..f2b5eab7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MO.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/pt.php', [ + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'LLL' => 'D [de] MMMM [de] YYYY, h:mm a', + 'LLLL' => 'dddd, D [de] MMMM [de] YYYY, h:mm a', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php new file mode 100644 index 00000000..fbc0c97b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_MZ.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/pt.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php new file mode 100644 index 00000000..2a76fc1f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_PT.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RAP bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/pt.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['janeiro', 'fevereiro', 'março', 'abril', 'maio', 'junho', 'julho', 'agosto', 'setembro', 'outubro', 'novembro', 'dezembro'], + 'months_short' => ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov', 'dez'], + 'weekdays' => ['domingo', 'segunda', 'terça', 'quarta', 'quinta', 'sexta', 'sábado'], + 'weekdays_short' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], + 'weekdays_min' => ['dom', 'seg', 'ter', 'qua', 'qui', 'sex', 'sáb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_ST.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php new file mode 100644 index 00000000..22c01ec5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/pt_TL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/pt.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu.php new file mode 100644 index 00000000..65278cd1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/es_UY.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM, YYYY HH:mm', + ], + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php new file mode 100644 index 00000000..d5db6bf5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_BO.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/qu.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php new file mode 100644 index 00000000..d5db6bf5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/qu_EC.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/qu.php', [ + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz.php new file mode 100644 index 00000000..1640c02f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/quz_PE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php new file mode 100644 index 00000000..b047e597 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/quz_PE.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sugar Labs // OLPC sugarlabs.org libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['iniru', 'phiwriru', 'marsu', 'awril', 'mayu', 'huniyu', 'huliyu', 'agustu', 'siptiyimri', 'uktuwri', 'nuwiyimri', 'tisiyimri'], + 'months_short' => ['ini', 'phi', 'mar', 'awr', 'may', 'hun', 'hul', 'agu', 'sip', 'ukt', 'nuw', 'tis'], + 'weekdays' => ['tuminku', 'lunis', 'martis', 'miyirkulis', 'juywis', 'wiyirnis', 'sawatu'], + 'weekdays_short' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], + 'weekdays_min' => ['tum', 'lun', 'mar', 'miy', 'juy', 'wiy', 'saw'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'minute' => ':count uchuy', // less reliable + 'min' => ':count uchuy', // less reliable + 'a_minute' => ':count uchuy', // less reliable + + 'year' => ':count wata', + 'y' => ':count wata', + 'a_year' => ':count wata', + + 'month' => ':count killa', + 'm' => ':count killa', + 'a_month' => ':count killa', + + 'week' => ':count simana', + 'w' => ':count simana', + 'a_week' => ':count simana', + + 'day' => ':count pʼunchaw', + 'd' => ':count pʼunchaw', + 'a_day' => ':count pʼunchaw', + + 'hour' => ':count ura', + 'h' => ':count ura', + 'a_hour' => ':count ura', + + 'second' => ':count iskay ñiqin', + 's' => ':count iskay ñiqin', + 'a_second' => ':count iskay ñiqin', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj.php new file mode 100644 index 00000000..26138c9b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/raj_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php new file mode 100644 index 00000000..4a9f0b9d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/raj_IN.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - meghrajsuthar03@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रैल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितंबर', 'अक्टूबर', 'नवंबर', 'दिसंबर'], + 'months_short' => ['जन', 'फर', 'मार्च', 'अप्रै', 'मई', 'जून', 'जुल', 'अग', 'सित', 'अक्टू', 'नव', 'दिस'], + 'weekdays' => ['रविवार', 'सोमवार', 'मंगल्लवार', 'बुधवार', 'बृहस्पतिवार', 'शुक्रवार', 'शनिवार'], + 'weekdays_short' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], + 'weekdays_min' => ['रवि', 'सोम', 'मंगल', 'बुध', 'बृहस्पति', 'शुक्र', 'शनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], + + 'year' => ':count आंहू', // less reliable + 'y' => ':count आंहू', // less reliable + 'a_year' => ':count आंहू', // less reliable + + 'month' => ':count सूरज', // less reliable + 'm' => ':count सूरज', // less reliable + 'a_month' => ':count सूरज', // less reliable + + 'week' => ':count निवाज', // less reliable + 'w' => ':count निवाज', // less reliable + 'a_week' => ':count निवाज', // less reliable + + 'day' => ':count अेक', // less reliable + 'd' => ':count अेक', // less reliable + 'a_day' => ':count अेक', // less reliable + + 'hour' => ':count दुनियांण', // less reliable + 'h' => ':count दुनियांण', // less reliable + 'a_hour' => ':count दुनियांण', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rm.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rm.php new file mode 100644 index 00000000..1843f456 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rm.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - tjku + * - Max Melentiev + * - Juanito Fatas + * - Tsutomu Kuroda + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Nicolás Hock Isaza + * - sebastian de castelberg + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'Do MMMM YYYY', + 'LLL' => 'Do MMMM, HH:mm [Uhr]', + 'LLLL' => 'dddd, Do MMMM YYYY, HH:mm [Uhr]', + ], + 'year' => ':count onn|:count onns', + 'month' => ':count mais', + 'week' => ':count emna|:count emnas', + 'day' => ':count di|:count dis', + 'hour' => ':count oura|:count ouras', + 'minute' => ':count minuta|:count minutas', + 'second' => ':count secunda|:count secundas', + 'weekdays' => ['dumengia', 'glindesdi', 'mardi', 'mesemna', 'gievgia', 'venderdi', 'sonda'], + 'weekdays_short' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], + 'weekdays_min' => ['du', 'gli', 'ma', 'me', 'gie', 've', 'so'], + 'months' => ['schaner', 'favrer', 'mars', 'avrigl', 'matg', 'zercladur', 'fanadur', 'avust', 'settember', 'october', 'november', 'december'], + 'months_short' => ['schan', 'favr', 'mars', 'avr', 'matg', 'zercl', 'fan', 'avust', 'sett', 'oct', 'nov', 'dec'], + 'meridiem' => ['avantmezdi', 'suentermezdi'], + 'list' => [', ', ' e '], + 'first_day_of_week' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rn.php new file mode 100644 index 00000000..8ab958eb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rn.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Z.MU.', 'Z.MW.'], + 'weekdays' => ['Ku w’indwi', 'Ku wa mbere', 'Ku wa kabiri', 'Ku wa gatatu', 'Ku wa kane', 'Ku wa gatanu', 'Ku wa gatandatu'], + 'weekdays_short' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], + 'weekdays_min' => ['cu.', 'mbe.', 'kab.', 'gtu.', 'kan.', 'gnu.', 'gnd.'], + 'months' => ['Nzero', 'Ruhuhuma', 'Ntwarante', 'Ndamukiza', 'Rusama', 'Ruheshi', 'Mukakaro', 'Nyandagaro', 'Nyakanga', 'Gitugutu', 'Munyonyo', 'Kigarama'], + 'months_short' => ['Mut.', 'Gas.', 'Wer.', 'Mat.', 'Gic.', 'Kam.', 'Nya.', 'Kan.', 'Nze.', 'Ukw.', 'Ugu.', 'Uku.'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'year' => 'imyaka :count', + 'y' => 'imyaka :count', + 'a_year' => 'imyaka :count', + + 'month' => 'amezi :count', + 'm' => 'amezi :count', + 'a_month' => 'amezi :count', + + 'week' => 'indwi :count', + 'w' => 'indwi :count', + 'a_week' => 'indwi :count', + + 'day' => 'imisi :count', + 'd' => 'imisi :count', + 'a_day' => 'imisi :count', + + 'hour' => 'amasaha :count', + 'h' => 'amasaha :count', + 'a_hour' => 'amasaha :count', + + 'minute' => 'iminuta :count', + 'min' => 'iminuta :count', + 'a_minute' => 'iminuta :count', + + 'second' => 'inguvu :count', // less reliable + 's' => 'inguvu :count', // less reliable + 'a_second' => 'inguvu :count', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro.php new file mode 100644 index 00000000..868a3279 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - JD Isaacks + * - Cătălin Georgescu + * - Valentin Ivaşcu (oriceon) + */ +return [ + 'year' => ':count an|:count ani|:count ani', + 'a_year' => 'un an|:count ani|:count ani', + 'y' => ':count a.', + 'month' => ':count lună|:count luni|:count luni', + 'a_month' => 'o lună|:count luni|:count luni', + 'm' => ':count l.', + 'week' => ':count săptămână|:count săptămâni|:count săptămâni', + 'a_week' => 'o săptămână|:count săptămâni|:count săptămâni', + 'w' => ':count săp.', + 'day' => ':count zi|:count zile|:count zile', + 'a_day' => 'o zi|:count zile|:count zile', + 'd' => ':count z.', + 'hour' => ':count oră|:count ore|:count ore', + 'a_hour' => 'o oră|:count ore|:count ore', + 'h' => ':count o.', + 'minute' => ':count minut|:count minute|:count minute', + 'a_minute' => 'un minut|:count minute|:count minute', + 'min' => ':count m.', + 'second' => ':count secundă|:count secunde|:count secunde', + 'a_second' => 'câteva secunde|:count secunde|:count secunde', + 's' => ':count sec.', + 'ago' => ':time în urmă', + 'from_now' => 'peste :time', + 'after' => 'peste :time', + 'before' => 'acum :time', + 'diff_now' => 'acum', + 'diff_today' => 'azi', + 'diff_today_regexp' => 'azi(?:\\s+la)?', + 'diff_yesterday' => 'ieri', + 'diff_yesterday_regexp' => 'ieri(?:\\s+la)?', + 'diff_tomorrow' => 'mâine', + 'diff_tomorrow_regexp' => 'mâine(?:\\s+la)?', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY H:mm', + 'LLLL' => 'dddd, D MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[azi la] LT', + 'nextDay' => '[mâine la] LT', + 'nextWeek' => 'dddd [la] LT', + 'lastDay' => '[ieri la] LT', + 'lastWeek' => '[fosta] dddd [la] LT', + 'sameElse' => 'L', + ], + 'months' => ['ianuarie', 'februarie', 'martie', 'aprilie', 'mai', 'iunie', 'iulie', 'august', 'septembrie', 'octombrie', 'noiembrie', 'decembrie'], + 'months_short' => ['ian.', 'feb.', 'mar.', 'apr.', 'mai', 'iun.', 'iul.', 'aug.', 'sept.', 'oct.', 'nov.', 'dec.'], + 'weekdays' => ['duminică', 'luni', 'marți', 'miercuri', 'joi', 'vineri', 'sâmbătă'], + 'weekdays_short' => ['dum', 'lun', 'mar', 'mie', 'joi', 'vin', 'sâm'], + 'weekdays_min' => ['du', 'lu', 'ma', 'mi', 'jo', 'vi', 'sâ'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' și '], + 'meridiem' => ['a.m.', 'p.m.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php new file mode 100644 index 00000000..ad1d2fa8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_MD.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ro.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php new file mode 100644 index 00000000..102afcde --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ro_RO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ro.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rof.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rof.php new file mode 100644 index 00000000..205fc266 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rof.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['kang’ama', 'kingoto'], + 'weekdays' => ['Ijumapili', 'Ijumatatu', 'Ijumanne', 'Ijumatano', 'Alhamisi', 'Ijumaa', 'Ijumamosi'], + 'weekdays_short' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], + 'weekdays_min' => ['Ijp', 'Ijt', 'Ijn', 'Ijtn', 'Alh', 'Iju', 'Ijm'], + 'months' => ['Mweri wa kwanza', 'Mweri wa kaili', 'Mweri wa katatu', 'Mweri wa kaana', 'Mweri wa tanu', 'Mweri wa sita', 'Mweri wa saba', 'Mweri wa nane', 'Mweri wa tisa', 'Mweri wa ikumi', 'Mweri wa ikumi na moja', 'Mweri wa ikumi na mbili'], + 'months_short' => ['M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'M10', 'M11', 'M12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru.php new file mode 100644 index 00000000..fe9607f4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru.php @@ -0,0 +1,180 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Bari Badamshin + * - Jørn Ølmheim + * - François B + * - Tim Fish + * - Коренберг Марк (imac) + * - Serhan Apaydın + * - RomeroMsk + * - vsn4ik + * - JD Isaacks + * - Bari Badamshin + * - Jørn Ølmheim + * - François B + * - Коренберг Марк (imac) + * - Serhan Apaydın + * - RomeroMsk + * - vsn4ik + * - JD Isaacks + * - Fellzo + * - andrey-helldar + * - Pavel Skripkin (psxx) + * - AlexWalkerson + * - Vladislav UnsealedOne + * - dima-bzz + * - Sergey Danilchenko + */ + +use Carbon\CarbonInterface; + +$transformDiff = static fn (string $input) => strtr($input, [ + 'неделя' => 'неделю', + 'секунда' => 'секунду', + 'минута' => 'минуту', +]); + +return [ + 'year' => ':count год|:count года|:count лет', + 'y' => ':count г.|:count г.|:count л.', + 'a_year' => '{1}год|:count год|:count года|:count лет', + 'month' => ':count месяц|:count месяца|:count месяцев', + 'm' => ':count мес.', + 'a_month' => '{1}месяц|:count месяц|:count месяца|:count месяцев', + 'week' => ':count неделя|:count недели|:count недель', + 'w' => ':count нед.', + 'a_week' => '{1}неделя|:count неделю|:count недели|:count недель', + 'day' => ':count день|:count дня|:count дней', + 'd' => ':count д.', + 'a_day' => '{1}день|:count день|:count дня|:count дней', + 'hour' => ':count час|:count часа|:count часов', + 'h' => ':count ч.', + 'a_hour' => '{1}час|:count час|:count часа|:count часов', + 'minute' => ':count минута|:count минуты|:count минут', + 'min' => ':count мин.', + 'a_minute' => '{1}минута|:count минута|:count минуты|:count минут', + 'second' => ':count секунда|:count секунды|:count секунд', + 's' => ':count сек.', + 'a_second' => '{1}несколько секунд|:count секунду|:count секунды|:count секунд', + 'millisecond' => '{1}:count миллисекунда|:count миллисекунды|:count миллисекунд', + 'a_millisecond' => '{1}миллисекунда|:count миллисекунда|:count миллисекунды|:count миллисекунд', + 'ms' => ':count мс', + 'microsecond' => '{1}:count микросекунда|:count микросекунды|:count микросекунд', + 'a_microsecond' => '{1}микросекунда|:count микросекунда|:count микросекунды|:count микросекунд', + 'ago' => static fn (string $time) => $transformDiff($time).' назад', + 'from_now' => static fn (string $time) => 'через '.$transformDiff($time), + 'after' => static fn (string $time) => $transformDiff($time).' после', + 'before' => static fn (string $time) => $transformDiff($time).' до', + 'diff_now' => 'только что', + 'diff_today' => 'Сегодня,', + 'diff_today_regexp' => 'Сегодня,?(?:\\s+в)?', + 'diff_yesterday' => 'вчера', + 'diff_yesterday_regexp' => 'Вчера,?(?:\\s+в)?', + 'diff_tomorrow' => 'завтра', + 'diff_tomorrow_regexp' => 'Завтра,?(?:\\s+в)?', + 'diff_before_yesterday' => 'позавчера', + 'diff_after_tomorrow' => 'послезавтра', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY г.', + 'LLL' => 'D MMMM YYYY г., H:mm', + 'LLLL' => 'dddd, D MMMM YYYY г., H:mm', + ], + 'calendar' => [ + 'sameDay' => '[Сегодня, в] LT', + 'nextDay' => '[Завтра, в] LT', + 'nextWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { + if ($current->week !== $other->week) { + switch ($current->dayOfWeek) { + case 0: + return '[В следующее] dddd, [в] LT'; + case 1: + case 2: + case 4: + return '[В следующий] dddd, [в] LT'; + case 3: + case 5: + case 6: + return '[В следующую] dddd, [в] LT'; + } + } + + if ($current->dayOfWeek === 2) { + return '[Во] dddd, [в] LT'; + } + + return '[В] dddd, [в] LT'; + }, + 'lastDay' => '[Вчера, в] LT', + 'lastWeek' => static function (CarbonInterface $current, \Carbon\CarbonInterface $other) { + if ($current->week !== $other->week) { + switch ($current->dayOfWeek) { + case 0: + return '[В прошлое] dddd, [в] LT'; + case 1: + case 2: + case 4: + return '[В прошлый] dddd, [в] LT'; + case 3: + case 5: + case 6: + return '[В прошлую] dddd, [в] LT'; + } + } + + if ($current->dayOfWeek === 2) { + return '[Во] dddd, [в] LT'; + } + + return '[В] dddd, [в] LT'; + }, + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'M', 'd', 'DDD' => $number.'-й', + 'D' => $number.'-го', + 'w', 'W' => $number.'-я', + default => $number, + }; + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'ночи'; + } + if ($hour < 12) { + return 'утра'; + } + if ($hour < 17) { + return 'дня'; + } + + return 'вечера'; + }, + 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], + 'months_standalone' => ['январь', 'февраль', 'март', 'апрель', 'май', 'июнь', 'июль', 'август', 'сентябрь', 'октябрь', 'ноябрь', 'декабрь'], + 'months_short' => ['янв', 'фев', 'мар', 'апр', 'мая', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'months_short_standalone' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среду', 'четверг', 'пятницу', 'субботу'], + 'weekdays_standalone' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], + 'weekdays_short' => ['вск', 'пнд', 'втр', 'срд', 'чтв', 'птн', 'сбт'], + 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], + 'weekdays_regexp' => '/\[\s*(В|в)\s*((?:прошлую|следующую|эту)\s*)?\]\s*dddd/', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' и '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php new file mode 100644 index 00000000..8ca7df34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_BY.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ru.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php new file mode 100644 index 00000000..8ca7df34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ru.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php new file mode 100644 index 00000000..8ca7df34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_KZ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ru.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php new file mode 100644 index 00000000..8ca7df34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_MD.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ru.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php new file mode 100644 index 00000000..8ca7df34 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_RU.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ru.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php new file mode 100644 index 00000000..db958d68 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ru_UA.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - RFC 2319 bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ru.php', [ + 'weekdays' => ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'], + 'weekdays_short' => ['вск', 'пнд', 'вто', 'срд', 'чтв', 'птн', 'суб'], + 'weekdays_min' => ['вс', 'пн', 'вт', 'ср', 'чт', 'пт', 'су'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw.php new file mode 100644 index 00000000..bc4a347f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/rw_RW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php new file mode 100644 index 00000000..9b3e0682 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rw_RW.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Rwanda Steve Murphy murf@e-tools.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Mutarama', 'Gashyantare', 'Werurwe', 'Mata', 'Gicuransi', 'Kamena', 'Nyakanga', 'Kanama', 'Nzeli', 'Ukwakira', 'Ugushyingo', 'Ukuboza'], + 'months_short' => ['Mut', 'Gas', 'Wer', 'Mat', 'Gic', 'Kam', 'Nya', 'Kan', 'Nze', 'Ukw', 'Ugu', 'Uku'], + 'weekdays' => ['Ku cyumweru', 'Kuwa mbere', 'Kuwa kabiri', 'Kuwa gatatu', 'Kuwa kane', 'Kuwa gatanu', 'Kuwa gatandatu'], + 'weekdays_short' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], + 'weekdays_min' => ['Mwe', 'Mbe', 'Kab', 'Gtu', 'Kan', 'Gnu', 'Gnd'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'second' => ':count vuna', // less reliable + 's' => ':count vuna', // less reliable + 'a_second' => ':count vuna', // less reliable + + 'year' => 'aka :count', + 'y' => 'aka :count', + 'a_year' => 'aka :count', + + 'month' => 'ezi :count', + 'm' => 'ezi :count', + 'a_month' => 'ezi :count', + + 'week' => ':count icyumweru', + 'w' => ':count icyumweru', + 'a_week' => ':count icyumweru', + + 'day' => ':count nsi', + 'd' => ':count nsi', + 'a_day' => ':count nsi', + + 'hour' => 'saha :count', + 'h' => 'saha :count', + 'a_hour' => 'saha :count', + + 'minute' => ':count -nzinya', + 'min' => ':count -nzinya', + 'a_minute' => ':count -nzinya', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php new file mode 100644 index 00000000..ed92e8e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/rwk.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['utuko', 'kyiukonyi'], + 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa.php new file mode 100644 index 00000000..1357c030 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sa_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php new file mode 100644 index 00000000..f2489e8d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sa_IN.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - The Debian project Christian Perrier bubulle@debian.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D-MM-YY', + ], + 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'weekdays' => ['रविवासर:', 'सोमवासर:', 'मंगलवासर:', 'बुधवासर:', 'बृहस्पतिवासरः', 'शुक्रवासर', 'शनिवासर:'], + 'weekdays_short' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], + 'weekdays_min' => ['रविः', 'सोम:', 'मंगल:', 'बुध:', 'बृहस्पतिः', 'शुक्र', 'शनि:'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], + + 'minute' => ':count होरा', // less reliable + 'min' => ':count होरा', // less reliable + 'a_minute' => ':count होरा', // less reliable + + 'year' => ':count वर्ष', + 'y' => ':count वर्ष', + 'a_year' => ':count वर्ष', + + 'month' => ':count मास', + 'm' => ':count मास', + 'a_month' => ':count मास', + + 'week' => ':count सप्ताहः saptahaĥ', + 'w' => ':count सप्ताहः saptahaĥ', + 'a_week' => ':count सप्ताहः saptahaĥ', + + 'day' => ':count दिन', + 'd' => ':count दिन', + 'a_day' => ':count दिन', + + 'hour' => ':count घण्टा', + 'h' => ':count घण्टा', + 'a_hour' => ':count घण्टा', + + 'second' => ':count द्वितीयः', + 's' => ':count द्वितीयः', + 'a_second' => ':count द्वितीयः', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah.php new file mode 100644 index 00000000..b8288242 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sah_RU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php new file mode 100644 index 00000000..94cc0cb0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sah_RU.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Valery Timiriliyev Valery Timiriliyev timiriliyev@gmail.com + */ +return array_replace_recursive(require __DIR__.'/ru.php', [ + 'formats' => [ + 'L' => 'YYYY.MM.DD', + ], + 'months' => ['тохсунньу', 'олунньу', 'кулун тутар', 'муус устар', 'ыам ыйын', 'бэс ыйын', 'от ыйын', 'атырдьах ыйын', 'балаҕан ыйын', 'алтынньы', 'сэтинньи', 'ахсынньы'], + 'months_short' => ['тохс', 'олун', 'кул', 'муус', 'ыам', 'бэс', 'от', 'атыр', 'бал', 'алт', 'сэт', 'ахс'], + 'weekdays' => ['баскыһыанньа', 'бэнидиэнньик', 'оптуорунньук', 'сэрэдэ', 'чэппиэр', 'бээтинсэ', 'субуота'], + 'weekdays_short' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], + 'weekdays_min' => ['бс', 'бн', 'оп', 'ср', 'чп', 'бт', 'сб'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/saq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/saq.php new file mode 100644 index 00000000..ca3f994d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/saq.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['Tesiran', 'Teipa'], + 'weekdays' => ['Mderot ee are', 'Mderot ee kuni', 'Mderot ee ong’wan', 'Mderot ee inet', 'Mderot ee ile', 'Mderot ee sapa', 'Mderot ee kwe'], + 'weekdays_short' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], + 'weekdays_min' => ['Are', 'Kun', 'Ong', 'Ine', 'Ile', 'Sap', 'Kwe'], + 'months' => ['Lapa le obo', 'Lapa le waare', 'Lapa le okuni', 'Lapa le ong’wan', 'Lapa le imet', 'Lapa le ile', 'Lapa le sapa', 'Lapa le isiet', 'Lapa le saal', 'Lapa le tomon', 'Lapa le tomon obo', 'Lapa le tomon waare'], + 'months_short' => ['Obo', 'Waa', 'Oku', 'Ong', 'Ime', 'Ile', 'Sap', 'Isi', 'Saa', 'Tom', 'Tob', 'Tow'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat.php new file mode 100644 index 00000000..c9914c66 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sat_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php new file mode 100644 index 00000000..6c3608b2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sat_IN.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat Pune libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जनवरी', 'फरवरी', 'मार्च', 'अप्रेल', 'मई', 'जुन', 'जुलाई', 'अगस्त', 'सितम्बर', 'अखथबर', 'नवम्बर', 'दिसम्बर'], + 'weekdays' => ['सिंगेमाँहाँ', 'ओतेमाँहाँ', 'बालेमाँहाँ', 'सागुनमाँहाँ', 'सारदीमाँहाँ', 'जारुममाँहाँ', 'ञुहुममाँहाँ'], + 'weekdays_short' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], + 'weekdays_min' => ['सिंगे', 'ओते', 'बाले', 'सागुन', 'सारदी', 'जारुम', 'ञुहुम'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'month' => ':count ńindạ cando', // less reliable + 'm' => ':count ńindạ cando', // less reliable + 'a_month' => ':count ńindạ cando', // less reliable + + 'week' => ':count mãhã', // less reliable + 'w' => ':count mãhã', // less reliable + 'a_week' => ':count mãhã', // less reliable + + 'hour' => ':count ᱥᱳᱱᱚ', // less reliable + 'h' => ':count ᱥᱳᱱᱚ', // less reliable + 'a_hour' => ':count ᱥᱳᱱᱚ', // less reliable + + 'minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable + 'min' => ':count ᱯᱤᱞᱪᱩ', // less reliable + 'a_minute' => ':count ᱯᱤᱞᱪᱩ', // less reliable + + 'second' => ':count ar', // less reliable + 's' => ':count ar', // less reliable + 'a_second' => ':count ar', // less reliable + + 'year' => ':count ne̲s', + 'y' => ':count ne̲s', + 'a_year' => ':count ne̲s', + + 'day' => ':count ᱫᱤᱱ', + 'd' => ':count ᱫᱤᱱ', + 'a_day' => ':count ᱫᱤᱱ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php new file mode 100644 index 00000000..e29ca379 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sbp.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Lwamilawu', 'Pashamihe'], + 'weekdays' => ['Mulungu', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alahamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Mul', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Mupalangulwa', 'Mwitope', 'Mushende', 'Munyi', 'Mushende Magali', 'Mujimbi', 'Mushipepo', 'Mupuguto', 'Munyense', 'Mokhu', 'Musongandembwe', 'Muhaano'], + 'months_short' => ['Mup', 'Mwi', 'Msh', 'Mun', 'Mag', 'Muj', 'Msp', 'Mpg', 'Mye', 'Mok', 'Mus', 'Muh'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc.php new file mode 100644 index 00000000..7178cf4f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sc_IT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php new file mode 100644 index 00000000..5d1e4cec --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sc_IT.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Sardinian Translators Team Massimeddu Cireddu massimeddu@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD. MM. YY', + ], + 'months' => ['Ghennàrgiu', 'Freàrgiu', 'Martzu', 'Abrile', 'Maju', 'Làmpadas', 'Argiolas//Trìulas', 'Austu', 'Cabudanni', 'Santugaine//Ladàmine', 'Onniasantu//Santandria', 'Nadale//Idas'], + 'months_short' => ['Ghe', 'Fre', 'Mar', 'Abr', 'Maj', 'Làm', 'Arg', 'Aus', 'Cab', 'Lad', 'Onn', 'Nad'], + 'weekdays' => ['Domìnigu', 'Lunis', 'Martis', 'Mèrcuris', 'Giòbia', 'Chenàbura', 'Sàbadu'], + 'weekdays_short' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], + 'weekdays_min' => ['Dom', 'Lun', 'Mar', 'Mèr', 'Giò', 'Che', 'Sàb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'minute' => ':count mementu', // less reliable + 'min' => ':count mementu', // less reliable + 'a_minute' => ':count mementu', // less reliable + + 'year' => ':count annu', + 'y' => ':count annu', + 'a_year' => ':count annu', + + 'month' => ':count mese', + 'm' => ':count mese', + 'a_month' => ':count mese', + + 'week' => ':count chida', + 'w' => ':count chida', + 'a_week' => ':count chida', + + 'day' => ':count dí', + 'd' => ':count dí', + 'a_day' => ':count dí', + + 'hour' => ':count ora', + 'h' => ':count ora', + 'a_hour' => ':count ora', + + 'second' => ':count secundu', + 's' => ':count secundu', + 'a_second' => ':count secundu', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd.php new file mode 100644 index 00000000..d91e4d85 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$months = [ + 'جنوري', + 'فيبروري', + 'مارچ', + 'اپريل', + 'مئي', + 'جون', + 'جولاءِ', + 'آگسٽ', + 'سيپٽمبر', + 'آڪٽوبر', + 'نومبر', + 'ڊسمبر', +]; + +$weekdays = [ + 'آچر', + 'سومر', + 'اڱارو', + 'اربع', + 'خميس', + 'جمع', + 'ڇنڇر', +]; + +/* + * Authors: + * - Narain Sagar + * - Sawood Alam + */ +return [ + 'year' => ':count '.'سال', + 'a_year' => '{1}'.'هڪ سال'.'|:count '.'سال', + 'month' => ':count '.'مهينا', + 'a_month' => '{1}'.'هڪ مهينو'.'|:count '.'مهينا', + 'week' => ':count '.'هفتا', + 'a_week' => '{1}'.'ھڪ ھفتو'.'|:count '.'هفتا', + 'day' => ':count '.'ڏينهن', + 'a_day' => '{1}'.'هڪ ڏينهن'.'|:count '.'ڏينهن', + 'hour' => ':count '.'ڪلاڪ', + 'a_hour' => '{1}'.'هڪ ڪلاڪ'.'|:count '.'ڪلاڪ', + 'minute' => ':count '.'منٽ', + 'a_minute' => '{1}'.'هڪ منٽ'.'|:count '.'منٽ', + 'second' => ':count '.'سيڪنڊ', + 'a_second' => '{1}'.'چند سيڪنڊ'.'|:count '.'سيڪنڊ', + 'ago' => ':time اڳ', + 'from_now' => ':time پوء', + 'diff_yesterday' => 'ڪالهه', + 'diff_today' => 'اڄ', + 'diff_tomorrow' => 'سڀاڻي', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd، D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[اڄ] LT', + 'nextDay' => '[سڀاڻي] LT', + 'nextWeek' => 'dddd [اڳين هفتي تي] LT', + 'lastDay' => '[ڪالهه] LT', + 'lastWeek' => '[گزريل هفتي] dddd [تي] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['صبح', 'شام'], + 'months' => $months, + 'months_short' => $months, + 'weekdays' => $weekdays, + 'weekdays_short' => $weekdays, + 'weekdays_min' => $weekdays, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => ['، ', ' ۽ '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php new file mode 100644 index 00000000..de1dad05 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/sd.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], + 'months_short' => ['جنوري', 'فبروري', 'مارچ', 'اپريل', 'مي', 'جون', 'جولاءِ', 'آگسٽ', 'سيپٽيمبر', 'آڪٽوبر', 'نومبر', 'ڊسمبر'], + 'weekdays' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], + 'weekdays_short' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], + 'weekdays_min' => ['آرتوارُ', 'سومرُ', 'منگلُ', 'ٻُڌرُ', 'وسپت', 'جُمو', 'ڇنڇر'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php new file mode 100644 index 00000000..061fcc16 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sd_IN@devanagari.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/sd.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], + 'months_short' => ['जनवरी', 'फबरवरी', 'मार्चि', 'अप्रेल', 'मे', 'जूनि', 'जूलाइ', 'आगस्टु', 'सेप्टेंबरू', 'आक्टूबरू', 'नवंबरू', 'ॾिसंबरू'], + 'weekdays' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], + 'weekdays_short' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], + 'weekdays_min' => ['आर्तवारू', 'सूमरू', 'मंगलू', 'ॿुधरू', 'विस्पति', 'जुमो', 'छंछस'], + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['म.पू.', 'म.नं.'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se.php new file mode 100644 index 00000000..7c4b92a5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Karamell + */ +return [ + 'year' => '{1}:count jahki|:count jagit', + 'a_year' => '{1}okta jahki|:count jagit', + 'y' => ':count j.', + 'month' => '{1}:count mánnu|:count mánut', + 'a_month' => '{1}okta mánnu|:count mánut', + 'm' => ':count mán.', + 'week' => '{1}:count vahkku|:count vahkku', + 'a_week' => '{1}okta vahkku|:count vahkku', + 'w' => ':count v.', + 'day' => '{1}:count beaivi|:count beaivvit', + 'a_day' => '{1}okta beaivi|:count beaivvit', + 'd' => ':count b.', + 'hour' => '{1}:count diimmu|:count diimmut', + 'a_hour' => '{1}okta diimmu|:count diimmut', + 'h' => ':count d.', + 'minute' => '{1}:count minuhta|:count minuhtat', + 'a_minute' => '{1}okta minuhta|:count minuhtat', + 'min' => ':count min.', + 'second' => '{1}:count sekunddat|:count sekunddat', + 'a_second' => '{1}moadde sekunddat|:count sekunddat', + 's' => ':count s.', + 'ago' => 'maŋit :time', + 'from_now' => ':time geažes', + 'diff_yesterday' => 'ikte', + 'diff_yesterday_regexp' => 'ikte(?:\\s+ti)?', + 'diff_today' => 'otne', + 'diff_today_regexp' => 'otne(?:\\s+ti)?', + 'diff_tomorrow' => 'ihttin', + 'diff_tomorrow_regexp' => 'ihttin(?:\\s+ti)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'MMMM D. [b.] YYYY', + 'LLL' => 'MMMM D. [b.] YYYY [ti.] HH:mm', + 'LLLL' => 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[otne ti] LT', + 'nextDay' => '[ihttin ti] LT', + 'nextWeek' => 'dddd [ti] LT', + 'lastDay' => '[ikte ti] LT', + 'lastWeek' => '[ovddit] dddd [ti] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], + 'months_short' => ['ođđj', 'guov', 'njuk', 'cuo', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], + 'weekdays' => ['sotnabeaivi', 'vuossárga', 'maŋŋebárga', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvardat'], + 'weekdays_short' => ['sotn', 'vuos', 'maŋ', 'gask', 'duor', 'bear', 'láv'], + 'weekdays_min' => ['s', 'v', 'm', 'g', 'd', 'b', 'L'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' ja '], + 'meridiem' => ['i.b.', 'e.b.'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php new file mode 100644 index 00000000..cf01805d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_FI.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/se.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'months' => ['ođđajagemánnu', 'guovvamánnu', 'njukčamánnu', 'cuoŋománnu', 'miessemánnu', 'geassemánnu', 'suoidnemánnu', 'borgemánnu', 'čakčamánnu', 'golggotmánnu', 'skábmamánnu', 'juovlamánnu'], + 'months_short' => ['ođđj', 'guov', 'njuk', 'cuoŋ', 'mies', 'geas', 'suoi', 'borg', 'čakč', 'golg', 'skáb', 'juov'], + 'weekdays' => ['sotnabeaivi', 'mánnodat', 'disdat', 'gaskavahkku', 'duorastat', 'bearjadat', 'lávvordat'], + 'weekdays_short' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], + 'weekdays_min' => ['so', 'má', 'di', 'ga', 'du', 'be', 'lá'], + 'meridiem' => ['i', 'e'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php new file mode 100644 index 00000000..177c7e94 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_NO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/se.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php new file mode 100644 index 00000000..177c7e94 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/se_SE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/se.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/seh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/seh.php new file mode 100644 index 00000000..31b5aade --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/seh.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'weekdays' => ['Dimingu', 'Chiposi', 'Chipiri', 'Chitatu', 'Chinai', 'Chishanu', 'Sabudu'], + 'weekdays_short' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], + 'weekdays_min' => ['Dim', 'Pos', 'Pir', 'Tat', 'Nai', 'Sha', 'Sab'], + 'months' => ['Janeiro', 'Fevreiro', 'Marco', 'Abril', 'Maio', 'Junho', 'Julho', 'Augusto', 'Setembro', 'Otubro', 'Novembro', 'Decembro'], + 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Aug', 'Set', 'Otu', 'Nov', 'Dec'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'd [de] MMM [de] YYYY', + 'LLL' => 'd [de] MMMM [de] YYYY HH:mm', + 'LLLL' => 'dddd, d [de] MMMM [de] YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ses.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ses.php new file mode 100644 index 00000000..e1099e65 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ses.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Adduha', 'Aluula'], + 'weekdays' => ['Alhadi', 'Atinni', 'Atalaata', 'Alarba', 'Alhamiisa', 'Alzuma', 'Asibti'], + 'weekdays_short' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], + 'weekdays_min' => ['Alh', 'Ati', 'Ata', 'Ala', 'Alm', 'Alz', 'Asi'], + 'months' => ['Žanwiye', 'Feewiriye', 'Marsi', 'Awiril', 'Me', 'Žuweŋ', 'Žuyye', 'Ut', 'Sektanbur', 'Oktoobur', 'Noowanbur', 'Deesanbur'], + 'months_short' => ['Žan', 'Fee', 'Mar', 'Awi', 'Me', 'Žuw', 'Žuy', 'Ut', 'Sek', 'Okt', 'Noo', 'Dee'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'month' => ':count alaada', // less reliable + 'm' => ':count alaada', // less reliable + 'a_month' => ':count alaada', // less reliable + + 'hour' => ':count ɲaajin', // less reliable + 'h' => ':count ɲaajin', // less reliable + 'a_hour' => ':count ɲaajin', // less reliable + + 'minute' => ':count zarbu', // less reliable + 'min' => ':count zarbu', // less reliable + 'a_minute' => ':count zarbu', // less reliable + + 'year' => ':count jiiri', + 'y' => ':count jiiri', + 'a_year' => ':count jiiri', + + 'week' => ':count jirbiiyye', + 'w' => ':count jirbiiyye', + 'a_week' => ':count jirbiiyye', + + 'day' => ':count zaari', + 'd' => ':count zaari', + 'a_day' => ':count zaari', + + 'second' => ':count ihinkante', + 's' => ':count ihinkante', + 'a_second' => ':count ihinkante', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sg.php new file mode 100644 index 00000000..9264e893 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sg.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['ND', 'LK'], + 'weekdays' => ['Bikua-ôko', 'Bïkua-ûse', 'Bïkua-ptâ', 'Bïkua-usïö', 'Bïkua-okü', 'Lâpôsö', 'Lâyenga'], + 'weekdays_short' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], + 'weekdays_min' => ['Bk1', 'Bk2', 'Bk3', 'Bk4', 'Bk5', 'Lâp', 'Lây'], + 'months' => ['Nyenye', 'Fulundïgi', 'Mbängü', 'Ngubùe', 'Bêläwü', 'Föndo', 'Lengua', 'Kükürü', 'Mvuka', 'Ngberere', 'Nabändüru', 'Kakauka'], + 'months_short' => ['Nye', 'Ful', 'Mbä', 'Ngu', 'Bêl', 'Fön', 'Len', 'Kük', 'Mvu', 'Ngb', 'Nab', 'Kak'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'year' => ':count dā', // less reliable + 'y' => ':count dā', // less reliable + 'a_year' => ':count dā', // less reliable + + 'week' => ':count bïkua-okü', // less reliable + 'w' => ':count bïkua-okü', // less reliable + 'a_week' => ':count bïkua-okü', // less reliable + + 'day' => ':count ziggawâ', // less reliable + 'd' => ':count ziggawâ', // less reliable + 'a_day' => ':count ziggawâ', // less reliable + + 'hour' => ':count yângâködörö', // less reliable + 'h' => ':count yângâködörö', // less reliable + 'a_hour' => ':count yângâködörö', // less reliable + + 'second' => ':count bïkua-ôko', // less reliable + 's' => ':count bïkua-ôko', // less reliable + 'a_second' => ':count bïkua-ôko', // less reliable + + 'month' => ':count Nze tî ngu', + 'm' => ':count Nze tî ngu', + 'a_month' => ':count Nze tî ngu', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php new file mode 100644 index 00000000..864b9892 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sgs_LT.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php new file mode 100644 index 00000000..aa9e942e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sgs_LT.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Arnas Udovičius bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY.MM.DD', + ], + 'months' => ['sausė', 'vasarė', 'kuova', 'balondė', 'gegožės', 'bėrželė', 'lëpas', 'rogpjūtė', 'siejės', 'spalė', 'lapkrėstė', 'grůdė'], + 'months_short' => ['Sau', 'Vas', 'Kuo', 'Bal', 'Geg', 'Bėr', 'Lëp', 'Rgp', 'Sie', 'Spa', 'Lap', 'Grd'], + 'weekdays' => ['nedielės dëna', 'panedielis', 'oterninks', 'sereda', 'četvergs', 'petnīčė', 'sobata'], + 'weekdays_short' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], + 'weekdays_min' => ['Nd', 'Pn', 'Ot', 'Sr', 'Čt', 'Pt', 'Sb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'minute' => ':count mažos', // less reliable + 'min' => ':count mažos', // less reliable + 'a_minute' => ':count mažos', // less reliable + + 'year' => ':count metā', + 'y' => ':count metā', + 'a_year' => ':count metā', + + 'month' => ':count mienou', + 'm' => ':count mienou', + 'a_month' => ':count mienou', + + 'week' => ':count nedielė', + 'w' => ':count nedielė', + 'a_week' => ':count nedielė', + + 'day' => ':count dīna', + 'd' => ':count dīna', + 'a_day' => ':count dīna', + + 'hour' => ':count adīna', + 'h' => ':count adīna', + 'a_hour' => ':count adīna', + + 'second' => ':count Sekondė', + 's' => ':count Sekondė', + 'a_second' => ':count Sekondė', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sh.php new file mode 100644 index 00000000..d65f90ec --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sh.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Томица Кораћ + * - Enrique Vidal + * - Christopher Dell + * - dmilisic + * - danijel + * - Miroslav Matkovic (mikki021) + */ +return [ + 'diff_now' => 'sada', + 'diff_yesterday' => 'juče', + 'diff_tomorrow' => 'sutra', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'MMMM D, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], + 'year' => ':count godina|:count godine|:count godina', + 'y' => ':count g.', + 'month' => ':count mesec|:count meseca|:count meseci', + 'm' => ':count m.', + 'week' => ':count nedelja|:count nedelje|:count nedelja', + 'w' => ':count n.', + 'day' => ':count dan|:count dana|:count dana', + 'd' => ':count d.', + 'hour' => ':count sat|:count sata|:count sati', + 'h' => ':count č.', + 'minute' => ':count minut|:count minuta|:count minuta', + 'min' => ':count min.', + 'second' => ':count sekund|:count sekunde|:count sekundi', + 's' => ':count s.', + 'ago' => 'pre :time', + 'from_now' => 'za :time', + 'after' => 'nakon :time', + 'before' => ':time raniјe', + 'weekdays' => ['Nedelja', 'Ponedeljak', 'Utorak', 'Sreda', 'Četvrtak', 'Petak', 'Subota'], + 'weekdays_short' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], + 'weekdays_min' => ['Ned', 'Pon', 'Uto', 'Sre', 'Čet', 'Pet', 'Sub'], + 'months' => ['Januar', 'Februar', 'Mart', 'April', 'Maj', 'Jun', 'Jul', 'Avgust', 'Septembar', 'Oktobar', 'Novembar', 'Decembar'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'Maj', 'Jun', 'Jul', 'Avg', 'Sep', 'Okt', 'Nov', 'Dec'], + 'list' => [', ', ' i '], + 'meridiem' => ['pre podne', 'po podne'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi.php new file mode 100644 index 00000000..78151869 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], + 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵕⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], + 'weekdays_short' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], + 'weekdays_min' => ['ⴰⵙⴰ', 'ⴰⵢⵏ', 'ⴰⵙⵉ', 'ⴰⴽⵕ', 'ⴰⴽⵡ', 'ⴰⵙⵉⵎ', 'ⴰⵙⵉⴹ'], + 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵜⵓⴱⵔ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], + 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵜⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], + 'first_day_of_week' => 6, + 'weekend' => [5, 6], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'year' => ':count aseggwas', + 'y' => ':count aseggwas', + 'a_year' => ':count aseggwas', + + 'month' => ':count ayyur', + 'm' => ':count ayyur', + 'a_month' => ':count ayyur', + + 'week' => ':count imalass', + 'w' => ':count imalass', + 'a_week' => ':count imalass', + + 'day' => ':count ass', + 'd' => ':count ass', + 'a_day' => ':count ass', + + 'hour' => ':count urɣ', // less reliable + 'h' => ':count urɣ', // less reliable + 'a_hour' => ':count urɣ', // less reliable + + 'minute' => ':count ⴰⵎⵥⵉ', // less reliable + 'min' => ':count ⴰⵎⵥⵉ', // less reliable + 'a_minute' => ':count ⴰⵎⵥⵉ', // less reliable + + 'second' => ':count sin', // less reliable + 's' => ':count sin', // less reliable + 'a_second' => ':count sin', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php new file mode 100644 index 00000000..cddfb242 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Latn.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/shi.php', [ + 'meridiem' => ['tifawt', 'tadggʷat'], + 'weekdays' => ['asamas', 'aynas', 'asinas', 'akṛas', 'akwas', 'asimwas', 'asiḍyas'], + 'weekdays_short' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], + 'weekdays_min' => ['asa', 'ayn', 'asi', 'akṛ', 'akw', 'asim', 'asiḍ'], + 'months' => ['innayr', 'bṛayṛ', 'maṛṣ', 'ibrir', 'mayyu', 'yunyu', 'yulyuz', 'ɣuct', 'cutanbir', 'ktubr', 'nuwanbir', 'dujanbir'], + 'months_short' => ['inn', 'bṛa', 'maṛ', 'ibr', 'may', 'yun', 'yul', 'ɣuc', 'cut', 'ktu', 'nuw', 'duj'], + 'first_day_of_week' => 6, + 'weekend' => [5, 6], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + + 'minute' => ':count agur', // less reliable + 'min' => ':count agur', // less reliable + 'a_minute' => ':count agur', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php new file mode 100644 index 00000000..f3df1f2c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shi_Tfng.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/shi.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn.php new file mode 100644 index 00000000..fe7b1ea5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/shn_MM.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php new file mode 100644 index 00000000..9eeba47f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shn_MM.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - ubuntu Myanmar LoCo Team https://ubuntu-mm.net Bone Pyae Sone bone.burma@mail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'OY MMM OD dddd', + ], + 'months' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], + 'months_short' => ['လိူၼ်ၵမ်', 'လိူၼ်သၢမ်', 'လိူၼ်သီ', 'လိူၼ်ႁႃႈ', 'လိူၼ်ႁူၵ်း', 'လိူၼ်ၸဵတ်း', 'လိူၼ်ပႅတ်ႇ', 'လိူၼ်ၵဝ်ႈ', 'လိူၼ်သိပ်း', 'လိူၼ်သိပ်းဢိတ်း', 'လိူၼ်သိပ်းဢိတ်းသွင်', 'လိူၼ်ၸဵင်'], + 'weekdays' => ['ဝၼ်းဢႃးတိတ်ႉ', 'ဝၼ်းၸၼ်', 'ဝၼ်း​ဢၢင်း​ၵၢၼ်း', 'ဝၼ်းပူတ်ႉ', 'ဝၼ်းၽတ်း', 'ဝၼ်းသုၵ်း', 'ဝၼ်းသဝ်'], + 'weekdays_short' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], + 'weekdays_min' => ['တိတ့်', 'ၸၼ်', 'ၵၢၼ်း', 'ပုတ့်', 'ၽတ်း', 'သုၵ်း', 'သဝ်'], + 'alt_numbers' => ['႐႐', '႐႑', '႐႒', '႐႓', '႐႔', '႐႕', '႐႖', '႐႗', '႐႘', '႐႙', '႑႐', '႑႑', '႑႒', '႑႓', '႑႔', '႑႕', '႑႖', '႑႗', '႑႘', '႑႙', '႒႐', '႒႑', '႒႒', '႒႓', '႒႔', '႒႕', '႒႖', '႒႗', '႒႘', '႒႙', '႓႐', '႓႑', '႓႒', '႓႓', '႓႔', '႓႕', '႓႖', '႓႗', '႓႘', '႓႙', '႔႐', '႔႑', '႔႒', '႔႓', '႔႔', '႔႕', '႔႖', '႔႗', '႔႘', '႔႙', '႕႐', '႕႑', '႕႒', '႕႓', '႕႔', '႕႕', '႕႖', '႕႗', '႕႘', '႕႙', '႖႐', '႖႑', '႖႒', '႖႓', '႖႔', '႖႕', '႖႖', '႖႗', '႖႘', '႖႙', '႗႐', '႗႑', '႗႒', '႗႓', '႗႔', '႗႕', '႗႖', '႗႗', '႗႘', '႗႙', '႘႐', '႘႑', '႘႒', '႘႓', '႘႔', '႘႕', '႘႖', '႘႗', '႘႘', '႘႙', '႙႐', '႙႑', '႙႒', '႙႓', '႙႔', '႙႕', '႙႖', '႙႗', '႙႘', '႙႙'], + 'meridiem' => ['ၵၢင်ၼႂ်', 'တၢမ်းၶမ်ႈ'], + + 'month' => ':count လိူၼ်', // less reliable + 'm' => ':count လိူၼ်', // less reliable + 'a_month' => ':count လိူၼ်', // less reliable + + 'week' => ':count ဝၼ်း', // less reliable + 'w' => ':count ဝၼ်း', // less reliable + 'a_week' => ':count ဝၼ်း', // less reliable + + 'hour' => ':count ຕີ', // less reliable + 'h' => ':count ຕີ', // less reliable + 'a_hour' => ':count ຕີ', // less reliable + + 'minute' => ':count ເດັກ', // less reliable + 'min' => ':count ເດັກ', // less reliable + 'a_minute' => ':count ເດັກ', // less reliable + + 'second' => ':count ဢိုၼ်ႇ', // less reliable + 's' => ':count ဢိုၼ်ႇ', // less reliable + 'a_second' => ':count ဢိုၼ်ႇ', // less reliable + + 'year' => ':count ပီ', + 'y' => ':count ပီ', + 'a_year' => ':count ပီ', + + 'day' => ':count ກາງວັນ', + 'd' => ':count ກາງວັນ', + 'a_day' => ':count ກາງວັນ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs.php new file mode 100644 index 00000000..8d2e1d7d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/shs_CA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php new file mode 100644 index 00000000..f41c34df --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/shs_CA.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Neskie Manuel bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Pellkwet̓min', 'Pelctsipwen̓ten', 'Pellsqépts', 'Peslléwten', 'Pell7ell7é7llqten', 'Pelltspéntsk', 'Pelltqwelq̓wél̓t', 'Pellct̓éxel̓cten', 'Pesqelqlélten', 'Pesllwélsten', 'Pellc7ell7é7llcwten̓', 'Pelltetétq̓em'], + 'months_short' => ['Kwe', 'Tsi', 'Sqe', 'Éwt', 'Ell', 'Tsp', 'Tqw', 'Ct̓é', 'Qel', 'Wél', 'U7l', 'Tet'], + 'weekdays' => ['Sxetspesq̓t', 'Spetkesq̓t', 'Selesq̓t', 'Skellesq̓t', 'Smesesq̓t', 'Stselkstesq̓t', 'Stqmekstesq̓t'], + 'weekdays_short' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], + 'weekdays_min' => ['Sxe', 'Spe', 'Sel', 'Ske', 'Sme', 'Sts', 'Stq'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count sqlélten', // less reliable + 'y' => ':count sqlélten', // less reliable + 'a_year' => ':count sqlélten', // less reliable + + 'month' => ':count swewll', // less reliable + 'm' => ':count swewll', // less reliable + 'a_month' => ':count swewll', // less reliable + + 'hour' => ':count seqwlút', // less reliable + 'h' => ':count seqwlút', // less reliable + 'a_hour' => ':count seqwlút', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si.php new file mode 100644 index 00000000..7d14ca6c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Serhan Apaydın + * - JD Isaacks + * - Malinda Weerasinghe (MalindaWMD) + */ +return [ + 'year' => '{1}වසර 1|වසර :count', + 'a_year' => '{1}වසරක්|වසර :count', + 'month' => '{1}මාස 1|මාස :count', + 'a_month' => '{1}මාසය|මාස :count', + 'week' => '{1}සති 1|සති :count', + 'a_week' => '{1}සතියක්|සති :count', + 'day' => '{1}දින 1|දින :count', + 'a_day' => '{1}දිනක්|දින :count', + 'hour' => '{1}පැය 1|පැය :count', + 'a_hour' => '{1}පැයක්|පැය :count', + 'minute' => '{1}මිනිත්තු 1|මිනිත්තු :count', + 'a_minute' => '{1}මිනිත්තුවක්|මිනිත්තු :count', + 'second' => '{1}තත්පර 1|තත්පර :count', + 'a_second' => '{1}තත්පර කිහිපයකට|තත්පර :count', + 'ago' => ':time කට පෙර', + 'from_now' => static function ($time) { + if (preg_match('/දින \d+/u', $time)) { + return $time.' න්'; + } + + return $time.' කින්'; + }, + 'before' => ':time කට පෙර', + 'after' => static function ($time) { + if (preg_match('/දින \d+/u', $time)) { + return $time.' න්'; + } + + return $time.' කින්'; + }, + 'diff_now' => 'දැන්', + 'diff_today' => 'අද', + 'diff_yesterday' => 'ඊයේ', + 'diff_tomorrow' => 'හෙට', + 'formats' => [ + 'LT' => 'a h:mm', + 'LTS' => 'a h:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY MMMM D', + 'LLL' => 'YYYY MMMM D, a h:mm', + 'LLLL' => 'YYYY MMMM D [වැනි] dddd, a h:mm:ss', + ], + 'calendar' => [ + 'sameDay' => '[අද] LT[ට]', + 'nextDay' => '[හෙට] LT[ට]', + 'nextWeek' => 'dddd LT[ට]', + 'lastDay' => '[ඊයේ] LT[ට]', + 'lastWeek' => '[පසුගිය] dddd LT[ට]', + 'sameElse' => 'L', + ], + 'ordinal' => ':number වැනි', + 'meridiem' => ['පෙර වරු', 'පස් වරු', 'පෙ.ව.', 'ප.ව.'], + 'months' => ['ජනවාරි', 'පෙබරවාරි', 'මාර්තු', 'අප්‍රේල්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝස්තු', 'සැප්තැම්බර්', 'ඔක්තෝබර්', 'නොවැම්බර්', 'දෙසැම්බර්'], + 'months_short' => ['ජන', 'පෙබ', 'මාර්', 'අප්', 'මැයි', 'ජූනි', 'ජූලි', 'අගෝ', 'සැප්', 'ඔක්', 'නොවැ', 'දෙසැ'], + 'weekdays' => ['ඉරිදා', 'සඳුදා', 'අඟහරුවාදා', 'බදාදා', 'බ්‍රහස්පතින්දා', 'සිකුරාදා', 'සෙනසුරාදා'], + 'weekdays_short' => ['ඉරි', 'සඳු', 'අඟ', 'බදා', 'බ්‍රහ', 'සිකු', 'සෙන'], + 'weekdays_min' => ['ඉ', 'ස', 'අ', 'බ', 'බ්‍ර', 'සි', 'සෙ'], + 'first_day_of_week' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php new file mode 100644 index 00000000..81c44e0e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/si_LK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/si.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid.php new file mode 100644 index 00000000..b1c65218 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sid_ET.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php new file mode 100644 index 00000000..5e9632d1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sid_ET.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + 'weekdays' => ['Sambata', 'Sanyo', 'Maakisanyo', 'Roowe', 'Hamuse', 'Arbe', 'Qidaame'], + 'weekdays_short' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], + 'weekdays_min' => ['Sam', 'San', 'Mak', 'Row', 'Ham', 'Arb', 'Qid'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['soodo', 'hawwaro'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk.php new file mode 100644 index 00000000..051e9356 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk.php @@ -0,0 +1,160 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Martin Suja + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Juanito Fatas + * - Ivan Stana + * - Akira Matsuda + * - Christopher Dell + * - James McKinney + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Jozef Fulop + * - Nicolás Hock Isaza + * - Tom Hughes + * - Simon Hürlimann (CyT) + * - jofi + * - Jakub ADAMEC + * - Marek Adamický + * - AlterwebStudio + * - Peter Kundis + */ + +use Carbon\CarbonInterface; + +$fromNow = function ($time) { + return 'o '.strtr($time, [ + 'hodina' => 'hodinu', + 'minúta' => 'minútu', + 'sekunda' => 'sekundu', + ]); +}; + +$ago = function ($time) { + $replacements = [ + '/\bhodina\b/' => 'hodinou', + '/\bminúta\b/' => 'minútou', + '/\bsekunda\b/' => 'sekundou', + '/\bdeň\b/u' => 'dňom', + '/\btýždeň\b/u' => 'týždňom', + '/\bmesiac\b/' => 'mesiacom', + '/\brok\b/' => 'rokom', + ]; + + $replacementsPlural = [ + '/\b(?:hodiny|hodín)\b/' => 'hodinami', + '/\b(?:minúty|minút)\b/' => 'minútami', + '/\b(?:sekundy|sekúnd)\b/' => 'sekundami', + '/\bdeň\b/' => 'dňom', + '/\bdni\b/' => 'dňami', + '/\bdní\b/u' => 'dňami', + '/\b(?:týždne|týždňov)\b/' => 'týždňami', + '/\b(?:mesiace|mesiacov)\b/' => 'mesiacmi', + '/\b(?:roky|rokov)\b/' => 'rokmi', + ]; + + foreach ($replacements + $replacementsPlural as $pattern => $replacement) { + $time = preg_replace($pattern, $replacement, $time); + } + + return "pred $time"; +}; + +return [ + 'year' => ':count rok|:count roky|:count rokov', + 'a_year' => 'rok|:count roky|:count rokov', + 'y' => ':count r', + 'month' => ':count mesiac|:count mesiace|:count mesiacov', + 'a_month' => 'mesiac|:count mesiace|:count mesiacov', + 'm' => ':count m', + 'week' => ':count týždeň|:count týždne|:count týždňov', + 'a_week' => 'týždeň|:count týždne|:count týždňov', + 'w' => ':count t', + 'day' => ':count deň|:count dni|:count dní', + 'a_day' => 'deň|:count dni|:count dní', + 'd' => ':count d', + 'hour' => ':count hodina|:count hodiny|:count hodín', + 'a_hour' => 'hodina|:count hodiny|:count hodín', + 'h' => ':count h', + 'minute' => ':count minúta|:count minúty|:count minút', + 'a_minute' => 'minúta|:count minúty|:count minút', + 'min' => ':count min', + 'second' => ':count sekunda|:count sekundy|:count sekúnd', + 'a_second' => 'sekunda|:count sekundy|:count sekúnd', + 's' => ':count s', + 'millisecond' => ':count milisekunda|:count milisekundy|:count milisekúnd', + 'a_millisecond' => 'milisekunda|:count milisekundy|:count milisekúnd', + 'ms' => ':count ms', + 'microsecond' => ':count mikrosekunda|:count mikrosekundy|:count mikrosekúnd', + 'a_microsecond' => 'mikrosekunda|:count mikrosekundy|:count mikrosekúnd', + 'µs' => ':count µs', + + 'ago' => $ago, + 'from_now' => $fromNow, + 'before' => ':time pred', + 'after' => ':time po', + + 'hour_after' => ':count hodinu|:count hodiny|:count hodín', + 'minute_after' => ':count minútu|:count minúty|:count minút', + 'second_after' => ':count sekundu|:count sekundy|:count sekúnd', + + 'hour_before' => ':count hodinu|:count hodiny|:count hodín', + 'minute_before' => ':count minútu|:count minúty|:count minút', + 'second_before' => ':count sekundu|:count sekundy|:count sekúnd', + + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' a '], + 'diff_now' => 'teraz', + 'diff_yesterday' => 'včera', + 'diff_tomorrow' => 'zajtra', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'DD. MMMM YYYY', + 'LLL' => 'D. M. HH:mm', + 'LLLL' => 'dddd D. MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[dnes o] LT', + 'nextDay' => '[zajtra o] LT', + 'lastDay' => '[včera o] LT', + 'nextWeek' => 'dddd [o] LT', + 'lastWeek' => static function (CarbonInterface $date) { + switch ($date->dayOfWeek) { + case 1: + case 2: + case 4: + case 5: + return '[minulý] dddd [o] LT'; //pondelok/utorok/štvrtok/piatok + default: + return '[minulá] dddd [o] LT'; + } + }, + 'sameElse' => 'L', + ], + 'weekdays' => ['nedeľa', 'pondelok', 'utorok', 'streda', 'štvrtok', 'piatok', 'sobota'], + 'weekdays_short' => ['ned', 'pon', 'uto', 'str', 'štv', 'pia', 'sob'], + 'weekdays_min' => ['ne', 'po', 'ut', 'st', 'št', 'pi', 'so'], + 'months' => ['januára', 'februára', 'marca', 'apríla', 'mája', 'júna', 'júla', 'augusta', 'septembra', 'októbra', 'novembra', 'decembra'], + 'months_standalone' => ['január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'máj', 'jún', 'júl', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'months_regexp' => '/(DD?o?\.?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'meridiem' => ['dopoludnia', 'popoludní'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php new file mode 100644 index 00000000..0515601a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sk_SK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sk.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl.php new file mode 100644 index 00000000..012742e1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Juanito Fatas + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Nicolás Hock Isaza + * - Miha Rebernik + * - Gal Jakič (morpheus7CS) + * - Glavić + * - Anže Časar + * - Lovro Tramšek (Lovro1107) + * - burut13 + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count leto|:count leti|:count leta|:count let', + 'y' => ':count leto|:count leti|:count leta|:count let', + 'month' => ':count mesec|:count meseca|:count mesece|:count mesecev', + 'm' => ':count mes.', + 'week' => ':count teden|:count tedna|:count tedne|:count tednov', + 'w' => ':count ted.', + 'day' => ':count dan|:count dni|:count dni|:count dni', + 'd' => ':count dan|:count dni|:count dni|:count dni', + 'hour' => ':count ura|:count uri|:count ure|:count ur', + 'h' => ':count h', + 'minute' => ':count minuta|:count minuti|:count minute|:count minut', + 'min' => ':count min.', + 'second' => ':count sekunda|:count sekundi|:count sekunde|:count sekund', + 'a_second' => '{1}nekaj sekund|:count sekunda|:count sekundi|:count sekunde|:count sekund', + 's' => ':count s', + + 'year_ago' => ':count letom|:count letoma|:count leti|:count leti', + 'y_ago' => ':count letom|:count letoma|:count leti|:count leti', + 'month_ago' => ':count mesecem|:count mesecema|:count meseci|:count meseci', + 'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni', + 'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', + 'd_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi', + 'hour_ago' => ':count uro|:count urama|:count urami|:count urami', + 'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami', + 'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami', + + 'day_from_now' => ':count dan|:count dneva|:count dni|:count dni', + 'd_from_now' => ':count dan|:count dneva|:count dni|:count dni', + 'hour_from_now' => ':count uro|:count uri|:count ure|:count ur', + 'minute_from_now' => ':count minuto|:count minuti|:count minute|:count minut', + 'second_from_now' => ':count sekundo|:count sekundi|:count sekunde|:count sekund', + + 'ago' => 'pred :time', + 'from_now' => 'čez :time', + 'after' => ':time kasneje', + 'before' => ':time prej', + + 'diff_now' => 'ravnokar', + 'diff_today' => 'danes', + 'diff_today_regexp' => 'danes(?:\\s+ob)?', + 'diff_yesterday' => 'včeraj', + 'diff_yesterday_regexp' => 'včeraj(?:\\s+ob)?', + 'diff_tomorrow' => 'jutri', + 'diff_tomorrow_regexp' => 'jutri(?:\\s+ob)?', + 'diff_before_yesterday' => 'predvčerajšnjim', + 'diff_after_tomorrow' => 'pojutrišnjem', + + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'period_start_date' => 'od :date', + 'period_end_date' => 'do :date', + + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[danes ob] LT', + 'nextDay' => '[jutri ob] LT', + 'nextWeek' => 'dddd [ob] LT', + 'lastDay' => '[včeraj ob] LT', + 'lastWeek' => static function (CarbonInterface $date) { + switch ($date->dayOfWeek) { + case 0: + return '[preteklo] [nedeljo] [ob] LT'; + case 1: + return '[pretekli] [ponedeljek] [ob] LT'; + case 2: + return '[pretekli] [torek] [ob] LT'; + case 3: + return '[preteklo] [sredo] [ob] LT'; + case 4: + return '[pretekli] [četrtek] [ob] LT'; + case 5: + return '[pretekli] [petek] [ob] LT'; + case 6: + return '[preteklo] [soboto] [ob] LT'; + } + }, + 'sameElse' => 'L', + ], + 'months' => ['januar', 'februar', 'marec', 'april', 'maj', 'junij', 'julij', 'avgust', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'avg', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['nedelja', 'ponedeljek', 'torek', 'sreda', 'četrtek', 'petek', 'sobota'], + 'weekdays_short' => ['ned', 'pon', 'tor', 'sre', 'čet', 'pet', 'sob'], + 'weekdays_min' => ['ne', 'po', 'to', 'sr', 'če', 'pe', 'so'], + 'list' => [', ', ' in '], + 'meridiem' => ['dopoldan', 'popoldan'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php new file mode 100644 index 00000000..5dad8c81 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sl_SI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm.php new file mode 100644 index 00000000..e8c118ac --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/sm_WS.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php new file mode 100644 index 00000000..1568af6e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sm_WS.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Ianuari', 'Fepuari', 'Mati', 'Aperila', 'Me', 'Iuni', 'Iulai', 'Auguso', 'Setema', 'Oketopa', 'Novema', 'Tesema'], + 'months_short' => ['Ian', 'Fep', 'Mat', 'Ape', 'Me', 'Iun', 'Iul', 'Aug', 'Set', 'Oke', 'Nov', 'Tes'], + 'weekdays' => ['Aso Sa', 'Aso Gafua', 'Aso Lua', 'Aso Lulu', 'Aso Tofi', 'Aso Farail', 'Aso To\'ana\'i'], + 'weekdays_short' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], + 'weekdays_min' => ['Aso Sa', 'Aso Gaf', 'Aso Lua', 'Aso Lul', 'Aso Tof', 'Aso Far', 'Aso To\''], + + 'hour' => ':count uati', // less reliable + 'h' => ':count uati', // less reliable + 'a_hour' => ':count uati', // less reliable + + 'minute' => ':count itiiti', // less reliable + 'min' => ':count itiiti', // less reliable + 'a_minute' => ':count itiiti', // less reliable + + 'second' => ':count lua', // less reliable + 's' => ':count lua', // less reliable + 'a_second' => ':count lua', // less reliable + + 'year' => ':count tausaga', + 'y' => ':count tausaga', + 'a_year' => ':count tausaga', + + 'month' => ':count māsina', + 'm' => ':count māsina', + 'a_month' => ':count māsina', + + 'week' => ':count vaiaso', + 'w' => ':count vaiaso', + 'a_week' => ':count vaiaso', + + 'day' => ':count aso', + 'd' => ':count aso', + 'a_day' => ':count aso', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/smn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/smn.php new file mode 100644 index 00000000..20add023 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/smn.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['ip.', 'ep.'], + 'weekdays' => ['pasepeeivi', 'vuossaargâ', 'majebaargâ', 'koskoho', 'tuorâstuv', 'vástuppeeivi', 'lávurduv'], + 'weekdays_short' => ['pas', 'vuo', 'maj', 'kos', 'tuo', 'vás', 'láv'], + 'weekdays_min' => ['pa', 'vu', 'ma', 'ko', 'tu', 'vá', 'lá'], + 'weekdays_standalone' => ['pasepeivi', 'vuossargâ', 'majebargâ', 'koskokko', 'tuorâstâh', 'vástuppeivi', 'lávurdâh'], + 'months' => ['uđđâivemáánu', 'kuovâmáánu', 'njuhčâmáánu', 'cuáŋuimáánu', 'vyesimáánu', 'kesimáánu', 'syeinimáánu', 'porgemáánu', 'čohčâmáánu', 'roovvâdmáánu', 'skammâmáánu', 'juovlâmáánu'], + 'months_short' => ['uđiv', 'kuovâ', 'njuhčâ', 'cuáŋui', 'vyesi', 'kesi', 'syeini', 'porge', 'čohčâ', 'roovvâd', 'skammâ', 'juovlâ'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'H.mm', + 'LTS' => 'H.mm.ss', + 'L' => 'D.M.YYYY', + 'LL' => 'MMM D. YYYY', + 'LLL' => 'MMMM D. YYYY H.mm', + 'LLLL' => 'dddd, MMMM D. YYYY H.mm', + ], + + 'hour' => ':count äigi', // less reliable + 'h' => ':count äigi', // less reliable + 'a_hour' => ':count äigi', // less reliable + + 'year' => ':count ihe', + 'y' => ':count ihe', + 'a_year' => ':count ihe', + + 'month' => ':count mánuppaje', + 'm' => ':count mánuppaje', + 'a_month' => ':count mánuppaje', + + 'week' => ':count okko', + 'w' => ':count okko', + 'a_week' => ':count okko', + + 'day' => ':count peivi', + 'd' => ':count peivi', + 'a_day' => ':count peivi', + + 'minute' => ':count miinut', + 'min' => ':count miinut', + 'a_minute' => ':count miinut', + + 'second' => ':count nubbe', + 's' => ':count nubbe', + 'a_second' => ':count nubbe', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sn.php new file mode 100644 index 00000000..095936fc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sn.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'meridiem' => ['a', 'p'], + 'weekdays' => ['Svondo', 'Muvhuro', 'Chipiri', 'Chitatu', 'China', 'Chishanu', 'Mugovera'], + 'weekdays_short' => ['Svo', 'Muv', 'Chp', 'Cht', 'Chn', 'Chs', 'Mug'], + 'weekdays_min' => ['Sv', 'Mu', 'Cp', 'Ct', 'Cn', 'Cs', 'Mg'], + 'months' => ['Ndira', 'Kukadzi', 'Kurume', 'Kubvumbi', 'Chivabvu', 'Chikumi', 'Chikunguru', 'Nyamavhuvhu', 'Gunyana', 'Gumiguru', 'Mbudzi', 'Zvita'], + 'months_short' => ['Ndi', 'Kuk', 'Kur', 'Kub', 'Chv', 'Chk', 'Chg', 'Nya', 'Gun', 'Gum', 'Mbu', 'Zvi'], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], + + 'year' => 'makore :count', + 'y' => 'makore :count', + 'a_year' => 'makore :count', + + 'month' => 'mwedzi :count', + 'm' => 'mwedzi :count', + 'a_month' => 'mwedzi :count', + + 'week' => 'vhiki :count', + 'w' => 'vhiki :count', + 'a_week' => 'vhiki :count', + + 'day' => 'mazuva :count', + 'd' => 'mazuva :count', + 'a_day' => 'mazuva :count', + + 'hour' => 'maawa :count', + 'h' => 'maawa :count', + 'a_hour' => 'maawa :count', + + 'minute' => 'minitsi :count', + 'min' => 'minitsi :count', + 'a_minute' => 'minitsi :count', + + 'second' => 'sekonzi :count', + 's' => 'sekonzi :count', + 'a_second' => 'sekonzi :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so.php new file mode 100644 index 00000000..78e487cc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Author: + * - Abdifatah Abdilahi(@abdifatahz) + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'year' => ':count sanad|:count sanadood', + 'a_year' => 'sanad|:count sanadood', + 'y' => '{1}:countsn|{0}:countsns|[-Inf,Inf]:countsn', + 'month' => ':count bil|:count bilood', + 'a_month' => 'bil|:count bilood', + 'm' => ':countbil', + 'week' => ':count isbuuc', + 'a_week' => 'isbuuc|:count isbuuc', + 'w' => ':countis', + 'day' => ':count maalin|:count maalmood', + 'a_day' => 'maalin|:count maalmood', + 'd' => ':countml', + 'hour' => ':count saac', + 'a_hour' => 'saacad|:count saac', + 'h' => ':countsc', + 'minute' => ':count daqiiqo', + 'a_minute' => 'daqiiqo|:count daqiiqo', + 'min' => ':countdq', + 'second' => ':count ilbidhiqsi', + 'a_second' => 'xooga ilbidhiqsiyo|:count ilbidhiqsi', + 's' => ':countil', + 'ago' => ':time kahor', + 'from_now' => ':time gudahood', + 'after' => ':time kedib', + 'before' => ':time kahor', + 'diff_now' => 'hada', + 'diff_today' => 'maanta', + 'diff_today_regexp' => 'maanta(?:\s+markay\s+(?:tahay|ahayd))?', + 'diff_yesterday' => 'shalayto', + 'diff_yesterday_regexp' => 'shalayto(?:\s+markay\s+ahayd)?', + 'diff_tomorrow' => 'beri', + 'diff_tomorrow_regexp' => 'beri(?:\s+markay\s+tahay)?', + 'diff_before_yesterday' => 'doraato', + 'diff_after_tomorrow' => 'saadanbe', + 'period_recurrences' => 'mar|:count jeer', + 'period_interval' => ':interval kasta', + 'period_start_date' => 'laga bilaabo :date', + 'period_end_date' => 'ilaa :date', + 'months' => ['Janaayo', 'Febraayo', 'Abriil', 'Maajo', 'Juun', 'Luuliyo', 'Agoosto', 'Sebteembar', 'Oktoobar', 'Nofeembar', 'Diseembar'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Abr', 'Mjo', 'Jun', 'Lyo', 'Agt', 'Seb', 'Okt', 'Nof', 'Dis'], + 'weekdays' => ['Axad', 'Isniin', 'Talaada', 'Arbaca', 'Khamiis', 'Jimce', 'Sabti'], + 'weekdays_short' => ['Axd', 'Isn', 'Tal', 'Arb', 'Kha', 'Jim', 'Sbt'], + 'weekdays_min' => ['Ax', 'Is', 'Ta', 'Ar', 'Kh', 'Ji', 'Sa'], + 'list' => [', ', ' and '], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'calendar' => [ + 'sameDay' => '[Maanta markay tahay] LT', + 'nextDay' => '[Beri markay tahay] LT', + 'nextWeek' => 'dddd [markay tahay] LT', + 'lastDay' => '[Shalay markay ahayd] LT', + 'lastWeek' => '[Hore] dddd [Markay ahayd] LT', + 'sameElse' => 'L', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php new file mode 100644 index 00000000..273dda8d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_DJ.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/so.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php new file mode 100644 index 00000000..7b699715 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_ET.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return require __DIR__.'/so.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php new file mode 100644 index 00000000..7b699715 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_KE.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return require __DIR__.'/so.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php new file mode 100644 index 00000000..7b699715 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/so_SO.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return require __DIR__.'/so.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq.php new file mode 100644 index 00000000..ffa592ec --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - JD Isaacks + * - Fadion Dashi + */ +return [ + 'year' => ':count vit|:count vjet', + 'a_year' => 'një vit|:count vite', + 'y' => ':count v.', + 'month' => ':count muaj', + 'a_month' => 'një muaj|:count muaj', + 'm' => ':count muaj', + 'week' => ':count javë', + 'a_week' => ':count javë|:count javë', + 'w' => ':count j.', + 'day' => ':count ditë', + 'a_day' => 'një ditë|:count ditë', + 'd' => ':count d.', + 'hour' => ':count orë', + 'a_hour' => 'një orë|:count orë', + 'h' => ':count o.', + 'minute' => ':count minutë|:count minuta', + 'a_minute' => 'një minutë|:count minuta', + 'min' => ':count min.', + 'second' => ':count sekondë|:count sekonda', + 'a_second' => 'disa sekonda|:count sekonda', + 's' => ':count s.', + 'ago' => ':time më parë', + 'from_now' => 'në :time', + 'after' => ':time pas', + 'before' => ':time para', + 'diff_now' => 'tani', + 'diff_today' => 'Sot', + 'diff_today_regexp' => 'Sot(?:\\s+në)?', + 'diff_yesterday' => 'dje', + 'diff_yesterday_regexp' => 'Dje(?:\\s+në)?', + 'diff_tomorrow' => 'nesër', + 'diff_tomorrow_regexp' => 'Nesër(?:\\s+në)?', + 'diff_before_yesterday' => 'pardje', + 'diff_after_tomorrow' => 'pasnesër', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Sot në] LT', + 'nextDay' => '[Nesër në] LT', + 'nextWeek' => 'dddd [në] LT', + 'lastDay' => '[Dje në] LT', + 'lastWeek' => 'dddd [e kaluar në] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'meridiem' => ['PD', 'MD'], + 'months' => ['janar', 'shkurt', 'mars', 'prill', 'maj', 'qershor', 'korrik', 'gusht', 'shtator', 'tetor', 'nëntor', 'dhjetor'], + 'months_short' => ['jan', 'shk', 'mar', 'pri', 'maj', 'qer', 'kor', 'gus', 'sht', 'tet', 'nën', 'dhj'], + 'weekdays' => ['e diel', 'e hënë', 'e martë', 'e mërkurë', 'e enjte', 'e premte', 'e shtunë'], + 'weekdays_short' => ['die', 'hën', 'mar', 'mër', 'enj', 'pre', 'sht'], + 'weekdays_min' => ['d', 'h', 'ma', 'më', 'e', 'p', 'sh'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' dhe '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php new file mode 100644 index 00000000..ea5df3f2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_AL.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sq.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php new file mode 100644 index 00000000..62f752c4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_MK.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/sq.php', [ + 'formats' => [ + 'L' => 'D.M.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php new file mode 100644 index 00000000..62f752c4 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sq_XK.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/sq.php', [ + 'formats' => [ + 'L' => 'D.M.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr.php new file mode 100644 index 00000000..f1908a22 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - shaishavgandhi05 + * - Serhan Apaydın + * - JD Isaacks + * - Glavić + * - Milos Sakovic + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count godina|:count godine|:count godina', + 'y' => ':count g.', + 'month' => ':count mesec|:count meseca|:count meseci', + 'm' => ':count mes.', + 'week' => ':count nedelja|:count nedelje|:count nedelja', + 'w' => ':count ned.', + 'day' => ':count dan|:count dana|:count dana', + 'd' => ':count d.', + 'hour' => ':count sat|:count sata|:count sati', + 'h' => ':count č.', + 'minute' => ':count minut|:count minuta|:count minuta', + 'min' => ':count min.', + 'second' => ':count sekundu|:count sekunde|:count sekundi', + 's' => ':count sek.', + + 'ago' => 'pre :time', + 'from_now' => 'za :time', + 'after' => 'nakon :time', + 'before' => 'pre :time', + + 'year_ago' => ':count godinu|:count godine|:count godina', + 'year_from_now' => ':count godinu|:count godine|:count godina', + 'week_ago' => ':count nedelju|:count nedelje|:count nedelja', + 'week_from_now' => ':count nedelju|:count nedelje|:count nedelja', + + 'diff_now' => 'upravo sada', + 'diff_today' => 'danas', + 'diff_today_regexp' => 'danas(?:\\s+u)?', + 'diff_yesterday' => 'juče', + 'diff_yesterday_regexp' => 'juče(?:\\s+u)?', + 'diff_tomorrow' => 'sutra', + 'diff_tomorrow_regexp' => 'sutra(?:\\s+u)?', + 'diff_before_yesterday' => 'prekjuče', + 'diff_after_tomorrow' => 'preksutra', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[danas u] LT', + 'nextDay' => '[sutra u] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[u nedelju u] LT', + 3 => '[u sredu u] LT', + 6 => '[u subotu u] LT', + default => '[u] dddd [u] LT', + }, + 'lastDay' => '[juče u] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[prošle nedelje u] LT', + 1 => '[prošlog ponedeljka u] LT', + 2 => '[prošlog utorka u] LT', + 3 => '[prošle srede u] LT', + 4 => '[prošlog četvrtka u] LT', + 5 => '[prošlog petka u] LT', + default => '[prošle subote u] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['januar', 'februar', 'mart', 'april', 'maj', 'jun', 'jul', 'avgust', 'septembar', 'oktobar', 'novembar', 'decembar'], + 'months_short' => ['jan.', 'feb.', 'mar.', 'apr.', 'maj', 'jun', 'jul', 'avg.', 'sep.', 'okt.', 'nov.', 'dec.'], + 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sre.', 'čet.', 'pet.', 'sub.'], + 'weekdays_min' => ['ne', 'po', 'ut', 'sr', 'če', 'pe', 'su'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' i '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php new file mode 100644 index 00000000..fe42d5ab --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - shaishavgandhi05 + * - Serhan Apaydın + * - JD Isaacks + * - Glavić + * - Nikola Zeravcic + * - Milos Sakovic + */ + +use Carbon\CarbonInterface; + +return [ + 'year' => ':count година|:count године|:count година', + 'y' => ':count г.', + 'month' => ':count месец|:count месеца|:count месеци', + 'm' => ':count м.', + 'week' => ':count недеља|:count недеље|:count недеља', + 'w' => ':count нед.', + 'day' => ':count дан|:count дана|:count дана', + 'd' => ':count д.', + 'hour' => ':count сат|:count сата|:count сати', + 'h' => ':count ч.', + 'minute' => ':count минут|:count минута|:count минута', + 'min' => ':count мин.', + 'second' => ':count секунд|:count секунде|:count секунди', + 's' => ':count сек.', + 'ago' => 'пре :time', + 'from_now' => 'за :time', + 'after' => ':time након', + 'before' => ':time пре', + 'year_from_now' => ':count годину|:count године|:count година', + 'year_ago' => ':count годину|:count године|:count година', + 'week_from_now' => ':count недељу|:count недеље|:count недеља', + 'week_ago' => ':count недељу|:count недеље|:count недеља', + 'diff_now' => 'управо сада', + 'diff_today' => 'данас', + 'diff_today_regexp' => 'данас(?:\\s+у)?', + 'diff_yesterday' => 'јуче', + 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', + 'diff_tomorrow' => 'сутра', + 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', + 'diff_before_yesterday' => 'прекјуче', + 'diff_after_tomorrow' => 'прекосутра', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[данас у] LT', + 'nextDay' => '[сутра у] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[у недељу у] LT', + 3 => '[у среду у] LT', + 6 => '[у суботу у] LT', + default => '[у] dddd [у] LT', + }, + 'lastDay' => '[јуче у] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[прошле недеље у] LT', + 1 => '[прошлог понедељка у] LT', + 2 => '[прошлог уторка у] LT', + 3 => '[прошле среде у] LT', + 4 => '[прошлог четвртка у] LT', + 5 => '[прошлог петка у] LT', + default => '[прошле суботе у] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], + 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], + 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], + 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], + 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' и '], + 'meridiem' => ['АМ', 'ПМ'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php new file mode 100644 index 00000000..4b29a45c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_BA.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Cyrl_BA'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/sr_Cyrl.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D.M.yy.', + 'LL' => 'DD.MM.YYYY.', + 'LLL' => 'DD. MMMM YYYY. HH:mm', + 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', + ], + 'weekdays' => ['недјеља', 'понедељак', 'уторак', 'сриједа', 'четвртак', 'петак', 'субота'], + 'weekdays_short' => ['нед.', 'пон.', 'ут.', 'ср.', 'чет.', 'пет.', 'суб.'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php new file mode 100644 index 00000000..e34f732a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Glavić + * - Milos Sakovic + */ + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Cyrl_ME'); +} +// @codeCoverageIgnoreEnd + +return [ + 'year' => ':count година|:count године|:count година', + 'y' => ':count г.', + 'month' => ':count мјесец|:count мјесеца|:count мјесеци', + 'm' => ':count мј.', + 'week' => ':count недјеља|:count недјеље|:count недјеља', + 'w' => ':count нед.', + 'day' => ':count дан|:count дана|:count дана', + 'd' => ':count д.', + 'hour' => ':count сат|:count сата|:count сати', + 'h' => ':count ч.', + 'minute' => ':count минут|:count минута|:count минута', + 'min' => ':count мин.', + 'second' => ':count секунд|:count секунде|:count секунди', + 's' => ':count сек.', + 'ago' => 'прије :time', + 'from_now' => 'за :time', + 'after' => ':time након', + 'before' => ':time прије', + + 'year_from_now' => ':count годину|:count године|:count година', + 'year_ago' => ':count годину|:count године|:count година', + + 'week_from_now' => ':count недјељу|:count недјеље|:count недјеља', + 'week_ago' => ':count недјељу|:count недјеље|:count недјеља', + + 'diff_now' => 'управо сада', + 'diff_today' => 'данас', + 'diff_today_regexp' => 'данас(?:\\s+у)?', + 'diff_yesterday' => 'јуче', + 'diff_yesterday_regexp' => 'јуче(?:\\s+у)?', + 'diff_tomorrow' => 'сутра', + 'diff_tomorrow_regexp' => 'сутра(?:\\s+у)?', + 'diff_before_yesterday' => 'прекјуче', + 'diff_after_tomorrow' => 'прекосјутра', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM YYYY', + 'LLL' => 'D. MMMM YYYY H:mm', + 'LLLL' => 'dddd, D. MMMM YYYY H:mm', + ], + 'calendar' => [ + 'sameDay' => '[данас у] LT', + 'nextDay' => '[сутра у] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[у недељу у] LT', + 3 => '[у среду у] LT', + 6 => '[у суботу у] LT', + default => '[у] dddd [у] LT', + }, + 'lastDay' => '[јуче у] LT', + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[прошле недеље у] LT', + 1 => '[прошлог понедељка у] LT', + 2 => '[прошлог уторка у] LT', + 3 => '[прошле среде у] LT', + 4 => '[прошлог четвртка у] LT', + 5 => '[прошлог петка у] LT', + default => '[прошле суботе у] LT', + }, + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['јануар', 'фебруар', 'март', 'април', 'мај', 'јун', 'јул', 'август', 'септембар', 'октобар', 'новембар', 'децембар'], + 'months_short' => ['јан.', 'феб.', 'мар.', 'апр.', 'мај', 'јун', 'јул', 'авг.', 'сеп.', 'окт.', 'нов.', 'дец.'], + 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], + 'weekdays_short' => ['нед.', 'пон.', 'уто.', 'сре.', 'чет.', 'пет.', 'суб.'], + 'weekdays_min' => ['не', 'по', 'ут', 'ср', 'че', 'пе', 'су'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' и '], + 'meridiem' => ['АМ', 'ПМ'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php new file mode 100644 index 00000000..d6e29b86 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_XK.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Cyrl_XK'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/sr_Cyrl_BA.php', [ + 'weekdays' => ['недеља', 'понедељак', 'уторак', 'среда', 'четвртак', 'петак', 'субота'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php new file mode 100644 index 00000000..99716747 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php new file mode 100644 index 00000000..95b2770d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_BA.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Latn_BA'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/sr_Latn.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D.M.yy.', + 'LL' => 'DD.MM.YYYY.', + 'LLL' => 'DD. MMMM YYYY. HH:mm', + 'LLLL' => 'dddd, DD. MMMM YYYY. HH:mm', + ], + 'weekdays' => ['nedjelja', 'ponedeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned.', 'pon.', 'ut.', 'sr.', 'čet.', 'pet.', 'sub.'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php new file mode 100644 index 00000000..81150801 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Glavić + * - Milos Sakovic + */ + +use Carbon\CarbonInterface; +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Latn_ME'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/sr.php', [ + 'month' => ':count mjesec|:count mjeseca|:count mjeseci', + 'week' => ':count nedjelja|:count nedjelje|:count nedjelja', + 'second' => ':count sekund|:count sekunde|:count sekundi', + 'ago' => 'prije :time', + 'from_now' => 'za :time', + 'after' => ':time nakon', + 'before' => ':time prije', + 'week_from_now' => ':count nedjelju|:count nedjelje|:count nedjelja', + 'week_ago' => ':count nedjelju|:count nedjelje|:count nedjelja', + 'second_ago' => ':count sekund|:count sekunde|:count sekundi', + 'diff_tomorrow' => 'sjutra', + 'calendar' => [ + 'nextDay' => '[sjutra u] LT', + 'nextWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[u nedjelju u] LT', + 3 => '[u srijedu u] LT', + 6 => '[u subotu u] LT', + default => '[u] dddd [u] LT', + }, + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0 => '[prošle nedjelje u] LT', + 1 => '[prošle nedjelje u] LT', + 2 => '[prošlog utorka u] LT', + 3 => '[prošle srijede u] LT', + 4 => '[prošlog četvrtka u] LT', + 5 => '[prošlog petka u] LT', + default => '[prošle subote u] LT', + }, + ], + 'weekdays' => ['nedjelja', 'ponedjeljak', 'utorak', 'srijeda', 'četvrtak', 'petak', 'subota'], + 'weekdays_short' => ['ned.', 'pon.', 'uto.', 'sri.', 'čet.', 'pet.', 'sub.'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php new file mode 100644 index 00000000..5278e2e5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_XK.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Component\Translation\PluralizationRules; + +// @codeCoverageIgnoreStart +if (class_exists(PluralizationRules::class)) { + PluralizationRules::set(static function ($number) { + return PluralizationRules::get($number, 'sr'); + }, 'sr_Latn_XK'); +} +// @codeCoverageIgnoreEnd + +return array_replace_recursive(require __DIR__.'/sr_Latn_BA.php', [ + 'weekdays' => ['nedelja', 'ponedeljak', 'utorak', 'sreda', 'četvrtak', 'petak', 'subota'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php new file mode 100644 index 00000000..d7c65b91 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sr_Latn_ME.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php new file mode 100644 index 00000000..bc5e04bf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - sr_YU, sr_CS locale Danilo Segan bug-glibc-locales@gnu.org + */ +return require __DIR__.'/sr_Cyrl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php new file mode 100644 index 00000000..99716747 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sr_RS@latin.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss.php new file mode 100644 index 00000000..0ec3e8f9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Nicolai Davies + */ +return [ + 'year' => '{1}umnyaka|:count iminyaka', + 'month' => '{1}inyanga|:count tinyanga', + 'week' => '{1}:count liviki|:count emaviki', + 'day' => '{1}lilanga|:count emalanga', + 'hour' => '{1}lihora|:count emahora', + 'minute' => '{1}umzuzu|:count emizuzu', + 'second' => '{1}emizuzwana lomcane|:count mzuzwana', + 'ago' => 'wenteka nga :time', + 'from_now' => 'nga :time', + 'diff_yesterday' => 'Itolo', + 'diff_yesterday_regexp' => 'Itolo(?:\\s+nga)?', + 'diff_today' => 'Namuhla', + 'diff_today_regexp' => 'Namuhla(?:\\s+nga)?', + 'diff_tomorrow' => 'Kusasa', + 'diff_tomorrow_regexp' => 'Kusasa(?:\\s+nga)?', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm A', + 'LLLL' => 'dddd, D MMMM YYYY h:mm A', + ], + 'calendar' => [ + 'sameDay' => '[Namuhla nga] LT', + 'nextDay' => '[Kusasa nga] LT', + 'nextWeek' => 'dddd [nga] LT', + 'lastDay' => '[Itolo nga] LT', + 'lastWeek' => 'dddd [leliphelile] [nga] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + $lastDigit = $number % 10; + + return $number.( + ((int) ($number % 100 / 10) === 1) ? 'e' : ( + ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' + ) + ); + }, + 'meridiem' => static function ($hour) { + if ($hour < 11) { + return 'ekuseni'; + } + if ($hour < 15) { + return 'emini'; + } + if ($hour < 19) { + return 'entsambama'; + } + + return 'ebusuku'; + }, + 'months' => ['Bhimbidvwane', 'Indlovana', 'Indlov\'lenkhulu', 'Mabasa', 'Inkhwekhweti', 'Inhlaba', 'Kholwane', 'Ingci', 'Inyoni', 'Imphala', 'Lweti', 'Ingongoni'], + 'months_short' => ['Bhi', 'Ina', 'Inu', 'Mab', 'Ink', 'Inh', 'Kho', 'Igc', 'Iny', 'Imp', 'Lwe', 'Igo'], + 'weekdays' => ['Lisontfo', 'Umsombuluko', 'Lesibili', 'Lesitsatfu', 'Lesine', 'Lesihlanu', 'Umgcibelo'], + 'weekdays_short' => ['Lis', 'Umb', 'Lsb', 'Les', 'Lsi', 'Lsh', 'Umg'], + 'weekdays_min' => ['Li', 'Us', 'Lb', 'Lt', 'Ls', 'Lh', 'Ug'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php new file mode 100644 index 00000000..ba89527c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ss_ZA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/ss.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st.php new file mode 100644 index 00000000..b065445b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/st_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php new file mode 100644 index 00000000..5eee2224 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/st_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Pherekgong', 'Hlakola', 'Tlhakubele', 'Mmese', 'Motsheanong', 'Phupjane', 'Phupu', 'Phato', 'Leotse', 'Mphalane', 'Pudungwana', 'Tshitwe'], + 'months_short' => ['Phe', 'Hla', 'TlH', 'Mme', 'Mot', 'Jan', 'Upu', 'Pha', 'Leo', 'Mph', 'Pud', 'Tsh'], + 'weekdays' => ['Sontaha', 'Mantaha', 'Labobedi', 'Laboraro', 'Labone', 'Labohlano', 'Moqebelo'], + 'weekdays_short' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], + 'weekdays_min' => ['Son', 'Mma', 'Bed', 'Rar', 'Ne', 'Hla', 'Moq'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'week' => ':count Sontaha', // less reliable + 'w' => ':count Sontaha', // less reliable + 'a_week' => ':count Sontaha', // less reliable + + 'day' => ':count letsatsi', // less reliable + 'd' => ':count letsatsi', // less reliable + 'a_day' => ':count letsatsi', // less reliable + + 'hour' => ':count sešupanako', // less reliable + 'h' => ':count sešupanako', // less reliable + 'a_hour' => ':count sešupanako', // less reliable + + 'minute' => ':count menyane', // less reliable + 'min' => ':count menyane', // less reliable + 'a_minute' => ':count menyane', // less reliable + + 'second' => ':count thusa', // less reliable + 's' => ':count thusa', // less reliable + 'a_second' => ':count thusa', // less reliable + + 'year' => ':count selemo', + 'y' => ':count selemo', + 'a_year' => ':count selemo', + + 'month' => ':count kgwedi', + 'm' => ':count kgwedi', + 'a_month' => ':count kgwedi', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv.php new file mode 100644 index 00000000..d7e0ddf2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Kristoffer Snabb + * - JD Isaacks + * - Jens Herlevsen + * - Nightpine + * - Anders Nygren (litemerafrukt) + */ +return [ + 'year' => ':count år', + 'a_year' => 'ett år|:count år', + 'y' => ':count år', + 'month' => ':count månad|:count månader', + 'a_month' => 'en månad|:count månader', + 'm' => ':count mån', + 'week' => ':count vecka|:count veckor', + 'a_week' => 'en vecka|:count veckor', + 'w' => ':count v', + 'day' => ':count dag|:count dagar', + 'a_day' => 'en dag|:count dagar', + 'd' => ':count dgr', + 'hour' => ':count timme|:count timmar', + 'a_hour' => 'en timme|:count timmar', + 'h' => ':count tim', + 'minute' => ':count minut|:count minuter', + 'a_minute' => 'en minut|:count minuter', + 'min' => ':count min', + 'second' => ':count sekund|:count sekunder', + 'a_second' => 'några sekunder|:count sekunder', + 's' => ':count s', + 'ago' => 'för :time sedan', + 'from_now' => 'om :time', + 'after' => ':time efter', + 'before' => ':time före', + 'diff_now' => 'nu', + 'diff_today' => 'I dag', + 'diff_yesterday' => 'i går', + 'diff_yesterday_regexp' => 'I går', + 'diff_tomorrow' => 'i morgon', + 'diff_tomorrow_regexp' => 'I morgon', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY [kl.] HH:mm', + 'LLLL' => 'dddd D MMMM YYYY [kl.] HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[I dag] LT', + 'nextDay' => '[I morgon] LT', + 'nextWeek' => '[På] dddd LT', + 'lastDay' => '[I går] LT', + 'lastWeek' => '[I] dddd[s] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + $lastDigit = $number % 10; + + return $number.( + ((int) ($number % 100 / 10) === 1) ? 'e' : ( + ($lastDigit === 1 || $lastDigit === 2) ? 'a' : 'e' + ) + ); + }, + 'months' => ['januari', 'februari', 'mars', 'april', 'maj', 'juni', 'juli', 'augusti', 'september', 'oktober', 'november', 'december'], + 'months_short' => ['jan', 'feb', 'mar', 'apr', 'maj', 'jun', 'jul', 'aug', 'sep', 'okt', 'nov', 'dec'], + 'weekdays' => ['söndag', 'måndag', 'tisdag', 'onsdag', 'torsdag', 'fredag', 'lördag'], + 'weekdays_short' => ['sön', 'mån', 'tis', 'ons', 'tors', 'fre', 'lör'], + 'weekdays_min' => ['sö', 'må', 'ti', 'on', 'to', 'fr', 'lö'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' och '], + 'meridiem' => ['fm', 'em'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php new file mode 100644 index 00000000..70cc5585 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_AX.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/sv.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-dd', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php new file mode 100644 index 00000000..d7182c83 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_FI.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sv.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php new file mode 100644 index 00000000..d7182c83 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sv_SE.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/sv.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw.php new file mode 100644 index 00000000..f8630d53 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - leyluj + * - Josh Soref + * - ryanhart2 + */ +return [ + 'year' => 'mwaka :count|miaka :count', + 'a_year' => 'mwaka mmoja|miaka :count', + 'y' => 'mwaka :count|miaka :count', + 'month' => 'mwezi :count|miezi :count', + 'a_month' => 'mwezi mmoja|miezi :count', + 'm' => 'mwezi :count|miezi :count', + 'week' => 'wiki :count', + 'a_week' => 'wiki mmoja|wiki :count', + 'w' => 'w. :count', + 'day' => 'siku :count', + 'a_day' => 'siku moja|masiku :count', + 'd' => 'si. :count', + 'hour' => 'saa :count|masaa :count', + 'a_hour' => 'saa limoja|masaa :count', + 'h' => 'saa :count|masaa :count', + 'minute' => 'dakika :count', + 'a_minute' => 'dakika moja|dakika :count', + 'min' => 'd. :count', + 'second' => 'sekunde :count', + 'a_second' => 'hivi punde|sekunde :count', + 's' => 'se. :count', + 'ago' => 'tokea :time', + 'from_now' => ':time baadaye', + 'after' => ':time baada', + 'before' => ':time kabla', + 'diff_now' => 'sasa hivi', + 'diff_today' => 'leo', + 'diff_today_regexp' => 'leo(?:\\s+saa)?', + 'diff_yesterday' => 'jana', + 'diff_tomorrow' => 'kesho', + 'diff_tomorrow_regexp' => 'kesho(?:\\s+saa)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[leo saa] LT', + 'nextDay' => '[kesho saa] LT', + 'nextWeek' => '[wiki ijayo] dddd [saat] LT', + 'lastDay' => '[jana] LT', + 'lastWeek' => '[wiki iliyopita] dddd [saat] LT', + 'sameElse' => 'L', + ], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Jpl', 'Jtat', 'Jnne', 'Jtan', 'Alh', 'Ijm', 'Jmos'], + 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Al', 'Ij', 'J1'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' na '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php new file mode 100644 index 00000000..ec9117b5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_CD.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/sw.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php new file mode 100644 index 00000000..2ace0db2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_KE.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kamusi Project Martin Benjamin locales@kamusi.org + */ +return array_replace_recursive(require __DIR__.'/sw.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], + 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['asubuhi', 'alasiri'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php new file mode 100644 index 00000000..fab3cd68 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_TZ.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kamusi Project Martin Benjamin locales@kamusi.org + */ +return array_replace_recursive(require __DIR__.'/sw.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprili', 'Mei', 'Juni', 'Julai', 'Agosti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Jumapili', 'Jumatatu', 'Jumanne', 'Jumatano', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], + 'weekdays_min' => ['J2', 'J3', 'J4', 'J5', 'Alh', 'Ij', 'J1'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['asubuhi', 'alasiri'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php new file mode 100644 index 00000000..ec9117b5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/sw_UG.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/sw.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl.php new file mode 100644 index 00000000..4429c4f5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/szl_PL.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php new file mode 100644 index 00000000..9adddcf8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/szl_PL.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - szl_PL locale Przemyslaw Buczkowski libc-alpha@sourceware.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['styczyń', 'luty', 'merc', 'kwjeciyń', 'moj', 'czyrwjyń', 'lipjyń', 'siyrpjyń', 'wrzesiyń', 'październik', 'listopad', 'grudziyń'], + 'months_short' => ['sty', 'lut', 'mer', 'kwj', 'moj', 'czy', 'lip', 'siy', 'wrz', 'paź', 'lis', 'gru'], + 'weekdays' => ['niydziela', 'pyńdziŏek', 'wtŏrek', 'strzŏda', 'sztwortek', 'pjōntek', 'sobŏta'], + 'weekdays_short' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], + 'weekdays_min' => ['niy', 'pyń', 'wtŏ', 'str', 'szt', 'pjō', 'sob'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count rok', + 'y' => ':count rok', + 'a_year' => ':count rok', + + 'month' => ':count mjeśůnc', + 'm' => ':count mjeśůnc', + 'a_month' => ':count mjeśůnc', + + 'week' => ':count tydźyń', + 'w' => ':count tydźyń', + 'a_week' => ':count tydźyń', + + 'day' => ':count dźyń', + 'd' => ':count dźyń', + 'a_day' => ':count dźyń', + + 'hour' => ':count godzina', + 'h' => ':count godzina', + 'a_hour' => ':count godzina', + + 'minute' => ':count minuta', + 'min' => ':count minuta', + 'a_minute' => ':count minuta', + + 'second' => ':count sekůnda', + 's' => ':count sekůnda', + 'a_second' => ':count sekůnda', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta.php new file mode 100644 index 00000000..c5dd68e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - François B + * - JD Isaacks + * - Satheez + */ +return [ + 'year' => ':count வருடம்|:count ஆண்டுகள்', + 'a_year' => 'ஒரு வருடம்|:count ஆண்டுகள்', + 'y' => ':count வருட.|:count ஆண்.', + 'month' => ':count மாதம்|:count மாதங்கள்', + 'a_month' => 'ஒரு மாதம்|:count மாதங்கள்', + 'm' => ':count மாத.', + 'week' => ':count வாரம்|:count வாரங்கள்', + 'a_week' => 'ஒரு வாரம்|:count வாரங்கள்', + 'w' => ':count வார.', + 'day' => ':count நாள்|:count நாட்கள்', + 'a_day' => 'ஒரு நாள்|:count நாட்கள்', + 'd' => ':count நாள்|:count நாட்.', + 'hour' => ':count மணி நேரம்|:count மணி நேரம்', + 'a_hour' => 'ஒரு மணி நேரம்|:count மணி நேரம்', + 'h' => ':count மணி.', + 'minute' => ':count நிமிடம்|:count நிமிடங்கள்', + 'a_minute' => 'ஒரு நிமிடம்|:count நிமிடங்கள்', + 'min' => ':count நிமி.', + 'second' => ':count சில விநாடிகள்|:count விநாடிகள்', + 'a_second' => 'ஒரு சில விநாடிகள்|:count விநாடிகள்', + 's' => ':count விநா.', + 'ago' => ':time முன்', + 'from_now' => ':time இல்', + 'before' => ':time முன்', + 'after' => ':time பின்', + 'diff_now' => 'இப்போது', + 'diff_today' => 'இன்று', + 'diff_yesterday' => 'நேற்று', + 'diff_tomorrow' => 'நாளை', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[இன்று] LT', + 'nextDay' => '[நாளை] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[நேற்று] LT', + 'lastWeek' => '[கடந்த வாரம்] dddd, LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberவது', + 'meridiem' => static function ($hour) { + if ($hour < 2) { + return ' யாமம்'; + } + if ($hour < 6) { + return ' வைகறை'; + } + if ($hour < 10) { + return ' காலை'; + } + if ($hour < 14) { + return ' நண்பகல்'; + } + if ($hour < 18) { + return ' எற்பாடு'; + } + if ($hour < 22) { + return ' மாலை'; + } + + return ' யாமம்'; + }, + 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'months_short' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டெம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'weekdays' => ['ஞாயிற்றுக்கிழமை', 'திங்கட்கிழமை', 'செவ்வாய்கிழமை', 'புதன்கிழமை', 'வியாழக்கிழமை', 'வெள்ளிக்கிழமை', 'சனிக்கிழமை'], + 'weekdays_short' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], + 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' மற்றும் '], + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php new file mode 100644 index 00000000..492d4c56 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_IN.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ta.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], + 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], + 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['காலை', 'மாலை'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php new file mode 100644 index 00000000..8e2afbf6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_LK.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - J.Yogaraj 94-777-315206 yogaraj.ubuntu@gmail.com + */ +return array_replace_recursive(require __DIR__.'/ta.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'months_short' => ['ஜன', 'பிப்', 'மார்', 'ஏப்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக', 'செப்', 'அக்', 'நவ', 'டிச'], + 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], + 'weekdays_short' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['காலை', 'மாலை'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php new file mode 100644 index 00000000..a6cd8b51 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_MY.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ta.php', [ + 'formats' => [ + 'LT' => 'a h:mm', + 'LTS' => 'a h:mm:ss', + 'L' => 'D/M/yy', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM, YYYY, a h:mm', + 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', + ], + 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], + 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], + 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], + 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'first_day_of_week' => 1, + 'meridiem' => ['மு.ப', 'பி.ப'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php new file mode 100644 index 00000000..7dbedeee --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ta_SG.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ta.php', [ + 'formats' => [ + 'LT' => 'a h:mm', + 'LTS' => 'a h:mm:ss', + 'L' => 'D/M/yy', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM, YYYY, a h:mm', + 'LLLL' => 'dddd, D MMMM, YYYY, a h:mm', + ], + 'months' => ['ஜனவரி', 'பிப்ரவரி', 'மார்ச்', 'ஏப்ரல்', 'மே', 'ஜூன்', 'ஜூலை', 'ஆகஸ்ட்', 'செப்டம்பர்', 'அக்டோபர்', 'நவம்பர்', 'டிசம்பர்'], + 'months_short' => ['ஜன.', 'பிப்.', 'மார்.', 'ஏப்.', 'மே', 'ஜூன்', 'ஜூலை', 'ஆக.', 'செப்.', 'அக்.', 'நவ.', 'டிச.'], + 'weekdays' => ['ஞாயிறு', 'திங்கள்', 'செவ்வாய்', 'புதன்', 'வியாழன்', 'வெள்ளி', 'சனி'], + 'weekdays_short' => ['ஞாயி.', 'திங்.', 'செவ்.', 'புத.', 'வியா.', 'வெள்.', 'சனி'], + 'weekdays_min' => ['ஞா', 'தி', 'செ', 'பு', 'வி', 'வெ', 'ச'], + 'meridiem' => ['மு.ப', 'பி.ப'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php new file mode 100644 index 00000000..2eb99057 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tcy_IN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php new file mode 100644 index 00000000..f2bbf103 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tcy_IN.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IndLinux.org, Samsung Electronics Co., Ltd. alexey.merzlyakov@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['ಜನವರಿ', 'ಫೆಬ್ರುವರಿ', 'ಮಾರ್ಚ್', 'ಏಪ್ರಿಲ್‌‌', 'ಮೇ', 'ಜೂನ್', 'ಜುಲೈ', 'ಆಗಸ್ಟ್', 'ಸೆಪ್ಟೆಂಬರ್‌', 'ಅಕ್ಟೋಬರ್', 'ನವೆಂಬರ್', 'ಡಿಸೆಂಬರ್'], + 'months_short' => ['ಜ', 'ಫೆ', 'ಮಾ', 'ಏ', 'ಮೇ', 'ಜೂ', 'ಜು', 'ಆ', 'ಸೆ', 'ಅ', 'ನ', 'ಡಿ'], + 'weekdays' => ['ಐಥಾರ', 'ಸೋಮಾರ', 'ಅಂಗರೆ', 'ಬುಧಾರ', 'ಗುರುವಾರ', 'ಶುಕ್ರರ', 'ಶನಿವಾರ'], + 'weekdays_short' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], + 'weekdays_min' => ['ಐ', 'ಸೋ', 'ಅಂ', 'ಬು', 'ಗು', 'ಶು', 'ಶ'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ಕಾಂಡೆ', 'ಬಯ್ಯ'], + + 'year' => ':count ನೀರ್', // less reliable + 'y' => ':count ನೀರ್', // less reliable + 'a_year' => ':count ನೀರ್', // less reliable + + 'month' => ':count ಮೀನ್', // less reliable + 'm' => ':count ಮೀನ್', // less reliable + 'a_month' => ':count ಮೀನ್', // less reliable + + 'day' => ':count ಸುಗ್ಗಿ', // less reliable + 'd' => ':count ಸುಗ್ಗಿ', // less reliable + 'a_day' => ':count ಸುಗ್ಗಿ', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te.php new file mode 100644 index 00000000..52d4809e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - Josh Soref + * - François B + * - kc + */ +return [ + 'year' => ':count సంవత్సరం|:count సంవత్సరాలు', + 'a_year' => 'ఒక సంవత్సరం|:count సంవత్సరాలు', + 'y' => ':count సం.', + 'month' => ':count నెల|:count నెలలు', + 'a_month' => 'ఒక నెల|:count నెలలు', + 'm' => ':count నెల|:count నెల.', + 'week' => ':count వారం|:count వారాలు', + 'a_week' => 'ఒక వారం|:count వారాలు', + 'w' => ':count వార.|:count వారా.', + 'day' => ':count రోజు|:count రోజులు', + 'a_day' => 'ఒక రోజు|:count రోజులు', + 'd' => ':count రోజు|:count రోజు.', + 'hour' => ':count గంట|:count గంటలు', + 'a_hour' => 'ఒక గంట|:count గంటలు', + 'h' => ':count గం.', + 'minute' => ':count నిమిషం|:count నిమిషాలు', + 'a_minute' => 'ఒక నిమిషం|:count నిమిషాలు', + 'min' => ':count నిమి.', + 'second' => ':count సెకను|:count సెకన్లు', + 'a_second' => 'కొన్ని క్షణాలు|:count సెకన్లు', + 's' => ':count సెక.', + 'ago' => ':time క్రితం', + 'from_now' => ':time లో', + 'diff_now' => 'ప్రస్తుతం', + 'diff_today' => 'నేడు', + 'diff_yesterday' => 'నిన్న', + 'diff_tomorrow' => 'రేపు', + 'formats' => [ + 'LT' => 'A h:mm', + 'LTS' => 'A h:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, A h:mm', + 'LLLL' => 'dddd, D MMMM YYYY, A h:mm', + ], + 'calendar' => [ + 'sameDay' => '[నేడు] LT', + 'nextDay' => '[రేపు] LT', + 'nextWeek' => 'dddd, LT', + 'lastDay' => '[నిన్న] LT', + 'lastWeek' => '[గత] dddd, LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberవ', + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'రాత్రి'; + } + if ($hour < 10) { + return 'ఉదయం'; + } + if ($hour < 17) { + return 'మధ్యాహ్నం'; + } + if ($hour < 20) { + return 'సాయంత్రం'; + } + + return ' రాత్రి'; + }, + 'months' => ['జనవరి', 'ఫిబ్రవరి', 'మార్చి', 'ఏప్రిల్', 'మే', 'జూన్', 'జూలై', 'ఆగస్టు', 'సెప్టెంబర్', 'అక్టోబర్', 'నవంబర్', 'డిసెంబర్'], + 'months_short' => ['జన.', 'ఫిబ్ర.', 'మార్చి', 'ఏప్రి.', 'మే', 'జూన్', 'జూలై', 'ఆగ.', 'సెప్.', 'అక్టో.', 'నవ.', 'డిసె.'], + 'weekdays' => ['ఆదివారం', 'సోమవారం', 'మంగళవారం', 'బుధవారం', 'గురువారం', 'శుక్రవారం', 'శనివారం'], + 'weekdays_short' => ['ఆది', 'సోమ', 'మంగళ', 'బుధ', 'గురు', 'శుక్ర', 'శని'], + 'weekdays_min' => ['ఆ', 'సో', 'మం', 'బు', 'గు', 'శు', 'శ'], + 'list' => ', ', + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'weekend' => [0, 0], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php new file mode 100644 index 00000000..3963f8d5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/te_IN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/te.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo.php new file mode 100644 index 00000000..ca30c37d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ta.php', [ + 'meridiem' => ['Taparachu', 'Ebongi'], + 'weekdays' => ['Nakaejuma', 'Nakaebarasa', 'Nakaare', 'Nakauni', 'Nakaung’on', 'Nakakany', 'Nakasabiti'], + 'weekdays_short' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], + 'weekdays_min' => ['Jum', 'Bar', 'Aar', 'Uni', 'Ung', 'Kan', 'Sab'], + 'months' => ['Orara', 'Omuk', 'Okwamg’', 'Odung’el', 'Omaruk', 'Omodok’king’ol', 'Ojola', 'Opedel', 'Osokosokoma', 'Otibar', 'Olabor', 'Opoo'], + 'months_short' => ['Rar', 'Muk', 'Kwa', 'Dun', 'Mar', 'Mod', 'Jol', 'Ped', 'Sok', 'Tib', 'Lab', 'Poo'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php new file mode 100644 index 00000000..010a04f5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/teo_KE.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/teo.php', [ + 'first_day_of_week' => 0, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tet.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tet.php new file mode 100644 index 00000000..d0544d4e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tet.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Joshua Brooks + * - François B + */ +return [ + 'year' => 'tinan :count', + 'a_year' => '{1}tinan ida|tinan :count', + 'month' => 'fulan :count', + 'a_month' => '{1}fulan ida|fulan :count', + 'week' => 'semana :count', + 'a_week' => '{1}semana ida|semana :count', + 'day' => 'loron :count', + 'a_day' => '{1}loron ida|loron :count', + 'hour' => 'oras :count', + 'a_hour' => '{1}oras ida|oras :count', + 'minute' => 'minutu :count', + 'a_minute' => '{1}minutu ida|minutu :count', + 'second' => 'segundu :count', + 'a_second' => '{1}segundu balun|segundu :count', + 'ago' => ':time liuba', + 'from_now' => 'iha :time', + 'diff_yesterday' => 'Horiseik', + 'diff_yesterday_regexp' => 'Horiseik(?:\\s+iha)?', + 'diff_today' => 'Ohin', + 'diff_today_regexp' => 'Ohin(?:\\s+iha)?', + 'diff_tomorrow' => 'Aban', + 'diff_tomorrow_regexp' => 'Aban(?:\\s+iha)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Ohin iha] LT', + 'nextDay' => '[Aban iha] LT', + 'nextWeek' => 'dddd [iha] LT', + 'lastDay' => '[Horiseik iha] LT', + 'lastWeek' => 'dddd [semana kotuk] [iha] LT', + 'sameElse' => 'L', + ], + 'ordinal' => ':numberº', + 'months' => ['Janeiru', 'Fevereiru', 'Marsu', 'Abril', 'Maiu', 'Juñu', 'Jullu', 'Agustu', 'Setembru', 'Outubru', 'Novembru', 'Dezembru'], + 'months_short' => ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun', 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'], + 'weekdays' => ['Domingu', 'Segunda', 'Tersa', 'Kuarta', 'Kinta', 'Sesta', 'Sabadu'], + 'weekdays_short' => ['Dom', 'Seg', 'Ters', 'Kua', 'Kint', 'Sest', 'Sab'], + 'weekdays_min' => ['Do', 'Seg', 'Te', 'Ku', 'Ki', 'Ses', 'Sa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg.php new file mode 100644 index 00000000..57b45135 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Orif N. Jr + */ +return [ + 'year' => '{1}як сол|:count сол', + 'month' => '{1}як моҳ|:count моҳ', + 'week' => '{1}як ҳафта|:count ҳафта', + 'day' => '{1}як рӯз|:count рӯз', + 'hour' => '{1}як соат|:count соат', + 'minute' => '{1}як дақиқа|:count дақиқа', + 'second' => '{1}якчанд сония|:count сония', + 'ago' => ':time пеш', + 'from_now' => 'баъди :time', + 'diff_today' => 'Имрӯз', + 'diff_yesterday' => 'Дирӯз', + 'diff_yesterday_regexp' => 'Дирӯз(?:\\s+соати)?', + 'diff_tomorrow' => 'Пагоҳ', + 'diff_tomorrow_regexp' => 'Пагоҳ(?:\\s+соати)?', + 'diff_today_regexp' => 'Имрӯз(?:\\s+соати)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Имрӯз соати] LT', + 'nextDay' => '[Пагоҳ соати] LT', + 'nextWeek' => 'dddd[и] [ҳафтаи оянда соати] LT', + 'lastDay' => '[Дирӯз соати] LT', + 'lastWeek' => 'dddd[и] [ҳафтаи гузашта соати] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number) { + if ($number === 0) { // special case for zero + return "$number-ıncı"; + } + + static $suffixes = [ + 0 => '-ум', + 1 => '-ум', + 2 => '-юм', + 3 => '-юм', + 4 => '-ум', + 5 => '-ум', + 6 => '-ум', + 7 => '-ум', + 8 => '-ум', + 9 => '-ум', + 10 => '-ум', + 12 => '-ум', + 13 => '-ум', + 20 => '-ум', + 30 => '-юм', + 40 => '-ум', + 50 => '-ум', + 60 => '-ум', + 70 => '-ум', + 80 => '-ум', + 90 => '-ум', + 100 => '-ум', + ]; + + return $number.($suffixes[$number] ?? $suffixes[$number % 10] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'шаб'; + } + if ($hour < 11) { + return 'субҳ'; + } + if ($hour < 16) { + return 'рӯз'; + } + if ($hour < 19) { + return 'бегоҳ'; + } + + return 'шаб'; + }, + 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], + 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'weekdays' => ['якшанбе', 'душанбе', 'сешанбе', 'чоршанбе', 'панҷшанбе', 'ҷумъа', 'шанбе'], + 'weekdays_short' => ['яшб', 'дшб', 'сшб', 'чшб', 'пшб', 'ҷум', 'шнб'], + 'weekdays_min' => ['яш', 'дш', 'сш', 'чш', 'пш', 'ҷм', 'шб'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' ва '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php new file mode 100644 index 00000000..badc7d1f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tg_TJ.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/tg.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th.php new file mode 100644 index 00000000..78980d5c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Nate Whittaker + * - John MacAslan + * - Chanintorn Asavavichairoj + * - JD Isaacks + * - ROKAISAKKON + * - RO'KAISAKKON + * - Andreas Möller + * - nithisa + */ +return [ + 'year' => ':count ปี', + 'y' => ':count ปี', + 'month' => ':count เดือน', + 'm' => ':count เดือน', + 'week' => ':count สัปดาห์', + 'w' => ':count สัปดาห์', + 'day' => ':count วัน', + 'd' => ':count วัน', + 'hour' => ':count ชั่วโมง', + 'h' => ':count ชั่วโมง', + 'minute' => ':count นาที', + 'min' => ':count นาที', + 'second' => ':count วินาที', + 'a_second' => '{1}ไม่กี่วินาที|[-Inf,Inf]:count วินาที', + 's' => ':count วินาที', + 'ago' => ':timeที่แล้ว', + 'from_now' => 'อีก :time', + 'after' => ':timeหลังจากนี้', + 'before' => ':timeก่อน', + 'diff_now' => 'ขณะนี้', + 'diff_today' => 'วันนี้', + 'diff_today_regexp' => 'วันนี้(?:\\s+เวลา)?', + 'diff_yesterday' => 'เมื่อวาน', + 'diff_yesterday_regexp' => 'เมื่อวานนี้(?:\\s+เวลา)?', + 'diff_tomorrow' => 'พรุ่งนี้', + 'diff_tomorrow_regexp' => 'พรุ่งนี้(?:\\s+เวลา)?', + 'formats' => [ + 'LT' => 'H:mm', + 'LTS' => 'H:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY เวลา H:mm', + 'LLLL' => 'วันddddที่ D MMMM YYYY เวลา H:mm', + ], + 'calendar' => [ + 'sameDay' => '[วันนี้ เวลา] LT', + 'nextDay' => '[พรุ่งนี้ เวลา] LT', + 'nextWeek' => 'dddd[หน้า เวลา] LT', + 'lastDay' => '[เมื่อวานนี้ เวลา] LT', + 'lastWeek' => '[วัน]dddd[ที่แล้ว เวลา] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ก่อนเที่ยง', 'หลังเที่ยง'], + 'months' => ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'], + 'months_short' => ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], + 'weekdays' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'], + 'weekdays_short' => ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัส', 'ศุกร์', 'เสาร์'], + 'weekdays_min' => ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], + 'list' => [', ', ' และ '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php new file mode 100644 index 00000000..b9f94b2d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/th_TH.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/th.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the.php new file mode 100644 index 00000000..85f8333b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/the_NP.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php new file mode 100644 index 00000000..cdb02b2c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/the_NP.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Chitwanix OS Development info@chitwanix.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'dddd DD MMM YYYY', + ], + 'months' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'months_short' => ['जनवरी', 'फ़रवरी', 'मार्च', 'अप्रेल', 'मई', 'जून', 'जुलाई', 'अगस्त', 'सितम्बर', 'अक्टूबर', 'नवम्बर', 'दिसम्बर'], + 'weekdays' => ['आइतबार', 'सोमबार', 'मंगलबार', 'बुधबार', 'बिहिबार', 'शुक्रबार', 'शनिबार'], + 'weekdays_short' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], + 'weekdays_min' => ['आइत', 'सोम', 'मंगल', 'बुध', 'बिहि', 'शुक्र', 'शनि'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['पूर्वाह्न', 'अपराह्न'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti.php new file mode 100644 index 00000000..ffd32369 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ti_ER.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php new file mode 100644 index 00000000..310c51cc --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ER.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], + 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], + 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], + + 'year' => ':count ዓመት', + 'y' => ':count ዓመት', + 'a_year' => ':count ዓመት', + + 'month' => 'ወርሒ :count', + 'm' => 'ወርሒ :count', + 'a_month' => 'ወርሒ :count', + + 'week' => ':count ሰሙን', + 'w' => ':count ሰሙን', + 'a_week' => ':count ሰሙን', + + 'day' => ':count መዓልቲ', + 'd' => ':count መዓልቲ', + 'a_day' => ':count መዓልቲ', + + 'hour' => ':count ሰዓት', + 'h' => ':count ሰዓት', + 'a_hour' => ':count ሰዓት', + + 'minute' => ':count ደቒቕ', + 'min' => ':count ደቒቕ', + 'a_minute' => ':count ደቒቕ', + + 'second' => ':count ሰከንድ', + 's' => ':count ሰከንድ', + 'a_second' => ':count ሰከንድ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php new file mode 100644 index 00000000..a8160698 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ti_ET.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], + 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], + 'weekdays' => ['ሰንበት', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'weekdays_short' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'weekdays_min' => ['ሰንበ', 'ሰኑይ', 'ሰሉስ', 'ረቡዕ', 'ሓሙስ', 'ዓርቢ', 'ቀዳም'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ንጉሆ ሰዓተ', 'ድሕር ሰዓት'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig.php new file mode 100644 index 00000000..186fe713 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tig_ER.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php new file mode 100644 index 00000000..46887b05 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tig_ER.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጥሪ', 'ለካቲት', 'መጋቢት', 'ሚያዝያ', 'ግንቦት', 'ሰነ', 'ሓምለ', 'ነሓሰ', 'መስከረም', 'ጥቅምቲ', 'ሕዳር', 'ታሕሳስ'], + 'months_short' => ['ጥሪ ', 'ለካቲ', 'መጋቢ', 'ሚያዝ', 'ግንቦ', 'ሰነ ', 'ሓምለ', 'ነሓሰ', 'መስከ', 'ጥቅም', 'ሕዳር', 'ታሕሳ'], + 'weekdays' => ['ሰንበት ዓባይ', 'ሰኖ', 'ታላሸኖ', 'ኣረርባዓ', 'ከሚሽ', 'ጅምዓት', 'ሰንበት ንኢሽ'], + 'weekdays_short' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], + 'weekdays_min' => ['ሰ//ዓ', 'ሰኖ ', 'ታላሸ', 'ኣረር', 'ከሚሽ', 'ጅምዓ', 'ሰ//ን'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ቀደም ሰር ምዕል', 'ሓቆ ሰር ምዕል'], + + 'year' => ':count ማይ', // less reliable + 'y' => ':count ማይ', // less reliable + 'a_year' => ':count ማይ', // less reliable + + 'month' => ':count ሸምሽ', // less reliable + 'm' => ':count ሸምሽ', // less reliable + 'a_month' => ':count ሸምሽ', // less reliable + + 'week' => ':count ሰቡዕ', // less reliable + 'w' => ':count ሰቡዕ', // less reliable + 'a_week' => ':count ሰቡዕ', // less reliable + + 'day' => ':count ዎሮ', // less reliable + 'd' => ':count ዎሮ', // less reliable + 'a_day' => ':count ዎሮ', // less reliable + + 'hour' => ':count ሰዓት', // less reliable + 'h' => ':count ሰዓት', // less reliable + 'a_hour' => ':count ሰዓት', // less reliable + + 'minute' => ':count ካልኣይት', // less reliable + 'min' => ':count ካልኣይት', // less reliable + 'a_minute' => ':count ካልኣይት', // less reliable + + 'second' => ':count ካልኣይ', + 's' => ':count ካልኣይ', + 'a_second' => ':count ካልኣይ', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk.php new file mode 100644 index 00000000..d8f7d19d --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tk_TM.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php new file mode 100644 index 00000000..b1c487a0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tk_TM.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/** + * Authors: + * - Ghorban M. Tavakoly Pablo Saratxaga & Ghorban M. Tavakoly pablo@walon.org & gmt314@yahoo.com + * - SuperManPHP + * - Maksat Meredow (isadma) + */ +$transformDiff = static fn (string $input) => strtr($input, [ + 'sekunt' => 'sekunt', + 'hepde' => 'hepde', +]); + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Ýanwar', 'Fewral', 'Mart', 'Aprel', 'Maý', 'Iýun', 'Iýul', 'Awgust', 'Sentýabr', 'Oktýabr', 'Noýabr', 'Dekabr'], + 'months_short' => ['Ýan', 'Few', 'Mar', 'Apr', 'Maý', 'Iýn', 'Iýl', 'Awg', 'Sen', 'Okt', 'Noý', 'Dek'], + 'weekdays' => ['Ýekşenbe', 'Duşenbe', 'Sişenbe', 'Çarşenbe', 'Penşenbe', 'Anna', 'Şenbe'], + 'weekdays_short' => ['Ýek', 'Duş', 'Siş', 'Çar', 'Pen', 'Ann', 'Şen'], + 'weekdays_min' => ['Ýe', 'Du', 'Si', 'Ça', 'Pe', 'An', 'Şe'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count ýyl', + 'y' => ':count ýyl', + 'a_year' => ':count ýyl', + + 'month' => ':count aý', + 'm' => ':count aý', + 'a_month' => ':count aý', + + 'week' => ':count hepde', + 'w' => ':count hepde', + 'a_week' => ':count hepde', + + 'day' => ':count gün', + 'd' => ':count gün', + 'a_day' => ':count gün', + + 'hour' => ':count sagat', + 'h' => ':count sagat', + 'a_hour' => ':count sagat', + + 'minute' => ':count minut', + 'min' => ':count minut', + 'a_minute' => ':count minut', + + 'second' => ':count sekunt', + 's' => ':count sekunt', + 'a_second' => ':count sekunt', + + 'ago' => static fn (string $time) => $transformDiff($time).' ozal', + 'from_now' => static fn (string $time) => $transformDiff($time).' soňra', + 'after' => static fn (string $time) => $transformDiff($time).' soň', + 'before' => static fn (string $time) => $transformDiff($time).' öň', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl.php new file mode 100644 index 00000000..410a2660 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'year' => ':count taon', + 'a_year' => '{1}isang taon|:count taon', + 'month' => ':count buwan', + 'a_month' => '{1}isang buwan|:count buwan', + 'week' => ':count linggo', + 'a_week' => '{1}isang linggo|:count linggo', + 'day' => ':count araw', + 'a_day' => '{1}isang araw|:count araw', + 'hour' => ':count oras', + 'a_hour' => '{1}isang oras|:count oras', + 'minute' => ':count minuto', + 'a_minute' => '{1}isang minuto|:count minuto', + 'min' => ':count min.', + 'second' => ':count segundo', + 'a_second' => '{1}ilang segundo|:count segundo', + 's' => ':count seg.', + 'ago' => ':time ang nakalipas', + 'from_now' => 'sa loob ng :time', + 'diff_now' => 'ngayon', + 'diff_today' => 'ngayong', + 'diff_today_regexp' => 'ngayong(?:\\s+araw)?', + 'diff_yesterday' => 'kahapon', + 'diff_tomorrow' => 'bukas', + 'diff_tomorrow_regexp' => 'Bukas(?:\\s+ng)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'MM/D/YYYY', + 'LL' => 'MMMM D, YYYY', + 'LLL' => 'MMMM D, YYYY HH:mm', + 'LLLL' => 'dddd, MMMM DD, YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => 'LT [ngayong araw]', + 'nextDay' => '[Bukas ng] LT', + 'nextWeek' => 'LT [sa susunod na] dddd', + 'lastDay' => 'LT [kahapon]', + 'lastWeek' => 'LT [noong nakaraang] dddd', + 'sameElse' => 'L', + ], + 'months' => ['Enero', 'Pebrero', 'Marso', 'Abril', 'Mayo', 'Hunyo', 'Hulyo', 'Agosto', 'Setyembre', 'Oktubre', 'Nobyembre', 'Disyembre'], + 'months_short' => ['Ene', 'Peb', 'Mar', 'Abr', 'May', 'Hun', 'Hul', 'Ago', 'Set', 'Okt', 'Nob', 'Dis'], + 'weekdays' => ['Linggo', 'Lunes', 'Martes', 'Miyerkules', 'Huwebes', 'Biyernes', 'Sabado'], + 'weekdays_short' => ['Lin', 'Lun', 'Mar', 'Miy', 'Huw', 'Biy', 'Sab'], + 'weekdays_min' => ['Li', 'Lu', 'Ma', 'Mi', 'Hu', 'Bi', 'Sab'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' at '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php new file mode 100644 index 00000000..95f508c3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tl_PH.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Ian De La Cruz + * - JD Isaacks + */ +return require __DIR__.'/tl.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php new file mode 100644 index 00000000..4ecf2446 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tlh.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Serhan Apaydın + * - Dominika + */ +return [ + 'year' => '{1}wa’ DIS|:count DIS', + 'month' => '{1}wa’ jar|:count jar', + 'week' => '{1}wa’ hogh|:count hogh', + 'day' => '{1}wa’ jaj|:count jaj', + 'hour' => '{1}wa’ rep|:count rep', + 'minute' => '{1}wa’ tup|:count tup', + 'second' => '{1}puS lup|:count lup', + 'ago' => static function ($time) { + $output = strtr($time, [ + 'jaj' => 'Hu’', + 'jar' => 'wen', + 'DIS' => 'ben', + ]); + + return $output === $time ? "$time ret" : $output; + }, + 'from_now' => static function ($time) { + $output = strtr($time, [ + 'jaj' => 'leS', + 'jar' => 'waQ', + 'DIS' => 'nem', + ]); + + return $output === $time ? "$time pIq" : $output; + }, + 'diff_yesterday' => 'wa’Hu’', + 'diff_today' => 'DaHjaj', + 'diff_tomorrow' => 'wa’leS', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[DaHjaj] LT', + 'nextDay' => '[wa’leS] LT', + 'nextWeek' => 'LLL', + 'lastDay' => '[wa’Hu’] LT', + 'lastWeek' => 'LLL', + 'sameElse' => 'L', + ], + 'ordinal' => ':number.', + 'months' => ['tera’ jar wa’', 'tera’ jar cha’', 'tera’ jar wej', 'tera’ jar loS', 'tera’ jar vagh', 'tera’ jar jav', 'tera’ jar Soch', 'tera’ jar chorgh', 'tera’ jar Hut', 'tera’ jar wa’maH', 'tera’ jar wa’maH wa’', 'tera’ jar wa’maH cha’'], + 'months_short' => ['jar wa’', 'jar cha’', 'jar wej', 'jar loS', 'jar vagh', 'jar jav', 'jar Soch', 'jar chorgh', 'jar Hut', 'jar wa’maH', 'jar wa’maH wa’', 'jar wa’maH cha’'], + 'weekdays' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], + 'weekdays_short' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], + 'weekdays_min' => ['lojmItjaj', 'DaSjaj', 'povjaj', 'ghItlhjaj', 'loghjaj', 'buqjaj', 'ghInjaj'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' ’ej '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn.php new file mode 100644 index 00000000..f29bdf68 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tn_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php new file mode 100644 index 00000000..e3df8f68 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tn_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Ferikgong', 'Tlhakole', 'Mopitlwe', 'Moranang', 'Motsheganong', 'Seetebosigo', 'Phukwi', 'Phatwe', 'Lwetse', 'Diphalane', 'Ngwanatsele', 'Sedimonthole'], + 'months_short' => ['Fer', 'Tlh', 'Mop', 'Mor', 'Mot', 'See', 'Phu', 'Pha', 'Lwe', 'Dip', 'Ngw', 'Sed'], + 'weekdays' => ['laTshipi', 'Mosupologo', 'Labobedi', 'Laboraro', 'Labone', 'Labotlhano', 'Lamatlhatso'], + 'weekdays_short' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], + 'weekdays_min' => ['Tsh', 'Mos', 'Bed', 'Rar', 'Ne', 'Tlh', 'Mat'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => 'dingwaga di le :count', + 'y' => 'dingwaga di le :count', + 'a_year' => 'dingwaga di le :count', + + 'month' => 'dikgwedi di le :count', + 'm' => 'dikgwedi di le :count', + 'a_month' => 'dikgwedi di le :count', + + 'week' => 'dibeke di le :count', + 'w' => 'dibeke di le :count', + 'a_week' => 'dibeke di le :count', + + 'day' => 'malatsi :count', + 'd' => 'malatsi :count', + 'a_day' => 'malatsi :count', + + 'hour' => 'diura di le :count', + 'h' => 'diura di le :count', + 'a_hour' => 'diura di le :count', + + 'minute' => 'metsotso e le :count', + 'min' => 'metsotso e le :count', + 'a_minute' => 'metsotso e le :count', + + 'second' => 'metsotswana e le :count', + 's' => 'metsotswana e le :count', + 'a_second' => 'metsotswana e le :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to.php new file mode 100644 index 00000000..20581bba --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/to_TO.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php new file mode 100644 index 00000000..ce713edb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/to_TO.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - International Components for Unicode akhilesh.k@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'first_day_of_week' => 0, + 'formats' => [ + 'L' => 'dddd DD MMM YYYY', + ], + 'months' => ['Sānuali', 'Fēpueli', 'Maʻasi', 'ʻEpeleli', 'Mē', 'Sune', 'Siulai', 'ʻAokosi', 'Sepitema', 'ʻOkatopa', 'Nōvema', 'Tīsema'], + 'months_short' => ['Sān', 'Fēp', 'Maʻa', 'ʻEpe', 'Mē', 'Sun', 'Siu', 'ʻAok', 'Sep', 'ʻOka', 'Nōv', 'Tīs'], + 'weekdays' => ['Sāpate', 'Mōnite', 'Tūsite', 'Pulelulu', 'Tuʻapulelulu', 'Falaite', 'Tokonaki'], + 'weekdays_short' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], + 'weekdays_min' => ['Sāp', 'Mōn', 'Tūs', 'Pul', 'Tuʻa', 'Fal', 'Tok'], + 'meridiem' => ['hengihengi', 'efiafi'], + + 'year' => ':count fitu', // less reliable + 'y' => ':count fitu', // less reliable + 'a_year' => ':count fitu', // less reliable + + 'month' => ':count mahina', // less reliable + 'm' => ':count mahina', // less reliable + 'a_month' => ':count mahina', // less reliable + + 'week' => ':count Sapate', // less reliable + 'w' => ':count Sapate', // less reliable + 'a_week' => ':count Sapate', // less reliable + + 'day' => ':count ʻaho', // less reliable + 'd' => ':count ʻaho', // less reliable + 'a_day' => ':count ʻaho', // less reliable + + 'hour' => ':count houa', + 'h' => ':count houa', + 'a_hour' => ':count houa', + + 'minute' => ':count miniti', + 'min' => ':count miniti', + 'a_minute' => ':count miniti', + + 'second' => ':count sekoni', + 's' => ':count sekoni', + 'a_second' => ':count sekoni', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php new file mode 100644 index 00000000..7d38daed --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tpi_PG.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php new file mode 100644 index 00000000..721b625b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tpi_PG.php @@ -0,0 +1,56 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Samsung Electronics Co., Ltd. akhilesh.k@samsung.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Janueri', 'Februeri', 'Mas', 'Epril', 'Me', 'Jun', 'Julai', 'Ogas', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mas', 'Epr', 'Me', 'Jun', 'Jul', 'Oga', 'Sep', 'Okt', 'Nov', 'Des'], + 'weekdays' => ['Sande', 'Mande', 'Tunde', 'Trinde', 'Fonde', 'Fraide', 'Sarere'], + 'weekdays_short' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], + 'weekdays_min' => ['San', 'Man', 'Tun', 'Tri', 'Fon', 'Fra', 'Sar'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['biknait', 'apinun'], + + 'year' => 'yia :count', + 'y' => 'yia :count', + 'a_year' => 'yia :count', + + 'month' => ':count mun', + 'm' => ':count mun', + 'a_month' => ':count mun', + + 'week' => ':count wik', + 'w' => ':count wik', + 'a_week' => ':count wik', + + 'day' => ':count de', + 'd' => ':count de', + 'a_day' => ':count de', + + 'hour' => ':count aua', + 'h' => ':count aua', + 'a_hour' => ':count aua', + + 'minute' => ':count minit', + 'min' => ':count minit', + 'a_minute' => ':count minit', + + 'second' => ':count namba tu', + 's' => ':count namba tu', + 'a_second' => ':count namba tu', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr.php new file mode 100644 index 00000000..0cb3aade --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Alan Agius + * - Erhan Gundogan + * - François B + * - JD Isaacks + * - Murat Yüksel + * - Baran Şengül + * - Selami (selamialtin) + * - TeomanBey + */ +return [ + 'year' => ':count yıl', + 'a_year' => '{1}bir yıl|[-Inf,Inf]:count yıl', + 'y' => ':county', + 'month' => ':count ay', + 'a_month' => '{1}bir ay|[-Inf,Inf]:count ay', + 'm' => ':countay', + 'week' => ':count hafta', + 'a_week' => '{1}bir hafta|[-Inf,Inf]:count hafta', + 'w' => ':counth', + 'day' => ':count gün', + 'a_day' => '{1}bir gün|[-Inf,Inf]:count gün', + 'd' => ':countg', + 'hour' => ':count saat', + 'a_hour' => '{1}bir saat|[-Inf,Inf]:count saat', + 'h' => ':countsa', + 'minute' => ':count dakika', + 'a_minute' => '{1}bir dakika|[-Inf,Inf]:count dakika', + 'min' => ':countdk', + 'second' => ':count saniye', + 'a_second' => '{1}birkaç saniye|[-Inf,Inf]:count saniye', + 's' => ':countsn', + 'ago' => ':time önce', + 'from_now' => ':time sonra', + 'after' => ':time sonra', + 'before' => ':time önce', + 'diff_now' => 'şimdi', + 'diff_today' => 'bugün', + 'diff_today_regexp' => 'bugün(?:\\s+saat)?', + 'diff_yesterday' => 'dün', + 'diff_tomorrow' => 'yarın', + 'diff_tomorrow_regexp' => 'yarın(?:\\s+saat)?', + 'diff_before_yesterday' => 'evvelsi gün', + 'diff_after_tomorrow' => 'öbür gün', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[bugün saat] LT', + 'nextDay' => '[yarın saat] LT', + 'nextWeek' => '[gelecek] dddd [saat] LT', + 'lastDay' => '[dün] LT', + 'lastWeek' => '[geçen] dddd [saat] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + switch ($period) { + case 'd': + case 'D': + case 'Do': + case 'DD': + return $number; + default: + if ($number === 0) { // special case for zero + return "$number'ıncı"; + } + + static $suffixes = [ + 1 => '\'inci', + 5 => '\'inci', + 8 => '\'inci', + 70 => '\'inci', + 80 => '\'inci', + 2 => '\'nci', + 7 => '\'nci', + 20 => '\'nci', + 50 => '\'nci', + 3 => '\'üncü', + 4 => '\'üncü', + 100 => '\'üncü', + 6 => '\'ncı', + 9 => '\'uncu', + 10 => '\'uncu', + 30 => '\'uncu', + 60 => '\'ıncı', + 90 => '\'ıncı', + ]; + + $lastDigit = $number % 10; + + return $number.($suffixes[$lastDigit] ?? $suffixes[$number % 100 - $lastDigit] ?? $suffixes[$number >= 100 ? 100 : -1] ?? ''); + } + }, + 'meridiem' => ['ÖÖ', 'ÖS', 'öö', 'ös'], + 'months' => ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran', 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım', 'Aralık'], + 'months_short' => ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'], + 'weekdays' => ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'], + 'weekdays_short' => ['Paz', 'Pts', 'Sal', 'Çar', 'Per', 'Cum', 'Cts'], + 'weekdays_min' => ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' ve '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php new file mode 100644 index 00000000..23f11449 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_CY.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/tr.php', [ + 'weekdays_short' => ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'], + 'weekdays_min' => ['Pa', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'], + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'D.MM.YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'D MMMM YYYY dddd h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php new file mode 100644 index 00000000..9e994824 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tr_TR.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/tr.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts.php new file mode 100644 index 00000000..525736bf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ts_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php new file mode 100644 index 00000000..32713455 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ts_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Sunguti', 'Nyenyenyani', 'Nyenyankulu', 'Dzivamisoko', 'Mudyaxihi', 'Khotavuxika', 'Mawuwani', 'Mhawuri', 'Ndzhati', 'Nhlangula', 'Hukuri', 'N\'wendzamhala'], + 'months_short' => ['Sun', 'Yan', 'Kul', 'Dzi', 'Mud', 'Kho', 'Maw', 'Mha', 'Ndz', 'Nhl', 'Huk', 'N\'w'], + 'weekdays' => ['Sonto', 'Musumbhunuku', 'Ravumbirhi', 'Ravunharhu', 'Ravumune', 'Ravuntlhanu', 'Mugqivela'], + 'weekdays_short' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], + 'weekdays_min' => ['Son', 'Mus', 'Bir', 'Har', 'Ne', 'Tlh', 'Mug'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => 'malembe ya :count', + 'y' => 'malembe ya :count', + 'a_year' => 'malembe ya :count', + + 'month' => 'tin’hweti ta :count', + 'm' => 'tin’hweti ta :count', + 'a_month' => 'tin’hweti ta :count', + + 'week' => 'mavhiki ya :count', + 'w' => 'mavhiki ya :count', + 'a_week' => 'mavhiki ya :count', + + 'day' => 'masiku :count', + 'd' => 'masiku :count', + 'a_day' => 'masiku :count', + + 'hour' => 'tiawara ta :count', + 'h' => 'tiawara ta :count', + 'a_hour' => 'tiawara ta :count', + + 'minute' => 'timinete ta :count', + 'min' => 'timinete ta :count', + 'a_minute' => 'timinete ta :count', + + 'second' => 'tisekoni ta :count', + 's' => 'tisekoni ta :count', + 'a_second' => 'tisekoni ta :count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt.php new file mode 100644 index 00000000..d67d896e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/tt_RU.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php new file mode 100644 index 00000000..38e42d05 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Rinat Norkin Pablo Saratxaga, Rinat Norkin pablo@mandrakesoft.com, rinat@taif.ru + */ +return [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'DD MMM, HH:mm', + 'LLLL' => 'DD MMMM YYYY, HH:mm', + ], + 'months' => ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'], + 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'weekdays' => ['якшәмбе', 'дышәмбе', 'сишәмбе', 'чәршәәмбе', 'пәнҗешмбе', 'җомга', 'шимбә'], + 'weekdays_short' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], + 'weekdays_min' => ['якш', 'дыш', 'сиш', 'чәрш', 'пәнҗ', 'җом', 'шим'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'year' => ':count ел', + 'month' => ':count ай', + 'week' => ':count атна', + 'day' => ':count көн', + 'hour' => ':count сәгать', + 'minute' => ':count минут', + 'second' => ':count секунд', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php new file mode 100644 index 00000000..16b8efb1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tt_RU@iqtelif.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Reshat Sabiq tatar.iqtelif.i18n@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD.MM.YYYY', + ], + 'months' => ['Ğınwar', 'Fiwral\'', 'Mart', 'April', 'May', 'Yün', 'Yül', 'Awgust', 'Sintebír', 'Üktebír', 'Noyebír', 'Dikebír'], + 'months_short' => ['Ğın', 'Fiw', 'Mar', 'Apr', 'May', 'Yün', 'Yül', 'Awg', 'Sin', 'Ükt', 'Noy', 'Dik'], + 'weekdays' => ['Yekşembí', 'Düşembí', 'Sişembí', 'Çerşembí', 'Pencíşembí', 'Comğa', 'Şimbe'], + 'weekdays_short' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], + 'weekdays_min' => ['Yek', 'Düş', 'Siş', 'Çer', 'Pen', 'Com', 'Şim'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ÖA', 'ÖS'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/twq.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/twq.php new file mode 100644 index 00000000..5cbb46e0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/twq.php @@ -0,0 +1,14 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/ses.php', [ + 'meridiem' => ['Subbaahi', 'Zaarikay b'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php new file mode 100644 index 00000000..50bf26d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzl.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + 'year' => '[0,1]:count ar|:count ars', + 'y' => '[0,1]:count ar|:count ars', + 'month' => '[0,1]:count mes|:count mesen', + 'm' => '[0,1]:count mes|:count mesen', + 'week' => '[0,1]:count seifetziua|:count seifetziuas', + 'w' => '[0,1]:count seifetziua|:count seifetziuas', + 'day' => '[0,1]:count ziua|:count ziuas', + 'd' => '[0,1]:count ziua|:count ziuas', + 'hour' => '[0,1]:count þora|:count þoras', + 'h' => '[0,1]:count þora|:count þoras', + 'minute' => '[0,1]:count míut|:count míuts', + 'min' => '[0,1]:count míut|:count míuts', + 'second' => ':count secunds', + 's' => ':count secunds', + + 'ago' => 'ja :time', + 'from_now' => 'osprei :time', + + 'diff_yesterday' => 'ieiri', + 'diff_yesterday_regexp' => 'ieiri(?:\\s+à)?', + 'diff_today' => 'oxhi', + 'diff_today_regexp' => 'oxhi(?:\\s+à)?', + 'diff_tomorrow' => 'demà', + 'diff_tomorrow_regexp' => 'demà(?:\\s+à)?', + + 'formats' => [ + 'LT' => 'HH.mm', + 'LTS' => 'HH.mm.ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D. MMMM [dallas] YYYY', + 'LLL' => 'D. MMMM [dallas] YYYY HH.mm', + 'LLLL' => 'dddd, [li] D. MMMM [dallas] YYYY HH.mm', + ], + + 'calendar' => [ + 'sameDay' => '[oxhi à] LT', + 'nextDay' => '[demà à] LT', + 'nextWeek' => 'dddd [à] LT', + 'lastDay' => '[ieiri à] LT', + 'lastWeek' => '[sür el] dddd [lasteu à] LT', + 'sameElse' => 'L', + ], + + 'meridiem' => ["D'A", "D'O"], + 'months' => ['Januar', 'Fevraglh', 'Març', 'Avrïu', 'Mai', 'Gün', 'Julia', 'Guscht', 'Setemvar', 'Listopäts', 'Noemvar', 'Zecemvar'], + 'months_short' => ['Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Gün', 'Jul', 'Gus', 'Set', 'Lis', 'Noe', 'Zec'], + 'weekdays' => ['Súladi', 'Lúneçi', 'Maitzi', 'Márcuri', 'Xhúadi', 'Viénerçi', 'Sáturi'], + 'weekdays_short' => ['Súl', 'Lún', 'Mai', 'Már', 'Xhú', 'Vié', 'Sát'], + 'weekdays_min' => ['Sú', 'Lú', 'Ma', 'Má', 'Xh', 'Vi', 'Sá'], + 'ordinal' => ':number.', + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php new file mode 100644 index 00000000..2a1a0f2b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - JD Isaacks + */ +return [ + 'year' => '{1}ⴰⵙⴳⴰⵙ|:count ⵉⵙⴳⴰⵙⵏ', + 'month' => '{1}ⴰⵢoⵓⵔ|:count ⵉⵢⵢⵉⵔⵏ', + 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ', + 'day' => '{1}ⴰⵙⵙ|:count oⵙⵙⴰⵏ', + 'hour' => '{1}ⵙⴰⵄⴰ|:count ⵜⴰⵙⵙⴰⵄⵉⵏ', + 'minute' => '{1}ⵎⵉⵏⵓⴺ|:count ⵎⵉⵏⵓⴺ', + 'second' => '{1}ⵉⵎⵉⴽ|:count ⵉⵎⵉⴽ', + 'ago' => 'ⵢⴰⵏ :time', + 'from_now' => 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ :time', + 'diff_today' => 'ⴰⵙⴷⵅ', + 'diff_yesterday' => 'ⴰⵚⴰⵏⵜ', + 'diff_yesterday_regexp' => 'ⴰⵚⴰⵏⵜ(?:\\s+ⴴ)?', + 'diff_tomorrow' => 'ⴰⵙⴽⴰ', + 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴰ(?:\\s+ⴴ)?', + 'diff_today_regexp' => 'ⴰⵙⴷⵅ(?:\\s+ⴴ)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[ⴰⵙⴷⵅ ⴴ] LT', + 'nextDay' => '[ⴰⵙⴽⴰ ⴴ] LT', + 'nextWeek' => 'dddd [ⴴ] LT', + 'lastDay' => '[ⴰⵚⴰⵏⵜ ⴴ] LT', + 'lastWeek' => 'dddd [ⴴ] LT', + 'sameElse' => 'L', + ], + 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], + 'months_short' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⵏⴱⵉⵔ'], + 'weekdays' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], + 'weekdays_short' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], + 'weekdays_min' => ['ⴰⵙⴰⵎⴰⵙ', 'ⴰⵢⵏⴰⵙ', 'ⴰⵙⵉⵏⴰⵙ', 'ⴰⴽⵔⴰⵙ', 'ⴰⴽⵡⴰⵙ', 'ⴰⵙⵉⵎⵡⴰⵙ', 'ⴰⵙⵉⴹⵢⴰⵙ'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, + 'weekend' => [5, 6], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php new file mode 100644 index 00000000..5840d209 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/tzm_Latn.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - JD Isaacks + */ +return [ + 'year' => '{1}:count asgas|:count isgasn', + 'a_year' => 'asgas|:count isgasn', + 'month' => '{1}:count ayowr|:count iyyirn', + 'a_month' => 'ayowr|:count iyyirn', + 'week' => ':count imalass', + 'a_week' => ':imalass', + 'day' => '{1}:count ass|:count ossan', + 'a_day' => 'ass|:count ossan', + 'hour' => '{1}:count saɛa|:count tassaɛin', + 'a_hour' => '{1}saɛa|:count tassaɛin', + 'minute' => ':count minuḍ', + 'a_minute' => '{1}minuḍ|:count minuḍ', + 'second' => ':count imik', + 'a_second' => '{1}imik|:count imik', + 'ago' => 'yan :time', + 'from_now' => 'dadkh s yan :time', + 'diff_yesterday' => 'assant', + 'diff_yesterday_regexp' => 'assant(?:\\s+g)?', + 'diff_today' => 'asdkh', + 'diff_today_regexp' => 'asdkh(?:\\s+g)?', + 'diff_tomorrow' => 'aska', + 'diff_tomorrow_regexp' => 'aska(?:\\s+g)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[asdkh g] LT', + 'nextDay' => '[aska g] LT', + 'nextWeek' => 'dddd [g] LT', + 'lastDay' => '[assant g] LT', + 'lastWeek' => 'dddd [g] LT', + 'sameElse' => 'L', + ], + 'months' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], + 'months_short' => ['innayr', 'brˤayrˤ', 'marˤsˤ', 'ibrir', 'mayyw', 'ywnyw', 'ywlywz', 'ɣwšt', 'šwtanbir', 'ktˤwbrˤ', 'nwwanbir', 'dwjnbir'], + 'weekdays' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], + 'weekdays_short' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], + 'weekdays_min' => ['asamas', 'aynas', 'asinas', 'akras', 'akwas', 'asimwas', 'asiḍyas'], + 'meridiem' => ['Zdat azal', 'Ḍeffir aza'], + 'first_day_of_week' => 6, + 'day_of_first_week_of_year' => 1, +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug.php new file mode 100644 index 00000000..12c9f8a6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Philippe Vaucher + * - Tsutomu Kuroda + * - yasinn + */ +return [ + 'year' => '{1}'.'بىر يىل'.'|:count '.'يىل', + 'month' => '{1}'.'بىر ئاي'.'|:count '.'ئاي', + 'week' => '{1}'.'بىر ھەپتە'.'|:count '.'ھەپتە', + 'day' => '{1}'.'بىر كۈن'.'|:count '.'كۈن', + 'hour' => '{1}'.'بىر سائەت'.'|:count '.'سائەت', + 'minute' => '{1}'.'بىر مىنۇت'.'|:count '.'مىنۇت', + 'second' => '{1}'.'نەچچە سېكونت'.'|:count '.'سېكونت', + 'ago' => ':time بۇرۇن', + 'from_now' => ':time كېيىن', + 'diff_today' => 'بۈگۈن', + 'diff_yesterday' => 'تۆنۈگۈن', + 'diff_tomorrow' => 'ئەتە', + 'diff_tomorrow_regexp' => 'ئەتە(?:\\s+سائەت)?', + 'diff_today_regexp' => 'بۈگۈن(?:\\s+سائەت)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-DD', + 'LL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى', + 'LLL' => 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', + 'LLLL' => 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[بۈگۈن سائەت] LT', + 'nextDay' => '[ئەتە سائەت] LT', + 'nextWeek' => '[كېلەركى] dddd [سائەت] LT', + 'lastDay' => '[تۆنۈگۈن] LT', + 'lastWeek' => '[ئالدىنقى] dddd [سائەت] LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'd', 'D', 'DDD' => $number.'-كۈنى', + 'w', 'W' => $number.'-ھەپتە', + default => $number, + }; + }, + 'meridiem' => static function ($hour, $minute) { + $time = $hour * 100 + $minute; + if ($time < 600) { + return 'يېرىم كېچە'; + } + if ($time < 900) { + return 'سەھەر'; + } + if ($time < 1130) { + return 'چۈشتىن بۇرۇن'; + } + if ($time < 1230) { + return 'چۈش'; + } + if ($time < 1800) { + return 'چۈشتىن كېيىن'; + } + + return 'كەچ'; + }, + 'months' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], + 'months_short' => ['يانۋار', 'فېۋرال', 'مارت', 'ئاپرېل', 'ماي', 'ئىيۇن', 'ئىيۇل', 'ئاۋغۇست', 'سېنتەبىر', 'ئۆكتەبىر', 'نويابىر', 'دېكابىر'], + 'weekdays' => ['يەكشەنبە', 'دۈشەنبە', 'سەيشەنبە', 'چارشەنبە', 'پەيشەنبە', 'جۈمە', 'شەنبە'], + 'weekdays_short' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], + 'weekdays_min' => ['يە', 'دۈ', 'سە', 'چا', 'پە', 'جۈ', 'شە'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' ۋە '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php new file mode 100644 index 00000000..deb828c5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ug_CN.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Kunal Marwaha + * - Alim Boyaq + */ +return require __DIR__.'/ug.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk.php new file mode 100644 index 00000000..3bedd2ea --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk.php @@ -0,0 +1,190 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Carbon\CarbonInterface; + +$processHoursFunction = static function (CarbonInterface $date, string $format) { + return $format.'о'.($date->hour === 11 ? 'б' : '').'] LT'; +}; + +/* + * Authors: + * - Kunal Marwaha + * - Josh Soref + * - François B + * - Tim Fish + * - Serhan Apaydın + * - Max Mykhailenko + * - JD Isaacks + * - Max Kovpak + * - AucT + * - Philippe Vaucher + * - Ilya Shaplyko + * - Vadym Ievsieiev + * - Denys Kurets + * - Igor Kasyanchuk + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Oleh + * - epaminond + * - Juanito Fatas + * - Vitalii Khustochka + * - Akira Matsuda + * - Christopher Dell + * - Enrique Vidal + * - Simone Carletti + * - Aaron Patterson + * - Andriy Tyurnikov + * - Nicolás Hock Isaza + * - Iwakura Taro + * - Andrii Ponomarov + * - alecrabbit + * - vystepanenko + * - AlexWalkerson + * - Andre Havryliuk (Andrend) + * - Max Datsenko (datsenko-md) + */ +return [ + 'year' => ':count рік|:count роки|:count років', + 'y' => ':countр|:countрр|:countрр', + 'a_year' => '{1}рік|:count рік|:count роки|:count років', + 'month' => ':count місяць|:count місяці|:count місяців', + 'm' => ':countм', + 'a_month' => '{1}місяць|:count місяць|:count місяці|:count місяців', + 'week' => ':count тиждень|:count тижні|:count тижнів', + 'w' => ':countт', + 'a_week' => '{1}тиждень|:count тиждень|:count тижні|:count тижнів', + 'day' => ':count день|:count дні|:count днів', + 'd' => ':countд', + 'a_day' => '{1}день|:count день|:count дні|:count днів', + 'hour' => ':count година|:count години|:count годин', + 'h' => ':countг', + 'a_hour' => '{1}година|:count година|:count години|:count годин', + 'minute' => ':count хвилина|:count хвилини|:count хвилин', + 'min' => ':countхв', + 'a_minute' => '{1}хвилина|:count хвилина|:count хвилини|:count хвилин', + 'second' => ':count секунда|:count секунди|:count секунд', + 's' => ':countсек', + 'a_second' => '{1}декілька секунд|:count секунда|:count секунди|:count секунд', + + 'hour_ago' => ':count годину|:count години|:count годин', + 'a_hour_ago' => '{1}годину|:count годину|:count години|:count годин', + 'minute_ago' => ':count хвилину|:count хвилини|:count хвилин', + 'a_minute_ago' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', + 'second_ago' => ':count секунду|:count секунди|:count секунд', + 'a_second_ago' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', + + 'hour_from_now' => ':count годину|:count години|:count годин', + 'a_hour_from_now' => '{1}годину|:count годину|:count години|:count годин', + 'minute_from_now' => ':count хвилину|:count хвилини|:count хвилин', + 'a_minute_from_now' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', + 'second_from_now' => ':count секунду|:count секунди|:count секунд', + 'a_second_from_now' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', + + 'hour_after' => ':count годину|:count години|:count годин', + 'a_hour_after' => '{1}годину|:count годину|:count години|:count годин', + 'minute_after' => ':count хвилину|:count хвилини|:count хвилин', + 'a_minute_after' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', + 'second_after' => ':count секунду|:count секунди|:count секунд', + 'a_second_after' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', + + 'hour_before' => ':count годину|:count години|:count годин', + 'a_hour_before' => '{1}годину|:count годину|:count години|:count годин', + 'minute_before' => ':count хвилину|:count хвилини|:count хвилин', + 'a_minute_before' => '{1}хвилину|:count хвилину|:count хвилини|:count хвилин', + 'second_before' => ':count секунду|:count секунди|:count секунд', + 'a_second_before' => '{1}декілька секунд|:count секунду|:count секунди|:count секунд', + + 'ago' => ':time тому', + 'from_now' => 'за :time', + 'after' => ':time після', + 'before' => ':time до', + 'diff_now' => 'щойно', + 'diff_today' => 'Сьогодні', + 'diff_today_regexp' => 'Сьогодні(?:\\s+о)?', + 'diff_yesterday' => 'вчора', + 'diff_yesterday_regexp' => 'Вчора(?:\\s+о)?', + 'diff_tomorrow' => 'завтра', + 'diff_tomorrow_regexp' => 'Завтра(?:\\s+о)?', + 'diff_before_yesterday' => 'позавчора', + 'diff_after_tomorrow' => 'післязавтра', + 'period_recurrences' => 'один раз|:count рази|:count разів', + 'period_interval' => 'кожні :interval', + 'period_start_date' => 'з :date', + 'period_end_date' => 'до :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY, HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY, HH:mm', + ], + 'calendar' => [ + 'sameDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Сьогодні '), + 'nextDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Завтра '), + 'nextWeek' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[У] dddd ['), + 'lastDay' => static fn (CarbonInterface $date) => $processHoursFunction($date, '[Вчора '), + 'lastWeek' => static fn (CarbonInterface $date) => match ($date->dayOfWeek) { + 0, 3, 5, 6 => $processHoursFunction($date, '[Минулої] dddd ['), + default => $processHoursFunction($date, '[Минулого] dddd ['), + }, + 'sameElse' => 'L', + ], + 'ordinal' => static fn ($number, $period) => match ($period) { + 'M', 'd', 'DDD', 'w', 'W' => $number.'-й', + 'D' => $number.'-го', + default => $number, + }, + 'meridiem' => static function ($hour) { + if ($hour < 4) { + return 'ночі'; + } + + if ($hour < 12) { + return 'ранку'; + } + + if ($hour < 17) { + return 'дня'; + } + + return 'вечора'; + }, + 'months' => ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня'], + 'months_standalone' => ['січень', 'лютий', 'березень', 'квітень', 'травень', 'червень', 'липень', 'серпень', 'вересень', 'жовтень', 'листопад', 'грудень'], + 'months_short' => ['січ', 'лют', 'бер', 'кві', 'тра', 'чер', 'лип', 'сер', 'вер', 'жов', 'лис', 'гру'], + 'months_regexp' => '/(D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|L{2,4}|l{2,4})/', + 'weekdays' => static function (CarbonInterface $date, $format, $index) { + static $words = [ + 'nominative' => ['неділя', 'понеділок', 'вівторок', 'середа', 'четвер', 'п’ятниця', 'субота'], + 'accusative' => ['неділю', 'понеділок', 'вівторок', 'середу', 'четвер', 'п’ятницю', 'суботу'], + 'genitive' => ['неділі', 'понеділка', 'вівторка', 'середи', 'четверга', 'п’ятниці', 'суботи'], + ]; + + $format ??= ''; + $nounCase = preg_match('/(\[(В|в|У|у)\])\s+dddd/u', $format) + ? 'accusative' + : ( + preg_match('/\[?(?:минулої|наступної)?\s*\]\s+dddd/u', $format) + ? 'genitive' + : 'nominative' + ); + + return $words[$nounCase][$index] ?? null; + }, + 'weekdays_short' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], + 'weekdays_min' => ['нд', 'пн', 'вт', 'ср', 'чт', 'пт', 'сб'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' i '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php new file mode 100644 index 00000000..bd11d86e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uk_UA.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/uk.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm.php new file mode 100644 index 00000000..d3f19f06 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/unm_US.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php new file mode 100644 index 00000000..161a1ec8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/unm_US.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['enikwsi', 'chkwali', 'xamokhwite', 'kwetayoxe', 'tainipen', 'kichinipen', 'lainipen', 'winaminke', 'kichitahkok', 'puksit', 'wini', 'muxkotae'], + 'months_short' => ['eni', 'chk', 'xam', 'kwe', 'tai', 'nip', 'lai', 'win', 'tah', 'puk', 'kun', 'mux'], + 'weekdays' => ['kentuwei', 'manteke', 'tusteke', 'lelai', 'tasteke', 'pelaiteke', 'sateteke'], + 'weekdays_short' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], + 'weekdays_min' => ['ken', 'man', 'tus', 'lel', 'tas', 'pel', 'sat'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + // Too unreliable + /* + 'year' => ':count kaxtëne', + 'y' => ':count kaxtëne', + 'a_year' => ':count kaxtëne', + + 'month' => ':count piskewëni kishux', // less reliable + 'm' => ':count piskewëni kishux', // less reliable + 'a_month' => ':count piskewëni kishux', // less reliable + + 'week' => ':count kishku', // less reliable + 'w' => ':count kishku', // less reliable + 'a_week' => ':count kishku', // less reliable + + 'day' => ':count kishku', + 'd' => ':count kishku', + 'a_day' => ':count kishku', + + 'hour' => ':count xkuk', // less reliable + 'h' => ':count xkuk', // less reliable + 'a_hour' => ':count xkuk', // less reliable + + 'minute' => ':count txituwàk', // less reliable + 'min' => ':count txituwàk', // less reliable + 'a_minute' => ':count txituwàk', // less reliable + + 'second' => ':count nisha', // less reliable + 's' => ':count nisha', // less reliable + 'a_second' => ':count nisha', // less reliable + */ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur.php new file mode 100644 index 00000000..ac960f3f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +$months = [ + 'جنوری', + 'فروری', + 'مارچ', + 'اپریل', + 'مئی', + 'جون', + 'جولائی', + 'اگست', + 'ستمبر', + 'اکتوبر', + 'نومبر', + 'دسمبر', +]; + +$weekdays = [ + 'اتوار', + 'پیر', + 'منگل', + 'بدھ', + 'جمعرات', + 'جمعہ', + 'ہفتہ', +]; + +/* + * Authors: + * - Sawood Alam + * - Mehshan + * - Philippe Vaucher + * - Tsutomu Kuroda + * - tjku + * - Zaid Akram + * - Max Melentiev + * - hafezdivandari + * - Hossein Jabbari + * - nimamo + * - Usman Zahid + */ +return [ + 'year' => ':count '.'سال', + 'a_year' => 'ایک سال|:count سال', + 'month' => ':count '.'ماہ', + 'a_month' => 'ایک ماہ|:count ماہ', + 'week' => ':count '.'ہفتے', + 'day' => ':count '.'دن', + 'a_day' => 'ایک دن|:count دن', + 'hour' => ':count '.'گھنٹے', + 'a_hour' => 'ایک گھنٹہ|:count گھنٹے', + 'minute' => ':count '.'منٹ', + 'a_minute' => 'ایک منٹ|:count منٹ', + 'second' => ':count '.'سیکنڈ', + 'a_second' => 'چند سیکنڈ|:count سیکنڈ', + 'ago' => ':time قبل', + 'from_now' => ':time بعد', + 'after' => ':time بعد', + 'before' => ':time پہلے', + 'diff_now' => 'اب', + 'diff_today' => 'آج', + 'diff_today_regexp' => 'آج(?:\\s+بوقت)?', + 'diff_yesterday' => 'گزشتہ کل', + 'diff_yesterday_regexp' => 'گذشتہ(?:\\s+روز)?(?:\\s+بوقت)?', + 'diff_tomorrow' => 'آئندہ کل', + 'diff_tomorrow_regexp' => 'کل(?:\\s+بوقت)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd، D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[آج بوقت] LT', + 'nextDay' => '[کل بوقت] LT', + 'nextWeek' => 'dddd [بوقت] LT', + 'lastDay' => '[گذشتہ روز بوقت] LT', + 'lastWeek' => '[گذشتہ] dddd [بوقت] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['صبح', 'شام'], + 'months' => $months, + 'months_short' => $months, + 'weekdays' => $weekdays, + 'weekdays_short' => $weekdays, + 'weekdays_min' => $weekdays, + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => ['، ', ' اور '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php new file mode 100644 index 00000000..f81c84d3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_IN.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Red Hat, Pune bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ur.php', [ + 'formats' => [ + 'L' => 'D/M/YY', + ], + 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'weekdays' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], + 'weekdays_short' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], + 'weekdays_min' => ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'سنیچر'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php new file mode 100644 index 00000000..8cd593db --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ur_PK.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/ur.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنوری', 'فروری', 'مارچ', 'اپریل', 'مئی', 'جون', 'جولائی', 'اگست', 'ستمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'weekdays' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'weekdays_short' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'weekdays_min' => ['اتوار', 'پير', 'منگل', 'بدھ', 'جمعرات', 'جمعه', 'هفته'], + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ص', 'ش'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz.php new file mode 100644 index 00000000..61f3b64b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Dmitriy Shabanov + * - JD Isaacks + * - Inoyatulloh + * - Jamshid + * - aarkhipov + * - Philippe Vaucher + * - felixthemagnificent + * - Tsutomu Kuroda + * - tjku + * - Max Melentiev + * - Juanito Fatas + * - Alisher Ulugbekov + * - Ergashev Adizbek + */ +return [ + 'year' => ':count йил', + 'a_year' => '{1}бир йил|:count йил', + 'y' => ':count й', + 'month' => ':count ой', + 'a_month' => '{1}бир ой|:count ой', + 'm' => ':count о', + 'week' => ':count ҳафта', + 'a_week' => '{1}бир ҳафта|:count ҳафта', + 'w' => ':count ҳ', + 'day' => ':count кун', + 'a_day' => '{1}бир кун|:count кун', + 'd' => ':count к', + 'hour' => ':count соат', + 'a_hour' => '{1}бир соат|:count соат', + 'h' => ':count с', + 'minute' => ':count дақиқа', + 'a_minute' => '{1}бир дақиқа|:count дақиқа', + 'min' => ':count д', + 'second' => ':count сония', + 'a_second' => '{1}сония|:count сония', + 's' => ':count с', + 'ago' => ':time аввал', + 'from_now' => 'Якин :time ичида', + 'after' => ':timeдан кейин', + 'before' => ':time олдин', + 'diff_now' => 'ҳозир', + 'diff_today' => 'Бугун', + 'diff_today_regexp' => 'Бугун(?:\\s+соат)?', + 'diff_yesterday' => 'Кеча', + 'diff_yesterday_regexp' => 'Кеча(?:\\s+соат)?', + 'diff_tomorrow' => 'Эртага', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'D MMMM YYYY, dddd HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Бугун соат] LT [да]', + 'nextDay' => '[Эртага] LT [да]', + 'nextWeek' => 'dddd [куни соат] LT [да]', + 'lastDay' => '[Кеча соат] LT [да]', + 'lastWeek' => '[Утган] dddd [куни соат] LT [да]', + 'sameElse' => 'L', + ], + 'months' => ['январ', 'феврал', 'март', 'апрел', 'май', 'июн', 'июл', 'август', 'сентябр', 'октябр', 'ноябр', 'декабр'], + 'months_short' => ['янв', 'фев', 'мар', 'апр', 'май', 'июн', 'июл', 'авг', 'сен', 'окт', 'ноя', 'дек'], + 'weekdays' => ['якшанба', 'душанба', 'сешанба', 'чоршанба', 'пайшанба', 'жума', 'шанба'], + 'weekdays_short' => ['якш', 'душ', 'сеш', 'чор', 'пай', 'жум', 'шан'], + 'weekdays_min' => ['як', 'ду', 'се', 'чо', 'па', 'жу', 'ша'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['эрталаб', 'кечаси'], + 'list' => [', ', ' ва '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php new file mode 100644 index 00000000..ffb51319 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Arab.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/fa.php', [ + 'weekdays' => ['یکشنبه', 'دوشنبه', 'سه‌شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'], + 'weekdays_short' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], + 'weekdays_min' => ['ی.', 'د.', 'س.', 'چ.', 'پ.', 'ج.', 'ش.'], + 'months' => ['جنوری', 'فبروری', 'مارچ', 'اپریل', 'می', 'جون', 'جولای', 'اگست', 'سپتمبر', 'اکتوبر', 'نومبر', 'دسمبر'], + 'months_short' => ['جنو', 'فبر', 'مار', 'اپر', 'می', 'جون', 'جول', 'اگس', 'سپت', 'اکت', 'نوم', 'دسم'], + 'first_day_of_week' => 6, + 'weekend' => [4, 5], + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php new file mode 100644 index 00000000..89e99718 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Cyrl.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/uz.php', [ + 'formats' => [ + 'L' => 'DD/MM/yy', + 'LL' => 'D MMM, YYYY', + 'LLL' => 'D MMMM, YYYY HH:mm', + 'LLLL' => 'dddd, DD MMMM, YYYY HH:mm', + ], + 'meridiem' => ['ТО', 'ТК'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php new file mode 100644 index 00000000..ecceeaa3 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_Latn.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Josh Soref + * - Rasulbek + * - Ilyosjon Kamoldinov (ilyosjon09) + */ +return [ + 'year' => ':count yil', + 'a_year' => '{1}bir yil|:count yil', + 'y' => ':count y', + 'month' => ':count oy', + 'a_month' => '{1}bir oy|:count oy', + 'm' => ':count o', + 'week' => ':count hafta', + 'a_week' => '{1}bir hafta|:count hafta', + 'w' => ':count h', + 'day' => ':count kun', + 'a_day' => '{1}bir kun|:count kun', + 'd' => ':count k', + 'hour' => ':count soat', + 'a_hour' => '{1}bir soat|:count soat', + 'h' => ':count soat', + 'minute' => ':count daqiqa', + 'a_minute' => '{1}bir daqiqa|:count daqiqa', + 'min' => ':count d', + 'second' => ':count soniya', + 'a_second' => '{1}soniya|:count soniya', + 's' => ':count son.', + 'ago' => ':time avval', + 'from_now' => 'Yaqin :time ichida', + 'after' => ':timedan keyin', + 'before' => ':time oldin', + 'diff_yesterday' => 'Kecha', + 'diff_yesterday_regexp' => 'Kecha(?:\\s+soat)?', + 'diff_today' => 'Bugun', + 'diff_today_regexp' => 'Bugun(?:\\s+soat)?', + 'diff_tomorrow' => 'Ertaga', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'D MMMM YYYY, dddd HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Bugun soat] LT [da]', + 'nextDay' => '[Ertaga] LT [da]', + 'nextWeek' => 'dddd [kuni soat] LT [da]', + 'lastDay' => '[Kecha soat] LT [da]', + 'lastWeek' => '[O\'tgan] dddd [kuni soat] LT [da]', + 'sameElse' => 'L', + ], + 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyun', 'Iyul', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], + 'weekdays_short' => ['Yak', 'Dush', 'Sesh', 'Chor', 'Pay', 'Jum', 'Shan'], + 'weekdays_min' => ['Ya', 'Du', 'Se', 'Cho', 'Pa', 'Ju', 'Sha'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' va '], + 'meridiem' => ['TO', 'TK'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php new file mode 100644 index 00000000..d41bfee2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Bobir Ismailov Bobir Ismailov, Pablo Saratxaga, Mashrab Kuvatov bobir_is@yahoo.com, pablo@mandrakesoft.com, kmashrab@uni-bremen.de + */ +return array_replace_recursive(require __DIR__.'/uz_Latn.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Yanvar', 'Fevral', 'Mart', 'Aprel', 'May', 'Iyun', 'Iyul', 'Avgust', 'Sentabr', 'Oktabr', 'Noyabr', 'Dekabr'], + 'months_short' => ['Yan', 'Fev', 'Mar', 'Apr', 'May', 'Iyn', 'Iyl', 'Avg', 'Sen', 'Okt', 'Noy', 'Dek'], + 'weekdays' => ['Yakshanba', 'Dushanba', 'Seshanba', 'Chorshanba', 'Payshanba', 'Juma', 'Shanba'], + 'weekdays_short' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], + 'weekdays_min' => ['Yak', 'Du', 'Se', 'Cho', 'Pay', 'Ju', 'Sha'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php new file mode 100644 index 00000000..2fa967c9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/uz_UZ@cyrillic.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Mashrab Kuvatov Mashrab Kuvatov, Pablo Saratxaga kmashrab@uni-bremen.de, pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/uz.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['Январ', 'Феврал', 'Март', 'Апрел', 'Май', 'Июн', 'Июл', 'Август', 'Сентябр', 'Октябр', 'Ноябр', 'Декабр'], + 'months_short' => ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл', 'Авг', 'Сен', 'Окт', 'Ноя', 'Дек'], + 'weekdays' => ['Якшанба', 'Душанба', 'Сешанба', 'Чоршанба', 'Пайшанба', 'Жума', 'Шанба'], + 'weekdays_short' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], + 'weekdays_min' => ['Якш', 'Душ', 'Сеш', 'Чор', 'Пай', 'Жум', 'Шан'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai.php new file mode 100644 index 00000000..3c378dfb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], + 'weekdays_short' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], + 'weekdays_min' => ['ꕞꕌꔵ', 'ꗳꗡꘉ', 'ꕚꕞꕚ', 'ꕉꕞꕒ', 'ꕉꔤꕆꕢ', 'ꕉꔤꕀꕮ', 'ꔻꔬꔳ'], + 'months' => ['ꖨꖕ ꕪꕴ ꔞꔀꕮꕊ', 'ꕒꕡꖝꖕ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞꔤ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋꕔꕿ ꕸꖃꗏ', 'ꖨꖕ ꕪꕴ ꗏꖺꕮꕊ'], + 'months_short' => ['ꖨꖕꔞ', 'ꕒꕡ', 'ꕾꖺ', 'ꖢꖕ', 'ꖑꕱ', 'ꖱꘋ', 'ꖱꕞ', 'ꗛꔕ', 'ꕢꕌ', 'ꕭꖃ', 'ꔞꘋ', 'ꖨꖕꗏ'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY h:mm a', + ], + + 'year' => ':count ꕀ', // less reliable + 'y' => ':count ꕀ', // less reliable + 'a_year' => ':count ꕀ', // less reliable + + 'second' => ':count ꗱꕞꕯꕊ', // less reliable + 's' => ':count ꗱꕞꕯꕊ', // less reliable + 'a_second' => ':count ꗱꕞꕯꕊ', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php new file mode 100644 index 00000000..51e83cc5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Latn.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'weekdays' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], + 'weekdays_short' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], + 'weekdays_min' => ['lahadi', 'tɛɛnɛɛ', 'talata', 'alaba', 'aimisa', 'aijima', 'siɓiti'], + 'months' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], + 'months_short' => ['luukao kemã', 'ɓandaɓu', 'vɔɔ', 'fulu', 'goo', '6', '7', 'kɔnde', 'saah', 'galo', 'kenpkato ɓololɔ', 'luukao lɔma'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'h:mm a', + 'LTS' => 'h:mm:ss a', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm a', + 'LLLL' => 'dddd, D MMMM YYYY h:mm a', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php new file mode 100644 index 00000000..b4bb533f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vai_Vaii.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/vai.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve.php new file mode 100644 index 00000000..7f10aeb9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/ve_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php new file mode 100644 index 00000000..d401d9f2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/ve_ZA.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Phando', 'Luhuhi', 'Ṱhafamuhwe', 'Lambamai', 'Shundunthule', 'Fulwi', 'Fulwana', 'Ṱhangule', 'Khubvumedzi', 'Tshimedzi', 'Ḽara', 'Nyendavhusiku'], + 'months_short' => ['Pha', 'Luh', 'Fam', 'Lam', 'Shu', 'Lwi', 'Lwa', 'Ngu', 'Khu', 'Tsh', 'Ḽar', 'Nye'], + 'weekdays' => ['Swondaha', 'Musumbuluwo', 'Ḽavhuvhili', 'Ḽavhuraru', 'Ḽavhuṋa', 'Ḽavhuṱanu', 'Mugivhela'], + 'weekdays_short' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], + 'weekdays_min' => ['Swo', 'Mus', 'Vhi', 'Rar', 'ṋa', 'Ṱan', 'Mug'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + // Too unreliable + /* + 'day' => ':count vhege', // less reliable + 'd' => ':count vhege', // less reliable + 'a_day' => ':count vhege', // less reliable + + 'hour' => ':count watshi', // less reliable + 'h' => ':count watshi', // less reliable + 'a_hour' => ':count watshi', // less reliable + + 'minute' => ':count watshi', // less reliable + 'min' => ':count watshi', // less reliable + 'a_minute' => ':count watshi', // less reliable + + 'second' => ':count Mu', // less reliable + 's' => ':count Mu', // less reliable + 'a_second' => ':count Mu', // less reliable + + 'week' => ':count vhege', + 'w' => ':count vhege', + 'a_week' => ':count vhege', + */ +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi.php new file mode 100644 index 00000000..73e2852e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Andre Polykanine A.K.A. Menelion Elensúlë + * - JD Isaacks + */ +return [ + 'year' => ':count năm', + 'a_year' => '{1}một năm|]1, Inf[:count năm', + 'y' => ':count năm', + 'month' => ':count tháng', + 'a_month' => '{1}một tháng|]1, Inf[:count tháng', + 'm' => ':count tháng', + 'week' => ':count tuần', + 'a_week' => '{1}một tuần|]1, Inf[:count tuần', + 'w' => ':count tuần', + 'day' => ':count ngày', + 'a_day' => '{1}một ngày|]1, Inf[:count ngày', + 'd' => ':count ngày', + 'hour' => ':count giờ', + 'a_hour' => '{1}một giờ|]1, Inf[:count giờ', + 'h' => ':count giờ', + 'minute' => ':count phút', + 'a_minute' => '{1}một phút|]1, Inf[:count phút', + 'min' => ':count phút', + 'second' => ':count giây', + 'a_second' => '{1}vài giây|]1, Inf[:count giây', + 's' => ':count giây', + 'ago' => ':time trước', + 'from_now' => ':time tới', + 'after' => ':time sau', + 'before' => ':time trước', + 'diff_now' => 'bây giờ', + 'diff_today' => 'Hôm', + 'diff_today_regexp' => 'Hôm(?:\\s+nay)?(?:\\s+lúc)?', + 'diff_yesterday' => 'Hôm qua', + 'diff_yesterday_regexp' => 'Hôm(?:\\s+qua)?(?:\\s+lúc)?', + 'diff_tomorrow' => 'Ngày mai', + 'diff_tomorrow_regexp' => 'Ngày(?:\\s+mai)?(?:\\s+lúc)?', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM [năm] YYYY', + 'LLL' => 'D MMMM [năm] YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM [năm] YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[Hôm nay lúc] LT', + 'nextDay' => '[Ngày mai lúc] LT', + 'nextWeek' => 'dddd [tuần tới lúc] LT', + 'lastDay' => '[Hôm qua lúc] LT', + 'lastWeek' => 'dddd [tuần trước lúc] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['SA', 'CH'], + 'months' => ['tháng 1', 'tháng 2', 'tháng 3', 'tháng 4', 'tháng 5', 'tháng 6', 'tháng 7', 'tháng 8', 'tháng 9', 'tháng 10', 'tháng 11', 'tháng 12'], + 'months_short' => ['Th01', 'Th02', 'Th03', 'Th04', 'Th05', 'Th06', 'Th07', 'Th08', 'Th09', 'Th10', 'Th11', 'Th12'], + 'weekdays' => ['chủ nhật', 'thứ hai', 'thứ ba', 'thứ tư', 'thứ năm', 'thứ sáu', 'thứ bảy'], + 'weekdays_short' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + 'weekdays_min' => ['CN', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => [', ', ' và '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php new file mode 100644 index 00000000..18d89876 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vi_VN.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/vi.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vo.php new file mode 100644 index 00000000..e273033f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vo.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'months' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'months_short' => ['M01', 'M02', 'M03', 'M04', 'M05', 'M06', 'M07', 'M08', 'M09', 'M10', 'M11', 'M12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY-MM-dd', + 'LL' => 'YYYY MMM D', + 'LLL' => 'YYYY MMMM D HH:mm', + 'LLLL' => 'YYYY MMMM D, dddd HH:mm', + ], + + 'year' => ':count yel', + 'y' => ':count yel', + 'a_year' => ':count yel', + + 'month' => ':count mul', + 'm' => ':count mul', + 'a_month' => ':count mul', + + 'week' => ':count vig', + 'w' => ':count vig', + 'a_week' => ':count vig', + + 'day' => ':count del', + 'd' => ':count del', + 'a_day' => ':count del', + + 'hour' => ':count düp', + 'h' => ':count düp', + 'a_hour' => ':count düp', + + 'minute' => ':count minut', + 'min' => ':count minut', + 'a_minute' => ':count minut', + + 'second' => ':count sekun', + 's' => ':count sekun', + 'a_second' => ':count sekun', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vun.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vun.php new file mode 100644 index 00000000..ed92e8e7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/vun.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['utuko', 'kyiukonyi'], + 'weekdays' => ['Jumapilyi', 'Jumatatuu', 'Jumanne', 'Jumatanu', 'Alhamisi', 'Ijumaa', 'Jumamosi'], + 'weekdays_short' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'weekdays_min' => ['Jpi', 'Jtt', 'Jnn', 'Jtn', 'Alh', 'Iju', 'Jmo'], + 'months' => ['Januari', 'Februari', 'Machi', 'Aprilyi', 'Mei', 'Junyi', 'Julyai', 'Agusti', 'Septemba', 'Oktoba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mac', 'Apr', 'Mei', 'Jun', 'Jul', 'Ago', 'Sep', 'Okt', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa.php new file mode 100644 index 00000000..f6dc4ccd --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/wa_BE.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php new file mode 100644 index 00000000..a76d80d9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wa_BE.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Djan SACRE Pablo Saratxaga pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['di djanvî', 'di fevrî', 'di måss', 'd’ avri', 'di may', 'di djun', 'di djulete', 'd’ awousse', 'di setimbe', 'd’ octôbe', 'di nôvimbe', 'di decimbe'], + 'months_short' => ['dja', 'fev', 'mås', 'avr', 'may', 'djn', 'djl', 'awo', 'set', 'oct', 'nôv', 'dec'], + 'weekdays' => ['dimegne', 'londi', 'mårdi', 'mierkidi', 'djudi', 'vénrdi', 'semdi'], + 'weekdays_short' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], + 'weekdays_min' => ['dim', 'lon', 'mår', 'mie', 'dju', 'vén', 'sem'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'year' => ':count anêye', + 'y' => ':count anêye', + 'a_year' => ':count anêye', + + 'month' => ':count meûs', + 'm' => ':count meûs', + 'a_month' => ':count meûs', + + 'week' => ':count samwinne', + 'w' => ':count samwinne', + 'a_week' => ':count samwinne', + + 'day' => ':count djoû', + 'd' => ':count djoû', + 'a_day' => ':count djoû', + + 'hour' => ':count eure', + 'h' => ':count eure', + 'a_hour' => ':count eure', + + 'minute' => ':count munute', + 'min' => ':count munute', + 'a_minute' => ':count munute', + + 'second' => ':count Sigonde', + 's' => ':count Sigonde', + 'a_second' => ':count Sigonde', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae.php new file mode 100644 index 00000000..bf57f23e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/wae_CH.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php new file mode 100644 index 00000000..2af50b4b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wae_CH.php @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Walser Translation Team ml@translate-wae.ch + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], + 'months' => ['Jenner', 'Hornig', 'Märze', 'Abrille', 'Meije', 'Bráčet', 'Heiwet', 'Öigšte', 'Herbštmánet', 'Wímánet', 'Wintermánet', 'Chrištmánet'], + 'months_short' => ['Jen', 'Hor', 'Mär', 'Abr', 'Mei', 'Brá', 'Hei', 'Öig', 'Her', 'Wím', 'Win', 'Chr'], + 'weekdays' => ['Suntag', 'Mäntag', 'Zischtag', 'Mittwuch', 'Frontag', 'Fritag', 'Samschtag'], + 'weekdays_short' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], + 'weekdays_min' => ['Sun', 'Män', 'Zis', 'Mit', 'Fro', 'Fri', 'Sam'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + + 'month' => ':count Maano', // less reliable + 'm' => ':count Maano', // less reliable + 'a_month' => ':count Maano', // less reliable +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal.php new file mode 100644 index 00000000..e8ec40ff --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/wal_ET.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php new file mode 100644 index 00000000..e862f2c5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wal_ET.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Ge'ez Frontier Foundation locales@geez.org + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['ጃንዩወሪ', 'ፌብሩወሪ', 'ማርች', 'ኤፕረል', 'ሜይ', 'ጁን', 'ጁላይ', 'ኦገስት', 'ሴፕቴምበር', 'ኦክተውበር', 'ኖቬምበር', 'ዲሴምበር'], + 'months_short' => ['ጃንዩ', 'ፌብሩ', 'ማርች', 'ኤፕረ', 'ሜይ ', 'ጁን ', 'ጁላይ', 'ኦገስ', 'ሴፕቴ', 'ኦክተ', 'ኖቬም', 'ዲሴም'], + 'weekdays' => ['ወጋ', 'ሳይኖ', 'ማቆሳኛ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ'], + 'weekdays_short' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], + 'weekdays_min' => ['ወጋ ', 'ሳይኖ', 'ማቆሳ', 'አሩዋ', 'ሃሙሳ', 'አርባ', 'ቄራ '], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['ማለዶ', 'ቃማ'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo.php new file mode 100644 index 00000000..74b95df0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/wo_SN.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php new file mode 100644 index 00000000..f8a85b3e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/wo_SN.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - The Debian Project Christian Perrier bubulle@debian.org + */ +return [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD.MM.YYYY', + 'LL' => 'MMMM DD, YYYY', + 'LLL' => 'DD MMM HH:mm', + 'LLLL' => 'MMMM DD, YYYY HH:mm', + ], + 'months' => ['sanwiy\'e', 'feebriy\'e', 'mars', 'awril', 'me', 'suwen', 'sulet', 'uut', 'septaambar', 'oktoobar', 'nowaambar', 'desaambar'], + 'months_short' => ['san', 'fee', 'mar', 'awr', 'me ', 'suw', 'sul', 'uut', 'sep', 'okt', 'now', 'des'], + 'weekdays' => ['dib\'eer', 'altine', 'talaata', 'allarba', 'alxames', 'ajjuma', 'gaawu'], + 'weekdays_short' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], + 'weekdays_min' => ['dib', 'alt', 'tal', 'all', 'alx', 'ajj', 'gaa'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'year' => ':count at', + 'month' => ':count wèr', + 'week' => ':count ayubés', + 'day' => ':count bés', + 'hour' => ':count waxtu', + 'minute' => ':count simili', + 'second' => ':count saa', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh.php new file mode 100644 index 00000000..e88c78d9 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/xh_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php new file mode 100644 index 00000000..009153c7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xh_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['eyoMqungu', 'eyoMdumba', 'eyoKwindla', 'uTshazimpuzi', 'uCanzibe', 'eyeSilimela', 'eyeKhala', 'eyeThupa', 'eyoMsintsi', 'eyeDwarha', 'eyeNkanga', 'eyoMnga'], + 'months_short' => ['Mqu', 'Mdu', 'Kwi', 'Tsh', 'Can', 'Sil', 'Kha', 'Thu', 'Msi', 'Dwa', 'Nka', 'Mng'], + 'weekdays' => ['iCawa', 'uMvulo', 'lwesiBini', 'lwesiThathu', 'ulweSine', 'lwesiHlanu', 'uMgqibelo'], + 'weekdays_short' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], + 'weekdays_min' => ['Caw', 'Mvu', 'Bin', 'Tha', 'Sin', 'Hla', 'Mgq'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count ihlobo', // less reliable + 'y' => ':count ihlobo', // less reliable + 'a_year' => ':count ihlobo', // less reliable + + 'hour' => ':count iwotshi', // less reliable + 'h' => ':count iwotshi', // less reliable + 'a_hour' => ':count iwotshi', // less reliable + + 'minute' => ':count ingqalelo', // less reliable + 'min' => ':count ingqalelo', // less reliable + 'a_minute' => ':count ingqalelo', // less reliable + + 'second' => ':count nceda', // less reliable + 's' => ':count nceda', // less reliable + 'a_second' => ':count nceda', // less reliable + + 'month' => ':count inyanga', + 'm' => ':count inyanga', + 'a_month' => ':count inyanga', + + 'week' => ':count veki', + 'w' => ':count veki', + 'a_week' => ':count veki', + + 'day' => ':count imini', + 'd' => ':count imini', + 'a_day' => ':count imini', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xog.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xog.php new file mode 100644 index 00000000..eb55b4ab --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/xog.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['Munkyo', 'Eigulo'], + 'weekdays' => ['Sabiiti', 'Balaza', 'Owokubili', 'Owokusatu', 'Olokuna', 'Olokutaanu', 'Olomukaaga'], + 'weekdays_short' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], + 'weekdays_min' => ['Sabi', 'Bala', 'Kubi', 'Kusa', 'Kuna', 'Kuta', 'Muka'], + 'months' => ['Janwaliyo', 'Febwaliyo', 'Marisi', 'Apuli', 'Maayi', 'Juuni', 'Julaayi', 'Agusito', 'Sebuttemba', 'Okitobba', 'Novemba', 'Desemba'], + 'months_short' => ['Jan', 'Feb', 'Mar', 'Apu', 'Maa', 'Juu', 'Jul', 'Agu', 'Seb', 'Oki', 'Nov', 'Des'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yav.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yav.php new file mode 100644 index 00000000..225a20d8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yav.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/en.php', [ + 'meridiem' => ['kiɛmɛ́ɛm', 'kisɛ́ndɛ'], + 'weekdays' => ['sɔ́ndiɛ', 'móndie', 'muányáŋmóndie', 'metúkpíápɛ', 'kúpélimetúkpiapɛ', 'feléte', 'séselé'], + 'weekdays_short' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], + 'weekdays_min' => ['sd', 'md', 'mw', 'et', 'kl', 'fl', 'ss'], + 'months' => ['pikítíkítie, oólí ú kutúan', 'siɛyɛ́, oóli ú kándíɛ', 'ɔnsúmbɔl, oóli ú kátátúɛ', 'mesiŋ, oóli ú kénie', 'ensil, oóli ú kátánuɛ', 'ɔsɔn', 'efute', 'pisuyú', 'imɛŋ i puɔs', 'imɛŋ i putúk,oóli ú kátíɛ', 'makandikɛ', 'pilɔndɔ́'], + 'months_short' => ['o.1', 'o.2', 'o.3', 'o.4', 'o.5', 'o.6', 'o.7', 'o.8', 'o.9', 'o.10', 'o.11', 'o.12'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'D/M/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi.php new file mode 100644 index 00000000..8f320229 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/yi_US.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php new file mode 100644 index 00000000..f2dec331 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yi_US.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - http://www.uyip.org/ Pablo Saratxaga pablo@mandrakesoft.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['יאַנואַר', 'פֿעברואַר', 'מערץ', 'אַפּריל', 'מיי', 'יוני', 'יולי', 'אויגוסט', 'סעפּטעמבער', 'אקטאבער', 'נאוועמבער', 'דעצעמבער'], + 'months_short' => ['יאַנ', 'פֿעב', 'מאַר', 'אַפּר', 'מײַ ', 'יונ', 'יול', 'אױג', 'סעפּ', 'אָקט', 'נאָװ', 'דעצ'], + 'weekdays' => ['זונטיק', 'מאָנטיק', 'דינסטיק', 'מיטװאָך', 'דאָנערשטיק', 'פֿרײַטיק', 'שבת'], + 'weekdays_short' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'], + 'weekdays_min' => ['זונ\'', 'מאָנ\'', 'דינ\'', 'מיט\'', 'דאָנ\'', 'פֿרײַ\'', 'שבת'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => ':count יאר', + 'y' => ':count יאר', + 'a_year' => ':count יאר', + + 'month' => ':count חודש', + 'm' => ':count חודש', + 'a_month' => ':count חודש', + + 'week' => ':count וואָך', + 'w' => ':count וואָך', + 'a_week' => ':count וואָך', + + 'day' => ':count טאָג', + 'd' => ':count טאָג', + 'a_day' => ':count טאָג', + + 'hour' => ':count שעה', + 'h' => ':count שעה', + 'a_hour' => ':count שעה', + + 'minute' => ':count מינוט', + 'min' => ':count מינוט', + 'a_minute' => ':count מינוט', + + 'second' => ':count סעקונדע', + 's' => ':count סעקונדע', + 'a_second' => ':count סעקונדע', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo.php new file mode 100644 index 00000000..0a829810 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - François B + * - Atolagbe Abisoye + */ +return [ + 'year' => 'ọdún :count', + 'a_year' => '{1}ọdún kan|ọdún :count', + 'month' => 'osù :count', + 'a_month' => '{1}osù kan|osù :count', + 'week' => 'ọsẹ :count', + 'a_week' => '{1}ọsẹ kan|ọsẹ :count', + 'day' => 'ọjọ́ :count', + 'a_day' => '{1}ọjọ́ kan|ọjọ́ :count', + 'hour' => 'wákati :count', + 'a_hour' => '{1}wákati kan|wákati :count', + 'minute' => 'ìsẹjú :count', + 'a_minute' => '{1}ìsẹjú kan|ìsẹjú :count', + 'second' => 'iaayá :count', + 'a_second' => '{1}ìsẹjú aayá die|aayá :count', + 'ago' => ':time kọjá', + 'from_now' => 'ní :time', + 'diff_yesterday' => 'Àna', + 'diff_yesterday_regexp' => 'Àna(?:\\s+ni)?', + 'diff_today' => 'Ònì', + 'diff_today_regexp' => 'Ònì(?:\\s+ni)?', + 'diff_tomorrow' => 'Ọ̀la', + 'diff_tomorrow_regexp' => 'Ọ̀la(?:\\s+ni)?', + 'formats' => [ + 'LT' => 'h:mm A', + 'LTS' => 'h:mm:ss A', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY h:mm A', + 'LLLL' => 'dddd, D MMMM YYYY h:mm A', + ], + 'calendar' => [ + 'sameDay' => '[Ònì ni] LT', + 'nextDay' => '[Ọ̀la ni] LT', + 'nextWeek' => 'dddd [Ọsẹ̀ tón\'bọ] [ni] LT', + 'lastDay' => '[Àna ni] LT', + 'lastWeek' => 'dddd [Ọsẹ̀ tólọ́] [ni] LT', + 'sameElse' => 'L', + ], + 'ordinal' => 'ọjọ́ :number', + 'months' => ['Sẹ́rẹ́', 'Èrèlè', 'Ẹrẹ̀nà', 'Ìgbé', 'Èbibi', 'Òkùdu', 'Agẹmo', 'Ògún', 'Owewe', 'Ọ̀wàrà', 'Bélú', 'Ọ̀pẹ̀̀'], + 'months_short' => ['Sẹ́r', 'Èrl', 'Ẹrn', 'Ìgb', 'Èbi', 'Òkù', 'Agẹ', 'Ògú', 'Owe', 'Ọ̀wà', 'Bél', 'Ọ̀pẹ̀̀'], + 'weekdays' => ['Àìkú', 'Ajé', 'Ìsẹ́gun', 'Ọjọ́rú', 'Ọjọ́bọ', 'Ẹtì', 'Àbámẹ́ta'], + 'weekdays_short' => ['Àìk', 'Ajé', 'Ìsẹ́', 'Ọjr', 'Ọjb', 'Ẹtì', 'Àbá'], + 'weekdays_min' => ['Àì', 'Aj', 'Ìs', 'Ọr', 'Ọb', 'Ẹt', 'Àb'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'meridiem' => ['Àárọ̀', 'Ọ̀sán'], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php new file mode 100644 index 00000000..12b9e815 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_BJ.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return array_replace_recursive(require __DIR__.'/yo.php', [ + 'meridiem' => ['Àárɔ̀', 'Ɔ̀sán'], + 'weekdays' => ['Ɔjɔ́ Àìkú', 'Ɔjɔ́ Ajé', 'Ɔjɔ́ Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɔjɔ́ Ɛtì', 'Ɔjɔ́ Àbámɛ́ta'], + 'weekdays_short' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], + 'weekdays_min' => ['Àìkú', 'Ajé', 'Ìsɛ́gun', 'Ɔjɔ́rú', 'Ɔjɔ́bɔ', 'Ɛtì', 'Àbámɛ́ta'], + 'months' => ['Oshù Shɛ́rɛ́', 'Oshù Èrèlè', 'Oshù Ɛrɛ̀nà', 'Oshù Ìgbé', 'Oshù Ɛ̀bibi', 'Oshù Òkúdu', 'Oshù Agɛmɔ', 'Oshù Ògún', 'Oshù Owewe', 'Oshù Ɔ̀wàrà', 'Oshù Bélú', 'Oshù Ɔ̀pɛ̀'], + 'months_short' => ['Shɛ́rɛ́', 'Èrèlè', 'Ɛrɛ̀nà', 'Ìgbé', 'Ɛ̀bibi', 'Òkúdu', 'Agɛmɔ', 'Ògún', 'Owewe', 'Ɔ̀wàrà', 'Bélú', 'Ɔ̀pɛ̀'], + 'first_day_of_week' => 1, + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd, D MMMM YYYY HH:mm', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php new file mode 100644 index 00000000..6860bc1a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yo_NG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/yo.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue.php new file mode 100644 index 00000000..ce233a4f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/yue_HK.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php new file mode 100644 index 00000000..4e7d5c36 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_HK.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/zh_HK.php', [ + 'formats' => [ + 'L' => 'YYYY年MM月DD日 dddd', + ], + 'months' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + 'meridiem' => ['上午', '下午'], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php new file mode 100644 index 00000000..db913caa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hans.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hans.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php new file mode 100644 index 00000000..e2526f13 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yue_Hant.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php new file mode 100644 index 00000000..8efdc937 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/yuw_PG.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php new file mode 100644 index 00000000..8a1ccf98 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/yuw_PG.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Information from native speakers Hannah Sarvasy nungon.localization@gmail.com + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YY', + ], + 'months' => ['jenuari', 'febuari', 'mas', 'epril', 'mei', 'jun', 'julai', 'ögus', 'septemba', 'öktoba', 'nöwemba', 'diksemba'], + 'months_short' => ['jen', 'feb', 'mas', 'epr', 'mei', 'jun', 'jul', 'ögu', 'sep', 'ökt', 'nöw', 'dis'], + 'weekdays' => ['sönda', 'mönda', 'sinda', 'mitiwö', 'sogipbono', 'nenggo', 'söndanggie'], + 'weekdays_short' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], + 'weekdays_min' => ['sön', 'mön', 'sin', 'mit', 'soi', 'nen', 'sab'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php new file mode 100644 index 00000000..4d2c3b37 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zgh.php @@ -0,0 +1,80 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - BAKTETE Miloud + */ +return [ + 'year' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', + 'a_year' => 'ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', + 'y' => ':count ⵓⵙⴳⴳⵯⴰⵙ|:count ⵉⵙⴳⴳⵓⵙⴰ', + 'month' => ':count ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', + 'a_month' => 'ⵉⴷⵊ ⵡⴰⵢⵢⵓⵔ|:count ⴰⵢⵢⵓⵔⵏ', + 'm' => ':count ⴰⵢⵢⵓⵔⵏ', + 'week' => ':count ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', + 'a_week' => 'ⵉⵛⵜ ⵉⵎⴰⵍⴰⵙⵙ|:count ⵉⵎⴰⵍⴰⵙⵙⵏ', + 'w' => ':count ⵉⵎⴰⵍⴰⵙⵙ.', + 'day' => ':count ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', + 'a_day' => 'ⵉⴷⵊ ⵡⴰⵙⵙ|:count ⵓⵙⵙⴰⵏ', + 'd' => ':count ⵓ', + 'hour' => ':count ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', + 'a_hour' => 'ⵉⵛⵜ ⵜⵙⵔⴰⴳⵜ|:count ⵜⵉⵙⵔⴰⴳⵉⵏ', + 'h' => ':count ⵜ', + 'minute' => ':count ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', + 'a_minute' => 'ⵉⵛⵜ ⵜⵓⵙⴷⵉⴷⵜ|:count ⵜⵓⵙⴷⵉⴷⵉⵏ', + 'min' => ':count ⵜⵓⵙ', + 'second' => ':count ⵜⵙⵉⵏⵜ|:count ⵜⵉⵙⵉⵏⴰ', + 'a_second' => 'ⴽⵔⴰ ⵜⵉⵙⵉⵏⴰ|:count ⵜⵉⵙⵉⵏⴰ', + 's' => ':count ⵜ', + 'ago' => 'ⵣⴳ :time', + 'from_now' => 'ⴷⴳ :time', + 'after' => ':time ⴰⵡⴰⵔ', + 'before' => ':time ⴷⴰⵜ', + 'diff_now' => 'ⴰⴷⵡⴰⵍⵉ', + 'diff_today' => 'ⴰⵙⵙ', + 'diff_today_regexp' => 'ⴰⵙⵙ(?:\\s+ⴰ/ⴰⴷ)?(?:\\s+ⴳ)?', + 'diff_yesterday' => 'ⴰⵙⵙⵏⵏⴰⵟ', + 'diff_yesterday_regexp' => 'ⴰⵙⵙⵏⵏⴰⵟ(?:\\s+ⴳ)?', + 'diff_tomorrow' => 'ⴰⵙⴽⴽⴰ', + 'diff_tomorrow_regexp' => 'ⴰⵙⴽⴽⴰ(?:\\s+ⴳ)?', + 'diff_before_yesterday' => 'ⴼⵔ ⵉⴹⵏⵏⴰⵟ', + 'diff_after_tomorrow' => 'ⵏⴰⴼ ⵓⵙⴽⴽⴰ', + 'period_recurrences' => ':count ⵜⵉⴽⴽⴰⵍ', + 'period_interval' => 'ⴽⵓ :interval', + 'period_start_date' => 'ⴳ :date', + 'period_end_date' => 'ⵉ :date', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'DD/MM/YYYY', + 'LL' => 'D MMMM YYYY', + 'LLL' => 'D MMMM YYYY HH:mm', + 'LLLL' => 'dddd D MMMM YYYY HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[ⴰⵙⵙ ⴰ/ⴰⴷ ⴳ] LT', + 'nextDay' => '[ⴰⵙⴽⴽⴰ ⴳ] LT', + 'nextWeek' => 'dddd [ⴳ] LT', + 'lastDay' => '[ⴰⵙⵙⵏⵏⴰⵟ ⴳ] LT', + 'lastWeek' => 'dddd [ⴰⵎⴳⴳⴰⵔⵓ ⴳ] LT', + 'sameElse' => 'L', + ], + 'meridiem' => ['ⵜⵉⴼⴰⵡⵜ', 'ⵜⴰⴷⴳⴳⵯⴰⵜ'], + 'months' => ['ⵉⵏⵏⴰⵢⵔ', 'ⴱⵕⴰⵢⵕ', 'ⵎⴰⵕⵚ', 'ⵉⴱⵔⵉⵔ', 'ⵎⴰⵢⵢⵓ', 'ⵢⵓⵏⵢⵓ', 'ⵢⵓⵍⵢⵓⵣ', 'ⵖⵓⵛⵜ', 'ⵛⵓⵜⴰⵏⴱⵉⵔ', 'ⴽⵟⵓⴱⵕ', 'ⵏⵓⵡⴰⵏⴱⵉⵔ', 'ⴷⵓⵊⴰⵏⴱⵉⵔ'], + 'months_short' => ['ⵉⵏⵏ', 'ⴱⵕⴰ', 'ⵎⴰⵕ', 'ⵉⴱⵔ', 'ⵎⴰⵢ', 'ⵢⵓⵏ', 'ⵢⵓⵍ', 'ⵖⵓⵛ', 'ⵛⵓⵜ', 'ⴽⵟⵓ', 'ⵏⵓⵡ', 'ⴷⵓⵊ'], + 'weekdays' => ['ⵓⵙⴰⵎⴰⵙ', 'ⵡⴰⵢⵏⴰⵙ', 'ⵓⵙⵉⵏⴰⵙ', 'ⵡⴰⴽⵕⴰⵙ', 'ⵓⴽⵡⴰⵙ', 'ⵓⵙⵉⵎⵡⴰⵙ', 'ⵓⵙⵉⴹⵢⴰⵙ'], + 'weekdays_short' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], + 'weekdays_min' => ['ⵓⵙⴰ', 'ⵡⴰⵢ', 'ⵓⵙⵉ', 'ⵡⴰⴽ', 'ⵓⴽⵡ', 'ⵓⵙⵉⵎ', 'ⵓⵙⵉⴹ'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 1, + 'list' => [', ', ' ⴷ '], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh.php new file mode 100644 index 00000000..1187c3d7 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - xuri + * - sycuato + * - bokideckonja + * - Luo Ning + * - William Yang (williamyang233) + */ +return array_merge(require __DIR__.'/zh_Hans.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY年M月D日', + 'LLL' => 'YYYY年M月D日 A h点mm分', + 'LLLL' => 'YYYY年M月D日dddd A h点mm分', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php new file mode 100644 index 00000000..9c05d5a8 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_CN.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - monkeycon + * - François B + * - Jason Katz-Brown + * - Serhan Apaydın + * - Matt Johnson + * - JD Isaacks + * - Zeno Zeng + * - Chris Hemp + * - shankesgk2 + */ +return array_merge(require __DIR__.'/zh.php', [ + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY年M月D日', + 'LLL' => 'YYYY年M月D日Ah点mm分', + 'LLLL' => 'YYYY年M月D日ddddAh点mm分', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php new file mode 100644 index 00000000..c3ee9fcb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_HK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant_HK.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php new file mode 100644 index 00000000..8d8d9d77 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - monkeycon + * - François B + * - Jason Katz-Brown + * - Konstantin Konev + * - Chris Lam + * - Serhan Apaydın + * - Gary Lo + * - JD Isaacks + * - Chris Hemp + * - shankesgk2 + * - Daniel Cheung (danvim) + */ +return [ + 'year' => ':count:optional-space年', + 'y' => ':count:optional-space年', + 'month' => ':count:optional-space个月', + 'm' => ':count:optional-space个月', + 'week' => ':count:optional-space周', + 'w' => ':count:optional-space周', + 'day' => ':count:optional-space天', + 'd' => ':count:optional-space天', + 'hour' => ':count:optional-space小时', + 'h' => ':count:optional-space小时', + 'minute' => ':count:optional-space分钟', + 'min' => ':count:optional-space分钟', + 'second' => ':count:optional-space秒', + 'a_second' => '{1}几秒|[-Inf,Inf]:count:optional-space秒', + 's' => ':count:optional-space秒', + 'ago' => ':time前', + 'from_now' => ':time后', + 'after' => ':time后', + 'before' => ':time前', + 'diff_now' => '现在', + 'diff_today' => '今天', + 'diff_yesterday' => '昨天', + 'diff_tomorrow' => '明天', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY年M月D日', + 'LLL' => 'YYYY年M月D日 HH:mm', + 'LLLL' => 'YYYY年M月D日dddd HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[今天]LT', + 'nextDay' => '[明天]LT', + 'nextWeek' => '[下]ddddLT', + 'lastDay' => '[昨天]LT', + 'lastWeek' => '[上]ddddLT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'd', 'D', 'DDD' => $number.'日', + 'M' => $number.'月', + 'w', 'W' => $number.'周', + default => $number, + }; + }, + 'meridiem' => static function ($hour, $minute) { + $time = $hour * 100 + $minute; + if ($time < 600) { + return '凌晨'; + } + if ($time < 900) { + return '早上'; + } + if ($time < 1130) { + return '上午'; + } + if ($time < 1230) { + return '中午'; + } + if ($time < 1800) { + return '下午'; + } + + return '晚上'; + }, + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + 'weekdays_short' => ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => '', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php new file mode 100644 index 00000000..db913caa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_HK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hans.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php new file mode 100644 index 00000000..db913caa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_MO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hans.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php new file mode 100644 index 00000000..db913caa --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hans_SG.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hans.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php new file mode 100644 index 00000000..e34db01c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant.php @@ -0,0 +1,104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Adam + * - monkeycon + * - François B + * - Jason Katz-Brown + * - Chris Lam + * - Serhan Apaydın + * - Gary Lo + * - JD Isaacks + * - Chris Hemp + * - Eddie + * - KID + * - shankesgk2 + * - Daniel Cheung (danvim) + */ +return [ + 'year' => ':count:optional-space年', + 'y' => ':count:optional-space年', + 'month' => ':count:optional-space個月', + 'm' => ':count:optional-space月', + 'week' => ':count:optional-space週', + 'w' => ':count:optional-space週', + 'day' => ':count:optional-space天', + 'd' => ':count:optional-space天', + 'hour' => ':count:optional-space小時', + 'h' => ':count:optional-space小時', + 'minute' => ':count:optional-space分鐘', + 'min' => ':count:optional-space分鐘', + 'second' => ':count:optional-space秒', + 'a_second' => '{1}幾秒|[-Inf,Inf]:count:optional-space秒', + 's' => ':count:optional-space秒', + 'ago' => ':time前', + 'from_now' => ':time後', + 'after' => ':time後', + 'before' => ':time前', + 'diff_now' => '現在', + 'diff_today' => '今天', + 'diff_yesterday' => '昨天', + 'diff_tomorrow' => '明天', + 'formats' => [ + 'LT' => 'HH:mm', + 'LTS' => 'HH:mm:ss', + 'L' => 'YYYY/MM/DD', + 'LL' => 'YYYY年M月D日', + 'LLL' => 'YYYY年M月D日 HH:mm', + 'LLLL' => 'YYYY年M月D日dddd HH:mm', + ], + 'calendar' => [ + 'sameDay' => '[今天] LT', + 'nextDay' => '[明天] LT', + 'nextWeek' => '[下]dddd LT', + 'lastDay' => '[昨天] LT', + 'lastWeek' => '[上]dddd LT', + 'sameElse' => 'L', + ], + 'ordinal' => static function ($number, $period) { + return match ($period) { + 'd', 'D', 'DDD' => $number.'日', + 'M' => $number.'月', + 'w', 'W' => $number.'周', + default => $number, + }; + }, + 'meridiem' => static function ($hour, $minute) { + $time = $hour * 100 + $minute; + if ($time < 600) { + return '凌晨'; + } + if ($time < 900) { + return '早上'; + } + if ($time < 1130) { + return '上午'; + } + if ($time < 1230) { + return '中午'; + } + if ($time < 1800) { + return '下午'; + } + + return '晚上'; + }, + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], + 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + 'weekdays_short' => ['週日', '週一', '週二', '週三', '週四', '週五', '週六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'first_day_of_week' => 1, + 'day_of_first_week_of_year' => 4, + 'list' => '', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php new file mode 100644 index 00000000..e2526f13 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_HK.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php new file mode 100644 index 00000000..e2526f13 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_MO.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php new file mode 100644 index 00000000..e2526f13 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_Hant_TW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php new file mode 100644 index 00000000..1c86d477 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_MO.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - tarunvelli + * - Eddie + * - KID + * - shankesgk2 + */ +return array_replace_recursive(require __DIR__.'/zh_Hant.php', [ + 'after' => ':time后', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php new file mode 100644 index 00000000..c451a562 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_SG.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/zh.php', [ + 'formats' => [ + 'L' => 'YYYY年MM月DD日', + ], + 'months' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'months_short' => ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'], + 'weekdays' => ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'], + 'weekdays_short' => ['日', '一', '二', '三', '四', '五', '六'], + 'weekdays_min' => ['日', '一', '二', '三', '四', '五', '六'], + 'day_of_first_week_of_year' => 1, +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php new file mode 100644 index 00000000..c6789ed2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php @@ -0,0 +1,12 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return require __DIR__.'/zh_Hant_TW.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php new file mode 100644 index 00000000..b0d9ba86 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zh_YUE.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - IBM Globalization Center of Competency, Yamato Software Laboratory bug-glibc-locales@gnu.org + */ +return array_replace_recursive(require __DIR__.'/zh.php', [ + 'formats' => [ + 'L' => 'YYYY-MM-DD', + ], +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu.php new file mode 100644 index 00000000..9a6cce02 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu.php @@ -0,0 +1,15 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Unknown default region, use the first alphabetically. + */ +return require __DIR__.'/zu_ZA.php'; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php new file mode 100644 index 00000000..b1e8bc0b --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Lang/zu_ZA.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Authors: + * - Zuza Software Foundation (Translate.org.za) Dwayne Bailey dwayne@translate.org.za + */ +return array_replace_recursive(require __DIR__.'/en.php', [ + 'formats' => [ + 'L' => 'DD/MM/YYYY', + ], + 'months' => ['Januwari', 'Februwari', 'Mashi', 'Ephreli', 'Meyi', 'Juni', 'Julayi', 'Agasti', 'Septhemba', 'Okthoba', 'Novemba', 'Disemba'], + 'months_short' => ['Jan', 'Feb', 'Mas', 'Eph', 'Mey', 'Jun', 'Jul', 'Aga', 'Sep', 'Okt', 'Nov', 'Dis'], + 'weekdays' => ['iSonto', 'uMsombuluko', 'uLwesibili', 'uLwesithathu', 'uLwesine', 'uLwesihlanu', 'uMgqibelo'], + 'weekdays_short' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], + 'weekdays_min' => ['Son', 'Mso', 'Bil', 'Tha', 'Sin', 'Hla', 'Mgq'], + 'first_day_of_week' => 0, + 'day_of_first_week_of_year' => 1, + + 'year' => 'kweminyaka engu-:count', + 'y' => 'kweminyaka engu-:count', + 'a_year' => 'kweminyaka engu-:count', + + 'month' => 'izinyanga ezingu-:count', + 'm' => 'izinyanga ezingu-:count', + 'a_month' => 'izinyanga ezingu-:count', + + 'week' => 'lwamasonto angu-:count', + 'w' => 'lwamasonto angu-:count', + 'a_week' => 'lwamasonto angu-:count', + + 'day' => 'ezingaba ngu-:count', + 'd' => 'ezingaba ngu-:count', + 'a_day' => 'ezingaba ngu-:count', + + 'hour' => 'amahora angu-:count', + 'h' => 'amahora angu-:count', + 'a_hour' => 'amahora angu-:count', + + 'minute' => 'ngemizuzu engu-:count', + 'min' => 'ngemizuzu engu-:count', + 'a_minute' => 'ngemizuzu engu-:count', + + 'second' => 'imizuzwana engu-:count', + 's' => 'imizuzwana engu-:count', + 'a_second' => 'imizuzwana engu-:count', +]); diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Language.php b/plugins/vendor/nesbot/carbon/src/Carbon/Language.php new file mode 100644 index 00000000..6197e8b0 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Language.php @@ -0,0 +1,271 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use JsonSerializable; + +class Language implements JsonSerializable +{ + protected static ?array $languagesNames = null; + + protected static ?array $regionsNames = null; + + protected string $id; + + protected string $code; + + protected ?string $variant = null; + + protected ?string $region = null; + + protected ?array $names = null; + + protected ?string $isoName = null; + + protected ?string $nativeName = null; + + public function __construct(string $id) + { + $this->id = str_replace('-', '_', $id); + $parts = explode('_', $this->id); + $this->code = $parts[0]; + + if (isset($parts[1])) { + if (!preg_match('/^[A-Z]+$/', $parts[1])) { + $this->variant = $parts[1]; + $parts[1] = $parts[2] ?? null; + } + if ($parts[1]) { + $this->region = $parts[1]; + } + } + } + + /** + * Get the list of the known languages. + * + * @return array + */ + public static function all(): array + { + static::$languagesNames ??= require __DIR__.'/List/languages.php'; + + return static::$languagesNames; + } + + /** + * Get the list of the known regions. + * + * ⚠ ISO 3166-2 short name provided with no warranty, should not + * be used for any purpose to show official state names. + */ + public static function regions(): array + { + static::$regionsNames ??= require __DIR__.'/List/regions.php'; + + return static::$regionsNames; + } + + /** + * Get both isoName and nativeName as an array. + */ + public function getNames(): array + { + $this->names ??= static::all()[$this->code] ?? [ + 'isoName' => $this->code, + 'nativeName' => $this->code, + ]; + + return $this->names; + } + + /** + * Returns the original locale ID. + */ + public function getId(): string + { + return $this->id; + } + + /** + * Returns the code of the locale "en"/"fr". + */ + public function getCode(): string + { + return $this->code; + } + + /** + * Returns the variant code such as cyrl/latn. + */ + public function getVariant(): ?string + { + return $this->variant; + } + + /** + * Returns the variant such as Cyrillic/Latin. + */ + public function getVariantName(): ?string + { + if ($this->variant === 'Latn') { + return 'Latin'; + } + + if ($this->variant === 'Cyrl') { + return 'Cyrillic'; + } + + return $this->variant; + } + + /** + * Returns the region part of the locale. + */ + public function getRegion(): ?string + { + return $this->region; + } + + /** + * Returns the region name for the current language. + * + * ⚠ ISO 3166-2 short name provided with no warranty, should not + * be used for any purpose to show official state names. + */ + public function getRegionName(): ?string + { + return $this->region ? (static::regions()[$this->region] ?? $this->region) : null; + } + + /** + * Returns the long ISO language name. + */ + public function getFullIsoName(): string + { + $this->isoName ??= $this->getNames()['isoName']; + + return $this->isoName; + } + + /** + * Set the ISO language name. + */ + public function setIsoName(string $isoName): static + { + $this->isoName = $isoName; + + return $this; + } + + /** + * Return the full name of the language in this language. + */ + public function getFullNativeName(): string + { + $this->nativeName ??= $this->getNames()['nativeName']; + + return $this->nativeName; + } + + /** + * Set the name of the language in this language. + */ + public function setNativeName(string $nativeName): static + { + $this->nativeName = $nativeName; + + return $this; + } + + /** + * Returns the short ISO language name. + */ + public function getIsoName(): string + { + $name = $this->getFullIsoName(); + + return trim(strstr($name, ',', true) ?: $name); + } + + /** + * Get the short name of the language in this language. + */ + public function getNativeName(): string + { + $name = $this->getFullNativeName(); + + return trim(strstr($name, ',', true) ?: $name); + } + + /** + * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. + */ + public function getIsoDescription(): string + { + $region = $this->getRegionName(); + $variant = $this->getVariantName(); + + return $this->getIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); + } + + /** + * Get a string with short native name, region in parentheses if applicable, variant in parentheses if applicable. + */ + public function getNativeDescription(): string + { + $region = $this->getRegionName(); + $variant = $this->getVariantName(); + + return $this->getNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); + } + + /** + * Get a string with long ISO name, region in parentheses if applicable, variant in parentheses if applicable. + */ + public function getFullIsoDescription(): string + { + $region = $this->getRegionName(); + $variant = $this->getVariantName(); + + return $this->getFullIsoName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); + } + + /** + * Get a string with long native name, region in parentheses if applicable, variant in parentheses if applicable. + */ + public function getFullNativeDescription(): string + { + $region = $this->getRegionName(); + $variant = $this->getVariantName(); + + return $this->getFullNativeName().($region ? ' ('.$region.')' : '').($variant ? ' ('.$variant.')' : ''); + } + + /** + * Returns the original locale ID. + */ + public function __toString(): string + { + return $this->getId(); + } + + /** + * Get a string with short ISO name, region in parentheses if applicable, variant in parentheses if applicable. + */ + public function jsonSerialize(): string + { + return $this->getIsoDescription(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php b/plugins/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php new file mode 100644 index 00000000..76fc24a1 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Laravel/ServiceProvider.php @@ -0,0 +1,178 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Laravel; + +use Carbon\Carbon; +use Carbon\CarbonImmutable; +use Carbon\CarbonInterval; +use Carbon\CarbonPeriod; +use Illuminate\Contracts\Events\Dispatcher as DispatcherContract; +use Illuminate\Events\Dispatcher; +use Illuminate\Events\EventDispatcher; +use Illuminate\Support\Carbon as IlluminateCarbon; +use Illuminate\Support\Facades\Date; +use Throwable; + +class ServiceProvider extends \Illuminate\Support\ServiceProvider +{ + /** @var callable|null */ + protected $appGetter = null; + + /** @var callable|null */ + protected $localeGetter = null; + + /** @var callable|null */ + protected $fallbackLocaleGetter = null; + + public function setAppGetter(?callable $appGetter): void + { + $this->appGetter = $appGetter; + } + + public function setLocaleGetter(?callable $localeGetter): void + { + $this->localeGetter = $localeGetter; + } + + public function setFallbackLocaleGetter(?callable $fallbackLocaleGetter): void + { + $this->fallbackLocaleGetter = $fallbackLocaleGetter; + } + + public function boot() + { + $this->updateLocale(); + $this->updateFallbackLocale(); + + if (!$this->app->bound('events')) { + return; + } + + $service = $this; + $events = $this->app['events']; + + if ($this->isEventDispatcher($events)) { + $events->listen(class_exists('Illuminate\Foundation\Events\LocaleUpdated') ? 'Illuminate\Foundation\Events\LocaleUpdated' : 'locale.changed', function () use ($service) { + $service->updateLocale(); + }); + } + } + + public function updateLocale() + { + $locale = $this->getLocale(); + + if ($locale === null) { + return; + } + + Carbon::setLocale($locale); + CarbonImmutable::setLocale($locale); + CarbonPeriod::setLocale($locale); + CarbonInterval::setLocale($locale); + + if (class_exists(IlluminateCarbon::class)) { + IlluminateCarbon::setLocale($locale); + } + + if (class_exists(Date::class)) { + try { + $root = Date::getFacadeRoot(); + $root->setLocale($locale); + } catch (Throwable) { + // Non Carbon class in use in Date facade + } + } + } + + public function updateFallbackLocale() + { + $locale = $this->getFallbackLocale(); + + if ($locale === null) { + return; + } + + Carbon::setFallbackLocale($locale); + CarbonImmutable::setFallbackLocale($locale); + CarbonPeriod::setFallbackLocale($locale); + CarbonInterval::setFallbackLocale($locale); + + if (class_exists(IlluminateCarbon::class) && method_exists(IlluminateCarbon::class, 'setFallbackLocale')) { + IlluminateCarbon::setFallbackLocale($locale); + } + + if (class_exists(Date::class)) { + try { + $root = Date::getFacadeRoot(); + $root->setFallbackLocale($locale); + } catch (Throwable) { // @codeCoverageIgnore + // Non Carbon class in use in Date facade + } + } + } + + public function register() + { + // Needed for Laravel < 5.3 compatibility + } + + protected function getLocale() + { + if ($this->localeGetter) { + return ($this->localeGetter)(); + } + + $app = $this->getApp(); + $app = $app && method_exists($app, 'getLocale') + ? $app + : $this->getGlobalApp('translator'); + + return $app ? $app->getLocale() : null; + } + + protected function getFallbackLocale() + { + if ($this->fallbackLocaleGetter) { + return ($this->fallbackLocaleGetter)(); + } + + $app = $this->getApp(); + + return $app && method_exists($app, 'getFallbackLocale') + ? $app->getFallbackLocale() + : $this->getGlobalApp('translator')?->getFallback(); + } + + protected function getApp() + { + if ($this->appGetter) { + return ($this->appGetter)(); + } + + return $this->app ?? $this->getGlobalApp(); + } + + protected function getGlobalApp(...$args) + { + return \function_exists('app') ? \app(...$args) : null; + } + + protected function isEventDispatcher($instance) + { + return $instance instanceof EventDispatcher + || $instance instanceof Dispatcher + || $instance instanceof DispatcherContract; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/List/languages.php b/plugins/vendor/nesbot/carbon/src/Carbon/List/languages.php new file mode 100644 index 00000000..55778775 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/List/languages.php @@ -0,0 +1,1241 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +return [ + /* + * ISO 639-2 + */ + 'ab' => [ + 'isoName' => 'Abkhazian', + 'nativeName' => 'аҧсуа бызшәа, аҧсшәа', + ], + 'aa' => [ + 'isoName' => 'Afar', + 'nativeName' => 'Afaraf', + ], + 'af' => [ + 'isoName' => 'Afrikaans', + 'nativeName' => 'Afrikaans', + ], + 'ak' => [ + 'isoName' => 'Akan', + 'nativeName' => 'Akan', + ], + 'sq' => [ + 'isoName' => 'Albanian', + 'nativeName' => 'Shqip', + ], + 'am' => [ + 'isoName' => 'Amharic', + 'nativeName' => 'አማርኛ', + ], + 'ar' => [ + 'isoName' => 'Arabic', + 'nativeName' => 'العربية', + ], + 'an' => [ + 'isoName' => 'Aragonese', + 'nativeName' => 'aragonés', + ], + 'hy' => [ + 'isoName' => 'Armenian', + 'nativeName' => 'Հայերեն', + ], + 'as' => [ + 'isoName' => 'Assamese', + 'nativeName' => 'অসমীয়া', + ], + 'av' => [ + 'isoName' => 'Avaric', + 'nativeName' => 'авар мацӀ, магӀарул мацӀ', + ], + 'ae' => [ + 'isoName' => 'Avestan', + 'nativeName' => 'avesta', + ], + 'ay' => [ + 'isoName' => 'Aymara', + 'nativeName' => 'aymar aru', + ], + 'az' => [ + 'isoName' => 'Azerbaijani', + 'nativeName' => 'azərbaycan dili', + ], + 'bm' => [ + 'isoName' => 'Bambara', + 'nativeName' => 'bamanankan', + ], + 'ba' => [ + 'isoName' => 'Bashkir', + 'nativeName' => 'башҡорт теле', + ], + 'eu' => [ + 'isoName' => 'Basque', + 'nativeName' => 'euskara, euskera', + ], + 'be' => [ + 'isoName' => 'Belarusian', + 'nativeName' => 'беларуская мова', + ], + 'bn' => [ + 'isoName' => 'Bengali', + 'nativeName' => 'বাংলা', + ], + 'bh' => [ + 'isoName' => 'Bihari languages', + 'nativeName' => 'भोजपुरी', + ], + 'bi' => [ + 'isoName' => 'Bislama', + 'nativeName' => 'Bislama', + ], + 'bs' => [ + 'isoName' => 'Bosnian', + 'nativeName' => 'bosanski jezik', + ], + 'br' => [ + 'isoName' => 'Breton', + 'nativeName' => 'brezhoneg', + ], + 'bg' => [ + 'isoName' => 'Bulgarian', + 'nativeName' => 'български език', + ], + 'my' => [ + 'isoName' => 'Burmese', + 'nativeName' => 'ဗမာစာ', + ], + 'ca' => [ + 'isoName' => 'Catalan, Valencian', + 'nativeName' => 'català, valencià', + ], + 'ch' => [ + 'isoName' => 'Chamorro', + 'nativeName' => 'Chamoru', + ], + 'ce' => [ + 'isoName' => 'Chechen', + 'nativeName' => 'нохчийн мотт', + ], + 'ny' => [ + 'isoName' => 'Chichewa, Chewa, Nyanja', + 'nativeName' => 'chiCheŵa, chinyanja', + ], + 'zh' => [ + 'isoName' => 'Chinese', + 'nativeName' => '中文 (Zhōngwén), 汉语, 漢語', + ], + 'cv' => [ + 'isoName' => 'Chuvash', + 'nativeName' => 'чӑваш чӗлхи', + ], + 'kw' => [ + 'isoName' => 'Cornish', + 'nativeName' => 'Kernewek', + ], + 'co' => [ + 'isoName' => 'Corsican', + 'nativeName' => 'corsu, lingua corsa', + ], + 'cr' => [ + 'isoName' => 'Cree', + 'nativeName' => 'ᓀᐦᐃᔭᐍᐏᐣ', + ], + 'hr' => [ + 'isoName' => 'Croatian', + 'nativeName' => 'hrvatski jezik', + ], + 'cs' => [ + 'isoName' => 'Czech', + 'nativeName' => 'čeština, český jazyk', + ], + 'da' => [ + 'isoName' => 'Danish', + 'nativeName' => 'dansk', + ], + 'dv' => [ + 'isoName' => 'Divehi, Dhivehi, Maldivian', + 'nativeName' => 'ދިވެހި', + ], + 'nl' => [ + 'isoName' => 'Dutch, Flemish', + 'nativeName' => 'Nederlands, Vlaams', + ], + 'dz' => [ + 'isoName' => 'Dzongkha', + 'nativeName' => 'རྫོང་ཁ', + ], + 'en' => [ + 'isoName' => 'English', + 'nativeName' => 'English', + ], + 'eo' => [ + 'isoName' => 'Esperanto', + 'nativeName' => 'Esperanto', + ], + 'et' => [ + 'isoName' => 'Estonian', + 'nativeName' => 'eesti, eesti keel', + ], + 'ee' => [ + 'isoName' => 'Ewe', + 'nativeName' => 'Eʋegbe', + ], + 'fo' => [ + 'isoName' => 'Faroese', + 'nativeName' => 'føroyskt', + ], + 'fj' => [ + 'isoName' => 'Fijian', + 'nativeName' => 'vosa Vakaviti', + ], + 'fi' => [ + 'isoName' => 'Finnish', + 'nativeName' => 'suomi, suomen kieli', + ], + 'fr' => [ + 'isoName' => 'French', + 'nativeName' => 'français', + ], + 'ff' => [ + 'isoName' => 'Fulah', + 'nativeName' => 'Fulfulde, Pulaar, Pular', + ], + 'gl' => [ + 'isoName' => 'Galician', + 'nativeName' => 'Galego', + ], + 'ka' => [ + 'isoName' => 'Georgian', + 'nativeName' => 'ქართული', + ], + 'de' => [ + 'isoName' => 'German', + 'nativeName' => 'Deutsch', + ], + 'el' => [ + 'isoName' => 'Greek (modern)', + 'nativeName' => 'ελληνικά', + ], + 'gn' => [ + 'isoName' => 'Guaraní', + 'nativeName' => 'Avañe\'ẽ', + ], + 'gu' => [ + 'isoName' => 'Gujarati', + 'nativeName' => 'ગુજરાતી', + ], + 'ht' => [ + 'isoName' => 'Haitian, Haitian Creole', + 'nativeName' => 'Kreyòl ayisyen', + ], + 'ha' => [ + 'isoName' => 'Hausa', + 'nativeName' => '(Hausa) هَوُسَ', + ], + 'he' => [ + 'isoName' => 'Hebrew (modern)', + 'nativeName' => 'עברית', + ], + 'hz' => [ + 'isoName' => 'Herero', + 'nativeName' => 'Otjiherero', + ], + 'hi' => [ + 'isoName' => 'Hindi', + 'nativeName' => 'हिन्दी, हिंदी', + ], + 'ho' => [ + 'isoName' => 'Hiri Motu', + 'nativeName' => 'Hiri Motu', + ], + 'hu' => [ + 'isoName' => 'Hungarian', + 'nativeName' => 'magyar', + ], + 'ia' => [ + 'isoName' => 'Interlingua', + 'nativeName' => 'Interlingua', + ], + 'id' => [ + 'isoName' => 'Indonesian', + 'nativeName' => 'Bahasa Indonesia', + ], + 'ie' => [ + 'isoName' => 'Interlingue', + 'nativeName' => 'Originally called Occidental; then Interlingue after WWII', + ], + 'ga' => [ + 'isoName' => 'Irish', + 'nativeName' => 'Gaeilge', + ], + 'ig' => [ + 'isoName' => 'Igbo', + 'nativeName' => 'Asụsụ Igbo', + ], + 'ik' => [ + 'isoName' => 'Inupiaq', + 'nativeName' => 'Iñupiaq, Iñupiatun', + ], + 'io' => [ + 'isoName' => 'Ido', + 'nativeName' => 'Ido', + ], + 'is' => [ + 'isoName' => 'Icelandic', + 'nativeName' => 'Íslenska', + ], + 'it' => [ + 'isoName' => 'Italian', + 'nativeName' => 'Italiano', + ], + 'iu' => [ + 'isoName' => 'Inuktitut', + 'nativeName' => 'ᐃᓄᒃᑎᑐᑦ', + ], + 'ja' => [ + 'isoName' => 'Japanese', + 'nativeName' => '日本語 (にほんご)', + ], + 'jv' => [ + 'isoName' => 'Javanese', + 'nativeName' => 'ꦧꦱꦗꦮ, Basa Jawa', + ], + 'kl' => [ + 'isoName' => 'Kalaallisut, Greenlandic', + 'nativeName' => 'kalaallisut, kalaallit oqaasii', + ], + 'kn' => [ + 'isoName' => 'Kannada', + 'nativeName' => 'ಕನ್ನಡ', + ], + 'kr' => [ + 'isoName' => 'Kanuri', + 'nativeName' => 'Kanuri', + ], + 'ks' => [ + 'isoName' => 'Kashmiri', + 'nativeName' => 'कश्मीरी, كشميري‎', + ], + 'kk' => [ + 'isoName' => 'Kazakh', + 'nativeName' => 'қазақ тілі', + ], + 'km' => [ + 'isoName' => 'Central Khmer', + 'nativeName' => 'ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ', + ], + 'ki' => [ + 'isoName' => 'Kikuyu, Gikuyu', + 'nativeName' => 'Gĩkũyũ', + ], + 'rw' => [ + 'isoName' => 'Kinyarwanda', + 'nativeName' => 'Ikinyarwanda', + ], + 'ky' => [ + 'isoName' => 'Kirghiz, Kyrgyz', + 'nativeName' => 'Кыргызча, Кыргыз тили', + ], + 'kv' => [ + 'isoName' => 'Komi', + 'nativeName' => 'коми кыв', + ], + 'kg' => [ + 'isoName' => 'Kongo', + 'nativeName' => 'Kikongo', + ], + 'ko' => [ + 'isoName' => 'Korean', + 'nativeName' => '한국어', + ], + 'ku' => [ + 'isoName' => 'Kurdish', + 'nativeName' => 'Kurdî, کوردی‎', + ], + 'kj' => [ + 'isoName' => 'Kuanyama, Kwanyama', + 'nativeName' => 'Kuanyama', + ], + 'la' => [ + 'isoName' => 'Latin', + 'nativeName' => 'latine, lingua latina', + ], + 'lb' => [ + 'isoName' => 'Luxembourgish, Letzeburgesch', + 'nativeName' => 'Lëtzebuergesch', + ], + 'lg' => [ + 'isoName' => 'Ganda', + 'nativeName' => 'Luganda', + ], + 'li' => [ + 'isoName' => 'Limburgan, Limburger, Limburgish', + 'nativeName' => 'Limburgs', + ], + 'ln' => [ + 'isoName' => 'Lingala', + 'nativeName' => 'Lingála', + ], + 'lo' => [ + 'isoName' => 'Lao', + 'nativeName' => 'ພາສາລາວ', + ], + 'lt' => [ + 'isoName' => 'Lithuanian', + 'nativeName' => 'lietuvių kalba', + ], + 'lu' => [ + 'isoName' => 'Luba-Katanga', + 'nativeName' => 'Kiluba', + ], + 'lv' => [ + 'isoName' => 'Latvian', + 'nativeName' => 'latviešu valoda', + ], + 'gv' => [ + 'isoName' => 'Manx', + 'nativeName' => 'Gaelg, Gailck', + ], + 'mk' => [ + 'isoName' => 'Macedonian', + 'nativeName' => 'македонски јазик', + ], + 'mg' => [ + 'isoName' => 'Malagasy', + 'nativeName' => 'fiteny malagasy', + ], + 'ms' => [ + 'isoName' => 'Malay', + 'nativeName' => 'Bahasa Melayu, بهاس ملايو‎', + ], + 'ml' => [ + 'isoName' => 'Malayalam', + 'nativeName' => 'മലയാളം', + ], + 'mt' => [ + 'isoName' => 'Maltese', + 'nativeName' => 'Malti', + ], + 'mi' => [ + 'isoName' => 'Maori', + 'nativeName' => 'te reo Māori', + ], + 'mr' => [ + 'isoName' => 'Marathi', + 'nativeName' => 'मराठी', + ], + 'mh' => [ + 'isoName' => 'Marshallese', + 'nativeName' => 'Kajin M̧ajeļ', + ], + 'mn' => [ + 'isoName' => 'Mongolian', + 'nativeName' => 'Монгол хэл', + ], + 'na' => [ + 'isoName' => 'Nauru', + 'nativeName' => 'Dorerin Naoero', + ], + 'nv' => [ + 'isoName' => 'Navajo, Navaho', + 'nativeName' => 'Diné bizaad', + ], + 'nd' => [ + 'isoName' => 'North Ndebele', + 'nativeName' => 'isiNdebele', + ], + 'ne' => [ + 'isoName' => 'Nepali', + 'nativeName' => 'नेपाली', + ], + 'ng' => [ + 'isoName' => 'Ndonga', + 'nativeName' => 'Owambo', + ], + 'nb' => [ + 'isoName' => 'Norwegian Bokmål', + 'nativeName' => 'Norsk Bokmål', + ], + 'nn' => [ + 'isoName' => 'Norwegian Nynorsk', + 'nativeName' => 'Norsk Nynorsk', + ], + 'no' => [ + 'isoName' => 'Norwegian', + 'nativeName' => 'Norsk', + ], + 'ii' => [ + 'isoName' => 'Sichuan Yi, Nuosu', + 'nativeName' => 'ꆈꌠ꒿ Nuosuhxop', + ], + 'nr' => [ + 'isoName' => 'South Ndebele', + 'nativeName' => 'isiNdebele', + ], + 'oc' => [ + 'isoName' => 'Occitan', + 'nativeName' => 'occitan, lenga d\'òc', + ], + 'oj' => [ + 'isoName' => 'Ojibwa', + 'nativeName' => 'ᐊᓂᔑᓈᐯᒧᐎᓐ', + ], + 'cu' => [ + 'isoName' => 'Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian', + 'nativeName' => 'ѩзыкъ словѣньскъ', + ], + 'om' => [ + 'isoName' => 'Oromo', + 'nativeName' => 'Afaan Oromoo', + ], + 'or' => [ + 'isoName' => 'Oriya', + 'nativeName' => 'ଓଡ଼ିଆ', + ], + 'os' => [ + 'isoName' => 'Ossetian, Ossetic', + 'nativeName' => 'ирон æвзаг', + ], + 'pa' => [ + 'isoName' => 'Panjabi, Punjabi', + 'nativeName' => 'ਪੰਜਾਬੀ', + ], + 'pi' => [ + 'isoName' => 'Pali', + 'nativeName' => 'पाऴि', + ], + 'fa' => [ + 'isoName' => 'Persian', + 'nativeName' => 'فارسی', + ], + 'pl' => [ + 'isoName' => 'Polish', + 'nativeName' => 'język polski, polszczyzna', + ], + 'ps' => [ + 'isoName' => 'Pashto, Pushto', + 'nativeName' => 'پښتو', + ], + 'pt' => [ + 'isoName' => 'Portuguese', + 'nativeName' => 'Português', + ], + 'qu' => [ + 'isoName' => 'Quechua', + 'nativeName' => 'Runa Simi, Kichwa', + ], + 'rm' => [ + 'isoName' => 'Romansh', + 'nativeName' => 'Rumantsch Grischun', + ], + 'rn' => [ + 'isoName' => 'Rundi', + 'nativeName' => 'Ikirundi', + ], + 'ro' => [ + 'isoName' => 'Romanian, Moldavian, Moldovan', + 'nativeName' => 'Română', + ], + 'ru' => [ + 'isoName' => 'Russian', + 'nativeName' => 'русский', + ], + 'sa' => [ + 'isoName' => 'Sanskrit', + 'nativeName' => 'संस्कृतम्', + ], + 'sc' => [ + 'isoName' => 'Sardinian', + 'nativeName' => 'sardu', + ], + 'sd' => [ + 'isoName' => 'Sindhi', + 'nativeName' => 'सिन्धी, سنڌي، سندھی‎', + ], + 'se' => [ + 'isoName' => 'Northern Sami', + 'nativeName' => 'Davvisámegiella', + ], + 'sm' => [ + 'isoName' => 'Samoan', + 'nativeName' => 'gagana fa\'a Samoa', + ], + 'sg' => [ + 'isoName' => 'Sango', + 'nativeName' => 'yângâ tî sängö', + ], + 'sr' => [ + 'isoName' => 'Serbian', + 'nativeName' => 'српски језик', + ], + 'gd' => [ + 'isoName' => 'Gaelic, Scottish Gaelic', + 'nativeName' => 'Gàidhlig', + ], + 'sn' => [ + 'isoName' => 'Shona', + 'nativeName' => 'chiShona', + ], + 'si' => [ + 'isoName' => 'Sinhala, Sinhalese', + 'nativeName' => 'සිංහල', + ], + 'sk' => [ + 'isoName' => 'Slovak', + 'nativeName' => 'Slovenčina, Slovenský Jazyk', + ], + 'sl' => [ + 'isoName' => 'Slovene', + 'nativeName' => 'Slovenski Jezik, Slovenščina', + ], + 'so' => [ + 'isoName' => 'Somali', + 'nativeName' => 'Soomaaliga, af Soomaali', + ], + 'st' => [ + 'isoName' => 'Southern Sotho', + 'nativeName' => 'Sesotho', + ], + 'es' => [ + 'isoName' => 'Spanish, Castilian', + 'nativeName' => 'Español', + ], + 'su' => [ + 'isoName' => 'Sundanese', + 'nativeName' => 'Basa Sunda', + ], + 'sw' => [ + 'isoName' => 'Swahili', + 'nativeName' => 'Kiswahili', + ], + 'ss' => [ + 'isoName' => 'Swati', + 'nativeName' => 'SiSwati', + ], + 'sv' => [ + 'isoName' => 'Swedish', + 'nativeName' => 'Svenska', + ], + 'ta' => [ + 'isoName' => 'Tamil', + 'nativeName' => 'தமிழ்', + ], + 'te' => [ + 'isoName' => 'Telugu', + 'nativeName' => 'తెలుగు', + ], + 'tg' => [ + 'isoName' => 'Tajik', + 'nativeName' => 'тоҷикӣ, toçikī, تاجیکی‎', + ], + 'th' => [ + 'isoName' => 'Thai', + 'nativeName' => 'ไทย', + ], + 'ti' => [ + 'isoName' => 'Tigrinya', + 'nativeName' => 'ትግርኛ', + ], + 'bo' => [ + 'isoName' => 'Tibetan', + 'nativeName' => 'བོད་ཡིག', + ], + 'tk' => [ + 'isoName' => 'Turkmen', + 'nativeName' => 'Türkmen, Түркмен', + ], + 'tl' => [ + 'isoName' => 'Tagalog', + 'nativeName' => 'Wikang Tagalog', + ], + 'tn' => [ + 'isoName' => 'Tswana', + 'nativeName' => 'Setswana', + ], + 'to' => [ + 'isoName' => 'Tongan (Tonga Islands)', + 'nativeName' => 'Faka Tonga', + ], + 'tr' => [ + 'isoName' => 'Turkish', + 'nativeName' => 'Türkçe', + ], + 'ts' => [ + 'isoName' => 'Tsonga', + 'nativeName' => 'Xitsonga', + ], + 'tt' => [ + 'isoName' => 'Tatar', + 'nativeName' => 'татар теле, tatar tele', + ], + 'tw' => [ + 'isoName' => 'Twi', + 'nativeName' => 'Twi', + ], + 'ty' => [ + 'isoName' => 'Tahitian', + 'nativeName' => 'Reo Tahiti', + ], + 'ug' => [ + 'isoName' => 'Uighur, Uyghur', + 'nativeName' => 'Uyƣurqə, ‫ئۇيغۇرچ', + ], + 'uk' => [ + 'isoName' => 'Ukrainian', + 'nativeName' => 'Українська', + ], + 'ur' => [ + 'isoName' => 'Urdu', + 'nativeName' => 'اردو', + ], + 'uz' => [ + 'isoName' => 'Uzbek', + 'nativeName' => 'Oʻzbek, Ўзбек, أۇزبېك‎', + ], + 've' => [ + 'isoName' => 'Venda', + 'nativeName' => 'Tshivenḓa', + ], + 'vi' => [ + 'isoName' => 'Vietnamese', + 'nativeName' => 'Tiếng Việt', + ], + 'vo' => [ + 'isoName' => 'Volapük', + 'nativeName' => 'Volapük', + ], + 'wa' => [ + 'isoName' => 'Walloon', + 'nativeName' => 'Walon', + ], + 'cy' => [ + 'isoName' => 'Welsh', + 'nativeName' => 'Cymraeg', + ], + 'wo' => [ + 'isoName' => 'Wolof', + 'nativeName' => 'Wollof', + ], + 'fy' => [ + 'isoName' => 'Western Frisian', + 'nativeName' => 'Frysk', + ], + 'xh' => [ + 'isoName' => 'Xhosa', + 'nativeName' => 'isiXhosa', + ], + 'yi' => [ + 'isoName' => 'Yiddish', + 'nativeName' => 'ייִדיש', + ], + 'yo' => [ + 'isoName' => 'Yoruba', + 'nativeName' => 'Yorùbá', + ], + 'za' => [ + 'isoName' => 'Zhuang, Chuang', + 'nativeName' => 'Saɯ cueŋƅ, Saw cuengh', + ], + 'zu' => [ + 'isoName' => 'Zulu', + 'nativeName' => 'isiZulu', + ], + /* + * Add ISO 639-3 languages available in Carbon + */ + 'agq' => [ + 'isoName' => 'Aghem', + 'nativeName' => 'Aghem', + ], + 'agr' => [ + 'isoName' => 'Aguaruna', + 'nativeName' => 'Aguaruna', + ], + 'anp' => [ + 'isoName' => 'Angika', + 'nativeName' => 'Angika', + ], + 'asa' => [ + 'isoName' => 'Asu', + 'nativeName' => 'Asu', + ], + 'ast' => [ + 'isoName' => 'Asturian', + 'nativeName' => 'Asturian', + ], + 'ayc' => [ + 'isoName' => 'Southern Aymara', + 'nativeName' => 'Southern Aymara', + ], + 'bas' => [ + 'isoName' => 'Basaa', + 'nativeName' => 'Basaa', + ], + 'bem' => [ + 'isoName' => 'Bemba', + 'nativeName' => 'Bemba', + ], + 'bez' => [ + 'isoName' => 'Bena', + 'nativeName' => 'Bena', + ], + 'bhb' => [ + 'isoName' => 'Bhili', + 'nativeName' => 'Bhili', + ], + 'bho' => [ + 'isoName' => 'Bhojpuri', + 'nativeName' => 'Bhojpuri', + ], + 'brx' => [ + 'isoName' => 'Bodo', + 'nativeName' => 'Bodo', + ], + 'byn' => [ + 'isoName' => 'Bilin', + 'nativeName' => 'Bilin', + ], + 'ccp' => [ + 'isoName' => 'Chakma', + 'nativeName' => 'Chakma', + ], + 'cgg' => [ + 'isoName' => 'Chiga', + 'nativeName' => 'Chiga', + ], + 'chr' => [ + 'isoName' => 'Cherokee', + 'nativeName' => 'Cherokee', + ], + 'cmn' => [ + 'isoName' => 'Chinese', + 'nativeName' => 'Chinese', + ], + 'crh' => [ + 'isoName' => 'Crimean Turkish', + 'nativeName' => 'Crimean Turkish', + ], + 'csb' => [ + 'isoName' => 'Kashubian', + 'nativeName' => 'Kashubian', + ], + 'dav' => [ + 'isoName' => 'Taita', + 'nativeName' => 'Taita', + ], + 'dje' => [ + 'isoName' => 'Zarma', + 'nativeName' => 'Zarma', + ], + 'doi' => [ + 'isoName' => 'Dogri (macrolanguage)', + 'nativeName' => 'Dogri (macrolanguage)', + ], + 'dsb' => [ + 'isoName' => 'Lower Sorbian', + 'nativeName' => 'Lower Sorbian', + ], + 'dua' => [ + 'isoName' => 'Duala', + 'nativeName' => 'Duala', + ], + 'dyo' => [ + 'isoName' => 'Jola-Fonyi', + 'nativeName' => 'Jola-Fonyi', + ], + 'ebu' => [ + 'isoName' => 'Embu', + 'nativeName' => 'Embu', + ], + 'ewo' => [ + 'isoName' => 'Ewondo', + 'nativeName' => 'Ewondo', + ], + 'fil' => [ + 'isoName' => 'Filipino', + 'nativeName' => 'Filipino', + ], + 'fur' => [ + 'isoName' => 'Friulian', + 'nativeName' => 'Friulian', + ], + 'gez' => [ + 'isoName' => 'Geez', + 'nativeName' => 'Geez', + ], + 'gom' => [ + 'isoName' => 'Konkani, Goan', + 'nativeName' => 'ಕೊಂಕಣಿ', + ], + 'gsw' => [ + 'isoName' => 'Swiss German', + 'nativeName' => 'Swiss German', + ], + 'guz' => [ + 'isoName' => 'Gusii', + 'nativeName' => 'Gusii', + ], + 'hak' => [ + 'isoName' => 'Hakka Chinese', + 'nativeName' => 'Hakka Chinese', + ], + 'haw' => [ + 'isoName' => 'Hawaiian', + 'nativeName' => 'Hawaiian', + ], + 'hif' => [ + 'isoName' => 'Fiji Hindi', + 'nativeName' => 'Fiji Hindi', + ], + 'hne' => [ + 'isoName' => 'Chhattisgarhi', + 'nativeName' => 'Chhattisgarhi', + ], + 'hsb' => [ + 'isoName' => 'Upper Sorbian', + 'nativeName' => 'Upper Sorbian', + ], + 'jgo' => [ + 'isoName' => 'Ngomba', + 'nativeName' => 'Ngomba', + ], + 'jmc' => [ + 'isoName' => 'Machame', + 'nativeName' => 'Machame', + ], + 'kab' => [ + 'isoName' => 'Kabyle', + 'nativeName' => 'Kabyle', + ], + 'kam' => [ + 'isoName' => 'Kamba', + 'nativeName' => 'Kamba', + ], + 'kde' => [ + 'isoName' => 'Makonde', + 'nativeName' => 'Makonde', + ], + 'kea' => [ + 'isoName' => 'Kabuverdianu', + 'nativeName' => 'Kabuverdianu', + ], + 'khq' => [ + 'isoName' => 'Koyra Chiini', + 'nativeName' => 'Koyra Chiini', + ], + 'kkj' => [ + 'isoName' => 'Kako', + 'nativeName' => 'Kako', + ], + 'kln' => [ + 'isoName' => 'Kalenjin', + 'nativeName' => 'Kalenjin', + ], + 'kok' => [ + 'isoName' => 'Konkani', + 'nativeName' => 'Konkani', + ], + 'ksb' => [ + 'isoName' => 'Shambala', + 'nativeName' => 'Shambala', + ], + 'ksf' => [ + 'isoName' => 'Bafia', + 'nativeName' => 'Bafia', + ], + 'ksh' => [ + 'isoName' => 'Colognian', + 'nativeName' => 'Colognian', + ], + 'lag' => [ + 'isoName' => 'Langi', + 'nativeName' => 'Langi', + ], + 'lij' => [ + 'isoName' => 'Ligurian', + 'nativeName' => 'Ligurian', + ], + 'lkt' => [ + 'isoName' => 'Lakota', + 'nativeName' => 'Lakota', + ], + 'lrc' => [ + 'isoName' => 'Northern Luri', + 'nativeName' => 'Northern Luri', + ], + 'luo' => [ + 'isoName' => 'Luo', + 'nativeName' => 'Luo', + ], + 'luy' => [ + 'isoName' => 'Luyia', + 'nativeName' => 'Luyia', + ], + 'lzh' => [ + 'isoName' => 'Literary Chinese', + 'nativeName' => 'Literary Chinese', + ], + 'mag' => [ + 'isoName' => 'Magahi', + 'nativeName' => 'Magahi', + ], + 'mai' => [ + 'isoName' => 'Maithili', + 'nativeName' => 'Maithili', + ], + 'mas' => [ + 'isoName' => 'Masai', + 'nativeName' => 'Masai', + ], + 'mer' => [ + 'isoName' => 'Meru', + 'nativeName' => 'Meru', + ], + 'mfe' => [ + 'isoName' => 'Morisyen', + 'nativeName' => 'Morisyen', + ], + 'mgh' => [ + 'isoName' => 'Makhuwa-Meetto', + 'nativeName' => 'Makhuwa-Meetto', + ], + 'mgo' => [ + 'isoName' => 'Metaʼ', + 'nativeName' => 'Metaʼ', + ], + 'mhr' => [ + 'isoName' => 'Eastern Mari', + 'nativeName' => 'Eastern Mari', + ], + 'miq' => [ + 'isoName' => 'Mískito', + 'nativeName' => 'Mískito', + ], + 'mjw' => [ + 'isoName' => 'Karbi', + 'nativeName' => 'Karbi', + ], + 'mni' => [ + 'isoName' => 'Manipuri', + 'nativeName' => 'Manipuri', + ], + 'mua' => [ + 'isoName' => 'Mundang', + 'nativeName' => 'Mundang', + ], + 'mzn' => [ + 'isoName' => 'Mazanderani', + 'nativeName' => 'Mazanderani', + ], + 'nan' => [ + 'isoName' => 'Min Nan Chinese', + 'nativeName' => 'Min Nan Chinese', + ], + 'naq' => [ + 'isoName' => 'Nama', + 'nativeName' => 'Nama', + ], + 'nds' => [ + 'isoName' => 'Low German', + 'nativeName' => 'Low German', + ], + 'nhn' => [ + 'isoName' => 'Central Nahuatl', + 'nativeName' => 'Central Nahuatl', + ], + 'niu' => [ + 'isoName' => 'Niuean', + 'nativeName' => 'Niuean', + ], + 'nmg' => [ + 'isoName' => 'Kwasio', + 'nativeName' => 'Kwasio', + ], + 'nnh' => [ + 'isoName' => 'Ngiemboon', + 'nativeName' => 'Ngiemboon', + ], + 'nso' => [ + 'isoName' => 'Northern Sotho', + 'nativeName' => 'Northern Sotho', + ], + 'nus' => [ + 'isoName' => 'Nuer', + 'nativeName' => 'Nuer', + ], + 'nyn' => [ + 'isoName' => 'Nyankole', + 'nativeName' => 'Nyankole', + ], + 'pap' => [ + 'isoName' => 'Papiamento', + 'nativeName' => 'Papiamento', + ], + 'prg' => [ + 'isoName' => 'Prussian', + 'nativeName' => 'Prussian', + ], + 'quz' => [ + 'isoName' => 'Cusco Quechua', + 'nativeName' => 'Cusco Quechua', + ], + 'raj' => [ + 'isoName' => 'Rajasthani', + 'nativeName' => 'Rajasthani', + ], + 'rof' => [ + 'isoName' => 'Rombo', + 'nativeName' => 'Rombo', + ], + 'rwk' => [ + 'isoName' => 'Rwa', + 'nativeName' => 'Rwa', + ], + 'sah' => [ + 'isoName' => 'Sakha', + 'nativeName' => 'Sakha', + ], + 'saq' => [ + 'isoName' => 'Samburu', + 'nativeName' => 'Samburu', + ], + 'sat' => [ + 'isoName' => 'Santali', + 'nativeName' => 'Santali', + ], + 'sbp' => [ + 'isoName' => 'Sangu', + 'nativeName' => 'Sangu', + ], + 'scr' => [ + 'isoName' => 'Serbo Croatian', + 'nativeName' => 'Serbo Croatian', + ], + 'seh' => [ + 'isoName' => 'Sena', + 'nativeName' => 'Sena', + ], + 'ses' => [ + 'isoName' => 'Koyraboro Senni', + 'nativeName' => 'Koyraboro Senni', + ], + 'sgs' => [ + 'isoName' => 'Samogitian', + 'nativeName' => 'Samogitian', + ], + 'shi' => [ + 'isoName' => 'Tachelhit', + 'nativeName' => 'Tachelhit', + ], + 'shn' => [ + 'isoName' => 'Shan', + 'nativeName' => 'Shan', + ], + 'shs' => [ + 'isoName' => 'Shuswap', + 'nativeName' => 'Shuswap', + ], + 'sid' => [ + 'isoName' => 'Sidamo', + 'nativeName' => 'Sidamo', + ], + 'smn' => [ + 'isoName' => 'Inari Sami', + 'nativeName' => 'Inari Sami', + ], + 'szl' => [ + 'isoName' => 'Silesian', + 'nativeName' => 'Silesian', + ], + 'tcy' => [ + 'isoName' => 'Tulu', + 'nativeName' => 'Tulu', + ], + 'teo' => [ + 'isoName' => 'Teso', + 'nativeName' => 'Teso', + ], + 'tet' => [ + 'isoName' => 'Tetum', + 'nativeName' => 'Tetum', + ], + 'the' => [ + 'isoName' => 'Chitwania Tharu', + 'nativeName' => 'Chitwania Tharu', + ], + 'tig' => [ + 'isoName' => 'Tigre', + 'nativeName' => 'Tigre', + ], + 'tlh' => [ + 'isoName' => 'Klingon', + 'nativeName' => 'tlhIngan Hol', + ], + 'tpi' => [ + 'isoName' => 'Tok Pisin', + 'nativeName' => 'Tok Pisin', + ], + 'twq' => [ + 'isoName' => 'Tasawaq', + 'nativeName' => 'Tasawaq', + ], + 'tzl' => [ + 'isoName' => 'Talossan', + 'nativeName' => 'Talossan', + ], + 'tzm' => [ + 'isoName' => 'Tamazight, Central Atlas', + 'nativeName' => 'ⵜⵎⴰⵣⵉⵖⵜ', + ], + 'unm' => [ + 'isoName' => 'Unami', + 'nativeName' => 'Unami', + ], + 'vai' => [ + 'isoName' => 'Vai', + 'nativeName' => 'Vai', + ], + 'vun' => [ + 'isoName' => 'Vunjo', + 'nativeName' => 'Vunjo', + ], + 'wae' => [ + 'isoName' => 'Walser', + 'nativeName' => 'Walser', + ], + 'wal' => [ + 'isoName' => 'Wolaytta', + 'nativeName' => 'Wolaytta', + ], + 'xog' => [ + 'isoName' => 'Soga', + 'nativeName' => 'Soga', + ], + 'yav' => [ + 'isoName' => 'Yangben', + 'nativeName' => 'Yangben', + ], + 'yue' => [ + 'isoName' => 'Cantonese', + 'nativeName' => 'Cantonese', + ], + 'yuw' => [ + 'isoName' => 'Yau (Morobe Province)', + 'nativeName' => 'Yau (Morobe Province)', + ], + 'zgh' => [ + 'isoName' => 'Standard Moroccan Tamazight', + 'nativeName' => 'Standard Moroccan Tamazight', + ], +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/List/regions.php b/plugins/vendor/nesbot/carbon/src/Carbon/List/regions.php new file mode 100644 index 00000000..f2410151 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/List/regions.php @@ -0,0 +1,292 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * ISO 3166-2 short names. + * + * ⚠ Provided with No Warranty + * + * This list has no official value, and it's using short name, i.e. the first column of + * https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + * + * Without the extra parenthesis unless a particular ambiguity in the list. + * + * For instance: + * - Falkland Islands and Malvinas both to FK, but we keep only the first for brevity and + * because there is no ambiguity in the list to justify longer name. + * - For Sint Maarten/Saint Martin not to have any confusion between FM and SX codes that + * are on the same island and so to be clear it's not referring to the whole island, + * south (dutch-speaking) and north (french-speaking) parentheses are kept for disambiguation. + * - For Virgin Islands, that can refer to either VG or VI, parentheses are also kept for + * disambiguation. + * + * We won't take into consideration any change request in this list unless there is an update + * in ISO 3166-2 itself that we need to align to. + * + * It's a purely geographical helper, state sovereignty is out of scope, for political + * complains you should address them directly to https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes + * + * Anyone needing official state names (such as the second column of the wikipedia page above) + * should seek for another tool, this list is not meant to provide long names. + */ +return [ + 'AD' => 'Andorra', + 'AE' => 'United Arab Emirates', + 'AF' => 'Afghanistan', + 'AG' => 'Antigua and Barbuda', + 'AI' => 'Anguilla', + 'AL' => 'Albania', + 'AM' => 'Armenia', + 'AO' => 'Angola', + 'AQ' => 'Antarctica', + 'AR' => 'Argentina', + 'AS' => 'American Samoa', + 'AT' => 'Austria', + 'AU' => 'Australia', + 'AW' => 'Aruba', + 'AX' => 'Åland Islands', + 'AZ' => 'Azerbaijan', + 'BA' => 'Bosnia and Herzegovina', + 'BB' => 'Barbados', + 'BD' => 'Bangladesh', + 'BE' => 'Belgium', + 'BF' => 'Burkina Faso', + 'BG' => 'Bulgaria', + 'BH' => 'Bahrain', + 'BI' => 'Burundi', + 'BJ' => 'Benin', + 'BL' => 'Saint Barthélemy', + 'BM' => 'Bermuda', + 'BN' => 'Brunei Darussalam', + 'BO' => 'Bolivia', + 'BQ' => 'Bonaire, Sint Eustatius and Saba', + 'BR' => 'Brazil', + 'BS' => 'Bahamas', + 'BT' => 'Bhutan', + 'BV' => 'Bouvet Island', + 'BW' => 'Botswana', + 'BY' => 'Belarus', + 'BZ' => 'Belize', + 'CA' => 'Canada', + 'CC' => 'Cocos (Keeling) Islands', + 'CD' => 'Congo, Democratic Republic of the', + 'CF' => 'Central African Republic', + 'CG' => 'Congo', + 'CH' => 'Switzerland', + 'CI' => 'Côte d\'Ivoire', + 'CK' => 'Cook Islands', + 'CL' => 'Chile', + 'CM' => 'Cameroon', + 'CN' => 'China', + 'CO' => 'Colombia', + 'CR' => 'Costa Rica', + 'CU' => 'Cuba', + 'CV' => 'Cabo Verde', + 'CW' => 'Curaçao', + 'CX' => 'Christmas Island', + 'CY' => 'Cyprus', + 'CZ' => 'Czechia', + 'DE' => 'Germany', + 'DJ' => 'Djibouti', + 'DK' => 'Denmark', + 'DM' => 'Dominica', + 'DO' => 'Dominican Republic', + 'DZ' => 'Algeria', + 'EC' => 'Ecuador', + 'EE' => 'Estonia', + 'EG' => 'Egypt', + 'EH' => 'Western Sahara', + 'ER' => 'Eritrea', + 'ES' => 'Spain', + 'ET' => 'Ethiopia', + 'FI' => 'Finland', + 'FJ' => 'Fiji', + 'FK' => 'Falkland Islands', + 'FM' => 'Micronesia', + 'FO' => 'Faroe Islands', + 'FR' => 'France', + 'GA' => 'Gabon', + 'GB' => 'United Kingdom of Great Britain and Northern Ireland', + 'GD' => 'Grenada', + 'GE' => 'Georgia', + 'GF' => 'French Guiana', + 'GG' => 'Guernsey', + 'GH' => 'Ghana', + 'GI' => 'Gibraltar', + 'GL' => 'Greenland', + 'GM' => 'Gambia', + 'GN' => 'Guinea', + 'GP' => 'Guadeloupe', + 'GQ' => 'Equatorial Guinea', + 'GR' => 'Greece', + 'GS' => 'South Georgia and the South Sandwich Islands', + 'GT' => 'Guatemala', + 'GU' => 'Guam', + 'GW' => 'Guinea-Bissau', + 'GY' => 'Guyana', + 'HK' => 'Hong Kong', + 'HM' => 'Heard Island and McDonald Islands', + 'HN' => 'Honduras', + 'HR' => 'Croatia', + 'HT' => 'Haiti', + 'HU' => 'Hungary', + 'ID' => 'Indonesia', + 'IE' => 'Ireland', + 'IL' => 'Israel', + 'IM' => 'Isle of Man', + 'IN' => 'India', + 'IO' => 'British Indian Ocean Territory', + 'IQ' => 'Iraq', + 'IR' => 'Iran', + 'IS' => 'Iceland', + 'IT' => 'Italy', + 'JE' => 'Jersey', + 'JM' => 'Jamaica', + 'JO' => 'Jordan', + 'JP' => 'Japan', + 'KE' => 'Kenya', + 'KG' => 'Kyrgyzstan', + 'KH' => 'Cambodia', + 'KI' => 'Kiribati', + 'KM' => 'Comoros', + 'KN' => 'Saint Kitts and Nevis', + 'KP' => 'Korea (Democratic People\'s Republic of)', + 'KR' => 'Korea, Republic of', + 'KW' => 'Kuwait', + 'KY' => 'Cayman Islands', + 'KZ' => 'Kazakhstan', + 'LA' => 'Lao People\'s Democratic Republic', + 'LB' => 'Lebanon', + 'LC' => 'Saint Lucia', + 'LI' => 'Liechtenstein', + 'LK' => 'Sri Lanka', + 'LR' => 'Liberia', + 'LS' => 'Lesotho', + 'LT' => 'Lithuania', + 'LU' => 'Luxembourg', + 'LV' => 'Latvia', + 'LY' => 'Libya', + 'MA' => 'Morocco', + 'MC' => 'Monaco', + 'MD' => 'Moldova', + 'ME' => 'Montenegro', + 'MF' => 'Saint Martin (French part)', + 'MG' => 'Madagascar', + 'MH' => 'Marshall Islands', + 'MK' => 'North Macedonia', + 'ML' => 'Mali', + 'MM' => 'Myanmar', + 'MN' => 'Mongolia', + 'MO' => 'Macao', + 'MP' => 'Northern Mariana Islands', + 'MQ' => 'Martinique', + 'MR' => 'Mauritania', + 'MS' => 'Montserrat', + 'MT' => 'Malta', + 'MU' => 'Mauritius', + 'MV' => 'Maldives', + 'MW' => 'Malawi', + 'MX' => 'Mexico', + 'MY' => 'Malaysia', + 'MZ' => 'Mozambique', + 'NA' => 'Namibia', + 'NC' => 'New Caledonia', + 'NE' => 'Niger', + 'NF' => 'Norfolk Island', + 'NG' => 'Nigeria', + 'NI' => 'Nicaragua', + 'NL' => 'Netherlands', + 'NO' => 'Norway', + 'NP' => 'Nepal', + 'NR' => 'Nauru', + 'NU' => 'Niue', + 'NZ' => 'New Zealand', + 'OM' => 'Oman', + 'PA' => 'Panama', + 'PE' => 'Peru', + 'PF' => 'French Polynesia', + 'PG' => 'Papua New Guinea', + 'PH' => 'Philippines', + 'PK' => 'Pakistan', + 'PL' => 'Poland', + 'PM' => 'Saint Pierre and Miquelon', + 'PN' => 'Pitcairn', + 'PR' => 'Puerto Rico', + 'PS' => 'Palestine', + 'PT' => 'Portugal', + 'PW' => 'Palau', + 'PY' => 'Paraguay', + 'QA' => 'Qatar', + 'RE' => 'Réunion', + 'RO' => 'Romania', + 'RS' => 'Serbia', + 'RU' => 'Russian Federation', + 'RW' => 'Rwanda', + 'SA' => 'Saudi Arabia', + 'SB' => 'Solomon Islands', + 'SC' => 'Seychelles', + 'SD' => 'Sudan', + 'SE' => 'Sweden', + 'SG' => 'Singapore', + 'SH' => 'Saint Helena, Ascension and Tristan da Cunha', + 'SI' => 'Slovenia', + 'SJ' => 'Svalbard and Jan Mayen', + 'SK' => 'Slovakia', + 'SL' => 'Sierra Leone', + 'SM' => 'San Marino', + 'SN' => 'Senegal', + 'SO' => 'Somalia', + 'SR' => 'Suriname', + 'SS' => 'South Sudan', + 'ST' => 'Sao Tome and Principe', + 'SV' => 'El Salvador', + 'SX' => 'Sint Maarten (Dutch part)', + 'SY' => 'Syrian Arab Republic', + 'SZ' => 'Eswatini', + 'TC' => 'Turks and Caicos Islands', + 'TD' => 'Chad', + 'TF' => 'French Southern Territories', + 'TG' => 'Togo', + 'TH' => 'Thailand', + 'TJ' => 'Tajikistan', + 'TK' => 'Tokelau', + 'TL' => 'Timor-Leste', + 'TM' => 'Turkmenistan', + 'TN' => 'Tunisia', + 'TO' => 'Tonga', + 'TR' => 'Turkey', + 'TT' => 'Trinidad and Tobago', + 'TV' => 'Tuvalu', + 'TW' => 'Taiwan', + 'TZ' => 'Tanzania', + 'UA' => 'Ukraine', + 'UG' => 'Uganda', + 'UM' => 'United States Minor Outlying Islands', + 'US' => 'United States of America', + 'UY' => 'Uruguay', + 'UZ' => 'Uzbekistan', + 'VA' => 'Holy See', + 'VC' => 'Saint Vincent and the Grenadines', + 'VE' => 'Venezuela', + 'VG' => 'Virgin Islands (British)', + 'VI' => 'Virgin Islands (U.S.)', + 'VN' => 'Viet Nam', + 'VU' => 'Vanuatu', + 'WF' => 'Wallis and Futuna', + 'WS' => 'Samoa', + 'YE' => 'Yemen', + 'YT' => 'Mayotte', + 'ZA' => 'South Africa', + 'ZM' => 'Zambia', + 'ZW' => 'Zimbabwe', +]; diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php b/plugins/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php new file mode 100644 index 00000000..64b5d976 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\MessageFormatter; + +use ReflectionMethod; +use Symfony\Component\Translation\Formatter\MessageFormatter; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +// @codeCoverageIgnoreStart +$transMethod = new ReflectionMethod(MessageFormatterInterface::class, 'format'); + +require $transMethod->getParameters()[0]->hasType() + ? __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperStrongType.php' + : __DIR__.'/../../../lazy/Carbon/MessageFormatter/MessageFormatterMapperWeakType.php'; +// @codeCoverageIgnoreEnd + +final class MessageFormatterMapper extends LazyMessageFormatter +{ + /** + * Wrapped formatter. + * + * @var MessageFormatterInterface + */ + protected $formatter; + + public function __construct(?MessageFormatterInterface $formatter = null) + { + $this->formatter = $formatter ?? new MessageFormatter(); + } + + protected function transformLocale(?string $locale): ?string + { + return $locale ? preg_replace('/[_@][A-Za-z][a-z]{2,}/', '', $locale) : $locale; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Month.php b/plugins/vendor/nesbot/carbon/src/Carbon/Month.php new file mode 100644 index 00000000..47b279f6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Month.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\InvalidFormatException; + +enum Month: int +{ + // Using constants is only safe starting from PHP 8.2 + case January = 1; // CarbonInterface::JANUARY + case February = 2; // CarbonInterface::FEBRUARY + case March = 3; // CarbonInterface::MARCH + case April = 4; // CarbonInterface::APRIL + case May = 5; // CarbonInterface::MAY + case June = 6; // CarbonInterface::JUNE + case July = 7; // CarbonInterface::JULY + case August = 8; // CarbonInterface::AUGUST + case September = 9; // CarbonInterface::SEPTEMBER + case October = 10; // CarbonInterface::OCTOBER + case November = 11; // CarbonInterface::NOVEMBER + case December = 12; // CarbonInterface::DECEMBER + + public static function int(self|int|null $value): ?int + { + return $value instanceof self ? $value->value : $value; + } + + public static function fromNumber(int $number): self + { + $month = $number % CarbonInterface::MONTHS_PER_YEAR; + + return self::from($month + ($month < 1 ? CarbonInterface::MONTHS_PER_YEAR : 0)); + } + + public static function fromName(string $name, ?string $locale = null): self + { + try { + return self::from(CarbonImmutable::parseFromLocale("$name 1", $locale)->month); + } catch (InvalidFormatException $exception) { + // Possibly current language expect a dot after short name, but it's missing + if ($locale !== null && !mb_strlen($name) < 4 && !str_ends_with($name, '.')) { + try { + return self::from(CarbonImmutable::parseFromLocale("$name. 1", $locale)->month); + } catch (InvalidFormatException $e) { + // Throw previous error + } + } + + throw $exception; + } + } + + public function ofTheYear(CarbonImmutable|int|null $now = null): CarbonImmutable + { + if (\is_int($now)) { + return CarbonImmutable::create($now, $this->value); + } + + $modifier = $this->name.' 1st'; + + return $now?->modify($modifier) ?? new CarbonImmutable($modifier); + } + + public function locale(string $locale, ?CarbonImmutable $now = null): CarbonImmutable + { + return $this->ofTheYear($now)->locale($locale); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php b/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php new file mode 100644 index 00000000..7327586a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroExtension.php @@ -0,0 +1,137 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +use Carbon\CarbonInterface; +use Carbon\FactoryImmutable; +use Closure; +use InvalidArgumentException; +use PHPStan\Reflection\ClassReflection; +use PHPStan\Reflection\MethodReflection; +use PHPStan\Reflection\MethodsClassReflectionExtension; +use PHPStan\Reflection\ReflectionProvider; +use PHPStan\Type\ClosureTypeFactory; +use ReflectionFunction; +use ReflectionMethod; +use stdClass; +use Throwable; + +/** + * Class MacroExtension. + * + * @codeCoverageIgnore Pure PHPStan wrapper. + */ +final class MacroExtension implements MethodsClassReflectionExtension +{ + /** + * @var ReflectionProvider + */ + protected $reflectionProvider; + + /** + * @var ClosureTypeFactory + */ + protected $closureTypeFactory; + + /** + * Extension constructor. + * + * @param ReflectionProvider $reflectionProvider + * @param ClosureTypeFactory $closureTypeFactory + */ + public function __construct( + ReflectionProvider $reflectionProvider, + ClosureTypeFactory $closureTypeFactory + ) { + $this->reflectionProvider = $reflectionProvider; + $this->closureTypeFactory = $closureTypeFactory; + } + + /** + * {@inheritdoc} + */ + public function hasMethod(ClassReflection $classReflection, string $methodName): bool + { + if ( + $classReflection->getName() !== CarbonInterface::class && + !$classReflection->isSubclassOf(CarbonInterface::class) + ) { + return false; + } + + $className = $classReflection->getName(); + + return \is_callable([$className, 'hasMacro']) && + $className::hasMacro($methodName); + } + + /** + * {@inheritdoc} + */ + public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection + { + $macros = FactoryImmutable::getDefaultInstance()->getSettings()['macros'] ?? []; + $macro = $macros[$methodName] ?? throw new InvalidArgumentException("Macro '$methodName' not found"); + $static = false; + $final = false; + $deprecated = false; + $docComment = null; + + if (\is_array($macro) && \count($macro) === 2 && \is_string($macro[1])) { + \assert($macro[1] !== ''); + + $reflection = new ReflectionMethod($macro[0], $macro[1]); + $closure = \is_object($macro[0]) ? $reflection->getClosure($macro[0]) : $reflection->getClosure(); + + $static = $reflection->isStatic(); + $final = $reflection->isFinal(); + $deprecated = $reflection->isDeprecated(); + $docComment = $reflection->getDocComment() ?: null; + } elseif (\is_string($macro)) { + $reflection = new ReflectionFunction($macro); + $closure = $reflection->getClosure(); + $deprecated = $reflection->isDeprecated(); + $docComment = $reflection->getDocComment() ?: null; + } elseif ($macro instanceof Closure) { + $closure = $macro; + + try { + $boundClosure = Closure::bind($closure, new stdClass()); + $static = (!$boundClosure || (new ReflectionFunction($boundClosure))->getClosureThis() === null); + } catch (Throwable) { + $static = true; + } + + $reflection = new ReflectionFunction($macro); + $deprecated = $reflection->isDeprecated(); + $docComment = $reflection->getDocComment() ?: null; + } + + if (!isset($closure)) { + throw new InvalidArgumentException('Could not create reflection from the spec given'); // @codeCoverageIgnore + } + + $closureType = $this->closureTypeFactory->fromClosureObject($closure); + + return new MacroMethodReflection( + $classReflection, + $methodName, + $closureType, + $static, + $final, + $deprecated, + $docComment, + ); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroMethodReflection.php b/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroMethodReflection.php new file mode 100644 index 00000000..b710f549 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/PHPStan/MacroMethodReflection.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\PHPStan; + +use PHPStan\Reflection\ClassReflection; +use PHPStan\Reflection\MethodReflection; +use PHPStan\Reflection\ParametersAcceptor; +use PHPStan\TrinaryLogic; +use PHPStan\Type\Type; + +use function preg_match; + +class MacroMethodReflection implements MethodReflection +{ + private ClassReflection $declaringClass; + private string $methodName; + private ParametersAcceptor $macroClosureType; + private bool $static; + private bool $final; + private bool $deprecated; + private ?string $docComment; + + public function __construct( + ClassReflection $declaringClass, + string $methodName, + ParametersAcceptor $macroClosureType, + bool $static, + bool $final, + bool $deprecated, + ?string $docComment + ) { + $this->declaringClass = $declaringClass; + $this->methodName = $methodName; + $this->macroClosureType = $macroClosureType; + $this->static = $static; + $this->final = $final; + $this->deprecated = $deprecated; + $this->docComment = $docComment; + } + + public function getDeclaringClass(): ClassReflection + { + return $this->declaringClass; + } + + public function isStatic(): bool + { + return $this->static; + } + + public function isPrivate(): bool + { + return false; + } + + public function isPublic(): bool + { + return true; + } + + public function getDocComment(): ?string + { + return $this->docComment; + } + + public function getName(): string + { + return $this->methodName; + } + + public function getPrototype(): \PHPStan\Reflection\ClassMemberReflection + { + return $this; + } + + public function getVariants(): array + { + return [$this->macroClosureType]; + } + + public function isDeprecated(): TrinaryLogic + { + return TrinaryLogic::createFromBoolean( + $this->deprecated || + preg_match('/@deprecated/i', $this->getDocComment() ?: '') + ); + } + + public function getDeprecatedDescription(): ?string + { + return null; + } + + public function isFinal(): TrinaryLogic + { + return TrinaryLogic::createFromBoolean($this->final); + } + + public function isInternal(): TrinaryLogic + { + return TrinaryLogic::createNo(); + } + + public function getThrowType(): ?Type + { + return null; + } + + public function hasSideEffects(): TrinaryLogic + { + return TrinaryLogic::createMaybe(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php new file mode 100644 index 00000000..b21b9c54 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Boundaries.php @@ -0,0 +1,469 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Exceptions\UnknownUnitException; +use Carbon\Unit; +use Carbon\WeekDay; + +/** + * Trait Boundaries. + * + * startOf, endOf and derived method for each unit. + * + * Depends on the following properties: + * + * @property int $year + * @property int $month + * @property int $daysInMonth + * @property int $quarter + * + * Depends on the following methods: + * + * @method $this setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0) + * @method $this setDate(int $year, int $month, int $day) + * @method $this addMonths(int $value = 1) + */ +trait Boundaries +{ + /** + * Resets the time to 00:00:00 start of day + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfDay(); + * ``` + * + * @return static + */ + public function startOfDay() + { + return $this->setTime(0, 0, 0, 0); + } + + /** + * Resets the time to 23:59:59.999999 end of day + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfDay(); + * ``` + * + * @return static + */ + public function endOfDay() + { + return $this->setTime(static::HOURS_PER_DAY - 1, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); + } + + /** + * Resets the date to the first day of the month and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMonth(); + * ``` + * + * @return static + */ + public function startOfMonth() + { + return $this->setDate($this->year, $this->month, 1)->startOfDay(); + } + + /** + * Resets the date to end of the month and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMonth(); + * ``` + * + * @return static + */ + public function endOfMonth() + { + return $this->setDate($this->year, $this->month, $this->daysInMonth)->endOfDay(); + } + + /** + * Resets the date to the first day of the quarter and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfQuarter(); + * ``` + * + * @return static + */ + public function startOfQuarter() + { + $month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1; + + return $this->setDate($this->year, $month, 1)->startOfDay(); + } + + /** + * Resets the date to end of the quarter and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfQuarter(); + * ``` + * + * @return static + */ + public function endOfQuarter() + { + return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth(); + } + + /** + * Resets the date to the first day of the year and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfYear(); + * ``` + * + * @return static + */ + public function startOfYear() + { + return $this->setDate($this->year, 1, 1)->startOfDay(); + } + + /** + * Resets the date to end of the year and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfYear(); + * ``` + * + * @return static + */ + public function endOfYear() + { + return $this->setDate($this->year, 12, 31)->endOfDay(); + } + + /** + * Resets the date to the first day of the decade and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfDecade(); + * ``` + * + * @return static + */ + public function startOfDecade() + { + $year = $this->year - $this->year % static::YEARS_PER_DECADE; + + return $this->setDate($year, 1, 1)->startOfDay(); + } + + /** + * Resets the date to end of the decade and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfDecade(); + * ``` + * + * @return static + */ + public function endOfDecade() + { + $year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1; + + return $this->setDate($year, 12, 31)->endOfDay(); + } + + /** + * Resets the date to the first day of the century and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfCentury(); + * ``` + * + * @return static + */ + public function startOfCentury() + { + $year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY; + + return $this->setDate($year, 1, 1)->startOfDay(); + } + + /** + * Resets the date to end of the century and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfCentury(); + * ``` + * + * @return static + */ + public function endOfCentury() + { + $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY; + + return $this->setDate($year, 12, 31)->endOfDay(); + } + + /** + * Resets the date to the first day of the millennium and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMillennium(); + * ``` + * + * @return static + */ + public function startOfMillennium() + { + $year = $this->year - ($this->year - 1) % static::YEARS_PER_MILLENNIUM; + + return $this->setDate($year, 1, 1)->startOfDay(); + } + + /** + * Resets the date to end of the millennium and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMillennium(); + * ``` + * + * @return static + */ + public function endOfMillennium() + { + $year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_MILLENNIUM + static::YEARS_PER_MILLENNIUM; + + return $this->setDate($year, 12, 31)->endOfDay(); + } + + /** + * Resets the date to the first day of week (defined in $weekStartsAt) and the time to 00:00:00 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->startOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->startOfWeek(Carbon::SUNDAY) . "\n"; + * ``` + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + * + * @return static + */ + public function startOfWeek(WeekDay|int|null $weekStartsAt = null): static + { + return $this + ->subDays( + (static::DAYS_PER_WEEK + $this->dayOfWeek - (WeekDay::int($weekStartsAt) ?? $this->firstWeekDay)) % + static::DAYS_PER_WEEK, + ) + ->startOfDay(); + } + + /** + * Resets the date to end of week (defined in $weekEndsAt) and time to 23:59:59.999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->locale('ar')->endOfWeek() . "\n"; + * echo Carbon::parse('2018-07-25 12:45:16')->endOfWeek(Carbon::SATURDAY) . "\n"; + * ``` + * + * @param WeekDay|int|null $weekEndsAt optional end allow you to specify the day of week to use to end the week + * + * @return static + */ + public function endOfWeek(WeekDay|int|null $weekEndsAt = null): static + { + return $this + ->addDays( + (static::DAYS_PER_WEEK - $this->dayOfWeek + (WeekDay::int($weekEndsAt) ?? $this->lastWeekDay)) % + static::DAYS_PER_WEEK, + ) + ->endOfDay(); + } + + /** + * Modify to start of current hour, minutes and seconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfHour(); + * ``` + */ + public function startOfHour(): static + { + return $this->setTime($this->hour, 0, 0, 0); + } + + /** + * Modify to end of current hour, minutes and seconds become 59 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfHour(); + * ``` + */ + public function endOfHour(): static + { + return $this->setTime($this->hour, static::MINUTES_PER_HOUR - 1, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); + } + + /** + * Modify to start of current minute, seconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->startOfMinute(); + * ``` + */ + public function startOfMinute(): static + { + return $this->setTime($this->hour, $this->minute, 0, 0); + } + + /** + * Modify to end of current minute, seconds become 59 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16')->endOfMinute(); + * ``` + */ + public function endOfMinute(): static + { + return $this->setTime($this->hour, $this->minute, static::SECONDS_PER_MINUTE - 1, static::MICROSECONDS_PER_SECOND - 1); + } + + /** + * Modify to start of current second, microseconds become 0 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function startOfSecond(): static + { + return $this->setTime($this->hour, $this->minute, $this->second, 0); + } + + /** + * Modify to end of current second, microseconds become 999999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->endOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function endOfSecond(): static + { + return $this->setTime($this->hour, $this->minute, $this->second, static::MICROSECONDS_PER_SECOND - 1); + } + + /** + * Modify to start of current millisecond, microseconds such as 12345 become 123000 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function startOfMillisecond(): static + { + $millisecond = (int) floor($this->micro / 1000); + + return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000); + } + + /** + * Modify to end of current millisecond, microseconds such as 12345 become 123999 + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->endOfSecond() + * ->format('H:i:s.u'); + * ``` + */ + public function endOfMillisecond(): static + { + $millisecond = (int) floor($this->micro / 1000); + + return $this->setTime($this->hour, $this->minute, $this->second, $millisecond * 1000 + 999); + } + + /** + * Modify to start of current given unit. + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOf(Unit::Month) + * ->endOf(Unit::Week, Carbon::FRIDAY); + * ``` + */ + public function startOf(Unit|string $unit, mixed ...$params): static + { + $ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit)); + $method = "startOf$ucfUnit"; + if (!method_exists($this, $method)) { + throw new UnknownUnitException($unit); + } + + return $this->$method(...$params); + } + + /** + * Modify to end of current given unit. + * + * @example + * ``` + * echo Carbon::parse('2018-07-25 12:45:16.334455') + * ->startOf(Unit::Month) + * ->endOf(Unit::Week, Carbon::FRIDAY); + * ``` + */ + public function endOf(Unit|string $unit, mixed ...$params): static + { + $ucfUnit = ucfirst($unit instanceof Unit ? $unit->value : static::singularUnit($unit)); + $method = "endOf$ucfUnit"; + if (!method_exists($this, $method)) { + throw new UnknownUnitException($unit); + } + + return $this->$method(...$params); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php new file mode 100644 index 00000000..4c00e42c --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Cast.php @@ -0,0 +1,48 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Exceptions\InvalidCastException; +use DateTimeInterface; + +/** + * Trait Cast. + * + * Utils to cast into an other class. + */ +trait Cast +{ + /** + * Cast the current instance into the given class. + * + * @template T + * + * @param class-string $className The $className::instance() method will be called to cast the current object. + * + * @return T + */ + public function cast(string $className): mixed + { + if (!method_exists($className, 'instance')) { + if (is_a($className, DateTimeInterface::class, true)) { + return $className::createFromFormat('U.u', $this->rawFormat('U.u')) + ->setTimezone($this->getTimezone()); + } + + throw new InvalidCastException("$className has not the instance() method needed to cast the date."); + } + + return $className::instance($this); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php new file mode 100644 index 00000000..53e54dea --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Comparison.php @@ -0,0 +1,1361 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use BackedEnum; +use BadMethodCallException; +use Carbon\CarbonConverterInterface; +use Carbon\CarbonInterface; +use Carbon\Exceptions\BadComparisonUnitException; +use Carbon\FactoryImmutable; +use Carbon\Month; +use Carbon\Unit; +use Carbon\WeekDay; +use Closure; +use DateInterval; +use DateTimeInterface; +use InvalidArgumentException; + +/** + * Trait Comparison. + * + * Comparison utils and testers. All the following methods return booleans. + * nowWithSameTz + * + * Depends on the following methods: + * + * @method static resolveCarbon($date) + * @method static copy() + * @method static nowWithSameTz() + * @method static static yesterday($timezone = null) + * @method static static tomorrow($timezone = null) + */ +trait Comparison +{ + protected bool $endOfTime = false; + + protected bool $startOfTime = false; + + /** + * Determines if the instance is equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->eq(Carbon::parse('2018-07-25 12:45:16')); // true + * Carbon::parse('2018-07-25 12:45:16')->eq('2018-07-25 12:45:17'); // false + * ``` + * + * @see equalTo() + */ + public function eq(DateTimeInterface|string $date): bool + { + return $this->equalTo($date); + } + + /** + * Determines if the instance is equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->equalTo(Carbon::parse('2018-07-25 12:45:16')); // true + * Carbon::parse('2018-07-25 12:45:16')->equalTo('2018-07-25 12:45:17'); // false + * ``` + */ + public function equalTo(DateTimeInterface|string $date): bool + { + return $this == $this->resolveCarbon($date); + } + + /** + * Determines if the instance is not equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->ne(Carbon::parse('2018-07-25 12:45:16')); // false + * Carbon::parse('2018-07-25 12:45:16')->ne('2018-07-25 12:45:17'); // true + * ``` + * + * @see notEqualTo() + */ + public function ne(DateTimeInterface|string $date): bool + { + return $this->notEqualTo($date); + } + + /** + * Determines if the instance is not equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo(Carbon::parse('2018-07-25 12:45:16')); // false + * Carbon::parse('2018-07-25 12:45:16')->notEqualTo('2018-07-25 12:45:17'); // true + * ``` + */ + public function notEqualTo(DateTimeInterface|string $date): bool + { + return !$this->equalTo($date); + } + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->gt('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThan() + */ + public function gt(DateTimeInterface|string $date): bool + { + return $this->greaterThan($date); + } + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->greaterThan('2018-07-25 12:45:17'); // false + * ``` + */ + public function greaterThan(DateTimeInterface|string $date): bool + { + return $this > $this->resolveCarbon($date); + } + + /** + * Determines if the instance is greater (after) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->isAfter('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThan() + */ + public function isAfter(DateTimeInterface|string $date): bool + { + return $this->greaterThan($date); + } + + /** + * Determines if the instance is greater (after) than or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->gte('2018-07-25 12:45:17'); // false + * ``` + * + * @see greaterThanOrEqualTo() + */ + public function gte(DateTimeInterface|string $date): bool + { + return $this->greaterThanOrEqualTo($date); + } + + /** + * Determines if the instance is greater (after) than or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:15'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->greaterThanOrEqualTo('2018-07-25 12:45:17'); // false + * ``` + */ + public function greaterThanOrEqualTo(DateTimeInterface|string $date): bool + { + return $this >= $this->resolveCarbon($date); + } + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->lt('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThan() + */ + public function lt(DateTimeInterface|string $date): bool + { + return $this->lessThan($date); + } + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThan('2018-07-25 12:45:17'); // true + * ``` + */ + public function lessThan(DateTimeInterface|string $date): bool + { + return $this < $this->resolveCarbon($date); + } + + /** + * Determines if the instance is less (before) than another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:16'); // false + * Carbon::parse('2018-07-25 12:45:16')->isBefore('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThan() + */ + public function isBefore(DateTimeInterface|string $date): bool + { + return $this->lessThan($date); + } + + /** + * Determines if the instance is less (before) or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->lte('2018-07-25 12:45:17'); // true + * ``` + * + * @see lessThanOrEqualTo() + */ + public function lte(DateTimeInterface|string $date): bool + { + return $this->lessThanOrEqualTo($date); + } + + /** + * Determines if the instance is less (before) or equal to another + * + * @example + * ``` + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:15'); // false + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:16'); // true + * Carbon::parse('2018-07-25 12:45:16')->lessThanOrEqualTo('2018-07-25 12:45:17'); // true + * ``` + */ + public function lessThanOrEqualTo(DateTimeInterface|string $date): bool + { + return $this <= $this->resolveCarbon($date); + } + + /** + * Determines if the instance is between two others. + * + * The third argument allow you to specify if bounds are included or not (true by default) + * but for when you including/excluding bounds may produce different results in your application, + * we recommend to use the explicit methods ->betweenIncluded() or ->betweenExcluded() instead. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->between('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->between('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->between('2018-07-25', '2018-08-01', false); // false + * ``` + * + * @param bool $equal Indicates if an equal to comparison should be done + */ + public function between(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool + { + $date1 = $this->resolveCarbon($date1); + $date2 = $this->resolveCarbon($date2); + + if ($date1->greaterThan($date2)) { + [$date1, $date2] = [$date2, $date1]; + } + + if ($equal) { + return $this >= $date1 && $this <= $date2; + } + + return $this > $date1 && $this < $date2; + } + + /** + * Determines if the instance is between two others, bounds included. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->betweenIncluded('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->betweenIncluded('2018-07-25', '2018-08-01'); // true + * ``` + */ + public function betweenIncluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool + { + return $this->between($date1, $date2, true); + } + + /** + * Determines if the instance is between two others, bounds excluded. + * + * @example + * ``` + * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->betweenExcluded('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->betweenExcluded('2018-07-25', '2018-08-01'); // false + * ``` + */ + public function betweenExcluded(DateTimeInterface|string $date1, DateTimeInterface|string $date2): bool + { + return $this->between($date1, $date2, false); + } + + /** + * Determines if the instance is between two others + * + * @example + * ``` + * Carbon::parse('2018-07-25')->isBetween('2018-07-14', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->isBetween('2018-08-01', '2018-08-20'); // false + * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01'); // true + * Carbon::parse('2018-07-25')->isBetween('2018-07-25', '2018-08-01', false); // false + * ``` + * + * @param bool $equal Indicates if an equal to comparison should be done + */ + public function isBetween(DateTimeInterface|string $date1, DateTimeInterface|string $date2, bool $equal = true): bool + { + return $this->between($date1, $date2, $equal); + } + + /** + * Determines if the instance is a weekday. + * + * @example + * ``` + * Carbon::parse('2019-07-14')->isWeekday(); // false + * Carbon::parse('2019-07-15')->isWeekday(); // true + * ``` + */ + public function isWeekday(): bool + { + return !$this->isWeekend(); + } + + /** + * Determines if the instance is a weekend day. + * + * @example + * ``` + * Carbon::parse('2019-07-14')->isWeekend(); // true + * Carbon::parse('2019-07-15')->isWeekend(); // false + * ``` + */ + public function isWeekend(): bool + { + return \in_array( + $this->dayOfWeek, + $this->transmitFactory(static fn () => static::getWeekendDays()), + true, + ); + } + + /** + * Determines if the instance is yesterday. + * + * @example + * ``` + * Carbon::yesterday()->isYesterday(); // true + * Carbon::tomorrow()->isYesterday(); // false + * ``` + */ + public function isYesterday(): bool + { + return $this->toDateString() === $this->transmitFactory( + fn () => static::yesterday($this->getTimezone())->toDateString(), + ); + } + + /** + * Determines if the instance is today. + * + * @example + * ``` + * Carbon::today()->isToday(); // true + * Carbon::tomorrow()->isToday(); // false + * ``` + */ + public function isToday(): bool + { + return $this->toDateString() === $this->nowWithSameTz()->toDateString(); + } + + /** + * Determines if the instance is tomorrow. + * + * @example + * ``` + * Carbon::tomorrow()->isTomorrow(); // true + * Carbon::yesterday()->isTomorrow(); // false + * ``` + */ + public function isTomorrow(): bool + { + return $this->toDateString() === $this->transmitFactory( + fn () => static::tomorrow($this->getTimezone())->toDateString(), + ); + } + + /** + * Determines if the instance is in the future, ie. greater (after) than now. + * + * @example + * ``` + * Carbon::now()->addHours(5)->isFuture(); // true + * Carbon::now()->subHours(5)->isFuture(); // false + * ``` + */ + public function isFuture(): bool + { + return $this->greaterThan($this->nowWithSameTz()); + } + + /** + * Determines if the instance is in the past, ie. less (before) than now. + * + * @example + * ``` + * Carbon::now()->subHours(5)->isPast(); // true + * Carbon::now()->addHours(5)->isPast(); // false + * ``` + */ + public function isPast(): bool + { + return $this->lessThan($this->nowWithSameTz()); + } + + /** + * Determines if the instance is now or in the future, ie. greater (after) than or equal to now. + * + * @example + * ``` + * Carbon::now()->isNowOrFuture(); // true + * Carbon::now()->addHours(5)->isNowOrFuture(); // true + * Carbon::now()->subHours(5)->isNowOrFuture(); // false + * ``` + */ + public function isNowOrFuture(): bool + { + return $this->greaterThanOrEqualTo($this->nowWithSameTz()); + } + + /** + * Determines if the instance is now or in the past, ie. less (before) than or equal to now. + * + * @example + * ``` + * Carbon::now()->isNowOrPast(); // true + * Carbon::now()->subHours(5)->isNowOrPast(); // true + * Carbon::now()->addHours(5)->isNowOrPast(); // false + * ``` + */ + public function isNowOrPast(): bool + { + return $this->lessThanOrEqualTo($this->nowWithSameTz()); + } + + /** + * Determines if the instance is a leap year. + * + * @example + * ``` + * Carbon::parse('2020-01-01')->isLeapYear(); // true + * Carbon::parse('2019-01-01')->isLeapYear(); // false + * ``` + */ + public function isLeapYear(): bool + { + return $this->rawFormat('L') === '1'; + } + + /** + * Determines if the instance is a long year (using calendar year). + * + * ⚠️ This method completely ignores month and day to use the numeric year number, + * it's not correct if the exact date matters. For instance as `2019-12-30` is already + * in the first week of the 2020 year, if you want to know from this date if ISO week + * year 2020 is a long year, use `isLongIsoYear` instead. + * + * @example + * ``` + * Carbon::create(2015)->isLongYear(); // true + * Carbon::create(2016)->isLongYear(); // false + * ``` + * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + */ + public function isLongYear(): bool + { + return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === static::WEEKS_PER_YEAR + 1; + } + + /** + * Determines if the instance is a long year (using ISO 8601 year). + * + * @example + * ``` + * Carbon::parse('2015-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-01')->isLongIsoYear(); // true + * Carbon::parse('2016-01-03')->isLongIsoYear(); // false + * Carbon::parse('2019-12-29')->isLongIsoYear(); // false + * Carbon::parse('2019-12-30')->isLongIsoYear(); // true + * ``` + * + * @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates + */ + public function isLongIsoYear(): bool + { + return static::create($this->isoWeekYear, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53; + } + + /** + * Compares the formatted values of the two dates. + * + * @example + * ``` + * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-12-13')); // true + * Carbon::parse('2019-06-13')->isSameAs('Y-d', Carbon::parse('2019-06-14')); // false + * ``` + * + * @param string $format date formats to compare. + * @param DateTimeInterface|string $date instance to compare with or null to use current day. + */ + public function isSameAs(string $format, DateTimeInterface|string $date): bool + { + return $this->rawFormat($format) === $this->resolveCarbon($date)->rawFormat($format); + } + + /** + * Determines if the instance is in the current unit given. + * + * @example + * ``` + * Carbon::parse('2019-01-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // true + * Carbon::parse('2018-12-13')->isSameUnit('year', Carbon::parse('2019-12-25')); // false + * ``` + * + * @param string $unit singular unit string + * @param DateTimeInterface|string $date instance to compare with or null to use current day. + * + * @throws BadComparisonUnitException + * + * @return bool + */ + public function isSameUnit(string $unit, DateTimeInterface|string $date): bool + { + if ($unit === /* @call isSameUnit */ 'quarter') { + $other = $this->resolveCarbon($date); + + return $other->year === $this->year && $other->quarter === $this->quarter; + } + + $units = [ + // @call isSameUnit + 'year' => 'Y', + // @call isSameUnit + 'month' => 'Y-n', + // @call isSameUnit + 'week' => 'o-W', + // @call isSameUnit + 'day' => 'Y-m-d', + // @call isSameUnit + 'hour' => 'Y-m-d H', + // @call isSameUnit + 'minute' => 'Y-m-d H:i', + // @call isSameUnit + 'second' => 'Y-m-d H:i:s', + // @call isSameUnit + 'milli' => 'Y-m-d H:i:s.v', + // @call isSameUnit + 'millisecond' => 'Y-m-d H:i:s.v', + // @call isSameUnit + 'micro' => 'Y-m-d H:i:s.u', + // @call isSameUnit + 'microsecond' => 'Y-m-d H:i:s.u', + ]; + + if (isset($units[$unit])) { + return $this->isSameAs($units[$unit], $date); + } + + if (isset($this->$unit)) { + return $this->resolveCarbon($date)->$unit === $this->$unit; + } + + if ($this->isLocalStrictModeEnabled()) { + throw new BadComparisonUnitException($unit); + } + + return false; + } + + /** + * Determines if the instance is in the current unit given. + * + * @example + * ``` + * Carbon::now()->isCurrentUnit('hour'); // true + * Carbon::now()->subHours(2)->isCurrentUnit('hour'); // false + * ``` + * + * @param string $unit The unit to test. + * + * @throws BadMethodCallException + */ + public function isCurrentUnit(string $unit): bool + { + return $this->{'isSame'.ucfirst($unit)}('now'); + } + + /** + * Checks if the passed in date is in the same quarter as the instance quarter (and year if needed). + * + * @example + * ``` + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-03-01')); // true + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2019-04-01')); // false + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01')); // false + * Carbon::parse('2019-01-12')->isSameQuarter(Carbon::parse('2018-03-01'), false); // true + * ``` + * + * @param DateTimeInterface|string $date The instance to compare with or null to use current day. + * @param bool $ofSameYear Check if it is the same month in the same year. + * + * @return bool + */ + public function isSameQuarter(DateTimeInterface|string $date, bool $ofSameYear = true): bool + { + $date = $this->resolveCarbon($date); + + return $this->quarter === $date->quarter && (!$ofSameYear || $this->isSameYear($date)); + } + + /** + * Checks if the passed in date is in the same month as the instance´s month. + * + * @example + * ``` + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-01-01')); // true + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2019-02-01')); // false + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01')); // false + * Carbon::parse('2019-01-12')->isSameMonth(Carbon::parse('2018-01-01'), false); // true + * ``` + * + * @param DateTimeInterface|string $date The instance to compare with or null to use the current date. + * @param bool $ofSameYear Check if it is the same month in the same year. + * + * @return bool + */ + public function isSameMonth(DateTimeInterface|string $date, bool $ofSameYear = true): bool + { + return $this->isSameAs($ofSameYear ? 'Y-m' : 'm', $date); + } + + /** + * Checks if this day is a specific day of the week. + * + * @example + * ``` + * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::WEDNESDAY); // true + * Carbon::parse('2019-07-17')->isDayOfWeek(Carbon::FRIDAY); // false + * Carbon::parse('2019-07-17')->isDayOfWeek('Wednesday'); // true + * Carbon::parse('2019-07-17')->isDayOfWeek('Friday'); // false + * ``` + * + * @param int|string $dayOfWeek + * + * @return bool + */ + public function isDayOfWeek($dayOfWeek): bool + { + if (\is_string($dayOfWeek) && \defined($constant = static::class.'::'.strtoupper($dayOfWeek))) { + $dayOfWeek = \constant($constant); + } + + return $this->dayOfWeek === $dayOfWeek; + } + + /** + * Check if its the birthday. Compares the date/month values of the two dates. + * + * @example + * ``` + * Carbon::now()->subYears(5)->isBirthday(); // true + * Carbon::now()->subYears(5)->subDay()->isBirthday(); // false + * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-05')); // true + * Carbon::parse('2019-06-05')->isBirthday(Carbon::parse('2001-06-06')); // false + * ``` + * + * @param DateTimeInterface|string|null $date The instance to compare with or null to use current day. + * + * @return bool + */ + public function isBirthday(DateTimeInterface|string|null $date = null): bool + { + return $this->isSameAs('md', $date ?? 'now'); + } + + /** + * Check if today is the last day of the Month + * + * @example + * ``` + * Carbon::parse('2019-02-28')->isLastOfMonth(); // true + * Carbon::parse('2019-03-28')->isLastOfMonth(); // false + * Carbon::parse('2019-03-30')->isLastOfMonth(); // false + * Carbon::parse('2019-03-31')->isLastOfMonth(); // true + * Carbon::parse('2019-04-30')->isLastOfMonth(); // true + * ``` + */ + public function isLastOfMonth(): bool + { + return $this->day === $this->daysInMonth; + } + + /** + * Check if the instance is start of a given unit (tolerating a given interval). + * + * @example + * ``` + * // Check if a date-time is the first 15 minutes of the hour it's in + * Carbon::parse('2019-02-28 20:13:00')->isStartOfUnit(Unit::Hour, '15 minutes'); // true + * ``` + */ + public function isStartOfUnit( + Unit $unit, + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + mixed ...$params, + ): bool { + $interval ??= match ($unit) { + Unit::Day, Unit::Hour, Unit::Minute, Unit::Second, Unit::Millisecond, Unit::Microsecond => Unit::Microsecond, + default => Unit::Day, + }; + + $startOfUnit = $this->avoidMutation()->startOf($unit, ...$params); + $startOfUnitDateTime = $startOfUnit->rawFormat('Y-m-d H:i:s.u'); + $maximumDateTime = $startOfUnit + ->add($interval instanceof Unit ? '1 '.$interval->value : $interval) + ->rawFormat('Y-m-d H:i:s.u'); + + if ($maximumDateTime < $startOfUnitDateTime) { + return false; + } + + return $this->rawFormat('Y-m-d H:i:s.u') < $maximumDateTime; + } + + /** + * Check if the instance is end of a given unit (tolerating a given interval). + * + * @example + * ``` + * // Check if a date-time is the last 15 minutes of the hour it's in + * Carbon::parse('2019-02-28 20:13:00')->isEndOfUnit(Unit::Hour, '15 minutes'); // false + * ``` + */ + public function isEndOfUnit( + Unit $unit, + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + mixed ...$params, + ): bool { + $interval ??= match ($unit) { + Unit::Day, Unit::Hour, Unit::Minute, Unit::Second, Unit::Millisecond, Unit::Microsecond => Unit::Microsecond, + default => Unit::Day, + }; + + $endOfUnit = $this->avoidMutation()->endOf($unit, ...$params); + $endOfUnitDateTime = $endOfUnit->rawFormat('Y-m-d H:i:s.u'); + $minimumDateTime = $endOfUnit + ->sub($interval instanceof Unit ? '1 '.$interval->value : $interval) + ->rawFormat('Y-m-d H:i:s.u'); + + if ($minimumDateTime > $endOfUnitDateTime) { + return false; + } + + return $this->rawFormat('Y-m-d H:i:s.u') > $minimumDateTime; + } + + /** + * Determines if the instance is start of millisecond (first microsecond by default but interval can be customized). + */ + public function isStartOfMillisecond( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Millisecond, $interval); + } + + /** + * Determines if the instance is end of millisecond (last microsecond by default but interval can be customized). + */ + public function isEndOfMillisecond( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Millisecond, $interval); + } + + /** + * Determines if the instance is start of second (first microsecond by default but interval can be customized). + */ + public function isStartOfSecond( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Second, $interval); + } + + /** + * Determines if the instance is end of second (last microsecond by default but interval can be customized). + */ + public function isEndOfSecond( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Second, $interval); + } + + /** + * Determines if the instance is start of minute (first microsecond by default but interval can be customized). + */ + public function isStartOfMinute( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Minute, $interval); + } + + /** + * Determines if the instance is end of minute (last microsecond by default but interval can be customized). + */ + public function isEndOfMinute( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Minute, $interval); + } + + /** + * Determines if the instance is start of hour (first microsecond by default but interval can be customized). + */ + public function isStartOfHour( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Hour, $interval); + } + + /** + * Determines if the instance is end of hour (last microsecond by default but interval can be customized). + */ + public function isEndOfHour( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Hour, $interval); + } + + /** + * Check if the instance is start of day / midnight. + * + * @example + * ``` + * Carbon::parse('2019-02-28 00:00:00')->isStartOfDay(); // true + * Carbon::parse('2019-02-28 00:00:00.999999')->isStartOfDay(); // true + * Carbon::parse('2019-02-28 00:00:01')->isStartOfDay(); // false + * Carbon::parse('2019-02-28 00:00:00.000000')->isStartOfDay(true); // true + * Carbon::parse('2019-02-28 00:00:00.000012')->isStartOfDay(true); // false + * ``` + * + * @param bool $checkMicroseconds check time at microseconds precision + * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision + * for instance with "15 minutes", it checks if current date-time + * is in the last 15 minutes of the day, with Unit::Hour, it + * checks if it's in the last hour of the day. + */ + public function isStartOfDay( + Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + if ($checkMicroseconds === true) { + @trigger_error( + "Since 3.8.0, it's deprecated to use \$checkMicroseconds.\n". + "It will be removed in 4.0.0.\n". + "Instead, you should use either isStartOfDay(interval: Unit::Microsecond) or isStartOfDay(interval: Unit::Second)\n". + 'And you can now use any custom interval as precision, such as isStartOfDay(interval: "15 minutes")', + \E_USER_DEPRECATED, + ); + } + + if ($interval === null && !\is_bool($checkMicroseconds)) { + $interval = $checkMicroseconds; + } + + if ($interval !== null) { + if ($interval instanceof Unit) { + $interval = '1 '.$interval->value; + } + + $date = $this->rawFormat('Y-m-d'); + $time = $this->rawFormat('H:i:s.u'); + $maximum = $this->avoidMutation()->startOfDay()->add($interval); + $maximumDate = $maximum->rawFormat('Y-m-d'); + + if ($date === $maximumDate) { + return $time < $maximum->rawFormat('H:i:s.u'); + } + + return $maximumDate > $date; + } + + /* @var CarbonInterface $this */ + return $checkMicroseconds + ? $this->rawFormat('H:i:s.u') === '00:00:00.000000' + : $this->rawFormat('H:i:s') === '00:00:00'; + } + + /** + * Check if the instance is end of day. + * + * @example + * ``` + * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(); // true + * Carbon::parse('2019-02-28 23:59:58.999999')->isEndOfDay(); // false + * Carbon::parse('2019-02-28 23:59:59.999999')->isEndOfDay(true); // true + * Carbon::parse('2019-02-28 23:59:59.123456')->isEndOfDay(true); // false + * Carbon::parse('2019-02-28 23:59:59')->isEndOfDay(true); // false + * ``` + * + * @param bool $checkMicroseconds check time at microseconds precision + * @param Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval if an interval is specified it will be used as precision + * for instance with "15 minutes", it checks if current date-time + * is in the last 15 minutes of the day, with Unit::Hour, it + * checks if it's in the last hour of the day. + */ + public function isEndOfDay( + Unit|DateInterval|Closure|CarbonConverterInterface|string|bool $checkMicroseconds = false, + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + if ($checkMicroseconds === true) { + @trigger_error( + "Since 3.8.0, it's deprecated to use \$checkMicroseconds.\n". + "It will be removed in 4.0.0.\n". + "Instead, you should use either isEndOfDay(interval: Unit::Microsecond) or isEndOfDay(interval: Unit::Second)\n". + 'And you can now use any custom interval as precision, such as isEndOfDay(interval: "15 minutes")', + \E_USER_DEPRECATED, + ); + } + + if ($interval === null && !\is_bool($checkMicroseconds)) { + $interval = $checkMicroseconds; + } + + if ($interval !== null) { + $date = $this->rawFormat('Y-m-d'); + $time = $this->rawFormat('H:i:s.u'); + $minimum = $this->avoidMutation() + ->endOfDay() + ->sub($interval instanceof Unit ? '1 '.$interval->value : $interval); + $minimumDate = $minimum->rawFormat('Y-m-d'); + + if ($date === $minimumDate) { + return $time > $minimum->rawFormat('H:i:s.u'); + } + + return $minimumDate < $date; + } + + /* @var CarbonInterface $this */ + return $checkMicroseconds + ? $this->rawFormat('H:i:s.u') === '23:59:59.999999' + : $this->rawFormat('H:i:s') === '23:59:59'; + } + + /** + * Determines if the instance is start of week (first day by default but interval can be customized). + * + * @example + * ``` + * Carbon::parse('2024-08-31')->startOfWeek()->isStartOfWeek(); // true + * Carbon::parse('2024-08-31')->isStartOfWeek(); // false + * ``` + */ + public function isStartOfWeek( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + WeekDay|int|null $weekStartsAt = null, + ): bool { + return $this->isStartOfUnit(Unit::Week, $interval, $weekStartsAt); + } + + /** + * Determines if the instance is end of week (last day by default but interval can be customized). + * + * @example + * ``` + * Carbon::parse('2024-08-31')->endOfWeek()->isEndOfWeek(); // true + * Carbon::parse('2024-08-31')->isEndOfWeek(); // false + * ``` + */ + public function isEndOfWeek( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + WeekDay|int|null $weekEndsAt = null, + ): bool { + return $this->isEndOfUnit(Unit::Week, $interval, $weekEndsAt); + } + + /** + * Determines if the instance is start of month (first day by default but interval can be customized). + */ + public function isStartOfMonth( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Month, $interval); + } + + /** + * Determines if the instance is end of month (last day by default but interval can be customized). + */ + public function isEndOfMonth( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Month, $interval); + } + + /** + * Determines if the instance is start of quarter (first day by default but interval can be customized). + */ + public function isStartOfQuarter( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Quarter, $interval); + } + + /** + * Determines if the instance is end of quarter (last day by default but interval can be customized). + */ + public function isEndOfQuarter( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Quarter, $interval); + } + + /** + * Determines if the instance is start of year (first day by default but interval can be customized). + */ + public function isStartOfYear( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Year, $interval); + } + + /** + * Determines if the instance is end of year (last day by default but interval can be customized). + */ + public function isEndOfYear( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Year, $interval); + } + + /** + * Determines if the instance is start of decade (first day by default but interval can be customized). + */ + public function isStartOfDecade( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Decade, $interval); + } + + /** + * Determines if the instance is end of decade (last day by default but interval can be customized). + */ + public function isEndOfDecade( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Decade, $interval); + } + + /** + * Determines if the instance is start of century (first day by default but interval can be customized). + */ + public function isStartOfCentury( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Century, $interval); + } + + /** + * Determines if the instance is end of century (last day by default but interval can be customized). + */ + public function isEndOfCentury( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Century, $interval); + } + + /** + * Determines if the instance is start of millennium (first day by default but interval can be customized). + */ + public function isStartOfMillennium( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isStartOfUnit(Unit::Millennium, $interval); + } + + /** + * Determines if the instance is end of millennium (last day by default but interval can be customized). + */ + public function isEndOfMillennium( + Unit|DateInterval|Closure|CarbonConverterInterface|string|null $interval = null, + ): bool { + return $this->isEndOfUnit(Unit::Millennium, $interval); + } + + /** + * Check if the instance is start of day / midnight. + * + * @example + * ``` + * Carbon::parse('2019-02-28 00:00:00')->isMidnight(); // true + * Carbon::parse('2019-02-28 00:00:00.999999')->isMidnight(); // true + * Carbon::parse('2019-02-28 00:00:01')->isMidnight(); // false + * ``` + */ + public function isMidnight(): bool + { + return $this->isStartOfDay(); + } + + /** + * Check if the instance is midday. + * + * @example + * ``` + * Carbon::parse('2019-02-28 11:59:59.999999')->isMidday(); // false + * Carbon::parse('2019-02-28 12:00:00')->isMidday(); // true + * Carbon::parse('2019-02-28 12:00:00.999999')->isMidday(); // true + * Carbon::parse('2019-02-28 12:00:01')->isMidday(); // false + * ``` + */ + public function isMidday(): bool + { + /* @var CarbonInterface $this */ + return $this->rawFormat('G:i:s') === static::$midDayAt.':00:00'; + } + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormat('11:12:45', 'h:i:s'); // true + * Carbon::hasFormat('13:12:45', 'h:i:s'); // false + * ``` + */ + public static function hasFormat(string $date, string $format): bool + { + return FactoryImmutable::getInstance()->hasFormat($date, $format); + } + + /** + * Checks if the (date)time string is in a given format. + * + * @example + * ``` + * Carbon::hasFormatWithModifiers('31/08/2015', 'd#m#Y'); // true + * Carbon::hasFormatWithModifiers('31/08/2015', 'm#d#Y'); // false + * ``` + * + * @param string $date + * @param string $format + * + * @return bool + */ + public static function hasFormatWithModifiers(?string $date, string $format): bool + { + return FactoryImmutable::getInstance()->hasFormatWithModifiers($date, $format); + } + + /** + * Checks if the (date)time string is in a given format and valid to create a + * new instance. + * + * @example + * ``` + * Carbon::canBeCreatedFromFormat('11:12:45', 'h:i:s'); // true + * Carbon::canBeCreatedFromFormat('13:12:45', 'h:i:s'); // false + * ``` + */ + public static function canBeCreatedFromFormat(?string $date, string $format): bool + { + if ($date === null) { + return false; + } + + try { + // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string + // doesn't match the format in any way. + if (!static::rawCreateFromFormat($format, $date)) { + return false; + } + } catch (InvalidArgumentException) { + return false; + } + + return static::hasFormatWithModifiers($date, $format); + } + + /** + * Returns true if the current date matches the given string. + * + * @example + * ``` + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2018')); // false + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('06-02')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('2019-06-02')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('Sunday')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('June')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:45')); // true + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12:23:00')); // false + * var_dump(Carbon::parse('2019-06-02 12:23:45')->is('12h')); // true + * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3pm')); // true + * var_dump(Carbon::parse('2019-06-02 15:23:45')->is('3am')); // false + * ``` + * + * @param string $tester day name, month name, hour, date, etc. as string + */ + public function is(WeekDay|Month|string $tester): bool + { + if ($tester instanceof BackedEnum) { + $tester = $tester->name; + } + + $tester = trim($tester); + + if (preg_match('/^\d+$/', $tester)) { + return $this->year === (int) $tester; + } + + if (preg_match('/^(?:Jan|January|Feb|February|Mar|March|Apr|April|May|Jun|June|Jul|July|Aug|August|Sep|September|Oct|October|Nov|November|Dec|December)$/i', $tester)) { + return $this->isSameMonth( + $this->transmitFactory(static fn () => static::parse("$tester 1st")), + false, + ); + } + + if (preg_match('/^\d{3,}-\d{1,2}$/', $tester)) { + return $this->isSameMonth( + $this->transmitFactory(static fn () => static::parse($tester)), + ); + } + + if (preg_match('/^(\d{1,2})-(\d{1,2})$/', $tester, $match)) { + return $this->month === (int) $match[1] && $this->day === (int) $match[2]; + } + + $modifier = preg_replace('/(\d)h$/i', '$1:00', $tester); + + /* @var CarbonInterface $max */ + $median = $this->transmitFactory(static fn () => static::parse('5555-06-15 12:30:30.555555')) + ->modify($modifier); + $current = $this->avoidMutation(); + /* @var CarbonInterface $other */ + $other = $this->avoidMutation()->modify($modifier); + + if ($current->eq($other)) { + return true; + } + + if (preg_match('/\d:\d{1,2}:\d{1,2}$/', $tester)) { + return $current->startOfSecond()->eq($other); + } + + if (preg_match('/\d:\d{1,2}$/', $tester)) { + return $current->startOfMinute()->eq($other); + } + + if (preg_match('/\d(?:h|am|pm)$/', $tester)) { + return $current->startOfHour()->eq($other); + } + + if (preg_match( + '/^(?:january|february|march|april|may|june|july|august|september|october|november|december)(?:\s+\d+)?$/i', + $tester, + )) { + return $current->startOfMonth()->eq($other->startOfMonth()); + } + + $units = [ + 'month' => [1, 'year'], + 'day' => [1, 'month'], + 'hour' => [0, 'day'], + 'minute' => [0, 'hour'], + 'second' => [0, 'minute'], + 'microsecond' => [0, 'second'], + ]; + + foreach ($units as $unit => [$minimum, $startUnit]) { + if ($minimum === $median->$unit) { + $current = $current->startOf($startUnit); + + break; + } + } + + return $current->eq($other); + } + + /** + * Returns true if the date was created using CarbonImmutable::startOfTime() + * + * @return bool + */ + public function isStartOfTime(): bool + { + return $this->startOfTime ?? false; + } + + /** + * Returns true if the date was created using CarbonImmutable::endOfTime() + * + * @return bool + */ + public function isEndOfTime(): bool + { + return $this->endOfTime ?? false; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php new file mode 100644 index 00000000..764c5d4f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Converter.php @@ -0,0 +1,556 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Carbon; +use Carbon\CarbonImmutable; +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; +use Carbon\CarbonPeriod; +use Carbon\CarbonPeriodImmutable; +use Carbon\Exceptions\UnitException; +use Closure; +use DateTime; +use DateTimeImmutable; +use DateTimeInterface; + +/** + * Trait Converter. + * + * Change date into different string formats and types and + * handle the string cast. + * + * Depends on the following methods: + * + * @method static copy() + */ +trait Converter +{ + use ToStringFormat; + + /** + * Returns the formatted date string on success or FALSE on failure. + * + * @see https://php.net/manual/en/datetime.format.php + */ + public function format(string $format): string + { + $function = $this->localFormatFunction + ?? $this->getFactory()->getSettings()['formatFunction'] + ?? static::$formatFunction; + + if (!$function) { + return $this->rawFormat($format); + } + + if (\is_string($function) && method_exists($this, $function)) { + $function = [$this, $function]; + } + + return $function(...\func_get_args()); + } + + /** + * @see https://php.net/manual/en/datetime.format.php + */ + public function rawFormat(string $format): string + { + return parent::format($format); + } + + /** + * Format the instance as a string using the set format + * + * @example + * ``` + * echo Carbon::now(); // Carbon instances can be cast to string + * ``` + */ + public function __toString(): string + { + $format = $this->localToStringFormat + ?? $this->getFactory()->getSettings()['toStringFormat'] + ?? null; + + return $format instanceof Closure + ? $format($this) + : $this->rawFormat($format ?: ( + \defined('static::DEFAULT_TO_STRING_FORMAT') + ? static::DEFAULT_TO_STRING_FORMAT + : CarbonInterface::DEFAULT_TO_STRING_FORMAT + )); + } + + /** + * Format the instance as date + * + * @example + * ``` + * echo Carbon::now()->toDateString(); + * ``` + */ + public function toDateString(): string + { + return $this->rawFormat('Y-m-d'); + } + + /** + * Format the instance as a readable date + * + * @example + * ``` + * echo Carbon::now()->toFormattedDateString(); + * ``` + */ + public function toFormattedDateString(): string + { + return $this->rawFormat('M j, Y'); + } + + /** + * Format the instance with the day, and a readable date + * + * @example + * ``` + * echo Carbon::now()->toFormattedDayDateString(); + * ``` + */ + public function toFormattedDayDateString(): string + { + return $this->rawFormat('D, M j, Y'); + } + + /** + * Format the instance as time + * + * @example + * ``` + * echo Carbon::now()->toTimeString(); + * ``` + */ + public function toTimeString(string $unitPrecision = 'second'): string + { + return $this->rawFormat(static::getTimeFormatByPrecision($unitPrecision)); + } + + /** + * Format the instance as date and time + * + * @example + * ``` + * echo Carbon::now()->toDateTimeString(); + * ``` + */ + public function toDateTimeString(string $unitPrecision = 'second'): string + { + return $this->rawFormat('Y-m-d '.static::getTimeFormatByPrecision($unitPrecision)); + } + + /** + * Return a format from H:i to H:i:s.u according to given unit precision. + * + * @param string $unitPrecision "minute", "second", "millisecond" or "microsecond" + */ + public static function getTimeFormatByPrecision(string $unitPrecision): string + { + return match (static::singularUnit($unitPrecision)) { + 'minute' => 'H:i', + 'second' => 'H:i:s', + 'm', 'millisecond' => 'H:i:s.v', + 'µ', 'microsecond' => 'H:i:s.u', + default => throw new UnitException('Precision unit expected among: minute, second, millisecond and microsecond.'), + }; + } + + /** + * Format the instance as date and time T-separated with no timezone + * + * @example + * ``` + * echo Carbon::now()->toDateTimeLocalString(); + * echo "\n"; + * echo Carbon::now()->toDateTimeLocalString('minute'); // You can specify precision among: minute, second, millisecond and microsecond + * ``` + */ + public function toDateTimeLocalString(string $unitPrecision = 'second'): string + { + return $this->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision)); + } + + /** + * Format the instance with day, date and time + * + * @example + * ``` + * echo Carbon::now()->toDayDateTimeString(); + * ``` + */ + public function toDayDateTimeString(): string + { + return $this->rawFormat('D, M j, Y g:i A'); + } + + /** + * Format the instance as ATOM + * + * @example + * ``` + * echo Carbon::now()->toAtomString(); + * ``` + */ + public function toAtomString(): string + { + return $this->rawFormat(DateTime::ATOM); + } + + /** + * Format the instance as COOKIE + * + * @example + * ``` + * echo Carbon::now()->toCookieString(); + * ``` + */ + public function toCookieString(): string + { + return $this->rawFormat(DateTimeInterface::COOKIE); + } + + /** + * Format the instance as ISO8601 + * + * @example + * ``` + * echo Carbon::now()->toIso8601String(); + * ``` + */ + public function toIso8601String(): string + { + return $this->toAtomString(); + } + + /** + * Format the instance as RFC822 + * + * @example + * ``` + * echo Carbon::now()->toRfc822String(); + * ``` + */ + public function toRfc822String(): string + { + return $this->rawFormat(DateTimeInterface::RFC822); + } + + /** + * Convert the instance to UTC and return as Zulu ISO8601 + * + * @example + * ``` + * echo Carbon::now()->toIso8601ZuluString(); + * ``` + */ + public function toIso8601ZuluString(string $unitPrecision = 'second'): string + { + return $this->avoidMutation() + ->utc() + ->rawFormat('Y-m-d\T'.static::getTimeFormatByPrecision($unitPrecision).'\Z'); + } + + /** + * Format the instance as RFC850 + * + * @example + * ``` + * echo Carbon::now()->toRfc850String(); + * ``` + */ + public function toRfc850String(): string + { + return $this->rawFormat(DateTimeInterface::RFC850); + } + + /** + * Format the instance as RFC1036 + * + * @example + * ``` + * echo Carbon::now()->toRfc1036String(); + * ``` + */ + public function toRfc1036String(): string + { + return $this->rawFormat(DateTimeInterface::RFC1036); + } + + /** + * Format the instance as RFC1123 + * + * @example + * ``` + * echo Carbon::now()->toRfc1123String(); + * ``` + */ + public function toRfc1123String(): string + { + return $this->rawFormat(DateTimeInterface::RFC1123); + } + + /** + * Format the instance as RFC2822 + * + * @example + * ``` + * echo Carbon::now()->toRfc2822String(); + * ``` + */ + public function toRfc2822String(): string + { + return $this->rawFormat(DateTimeInterface::RFC2822); + } + + /** + * Format the instance as RFC3339. + * + * @example + * ``` + * echo Carbon::now()->toRfc3339String() . "\n"; + * echo Carbon::now()->toRfc3339String(true) . "\n"; + * ``` + */ + public function toRfc3339String(bool $extended = false): string + { + return $this->rawFormat($extended ? DateTimeInterface::RFC3339_EXTENDED : DateTimeInterface::RFC3339); + } + + /** + * Format the instance as RSS + * + * @example + * ``` + * echo Carbon::now()->toRssString(); + * ``` + */ + public function toRssString(): string + { + return $this->rawFormat(DateTimeInterface::RSS); + } + + /** + * Format the instance as W3C + * + * @example + * ``` + * echo Carbon::now()->toW3cString(); + * ``` + */ + public function toW3cString(): string + { + return $this->rawFormat(DateTimeInterface::W3C); + } + + /** + * Format the instance as RFC7231 + * + * @example + * ``` + * echo Carbon::now()->toRfc7231String(); + * ``` + */ + public function toRfc7231String(): string + { + return $this->avoidMutation() + ->setTimezone('GMT') + ->rawFormat(\defined('static::RFC7231_FORMAT') ? static::RFC7231_FORMAT : CarbonInterface::RFC7231_FORMAT); + } + + /** + * Get default array representation. + * + * @example + * ``` + * var_dump(Carbon::now()->toArray()); + * ``` + */ + public function toArray(): array + { + return [ + 'year' => $this->year, + 'month' => $this->month, + 'day' => $this->day, + 'dayOfWeek' => $this->dayOfWeek, + 'dayOfYear' => $this->dayOfYear, + 'hour' => $this->hour, + 'minute' => $this->minute, + 'second' => $this->second, + 'micro' => $this->micro, + 'timestamp' => $this->timestamp, + 'formatted' => $this->rawFormat(\defined('static::DEFAULT_TO_STRING_FORMAT') ? static::DEFAULT_TO_STRING_FORMAT : CarbonInterface::DEFAULT_TO_STRING_FORMAT), + 'timezone' => $this->timezone, + ]; + } + + /** + * Get default object representation. + * + * @example + * ``` + * var_dump(Carbon::now()->toObject()); + * ``` + */ + public function toObject(): object + { + return (object) $this->toArray(); + } + + /** + * Returns english human-readable complete date string. + * + * @example + * ``` + * echo Carbon::now()->toString(); + * ``` + */ + public function toString(): string + { + return $this->avoidMutation()->locale('en')->isoFormat('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + /** + * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z, if $keepOffset truthy, offset will be kept: + * 1977-04-22T01:00:00-05:00). + * + * @example + * ``` + * echo Carbon::now('America/Toronto')->toISOString() . "\n"; + * echo Carbon::now('America/Toronto')->toISOString(true) . "\n"; + * ``` + * + * @param bool $keepOffset Pass true to keep the date offset. Else forced to UTC. + */ + public function toISOString(bool $keepOffset = false): ?string + { + if (!$this->isValid()) { + return null; + } + + $yearFormat = $this->year < 0 || $this->year > 9999 ? 'YYYYYY' : 'YYYY'; + $timezoneFormat = $keepOffset ? 'Z' : '[Z]'; + $date = $keepOffset ? $this : $this->avoidMutation()->utc(); + + return $date->isoFormat("$yearFormat-MM-DD[T]HH:mm:ss.SSSSSS$timezoneFormat"); + } + + /** + * Return the ISO-8601 string (ex: 1977-04-22T06:00:00Z) with UTC timezone. + * + * @example + * ``` + * echo Carbon::now('America/Toronto')->toJSON(); + * ``` + */ + public function toJSON(): ?string + { + return $this->toISOString(); + } + + /** + * Return native DateTime PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDateTime()); + * ``` + */ + public function toDateTime(): DateTime + { + return DateTime::createFromFormat('U.u', $this->rawFormat('U.u')) + ->setTimezone($this->getTimezone()); + } + + /** + * Return native toDateTimeImmutable PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDateTimeImmutable()); + * ``` + */ + public function toDateTimeImmutable(): DateTimeImmutable + { + return DateTimeImmutable::createFromFormat('U.u', $this->rawFormat('U.u')) + ->setTimezone($this->getTimezone()); + } + + /** + * @alias toDateTime + * + * Return native DateTime PHP object matching the current instance. + * + * @example + * ``` + * var_dump(Carbon::now()->toDate()); + * ``` + */ + public function toDate(): DateTime + { + return $this->toDateTime(); + } + + /** + * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). + * + * @param \DateTimeInterface|Carbon|CarbonImmutable|int|null $end period end date or recurrences count if int + * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit + * @param string|null $unit if specified, $interval must be an integer + */ + public function toPeriod($end = null, $interval = null, $unit = null): CarbonPeriod + { + if ($unit) { + $interval = CarbonInterval::make("$interval ".static::pluralUnit($unit)); + } + + $isDefaultInterval = !$interval; + $interval ??= CarbonInterval::day(); + $class = $this->isMutable() ? CarbonPeriod::class : CarbonPeriodImmutable::class; + + if (\is_int($end) || (\is_string($end) && ctype_digit($end))) { + $end = (int) $end; + } + + $end ??= 1; + + if (!\is_int($end)) { + $end = $this->resolveCarbon($end); + } + + return new $class( + raw: [$this, CarbonInterval::make($interval), $end], + dateClass: static::class, + isDefaultInterval: $isDefaultInterval, + ); + } + + /** + * Create a iterable CarbonPeriod object from current date to a given end date (and optional interval). + * + * @param \DateTimeInterface|Carbon|CarbonImmutable|null $end period end date + * @param int|\DateInterval|string|null $interval period default interval or number of the given $unit + * @param string|null $unit if specified, $interval must be an integer + */ + public function range($end = null, $interval = null, $unit = null): CarbonPeriod + { + return $this->toPeriod($end, $interval, $unit); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php new file mode 100644 index 00000000..9509e5ba --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php @@ -0,0 +1,938 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Carbon; +use Carbon\CarbonImmutable; +use Carbon\CarbonInterface; +use Carbon\Exceptions\InvalidDateException; +use Carbon\Exceptions\InvalidFormatException; +use Carbon\Exceptions\InvalidTimeZoneException; +use Carbon\Exceptions\OutOfRangeException; +use Carbon\Exceptions\UnitException; +use Carbon\Month; +use Carbon\Translator; +use Carbon\WeekDay; +use Closure; +use DateMalformedStringException; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use Exception; +use ReturnTypeWillChange; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Trait Creator. + * + * Static creators. + * + * Depends on the following methods: + * + * @method static Carbon|CarbonImmutable getTestNow() + */ +trait Creator +{ + use ObjectInitialisation; + use LocalFactory; + + /** + * The errors that can occur. + */ + protected static ?array $lastErrors = null; + + /** + * Create a new Carbon instance. + * + * Please see the testing aids section (specifically static::setTestNow()) + * for more on the possibility of this constructor returning a test instance. + * + * @throws InvalidFormatException + */ + public function __construct( + DateTimeInterface|WeekDay|Month|string|int|float|null $time = null, + DateTimeZone|string|int|null $timezone = null, + ) { + $this->initLocalFactory(); + + if ($time instanceof Month) { + $time = $time->name.' 1'; + } elseif ($time instanceof WeekDay) { + $time = $time->name; + } elseif ($time instanceof DateTimeInterface) { + $time = $this->constructTimezoneFromDateTime($time, $timezone)->format('Y-m-d H:i:s.u'); + } + + if (\is_string($time) && str_starts_with($time, '@')) { + $time = static::createFromTimestampUTC(substr($time, 1))->format('Y-m-d\TH:i:s.uP'); + } elseif (is_numeric($time) && (!\is_string($time) || !preg_match('/^\d{1,14}$/', $time))) { + $time = static::createFromTimestampUTC($time)->format('Y-m-d\TH:i:s.uP'); + } + + // If the class has a test now set, and we are trying to create a now() + // instance then override as required + $isNow = \in_array($time, [null, '', 'now'], true); + $timezone = static::safeCreateDateTimeZone($timezone) ?? null; + + if ( + ($this->clock || ( + method_exists(static::class, 'hasTestNow') && + method_exists(static::class, 'getTestNow') && + static::hasTestNow() + )) && + ($isNow || static::hasRelativeKeywords($time)) + ) { + $this->mockConstructorParameters($time, $timezone); + } + + try { + parent::__construct($time ?? 'now', $timezone); + } catch (Exception $exception) { + throw new InvalidFormatException($exception->getMessage(), 0, $exception); + } + + $this->constructedObjectId = spl_object_hash($this); + + self::setLastErrors(parent::getLastErrors()); + } + + /** + * Get timezone from a datetime instance. + */ + private function constructTimezoneFromDateTime( + DateTimeInterface $date, + DateTimeZone|string|int|null &$timezone, + ): DateTimeInterface { + if ($timezone !== null) { + $safeTz = static::safeCreateDateTimeZone($timezone); + + if ($safeTz) { + $date = ($date instanceof DateTimeImmutable ? $date : clone $date)->setTimezone($safeTz); + } + + return $date; + } + + $timezone = $date->getTimezone(); + + return $date; + } + + /** + * Update constructedObjectId on cloned. + */ + public function __clone(): void + { + $this->constructedObjectId = spl_object_hash($this); + } + + /** + * Create a Carbon instance from a DateTime one. + */ + public static function instance(DateTimeInterface $date): static + { + if ($date instanceof static) { + return clone $date; + } + + $instance = parent::createFromFormat('U.u', $date->format('U.u')) + ->setTimezone($date->getTimezone()); + + if ($date instanceof CarbonInterface) { + $settings = $date->getSettings(); + + if (!$date->hasLocalTranslator()) { + unset($settings['locale']); + } + + $instance->settings($settings); + } + + return $instance; + } + + /** + * Create a carbon instance from a string. + * + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * + * @throws InvalidFormatException + */ + public static function rawParse( + DateTimeInterface|WeekDay|Month|string|int|float|null $time, + DateTimeZone|string|int|null $timezone = null, + ): static { + if ($time instanceof DateTimeInterface) { + return static::instance($time); + } + + try { + return new static($time, $timezone); + } catch (Exception $exception) { + // @codeCoverageIgnoreStart + try { + $date = @static::now($timezone)->change($time); + } catch (DateMalformedStringException|InvalidFormatException) { + $date = null; + } + // @codeCoverageIgnoreEnd + + return $date + ?? throw new InvalidFormatException("Could not parse '$time': ".$exception->getMessage(), 0, $exception); + } + } + + /** + * Create a carbon instance from a string. + * + * This is an alias for the constructor that allows better fluent syntax + * as it allows you to do Carbon::parse('Monday next week')->fn() rather + * than (new Carbon('Monday next week'))->fn(). + * + * @throws InvalidFormatException + */ + public static function parse( + DateTimeInterface|WeekDay|Month|string|int|float|null $time, + DateTimeZone|string|int|null $timezone = null, + ): static { + $function = static::$parseFunction; + + if (!$function) { + return static::rawParse($time, $timezone); + } + + if (\is_string($function) && method_exists(static::class, $function)) { + $function = [static::class, $function]; + } + + return $function(...\func_get_args()); + } + + /** + * Create a carbon instance from a localized string (in French, Japanese, Arabic, etc.). + * + * @param string $time date/time string in the given language (may also contain English). + * @param string|null $locale if locale is null or not specified, current global locale will be + * used instead. + * @param DateTimeZone|string|int|null $timezone optional timezone for the new instance. + * + * @throws InvalidFormatException + */ + public static function parseFromLocale( + string $time, + ?string $locale = null, + DateTimeZone|string|int|null $timezone = null, + ): static { + return static::rawParse(static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone); + } + + /** + * Get a Carbon instance for the current date and time. + */ + public static function now(DateTimeZone|string|int|null $timezone = null): static + { + return new static(null, $timezone); + } + + /** + * Create a Carbon instance for today. + */ + public static function today(DateTimeZone|string|int|null $timezone = null): static + { + return static::rawParse('today', $timezone); + } + + /** + * Create a Carbon instance for tomorrow. + */ + public static function tomorrow(DateTimeZone|string|int|null $timezone = null): static + { + return static::rawParse('tomorrow', $timezone); + } + + /** + * Create a Carbon instance for yesterday. + */ + public static function yesterday(DateTimeZone|string|int|null $timezone = null): static + { + return static::rawParse('yesterday', $timezone); + } + + private static function assertBetween($unit, $value, $min, $max): void + { + if (static::isStrictModeEnabled() && ($value < $min || $value > $max)) { + throw new OutOfRangeException($unit, $min, $max, $value); + } + } + + private static function createNowInstance($timezone) + { + if (!static::hasTestNow()) { + return static::now($timezone); + } + + $now = static::getTestNow(); + + if ($now instanceof Closure) { + return $now(static::now($timezone)); + } + + $now = $now->avoidMutation(); + + return $timezone === null ? $now : $now->setTimezone($timezone); + } + + /** + * Create a new Carbon instance from a specific date and time. + * + * If any of $year, $month or $day are set to null their now() values will + * be used. + * + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * + * If $hour is not null then the default values for $minute and $second + * will be 0. + * + * @param DateTimeInterface|string|int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function create($year = 0, $month = 1, $day = 1, $hour = 0, $minute = 0, $second = 0, $timezone = null): ?static + { + $month = self::monthToInt($month); + + if ((\is_string($year) && !is_numeric($year)) || $year instanceof DateTimeInterface) { + return static::parse($year, $timezone ?? (\is_string($month) || $month instanceof DateTimeZone ? $month : null)); + } + + $defaults = null; + $getDefault = function ($unit) use ($timezone, &$defaults) { + if ($defaults === null) { + $now = self::createNowInstance($timezone); + + $defaults = array_combine([ + 'year', + 'month', + 'day', + 'hour', + 'minute', + 'second', + ], explode('-', $now->rawFormat('Y-n-j-G-i-s.u'))); + } + + return $defaults[$unit]; + }; + + $year = $year ?? $getDefault('year'); + $month = $month ?? $getDefault('month'); + $day = $day ?? $getDefault('day'); + $hour = $hour ?? $getDefault('hour'); + $minute = $minute ?? $getDefault('minute'); + $second = (float) ($second ?? $getDefault('second')); + + self::assertBetween('month', $month, 0, 99); + self::assertBetween('day', $day, 0, 99); + self::assertBetween('hour', $hour, 0, 99); + self::assertBetween('minute', $minute, 0, 99); + self::assertBetween('second', $second, 0, 99); + + $fixYear = null; + + if ($year < 0) { + $fixYear = $year; + $year = 0; + } elseif ($year > 9999) { + $fixYear = $year - 9999; + $year = 9999; + } + + $second = ($second < 10 ? '0' : '').number_format($second, 6); + $instance = static::rawCreateFromFormat('!Y-n-j G:i:s.u', \sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $timezone); + + if ($instance && $fixYear !== null) { + $instance = $instance->addYears($fixYear); + } + + return $instance ?? null; + } + + /** + * Create a new safe Carbon instance from a specific date and time. + * + * If any of $year, $month or $day are set to null their now() values will + * be used. + * + * If $hour is null it will be set to its now() value and the default + * values for $minute and $second will be their now() values. + * + * If $hour is not null then the default values for $minute and $second + * will be 0. + * + * If one of the set values is not valid, an InvalidDateException + * will be thrown. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidDateException + * + * @return static|null + */ + public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $timezone = null): ?static + { + $month = self::monthToInt($month); + $fields = static::getRangesByUnit(); + + foreach ($fields as $field => $range) { + if ($$field !== null && (!\is_int($$field) || $$field < $range[0] || $$field > $range[1])) { + if (static::isStrictModeEnabled()) { + throw new InvalidDateException($field, $$field); + } + + return null; + } + } + + $instance = static::create($year, $month, $day, $hour, $minute, $second, $timezone); + + foreach (array_reverse($fields) as $field => $range) { + if ($$field !== null && (!\is_int($$field) || $$field !== $instance->$field)) { + if (static::isStrictModeEnabled()) { + throw new InvalidDateException($field, $$field); + } + + return null; + } + } + + return $instance; + } + + /** + * Create a new Carbon instance from a specific date and time using strict validation. + * + * @see create() + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createStrict(?int $year = 0, ?int $month = 1, ?int $day = 1, ?int $hour = 0, ?int $minute = 0, ?int $second = 0, $timezone = null): static + { + $initialStrictMode = static::isStrictModeEnabled(); + static::useStrictMode(true); + + try { + $date = static::create($year, $month, $day, $hour, $minute, $second, $timezone); + } finally { + static::useStrictMode($initialStrictMode); + } + + return $date; + } + + /** + * Create a Carbon instance from just a date. The time portion is set to now. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createFromDate($year = null, $month = null, $day = null, $timezone = null) + { + return static::create($year, $month, $day, null, null, null, $timezone); + } + + /** + * Create a Carbon instance from just a date. The time portion is set to midnight. + * + * @param int|null $year + * @param int|null $month + * @param int|null $day + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createMidnightDate($year = null, $month = null, $day = null, $timezone = null) + { + return static::create($year, $month, $day, 0, 0, 0, $timezone); + } + + /** + * Create a Carbon instance from just a time. The date portion is set to today. + * + * @param int|null $hour + * @param int|null $minute + * @param int|null $second + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static + */ + public static function createFromTime($hour = 0, $minute = 0, $second = 0, $timezone = null): static + { + return static::create(null, null, null, $hour, $minute, $second, $timezone); + } + + /** + * Create a Carbon instance from a time string. The date portion is set to today. + * + * @throws InvalidFormatException + */ + public static function createFromTimeString(string $time, DateTimeZone|string|int|null $timezone = null): static + { + return static::today($timezone)->setTimeFromTimeString($time); + } + + private static function createFromFormatAndTimezone( + string $format, + string $time, + DateTimeZone|string|int|null $originalTimezone, + ): ?DateTimeInterface { + if ($originalTimezone === null) { + return parent::createFromFormat($format, $time) ?: null; + } + + $timezone = \is_int($originalTimezone) ? self::getOffsetTimezone($originalTimezone) : $originalTimezone; + + $timezone = static::safeCreateDateTimeZone($timezone, $originalTimezone); + + return parent::createFromFormat($format, $time, $timezone) ?: null; + } + + private static function getOffsetTimezone(int $offset): string + { + $minutes = (int) ($offset * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE); + + return @timezone_name_from_abbr('', $minutes, 1) ?: throw new InvalidTimeZoneException( + "Invalid offset timezone $offset", + ); + } + + /** + * Create a Carbon instance from a specific format. + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function rawCreateFromFormat(string $format, string $time, $timezone = null): ?static + { + // Work-around for https://bugs.php.net/bug.php?id=80141 + $format = preg_replace('/(?getTimezone(); + } + + $mock = $mock->copy(); + + // Prepend mock datetime only if the format does not contain non escaped unix epoch reset flag. + if (!preg_match("/{$nonEscaped}[!|]/", $format)) { + if (preg_match('/[HhGgisvuB]/', $format)) { + $mock = $mock->setTime(0, 0); + } + + $format = static::MOCK_DATETIME_FORMAT.' '.$format; + $time = ($mock instanceof self ? $mock->rawFormat(static::MOCK_DATETIME_FORMAT) : $mock->format(static::MOCK_DATETIME_FORMAT)).' '.$time; + } + + // Regenerate date from the modified format to base result on the mocked instance instead of now. + $date = self::createFromFormatAndTimezone($format, $time, $timezone); + } + + if ($date instanceof DateTimeInterface) { + $instance = static::instance($date); + $instance::setLastErrors($lastErrors); + + return $instance; + } + + if (static::isStrictModeEnabled()) { + throw new InvalidFormatException(implode(PHP_EOL, (array) $lastErrors['errors'])); + } + + return null; + } + + /** + * Create a Carbon instance from a specific format. + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + #[ReturnTypeWillChange] + public static function createFromFormat($format, $time, $timezone = null): ?static + { + $function = static::$createFromFormatFunction; + + // format is a single numeric unit + if (\is_int($time) && \in_array(ltrim($format, '!'), ['U', 'Y', 'y', 'X', 'x', 'm', 'n', 'd', 'j', 'w', 'W', 'H', 'h', 'G', 'g', 'i', 's', 'u', 'z', 'v'], true)) { + $time = (string) $time; + } + + if (!\is_string($time)) { + @trigger_error( + 'createFromFormat() $time parameter will only accept string or integer for 1-letter format representing a numeric unit in the next version', + \E_USER_DEPRECATED, + ); + $time = (string) $time; + } + + if (!$function) { + return static::rawCreateFromFormat($format, $time, $timezone); + } + + if (\is_string($function) && method_exists(static::class, $function)) { + $function = [static::class, $function]; + } + + return $function(...\func_get_args()); + } + + /** + * Create a Carbon instance from a specific ISO format (same replacements as ->isoFormat()). + * + * @param string $format Datetime format + * @param string $time + * @param DateTimeZone|string|int|null $timezone optional timezone + * @param string|null $locale locale to be used for LTS, LT, LL, LLL, etc. macro-formats (en by fault, unneeded if no such macro-format in use) + * @param TranslatorInterface|null $translator optional custom translator to use for macro-formats + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromIsoFormat( + string $format, + string $time, + $timezone = null, + ?string $locale = CarbonInterface::DEFAULT_LOCALE, + ?TranslatorInterface $translator = null + ): ?static { + $format = preg_replace_callback('/(? static::getTranslationMessageWith($translator, 'formats.LT', $locale), + 'LTS' => static::getTranslationMessageWith($translator, 'formats.LTS', $locale), + 'L' => static::getTranslationMessageWith($translator, 'formats.L', $locale), + 'LL' => static::getTranslationMessageWith($translator, 'formats.LL', $locale), + 'LLL' => static::getTranslationMessageWith($translator, 'formats.LLL', $locale), + 'LLLL' => static::getTranslationMessageWith($translator, 'formats.LLLL', $locale), + ]; + } + + return $formats[$code] ?? preg_replace_callback( + '/MMMM|MM|DD|dddd/', + static fn (array $code) => mb_substr($code[0], 1), + $formats[strtoupper($code)] ?? '', + ); + }, $format); + + $format = preg_replace_callback('/(? 'd', + 'OM' => 'M', + 'OY' => 'Y', + 'OH' => 'G', + 'Oh' => 'g', + 'Om' => 'i', + 'Os' => 's', + 'D' => 'd', + 'DD' => 'd', + 'Do' => 'd', + 'd' => '!', + 'dd' => '!', + 'ddd' => 'D', + 'dddd' => 'D', + 'DDD' => 'z', + 'DDDD' => 'z', + 'DDDo' => 'z', + 'e' => '!', + 'E' => '!', + 'H' => 'G', + 'HH' => 'H', + 'h' => 'g', + 'hh' => 'h', + 'k' => 'G', + 'kk' => 'G', + 'hmm' => 'gi', + 'hmmss' => 'gis', + 'Hmm' => 'Gi', + 'Hmmss' => 'Gis', + 'm' => 'i', + 'mm' => 'i', + 'a' => 'a', + 'A' => 'a', + 's' => 's', + 'ss' => 's', + 'S' => '*', + 'SS' => '*', + 'SSS' => '*', + 'SSSS' => '*', + 'SSSSS' => '*', + 'SSSSSS' => 'u', + 'SSSSSSS' => 'u*', + 'SSSSSSSS' => 'u*', + 'SSSSSSSSS' => 'u*', + 'M' => 'm', + 'MM' => 'm', + 'MMM' => 'M', + 'MMMM' => 'M', + 'Mo' => 'm', + 'Q' => '!', + 'Qo' => '!', + 'G' => '!', + 'GG' => '!', + 'GGG' => '!', + 'GGGG' => '!', + 'GGGGG' => '!', + 'g' => '!', + 'gg' => '!', + 'ggg' => '!', + 'gggg' => '!', + 'ggggg' => '!', + 'W' => '!', + 'WW' => '!', + 'Wo' => '!', + 'w' => '!', + 'ww' => '!', + 'wo' => '!', + 'x' => 'U???', + 'X' => 'U', + 'Y' => 'Y', + 'YY' => 'y', + 'YYYY' => 'Y', + 'YYYYY' => 'Y', + 'YYYYYY' => 'Y', + 'z' => 'e', + 'zz' => 'e', + 'Z' => 'e', + 'ZZ' => 'e', + ]; + } + + $format = $replacements[$code] ?? '?'; + + if ($format === '!') { + throw new InvalidFormatException("Format $code not supported for creation."); + } + + return $format; + }, $format); + + return static::rawCreateFromFormat($format, $time, $timezone); + } + + /** + * Create a Carbon instance from a specific format and a string in a given language. + * + * @param string $format Datetime format + * @param string $locale + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromLocaleFormat(string $format, string $locale, string $time, $timezone = null): ?static + { + $format = preg_replace_callback( + '/(?:\\\\[a-zA-Z]|[bfkqCEJKQRV]){2,}/', + static function (array $match) use ($locale): string { + $word = str_replace('\\', '', $match[0]); + $translatedWord = static::translateTimeString($word, $locale, static::DEFAULT_LOCALE); + + return $word === $translatedWord + ? $match[0] + : preg_replace('/[a-zA-Z]/', '\\\\$0', $translatedWord); + }, + $format + ); + + return static::rawCreateFromFormat($format, static::translateTimeString($time, $locale, static::DEFAULT_LOCALE), $timezone); + } + + /** + * Create a Carbon instance from a specific ISO format and a string in a given language. + * + * @param string $format Datetime ISO format + * @param string $locale + * @param string $time + * @param DateTimeZone|string|int|null $timezone + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function createFromLocaleIsoFormat(string $format, string $locale, string $time, $timezone = null): ?static + { + $time = static::translateTimeString($time, $locale, static::DEFAULT_LOCALE, CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS | CarbonInterface::TRANSLATE_MERIDIEM); + + return static::createFromIsoFormat($format, $time, $timezone, $locale); + } + + /** + * Make a Carbon instance from given variable if possible. + * + * Always return a new instance. Parse only strings and only these likely to be dates (skip intervals + * and recurrences). Throw an exception for invalid format, but otherwise return null. + * + * @param mixed $var + * + * @throws InvalidFormatException + * + * @return static|null + */ + public static function make($var, DateTimeZone|string|null $timezone = null): ?static + { + if ($var instanceof DateTimeInterface) { + return static::instance($var); + } + + $date = null; + + if (\is_string($var)) { + $var = trim($var); + + if (!preg_match('/^P[\dT]/', $var) && + !preg_match('/^R\d/', $var) && + preg_match('/[a-z\d]/i', $var) + ) { + $date = static::parse($var, $timezone); + } + } + + return $date; + } + + /** + * Set last errors. + * + * @param array|bool $lastErrors + * + * @return void + */ + private static function setLastErrors($lastErrors): void + { + if (\is_array($lastErrors) || $lastErrors === false) { + static::$lastErrors = \is_array($lastErrors) ? $lastErrors : [ + 'warning_count' => 0, + 'warnings' => [], + 'error_count' => 0, + 'errors' => [], + ]; + } + } + + /** + * {@inheritdoc} + */ + public static function getLastErrors(): array|false + { + return static::$lastErrors ?? false; + } + + private static function monthToInt(mixed $value, string $unit = 'month'): mixed + { + if ($value instanceof Month) { + if ($unit !== 'month') { + throw new UnitException("Month enum cannot be used to set $unit"); + } + + return Month::int($value); + } + + return $value; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Date.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Date.php new file mode 100644 index 00000000..14b9abaf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Date.php @@ -0,0 +1,2973 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use BadMethodCallException; +use Carbon\Carbon; +use Carbon\CarbonInterface; +use Carbon\CarbonPeriod; +use Carbon\CarbonTimeZone; +use Carbon\Exceptions\BadComparisonUnitException; +use Carbon\Exceptions\ImmutableException; +use Carbon\Exceptions\InvalidTimeZoneException; +use Carbon\Exceptions\UnitException; +use Carbon\Exceptions\UnknownGetterException; +use Carbon\Exceptions\UnknownMethodException; +use Carbon\Exceptions\UnknownSetterException; +use Carbon\Exceptions\UnknownUnitException; +use Carbon\FactoryImmutable; +use Carbon\Month; +use Carbon\Translator; +use Carbon\Unit; +use Carbon\WeekDay; +use Closure; +use DateInterval; +use DatePeriod; +use DateTime; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use Generator; +use InvalidArgumentException; +use ReflectionException; +use Symfony\Component\Clock\NativeClock; +use Throwable; + +/** + * A simple API extension for DateTime. + * + * + * + * @property string $localeDayOfWeek the day of week in current locale + * @property string $shortLocaleDayOfWeek the abbreviated day of week in current locale + * @property string $localeMonth the month in current locale + * @property string $shortLocaleMonth the abbreviated month in current locale + * @property int $year + * @property int $yearIso + * @property int $month + * @property int $day + * @property int $hour + * @property int $minute + * @property int $second + * @property int $micro + * @property int $microsecond + * @property int $dayOfWeekIso 1 (for Monday) through 7 (for Sunday) + * @property int|float|string $timestamp seconds since the Unix Epoch + * @property string $englishDayOfWeek the day of week in English + * @property string $shortEnglishDayOfWeek the abbreviated day of week in English + * @property string $englishMonth the month in English + * @property string $shortEnglishMonth the abbreviated month in English + * @property int $milliseconds + * @property int $millisecond + * @property int $milli + * @property int $week 1 through 53 + * @property int $isoWeek 1 through 53 + * @property int $weekYear year according to week format + * @property int $isoWeekYear year according to ISO week format + * @property int $age does a diffInYears() with default parameters + * @property int $offset the timezone offset in seconds from UTC + * @property int $offsetMinutes the timezone offset in minutes from UTC + * @property int $offsetHours the timezone offset in hours from UTC + * @property CarbonTimeZone $timezone the current timezone + * @property CarbonTimeZone $tz alias of $timezone + * @property int $centuryOfMillennium The value of the century starting from the beginning of the current millennium + * @property int $dayOfCentury The value of the day starting from the beginning of the current century + * @property int $dayOfDecade The value of the day starting from the beginning of the current decade + * @property int $dayOfMillennium The value of the day starting from the beginning of the current millennium + * @property int $dayOfMonth The value of the day starting from the beginning of the current month + * @property int $dayOfQuarter The value of the day starting from the beginning of the current quarter + * @property int $dayOfWeek 0 (for Sunday) through 6 (for Saturday) + * @property int $dayOfYear 1 through 366 + * @property int $decadeOfCentury The value of the decade starting from the beginning of the current century + * @property int $decadeOfMillennium The value of the decade starting from the beginning of the current millennium + * @property int $hourOfCentury The value of the hour starting from the beginning of the current century + * @property int $hourOfDay The value of the hour starting from the beginning of the current day + * @property int $hourOfDecade The value of the hour starting from the beginning of the current decade + * @property int $hourOfMillennium The value of the hour starting from the beginning of the current millennium + * @property int $hourOfMonth The value of the hour starting from the beginning of the current month + * @property int $hourOfQuarter The value of the hour starting from the beginning of the current quarter + * @property int $hourOfWeek The value of the hour starting from the beginning of the current week + * @property int $hourOfYear The value of the hour starting from the beginning of the current year + * @property int $microsecondOfCentury The value of the microsecond starting from the beginning of the current century + * @property int $microsecondOfDay The value of the microsecond starting from the beginning of the current day + * @property int $microsecondOfDecade The value of the microsecond starting from the beginning of the current decade + * @property int $microsecondOfHour The value of the microsecond starting from the beginning of the current hour + * @property int $microsecondOfMillennium The value of the microsecond starting from the beginning of the current millennium + * @property int $microsecondOfMillisecond The value of the microsecond starting from the beginning of the current millisecond + * @property int $microsecondOfMinute The value of the microsecond starting from the beginning of the current minute + * @property int $microsecondOfMonth The value of the microsecond starting from the beginning of the current month + * @property int $microsecondOfQuarter The value of the microsecond starting from the beginning of the current quarter + * @property int $microsecondOfSecond The value of the microsecond starting from the beginning of the current second + * @property int $microsecondOfWeek The value of the microsecond starting from the beginning of the current week + * @property int $microsecondOfYear The value of the microsecond starting from the beginning of the current year + * @property int $millisecondOfCentury The value of the millisecond starting from the beginning of the current century + * @property int $millisecondOfDay The value of the millisecond starting from the beginning of the current day + * @property int $millisecondOfDecade The value of the millisecond starting from the beginning of the current decade + * @property int $millisecondOfHour The value of the millisecond starting from the beginning of the current hour + * @property int $millisecondOfMillennium The value of the millisecond starting from the beginning of the current millennium + * @property int $millisecondOfMinute The value of the millisecond starting from the beginning of the current minute + * @property int $millisecondOfMonth The value of the millisecond starting from the beginning of the current month + * @property int $millisecondOfQuarter The value of the millisecond starting from the beginning of the current quarter + * @property int $millisecondOfSecond The value of the millisecond starting from the beginning of the current second + * @property int $millisecondOfWeek The value of the millisecond starting from the beginning of the current week + * @property int $millisecondOfYear The value of the millisecond starting from the beginning of the current year + * @property int $minuteOfCentury The value of the minute starting from the beginning of the current century + * @property int $minuteOfDay The value of the minute starting from the beginning of the current day + * @property int $minuteOfDecade The value of the minute starting from the beginning of the current decade + * @property int $minuteOfHour The value of the minute starting from the beginning of the current hour + * @property int $minuteOfMillennium The value of the minute starting from the beginning of the current millennium + * @property int $minuteOfMonth The value of the minute starting from the beginning of the current month + * @property int $minuteOfQuarter The value of the minute starting from the beginning of the current quarter + * @property int $minuteOfWeek The value of the minute starting from the beginning of the current week + * @property int $minuteOfYear The value of the minute starting from the beginning of the current year + * @property int $monthOfCentury The value of the month starting from the beginning of the current century + * @property int $monthOfDecade The value of the month starting from the beginning of the current decade + * @property int $monthOfMillennium The value of the month starting from the beginning of the current millennium + * @property int $monthOfQuarter The value of the month starting from the beginning of the current quarter + * @property int $monthOfYear The value of the month starting from the beginning of the current year + * @property int $quarterOfCentury The value of the quarter starting from the beginning of the current century + * @property int $quarterOfDecade The value of the quarter starting from the beginning of the current decade + * @property int $quarterOfMillennium The value of the quarter starting from the beginning of the current millennium + * @property int $quarterOfYear The value of the quarter starting from the beginning of the current year + * @property int $secondOfCentury The value of the second starting from the beginning of the current century + * @property int $secondOfDay The value of the second starting from the beginning of the current day + * @property int $secondOfDecade The value of the second starting from the beginning of the current decade + * @property int $secondOfHour The value of the second starting from the beginning of the current hour + * @property int $secondOfMillennium The value of the second starting from the beginning of the current millennium + * @property int $secondOfMinute The value of the second starting from the beginning of the current minute + * @property int $secondOfMonth The value of the second starting from the beginning of the current month + * @property int $secondOfQuarter The value of the second starting from the beginning of the current quarter + * @property int $secondOfWeek The value of the second starting from the beginning of the current week + * @property int $secondOfYear The value of the second starting from the beginning of the current year + * @property int $weekOfCentury The value of the week starting from the beginning of the current century + * @property int $weekOfDecade The value of the week starting from the beginning of the current decade + * @property int $weekOfMillennium The value of the week starting from the beginning of the current millennium + * @property int $weekOfMonth 1 through 5 + * @property int $weekOfQuarter The value of the week starting from the beginning of the current quarter + * @property int $weekOfYear ISO-8601 week number of year, weeks starting on Monday + * @property int $yearOfCentury The value of the year starting from the beginning of the current century + * @property int $yearOfDecade The value of the year starting from the beginning of the current decade + * @property int $yearOfMillennium The value of the year starting from the beginning of the current millennium + * @property-read string $latinMeridiem "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + * @property-read string $latinUpperMeridiem "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + * @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + * @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + * @property-read string $dayName long name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortDayName short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $minDayName very short name of weekday translated according to Carbon locale, in english if no translation available for current language + * @property-read string $monthName long name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $shortMonthName short name of month translated according to Carbon locale, in english if no translation available for current language + * @property-read string $meridiem lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read string $upperMeridiem uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + * @property-read int $noZeroHour current hour from 1 to 24 + * @property-read int $isoWeeksInYear 51 through 53 + * @property-read int $weekNumberInMonth 1 through 5 + * @property-read int $firstWeekDay 0 through 6 + * @property-read int $lastWeekDay 0 through 6 + * @property-read int $quarter the quarter of this instance, 1 - 4 + * @property-read int $decade the decade of this instance + * @property-read int $century the century of this instance + * @property-read int $millennium the millennium of this instance + * @property-read bool $dst daylight savings time indicator, true if DST, false otherwise + * @property-read bool $local checks if the timezone is local, true if local, false otherwise + * @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise + * @property-read string $timezoneName the current timezone name + * @property-read string $tzName alias of $timezoneName + * @property-read string $locale locale of the current instance + * @property-read int $centuriesInMillennium The number of centuries contained in the current millennium + * @property-read int $daysInCentury The number of days contained in the current century + * @property-read int $daysInDecade The number of days contained in the current decade + * @property-read int $daysInMillennium The number of days contained in the current millennium + * @property-read int $daysInMonth number of days in the given month + * @property-read int $daysInQuarter The number of days contained in the current quarter + * @property-read int $daysInWeek The number of days contained in the current week + * @property-read int $daysInYear 365 or 366 + * @property-read int $decadesInCentury The number of decades contained in the current century + * @property-read int $decadesInMillennium The number of decades contained in the current millennium + * @property-read int $hoursInCentury The number of hours contained in the current century + * @property-read int $hoursInDay The number of hours contained in the current day + * @property-read int $hoursInDecade The number of hours contained in the current decade + * @property-read int $hoursInMillennium The number of hours contained in the current millennium + * @property-read int $hoursInMonth The number of hours contained in the current month + * @property-read int $hoursInQuarter The number of hours contained in the current quarter + * @property-read int $hoursInWeek The number of hours contained in the current week + * @property-read int $hoursInYear The number of hours contained in the current year + * @property-read int $microsecondsInCentury The number of microseconds contained in the current century + * @property-read int $microsecondsInDay The number of microseconds contained in the current day + * @property-read int $microsecondsInDecade The number of microseconds contained in the current decade + * @property-read int $microsecondsInHour The number of microseconds contained in the current hour + * @property-read int $microsecondsInMillennium The number of microseconds contained in the current millennium + * @property-read int $microsecondsInMillisecond The number of microseconds contained in the current millisecond + * @property-read int $microsecondsInMinute The number of microseconds contained in the current minute + * @property-read int $microsecondsInMonth The number of microseconds contained in the current month + * @property-read int $microsecondsInQuarter The number of microseconds contained in the current quarter + * @property-read int $microsecondsInSecond The number of microseconds contained in the current second + * @property-read int $microsecondsInWeek The number of microseconds contained in the current week + * @property-read int $microsecondsInYear The number of microseconds contained in the current year + * @property-read int $millisecondsInCentury The number of milliseconds contained in the current century + * @property-read int $millisecondsInDay The number of milliseconds contained in the current day + * @property-read int $millisecondsInDecade The number of milliseconds contained in the current decade + * @property-read int $millisecondsInHour The number of milliseconds contained in the current hour + * @property-read int $millisecondsInMillennium The number of milliseconds contained in the current millennium + * @property-read int $millisecondsInMinute The number of milliseconds contained in the current minute + * @property-read int $millisecondsInMonth The number of milliseconds contained in the current month + * @property-read int $millisecondsInQuarter The number of milliseconds contained in the current quarter + * @property-read int $millisecondsInSecond The number of milliseconds contained in the current second + * @property-read int $millisecondsInWeek The number of milliseconds contained in the current week + * @property-read int $millisecondsInYear The number of milliseconds contained in the current year + * @property-read int $minutesInCentury The number of minutes contained in the current century + * @property-read int $minutesInDay The number of minutes contained in the current day + * @property-read int $minutesInDecade The number of minutes contained in the current decade + * @property-read int $minutesInHour The number of minutes contained in the current hour + * @property-read int $minutesInMillennium The number of minutes contained in the current millennium + * @property-read int $minutesInMonth The number of minutes contained in the current month + * @property-read int $minutesInQuarter The number of minutes contained in the current quarter + * @property-read int $minutesInWeek The number of minutes contained in the current week + * @property-read int $minutesInYear The number of minutes contained in the current year + * @property-read int $monthsInCentury The number of months contained in the current century + * @property-read int $monthsInDecade The number of months contained in the current decade + * @property-read int $monthsInMillennium The number of months contained in the current millennium + * @property-read int $monthsInQuarter The number of months contained in the current quarter + * @property-read int $monthsInYear The number of months contained in the current year + * @property-read int $quartersInCentury The number of quarters contained in the current century + * @property-read int $quartersInDecade The number of quarters contained in the current decade + * @property-read int $quartersInMillennium The number of quarters contained in the current millennium + * @property-read int $quartersInYear The number of quarters contained in the current year + * @property-read int $secondsInCentury The number of seconds contained in the current century + * @property-read int $secondsInDay The number of seconds contained in the current day + * @property-read int $secondsInDecade The number of seconds contained in the current decade + * @property-read int $secondsInHour The number of seconds contained in the current hour + * @property-read int $secondsInMillennium The number of seconds contained in the current millennium + * @property-read int $secondsInMinute The number of seconds contained in the current minute + * @property-read int $secondsInMonth The number of seconds contained in the current month + * @property-read int $secondsInQuarter The number of seconds contained in the current quarter + * @property-read int $secondsInWeek The number of seconds contained in the current week + * @property-read int $secondsInYear The number of seconds contained in the current year + * @property-read int $weeksInCentury The number of weeks contained in the current century + * @property-read int $weeksInDecade The number of weeks contained in the current decade + * @property-read int $weeksInMillennium The number of weeks contained in the current millennium + * @property-read int $weeksInMonth The number of weeks contained in the current month + * @property-read int $weeksInQuarter The number of weeks contained in the current quarter + * @property-read int $weeksInYear 51 through 53 + * @property-read int $yearsInCentury The number of years contained in the current century + * @property-read int $yearsInDecade The number of years contained in the current decade + * @property-read int $yearsInMillennium The number of years contained in the current millennium + * + * @method bool isUtc() Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + * @method bool isLocal() Check if the current instance has non-UTC timezone. + * @method bool isValid() Check if the current instance is a valid date. + * @method bool isDST() Check if the current instance is in a daylight saving time. + * @method bool isSunday() Checks if the instance day is sunday. + * @method bool isMonday() Checks if the instance day is monday. + * @method bool isTuesday() Checks if the instance day is tuesday. + * @method bool isWednesday() Checks if the instance day is wednesday. + * @method bool isThursday() Checks if the instance day is thursday. + * @method bool isFriday() Checks if the instance day is friday. + * @method bool isSaturday() Checks if the instance day is saturday. + * @method bool isSameYear(DateTimeInterface|string $date) Checks if the given date is in the same year as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentYear() Checks if the instance is in the same year as the current moment. + * @method bool isNextYear() Checks if the instance is in the same year as the current moment next year. + * @method bool isLastYear() Checks if the instance is in the same year as the current moment last year. + * @method bool isCurrentMonth() Checks if the instance is in the same month as the current moment. + * @method bool isNextMonth() Checks if the instance is in the same month as the current moment next month. + * @method bool isLastMonth() Checks if the instance is in the same month as the current moment last month. + * @method bool isSameWeek(DateTimeInterface|string $date) Checks if the given date is in the same week as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentWeek() Checks if the instance is in the same week as the current moment. + * @method bool isNextWeek() Checks if the instance is in the same week as the current moment next week. + * @method bool isLastWeek() Checks if the instance is in the same week as the current moment last week. + * @method bool isSameDay(DateTimeInterface|string $date) Checks if the given date is in the same day as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDay() Checks if the instance is in the same day as the current moment. + * @method bool isNextDay() Checks if the instance is in the same day as the current moment next day. + * @method bool isLastDay() Checks if the instance is in the same day as the current moment last day. + * @method bool isSameHour(DateTimeInterface|string $date) Checks if the given date is in the same hour as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentHour() Checks if the instance is in the same hour as the current moment. + * @method bool isNextHour() Checks if the instance is in the same hour as the current moment next hour. + * @method bool isLastHour() Checks if the instance is in the same hour as the current moment last hour. + * @method bool isSameMinute(DateTimeInterface|string $date) Checks if the given date is in the same minute as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMinute() Checks if the instance is in the same minute as the current moment. + * @method bool isNextMinute() Checks if the instance is in the same minute as the current moment next minute. + * @method bool isLastMinute() Checks if the instance is in the same minute as the current moment last minute. + * @method bool isSameSecond(DateTimeInterface|string $date) Checks if the given date is in the same second as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentSecond() Checks if the instance is in the same second as the current moment. + * @method bool isNextSecond() Checks if the instance is in the same second as the current moment next second. + * @method bool isLastSecond() Checks if the instance is in the same second as the current moment last second. + * @method bool isSameMilli(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMilli() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMilli() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMilli() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMillisecond(DateTimeInterface|string $date) Checks if the given date is in the same millisecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillisecond() Checks if the instance is in the same millisecond as the current moment. + * @method bool isNextMillisecond() Checks if the instance is in the same millisecond as the current moment next millisecond. + * @method bool isLastMillisecond() Checks if the instance is in the same millisecond as the current moment last millisecond. + * @method bool isSameMicro(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicro() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicro() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicro() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameMicrosecond(DateTimeInterface|string $date) Checks if the given date is in the same microsecond as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMicrosecond() Checks if the instance is in the same microsecond as the current moment. + * @method bool isNextMicrosecond() Checks if the instance is in the same microsecond as the current moment next microsecond. + * @method bool isLastMicrosecond() Checks if the instance is in the same microsecond as the current moment last microsecond. + * @method bool isSameDecade(DateTimeInterface|string $date) Checks if the given date is in the same decade as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentDecade() Checks if the instance is in the same decade as the current moment. + * @method bool isNextDecade() Checks if the instance is in the same decade as the current moment next decade. + * @method bool isLastDecade() Checks if the instance is in the same decade as the current moment last decade. + * @method bool isSameCentury(DateTimeInterface|string $date) Checks if the given date is in the same century as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentCentury() Checks if the instance is in the same century as the current moment. + * @method bool isNextCentury() Checks if the instance is in the same century as the current moment next century. + * @method bool isLastCentury() Checks if the instance is in the same century as the current moment last century. + * @method bool isSameMillennium(DateTimeInterface|string $date) Checks if the given date is in the same millennium as the instance. If null passed, compare to now (with the same timezone). + * @method bool isCurrentMillennium() Checks if the instance is in the same millennium as the current moment. + * @method bool isNextMillennium() Checks if the instance is in the same millennium as the current moment next millennium. + * @method bool isLastMillennium() Checks if the instance is in the same millennium as the current moment last millennium. + * @method bool isCurrentQuarter() Checks if the instance is in the same quarter as the current moment. + * @method bool isNextQuarter() Checks if the instance is in the same quarter as the current moment next quarter. + * @method bool isLastQuarter() Checks if the instance is in the same quarter as the current moment last quarter. + * @method CarbonInterface years(int $value) Set current instance year to the given value. + * @method CarbonInterface year(int $value) Set current instance year to the given value. + * @method CarbonInterface setYears(int $value) Set current instance year to the given value. + * @method CarbonInterface setYear(int $value) Set current instance year to the given value. + * @method CarbonInterface months(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface month(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface setMonths(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface setMonth(Month|int $value) Set current instance month to the given value. + * @method CarbonInterface days(int $value) Set current instance day to the given value. + * @method CarbonInterface day(int $value) Set current instance day to the given value. + * @method CarbonInterface setDays(int $value) Set current instance day to the given value. + * @method CarbonInterface setDay(int $value) Set current instance day to the given value. + * @method CarbonInterface hours(int $value) Set current instance hour to the given value. + * @method CarbonInterface hour(int $value) Set current instance hour to the given value. + * @method CarbonInterface setHours(int $value) Set current instance hour to the given value. + * @method CarbonInterface setHour(int $value) Set current instance hour to the given value. + * @method CarbonInterface minutes(int $value) Set current instance minute to the given value. + * @method CarbonInterface minute(int $value) Set current instance minute to the given value. + * @method CarbonInterface setMinutes(int $value) Set current instance minute to the given value. + * @method CarbonInterface setMinute(int $value) Set current instance minute to the given value. + * @method CarbonInterface seconds(int $value) Set current instance second to the given value. + * @method CarbonInterface second(int $value) Set current instance second to the given value. + * @method CarbonInterface setSeconds(int $value) Set current instance second to the given value. + * @method CarbonInterface setSecond(int $value) Set current instance second to the given value. + * @method CarbonInterface millis(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface milli(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMillis(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMilli(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface milliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface millisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMilliseconds(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface setMillisecond(int $value) Set current instance millisecond to the given value. + * @method CarbonInterface micros(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface micro(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicros(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicro(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface microseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface microsecond(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicroseconds(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface setMicrosecond(int $value) Set current instance microsecond to the given value. + * @method CarbonInterface addYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addYear() Add one year to the instance (using date interval). + * @method CarbonInterface subYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subYear() Sub one year to the instance (using date interval). + * @method CarbonInterface addYearsWithOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addYearWithOverflow() Add one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subYearsWithOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subYearWithOverflow() Sub one year to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addYearsWithoutOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearWithoutOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsWithoutOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearWithoutOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearsWithNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearWithNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsWithNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearWithNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearsNoOverflow(int|float $value = 1) Add years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addYearNoOverflow() Add one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearsNoOverflow(int|float $value = 1) Sub years (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subYearNoOverflow() Sub one year to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMonth() Add one month to the instance (using date interval). + * @method CarbonInterface subMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMonth() Sub one month to the instance (using date interval). + * @method CarbonInterface addMonthsWithOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMonthWithOverflow() Add one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMonthsWithOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMonthWithOverflow() Sub one month to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMonthsWithoutOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthWithoutOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsWithoutOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthWithoutOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthsWithNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthWithNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsWithNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthWithNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthsNoOverflow(int|float $value = 1) Add months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMonthNoOverflow() Add one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthsNoOverflow(int|float $value = 1) Sub months (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMonthNoOverflow() Sub one month to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addDay() Add one day to the instance (using date interval). + * @method CarbonInterface subDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subDay() Sub one day to the instance (using date interval). + * @method CarbonInterface addHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addHour() Add one hour to the instance (using date interval). + * @method CarbonInterface subHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subHour() Sub one hour to the instance (using date interval). + * @method CarbonInterface addMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMinute() Add one minute to the instance (using date interval). + * @method CarbonInterface subMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMinute() Sub one minute to the instance (using date interval). + * @method CarbonInterface addSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addSecond() Add one second to the instance (using date interval). + * @method CarbonInterface subSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subSecond() Sub one second to the instance (using date interval). + * @method CarbonInterface addMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMilli() Add one millisecond to the instance (using date interval). + * @method CarbonInterface subMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMilli() Sub one millisecond to the instance (using date interval). + * @method CarbonInterface addMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMillisecond() Add one millisecond to the instance (using date interval). + * @method CarbonInterface subMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMillisecond() Sub one millisecond to the instance (using date interval). + * @method CarbonInterface addMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMicro() Add one microsecond to the instance (using date interval). + * @method CarbonInterface subMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMicro() Sub one microsecond to the instance (using date interval). + * @method CarbonInterface addMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMicrosecond() Add one microsecond to the instance (using date interval). + * @method CarbonInterface subMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMicrosecond() Sub one microsecond to the instance (using date interval). + * @method CarbonInterface addMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addMillennium() Add one millennium to the instance (using date interval). + * @method CarbonInterface subMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subMillennium() Sub one millennium to the instance (using date interval). + * @method CarbonInterface addMillenniaWithOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMillenniumWithOverflow() Add one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMillenniaWithOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subMillenniumWithOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addMillenniaWithoutOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumWithoutOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaWithoutOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumWithoutOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniaWithNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumWithNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaWithNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumWithNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniaNoOverflow(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addMillenniumNoOverflow() Add one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniaNoOverflow(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subMillenniumNoOverflow() Sub one millennium to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addCentury() Add one century to the instance (using date interval). + * @method CarbonInterface subCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subCentury() Sub one century to the instance (using date interval). + * @method CarbonInterface addCenturiesWithOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addCenturyWithOverflow() Add one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subCenturiesWithOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subCenturyWithOverflow() Sub one century to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addCenturiesWithoutOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyWithoutOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesWithoutOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyWithoutOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturiesWithNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyWithNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesWithNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyWithNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturiesNoOverflow(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addCenturyNoOverflow() Add one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturiesNoOverflow(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subCenturyNoOverflow() Sub one century to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addDecade() Add one decade to the instance (using date interval). + * @method CarbonInterface subDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subDecade() Sub one decade to the instance (using date interval). + * @method CarbonInterface addDecadesWithOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addDecadeWithOverflow() Add one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subDecadesWithOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subDecadeWithOverflow() Sub one decade to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addDecadesWithoutOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeWithoutOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesWithoutOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeWithoutOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadesWithNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeWithNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesWithNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeWithNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadesNoOverflow(int|float $value = 1) Add decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addDecadeNoOverflow() Add one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadesNoOverflow(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subDecadeNoOverflow() Sub one decade to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addQuarter() Add one quarter to the instance (using date interval). + * @method CarbonInterface subQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subQuarter() Sub one quarter to the instance (using date interval). + * @method CarbonInterface addQuartersWithOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addQuarterWithOverflow() Add one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subQuartersWithOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface subQuarterWithOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly allowed. + * @method CarbonInterface addQuartersWithoutOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterWithoutOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersWithoutOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterWithoutOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuartersWithNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterWithNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersWithNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterWithNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuartersNoOverflow(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addQuarterNoOverflow() Add one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuartersNoOverflow(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface subQuarterNoOverflow() Sub one quarter to the instance (using date interval) with overflow explicitly forbidden. + * @method CarbonInterface addWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addWeek() Add one week to the instance (using date interval). + * @method CarbonInterface subWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subWeek() Sub one week to the instance (using date interval). + * @method CarbonInterface addWeekdays(int|float $value = 1) Add weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface addWeekday() Add one weekday to the instance (using date interval). + * @method CarbonInterface subWeekdays(int|float $value = 1) Sub weekdays (the $value count passed in) to the instance (using date interval). + * @method CarbonInterface subWeekday() Sub one weekday to the instance (using date interval). + * @method CarbonInterface addUTCMicros(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMicro() Add one microsecond to the instance (using timestamp). + * @method CarbonInterface subUTCMicros(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMicro() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicros(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonInterface addUTCMicroseconds(int|float $value = 1) Add microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMicrosecond() Add one microsecond to the instance (using timestamp). + * @method CarbonInterface subUTCMicroseconds(int|float $value = 1) Sub microseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMicrosecond() Sub one microsecond to the instance (using timestamp). + * @method CarbonPeriod microsecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each microsecond or every X microseconds if a factor is given. + * @method float diffInUTCMicroseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of microseconds. + * @method CarbonInterface addUTCMillis(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMilli() Add one millisecond to the instance (using timestamp). + * @method CarbonInterface subUTCMillis(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMilli() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMillis(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonInterface addUTCMilliseconds(int|float $value = 1) Add milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMillisecond() Add one millisecond to the instance (using timestamp). + * @method CarbonInterface subUTCMilliseconds(int|float $value = 1) Sub milliseconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMillisecond() Sub one millisecond to the instance (using timestamp). + * @method CarbonPeriod millisecondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millisecond or every X milliseconds if a factor is given. + * @method float diffInUTCMilliseconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of milliseconds. + * @method CarbonInterface addUTCSeconds(int|float $value = 1) Add seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCSecond() Add one second to the instance (using timestamp). + * @method CarbonInterface subUTCSeconds(int|float $value = 1) Sub seconds (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCSecond() Sub one second to the instance (using timestamp). + * @method CarbonPeriod secondsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each second or every X seconds if a factor is given. + * @method float diffInUTCSeconds(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of seconds. + * @method CarbonInterface addUTCMinutes(int|float $value = 1) Add minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMinute() Add one minute to the instance (using timestamp). + * @method CarbonInterface subUTCMinutes(int|float $value = 1) Sub minutes (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMinute() Sub one minute to the instance (using timestamp). + * @method CarbonPeriod minutesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each minute or every X minutes if a factor is given. + * @method float diffInUTCMinutes(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of minutes. + * @method CarbonInterface addUTCHours(int|float $value = 1) Add hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCHour() Add one hour to the instance (using timestamp). + * @method CarbonInterface subUTCHours(int|float $value = 1) Sub hours (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCHour() Sub one hour to the instance (using timestamp). + * @method CarbonPeriod hoursUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each hour or every X hours if a factor is given. + * @method float diffInUTCHours(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of hours. + * @method CarbonInterface addUTCDays(int|float $value = 1) Add days (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCDay() Add one day to the instance (using timestamp). + * @method CarbonInterface subUTCDays(int|float $value = 1) Sub days (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCDay() Sub one day to the instance (using timestamp). + * @method CarbonPeriod daysUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each day or every X days if a factor is given. + * @method float diffInUTCDays(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of days. + * @method CarbonInterface addUTCWeeks(int|float $value = 1) Add weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCWeek() Add one week to the instance (using timestamp). + * @method CarbonInterface subUTCWeeks(int|float $value = 1) Sub weeks (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCWeek() Sub one week to the instance (using timestamp). + * @method CarbonPeriod weeksUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each week or every X weeks if a factor is given. + * @method float diffInUTCWeeks(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of weeks. + * @method CarbonInterface addUTCMonths(int|float $value = 1) Add months (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMonth() Add one month to the instance (using timestamp). + * @method CarbonInterface subUTCMonths(int|float $value = 1) Sub months (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMonth() Sub one month to the instance (using timestamp). + * @method CarbonPeriod monthsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each month or every X months if a factor is given. + * @method float diffInUTCMonths(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of months. + * @method CarbonInterface addUTCQuarters(int|float $value = 1) Add quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCQuarter() Add one quarter to the instance (using timestamp). + * @method CarbonInterface subUTCQuarters(int|float $value = 1) Sub quarters (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCQuarter() Sub one quarter to the instance (using timestamp). + * @method CarbonPeriod quartersUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each quarter or every X quarters if a factor is given. + * @method float diffInUTCQuarters(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of quarters. + * @method CarbonInterface addUTCYears(int|float $value = 1) Add years (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCYear() Add one year to the instance (using timestamp). + * @method CarbonInterface subUTCYears(int|float $value = 1) Sub years (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCYear() Sub one year to the instance (using timestamp). + * @method CarbonPeriod yearsUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each year or every X years if a factor is given. + * @method float diffInUTCYears(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of years. + * @method CarbonInterface addUTCDecades(int|float $value = 1) Add decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCDecade() Add one decade to the instance (using timestamp). + * @method CarbonInterface subUTCDecades(int|float $value = 1) Sub decades (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCDecade() Sub one decade to the instance (using timestamp). + * @method CarbonPeriod decadesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each decade or every X decades if a factor is given. + * @method float diffInUTCDecades(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of decades. + * @method CarbonInterface addUTCCenturies(int|float $value = 1) Add centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCCentury() Add one century to the instance (using timestamp). + * @method CarbonInterface subUTCCenturies(int|float $value = 1) Sub centuries (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCCentury() Sub one century to the instance (using timestamp). + * @method CarbonPeriod centuriesUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each century or every X centuries if a factor is given. + * @method float diffInUTCCenturies(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of centuries. + * @method CarbonInterface addUTCMillennia(int|float $value = 1) Add millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface addUTCMillennium() Add one millennium to the instance (using timestamp). + * @method CarbonInterface subUTCMillennia(int|float $value = 1) Sub millennia (the $value count passed in) to the instance (using timestamp). + * @method CarbonInterface subUTCMillennium() Sub one millennium to the instance (using timestamp). + * @method CarbonPeriod millenniaUntil($endDate = null, int|float $factor = 1) Return an iterable period from current date to given end (string, DateTime or Carbon instance) for each millennium or every X millennia if a factor is given. + * @method float diffInUTCMillennia(DateTimeInterface|string|null $date, bool $absolute = false) Convert current and given date in UTC timezone and return a floating number of millennia. + * @method CarbonInterface roundYear(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonInterface roundYears(float $precision = 1, string $function = "round") Round the current instance year with given precision using the given function. + * @method CarbonInterface floorYear(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonInterface floorYears(float $precision = 1) Truncate the current instance year with given precision. + * @method CarbonInterface ceilYear(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonInterface ceilYears(float $precision = 1) Ceil the current instance year with given precision. + * @method CarbonInterface roundMonth(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonInterface roundMonths(float $precision = 1, string $function = "round") Round the current instance month with given precision using the given function. + * @method CarbonInterface floorMonth(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonInterface floorMonths(float $precision = 1) Truncate the current instance month with given precision. + * @method CarbonInterface ceilMonth(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonInterface ceilMonths(float $precision = 1) Ceil the current instance month with given precision. + * @method CarbonInterface roundDay(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonInterface roundDays(float $precision = 1, string $function = "round") Round the current instance day with given precision using the given function. + * @method CarbonInterface floorDay(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonInterface floorDays(float $precision = 1) Truncate the current instance day with given precision. + * @method CarbonInterface ceilDay(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonInterface ceilDays(float $precision = 1) Ceil the current instance day with given precision. + * @method CarbonInterface roundHour(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonInterface roundHours(float $precision = 1, string $function = "round") Round the current instance hour with given precision using the given function. + * @method CarbonInterface floorHour(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonInterface floorHours(float $precision = 1) Truncate the current instance hour with given precision. + * @method CarbonInterface ceilHour(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonInterface ceilHours(float $precision = 1) Ceil the current instance hour with given precision. + * @method CarbonInterface roundMinute(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonInterface roundMinutes(float $precision = 1, string $function = "round") Round the current instance minute with given precision using the given function. + * @method CarbonInterface floorMinute(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonInterface floorMinutes(float $precision = 1) Truncate the current instance minute with given precision. + * @method CarbonInterface ceilMinute(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonInterface ceilMinutes(float $precision = 1) Ceil the current instance minute with given precision. + * @method CarbonInterface roundSecond(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonInterface roundSeconds(float $precision = 1, string $function = "round") Round the current instance second with given precision using the given function. + * @method CarbonInterface floorSecond(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonInterface floorSeconds(float $precision = 1) Truncate the current instance second with given precision. + * @method CarbonInterface ceilSecond(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonInterface ceilSeconds(float $precision = 1) Ceil the current instance second with given precision. + * @method CarbonInterface roundMillennium(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonInterface roundMillennia(float $precision = 1, string $function = "round") Round the current instance millennium with given precision using the given function. + * @method CarbonInterface floorMillennium(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonInterface floorMillennia(float $precision = 1) Truncate the current instance millennium with given precision. + * @method CarbonInterface ceilMillennium(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonInterface ceilMillennia(float $precision = 1) Ceil the current instance millennium with given precision. + * @method CarbonInterface roundCentury(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonInterface roundCenturies(float $precision = 1, string $function = "round") Round the current instance century with given precision using the given function. + * @method CarbonInterface floorCentury(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonInterface floorCenturies(float $precision = 1) Truncate the current instance century with given precision. + * @method CarbonInterface ceilCentury(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonInterface ceilCenturies(float $precision = 1) Ceil the current instance century with given precision. + * @method CarbonInterface roundDecade(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonInterface roundDecades(float $precision = 1, string $function = "round") Round the current instance decade with given precision using the given function. + * @method CarbonInterface floorDecade(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonInterface floorDecades(float $precision = 1) Truncate the current instance decade with given precision. + * @method CarbonInterface ceilDecade(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonInterface ceilDecades(float $precision = 1) Ceil the current instance decade with given precision. + * @method CarbonInterface roundQuarter(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonInterface roundQuarters(float $precision = 1, string $function = "round") Round the current instance quarter with given precision using the given function. + * @method CarbonInterface floorQuarter(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonInterface floorQuarters(float $precision = 1) Truncate the current instance quarter with given precision. + * @method CarbonInterface ceilQuarter(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonInterface ceilQuarters(float $precision = 1) Ceil the current instance quarter with given precision. + * @method CarbonInterface roundMillisecond(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonInterface roundMilliseconds(float $precision = 1, string $function = "round") Round the current instance millisecond with given precision using the given function. + * @method CarbonInterface floorMillisecond(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonInterface floorMilliseconds(float $precision = 1) Truncate the current instance millisecond with given precision. + * @method CarbonInterface ceilMillisecond(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonInterface ceilMilliseconds(float $precision = 1) Ceil the current instance millisecond with given precision. + * @method CarbonInterface roundMicrosecond(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonInterface roundMicroseconds(float $precision = 1, string $function = "round") Round the current instance microsecond with given precision using the given function. + * @method CarbonInterface floorMicrosecond(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonInterface floorMicroseconds(float $precision = 1) Truncate the current instance microsecond with given precision. + * @method CarbonInterface ceilMicrosecond(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method CarbonInterface ceilMicroseconds(float $precision = 1) Ceil the current instance microsecond with given precision. + * @method string shortAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longAbsoluteDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Absolute' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'Relative' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToNowDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToNow' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string shortRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (short format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method string longRelativeToOtherDiffForHumans(DateTimeInterface $other = null, int $parts = 1) Get the difference (long format, 'RelativeToOther' mode) in a human readable format in the current locale. ($other and $parts parameters can be swapped.) + * @method int centuriesInMillennium() Return the number of centuries contained in the current millennium + * @method int|static centuryOfMillennium(?int $century = null) Return the value of the century starting from the beginning of the current millennium when called with no parameters, change the current century when called with an integer value + * @method int|static dayOfCentury(?int $day = null) Return the value of the day starting from the beginning of the current century when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfDecade(?int $day = null) Return the value of the day starting from the beginning of the current decade when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMillennium(?int $day = null) Return the value of the day starting from the beginning of the current millennium when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfMonth(?int $day = null) Return the value of the day starting from the beginning of the current month when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfQuarter(?int $day = null) Return the value of the day starting from the beginning of the current quarter when called with no parameters, change the current day when called with an integer value + * @method int|static dayOfWeek(?int $day = null) Return the value of the day starting from the beginning of the current week when called with no parameters, change the current day when called with an integer value + * @method int daysInCentury() Return the number of days contained in the current century + * @method int daysInDecade() Return the number of days contained in the current decade + * @method int daysInMillennium() Return the number of days contained in the current millennium + * @method int daysInMonth() Return the number of days contained in the current month + * @method int daysInQuarter() Return the number of days contained in the current quarter + * @method int daysInWeek() Return the number of days contained in the current week + * @method int daysInYear() Return the number of days contained in the current year + * @method int|static decadeOfCentury(?int $decade = null) Return the value of the decade starting from the beginning of the current century when called with no parameters, change the current decade when called with an integer value + * @method int|static decadeOfMillennium(?int $decade = null) Return the value of the decade starting from the beginning of the current millennium when called with no parameters, change the current decade when called with an integer value + * @method int decadesInCentury() Return the number of decades contained in the current century + * @method int decadesInMillennium() Return the number of decades contained in the current millennium + * @method int|static hourOfCentury(?int $hour = null) Return the value of the hour starting from the beginning of the current century when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDay(?int $hour = null) Return the value of the hour starting from the beginning of the current day when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfDecade(?int $hour = null) Return the value of the hour starting from the beginning of the current decade when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMillennium(?int $hour = null) Return the value of the hour starting from the beginning of the current millennium when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfMonth(?int $hour = null) Return the value of the hour starting from the beginning of the current month when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfQuarter(?int $hour = null) Return the value of the hour starting from the beginning of the current quarter when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfWeek(?int $hour = null) Return the value of the hour starting from the beginning of the current week when called with no parameters, change the current hour when called with an integer value + * @method int|static hourOfYear(?int $hour = null) Return the value of the hour starting from the beginning of the current year when called with no parameters, change the current hour when called with an integer value + * @method int hoursInCentury() Return the number of hours contained in the current century + * @method int hoursInDay() Return the number of hours contained in the current day + * @method int hoursInDecade() Return the number of hours contained in the current decade + * @method int hoursInMillennium() Return the number of hours contained in the current millennium + * @method int hoursInMonth() Return the number of hours contained in the current month + * @method int hoursInQuarter() Return the number of hours contained in the current quarter + * @method int hoursInWeek() Return the number of hours contained in the current week + * @method int hoursInYear() Return the number of hours contained in the current year + * @method int|static microsecondOfCentury(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current century when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDay(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current day when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfDecade(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current decade when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfHour(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current hour when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillennium(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millennium when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMillisecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current millisecond when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMinute(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current minute when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfMonth(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current month when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfQuarter(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current quarter when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfSecond(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current second when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfWeek(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current week when called with no parameters, change the current microsecond when called with an integer value + * @method int|static microsecondOfYear(?int $microsecond = null) Return the value of the microsecond starting from the beginning of the current year when called with no parameters, change the current microsecond when called with an integer value + * @method int microsecondsInCentury() Return the number of microseconds contained in the current century + * @method int microsecondsInDay() Return the number of microseconds contained in the current day + * @method int microsecondsInDecade() Return the number of microseconds contained in the current decade + * @method int microsecondsInHour() Return the number of microseconds contained in the current hour + * @method int microsecondsInMillennium() Return the number of microseconds contained in the current millennium + * @method int microsecondsInMillisecond() Return the number of microseconds contained in the current millisecond + * @method int microsecondsInMinute() Return the number of microseconds contained in the current minute + * @method int microsecondsInMonth() Return the number of microseconds contained in the current month + * @method int microsecondsInQuarter() Return the number of microseconds contained in the current quarter + * @method int microsecondsInSecond() Return the number of microseconds contained in the current second + * @method int microsecondsInWeek() Return the number of microseconds contained in the current week + * @method int microsecondsInYear() Return the number of microseconds contained in the current year + * @method int|static millisecondOfCentury(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current century when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDay(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current day when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfDecade(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current decade when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfHour(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current hour when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMillennium(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current millennium when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMinute(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current minute when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfMonth(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current month when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfQuarter(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current quarter when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfSecond(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current second when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfWeek(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current week when called with no parameters, change the current millisecond when called with an integer value + * @method int|static millisecondOfYear(?int $millisecond = null) Return the value of the millisecond starting from the beginning of the current year when called with no parameters, change the current millisecond when called with an integer value + * @method int millisecondsInCentury() Return the number of milliseconds contained in the current century + * @method int millisecondsInDay() Return the number of milliseconds contained in the current day + * @method int millisecondsInDecade() Return the number of milliseconds contained in the current decade + * @method int millisecondsInHour() Return the number of milliseconds contained in the current hour + * @method int millisecondsInMillennium() Return the number of milliseconds contained in the current millennium + * @method int millisecondsInMinute() Return the number of milliseconds contained in the current minute + * @method int millisecondsInMonth() Return the number of milliseconds contained in the current month + * @method int millisecondsInQuarter() Return the number of milliseconds contained in the current quarter + * @method int millisecondsInSecond() Return the number of milliseconds contained in the current second + * @method int millisecondsInWeek() Return the number of milliseconds contained in the current week + * @method int millisecondsInYear() Return the number of milliseconds contained in the current year + * @method int|static minuteOfCentury(?int $minute = null) Return the value of the minute starting from the beginning of the current century when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDay(?int $minute = null) Return the value of the minute starting from the beginning of the current day when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfDecade(?int $minute = null) Return the value of the minute starting from the beginning of the current decade when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfHour(?int $minute = null) Return the value of the minute starting from the beginning of the current hour when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMillennium(?int $minute = null) Return the value of the minute starting from the beginning of the current millennium when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfMonth(?int $minute = null) Return the value of the minute starting from the beginning of the current month when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfQuarter(?int $minute = null) Return the value of the minute starting from the beginning of the current quarter when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfWeek(?int $minute = null) Return the value of the minute starting from the beginning of the current week when called with no parameters, change the current minute when called with an integer value + * @method int|static minuteOfYear(?int $minute = null) Return the value of the minute starting from the beginning of the current year when called with no parameters, change the current minute when called with an integer value + * @method int minutesInCentury() Return the number of minutes contained in the current century + * @method int minutesInDay() Return the number of minutes contained in the current day + * @method int minutesInDecade() Return the number of minutes contained in the current decade + * @method int minutesInHour() Return the number of minutes contained in the current hour + * @method int minutesInMillennium() Return the number of minutes contained in the current millennium + * @method int minutesInMonth() Return the number of minutes contained in the current month + * @method int minutesInQuarter() Return the number of minutes contained in the current quarter + * @method int minutesInWeek() Return the number of minutes contained in the current week + * @method int minutesInYear() Return the number of minutes contained in the current year + * @method int|static monthOfCentury(?int $month = null) Return the value of the month starting from the beginning of the current century when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfDecade(?int $month = null) Return the value of the month starting from the beginning of the current decade when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfMillennium(?int $month = null) Return the value of the month starting from the beginning of the current millennium when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfQuarter(?int $month = null) Return the value of the month starting from the beginning of the current quarter when called with no parameters, change the current month when called with an integer value + * @method int|static monthOfYear(?int $month = null) Return the value of the month starting from the beginning of the current year when called with no parameters, change the current month when called with an integer value + * @method int monthsInCentury() Return the number of months contained in the current century + * @method int monthsInDecade() Return the number of months contained in the current decade + * @method int monthsInMillennium() Return the number of months contained in the current millennium + * @method int monthsInQuarter() Return the number of months contained in the current quarter + * @method int monthsInYear() Return the number of months contained in the current year + * @method int|static quarterOfCentury(?int $quarter = null) Return the value of the quarter starting from the beginning of the current century when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfDecade(?int $quarter = null) Return the value of the quarter starting from the beginning of the current decade when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfMillennium(?int $quarter = null) Return the value of the quarter starting from the beginning of the current millennium when called with no parameters, change the current quarter when called with an integer value + * @method int|static quarterOfYear(?int $quarter = null) Return the value of the quarter starting from the beginning of the current year when called with no parameters, change the current quarter when called with an integer value + * @method int quartersInCentury() Return the number of quarters contained in the current century + * @method int quartersInDecade() Return the number of quarters contained in the current decade + * @method int quartersInMillennium() Return the number of quarters contained in the current millennium + * @method int quartersInYear() Return the number of quarters contained in the current year + * @method int|static secondOfCentury(?int $second = null) Return the value of the second starting from the beginning of the current century when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDay(?int $second = null) Return the value of the second starting from the beginning of the current day when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfDecade(?int $second = null) Return the value of the second starting from the beginning of the current decade when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfHour(?int $second = null) Return the value of the second starting from the beginning of the current hour when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMillennium(?int $second = null) Return the value of the second starting from the beginning of the current millennium when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMinute(?int $second = null) Return the value of the second starting from the beginning of the current minute when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfMonth(?int $second = null) Return the value of the second starting from the beginning of the current month when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfQuarter(?int $second = null) Return the value of the second starting from the beginning of the current quarter when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfWeek(?int $second = null) Return the value of the second starting from the beginning of the current week when called with no parameters, change the current second when called with an integer value + * @method int|static secondOfYear(?int $second = null) Return the value of the second starting from the beginning of the current year when called with no parameters, change the current second when called with an integer value + * @method int secondsInCentury() Return the number of seconds contained in the current century + * @method int secondsInDay() Return the number of seconds contained in the current day + * @method int secondsInDecade() Return the number of seconds contained in the current decade + * @method int secondsInHour() Return the number of seconds contained in the current hour + * @method int secondsInMillennium() Return the number of seconds contained in the current millennium + * @method int secondsInMinute() Return the number of seconds contained in the current minute + * @method int secondsInMonth() Return the number of seconds contained in the current month + * @method int secondsInQuarter() Return the number of seconds contained in the current quarter + * @method int secondsInWeek() Return the number of seconds contained in the current week + * @method int secondsInYear() Return the number of seconds contained in the current year + * @method int|static weekOfCentury(?int $week = null) Return the value of the week starting from the beginning of the current century when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfDecade(?int $week = null) Return the value of the week starting from the beginning of the current decade when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMillennium(?int $week = null) Return the value of the week starting from the beginning of the current millennium when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfMonth(?int $week = null) Return the value of the week starting from the beginning of the current month when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfQuarter(?int $week = null) Return the value of the week starting from the beginning of the current quarter when called with no parameters, change the current week when called with an integer value + * @method int|static weekOfYear(?int $week = null) Return the value of the week starting from the beginning of the current year when called with no parameters, change the current week when called with an integer value + * @method int weeksInCentury() Return the number of weeks contained in the current century + * @method int weeksInDecade() Return the number of weeks contained in the current decade + * @method int weeksInMillennium() Return the number of weeks contained in the current millennium + * @method int weeksInMonth() Return the number of weeks contained in the current month + * @method int weeksInQuarter() Return the number of weeks contained in the current quarter + * @method int|static yearOfCentury(?int $year = null) Return the value of the year starting from the beginning of the current century when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfDecade(?int $year = null) Return the value of the year starting from the beginning of the current decade when called with no parameters, change the current year when called with an integer value + * @method int|static yearOfMillennium(?int $year = null) Return the value of the year starting from the beginning of the current millennium when called with no parameters, change the current year when called with an integer value + * @method int yearsInCentury() Return the number of years contained in the current century + * @method int yearsInDecade() Return the number of years contained in the current decade + * @method int yearsInMillennium() Return the number of years contained in the current millennium + * + * + */ +trait Date +{ + use Boundaries; + use Comparison; + use Converter; + use Creator; + use Difference; + use Macro; + use MagicParameter; + use Modifiers; + use Mutability; + use ObjectInitialisation; + use Options; + use Rounding; + use Serialization; + use Test; + use Timestamp; + use Units; + use Week; + + /** + * Names of days of the week. + * + * @var array + */ + protected static $days = [ + // @call isDayOfWeek + CarbonInterface::SUNDAY => 'Sunday', + // @call isDayOfWeek + CarbonInterface::MONDAY => 'Monday', + // @call isDayOfWeek + CarbonInterface::TUESDAY => 'Tuesday', + // @call isDayOfWeek + CarbonInterface::WEDNESDAY => 'Wednesday', + // @call isDayOfWeek + CarbonInterface::THURSDAY => 'Thursday', + // @call isDayOfWeek + CarbonInterface::FRIDAY => 'Friday', + // @call isDayOfWeek + CarbonInterface::SATURDAY => 'Saturday', + ]; + + /** + * List of unit and magic methods associated as doc-comments. + * + * @var array + */ + protected static $units = [ + // @call setUnit + // @call addUnit + 'year', + // @call setUnit + // @call addUnit + 'month', + // @call setUnit + // @call addUnit + 'day', + // @call setUnit + // @call addUnit + 'hour', + // @call setUnit + // @call addUnit + 'minute', + // @call setUnit + // @call addUnit + 'second', + // @call setUnit + // @call addUnit + 'milli', + // @call setUnit + // @call addUnit + 'millisecond', + // @call setUnit + // @call addUnit + 'micro', + // @call setUnit + // @call addUnit + 'microsecond', + ]; + + /** + * Creates a DateTimeZone from a string, DateTimeZone or integer offset. + * + * @param DateTimeZone|string|int|false|null $object original value to get CarbonTimeZone from it. + * @param DateTimeZone|string|int|false|null $objectDump dump of the object for error messages. + * + * @throws InvalidTimeZoneException + * + * @return CarbonTimeZone|null + */ + protected static function safeCreateDateTimeZone( + DateTimeZone|string|int|false|null $object, + DateTimeZone|string|int|false|null $objectDump = null, + ): ?CarbonTimeZone { + return CarbonTimeZone::instance($object, $objectDump); + } + + /** + * Get the TimeZone associated with the Carbon instance (as CarbonTimeZone). + * + * @link https://php.net/manual/en/datetime.gettimezone.php + */ + public function getTimezone(): CarbonTimeZone + { + return $this->transmitFactory(fn () => CarbonTimeZone::instance(parent::getTimezone())); + } + + /** + * List of minimum and maximums for each unit. + */ + protected static function getRangesByUnit(int $daysInMonth = 31): array + { + return [ + // @call roundUnit + 'year' => [1, 9999], + // @call roundUnit + 'month' => [1, static::MONTHS_PER_YEAR], + // @call roundUnit + 'day' => [1, $daysInMonth], + // @call roundUnit + 'hour' => [0, static::HOURS_PER_DAY - 1], + // @call roundUnit + 'minute' => [0, static::MINUTES_PER_HOUR - 1], + // @call roundUnit + 'second' => [0, static::SECONDS_PER_MINUTE - 1], + ]; + } + + /** + * Get a copy of the instance. + * + * @return static + */ + public function copy() + { + return clone $this; + } + + /** + * @alias copy + * + * Get a copy of the instance. + * + * @return static + */ + public function clone() + { + return clone $this; + } + + /** + * Clone the current instance if it's mutable. + * + * This method is convenient to ensure you don't mutate the initial object + * but avoid to make a useless copy of it if it's already immutable. + * + * @return static + */ + public function avoidMutation(): static + { + if ($this instanceof DateTimeImmutable) { + return $this; + } + + return clone $this; + } + + /** + * Returns a present instance in the same timezone. + * + * @return static + */ + public function nowWithSameTz(): static + { + $timezone = $this->getTimezone(); + + return $this->getClock()?->nowAs(static::class, $timezone) ?? static::now($timezone); + } + + /** + * Return the Carbon instance passed through, a now instance in the same timezone + * if null given or parse the input if string given. + * + * @param Carbon|\Carbon\CarbonPeriod|\Carbon\CarbonInterval|\DateInterval|\DatePeriod|DateTimeInterface|string|null $date + * + * @return static + */ + public function carbonize($date = null) + { + if ($date instanceof DateInterval) { + return $this->avoidMutation()->add($date); + } + + if ($date instanceof DatePeriod || $date instanceof CarbonPeriod) { + $date = $date->getStartDate(); + } + + return $this->resolveCarbon($date); + } + + /////////////////////////////////////////////////////////////////// + ///////////////////////// GETTERS AND SETTERS ///////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Get a part of the Carbon object. + * + * @throws UnknownGetterException + * + * @return string|int|bool|DateTimeZone|null + */ + public function __get(string $name): mixed + { + return $this->get($name); + } + + /** + * Get a part of the Carbon object. + * + * @throws UnknownGetterException + * + * @return string|int|bool|DateTimeZone + */ + public function get(Unit|string $name): mixed + { + static $localizedFormats = [ + // @property string the day of week in current locale + 'localeDayOfWeek' => 'dddd', + // @property string the abbreviated day of week in current locale + 'shortLocaleDayOfWeek' => 'ddd', + // @property string the month in current locale + 'localeMonth' => 'MMMM', + // @property string the abbreviated month in current locale + 'shortLocaleMonth' => 'MMM', + ]; + + $name = Unit::toName($name); + + if (isset($localizedFormats[$name])) { + return $this->isoFormat($localizedFormats[$name]); + } + + static $formats = [ + // @property int + 'year' => 'Y', + // @property int + 'yearIso' => 'o', + // @--property-read int + // @--property-write Month|int + // @property int + 'month' => 'n', + // @property int + 'day' => 'j', + // @property int + 'hour' => 'G', + // @property int + 'minute' => 'i', + // @property int + 'second' => 's', + // @property int + 'micro' => 'u', + // @property int + 'microsecond' => 'u', + // @property int 0 (for Sunday) through 6 (for Saturday) + 'dayOfWeek' => 'w', + // @property int 1 (for Monday) through 7 (for Sunday) + 'dayOfWeekIso' => 'N', + // @property int ISO-8601 week number of year, weeks starting on Monday + 'weekOfYear' => 'W', + // @property-read int number of days in the given month + 'daysInMonth' => 't', + // @property int|float|string seconds since the Unix Epoch + 'timestamp' => 'U', + // @property-read string "am"/"pm" (Ante meridiem or Post meridiem latin lowercase mark) + 'latinMeridiem' => 'a', + // @property-read string "AM"/"PM" (Ante meridiem or Post meridiem latin uppercase mark) + 'latinUpperMeridiem' => 'A', + // @property string the day of week in English + 'englishDayOfWeek' => 'l', + // @property string the abbreviated day of week in English + 'shortEnglishDayOfWeek' => 'D', + // @property string the month in English + 'englishMonth' => 'F', + // @property string the abbreviated month in English + 'shortEnglishMonth' => 'M', + // @property-read string $timezoneAbbreviatedName the current timezone abbreviated name + 'timezoneAbbreviatedName' => 'T', + // @property-read string $tzAbbrName alias of $timezoneAbbreviatedName + 'tzAbbrName' => 'T', + ]; + + switch (true) { + case isset($formats[$name]): + $value = $this->rawFormat($formats[$name]); + + return is_numeric($value) ? (int) $value : $value; + + // @property-read string long name of weekday translated according to Carbon locale, in english if no translation available for current language + case $name === 'dayName': + return $this->getTranslatedDayName(); + // @property-read string short name of weekday translated according to Carbon locale, in english if no translation available for current language + case $name === 'shortDayName': + return $this->getTranslatedShortDayName(); + // @property-read string very short name of weekday translated according to Carbon locale, in english if no translation available for current language + case $name === 'minDayName': + return $this->getTranslatedMinDayName(); + // @property-read string long name of month translated according to Carbon locale, in english if no translation available for current language + case $name === 'monthName': + return $this->getTranslatedMonthName(); + // @property-read string short name of month translated according to Carbon locale, in english if no translation available for current language + case $name === 'shortMonthName': + return $this->getTranslatedShortMonthName(); + // @property-read string lowercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + case $name === 'meridiem': + return $this->meridiem(true); + // @property-read string uppercase meridiem mark translated according to Carbon locale, in latin if no translation available for current language + case $name === 'upperMeridiem': + return $this->meridiem(); + // @property-read int current hour from 1 to 24 + case $name === 'noZeroHour': + return $this->hour ?: 24; + // @property int + case $name === 'milliseconds': + // @property int + case $name === 'millisecond': + // @property int + case $name === 'milli': + return (int) floor(((int) $this->rawFormat('u')) / 1000); + + // @property int 1 through 53 + case $name === 'week': + return (int) $this->week(); + + // @property int 1 through 53 + case $name === 'isoWeek': + return (int) $this->isoWeek(); + + // @property int year according to week format + case $name === 'weekYear': + return (int) $this->weekYear(); + + // @property int year according to ISO week format + case $name === 'isoWeekYear': + return (int) $this->isoWeekYear(); + + // @property-read int 51 through 53 + case $name === 'weeksInYear': + return $this->weeksInYear(); + + // @property-read int 51 through 53 + case $name === 'isoWeeksInYear': + return $this->isoWeeksInYear(); + + // @property int 1 through 5 + case $name === 'weekOfMonth': + return (int) ceil($this->day / static::DAYS_PER_WEEK); + + // @property-read int 1 through 5 + case $name === 'weekNumberInMonth': + return (int) ceil(($this->day + $this->avoidMutation()->startOfMonth()->dayOfWeekIso - 1) / static::DAYS_PER_WEEK); + + // @property-read int 0 through 6 + case $name === 'firstWeekDay': + return (int) $this->getTranslationMessage('first_day_of_week'); + + // @property-read int 0 through 6 + case $name === 'lastWeekDay': + return $this->transmitFactory(fn () => static::weekRotate((int) $this->getTranslationMessage('first_day_of_week'), -1)); + + // @property int 1 through 366 + case $name === 'dayOfYear': + return 1 + (int) ($this->rawFormat('z')); + + // @property-read int 365 or 366 + case $name === 'daysInYear': + return static::DAYS_PER_YEAR + ($this->isLeapYear() ? 1 : 0); + + // @property int does a diffInYears() with default parameters + case $name === 'age': + return (int) $this->diffInYears(); + + // @property-read int the quarter of this instance, 1 - 4 + case $name === 'quarter': + return (int) ceil($this->month / static::MONTHS_PER_QUARTER); + + // @property-read int the decade of this instance + // @call isSameUnit + case $name === 'decade': + return (int) ceil($this->year / static::YEARS_PER_DECADE); + + // @property-read int the century of this instance + // @call isSameUnit + case $name === 'century': + $factor = 1; + $year = $this->year; + + if ($year < 0) { + $year = -$year; + $factor = -1; + } + + return (int) ($factor * ceil($year / static::YEARS_PER_CENTURY)); + + // @property-read int the millennium of this instance + // @call isSameUnit + case $name === 'millennium': + $factor = 1; + $year = $this->year; + + if ($year < 0) { + $year = -$year; + $factor = -1; + } + + return (int) ($factor * ceil($year / static::YEARS_PER_MILLENNIUM)); + + // @property int the timezone offset in seconds from UTC + case $name === 'offset': + return $this->getOffset(); + + // @property int the timezone offset in minutes from UTC + case $name === 'offsetMinutes': + return $this->getOffset() / static::SECONDS_PER_MINUTE; + + // @property int the timezone offset in hours from UTC + case $name === 'offsetHours': + return $this->getOffset() / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR; + + // @property-read bool daylight savings time indicator, true if DST, false otherwise + case $name === 'dst': + return $this->rawFormat('I') === '1'; + + // @property-read bool checks if the timezone is local, true if local, false otherwise + case $name === 'local': + return $this->getOffset() === $this->avoidMutation()->setTimezone(date_default_timezone_get())->getOffset(); + + // @property-read bool checks if the timezone is UTC, true if UTC, false otherwise + case $name === 'utc': + return $this->getOffset() === 0; + + // @--property-write DateTimeZone|string|int $timezone the current timezone + // @--property-write DateTimeZone|string|int $tz alias of $timezone + // @--property-read CarbonTimeZone $timezone the current timezone + // @--property-read CarbonTimeZone $tz alias of $timezone + // @property CarbonTimeZone $timezone the current timezone + // @property CarbonTimeZone $tz alias of $timezone + case $name === 'timezone' || $name === 'tz': + return $this->getTimezone(); + + // @property-read string $timezoneName the current timezone name + // @property-read string $tzName alias of $timezoneName + case $name === 'timezoneName' || $name === 'tzName': + return $this->getTimezone()->getName(); + + // @property-read string locale of the current instance + case $name === 'locale': + return $this->getTranslatorLocale(); + + case preg_match('/^([a-z]{2,})(In|Of)([A-Z][a-z]+)$/', $name, $match): + [, $firstUnit, $operator, $secondUnit] = $match; + + try { + $start = $this->avoidMutation()->startOf($secondUnit); + $value = $operator === 'Of' + ? (\in_array($firstUnit, [ + // Unit with indexes starting at 1 (other units start at 0) + 'day', + 'week', + 'month', + 'quarter', + ], true) ? 1 : 0) + floor($start->diffInUnit($firstUnit, $this)) + : round($start->diffInUnit($firstUnit, $start->avoidMutation()->add($secondUnit, 1))); + + return (int) $value; + } catch (UnknownUnitException) { + // default to macro + } + + default: + $macro = $this->getLocalMacro('get'.ucfirst($name)); + + if ($macro) { + return $this->executeCallableWithContext($macro); + } + + throw new UnknownGetterException($name); + } + } + + /** + * Check if an attribute exists on the object + * + * @param string $name + * + * @return bool + */ + public function __isset($name) + { + try { + $this->__get($name); + } catch (UnknownGetterException | ReflectionException) { + return false; + } + + return true; + } + + /** + * Set a part of the Carbon object + * + * @param string $name + * @param string|int|DateTimeZone $value + * + * @throws UnknownSetterException|ReflectionException + * + * @return void + */ + public function __set($name, $value) + { + if ($this->constructedObjectId === spl_object_hash($this)) { + $this->set($name, $value); + + return; + } + + $this->$name = $value; + } + + /** + * Set a part of the Carbon object. + * + * @throws ImmutableException|UnknownSetterException + * + * @return $this + */ + public function set(Unit|array|string $name, DateTimeZone|Month|string|int|float|null $value = null): static + { + if ($this->isImmutable()) { + throw new ImmutableException(\sprintf('%s class', static::class)); + } + + if (\is_array($name)) { + foreach ($name as $key => $value) { + $this->set($key, $value); + } + + return $this; + } + + $name = Unit::toName($name); + + switch ($name) { + case 'milliseconds': + case 'millisecond': + case 'milli': + case 'microseconds': + case 'microsecond': + case 'micro': + if (str_starts_with($name, 'milli')) { + $value *= 1000; + } + + while ($value < 0) { + $this->subSecond(); + $value += static::MICROSECONDS_PER_SECOND; + } + + while ($value >= static::MICROSECONDS_PER_SECOND) { + $this->addSecond(); + $value -= static::MICROSECONDS_PER_SECOND; + } + + $this->modify($this->rawFormat('H:i:s.').str_pad((string) round($value), 6, '0', STR_PAD_LEFT)); + + break; + + case 'year': + case 'month': + case 'day': + case 'hour': + case 'minute': + case 'second': + [$year, $month, $day, $hour, $minute, $second] = array_map('intval', explode('-', $this->rawFormat('Y-n-j-G-i-s'))); + $$name = self::monthToInt($value, $name); + $this->setDateTime($year, $month, $day, $hour, $minute, $second); + + break; + + case 'week': + $this->week($value); + + break; + + case 'isoWeek': + $this->isoWeek($value); + + break; + + case 'weekYear': + $this->weekYear($value); + + break; + + case 'isoWeekYear': + $this->isoWeekYear($value); + + break; + + case 'dayOfYear': + $this->addDays($value - $this->dayOfYear); + + break; + + case 'dayOfWeek': + $this->addDays($value - $this->dayOfWeek); + + break; + + case 'dayOfWeekIso': + $this->addDays($value - $this->dayOfWeekIso); + + break; + + case 'timestamp': + $this->setTimestamp($value); + + break; + + case 'offset': + $this->setTimezone(static::safeCreateDateTimeZone($value / static::SECONDS_PER_MINUTE / static::MINUTES_PER_HOUR)); + + break; + + case 'offsetMinutes': + $this->setTimezone(static::safeCreateDateTimeZone($value / static::MINUTES_PER_HOUR)); + + break; + + case 'offsetHours': + $this->setTimezone(static::safeCreateDateTimeZone($value)); + + break; + + case 'timezone': + case 'tz': + $this->setTimezone($value); + + break; + + default: + if (preg_match('/^([a-z]{2,})Of([A-Z][a-z]+)$/', $name, $match)) { + [, $firstUnit, $secondUnit] = $match; + + try { + $start = $this->avoidMutation()->startOf($secondUnit); + $currentValue = (\in_array($firstUnit, [ + // Unit with indexes starting at 1 (other units start at 0) + 'day', + 'week', + 'month', + 'quarter', + ], true) ? 1 : 0) + (int) floor($start->diffInUnit($firstUnit, $this)); + + // We check $value a posteriori to give precedence to UnknownUnitException + if (!\is_int($value)) { + throw new UnitException("->$name expects integer value"); + } + + $this->addUnit($firstUnit, $value - $currentValue); + + break; + } catch (UnknownUnitException) { + // default to macro + } + } + + $macro = $this->getLocalMacro('set'.ucfirst($name)); + + if ($macro) { + $this->executeCallableWithContext($macro, $value); + + break; + } + + if ($this->isLocalStrictModeEnabled()) { + throw new UnknownSetterException($name); + } + + $this->$name = $value; + } + + return $this; + } + + /** + * Get the translation of the current week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + * @param string $keySuffix "", "_short" or "_min" + * @param string|null $defaultValue default value if translation missing + */ + public function getTranslatedDayName( + ?string $context = null, + string $keySuffix = '', + ?string $defaultValue = null, + ): string { + return $this->getTranslatedFormByRegExp('weekdays', $keySuffix, $context, $this->dayOfWeek, $defaultValue ?: $this->englishDayOfWeek); + } + + /** + * Get the translation of the current short week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedShortDayName(?string $context = null): string + { + return $this->getTranslatedDayName($context, '_short', $this->shortEnglishDayOfWeek); + } + + /** + * Get the translation of the current abbreviated week day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedMinDayName(?string $context = null): string + { + return $this->getTranslatedDayName($context, '_min', $this->shortEnglishDayOfWeek); + } + + /** + * Get the translation of the current month day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + * @param string $keySuffix "" or "_short" + * @param string|null $defaultValue default value if translation missing + */ + public function getTranslatedMonthName( + ?string $context = null, + string $keySuffix = '', + ?string $defaultValue = null, + ): string { + return $this->getTranslatedFormByRegExp('months', $keySuffix, $context, $this->month - 1, $defaultValue ?: $this->englishMonth); + } + + /** + * Get the translation of the current short month day name (with context for languages with multiple forms). + * + * @param string|null $context whole format string + */ + public function getTranslatedShortMonthName(?string $context = null): string + { + return $this->getTranslatedMonthName($context, '_short', $this->shortEnglishMonth); + } + + /** + * Get/set the day of year. + * + * @template T of int|null + * + * @param int|null $value new value for day of year if using as setter. + * + * @psalm-param T $value + * + * @return static|int + * + * @psalm-return (T is int ? static : int) + */ + public function dayOfYear(?int $value = null): static|int + { + $dayOfYear = $this->dayOfYear; + + return $value === null ? $dayOfYear : $this->addDays($value - $dayOfYear); + } + + /** + * Get/set the weekday from 0 (Sunday) to 6 (Saturday). + * + * @param WeekDay|int|null $value new value for weekday if using as setter. + */ + public function weekday(WeekDay|int|null $value = null): static|int + { + if ($value === null) { + return $this->dayOfWeek; + } + + $firstDay = (int) ($this->getTranslationMessage('first_day_of_week') ?? 0); + $dayOfWeek = ($this->dayOfWeek + 7 - $firstDay) % 7; + + return $this->addDays(((WeekDay::int($value) + 7 - $firstDay) % 7) - $dayOfWeek); + } + + /** + * Get/set the ISO weekday from 1 (Monday) to 7 (Sunday). + * + * @param WeekDay|int|null $value new value for weekday if using as setter. + */ + public function isoWeekday(WeekDay|int|null $value = null): static|int + { + $dayOfWeekIso = $this->dayOfWeekIso; + + return $value === null ? $dayOfWeekIso : $this->addDays(WeekDay::int($value) - $dayOfWeekIso); + } + + /** + * Return the number of days since the start of the week (using the current locale or the first parameter + * if explicitly given). + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, + * if not provided, start of week is inferred from the locale + * (Sunday for en_US, Monday for de_DE, etc.) + */ + public function getDaysFromStartOfWeek(WeekDay|int|null $weekStartsAt = null): int + { + $firstDay = (int) (WeekDay::int($weekStartsAt) ?? $this->getTranslationMessage('first_day_of_week') ?? 0); + + return ($this->dayOfWeek + 7 - $firstDay) % 7; + } + + /** + * Set the day (keeping the current time) to the start of the week + the number of days passed as the first + * parameter. First day of week is driven by the locale unless explicitly set with the second parameter. + * + * @param int $numberOfDays number of days to add after the start of the current week + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week, + * if not provided, start of week is inferred from the locale + * (Sunday for en_US, Monday for de_DE, etc.) + */ + public function setDaysFromStartOfWeek(int $numberOfDays, WeekDay|int|null $weekStartsAt = null): static + { + return $this->addDays($numberOfDays - $this->getDaysFromStartOfWeek(WeekDay::int($weekStartsAt))); + } + + /** + * Set any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value new value for the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function setUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static + { + try { + $start = $this->avoidMutation()->startOf($overflowUnit); + $end = $this->avoidMutation()->endOf($overflowUnit); + /** @var static $date */ + $date = $this->$valueUnit($value); + + if ($date < $start) { + return $date->mutateIfMutable($start); + } + + if ($date > $end) { + return $date->mutateIfMutable($end); + } + + return $date; + } catch (BadMethodCallException | ReflectionException $exception) { + throw new UnknownUnitException($valueUnit, 0, $exception); + } + } + + /** + * Add any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value amount to add to the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function addUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static + { + return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit + $value, $overflowUnit); + } + + /** + * Subtract any unit to a new value without overflowing current other unit given. + * + * @param string $valueUnit unit name to modify + * @param int $value amount to subtract to the input unit + * @param string $overflowUnit unit name to not overflow + */ + public function subUnitNoOverflow(string $valueUnit, int $value, string $overflowUnit): static + { + return $this->setUnitNoOverflow($valueUnit, $this->$valueUnit - $value, $overflowUnit); + } + + /** + * Returns the minutes offset to UTC if no arguments passed, else set the timezone with given minutes shift passed. + */ + public function utcOffset(?int $minuteOffset = null): static|int + { + if ($minuteOffset === null) { + return $this->offsetMinutes; + } + + return $this->setTimezone(CarbonTimeZone::createFromMinuteOffset($minuteOffset)); + } + + /** + * Set the date with gregorian year, month and day numbers. + * + * @see https://php.net/manual/en/datetime.setdate.php + */ + public function setDate(int $year, int $month, int $day): static + { + return parent::setDate($year, $month, $day); + } + + /** + * Set a date according to the ISO 8601 standard - using weeks and day offsets rather than specific dates. + * + * @see https://php.net/manual/en/datetime.setisodate.php + */ + public function setISODate(int $year, int $week, int $day = 1): static + { + return parent::setISODate($year, $week, $day); + } + + /** + * Set the date and time all together. + */ + public function setDateTime( + int $year, + int $month, + int $day, + int $hour, + int $minute, + int $second = 0, + int $microseconds = 0, + ): static { + return $this->setDate($year, $month, $day)->setTime($hour, $minute, $second, $microseconds); + } + + /** + * Resets the current time of the DateTime object to a different time. + * + * @see https://php.net/manual/en/datetime.settime.php + */ + public function setTime(int $hour, int $minute, int $second = 0, int $microseconds = 0): static + { + return parent::setTime($hour, $minute, $second, $microseconds); + } + + /** + * Set the instance's timestamp. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public function setTimestamp(float|int|string $timestamp): static + { + [$seconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp); + + return parent::setTimestamp((int) $seconds)->setMicroseconds((int) $microseconds); + } + + /** + * Set the time by time string. + */ + public function setTimeFromTimeString(string $time): static + { + if (!str_contains($time, ':')) { + $time .= ':0'; + } + + return $this->modify($time); + } + + /** + * @alias setTimezone + */ + public function timezone(DateTimeZone|string|int $value): static + { + return $this->setTimezone($value); + } + + /** + * Set the timezone or returns the timezone name if no arguments passed. + * + * @return ($value is null ? string : static) + */ + public function tz(DateTimeZone|string|int|null $value = null): static|string + { + if ($value === null) { + return $this->tzName; + } + + return $this->setTimezone($value); + } + + /** + * Set the instance's timezone from a string or object. + */ + public function setTimezone(DateTimeZone|string|int $timeZone): static + { + return parent::setTimezone(static::safeCreateDateTimeZone($timeZone)); + } + + /** + * Set the instance's timezone from a string or object and add/subtract the offset difference. + */ + public function shiftTimezone(DateTimeZone|string $value): static + { + $dateTimeString = $this->format('Y-m-d H:i:s.u'); + + return $this + ->setTimezone($value) + ->modify($dateTimeString); + } + + /** + * Set the instance's timezone to UTC. + */ + public function utc(): static + { + return $this->setTimezone('UTC'); + } + + /** + * Set the year, month, and date for this instance to that of the passed instance. + */ + public function setDateFrom(DateTimeInterface|string $date): static + { + $date = $this->resolveCarbon($date); + + return $this->setDate($date->year, $date->month, $date->day); + } + + /** + * Set the hour, minute, second and microseconds for this instance to that of the passed instance. + */ + public function setTimeFrom(DateTimeInterface|string $date): static + { + $date = $this->resolveCarbon($date); + + return $this->setTime($date->hour, $date->minute, $date->second, $date->microsecond); + } + + /** + * Set the date and time for this instance to that of the passed instance. + */ + public function setDateTimeFrom(DateTimeInterface|string $date): static + { + $date = $this->resolveCarbon($date); + + return $this->modify($date->rawFormat('Y-m-d H:i:s.u')); + } + + /** + * Get the days of the week. + */ + public static function getDays(): array + { + return static::$days; + } + + /////////////////////////////////////////////////////////////////// + /////////////////////// WEEK SPECIAL DAYS ///////////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Get the first day of week. + * + * @return int + */ + public static function getWeekStartsAt(?string $locale = null): int + { + return (int) static::getTranslationMessageWith( + $locale ? Translator::get($locale) : static::getTranslator(), + 'first_day_of_week', + ); + } + + /** + * Get the last day of week. + * + * @param string $locale local to consider the last day of week. + * + * @return int + */ + public static function getWeekEndsAt(?string $locale = null): int + { + return static::weekRotate(static::getWeekStartsAt($locale), -1); + } + + /** + * Get weekend days + */ + public static function getWeekendDays(): array + { + return FactoryImmutable::getInstance()->getWeekendDays(); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider week-end is always saturday and sunday, and if you have some custom + * week-end days to handle, give to those days an other name and create a macro for them: + * + * ``` + * Carbon::macro('isDayOff', function ($date) { + * return $date->isSunday() || $date->isMonday(); + * }); + * Carbon::macro('isNotDayOff', function ($date) { + * return !$date->isDayOff(); + * }); + * if ($someDate->isDayOff()) ... + * if ($someDate->isNotDayOff()) ... + * // Add 5 not-off days + * $count = 5; + * while ($someDate->isDayOff() || ($count-- > 0)) { + * $someDate->addDay(); + * } + * ``` + * + * Set weekend days + */ + public static function setWeekendDays(array $days): void + { + FactoryImmutable::getDefaultInstance()->setWeekendDays($days); + } + + /** + * Determine if a time string will produce a relative date. + * + * @return bool true if time match a relative date, false if absolute or invalid time string + */ + public static function hasRelativeKeywords(?string $time): bool + { + if (!$time || strtotime($time) === false) { + return false; + } + + $date1 = new DateTime('2000-01-01T00:00:00Z'); + $date1->modify($time); + $date2 = new DateTime('2001-12-25T00:00:00Z'); + $date2->modify($time); + + return $date1 != $date2; + } + + /////////////////////////////////////////////////////////////////// + /////////////////////// STRING FORMATTING ///////////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Returns list of locale formats for ISO formatting. + * + * @param string|null $locale current locale used if null + */ + public function getIsoFormats(?string $locale = null): array + { + return [ + 'LT' => $this->getTranslationMessage('formats.LT', $locale), + 'LTS' => $this->getTranslationMessage('formats.LTS', $locale), + 'L' => $this->getTranslationMessage('formats.L', $locale), + 'LL' => $this->getTranslationMessage('formats.LL', $locale), + 'LLL' => $this->getTranslationMessage('formats.LLL', $locale), + 'LLLL' => $this->getTranslationMessage('formats.LLLL', $locale), + 'l' => $this->getTranslationMessage('formats.l', $locale), + 'll' => $this->getTranslationMessage('formats.ll', $locale), + 'lll' => $this->getTranslationMessage('formats.lll', $locale), + 'llll' => $this->getTranslationMessage('formats.llll', $locale), + ]; + } + + /** + * Returns list of calendar formats for ISO formatting. + * + * @param string|null $locale current locale used if null + */ + public function getCalendarFormats(?string $locale = null): array + { + return [ + 'sameDay' => $this->getTranslationMessage('calendar.sameDay', $locale, '[Today at] LT'), + 'nextDay' => $this->getTranslationMessage('calendar.nextDay', $locale, '[Tomorrow at] LT'), + 'nextWeek' => $this->getTranslationMessage('calendar.nextWeek', $locale, 'dddd [at] LT'), + 'lastDay' => $this->getTranslationMessage('calendar.lastDay', $locale, '[Yesterday at] LT'), + 'lastWeek' => $this->getTranslationMessage('calendar.lastWeek', $locale, '[Last] dddd [at] LT'), + 'sameElse' => $this->getTranslationMessage('calendar.sameElse', $locale, 'L'), + ]; + } + + /** + * Returns list of locale units for ISO formatting. + */ + public static function getIsoUnits(): array + { + static $units = null; + + $units ??= [ + 'OD' => ['getAltNumber', ['day']], + 'OM' => ['getAltNumber', ['month']], + 'OY' => ['getAltNumber', ['year']], + 'OH' => ['getAltNumber', ['hour']], + 'Oh' => ['getAltNumber', ['h']], + 'Om' => ['getAltNumber', ['minute']], + 'Os' => ['getAltNumber', ['second']], + 'D' => 'day', + 'DD' => ['rawFormat', ['d']], + 'Do' => ['ordinal', ['day', 'D']], + 'd' => 'dayOfWeek', + 'dd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedMinDayName( + $originalFormat, + ), + 'ddd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedShortDayName( + $originalFormat, + ), + 'dddd' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedDayName( + $originalFormat, + ), + 'DDD' => 'dayOfYear', + 'DDDD' => ['getPaddedUnit', ['dayOfYear', 3]], + 'DDDo' => ['ordinal', ['dayOfYear', 'DDD']], + 'e' => ['weekday', []], + 'E' => 'dayOfWeekIso', + 'H' => ['rawFormat', ['G']], + 'HH' => ['rawFormat', ['H']], + 'h' => ['rawFormat', ['g']], + 'hh' => ['rawFormat', ['h']], + 'k' => 'noZeroHour', + 'kk' => ['getPaddedUnit', ['noZeroHour']], + 'hmm' => ['rawFormat', ['gi']], + 'hmmss' => ['rawFormat', ['gis']], + 'Hmm' => ['rawFormat', ['Gi']], + 'Hmmss' => ['rawFormat', ['Gis']], + 'm' => 'minute', + 'mm' => ['rawFormat', ['i']], + 'a' => 'meridiem', + 'A' => 'upperMeridiem', + 's' => 'second', + 'ss' => ['getPaddedUnit', ['second']], + 'S' => static fn (CarbonInterface $date) => (string) floor($date->micro / 100000), + 'SS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 10000, 2), + 'SSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 1000, 3), + 'SSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 100, 4), + 'SSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro / 10, 5), + 'SSSSSS' => ['getPaddedUnit', ['micro', 6]], + 'SSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 10, 7), + 'SSSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 100, 8), + 'SSSSSSSSS' => static fn (CarbonInterface $date) => self::floorZeroPad($date->micro * 1000, 9), + 'M' => 'month', + 'MM' => ['rawFormat', ['m']], + 'MMM' => static function (CarbonInterface $date, $originalFormat = null) { + $month = $date->getTranslatedShortMonthName($originalFormat); + $suffix = $date->getTranslationMessage('mmm_suffix'); + if ($suffix && $month !== $date->monthName) { + $month .= $suffix; + } + + return $month; + }, + 'MMMM' => static fn (CarbonInterface $date, $originalFormat = null) => $date->getTranslatedMonthName( + $originalFormat, + ), + 'Mo' => ['ordinal', ['month', 'M']], + 'Q' => 'quarter', + 'Qo' => ['ordinal', ['quarter', 'M']], + 'G' => 'isoWeekYear', + 'GG' => ['getPaddedUnit', ['isoWeekYear']], + 'GGG' => ['getPaddedUnit', ['isoWeekYear', 3]], + 'GGGG' => ['getPaddedUnit', ['isoWeekYear', 4]], + 'GGGGG' => ['getPaddedUnit', ['isoWeekYear', 5]], + 'g' => 'weekYear', + 'gg' => ['getPaddedUnit', ['weekYear']], + 'ggg' => ['getPaddedUnit', ['weekYear', 3]], + 'gggg' => ['getPaddedUnit', ['weekYear', 4]], + 'ggggg' => ['getPaddedUnit', ['weekYear', 5]], + 'W' => 'isoWeek', + 'WW' => ['getPaddedUnit', ['isoWeek']], + 'Wo' => ['ordinal', ['isoWeek', 'W']], + 'w' => 'week', + 'ww' => ['getPaddedUnit', ['week']], + 'wo' => ['ordinal', ['week', 'w']], + 'x' => ['valueOf', []], + 'X' => 'timestamp', + 'Y' => 'year', + 'YY' => ['rawFormat', ['y']], + 'YYYY' => ['getPaddedUnit', ['year', 4]], + 'YYYYY' => ['getPaddedUnit', ['year', 5]], + 'YYYYYY' => static fn (CarbonInterface $date) => ($date->year < 0 ? '' : '+'). + $date->getPaddedUnit('year', 6), + 'z' => ['rawFormat', ['T']], + 'zz' => 'tzName', + 'Z' => ['getOffsetString', []], + 'ZZ' => ['getOffsetString', ['']], + ]; + + return $units; + } + + /** + * Returns a unit of the instance padded with 0 by default or any other string if specified. + * + * @param string $unit Carbon unit name + * @param int $length Length of the output (2 by default) + * @param string $padString String to use for padding ("0" by default) + * @param int $padType Side(s) to pad (STR_PAD_LEFT by default) + */ + public function getPaddedUnit($unit, $length = 2, $padString = '0', $padType = STR_PAD_LEFT): string + { + return ($this->$unit < 0 ? '-' : '').str_pad((string) abs($this->$unit), $length, $padString, $padType); + } + + /** + * Return a property with its ordinal. + */ + public function ordinal(string $key, ?string $period = null): string + { + $number = $this->$key; + $result = $this->translate('ordinal', [ + ':number' => $number, + ':period' => (string) $period, + ]); + + return (string) ($result === 'ordinal' ? $number : $result); + } + + /** + * Return the meridiem of the current time in the current locale. + * + * @param bool $isLower if true, returns lowercase variant if available in the current locale. + */ + public function meridiem(bool $isLower = false): string + { + $hour = $this->hour; + $index = $hour < static::HOURS_PER_DAY / 2 ? 0 : 1; + + if ($isLower) { + $key = 'meridiem.'.($index + 2); + $result = $this->translate($key); + + if ($result !== $key) { + return $result; + } + } + + $key = "meridiem.$index"; + $result = $this->translate($key); + if ($result === $key) { + $result = $this->translate('meridiem', [ + ':hour' => $this->hour, + ':minute' => $this->minute, + ':isLower' => $isLower, + ]); + + if ($result === 'meridiem') { + return $isLower ? $this->latinMeridiem : $this->latinUpperMeridiem; + } + } elseif ($isLower) { + $result = mb_strtolower($result); + } + + return $result; + } + + /** + * Returns the alternative number for a given date property if available in the current locale. + * + * @param string $key date property + */ + public function getAltNumber(string $key): string + { + return $this->translateNumber((int) (\strlen($key) > 1 ? $this->$key : $this->rawFormat($key))); + } + + /** + * Format in the current language using ISO replacement patterns. + * + * @param string|null $originalFormat provide context if a chunk has been passed alone + */ + public function isoFormat(string $format, ?string $originalFormat = null): string + { + $result = ''; + $length = mb_strlen($format); + $originalFormat ??= $format; + $inEscaped = false; + $formats = null; + $units = null; + + for ($i = 0; $i < $length; $i++) { + $char = mb_substr($format, $i, 1); + + if ($char === '\\') { + $result .= mb_substr($format, ++$i, 1); + + continue; + } + + if ($char === '[' && !$inEscaped) { + $inEscaped = true; + + continue; + } + + if ($char === ']' && $inEscaped) { + $inEscaped = false; + + continue; + } + + if ($inEscaped) { + $result .= $char; + + continue; + } + + $input = mb_substr($format, $i); + + if (preg_match('/^(LTS|LT|l{1,4}|L{1,4})/', $input, $match)) { + if ($formats === null) { + $formats = $this->getIsoFormats(); + } + + $code = $match[0]; + $sequence = $formats[$code] ?? preg_replace_callback( + '/MMMM|MM|DD|dddd/', + static fn ($code) => mb_substr($code[0], 1), + $formats[strtoupper($code)] ?? '', + ); + $rest = mb_substr($format, $i + mb_strlen($code)); + $format = mb_substr($format, 0, $i).$sequence.$rest; + $length = mb_strlen($format); + $input = $sequence.$rest; + } + + if (preg_match('/^'.CarbonInterface::ISO_FORMAT_REGEXP.'/', $input, $match)) { + $code = $match[0]; + + if ($units === null) { + $units = static::getIsoUnits(); + } + + $sequence = $units[$code] ?? ''; + + if ($sequence instanceof Closure) { + $sequence = $sequence($this, $originalFormat); + } elseif (\is_array($sequence)) { + try { + $sequence = $this->{$sequence[0]}(...$sequence[1]); + } catch (ReflectionException | InvalidArgumentException | BadMethodCallException) { + $sequence = ''; + } + } elseif (\is_string($sequence)) { + $sequence = $this->$sequence ?? $code; + } + + $format = mb_substr($format, 0, $i).$sequence.mb_substr($format, $i + mb_strlen($code)); + $i += mb_strlen((string) $sequence) - 1; + $length = mb_strlen($format); + $char = $sequence; + } + + $result .= $char; + } + + return $result; + } + + /** + * List of replacements from date() format to isoFormat(). + */ + public static function getFormatsToIsoReplacements(): array + { + static $replacements = null; + + $replacements ??= [ + 'd' => true, + 'D' => 'ddd', + 'j' => true, + 'l' => 'dddd', + 'N' => true, + 'S' => static fn ($date) => str_replace((string) $date->rawFormat('j'), '', $date->isoFormat('Do')), + 'w' => true, + 'z' => true, + 'W' => true, + 'F' => 'MMMM', + 'm' => true, + 'M' => 'MMM', + 'n' => true, + 't' => true, + 'L' => true, + 'o' => true, + 'Y' => true, + 'y' => true, + 'a' => 'a', + 'A' => 'A', + 'B' => true, + 'g' => true, + 'G' => true, + 'h' => true, + 'H' => true, + 'i' => true, + 's' => true, + 'u' => true, + 'v' => true, + 'E' => true, + 'I' => true, + 'O' => true, + 'P' => true, + 'Z' => true, + 'c' => true, + 'r' => true, + 'U' => true, + 'T' => true, + ]; + + return $replacements; + } + + /** + * Format as ->format() do (using date replacements patterns from https://php.net/manual/en/function.date.php) + * but translate words whenever possible (months, day names, etc.) using the current locale. + */ + public function translatedFormat(string $format): string + { + $replacements = static::getFormatsToIsoReplacements(); + $context = ''; + $isoFormat = ''; + $length = mb_strlen($format); + + for ($i = 0; $i < $length; $i++) { + $char = mb_substr($format, $i, 1); + + if ($char === '\\') { + $replacement = mb_substr($format, $i, 2); + $isoFormat .= $replacement; + $i++; + + continue; + } + + if (!isset($replacements[$char])) { + $replacement = preg_match('/^[A-Za-z]$/', $char) ? "\\$char" : $char; + $isoFormat .= $replacement; + $context .= $replacement; + + continue; + } + + $replacement = $replacements[$char]; + + if ($replacement === true) { + static $contextReplacements = null; + + if ($contextReplacements === null) { + $contextReplacements = [ + 'm' => 'MM', + 'd' => 'DD', + 't' => 'D', + 'j' => 'D', + 'N' => 'e', + 'w' => 'e', + 'n' => 'M', + 'o' => 'YYYY', + 'Y' => 'YYYY', + 'y' => 'YY', + 'g' => 'h', + 'G' => 'H', + 'h' => 'hh', + 'H' => 'HH', + 'i' => 'mm', + 's' => 'ss', + ]; + } + + $isoFormat .= '['.$this->rawFormat($char).']'; + $context .= $contextReplacements[$char] ?? ' '; + + continue; + } + + if ($replacement instanceof Closure) { + $replacement = '['.$replacement($this).']'; + $isoFormat .= $replacement; + $context .= $replacement; + + continue; + } + + $isoFormat .= $replacement; + $context .= $replacement; + } + + return $this->isoFormat($isoFormat, $context); + } + + /** + * Returns the offset hour and minute formatted with +/- and a given separator (":" by default). + * For example, if the time zone is 9 hours 30 minutes, you'll get "+09:30", with "@@" as first + * argument, "+09@@30", with "" as first argument, "+0930". Negative offset will return something + * like "-12:00". + * + * @param string $separator string to place between hours and minutes (":" by default) + */ + public function getOffsetString(string $separator = ':'): string + { + $second = $this->getOffset(); + $symbol = $second < 0 ? '-' : '+'; + $minute = abs($second) / static::SECONDS_PER_MINUTE; + $hour = self::floorZeroPad($minute / static::MINUTES_PER_HOUR, 2); + $minute = self::floorZeroPad(((int) $minute) % static::MINUTES_PER_HOUR, 2); + + return "$symbol$hour$separator$minute"; + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @throws BadMethodCallException + */ + public static function __callStatic(string $method, array $parameters): mixed + { + if (!static::hasMacro($method)) { + foreach (static::getGenericMacros() as $callback) { + try { + return static::executeStaticCallable($callback, $method, ...$parameters); + } catch (BadMethodCallException) { + continue; + } + } + + if (static::isStrictModeEnabled()) { + throw new UnknownMethodException(\sprintf('%s::%s', static::class, $method)); + } + + return null; + } + + return static::executeStaticCallable(static::getMacro($method), ...$parameters); + } + + /** + * Set specified unit to new given value. + * + * @param string $unit year, month, day, hour, minute, second or microsecond + * @param Month|int $value new value for given unit + */ + public function setUnit(string $unit, Month|int|float|null $value = null): static + { + if (\is_float($value)) { + $int = (int) $value; + + if ((float) $int !== $value) { + throw new InvalidArgumentException( + "$unit cannot be changed to float value $value, integer expected", + ); + } + + $value = $int; + } + + $unit = static::singularUnit($unit); + $value = self::monthToInt($value, $unit); + $dateUnits = ['year', 'month', 'day']; + + if (\in_array($unit, $dateUnits)) { + return $this->setDate(...array_map( + fn ($name) => (int) ($name === $unit ? $value : $this->$name), + $dateUnits, + )); + } + + $units = ['hour', 'minute', 'second', 'micro']; + + if ($unit === 'millisecond' || $unit === 'milli') { + $value *= 1000; + $unit = 'micro'; + } elseif ($unit === 'microsecond') { + $unit = 'micro'; + } + + return $this->setTime(...array_map( + fn ($name) => (int) ($name === $unit ? $value : $this->$name), + $units, + )); + } + + /** + * Returns standardized singular of a given singular/plural unit name (in English). + */ + public static function singularUnit(string $unit): string + { + $unit = rtrim(mb_strtolower($unit), 's'); + + return match ($unit) { + 'centurie' => 'century', + 'millennia' => 'millennium', + default => $unit, + }; + } + + /** + * Returns standardized plural of a given singular/plural unit name (in English). + */ + public static function pluralUnit(string $unit): string + { + $unit = rtrim(strtolower($unit), 's'); + + return match ($unit) { + 'century' => 'centuries', + 'millennium', 'millennia' => 'millennia', + default => "{$unit}s", + }; + } + + public static function sleep(int|float $seconds): void + { + if (static::hasTestNow()) { + static::setTestNow(static::getTestNow()->avoidMutation()->addSeconds($seconds)); + + return; + } + + (new NativeClock('UTC'))->sleep($seconds); + } + + /** + * Dynamically handle calls to the class. + * + * @param string $method magic method name called + * @param array $parameters parameters list + * + * @throws UnknownMethodException|BadMethodCallException|ReflectionException|Throwable + */ + public function __call(string $method, array $parameters): mixed + { + $unit = rtrim($method, 's'); + + return $this->callDiffAlias($unit, $parameters) + ?? $this->callHumanDiffAlias($unit, $parameters) + ?? $this->callRoundMethod($unit, $parameters) + ?? $this->callIsMethod($unit, $parameters) + ?? $this->callModifierMethod($unit, $parameters) + ?? $this->callPeriodMethod($method, $parameters) + ?? $this->callGetOrSetMethod($method, $parameters) + ?? $this->callMacroMethod($method, $parameters); + } + + /** + * Return the Carbon instance passed through, a now instance in the same timezone + * if null given or parse the input if string given. + */ + protected function resolveCarbon(DateTimeInterface|string|null $date): self + { + if (!$date) { + return $this->nowWithSameTz(); + } + + if (\is_string($date)) { + return $this->transmitFactory(fn () => static::parse($date, $this->getTimezone())); + } + + return $date instanceof self ? $date : $this->transmitFactory(static fn () => static::instance($date)); + } + + protected static function weekRotate(int $day, int $rotation): int + { + return (static::DAYS_PER_WEEK + $rotation % static::DAYS_PER_WEEK + $day) % static::DAYS_PER_WEEK; + } + + protected function executeCallable(callable $macro, ...$parameters) + { + if ($macro instanceof Closure) { + $boundMacro = @$macro->bindTo($this, static::class) ?: @$macro->bindTo(null, static::class); + + return \call_user_func_array($boundMacro ?: $macro, $parameters); + } + + return \call_user_func_array($macro, $parameters); + } + + protected function executeCallableWithContext(callable $macro, ...$parameters) + { + return static::bindMacroContext($this, function () use (&$macro, &$parameters) { + return $this->executeCallable($macro, ...$parameters); + }); + } + + protected function getAllGenericMacros(): Generator + { + yield from $this->localGenericMacros ?? []; + yield from $this->transmitFactory(static fn () => static::getGenericMacros()); + } + + protected static function getGenericMacros(): Generator + { + foreach ((FactoryImmutable::getInstance()->getSettings()['genericMacros'] ?? []) as $list) { + foreach ($list as $macro) { + yield $macro; + } + } + } + + protected static function executeStaticCallable(callable $macro, ...$parameters) + { + return static::bindMacroContext(null, function () use (&$macro, &$parameters) { + if ($macro instanceof Closure) { + $boundMacro = @Closure::bind($macro, null, static::class); + + return \call_user_func_array($boundMacro ?: $macro, $parameters); + } + + return \call_user_func_array($macro, $parameters); + }); + } + + protected function getTranslatedFormByRegExp($baseKey, $keySuffix, $context, $subKey, $defaultValue) + { + $key = $baseKey.$keySuffix; + $standaloneKey = "{$key}_standalone"; + $baseTranslation = $this->getTranslationMessage($key); + + if ($baseTranslation instanceof Closure) { + return $baseTranslation($this, $context, $subKey) ?: $defaultValue; + } + + if ( + $this->getTranslationMessage("$standaloneKey.$subKey") && + (!$context || (($regExp = $this->getTranslationMessage("{$baseKey}_regexp")) && !preg_match($regExp, $context))) + ) { + $key = $standaloneKey; + } + + return $this->getTranslationMessage("$key.$subKey", null, $defaultValue); + } + + private function callGetOrSetMethod(string $method, array $parameters): mixed + { + if (preg_match('/^([a-z]{2,})(In|Of)([A-Z][a-z]+)$/', $method)) { + $localStrictModeEnabled = $this->localStrictModeEnabled; + $this->localStrictModeEnabled = true; + + try { + return $this->callGetOrSet($method, $parameters[0] ?? null); + } catch (UnknownGetterException|UnknownSetterException|ImmutableException) { + // continue to macro + } finally { + $this->localStrictModeEnabled = $localStrictModeEnabled; + } + } + + return null; + } + + private function callGetOrSet(string $name, mixed $value): mixed + { + if ($value !== null) { + if (\is_string($value) || \is_int($value) || \is_float($value) || $value instanceof DateTimeZone || $value instanceof Month) { + return $this->set($name, $value); + } + + return null; + } + + return $this->get($name); + } + + private function getUTCUnit(string $unit): ?string + { + if (str_starts_with($unit, 'Real')) { + return substr($unit, 4); + } + + if (str_starts_with($unit, 'UTC')) { + return substr($unit, 3); + } + + return null; + } + + private function callDiffAlias(string $method, array $parameters): mixed + { + if (preg_match('/^(diff|floatDiff)In(Real|UTC|Utc)?(.+)$/', $method, $match)) { + $mode = strtoupper($match[2] ?? ''); + $betterMethod = $match[1] === 'floatDiff' ? str_replace('floatDiff', 'diff', $method) : null; + + if ($mode === 'REAL') { + $mode = 'UTC'; + $betterMethod = str_replace($match[2], 'UTC', $betterMethod ?? $method); + } + + if ($betterMethod) { + @trigger_error( + "Use the method $betterMethod instead to make it more explicit about what it does.\n". + 'On next major version, "float" prefix will be removed (as all diff are now returning floating numbers)'. + ' and "Real" methods will be removed in favor of "UTC" because what it actually does is to convert both'. + ' dates to UTC timezone before comparison, while by default it does it only if both dates don\'t have'. + ' exactly the same timezone (Note: 2 timezones with the same offset but different names are considered'. + " different as it's not safe to assume they will always have the same offset).", + \E_USER_DEPRECATED, + ); + } + + $unit = self::pluralUnit($match[3]); + $diffMethod = 'diffIn'.ucfirst($unit); + + if (\in_array($unit, ['days', 'weeks', 'months', 'quarters', 'years'])) { + $parameters['utc'] = ($mode === 'UTC'); + } + + if (method_exists($this, $diffMethod)) { + return $this->$diffMethod(...$parameters); + } + } + + return null; + } + + private function callHumanDiffAlias(string $method, array $parameters): ?string + { + $diffSizes = [ + // @mode diffForHumans + 'short' => true, + // @mode diffForHumans + 'long' => false, + ]; + $diffSyntaxModes = [ + // @call diffForHumans + 'Absolute' => CarbonInterface::DIFF_ABSOLUTE, + // @call diffForHumans + 'Relative' => CarbonInterface::DIFF_RELATIVE_AUTO, + // @call diffForHumans + 'RelativeToNow' => CarbonInterface::DIFF_RELATIVE_TO_NOW, + // @call diffForHumans + 'RelativeToOther' => CarbonInterface::DIFF_RELATIVE_TO_OTHER, + ]; + $sizePattern = implode('|', array_keys($diffSizes)); + $syntaxPattern = implode('|', array_keys($diffSyntaxModes)); + + if (preg_match("/^(?$sizePattern)(?$syntaxPattern)DiffForHuman$/", $method, $match)) { + $dates = array_filter($parameters, function ($parameter) { + return $parameter instanceof DateTimeInterface; + }); + $other = null; + + if (\count($dates)) { + $key = key($dates); + $other = current($dates); + array_splice($parameters, $key, 1); + } + + return $this->diffForHumans($other, $diffSyntaxModes[$match['syntax']], $diffSizes[$match['size']], ...$parameters); + } + + return null; + } + + private function callIsMethod(string $unit, array $parameters): ?bool + { + if (!str_starts_with($unit, 'is')) { + return null; + } + + $word = substr($unit, 2); + + if (\in_array($word, static::$days, true)) { + return $this->isDayOfWeek($word); + } + + return match ($word) { + // @call is Check if the current instance has UTC timezone. (Both isUtc and isUTC cases are valid.) + 'Utc', 'UTC' => $this->utc, + // @call is Check if the current instance has non-UTC timezone. + 'Local' => $this->local, + // @call is Check if the current instance is a valid date. + 'Valid' => $this->year !== 0, + // @call is Check if the current instance is in a daylight saving time. + 'DST' => $this->dst, + default => $this->callComparatorMethod($word, $parameters), + }; + } + + private function callComparatorMethod(string $unit, array $parameters): ?bool + { + $start = substr($unit, 0, 4); + $factor = -1; + + if ($start === 'Last') { + $start = 'Next'; + $factor = 1; + } + + if ($start === 'Next') { + $lowerUnit = strtolower(substr($unit, 4)); + + if (static::isModifiableUnit($lowerUnit)) { + return $this->avoidMutation()->addUnit($lowerUnit, $factor, false)->isSameUnit($lowerUnit, ...($parameters ?: ['now'])); + } + } + + if ($start === 'Same') { + try { + return $this->isSameUnit(strtolower(substr($unit, 4)), ...$parameters); + } catch (BadComparisonUnitException) { + // Try next + } + } + + if (str_starts_with($unit, 'Current')) { + try { + return $this->isCurrentUnit(strtolower(substr($unit, 7))); + } catch (BadComparisonUnitException | BadMethodCallException) { + // Try next + } + } + + return null; + } + + private function callModifierMethod(string $unit, array $parameters): ?static + { + $action = substr($unit, 0, 3); + $overflow = null; + + if ($action === 'set') { + $unit = strtolower(substr($unit, 3)); + } + + if (\in_array($unit, static::$units, true)) { + return $this->setUnit($unit, ...$parameters); + } + + if ($action === 'add' || $action === 'sub') { + $unit = substr($unit, 3); + $utcUnit = $this->getUTCUnit($unit); + + if ($utcUnit) { + $unit = static::singularUnit($utcUnit); + + return $this->{"{$action}UTCUnit"}($unit, ...$parameters); + } + + if (preg_match('/^(Month|Quarter|Year|Decade|Century|Centurie|Millennium|Millennia)s?(No|With|Without|WithNo)Overflow$/', $unit, $match)) { + $unit = $match[1]; + $overflow = $match[2] === 'With'; + } + + $unit = static::singularUnit($unit); + } + + if (static::isModifiableUnit($unit)) { + return $this->{"{$action}Unit"}($unit, $this->getMagicParameter($parameters, 0, 'value', 1), $overflow); + } + + return null; + } + + private function callPeriodMethod(string $method, array $parameters): ?CarbonPeriod + { + if (str_ends_with($method, 'Until')) { + try { + $unit = static::singularUnit(substr($method, 0, -5)); + + return $this->range( + $this->getMagicParameter($parameters, 0, 'endDate', $this), + $this->getMagicParameter($parameters, 1, 'factor', 1), + $unit + ); + } catch (InvalidArgumentException) { + // Try macros + } + } + + return null; + } + + private function callMacroMethod(string $method, array $parameters): mixed + { + return static::bindMacroContext($this, function () use (&$method, &$parameters) { + $macro = $this->getLocalMacro($method); + + if (!$macro) { + foreach ($this->getAllGenericMacros() as $callback) { + try { + return $this->executeCallable($callback, $method, ...$parameters); + } catch (BadMethodCallException) { + continue; + } + } + + if ($this->isLocalStrictModeEnabled()) { + throw new UnknownMethodException($method); + } + + return null; + } + + return $this->executeCallable($macro, ...$parameters); + }); + } + + private static function floorZeroPad(int|float $value, int $length): string + { + return str_pad((string) floor($value), $length, '0', STR_PAD_LEFT); + } + + /** + * @template T of CarbonInterface + * + * @param T $date + * + * @return T + */ + private function mutateIfMutable(CarbonInterface $date): CarbonInterface + { + return $this instanceof DateTimeImmutable + ? $date + : $this->modify('@'.$date->rawFormat('U.u'))->setTimezone($date->getTimezone()); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedPeriodProperties.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedPeriodProperties.php new file mode 100644 index 00000000..71660c3a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/DeprecatedPeriodProperties.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; + +trait DeprecatedPeriodProperties +{ + /** + * Period start in PHP < 8.2. + * + * @var CarbonInterface + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period start. + */ + public $start; + + /** + * Period end in PHP < 8.2. + * + * @var CarbonInterface|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period end. + */ + public $end; + + /** + * Period current iterated date in PHP < 8.2. + * + * @var CarbonInterface|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period current iterated date. + */ + public $current; + + /** + * Period interval in PHP < 8.2. + * + * @var CarbonInterval|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period interval. + */ + public $interval; + + /** + * Period recurrences in PHP < 8.2. + * + * @var int|float|null + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period recurrences. + */ + public $recurrences; + + /** + * Period start included option in PHP < 8.2. + * + * @var bool + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period start included option. + */ + public $include_start_date; + + /** + * Period end included option in PHP < 8.2. + * + * @var bool + * + * @deprecated PHP 8.2 this property is no longer in sync with the actual period end included option. + */ + public $include_end_date; +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php new file mode 100644 index 00000000..db5fe1d2 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Difference.php @@ -0,0 +1,855 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Carbon; +use Carbon\CarbonImmutable; +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; +use Carbon\CarbonPeriod; +use Carbon\Exceptions\UnknownUnitException; +use Carbon\Unit; +use Closure; +use DateInterval; +use DateTimeInterface; + +/** + * Trait Difference. + * + * Depends on the following methods: + * + * @method bool lessThan($date) + * @method static copy() + * @method static resolveCarbon($date = null) + */ +trait Difference +{ + /** + * Get the difference as a DateInterval instance. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return DateInterval + */ + public function diffAsDateInterval($date = null, bool $absolute = false): DateInterval + { + $other = $this->resolveCarbon($date); + + // Work-around for https://bugs.php.net/bug.php?id=81458 + // It was initially introduced for https://bugs.php.net/bug.php?id=80998 + // The very specific case of 80998 was fixed in PHP 8.1beta3, but it introduced 81458 + // So we still need to keep this for now + if ($other->tz !== $this->tz) { + $other = $other->avoidMutation()->setTimezone($this->tz); + } + + return parent::diff($other, $absolute); + } + + /** + * Get the difference as a CarbonInterval instance. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return CarbonInterval + */ + public function diffAsCarbonInterval($date = null, bool $absolute = false, array $skip = []): CarbonInterval + { + return CarbonInterval::diff($this, $this->resolveCarbon($date), $absolute, $skip) + ->setLocalTranslator($this->getLocalTranslator()); + } + + /** + * @alias diffAsCarbonInterval + * + * Get the difference as a DateInterval instance. + * Return relative interval (negative if $absolute flag is not set to true and the given date is before + * current one). + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return CarbonInterval + */ + public function diff($date = null, bool $absolute = false, array $skip = []): CarbonInterval + { + return $this->diffAsCarbonInterval($date, $absolute, $skip); + } + + /** + * @param Unit|string $unit microsecond, millisecond, second, minute, + * hour, day, week, month, quarter, year, + * century, millennium + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInUnit(Unit|string $unit, $date = null, bool $absolute = false, bool $utc = false): float + { + $unit = static::pluralUnit($unit instanceof Unit ? $unit->value : rtrim($unit, 'z')); + $method = 'diffIn'.$unit; + + if (!method_exists($this, $method)) { + throw new UnknownUnitException($unit); + } + + return $this->$method($date, $absolute, $utc); + } + + /** + * Get the difference in years + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInYears($date = null, bool $absolute = false, bool $utc = false): float + { + $start = $this; + $end = $this->resolveCarbon($date); + + if ($utc) { + $start = $start->avoidMutation()->utc(); + $end = $end->avoidMutation()->utc(); + } + + $ascending = ($start <= $end); + $sign = $absolute || $ascending ? 1 : -1; + + if (!$ascending) { + [$start, $end] = [$end, $start]; + } + + $yearsDiff = (int) $start->diff($end, $absolute)->format('%r%y'); + /** @var Carbon|CarbonImmutable $floorEnd */ + $floorEnd = $start->avoidMutation()->addYears($yearsDiff); + + if ($floorEnd >= $end) { + return $sign * $yearsDiff; + } + + /** @var Carbon|CarbonImmutable $ceilEnd */ + $ceilEnd = $start->avoidMutation()->addYears($yearsDiff + 1); + + $daysToFloor = $floorEnd->diffInDays($end); + $daysToCeil = $end->diffInDays($ceilEnd); + + return $sign * ($yearsDiff + $daysToFloor / ($daysToCeil + $daysToFloor)); + } + + /** + * Get the difference in quarters. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInQuarters($date = null, bool $absolute = false, bool $utc = false): float + { + return $this->diffInMonths($date, $absolute, $utc) / static::MONTHS_PER_QUARTER; + } + + /** + * Get the difference in months. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInMonths($date = null, bool $absolute = false, bool $utc = false): float + { + $start = $this; + $end = $this->resolveCarbon($date); + + // Compare using UTC + if ($utc || ($end->timezoneName !== $start->timezoneName)) { + $start = $start->avoidMutation()->utc(); + $end = $end->avoidMutation()->utc(); + } + + [$yearStart, $monthStart, $dayStart] = explode('-', $start->format('Y-m-dHisu')); + [$yearEnd, $monthEnd, $dayEnd] = explode('-', $end->format('Y-m-dHisu')); + + $monthsDiff = (((int) $yearEnd) - ((int) $yearStart)) * static::MONTHS_PER_YEAR + + ((int) $monthEnd) - ((int) $monthStart); + + if ($monthsDiff > 0) { + $monthsDiff -= ($dayStart > $dayEnd ? 1 : 0); + } elseif ($monthsDiff < 0) { + $monthsDiff += ($dayStart < $dayEnd ? 1 : 0); + } + + $ascending = ($start <= $end); + $sign = $absolute || $ascending ? 1 : -1; + $monthsDiff = abs($monthsDiff); + + if (!$ascending) { + [$start, $end] = [$end, $start]; + } + + /** @var Carbon|CarbonImmutable $floorEnd */ + $floorEnd = $start->avoidMutation()->addMonths($monthsDiff); + + if ($floorEnd >= $end) { + return $sign * $monthsDiff; + } + + /** @var Carbon|CarbonImmutable $ceilEnd */ + $ceilEnd = $start->avoidMutation()->addMonths($monthsDiff + 1); + + $daysToFloor = $floorEnd->diffInDays($end); + $daysToCeil = $end->diffInDays($ceilEnd); + + return $sign * ($monthsDiff + $daysToFloor / ($daysToCeil + $daysToFloor)); + } + + /** + * Get the difference in weeks. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInWeeks($date = null, bool $absolute = false, bool $utc = false): float + { + return $this->diffInDays($date, $absolute, $utc) / static::DAYS_PER_WEEK; + } + + /** + * Get the difference in days. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * @param bool $utc Always convert dates to UTC before comparing (if not set, it will do it only if timezones are different) + * + * @return float + */ + public function diffInDays($date = null, bool $absolute = false, bool $utc = false): float + { + $date = $this->resolveCarbon($date); + $current = $this; + + // Compare using UTC + if ($utc || ($date->timezoneName !== $current->timezoneName)) { + $date = $date->avoidMutation()->utc(); + $current = $current->avoidMutation()->utc(); + } + + $negative = ($date < $current); + [$start, $end] = $negative ? [$date, $current] : [$current, $date]; + $interval = $start->diffAsDateInterval($end); + $daysA = $this->getIntervalDayDiff($interval); + $floorEnd = $start->avoidMutation()->addDays($daysA); + $daysB = $daysA + ($floorEnd <= $end ? 1 : -1); + $ceilEnd = $start->avoidMutation()->addDays($daysB); + $microsecondsBetween = $floorEnd->diffInMicroseconds($ceilEnd); + $microsecondsToEnd = $floorEnd->diffInMicroseconds($end); + + return ($negative && !$absolute ? -1 : 1) + * ($daysA * ($microsecondsBetween - $microsecondsToEnd) + $daysB * $microsecondsToEnd) + / $microsecondsBetween; + } + + /** + * Get the difference in days using a filter closure. + * + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInDaysFiltered(Closure $callback, $date = null, bool $absolute = false): int + { + return $this->diffFiltered(CarbonInterval::day(), $callback, $date, $absolute); + } + + /** + * Get the difference in hours using a filter closure. + * + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInHoursFiltered(Closure $callback, $date = null, bool $absolute = false): int + { + return $this->diffFiltered(CarbonInterval::hour(), $callback, $date, $absolute); + } + + /** + * Get the difference by the given interval using a filter closure. + * + * @param CarbonInterval $ci An interval to traverse by + * @param Closure $callback + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffFiltered(CarbonInterval $ci, Closure $callback, $date = null, bool $absolute = false): int + { + $start = $this; + $end = $this->resolveCarbon($date); + $inverse = false; + + if ($end < $start) { + $start = $end; + $end = $this; + $inverse = true; + } + + $options = CarbonPeriod::EXCLUDE_END_DATE | ($this->isMutable() ? 0 : CarbonPeriod::IMMUTABLE); + $diff = $ci->toPeriod($start, $end, $options)->filter($callback)->count(); + + return $inverse && !$absolute ? -$diff : $diff; + } + + /** + * Get the difference in weekdays. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInWeekdays($date = null, bool $absolute = false): int + { + return $this->diffInDaysFiltered( + static fn (CarbonInterface $date) => $date->isWeekday(), + $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), + $absolute, + ); + } + + /** + * Get the difference in weekend days using a filter. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return int + */ + public function diffInWeekendDays($date = null, bool $absolute = false): int + { + return $this->diffInDaysFiltered( + static fn (CarbonInterface $date) => $date->isWeekend(), + $this->resolveCarbon($date)->avoidMutation()->modify($this->format('H:i:s.u')), + $absolute, + ); + } + + /** + * Get the difference in hours. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInHours($date = null, bool $absolute = false): float + { + return $this->diffInMinutes($date, $absolute) / static::MINUTES_PER_HOUR; + } + + /** + * Get the difference in minutes. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMinutes($date = null, bool $absolute = false): float + { + return $this->diffInSeconds($date, $absolute) / static::SECONDS_PER_MINUTE; + } + + /** + * Get the difference in seconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInSeconds($date = null, bool $absolute = false): float + { + return $this->diffInMilliseconds($date, $absolute) / static::MILLISECONDS_PER_SECOND; + } + + /** + * Get the difference in microseconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMicroseconds($date = null, bool $absolute = false): float + { + /** @var CarbonInterface $date */ + $date = $this->resolveCarbon($date); + $value = ($date->timestamp - $this->timestamp) * static::MICROSECONDS_PER_SECOND + + $date->micro - $this->micro; + + return $absolute ? abs($value) : $value; + } + + /** + * Get the difference in milliseconds. + * + * @param \Carbon\CarbonInterface|\DateTimeInterface|string|null $date + * @param bool $absolute Get the absolute of the difference + * + * @return float + */ + public function diffInMilliseconds($date = null, bool $absolute = false): float + { + return $this->diffInMicroseconds($date, $absolute) / static::MICROSECONDS_PER_MILLISECOND; + } + + /** + * The number of seconds since midnight. + * + * @return float + */ + public function secondsSinceMidnight(): float + { + return $this->diffInSeconds($this->copy()->startOfDay(), true); + } + + /** + * The number of seconds until 23:59:59. + * + * @return float + */ + public function secondsUntilEndOfDay(): float + { + return $this->diffInSeconds($this->copy()->endOfDay(), true); + } + + /** + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + * + * @example + * ``` + * echo Carbon::tomorrow()->diffForHumans() . "\n"; + * echo Carbon::tomorrow()->diffForHumans(['parts' => 2]) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(['parts' => 3, 'join' => true]) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday()) . "\n"; + * echo Carbon::tomorrow()->diffForHumans(Carbon::yesterday(), ['short' => true]) . "\n"; + * ``` + * + * @param Carbon|DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * ⦿ 'syntax' entry (see below) + * ⦿ 'short' entry (see below) + * ⦿ 'parts' entry (see below) + * ⦿ 'options' entry (see below) + * ⦿ 'skip' entry, list of units to skip (array of strings or a single string, + * ` it can be the unit name (singular or plural) or its shortcut + * ` (y, m, w, d, h, min, s, ms, µs). + * ⦿ 'aUnit' entry, prefer "an hour" over "1 hour" if true + * ⦿ 'altNumbers' entry, use alternative numbers if available + * ` (from the current language if true is passed, from the given language(s) + * ` if array or string is passed) + * ⦿ 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * ⦿ 'other' entry (see above) + * ⦿ 'minimumUnit' entry determines the smallest unit of time to display can be long or + * ` short form of the units, e.g. 'hour' or 'h' (default value: s) + * ⦿ 'locale' language in which the diff should be output (has no effect if 'translator' key is set) + * ⦿ 'translator' a custom translator to use to translator the output. + * if int passed, it adds modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + */ + public function diffForHumans($other = null, $syntax = null, $short = false, $parts = 1, $options = null): string + { + /* @var CarbonInterface $this */ + if (\is_array($other)) { + $other['syntax'] = \array_key_exists('syntax', $other) ? $other['syntax'] : $syntax; + $syntax = $other; + $other = $syntax['other'] ?? null; + } + + $intSyntax = &$syntax; + + if (\is_array($syntax)) { + $syntax['syntax'] = $syntax['syntax'] ?? null; + $intSyntax = &$syntax['syntax']; + } + + $intSyntax = (int) ($intSyntax ?? static::DIFF_RELATIVE_AUTO); + $intSyntax = $intSyntax === static::DIFF_RELATIVE_AUTO && $other === null ? static::DIFF_RELATIVE_TO_NOW : $intSyntax; + + $parts = min(7, max(1, (int) $parts)); + $skip = \is_array($syntax) ? ($syntax['skip'] ?? []) : []; + $options ??= $this->localHumanDiffOptions ?? $this->transmitFactory( + static fn () => static::getHumanDiffOptions(), + ); + + return $this->diff($other, skip: (array) $skip)->forHumans($syntax, (bool) $short, $parts, $options); + } + + /** + * @alias diffForHumans + * + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function from($other = null, $syntax = null, $short = false, $parts = 1, $options = null) + { + return $this->diffForHumans($other, $syntax, $short, $parts, $options); + } + + /** + * @alias diffForHumans + * + * Get the difference in a human readable format in the current locale from current instance to an other + * instance given (or now if null given). + */ + public function since($other = null, $syntax = null, $short = false, $parts = 1, $options = null) + { + return $this->diffForHumans($other, $syntax, $short, $parts, $options); + } + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given (or now if null given) to current instance. + * + * When comparing a value in the past to default now: + * 1 hour from now + * 5 months from now + * + * When comparing a value in the future to default now: + * 1 hour ago + * 5 months ago + * + * When comparing a value in the past to another value: + * 1 hour after + * 5 months after + * + * When comparing a value in the future to another value: + * 1 hour before + * 5 months before + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function to($other = null, $syntax = null, $short = false, $parts = 1, $options = null) + { + if (!$syntax && !$other) { + $syntax = CarbonInterface::DIFF_RELATIVE_TO_NOW; + } + + return $this->resolveCarbon($other)->diffForHumans($this, $syntax, $short, $parts, $options); + } + + /** + * @alias to + * + * Get the difference in a human readable format in the current locale from an other + * instance given (or now if null given) to current instance. + * + * @param Carbon|\DateTimeInterface|string|array|null $other if array passed, will be used as parameters array, see $syntax below; + * if null passed, now will be used as comparison reference; + * if any other type, it will be converted to date and used as reference. + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * - 'other' entry (see above) + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function until($other = null, $syntax = null, $short = false, $parts = 1, $options = null) + { + return $this->to($other, $syntax, $short, $parts, $options); + } + + /** + * Get the difference in a human readable format in the current locale from current + * instance to now. + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single unit) + * @param int $options human diff options + * + * @return string + */ + public function fromNow($syntax = null, $short = false, $parts = 1, $options = null) + { + $other = null; + + if ($syntax instanceof DateTimeInterface) { + [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); + } + + return $this->from($other, $syntax, $short, $parts, $options); + } + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given to now + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single part) + * @param int $options human diff options + * + * @return string + */ + public function toNow($syntax = null, $short = false, $parts = 1, $options = null) + { + return $this->to(null, $syntax, $short, $parts, $options); + } + + /** + * Get the difference in a human readable format in the current locale from an other + * instance given to now + * + * @param int|array $syntax if array passed, parameters will be extracted from it, the array may contains: + * - 'syntax' entry (see below) + * - 'short' entry (see below) + * - 'parts' entry (see below) + * - 'options' entry (see below) + * - 'join' entry determines how to join multiple parts of the string + * ` - if $join is a string, it's used as a joiner glue + * ` - if $join is a callable/closure, it get the list of string and should return a string + * ` - if $join is an array, the first item will be the default glue, and the second item + * ` will be used instead of the glue for the last item + * ` - if $join is true, it will be guessed from the locale ('list' translation file entry) + * ` - if $join is missing, a space will be used as glue + * if int passed, it add modifiers: + * Possible values: + * - CarbonInterface::DIFF_ABSOLUTE no modifiers + * - CarbonInterface::DIFF_RELATIVE_TO_NOW add ago/from now modifier + * - CarbonInterface::DIFF_RELATIVE_TO_OTHER add before/after modifier + * Default value: CarbonInterface::DIFF_ABSOLUTE + * @param bool $short displays short format of time units + * @param int $parts maximum number of parts to display (default value: 1: single part) + * @param int $options human diff options + * + * @return string + */ + public function ago($syntax = null, $short = false, $parts = 1, $options = null) + { + $other = null; + + if ($syntax instanceof DateTimeInterface) { + [$other, $syntax, $short, $parts, $options] = array_pad(\func_get_args(), 5, null); + } + + return $this->from($other, $syntax, $short, $parts, $options); + } + + /** + * Get the difference in a human-readable format in the current locale from current instance to another + * instance given (or now if null given). + * + * @return string + */ + public function timespan($other = null, $timezone = null): string + { + if (\is_string($other)) { + $other = $this->transmitFactory(static fn () => static::parse($other, $timezone)); + } + + return $this->diffForHumans($other, [ + 'join' => ', ', + 'syntax' => CarbonInterface::DIFF_ABSOLUTE, + 'parts' => INF, + ]); + } + + /** + * Returns either day of week + time (e.g. "Last Friday at 3:30 PM") if reference time is within 7 days, + * or a calendar date (e.g. "10/29/2017") otherwise. + * + * Language, date and time formats will change according to the current locale. + * + * @param Carbon|\DateTimeInterface|string|null $referenceTime + * @param array $formats + * + * @return string + */ + public function calendar($referenceTime = null, array $formats = []) + { + /** @var CarbonInterface $current */ + $current = $this->avoidMutation()->startOfDay(); + /** @var CarbonInterface $other */ + $other = $this->resolveCarbon($referenceTime)->avoidMutation()->setTimezone($this->getTimezone())->startOfDay(); + $diff = $other->diffInDays($current, false); + $format = $diff <= -static::DAYS_PER_WEEK ? 'sameElse' : ( + $diff < -1 ? 'lastWeek' : ( + $diff < 0 ? 'lastDay' : ( + $diff < 1 ? 'sameDay' : ( + $diff < 2 ? 'nextDay' : ( + $diff < static::DAYS_PER_WEEK ? 'nextWeek' : 'sameElse' + ) + ) + ) + ) + ); + $format = array_merge($this->getCalendarFormats(), $formats)[$format]; + if ($format instanceof Closure) { + $format = $format($current, $other) ?? ''; + } + + return $this->isoFormat((string) $format); + } + + private function getIntervalDayDiff(DateInterval $interval): int + { + return (int) $interval->format('%r%a'); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php new file mode 100644 index 00000000..e27c7bab --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalRounding.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterval; +use Carbon\Exceptions\InvalidIntervalException; +use DateInterval; + +/** + * Trait to call rounding methods to interval or the interval of a period. + */ +trait IntervalRounding +{ + protected function callRoundMethod(string $method, array $parameters): ?static + { + $action = substr($method, 0, 4); + + if ($action !== 'ceil') { + $action = substr($method, 0, 5); + } + + if (\in_array($action, ['round', 'floor', 'ceil'])) { + return $this->{$action.'Unit'}(substr($method, \strlen($action)), ...$parameters); + } + + return null; + } + + protected function roundWith(DateInterval|string|float|int $precision, callable|string $function): ?static + { + $unit = 'second'; + + if ($precision instanceof DateInterval) { + $precision = CarbonInterval::instance($precision)->forHumans(['locale' => 'en']); + } + + if (\is_string($precision) && preg_match('/^\s*(?\d+)?\s*(?\w+)(?\W.*)?$/', $precision, $match)) { + if (trim($match['other'] ?? '') !== '') { + throw new InvalidIntervalException('Rounding is only possible with single unit intervals.'); + } + + $precision = (int) ($match['precision'] ?: 1); + $unit = $match['unit']; + } + + return $this->roundUnit($unit, $precision, $function); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php new file mode 100644 index 00000000..2eaf9845 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/IntervalStep.php @@ -0,0 +1,94 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Callback; +use Carbon\Carbon; +use Carbon\CarbonImmutable; +use Carbon\CarbonInterface; +use Closure; +use DateTimeImmutable; +use DateTimeInterface; + +trait IntervalStep +{ + /** + * Step to apply instead of a fixed interval to get the new date. + * + * @var Closure|null + */ + protected $step; + + /** + * Get the dynamic step in use. + * + * @return Closure + */ + public function getStep(): ?Closure + { + return $this->step; + } + + /** + * Set a step to apply instead of a fixed interval to get the new date. + * + * Or pass null to switch to fixed interval. + * + * @param Closure|null $step + */ + public function setStep(?Closure $step): void + { + $this->step = $step; + } + + /** + * Take a date and apply either the step if set, or the current interval else. + * + * The interval/step is applied negatively (typically subtraction instead of addition) if $negated is true. + * + * @param DateTimeInterface $dateTime + * @param bool $negated + * + * @return CarbonInterface + */ + public function convertDate(DateTimeInterface $dateTime, bool $negated = false): CarbonInterface + { + /** @var CarbonInterface $carbonDate */ + $carbonDate = $dateTime instanceof CarbonInterface ? $dateTime : $this->resolveCarbon($dateTime); + + if ($this->step) { + $carbonDate = Callback::parameter($this->step, $carbonDate->avoidMutation()); + + return $carbonDate->modify(($this->step)($carbonDate, $negated)->format('Y-m-d H:i:s.u e O')); + } + + if ($negated) { + return $carbonDate->rawSub($this); + } + + return $carbonDate->rawAdd($this); + } + + /** + * Convert DateTimeImmutable instance to CarbonImmutable instance and DateTime instance to Carbon instance. + */ + private function resolveCarbon(DateTimeInterface $dateTime): Carbon|CarbonImmutable + { + if ($dateTime instanceof DateTimeImmutable) { + return CarbonImmutable::instance($dateTime); + } + + return Carbon::instance($dateTime); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/LocalFactory.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/LocalFactory.php new file mode 100644 index 00000000..a0398549 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/LocalFactory.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Factory; +use Carbon\FactoryImmutable; +use Carbon\WrapperClock; +use Closure; + +/** + * Remember the factory that was the current at the creation of the object. + */ +trait LocalFactory +{ + /** + * The clock that generated the current instance (or FactoryImmutable::getDefaultInstance() if none) + */ + private ?WrapperClock $clock = null; + + public function getClock(): ?WrapperClock + { + return $this->clock; + } + + private function initLocalFactory(): void + { + $this->clock = FactoryImmutable::getCurrentClock(); + } + + /** + * Trigger the given action using the local factory of the object, so it will be transmitted + * to any object also using this trait and calling initLocalFactory() in its constructor. + * + * @template T + * + * @param Closure(): T $action + * + * @return T + */ + private function transmitFactory(Closure $action): mixed + { + $previousClock = FactoryImmutable::getCurrentClock(); + FactoryImmutable::setCurrentClock($this->clock); + + try { + return $action(); + } finally { + FactoryImmutable::setCurrentClock($previousClock); + } + } + + private function getFactory(): Factory + { + return $this->getClock()?->getFactory() ?? FactoryImmutable::getDefaultInstance(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php new file mode 100644 index 00000000..8da7a17a --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Localization.php @@ -0,0 +1,732 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\Exceptions\InvalidTypeException; +use Carbon\Exceptions\NotLocaleAwareException; +use Carbon\Language; +use Carbon\Translator; +use Carbon\TranslatorStrongTypeInterface; +use Closure; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Trait Localization. + * + * Embed default and locale translators and translation base methods. + */ +trait Localization +{ + use StaticLocalization; + + /** + * Specific translator of the current instance. + */ + protected ?TranslatorInterface $localTranslator = null; + + /** + * Return true if the current instance has its own translator. + */ + public function hasLocalTranslator(): bool + { + return isset($this->localTranslator); + } + + /** + * Get the translator of the current instance or the default if none set. + */ + public function getLocalTranslator(): TranslatorInterface + { + return $this->localTranslator ?? $this->transmitFactory(static fn () => static::getTranslator()); + } + + /** + * Set the translator for the current instance. + */ + public function setLocalTranslator(TranslatorInterface $translator): self + { + $this->localTranslator = $translator; + + return $this; + } + + /** + * Returns raw translation message for a given key. + * + * @param TranslatorInterface|null $translator the translator to use + * @param string $key key to find + * @param string|null $locale current locale used if null + * @param string|null $default default value if translation returns the key + * + * @return string|Closure|null + */ + public static function getTranslationMessageWith($translator, string $key, ?string $locale = null, ?string $default = null) + { + if (!($translator instanceof TranslatorBagInterface && $translator instanceof TranslatorInterface)) { + throw new InvalidTypeException( + 'Translator does not implement '.TranslatorInterface::class.' and '.TranslatorBagInterface::class.'. '. + (\is_object($translator) ? \get_class($translator) : \gettype($translator)).' has been given.', + ); + } + + if (!$locale && $translator instanceof LocaleAwareInterface) { + $locale = $translator->getLocale(); + } + + $result = self::getFromCatalogue($translator, $translator->getCatalogue($locale), $key); + + return $result === $key ? $default : $result; + } + + /** + * Returns raw translation message for a given key. + * + * @param string $key key to find + * @param string|null $locale current locale used if null + * @param string|null $default default value if translation returns the key + * @param TranslatorInterface $translator an optional translator to use + * + * @return string + */ + public function getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) + { + return static::getTranslationMessageWith($translator ?? $this->getLocalTranslator(), $key, $locale, $default); + } + + /** + * Translate using translation string or callback available. + * + * @param TranslatorInterface $translator an optional translator to use + * @param string $key key to find + * @param array $parameters replacement parameters + * @param int|float|null $number number if plural + * + * @return string + */ + public static function translateWith(TranslatorInterface $translator, string $key, array $parameters = [], $number = null): string + { + $message = static::getTranslationMessageWith($translator, $key, null, $key); + if ($message instanceof Closure) { + return (string) $message(...array_values($parameters)); + } + + if ($number !== null) { + $parameters['%count%'] = $number; + } + if (isset($parameters['%count%'])) { + $parameters[':count'] = $parameters['%count%']; + } + + return (string) $translator->trans($key, $parameters); + } + + /** + * Translate using translation string or callback available. + * + * @param string $key key to find + * @param array $parameters replacement parameters + * @param string|int|float|null $number number if plural + * @param TranslatorInterface|null $translator an optional translator to use + * @param bool $altNumbers pass true to use alternative numbers + * + * @return string + */ + public function translate( + string $key, + array $parameters = [], + string|int|float|null $number = null, + ?TranslatorInterface $translator = null, + bool $altNumbers = false, + ): string { + $translation = static::translateWith($translator ?? $this->getLocalTranslator(), $key, $parameters, $number); + + if ($number !== null && $altNumbers) { + return str_replace((string) $number, $this->translateNumber((int) $number), $translation); + } + + return $translation; + } + + /** + * Returns the alternative number for a given integer if available in the current locale. + * + * @param int $number + * + * @return string + */ + public function translateNumber(int $number): string + { + $translateKey = "alt_numbers.$number"; + $symbol = $this->translate($translateKey); + + if ($symbol !== $translateKey) { + return $symbol; + } + + if ($number > 99 && $this->translate('alt_numbers.99') !== 'alt_numbers.99') { + $start = ''; + foreach ([10000, 1000, 100] as $exp) { + $key = "alt_numbers_pow.$exp"; + if ($number >= $exp && $number < $exp * 10 && ($pow = $this->translate($key)) !== $key) { + $unit = floor($number / $exp); + $number -= $unit * $exp; + $start .= ($unit > 1 ? $this->translate("alt_numbers.$unit") : '').$pow; + } + } + $result = ''; + while ($number) { + $chunk = $number % 100; + $result = $this->translate("alt_numbers.$chunk").$result; + $number = floor($number / 100); + } + + return "$start$result"; + } + + if ($number > 9 && $this->translate('alt_numbers.9') !== 'alt_numbers.9') { + $result = ''; + while ($number) { + $chunk = $number % 10; + $result = $this->translate("alt_numbers.$chunk").$result; + $number = floor($number / 10); + } + + return $result; + } + + return (string) $number; + } + + /** + * Translate a time string from a locale to an other. + * + * @param string $timeString date/time/duration string to translate (may also contain English) + * @param string|null $from input locale of the $timeString parameter (`Carbon::getLocale()` by default) + * @param string|null $to output locale of the result returned (`"en"` by default) + * @param int $mode specify what to translate with options: + * - CarbonInterface::TRANSLATE_ALL (default) + * - CarbonInterface::TRANSLATE_MONTHS + * - CarbonInterface::TRANSLATE_DAYS + * - CarbonInterface::TRANSLATE_UNITS + * - CarbonInterface::TRANSLATE_MERIDIEM + * You can use pipe to group: CarbonInterface::TRANSLATE_MONTHS | CarbonInterface::TRANSLATE_DAYS + * + * @return string + */ + public static function translateTimeString( + string $timeString, + ?string $from = null, + ?string $to = null, + int $mode = CarbonInterface::TRANSLATE_ALL, + ): string { + // Fallback source and destination locales + $from = $from ?: static::getLocale(); + $to = $to ?: CarbonInterface::DEFAULT_LOCALE; + + if ($from === $to) { + return $timeString; + } + + // Standardize apostrophe + $timeString = strtr($timeString, ['’' => "'"]); + + $fromTranslations = []; + $toTranslations = []; + + foreach (['from', 'to'] as $key) { + $language = $$key; + $translator = Translator::get($language); + $translations = $translator->getMessages(); + + if (!isset($translations[$language])) { + return $timeString; + } + + $translationKey = $key.'Translations'; + $messages = $translations[$language]; + $months = $messages['months'] ?? []; + $weekdays = $messages['weekdays'] ?? []; + $meridiem = $messages['meridiem'] ?? ['AM', 'PM']; + + if (isset($messages['ordinal_words'])) { + $timeString = self::replaceOrdinalWords( + $timeString, + $key === 'from' ? array_flip($messages['ordinal_words']) : $messages['ordinal_words'] + ); + } + + if ($key === 'from') { + foreach (['months', 'weekdays'] as $variable) { + $list = $messages[$variable.'_standalone'] ?? null; + + if ($list) { + foreach ($$variable as $index => &$name) { + $name .= '|'.$messages[$variable.'_standalone'][$index]; + } + } + } + } + + $$translationKey = array_merge( + $mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($months, static::MONTHS_PER_YEAR, $timeString) : [], + $mode & CarbonInterface::TRANSLATE_MONTHS ? static::getTranslationArray($messages['months_short'] ?? [], static::MONTHS_PER_YEAR, $timeString) : [], + $mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($weekdays, static::DAYS_PER_WEEK, $timeString) : [], + $mode & CarbonInterface::TRANSLATE_DAYS ? static::getTranslationArray($messages['weekdays_short'] ?? [], static::DAYS_PER_WEEK, $timeString) : [], + $mode & CarbonInterface::TRANSLATE_DIFF ? static::translateWordsByKeys([ + 'diff_now', + 'diff_today', + 'diff_yesterday', + 'diff_tomorrow', + 'diff_before_yesterday', + 'diff_after_tomorrow', + ], $messages, $key) : [], + $mode & CarbonInterface::TRANSLATE_UNITS ? static::translateWordsByKeys([ + 'year', + 'month', + 'week', + 'day', + 'hour', + 'minute', + 'second', + ], $messages, $key) : [], + $mode & CarbonInterface::TRANSLATE_MERIDIEM ? array_map(function ($hour) use ($meridiem) { + if (\is_array($meridiem)) { + return $meridiem[$hour < static::HOURS_PER_DAY / 2 ? 0 : 1]; + } + + return $meridiem($hour, 0, false); + }, range(0, 23)) : [], + ); + } + + return substr(preg_replace_callback('/(?<=[\d\s+.\/,_-])('.implode('|', $fromTranslations).')(?=[\d\s+.\/,_-])/iu', function ($match) use ($fromTranslations, $toTranslations) { + [$chunk] = $match; + + foreach ($fromTranslations as $index => $word) { + if (preg_match("/^$word\$/iu", $chunk)) { + return $toTranslations[$index] ?? ''; + } + } + + return $chunk; // @codeCoverageIgnore + }, " $timeString "), 1, -1); + } + + /** + * Translate a time string from the current locale (`$date->locale()`) to another one. + * + * @param string $timeString time string to translate + * @param string|null $to output locale of the result returned ("en" by default) + * + * @return string + */ + public function translateTimeStringTo(string $timeString, ?string $to = null): string + { + return static::translateTimeString($timeString, $this->getTranslatorLocale(), $to); + } + + /** + * Get/set the locale for the current instance. + * + * @param string|null $locale + * @param string ...$fallbackLocales + * + * @return $this|string + */ + public function locale(?string $locale = null, string ...$fallbackLocales): static|string + { + if ($locale === null) { + return $this->getTranslatorLocale(); + } + + if (!$this->localTranslator || $this->getTranslatorLocale($this->localTranslator) !== $locale) { + $translator = Translator::get($locale); + + if (!empty($fallbackLocales)) { + $translator->setFallbackLocales($fallbackLocales); + + foreach ($fallbackLocales as $fallbackLocale) { + $messages = Translator::get($fallbackLocale)->getMessages(); + + if (isset($messages[$fallbackLocale])) { + $translator->setMessages($fallbackLocale, $messages[$fallbackLocale]); + } + } + } + + $this->localTranslator = $translator; + } + + return $this; + } + + /** + * Get the current translator locale. + * + * @return string + */ + public static function getLocale(): string + { + return static::getLocaleAwareTranslator()->getLocale(); + } + + /** + * Set the current translator locale and indicate if the source locale file exists. + * Pass 'auto' as locale to use the closest language to the current LC_TIME locale. + * + * @param string $locale locale ex. en + */ + public static function setLocale(string $locale): void + { + static::getLocaleAwareTranslator()->setLocale($locale); + } + + /** + * Set the fallback locale. + * + * @see https://symfony.com/doc/current/components/translation.html#fallback-locales + * + * @param string $locale + */ + public static function setFallbackLocale(string $locale): void + { + $translator = static::getTranslator(); + + if (method_exists($translator, 'setFallbackLocales')) { + $translator->setFallbackLocales([$locale]); + + if ($translator instanceof Translator) { + $preferredLocale = $translator->getLocale(); + $translator->setMessages($preferredLocale, array_replace_recursive( + $translator->getMessages()[$locale] ?? [], + Translator::get($locale)->getMessages()[$locale] ?? [], + $translator->getMessages($preferredLocale), + )); + } + } + } + + /** + * Get the fallback locale. + * + * @see https://symfony.com/doc/current/components/translation.html#fallback-locales + */ + public static function getFallbackLocale(): ?string + { + $translator = static::getTranslator(); + + if (method_exists($translator, 'getFallbackLocales')) { + return $translator->getFallbackLocales()[0] ?? null; + } + + return null; + } + + /** + * Set the current locale to the given, execute the passed function, reset the locale to previous one, + * then return the result of the closure (or null if the closure was void). + * + * @param string $locale locale ex. en + * @param callable $func + * + * @return mixed + */ + public static function executeWithLocale(string $locale, callable $func): mixed + { + $currentLocale = static::getLocale(); + static::setLocale($locale); + $newLocale = static::getLocale(); + $result = $func( + $newLocale === 'en' && strtolower(substr((string) $locale, 0, 2)) !== 'en' + ? false + : $newLocale, + static::getTranslator(), + ); + static::setLocale($currentLocale); + + return $result; + } + + /** + * Returns true if the given locale is internally supported and has short-units support. + * Support is considered enabled if either year, day or hour has a short variant translated. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasShortUnits(string $locale): bool + { + return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { + return ($newLocale && (($y = static::translateWith($translator, 'y')) !== 'y' && $y !== static::translateWith($translator, 'year'))) || ( + ($y = static::translateWith($translator, 'd')) !== 'd' && + $y !== static::translateWith($translator, 'day') + ) || ( + ($y = static::translateWith($translator, 'h')) !== 'h' && + $y !== static::translateWith($translator, 'hour') + ); + }); + } + + /** + * Returns true if the given locale is internally supported and has diff syntax support (ago, from now, before, after). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffSyntax(string $locale): bool + { + return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { + if (!$newLocale) { + return false; + } + + foreach (['ago', 'from_now', 'before', 'after'] as $key) { + if ($translator instanceof TranslatorBagInterface && + self::getFromCatalogue($translator, $translator->getCatalogue($newLocale), $key) instanceof Closure + ) { + continue; + } + + if ($translator->trans($key) === $key) { + return false; + } + } + + return true; + }); + } + + /** + * Returns true if the given locale is internally supported and has words for 1-day diff (just now, yesterday, tomorrow). + * Support is considered enabled if the 3 words are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffOneDayWords(string $locale): bool + { + return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { + return $newLocale && + $translator->trans('diff_now') !== 'diff_now' && + $translator->trans('diff_yesterday') !== 'diff_yesterday' && + $translator->trans('diff_tomorrow') !== 'diff_tomorrow'; + }); + } + + /** + * Returns true if the given locale is internally supported and has words for 2-days diff (before yesterday, after tomorrow). + * Support is considered enabled if the 2 words are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasDiffTwoDayWords(string $locale): bool + { + return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { + return $newLocale && + $translator->trans('diff_before_yesterday') !== 'diff_before_yesterday' && + $translator->trans('diff_after_tomorrow') !== 'diff_after_tomorrow'; + }); + } + + /** + * Returns true if the given locale is internally supported and has period syntax support (X times, every X, from X, to X). + * Support is considered enabled if the 4 sentences are translated in the given locale. + * + * @param string $locale locale ex. en + * + * @return bool + */ + public static function localeHasPeriodSyntax($locale) + { + return static::executeWithLocale($locale, function ($newLocale, TranslatorInterface $translator) { + return $newLocale && + $translator->trans('period_recurrences') !== 'period_recurrences' && + $translator->trans('period_interval') !== 'period_interval' && + $translator->trans('period_start_date') !== 'period_start_date' && + $translator->trans('period_end_date') !== 'period_end_date'; + }); + } + + /** + * Returns the list of internally available locales and already loaded custom locales. + * (It will ignore custom translator dynamic loading.) + * + * @return array + */ + public static function getAvailableLocales() + { + $translator = static::getLocaleAwareTranslator(); + + return $translator instanceof Translator + ? $translator->getAvailableLocales() + : [$translator->getLocale()]; + } + + /** + * Returns list of Language object for each available locale. This object allow you to get the ISO name, native + * name, region and variant of the locale. + * + * @return Language[] + */ + public static function getAvailableLocalesInfo() + { + $languages = []; + foreach (static::getAvailableLocales() as $id) { + $languages[$id] = new Language($id); + } + + return $languages; + } + + /** + * Get the locale of a given translator. + * + * If null or omitted, current local translator is used. + * If no local translator is in use, current global translator is used. + */ + protected function getTranslatorLocale($translator = null): ?string + { + if (\func_num_args() === 0) { + $translator = $this->getLocalTranslator(); + } + + $translator = static::getLocaleAwareTranslator($translator); + + return $translator?->getLocale(); + } + + /** + * Throw an error if passed object is not LocaleAwareInterface. + * + * @param LocaleAwareInterface|null $translator + * + * @return LocaleAwareInterface|null + */ + protected static function getLocaleAwareTranslator($translator = null) + { + if (\func_num_args() === 0) { + $translator = static::getTranslator(); + } + + if ($translator && !($translator instanceof LocaleAwareInterface || method_exists($translator, 'getLocale'))) { + throw new NotLocaleAwareException($translator); // @codeCoverageIgnore + } + + return $translator; + } + + /** + * @param mixed $translator + * @param \Symfony\Component\Translation\MessageCatalogueInterface $catalogue + * + * @return mixed + */ + private static function getFromCatalogue($translator, $catalogue, string $id, string $domain = 'messages') + { + return $translator instanceof TranslatorStrongTypeInterface + ? $translator->getFromCatalogue($catalogue, $id, $domain) + : $catalogue->get($id, $domain); // @codeCoverageIgnore + } + + /** + * Return the word cleaned from its translation codes. + * + * @param string $word + * + * @return string + */ + private static function cleanWordFromTranslationString($word) + { + $word = str_replace([':count', '%count', ':time'], '', $word); + $word = strtr($word, ['’' => "'"]); + $word = preg_replace( + '/\{(?:-?\d+(?:\.\d+)?|-?Inf)(?:,(?:-?\d+|-?Inf))?}|[\[\]](?:-?\d+(?:\.\d+)?|-?Inf)(?:,(?:-?\d+|-?Inf))?[\[\]]/', + '', + $word, + ); + + return trim($word); + } + + /** + * Translate a list of words. + * + * @param string[] $keys keys to translate. + * @param string[] $messages messages bag handling translations. + * @param string $key 'to' (to get the translation) or 'from' (to get the detection RegExp pattern). + * + * @return string[] + */ + private static function translateWordsByKeys($keys, $messages, $key): array + { + return array_map(function ($wordKey) use ($messages, $key) { + $message = $key === 'from' && isset($messages[$wordKey.'_regexp']) + ? $messages[$wordKey.'_regexp'] + : ($messages[$wordKey] ?? null); + + if (!$message) { + return '>>DO NOT REPLACE<<'; + } + + $parts = explode('|', $message); + + return $key === 'to' + ? self::cleanWordFromTranslationString(end($parts)) + : '(?:'.implode('|', array_map(static::cleanWordFromTranslationString(...), $parts)).')'; + }, $keys); + } + + /** + * Get an array of translations based on the current date. + * + * @param callable $translation + * @param int $length + * @param string $timeString + * + * @return string[] + */ + private static function getTranslationArray($translation, $length, $timeString): array + { + $filler = '>>DO NOT REPLACE<<'; + + if (\is_array($translation)) { + return array_pad($translation, $length, $filler); + } + + $list = []; + $date = static::now(); + + for ($i = 0; $i < $length; $i++) { + $list[] = $translation($date, $timeString, $i) ?? $filler; + } + + return $list; + } + + private static function replaceOrdinalWords(string $timeString, array $ordinalWords): string + { + return preg_replace_callback('/(? + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\FactoryImmutable; + +/** + * Trait Macros. + * + * Allows users to register macros within the Carbon class. + */ +trait Macro +{ + use Mixin; + + /** + * Register a custom macro. + * + * Pass null macro to remove it. + * + * @example + * ``` + * $userSettings = [ + * 'locale' => 'pt', + * 'timezone' => 'America/Sao_Paulo', + * ]; + * Carbon::macro('userFormat', function () use ($userSettings) { + * return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->calendar(); + * }); + * echo Carbon::yesterday()->hours(11)->userFormat(); + * ``` + * + * @param-closure-this static $macro + */ + public static function macro(string $name, ?callable $macro): void + { + FactoryImmutable::getDefaultInstance()->macro($name, $macro); + } + + /** + * Remove all macros and generic macros. + */ + public static function resetMacros(): void + { + FactoryImmutable::getDefaultInstance()->resetMacros(); + } + + /** + * Register a custom macro. + * + * @param callable $macro + * @param int $priority marco with higher priority is tried first + * + * @return void + */ + public static function genericMacro(callable $macro, int $priority = 0): void + { + FactoryImmutable::getDefaultInstance()->genericMacro($macro, $priority); + } + + /** + * Checks if macro is registered globally. + * + * @param string $name + * + * @return bool + */ + public static function hasMacro(string $name): bool + { + return FactoryImmutable::getInstance()->hasMacro($name); + } + + /** + * Get the raw callable macro registered globally for a given name. + */ + public static function getMacro(string $name): ?callable + { + return FactoryImmutable::getInstance()->getMacro($name); + } + + /** + * Checks if macro is registered globally or locally. + */ + public function hasLocalMacro(string $name): bool + { + return ($this->localMacros && isset($this->localMacros[$name])) || $this->transmitFactory( + static fn () => static::hasMacro($name), + ); + } + + /** + * Get the raw callable macro registered globally or locally for a given name. + */ + public function getLocalMacro(string $name): ?callable + { + return ($this->localMacros ?? [])[$name] ?? $this->transmitFactory( + static fn () => static::getMacro($name), + ); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php new file mode 100644 index 00000000..d6595f18 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/MagicParameter.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +/** + * Trait MagicParameter. + * + * Allows to retrieve parameter in magic calls by index or name. + */ +trait MagicParameter +{ + private function getMagicParameter(array $parameters, int $index, string $key, $default) + { + if (\array_key_exists($index, $parameters)) { + return $parameters[$index]; + } + + if (\array_key_exists($key, $parameters)) { + return $parameters[$key]; + } + + return $default; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php new file mode 100644 index 00000000..3aedfa24 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mixin.php @@ -0,0 +1,208 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; +use Carbon\CarbonPeriod; +use Closure; +use Generator; +use ReflectionClass; +use ReflectionException; +use ReflectionMethod; +use Throwable; + +/** + * Trait Mixin. + * + * Allows mixing in entire classes with multiple macros. + */ +trait Mixin +{ + /** + * Stack of macro instance contexts. + */ + protected static array $macroContextStack = []; + + /** + * Mix another object into the class. + * + * @example + * ``` + * Carbon::mixin(new class { + * public function addMoon() { + * return function () { + * return $this->addDays(30); + * }; + * } + * public function subMoon() { + * return function () { + * return $this->subDays(30); + * }; + * } + * }); + * $fullMoon = Carbon::create('2018-12-22'); + * $nextFullMoon = $fullMoon->addMoon(); + * $blackMoon = Carbon::create('2019-01-06'); + * $previousBlackMoon = $blackMoon->subMoon(); + * echo "$nextFullMoon\n"; + * echo "$previousBlackMoon\n"; + * ``` + * + * @throws ReflectionException + */ + public static function mixin(object|string $mixin): void + { + \is_string($mixin) && trait_exists($mixin) + ? self::loadMixinTrait($mixin) + : self::loadMixinClass($mixin); + } + + /** + * @throws ReflectionException + */ + private static function loadMixinClass(object|string $mixin): void + { + $methods = (new ReflectionClass($mixin))->getMethods( + ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED, + ); + + foreach ($methods as $method) { + if ($method->isConstructor() || $method->isDestructor()) { + continue; + } + + $macro = $method->invoke($mixin); + + if (\is_callable($macro)) { + static::macro($method->name, $macro); + } + } + } + + private static function loadMixinTrait(string $trait): void + { + $context = eval(self::getAnonymousClassCodeForTrait($trait)); + $className = \get_class($context); + $baseClass = static::class; + + foreach (self::getMixableMethods($context) as $name) { + $closureBase = Closure::fromCallable([$context, $name]); + + static::macro($name, function (...$parameters) use ($closureBase, $className, $baseClass) { + $downContext = isset($this) ? ($this) : new $baseClass(); + $context = isset($this) ? $this->cast($className) : new $className(); + + try { + // @ is required to handle error if not converted into exceptions + $closure = @$closureBase->bindTo($context); + } catch (Throwable) { // @codeCoverageIgnore + $closure = $closureBase; // @codeCoverageIgnore + } + + // in case of errors not converted into exceptions + $closure = $closure ?: $closureBase; + + $result = $closure(...$parameters); + + if (!($result instanceof $className)) { + return $result; + } + + if ($downContext instanceof CarbonInterface && $result instanceof CarbonInterface) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + return $downContext + ->setTimezone($result->getTimezone()) + ->modify($result->format('Y-m-d H:i:s.u')) + ->settings($result->getSettings()); + } + + if ($downContext instanceof CarbonInterval && $result instanceof CarbonInterval) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + $downContext->copyProperties($result); + self::copyStep($downContext, $result); + self::copyNegativeUnits($downContext, $result); + + return $downContext->settings($result->getSettings()); + } + + if ($downContext instanceof CarbonPeriod && $result instanceof CarbonPeriod) { + if ($context !== $result) { + $downContext = $downContext->copy(); + } + + return $downContext + ->setDates($result->getStartDate(), $result->getEndDate()) + ->setRecurrences($result->getRecurrences()) + ->setOptions($result->getOptions()) + ->settings($result->getSettings()); + } + + return $result; + }); + } + } + + private static function getAnonymousClassCodeForTrait(string $trait): string + { + return 'return new class() extends '.static::class.' {use '.$trait.';};'; + } + + private static function getMixableMethods(self $context): Generator + { + foreach (get_class_methods($context) as $name) { + if (method_exists(static::class, $name)) { + continue; + } + + yield $name; + } + } + + /** + * Stack a Carbon context from inside calls of self::this() and execute a given action. + */ + protected static function bindMacroContext(?self $context, callable $callable): mixed + { + static::$macroContextStack[] = $context; + + try { + return $callable(); + } finally { + array_pop(static::$macroContextStack); + } + } + + /** + * Return the current context from inside a macro callee or a null if static. + */ + protected static function context(): ?static + { + return end(static::$macroContextStack) ?: null; + } + + /** + * Return the current context from inside a macro callee or a new one if static. + */ + protected static function this(): static + { + return end(static::$macroContextStack) ?: new static(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php new file mode 100644 index 00000000..7fc0f9f6 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Modifiers.php @@ -0,0 +1,476 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\Exceptions\InvalidFormatException; +use ReturnTypeWillChange; + +/** + * Trait Modifiers. + * + * Returns dates relative to current date using modifier short-hand. + */ +trait Modifiers +{ + /** + * Midday/noon hour. + * + * @var int + */ + protected static $midDayAt = 12; + + /** + * get midday/noon hour + * + * @return int + */ + public static function getMidDayAt() + { + return static::$midDayAt; + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather consider mid-day is always 12pm, then if you need to test if it's an other + * hour, test it explicitly: + * $date->format('G') == 13 + * or to set explicitly to a given hour: + * $date->setTime(13, 0, 0, 0) + * + * Set midday/noon hour + * + * @param int $hour midday hour + * + * @return void + */ + public static function setMidDayAt($hour) + { + static::$midDayAt = $hour; + } + + /** + * Modify to midday, default to self::$midDayAt + * + * @return static + */ + public function midDay() + { + return $this->setTime(static::$midDayAt, 0, 0, 0); + } + + /** + * Modify to the next occurrence of a given modifier such as a day of + * the week. If no modifier is provided, modify to the next occurrence + * of the current day of the week. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param string|int|null $modifier + * + * @return static + */ + public function next($modifier = null) + { + if ($modifier === null) { + $modifier = $this->dayOfWeek; + } + + return $this->change( + 'next '.(\is_string($modifier) ? $modifier : static::$days[$modifier]), + ); + } + + /** + * Go forward or backward to the next week- or weekend-day. + * + * @param bool $weekday + * @param bool $forward + * + * @return static + */ + private function nextOrPreviousDay($weekday = true, $forward = true) + { + /** @var CarbonInterface $date */ + $date = $this; + $step = $forward ? 1 : -1; + + do { + $date = $date->addDays($step); + } while ($weekday ? $date->isWeekend() : $date->isWeekday()); + + return $date; + } + + /** + * Go forward to the next weekday. + * + * @return static + */ + public function nextWeekday() + { + return $this->nextOrPreviousDay(); + } + + /** + * Go backward to the previous weekday. + * + * @return static + */ + public function previousWeekday() + { + return $this->nextOrPreviousDay(true, false); + } + + /** + * Go forward to the next weekend day. + * + * @return static + */ + public function nextWeekendDay() + { + return $this->nextOrPreviousDay(false); + } + + /** + * Go backward to the previous weekend day. + * + * @return static + */ + public function previousWeekendDay() + { + return $this->nextOrPreviousDay(false, false); + } + + /** + * Modify to the previous occurrence of a given modifier such as a day of + * the week. If no dayOfWeek is provided, modify to the previous occurrence + * of the current day of the week. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param string|int|null $modifier + * + * @return static + */ + public function previous($modifier = null) + { + if ($modifier === null) { + $modifier = $this->dayOfWeek; + } + + return $this->change( + 'last '.(\is_string($modifier) ? $modifier : static::$days[$modifier]), + ); + } + + /** + * Modify to the first occurrence of a given day of the week + * in the current month. If no dayOfWeek is provided, modify to the + * first day of the current month. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek + * + * @return static + */ + public function firstOfMonth($dayOfWeek = null) + { + $date = $this->startOfDay(); + + if ($dayOfWeek === null) { + return $date->day(1); + } + + return $date->modify('first '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); + } + + /** + * Modify to the last occurrence of a given day of the week + * in the current month. If no dayOfWeek is provided, modify to the + * last day of the current month. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek + * + * @return static + */ + public function lastOfMonth($dayOfWeek = null) + { + $date = $this->startOfDay(); + + if ($dayOfWeek === null) { + return $date->day($date->daysInMonth); + } + + return $date->modify('last '.static::$days[$dayOfWeek].' of '.$date->rawFormat('F').' '.$date->year); + } + + /** + * Modify to the given occurrence of a given day of the week + * in the current month. If the calculated occurrence is outside the scope + * of the current month, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfMonth($nth, $dayOfWeek) + { + $date = $this->avoidMutation()->firstOfMonth(); + $check = $date->rawFormat('Y-m'); + $date = $date->modify('+'.$nth.' '.static::$days[$dayOfWeek]); + + return $date->rawFormat('Y-m') === $check ? $this->modify((string) $date) : false; + } + + /** + * Modify to the first occurrence of a given day of the week + * in the current quarter. If no dayOfWeek is provided, modify to the + * first day of the current quarter. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function firstOfQuarter($dayOfWeek = null) + { + return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek); + } + + /** + * Modify to the last occurrence of a given day of the week + * in the current quarter. If no dayOfWeek is provided, modify to the + * last day of the current quarter. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function lastOfQuarter($dayOfWeek = null) + { + return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek); + } + + /** + * Modify to the given occurrence of a given day of the week + * in the current quarter. If the calculated occurrence is outside the scope + * of the current quarter, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfQuarter($nth, $dayOfWeek) + { + $date = $this->avoidMutation()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER); + $lastMonth = $date->month; + $year = $date->year; + $date = $date->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); + + return ($lastMonth < $date->month || $year !== $date->year) ? false : $this->modify((string) $date); + } + + /** + * Modify to the first occurrence of a given day of the week + * in the current year. If no dayOfWeek is provided, modify to the + * first day of the current year. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function firstOfYear($dayOfWeek = null) + { + return $this->month(1)->firstOfMonth($dayOfWeek); + } + + /** + * Modify to the last occurrence of a given day of the week + * in the current year. If no dayOfWeek is provided, modify to the + * last day of the current year. Use the supplied constants + * to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int|null $dayOfWeek day of the week default null + * + * @return static + */ + public function lastOfYear($dayOfWeek = null) + { + return $this->month(static::MONTHS_PER_YEAR)->lastOfMonth($dayOfWeek); + } + + /** + * Modify to the given occurrence of a given day of the week + * in the current year. If the calculated occurrence is outside the scope + * of the current year, then return false and no modifications are made. + * Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY. + * + * @param int $nth + * @param int $dayOfWeek + * + * @return mixed + */ + public function nthOfYear($nth, $dayOfWeek) + { + $date = $this->avoidMutation()->firstOfYear()->modify('+'.$nth.' '.static::$days[$dayOfWeek]); + + return $this->year === $date->year ? $this->modify((string) $date) : false; + } + + /** + * Modify the current instance to the average of a given instance (default now) and the current instance + * (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|null $date + * + * @return static + */ + public function average($date = null) + { + return $this->addRealMicroseconds((int) ($this->diffInMicroseconds($this->resolveCarbon($date), false) / 2)); + } + + /** + * Get the closest date from the instance (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 + * + * @return static + */ + public function closest($date1, $date2) + { + return $this->diffInMicroseconds($date1, true) < $this->diffInMicroseconds($date2, true) ? $date1 : $date2; + } + + /** + * Get the farthest date from the instance (second-precision). + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date1 + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date2 + * + * @return static + */ + public function farthest($date1, $date2) + { + return $this->diffInMicroseconds($date1, true) > $this->diffInMicroseconds($date2, true) ? $date1 : $date2; + } + + /** + * Get the minimum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @return static + */ + public function min($date = null) + { + $date = $this->resolveCarbon($date); + + return $this->lt($date) ? $this : $date; + } + + /** + * Get the minimum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @see min() + * + * @return static + */ + public function minimum($date = null) + { + return $this->min($date); + } + + /** + * Get the maximum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @return static + */ + public function max($date = null) + { + $date = $this->resolveCarbon($date); + + return $this->gt($date) ? $this : $date; + } + + /** + * Get the maximum instance between a given instance (default now) and the current instance. + * + * @param \Carbon\Carbon|\DateTimeInterface|mixed $date + * + * @see max() + * + * @return static + */ + public function maximum($date = null) + { + return $this->max($date); + } + + /** + * Calls \DateTime::modify if mutable or \DateTimeImmutable::modify else. + * + * @see https://php.net/manual/en/datetime.modify.php + * + * @return static + */ + #[ReturnTypeWillChange] + public function modify($modify) + { + return parent::modify((string) $modify) + ?: throw new InvalidFormatException('Could not modify with: '.var_export($modify, true)); + } + + /** + * Similar to native modify() method of DateTime but can handle more grammars. + * + * @example + * ``` + * echo Carbon::now()->change('next 2pm'); + * ``` + * + * @link https://php.net/manual/en/datetime.modify.php + * + * @param string $modifier + * + * @return static + */ + public function change($modifier) + { + return $this->modify(preg_replace_callback('/^(next|previous|last)\s+(\d{1,2}(h|am|pm|:\d{1,2}(:\d{1,2})?))$/i', function ($match) { + $match[2] = str_replace('h', ':00', $match[2]); + $test = $this->avoidMutation()->modify($match[2]); + $method = $match[1] === 'next' ? 'lt' : 'gt'; + $match[1] = $test->$method($this) ? $match[1].' day' : 'today'; + + return $match[1].' '.$match[2]; + }, strtr(trim($modifier), [ + ' at ' => ' ', + 'just now' => 'now', + 'after tomorrow' => 'tomorrow +1 day', + 'before yesterday' => 'yesterday -1 day', + ]))); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php new file mode 100644 index 00000000..9f45f585 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Mutability.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Carbon; +use Carbon\CarbonImmutable; + +/** + * Trait Mutability. + * + * Utils to know if the current object is mutable or immutable and convert it. + */ +trait Mutability +{ + use Cast; + + /** + * Returns true if the current class/instance is mutable. + */ + public static function isMutable(): bool + { + return false; + } + + /** + * Returns true if the current class/instance is immutable. + */ + public static function isImmutable(): bool + { + return !static::isMutable(); + } + + /** + * Return a mutable copy of the instance. + * + * @return Carbon + */ + public function toMutable() + { + /** @var Carbon $date */ + $date = $this->cast(Carbon::class); + + return $date; + } + + /** + * Return a immutable copy of the instance. + * + * @return CarbonImmutable + */ + public function toImmutable() + { + /** @var CarbonImmutable $date */ + $date = $this->cast(CarbonImmutable::class); + + return $date; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php new file mode 100644 index 00000000..463a74db --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ObjectInitialisation.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +trait ObjectInitialisation +{ + /** + * True when parent::__construct has been called. + * + * @var string + */ + protected $constructedObjectId; +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Options.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Options.php new file mode 100644 index 00000000..df81aaaf --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Options.php @@ -0,0 +1,217 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use DateTimeInterface; +use Throwable; + +/** + * Trait Options. + * + * Embed base methods to change settings of Carbon classes. + * + * Depends on the following methods: + * + * @method static shiftTimezone($timezone) Set the timezone + */ +trait Options +{ + use StaticOptions; + use Localization; + + /** + * Indicates if months should be calculated with overflow. + * Specific setting. + */ + protected ?bool $localMonthsOverflow = null; + + /** + * Indicates if years should be calculated with overflow. + * Specific setting. + */ + protected ?bool $localYearsOverflow = null; + + /** + * Indicates if the strict mode is in use. + * Specific setting. + */ + protected ?bool $localStrictModeEnabled = null; + + /** + * Options for diffForHumans and forHumans methods. + */ + protected ?int $localHumanDiffOptions = null; + + /** + * Format to use on string cast. + * + * @var string|callable|null + */ + protected $localToStringFormat = null; + + /** + * Format to use on JSON serialization. + * + * @var string|callable|null + */ + protected $localSerializer = null; + + /** + * Instance-specific macros. + */ + protected ?array $localMacros = null; + + /** + * Instance-specific generic macros. + */ + protected ?array $localGenericMacros = null; + + /** + * Function to call instead of format. + * + * @var string|callable|null + */ + protected $localFormatFunction = null; + + /** + * Set specific options. + * - strictMode: true|false|null + * - monthOverflow: true|false|null + * - yearOverflow: true|false|null + * - humanDiffOptions: int|null + * - toStringFormat: string|Closure|null + * - toJsonFormat: string|Closure|null + * - locale: string|null + * - timezone: \DateTimeZone|string|int|null + * - macros: array|null + * - genericMacros: array|null + * + * @param array $settings + * + * @return $this|static + */ + public function settings(array $settings): static + { + $this->localStrictModeEnabled = $settings['strictMode'] ?? null; + $this->localMonthsOverflow = $settings['monthOverflow'] ?? null; + $this->localYearsOverflow = $settings['yearOverflow'] ?? null; + $this->localHumanDiffOptions = $settings['humanDiffOptions'] ?? null; + $this->localToStringFormat = $settings['toStringFormat'] ?? null; + $this->localSerializer = $settings['toJsonFormat'] ?? null; + $this->localMacros = $settings['macros'] ?? null; + $this->localGenericMacros = $settings['genericMacros'] ?? null; + $this->localFormatFunction = $settings['formatFunction'] ?? null; + + if (isset($settings['locale'])) { + $locales = $settings['locale']; + + if (!\is_array($locales)) { + $locales = [$locales]; + } + + $this->locale(...$locales); + } elseif (isset($settings['translator']) && property_exists($this, 'localTranslator')) { + $this->localTranslator = $settings['translator']; + } + + if (isset($settings['innerTimezone'])) { + return $this->setTimezone($settings['innerTimezone']); + } + + if (isset($settings['timezone'])) { + return $this->shiftTimezone($settings['timezone']); + } + + return $this; + } + + /** + * Returns current local settings. + */ + public function getSettings(): array + { + $settings = []; + $map = [ + 'localStrictModeEnabled' => 'strictMode', + 'localMonthsOverflow' => 'monthOverflow', + 'localYearsOverflow' => 'yearOverflow', + 'localHumanDiffOptions' => 'humanDiffOptions', + 'localToStringFormat' => 'toStringFormat', + 'localSerializer' => 'toJsonFormat', + 'localMacros' => 'macros', + 'localGenericMacros' => 'genericMacros', + 'locale' => 'locale', + 'tzName' => 'timezone', + 'localFormatFunction' => 'formatFunction', + ]; + + foreach ($map as $property => $key) { + $value = $this->$property ?? null; + + if ($value !== null && ($key !== 'locale' || $value !== 'en' || $this->localTranslator)) { + $settings[$key] = $value; + } + } + + return $settings; + } + + /** + * Show truthy properties on var_dump(). + */ + public function __debugInfo(): array + { + $infos = array_filter(get_object_vars($this), static function ($var) { + return $var; + }); + + foreach (['dumpProperties', 'constructedObjectId', 'constructed', 'originalInput'] as $property) { + if (isset($infos[$property])) { + unset($infos[$property]); + } + } + + $this->addExtraDebugInfos($infos); + + foreach (["\0*\0", ''] as $prefix) { + $key = $prefix.'carbonRecurrences'; + + if (\array_key_exists($key, $infos)) { + $infos['recurrences'] = $infos[$key]; + unset($infos[$key]); + } + } + + return $infos; + } + + protected function isLocalStrictModeEnabled(): bool + { + return $this->localStrictModeEnabled + ?? $this->transmitFactory(static fn () => static::isStrictModeEnabled()); + } + + protected function addExtraDebugInfos(array &$infos): void + { + if ($this instanceof DateTimeInterface) { + try { + $infos['date'] ??= $this->format(CarbonInterface::MOCK_DATETIME_FORMAT); + $infos['timezone'] ??= $this->tzName ?? $this->timezoneSetting ?? $this->timezone ?? null; + } catch (Throwable) { + // noop + } + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php new file mode 100644 index 00000000..4239c668 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Rounding.php @@ -0,0 +1,226 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\Exceptions\UnknownUnitException; +use Carbon\WeekDay; +use DateInterval; + +/** + * Trait Rounding. + * + * Round, ceil, floor units. + * + * Depends on the following methods: + * + * @method static copy() + * @method static startOfWeek(int $weekStartsAt = null) + */ +trait Rounding +{ + use IntervalRounding; + + /** + * Round the current instance at the given unit with given precision if specified and the given function. + */ + public function roundUnit( + string $unit, + DateInterval|string|float|int $precision = 1, + callable|string $function = 'round', + ): static { + $metaUnits = [ + // @call roundUnit + 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], + // @call roundUnit + 'century' => [static::YEARS_PER_CENTURY, 'year'], + // @call roundUnit + 'decade' => [static::YEARS_PER_DECADE, 'year'], + // @call roundUnit + 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], + // @call roundUnit + 'millisecond' => [1000, 'microsecond'], + ]; + $normalizedUnit = static::singularUnit($unit); + $ranges = array_merge(static::getRangesByUnit($this->daysInMonth), [ + // @call roundUnit + 'microsecond' => [0, 999999], + ]); + $factor = 1; + + if ($normalizedUnit === 'week') { + $normalizedUnit = 'day'; + $precision *= static::DAYS_PER_WEEK; + } + + if (isset($metaUnits[$normalizedUnit])) { + [$factor, $normalizedUnit] = $metaUnits[$normalizedUnit]; + } + + $precision *= $factor; + + if (!isset($ranges[$normalizedUnit])) { + throw new UnknownUnitException($unit); + } + + $found = false; + $fraction = 0; + $arguments = null; + $initialValue = null; + $factor = $this->year < 0 ? -1 : 1; + $changes = []; + $minimumInc = null; + + foreach ($ranges as $unit => [$minimum, $maximum]) { + if ($normalizedUnit === $unit) { + $arguments = [$this->$unit, $minimum]; + $initialValue = $this->$unit; + $fraction = $precision - floor($precision); + $found = true; + + continue; + } + + if ($found) { + $delta = $maximum + 1 - $minimum; + $factor /= $delta; + $fraction *= $delta; + $inc = ($this->$unit - $minimum) * $factor; + + if ($inc !== 0.0) { + $minimumInc = $minimumInc ?? ($arguments[0] / pow(2, 52)); + + // If value is still the same when adding a non-zero increment/decrement, + // it means precision got lost in the addition + if (abs($inc) < $minimumInc) { + $inc = $minimumInc * ($inc < 0 ? -1 : 1); + } + + // If greater than $precision, assume precision loss caused an overflow + if ($function !== 'floor' || abs($arguments[0] + $inc - $initialValue) >= $precision) { + $arguments[0] += $inc; + } + } + + $changes[$unit] = round( + $minimum + ($fraction ? $fraction * $function(($this->$unit - $minimum) / $fraction) : 0), + ); + + // Cannot use modulo as it lose double precision + while ($changes[$unit] >= $delta) { + $changes[$unit] -= $delta; + } + + $fraction -= floor($fraction); + } + } + + [$value, $minimum] = $arguments; + $normalizedValue = floor($function(($value - $minimum) / $precision) * $precision + $minimum); + + /** @var CarbonInterface $result */ + $result = $this; + + foreach ($changes as $unit => $value) { + $result = $result->$unit($value); + } + + return $result->$normalizedUnit($normalizedValue); + } + + /** + * Truncate the current instance at the given unit with given precision if specified. + */ + public function floorUnit(string $unit, DateInterval|string|float|int $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'floor'); + } + + /** + * Ceil the current instance at the given unit with given precision if specified. + */ + public function ceilUnit(string $unit, DateInterval|string|float|int $precision = 1): static + { + return $this->roundUnit($unit, $precision, 'ceil'); + } + + /** + * Round the current instance second with given precision if specified. + */ + public function round(DateInterval|string|float|int $precision = 1, callable|string $function = 'round'): static + { + return $this->roundWith($precision, $function); + } + + /** + * Round the current instance second with given precision if specified. + */ + public function floor(DateInterval|string|float|int $precision = 1): static + { + return $this->round($precision, 'floor'); + } + + /** + * Ceil the current instance second with given precision if specified. + */ + public function ceil(DateInterval|string|float|int $precision = 1): static + { + return $this->round($precision, 'ceil'); + } + + /** + * Round the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function roundWeek(WeekDay|int|null $weekStartsAt = null): static + { + return $this->closest( + $this->avoidMutation()->floorWeek($weekStartsAt), + $this->avoidMutation()->ceilWeek($weekStartsAt), + ); + } + + /** + * Truncate the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function floorWeek(WeekDay|int|null $weekStartsAt = null): static + { + return $this->startOfWeek($weekStartsAt); + } + + /** + * Ceil the current instance week. + * + * @param WeekDay|int|null $weekStartsAt optional start allow you to specify the day of week to use to start the week + */ + public function ceilWeek(WeekDay|int|null $weekStartsAt = null): static + { + if ($this->isMutable()) { + $startOfWeek = $this->avoidMutation()->startOfWeek($weekStartsAt); + + return $startOfWeek != $this ? + $this->startOfWeek($weekStartsAt)->addWeek() : + $this; + } + + $startOfWeek = $this->startOfWeek($weekStartsAt); + + return $startOfWeek != $this ? + $startOfWeek->addWeek() : + $this->avoidMutation(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php new file mode 100644 index 00000000..1cb5c824 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Serialization.php @@ -0,0 +1,328 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\Exceptions\InvalidFormatException; +use Carbon\FactoryImmutable; +use DateTimeZone; +use ReturnTypeWillChange; +use Throwable; + +/** + * Trait Serialization. + * + * Serialization and JSON stuff. + * + * Depends on the following properties: + * + * @property int $year + * @property int $month + * @property int $daysInMonth + * @property int $quarter + * + * Depends on the following methods: + * + * @method string|static locale(string $locale = null, string ...$fallbackLocales) + * @method string toJSON() + */ +trait Serialization +{ + use ObjectInitialisation; + + /** + * List of key to use for dump/serialization. + * + * @var string[] + */ + protected array $dumpProperties = ['date', 'timezone_type', 'timezone']; + + /** + * Locale to dump comes here before serialization. + * + * @var string|null + */ + protected $dumpLocale; + + /** + * Embed date properties to dump in a dedicated variables so it won't overlap native + * DateTime ones. + * + * @var array|null + */ + protected $dumpDateProperties; + + /** + * Return a serialized string of the instance. + */ + public function serialize(): string + { + return serialize($this); + } + + /** + * Create an instance from a serialized string. + * + * If $value is not from a trusted source, consider using the allowed_classes option to limit + * the types of objects that can be built, for instance: + * + * @example + * ```php + * $object = Carbon::fromSerialized($value, ['allowed_classes' => [Carbon::class, CarbonImmutable::class]]); + * ``` + * + * @param \Stringable|string $value + * @param array $options example: ['allowed_classes' => [CarbonImmutable::class]] + * + * @throws InvalidFormatException + * + * @return static + */ + public static function fromSerialized($value, array $options = []): static + { + $instance = @unserialize((string) $value, $options); + + if (!$instance instanceof static) { + throw new InvalidFormatException("Invalid serialized value: $value"); + } + + return $instance; + } + + /** + * The __set_state handler. + * + * @param string|array $dump + * + * @return static + */ + #[ReturnTypeWillChange] + public static function __set_state($dump): static + { + if (\is_string($dump)) { + return static::parse($dump); + } + + /** @var \DateTimeInterface $date */ + $date = get_parent_class(static::class) && method_exists(parent::class, '__set_state') + ? parent::__set_state((array) $dump) + : (object) $dump; + + return static::instance($date); + } + + /** + * Returns the list of properties to dump on serialize() called on. + * + * Only used by PHP < 7.4. + * + * @return array + */ + public function __sleep() + { + $properties = $this->getSleepProperties(); + + if ($this->localTranslator ?? null) { + $properties[] = 'dumpLocale'; + $this->dumpLocale = $this->locale ?? null; + } + + return $properties; + } + + /** + * Returns the values to dump on serialize() called on. + * + * Only used by PHP >= 7.4. + * + * @return array + */ + public function __serialize(): array + { + // @codeCoverageIgnoreStart + if (isset($this->timezone_type, $this->timezone, $this->date)) { + return [ + 'date' => $this->date, + 'timezone_type' => $this->timezone_type, + 'timezone' => $this->dumpTimezone($this->timezone), + ]; + } + // @codeCoverageIgnoreEnd + + $timezone = $this->getTimezone(); + $export = [ + 'date' => $this->format('Y-m-d H:i:s.u'), + 'timezone_type' => $timezone->getType(), + 'timezone' => $timezone->getName(), + ]; + + // @codeCoverageIgnoreStart + if (\extension_loaded('msgpack') && isset($this->constructedObjectId)) { + $timezone = $this->timezone ?? null; + $export['dumpDateProperties'] = [ + 'date' => $this->format('Y-m-d H:i:s.u'), + 'timezone' => $this->dumpTimezone($timezone), + ]; + } + // @codeCoverageIgnoreEnd + + if ($this->localTranslator ?? null) { + $export['dumpLocale'] = $this->locale ?? null; + } + + return $export; + } + + /** + * Set locale if specified on unserialize() called. + * + * Only used by PHP < 7.4. + */ + public function __wakeup(): void + { + if (parent::class && method_exists(parent::class, '__wakeup')) { + // @codeCoverageIgnoreStart + try { + parent::__wakeup(); + } catch (Throwable $exception) { + try { + // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. + ['date' => $date, 'timezone' => $timezone] = $this->dumpDateProperties; + parent::__construct($date, $timezone); + } catch (Throwable) { + throw $exception; + } + } + // @codeCoverageIgnoreEnd + } + + $this->constructedObjectId = spl_object_hash($this); + + if (isset($this->dumpLocale)) { + $this->locale($this->dumpLocale); + $this->dumpLocale = null; + } + + $this->cleanupDumpProperties(); + } + + /** + * Set locale if specified on unserialize() called. + * + * Only used by PHP >= 7.4. + */ + public function __unserialize(array $data): void + { + // @codeCoverageIgnoreStart + try { + $this->__construct($data['date'] ?? null, $data['timezone'] ?? null); + } catch (Throwable $exception) { + if (!isset($data['dumpDateProperties']['date'], $data['dumpDateProperties']['timezone'])) { + throw $exception; + } + + try { + // FatalError occurs when calling msgpack_unpack() in PHP 7.4 or later. + ['date' => $date, 'timezone' => $timezone] = $data['dumpDateProperties']; + $this->__construct($date, $timezone); + } catch (Throwable) { + throw $exception; + } + } + // @codeCoverageIgnoreEnd + + if (isset($data['dumpLocale'])) { + $this->locale($data['dumpLocale']); + } + } + + /** + * Prepare the object for JSON serialization. + */ + public function jsonSerialize(): mixed + { + $serializer = $this->localSerializer + ?? $this->getFactory()->getSettings()['toJsonFormat'] + ?? null; + + if ($serializer) { + return \is_string($serializer) + ? $this->rawFormat($serializer) + : $serializer($this); + } + + return $this->toJSON(); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather transform Carbon object before the serialization. + * + * JSON serialize all Carbon instances using the given callback. + */ + public static function serializeUsing(string|callable|null $format): void + { + FactoryImmutable::getDefaultInstance()->serializeUsing($format); + } + + /** + * Cleanup properties attached to the public scope of DateTime when a dump of the date is requested. + * foreach ($date as $_) {} + * serializer($date) + * var_export($date) + * get_object_vars($date) + */ + public function cleanupDumpProperties(): self + { + // @codeCoverageIgnoreStart + if (PHP_VERSION < 8.2) { + foreach ($this->dumpProperties as $property) { + if (isset($this->$property)) { + unset($this->$property); + } + } + } + // @codeCoverageIgnoreEnd + + return $this; + } + + private function getSleepProperties(): array + { + $properties = $this->dumpProperties; + + // @codeCoverageIgnoreStart + if (!\extension_loaded('msgpack')) { + return $properties; + } + + if (isset($this->constructedObjectId)) { + $timezone = $this->timezone ?? null; + $this->dumpDateProperties = [ + 'date' => $this->format('Y-m-d H:i:s.u'), + 'timezone' => $this->dumpTimezone($timezone), + ]; + + $properties[] = 'dumpDateProperties'; + } + + return $properties; + // @codeCoverageIgnoreEnd + } + + /** @codeCoverageIgnore */ + private function dumpTimezone(mixed $timezone): mixed + { + return $timezone instanceof DateTimeZone ? $timezone->getName() : $timezone; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticLocalization.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticLocalization.php new file mode 100644 index 00000000..cb1e9e60 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticLocalization.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\FactoryImmutable; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Static config for localization. + */ +trait StaticLocalization +{ + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function setHumanDiffOptions(int $humanDiffOptions): void + { + FactoryImmutable::getDefaultInstance()->setHumanDiffOptions($humanDiffOptions); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function enableHumanDiffOption(int $humanDiffOption): void + { + FactoryImmutable::getDefaultInstance()->enableHumanDiffOption($humanDiffOption); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + */ + public static function disableHumanDiffOption(int $humanDiffOption): void + { + FactoryImmutable::getDefaultInstance()->disableHumanDiffOption($humanDiffOption); + } + + /** + * Return default humanDiff() options (merged flags as integer). + */ + public static function getHumanDiffOptions(): int + { + return FactoryImmutable::getInstance()->getHumanDiffOptions(); + } + + /** + * Set the default translator instance to use. + * + * @param TranslatorInterface $translator + * + * @return void + */ + public static function setTranslator(TranslatorInterface $translator): void + { + FactoryImmutable::getDefaultInstance()->setTranslator($translator); + } + + /** + * Initialize the default translator instance if necessary. + */ + public static function getTranslator(): TranslatorInterface + { + return FactoryImmutable::getInstance()->getTranslator(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticOptions.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticOptions.php new file mode 100644 index 00000000..44dd284e --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/StaticOptions.php @@ -0,0 +1,164 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\FactoryImmutable; + +/** + * Options related to a static variable. + */ +trait StaticOptions +{ + /////////////////////////////////////////////////////////////////// + ///////////// Behavior customization for sub-classes ////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Function to call instead of format. + * + * @var string|callable|null + */ + protected static $formatFunction; + + /** + * Function to call instead of createFromFormat. + * + * @var string|callable|null + */ + protected static $createFromFormatFunction; + + /** + * Function to call instead of parse. + * + * @var string|callable|null + */ + protected static $parseFunction; + + /////////////////////////////////////////////////////////////////// + ///////////// Use default factory for static options ////////////// + /////////////////////////////////////////////////////////////////// + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * @see settings + * + * Enable the strict mode (or disable with passing false). + * + * @param bool $strictModeEnabled + */ + public static function useStrictMode(bool $strictModeEnabled = true): void + { + FactoryImmutable::getDefaultInstance()->useStrictMode($strictModeEnabled); + } + + /** + * Returns true if the strict mode is globally in use, false else. + * (It can be overridden in specific instances.) + * + * @return bool + */ + public static function isStrictModeEnabled(): bool + { + return FactoryImmutable::getInstance()->isStrictModeEnabled(); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Indicates if months should be calculated with overflow. + * + * @param bool $monthsOverflow + * + * @return void + */ + public static function useMonthsOverflow(bool $monthsOverflow = true): void + { + FactoryImmutable::getDefaultInstance()->useMonthsOverflow($monthsOverflow); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addMonthsWithOverflow/addMonthsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Reset the month overflow behavior. + * + * @return void + */ + public static function resetMonthsOverflow(): void + { + FactoryImmutable::getDefaultInstance()->resetMonthsOverflow(); + } + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + * + * @return bool + */ + public static function shouldOverflowMonths(): bool + { + return FactoryImmutable::getInstance()->shouldOverflowMonths(); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Indicates if years should be calculated with overflow. + * + * @param bool $yearsOverflow + * + * @return void + */ + public static function useYearsOverflow(bool $yearsOverflow = true): void + { + FactoryImmutable::getDefaultInstance()->useYearsOverflow($yearsOverflow); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather use the ->settings() method. + * Or you can use method variants: addYearsWithOverflow/addYearsNoOverflow, same variants + * are available for quarters, years, decade, centuries, millennia (singular and plural forms). + * @see settings + * + * Reset the month overflow behavior. + * + * @return void + */ + public static function resetYearsOverflow(): void + { + FactoryImmutable::getDefaultInstance()->resetYearsOverflow(); + } + + /** + * Get the month overflow global behavior (can be overridden in specific instances). + * + * @return bool + */ + public static function shouldOverflowYears(): bool + { + return FactoryImmutable::getInstance()->shouldOverflowYears(); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Test.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Test.php new file mode 100644 index 00000000..c642dbdb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Test.php @@ -0,0 +1,185 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterface; +use Carbon\CarbonTimeZone; +use Carbon\Factory; +use Carbon\FactoryImmutable; +use Closure; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; + +trait Test +{ + /////////////////////////////////////////////////////////////////// + ///////////////////////// TESTING AIDS //////////////////////////// + /////////////////////////////////////////////////////////////////// + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * Note the timezone parameter was left out of the examples above and + * has no affect as the mock value will be returned regardless of its value. + * + * Only the moment is mocked with setTestNow(), the timezone will still be the one passed + * as parameter of date_default_timezone_get() as a fallback (see setTestNowAndTimezone()). + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNow(mixed $testNow = null): void + { + FactoryImmutable::getDefaultInstance()->setTestNow($testNow); + } + + /** + * Set a Carbon instance (real or mock) to be returned when a "now" + * instance is created. The provided instance will be returned + * specifically under the following conditions: + * - A call to the static now() method, ex. Carbon::now() + * - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null) + * - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now') + * - When a string containing the desired time is passed to Carbon::parse(). + * + * It will also align default timezone (e.g. call date_default_timezone_set()) with + * the second argument or if null, with the timezone of the given date object. + * + * To clear the test instance call this method using the default + * parameter of null. + * + * /!\ Use this method for unit tests only. + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + */ + public static function setTestNowAndTimezone($testNow = null, $timezone = null): void + { + FactoryImmutable::getDefaultInstance()->setTestNowAndTimezone($testNow, $timezone); + } + + /** + * Temporarily sets a static date to be used within the callback. + * Using setTestNow to set the date, executing the callback, then + * clearing the test instance. + * + * /!\ Use this method for unit tests only. + * + * @template T + * + * @param DateTimeInterface|Closure|static|string|false|null $testNow real or mock Carbon instance + * @param Closure(): T $callback + * + * @return T + */ + public static function withTestNow(mixed $testNow, callable $callback): mixed + { + return FactoryImmutable::getDefaultInstance()->withTestNow($testNow, $callback); + } + + /** + * Get the Carbon instance (real or mock) to be returned when a "now" + * instance is created. + * + * @return Closure|CarbonInterface|null the current instance used for testing + */ + public static function getTestNow(): Closure|CarbonInterface|null + { + return FactoryImmutable::getInstance()->getTestNow(); + } + + /** + * Determine if there is a valid test instance set. A valid test instance + * is anything that is not null. + * + * @return bool true if there is a test instance, otherwise false + */ + public static function hasTestNow(): bool + { + return FactoryImmutable::getInstance()->hasTestNow(); + } + + /** + * Get the mocked date passed in setTestNow() and if it's a Closure, execute it. + */ + protected static function getMockedTestNow(DateTimeZone|string|int|null $timezone): ?CarbonInterface + { + $testNow = FactoryImmutable::getInstance()->handleTestNowClosure(static::getTestNow(), $timezone); + + if ($testNow === null) { + return null; + } + + $testNow = $testNow->avoidMutation(); + + return $timezone ? $testNow->setTimezone($timezone) : $testNow; + } + + private function mockConstructorParameters(&$time, ?CarbonTimeZone $timezone): void + { + $clock = $this->clock?->unwrap(); + $now = $clock instanceof Factory + ? $clock->getTestNow() + : $this->nowFromClock($timezone); + $testInstance = $now ?? self::getMockedTestNowClone($timezone); + + if (!$testInstance) { + return; + } + + if ($testInstance instanceof DateTimeInterface) { + $testInstance = $testInstance->setTimezone($timezone ?? date_default_timezone_get()); + } + + if (static::hasRelativeKeywords($time)) { + $testInstance = $testInstance->modify($time); + } + + $factory = $this->getClock()?->unwrap(); + + if (!($factory instanceof Factory)) { + $factory = FactoryImmutable::getInstance(); + } + + $testInstance = $factory->handleTestNowClosure($testInstance, $timezone); + + $time = $testInstance instanceof self + ? $testInstance->rawFormat(static::MOCK_DATETIME_FORMAT) + : $testInstance->format(static::MOCK_DATETIME_FORMAT); + } + + private function getMockedTestNowClone($timezone): CarbonInterface|self|null + { + $mock = static::getMockedTestNow($timezone); + + return $mock ? clone $mock : null; + } + + private function nowFromClock(?CarbonTimeZone $timezone): ?DateTimeImmutable + { + $now = $this->clock?->now(); + + return $now && $timezone ? $now->setTimezone($timezone) : null; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php new file mode 100644 index 00000000..dab448de --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Timestamp.php @@ -0,0 +1,192 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use DateTimeZone; + +/** + * Trait Timestamp. + */ +trait Timestamp +{ + /** + * Create a Carbon instance from a timestamp and set the timezone (UTC by default). + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + #[\ReturnTypeWillChange] + public static function createFromTimestamp( + float|int|string $timestamp, + DateTimeZone|string|int|null $timezone = null, + ): static { + $date = static::createFromTimestampUTC($timestamp); + + return $timezone === null ? $date : $date->setTimezone($timezone); + } + + /** + * Create a Carbon instance from a timestamp keeping the timezone to UTC. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public static function createFromTimestampUTC(float|int|string $timestamp): static + { + [$integer, $decimal] = self::getIntegerAndDecimalParts($timestamp); + $delta = floor($decimal / static::MICROSECONDS_PER_SECOND); + $integer += $delta; + $decimal -= $delta * static::MICROSECONDS_PER_SECOND; + $decimal = str_pad((string) $decimal, 6, '0', STR_PAD_LEFT); + + return static::rawCreateFromFormat('U u', "$integer $decimal"); + } + + /** + * Create a Carbon instance from a timestamp in milliseconds. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + * + * @param float|int|string $timestamp + * + * @return static + */ + public static function createFromTimestampMsUTC($timestamp): static + { + [$milliseconds, $microseconds] = self::getIntegerAndDecimalParts($timestamp, 3); + $sign = $milliseconds < 0 || ($milliseconds === 0.0 && $microseconds < 0) ? -1 : 1; + $milliseconds = abs($milliseconds); + $microseconds = $sign * abs($microseconds) + static::MICROSECONDS_PER_MILLISECOND * ($milliseconds % static::MILLISECONDS_PER_SECOND); + $seconds = $sign * floor($milliseconds / static::MILLISECONDS_PER_SECOND); + $delta = floor($microseconds / static::MICROSECONDS_PER_SECOND); + $seconds = (int) ($seconds + $delta); + $microseconds -= $delta * static::MICROSECONDS_PER_SECOND; + $microseconds = str_pad((string) (int) $microseconds, 6, '0', STR_PAD_LEFT); + + return static::rawCreateFromFormat('U u', "$seconds $microseconds"); + } + + /** + * Create a Carbon instance from a timestamp in milliseconds. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public static function createFromTimestampMs( + float|int|string $timestamp, + DateTimeZone|string|int|null $timezone = null, + ): static { + $date = static::createFromTimestampMsUTC($timestamp); + + return $timezone === null ? $date : $date->setTimezone($timezone); + } + + /** + * Set the instance's timestamp. + * + * Timestamp input can be given as int, float or a string containing one or more numbers. + */ + public function timestamp(float|int|string $timestamp): static + { + return $this->setTimestamp($timestamp); + } + + /** + * Returns a timestamp rounded with the given precision (6 by default). + * + * @example getPreciseTimestamp() 1532087464437474 (microsecond maximum precision) + * @example getPreciseTimestamp(6) 1532087464437474 + * @example getPreciseTimestamp(5) 153208746443747 (1/100000 second precision) + * @example getPreciseTimestamp(4) 15320874644375 (1/10000 second precision) + * @example getPreciseTimestamp(3) 1532087464437 (millisecond precision) + * @example getPreciseTimestamp(2) 153208746444 (1/100 second precision) + * @example getPreciseTimestamp(1) 15320874644 (1/10 second precision) + * @example getPreciseTimestamp(0) 1532087464 (second precision) + * @example getPreciseTimestamp(-1) 153208746 (10 second precision) + * @example getPreciseTimestamp(-2) 15320875 (100 second precision) + * + * @param int $precision + * + * @return float + */ + public function getPreciseTimestamp($precision = 6): float + { + return round(((float) $this->rawFormat('Uu')) / pow(10, 6 - $precision)); + } + + /** + * Returns the milliseconds timestamps used amongst other by Date javascript objects. + * + * @return float + */ + public function valueOf(): float + { + return $this->getPreciseTimestamp(3); + } + + /** + * Returns the timestamp with millisecond precision. + * + * @return int + */ + public function getTimestampMs(): int + { + return (int) $this->getPreciseTimestamp(3); + } + + /** + * @alias getTimestamp + * + * Returns the UNIX timestamp for the current date. + * + * @return int + */ + public function unix(): int + { + return $this->getTimestamp(); + } + + /** + * Return an array with integer part digits and decimals digits split from one or more positive numbers + * (such as timestamps) as string with the given number of decimals (6 by default). + * + * By splitting integer and decimal, this method obtain a better precision than + * number_format when the input is a string. + * + * @param float|int|string $numbers one or more numbers + * @param int $decimals number of decimals precision (6 by default) + * + * @return array 0-index is integer part, 1-index is decimal part digits + */ + private static function getIntegerAndDecimalParts($numbers, $decimals = 6): array + { + if (\is_int($numbers) || \is_float($numbers)) { + $numbers = number_format($numbers, $decimals, '.', ''); + } + + $sign = str_starts_with($numbers, '-') ? -1 : 1; + $integer = 0; + $decimal = 0; + + foreach (preg_split('`[^\d.]+`', $numbers) as $chunk) { + [$integerPart, $decimalPart] = explode('.', "$chunk."); + + $integer += (int) $integerPart; + $decimal += (float) ("0.$decimalPart"); + } + + $overflow = floor($decimal); + $integer += $overflow; + $decimal -= $overflow; + + return [$sign * $integer, $decimal === 0.0 ? 0.0 : $sign * round($decimal * pow(10, $decimals))]; + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php new file mode 100644 index 00000000..5f0b367f --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/ToStringFormat.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\FactoryImmutable; +use Closure; + +/** + * Trait ToStringFormat. + * + * Handle global format customization for string cast of the object. + */ +trait ToStringFormat +{ + /** + * Reset the format used to the default when type juggling a Carbon instance to a string + * + * @return void + */ + public static function resetToStringFormat(): void + { + FactoryImmutable::getDefaultInstance()->resetToStringFormat(); + } + + /** + * @deprecated To avoid conflict between different third-party libraries, static setters should not be used. + * You should rather let Carbon object being cast to string with DEFAULT_TO_STRING_FORMAT, and + * use other method or custom format passed to format() method if you need to dump another string + * format. + * + * Set the default format used when type juggling a Carbon instance to a string. + * + * @param string|Closure|null $format + * + * @return void + */ + public static function setToStringFormat(string|Closure|null $format): void + { + FactoryImmutable::getDefaultInstance()->setToStringFormat($format); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Units.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Units.php new file mode 100644 index 00000000..59537214 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Units.php @@ -0,0 +1,469 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonConverterInterface; +use Carbon\CarbonInterface; +use Carbon\CarbonInterval; +use Carbon\Exceptions\InvalidFormatException; +use Carbon\Exceptions\InvalidIntervalException; +use Carbon\Exceptions\UnitException; +use Carbon\Exceptions\UnsupportedUnitException; +use Carbon\Unit; +use Closure; +use DateInterval; +use DateMalformedStringException; +use ReturnTypeWillChange; + +/** + * Trait Units. + * + * Add, subtract and set units. + */ +trait Units +{ + /** + * @deprecated Prefer to use add addUTCUnit() which more accurately defines what it's doing. + * + * Add seconds to the instance using timestamp. Positive $value travels + * forward while negative $value travels into the past. + * + * @param string $unit + * @param int|float|null $value + * + * @return static + */ + public function addRealUnit(string $unit, $value = 1): static + { + return $this->addUTCUnit($unit, $value); + } + + /** + * Add seconds to the instance using timestamp. Positive $value travels + * forward while negative $value travels into the past. + * + * @param string $unit + * @param int|float|null $value + * + * @return static + */ + public function addUTCUnit(string $unit, $value = 1): static + { + $value ??= 0; + + switch ($unit) { + // @call addUTCUnit + case 'micro': + + // @call addUTCUnit + case 'microsecond': + /* @var CarbonInterface $this */ + $diff = $this->microsecond + $value; + $time = $this->getTimestamp(); + $seconds = (int) floor($diff / static::MICROSECONDS_PER_SECOND); + $time += $seconds; + $diff -= $seconds * static::MICROSECONDS_PER_SECOND; + $microtime = str_pad((string) $diff, 6, '0', STR_PAD_LEFT); + $timezone = $this->tz; + + return $this->tz('UTC')->modify("@$time.$microtime")->setTimezone($timezone); + + // @call addUTCUnit + case 'milli': + // @call addUTCUnit + case 'millisecond': + return $this->addUTCUnit('microsecond', $value * static::MICROSECONDS_PER_MILLISECOND); + + // @call addUTCUnit + case 'second': + break; + + // @call addUTCUnit + case 'minute': + $value *= static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'hour': + $value *= static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'day': + $value *= static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'week': + $value *= static::DAYS_PER_WEEK * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'month': + $value *= 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'quarter': + $value *= static::MONTHS_PER_QUARTER * 30 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'year': + $value *= 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'decade': + $value *= static::YEARS_PER_DECADE * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'century': + $value *= static::YEARS_PER_CENTURY * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + // @call addUTCUnit + case 'millennium': + $value *= static::YEARS_PER_MILLENNIUM * 365 * static::HOURS_PER_DAY * static::MINUTES_PER_HOUR * static::SECONDS_PER_MINUTE; + + break; + + default: + if ($this->isLocalStrictModeEnabled()) { + throw new UnitException("Invalid unit for real timestamp add/sub: '$unit'"); + } + + return $this; + } + + $seconds = (int) $value; + $microseconds = (int) round( + (abs($value) - abs($seconds)) * ($value < 0 ? -1 : 1) * static::MICROSECONDS_PER_SECOND, + ); + $date = $this->setTimestamp($this->getTimestamp() + $seconds); + + return $microseconds ? $date->addUTCUnit('microsecond', $microseconds) : $date; + } + + /** + * @deprecated Prefer to use add subUTCUnit() which more accurately defines what it's doing. + * + * Subtract seconds to the instance using timestamp. Positive $value travels + * into the past while negative $value travels forward. + * + * @param string $unit + * @param int $value + * + * @return static + */ + public function subRealUnit($unit, $value = 1): static + { + return $this->addUTCUnit($unit, -$value); + } + + /** + * Subtract seconds to the instance using timestamp. Positive $value travels + * into the past while negative $value travels forward. + * + * @param string $unit + * @param int $value + * + * @return static + */ + public function subUTCUnit($unit, $value = 1): static + { + return $this->addUTCUnit($unit, -$value); + } + + /** + * Returns true if a property can be changed via setter. + * + * @param string $unit + * + * @return bool + */ + public static function isModifiableUnit($unit): bool + { + static $modifiableUnits = [ + // @call addUnit + 'millennium', + // @call addUnit + 'century', + // @call addUnit + 'decade', + // @call addUnit + 'quarter', + // @call addUnit + 'week', + // @call addUnit + 'weekday', + ]; + + return \in_array($unit, $modifiableUnits, true) || \in_array($unit, static::$units, true); + } + + /** + * Call native PHP DateTime/DateTimeImmutable add() method. + * + * @param DateInterval $interval + * + * @return static + */ + public function rawAdd(DateInterval $interval): static + { + return parent::add($interval); + } + + /** + * Add given units or interval to the current instance. + * + * @example $date->add('hour', 3) + * @example $date->add(15, 'days') + * @example $date->add(CarbonInterval::days(4)) + * + * @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + #[ReturnTypeWillChange] + public function add($unit, $value = 1, ?bool $overflow = null): static + { + $unit = Unit::toNameIfUnit($unit); + $value = Unit::toNameIfUnit($value); + + if (\is_string($unit) && \func_num_args() === 1) { + $unit = CarbonInterval::make($unit, [], true); + } + + if ($unit instanceof CarbonConverterInterface) { + $unit = Closure::fromCallable([$unit, 'convertDate']); + } + + if ($unit instanceof Closure) { + $result = $this->resolveCarbon($unit($this, false)); + + if ($this !== $result && $this->isMutable()) { + return $this->modify($result->rawFormat('Y-m-d H:i:s.u e O')); + } + + return $result; + } + + if ($unit instanceof DateInterval) { + return parent::add($unit); + } + + if (is_numeric($unit)) { + [$value, $unit] = [$unit, $value]; + } + + return $this->addUnit((string) $unit, $value, $overflow); + } + + /** + * Add given units to the current instance. + */ + public function addUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static + { + $unit = Unit::toName($unit); + + $originalArgs = \func_get_args(); + + $date = $this; + + if (!is_numeric($value) || !(float) $value) { + return $date->isMutable() ? $date : $date->copy(); + } + + $unit = self::singularUnit($unit); + $metaUnits = [ + 'millennium' => [static::YEARS_PER_MILLENNIUM, 'year'], + 'century' => [static::YEARS_PER_CENTURY, 'year'], + 'decade' => [static::YEARS_PER_DECADE, 'year'], + 'quarter' => [static::MONTHS_PER_QUARTER, 'month'], + ]; + + if (isset($metaUnits[$unit])) { + [$factor, $unit] = $metaUnits[$unit]; + $value *= $factor; + } + + if ($unit === 'weekday') { + $weekendDays = $this->transmitFactory(static fn () => static::getWeekendDays()); + + if ($weekendDays !== [static::SATURDAY, static::SUNDAY]) { + $absoluteValue = abs($value); + $sign = $value / max(1, $absoluteValue); + $weekDaysCount = static::DAYS_PER_WEEK - min(static::DAYS_PER_WEEK - 1, \count(array_unique($weekendDays))); + $weeks = floor($absoluteValue / $weekDaysCount); + + for ($diff = $absoluteValue % $weekDaysCount; $diff; $diff--) { + /** @var static $date */ + $date = $date->addDays($sign); + + while (\in_array($date->dayOfWeek, $weekendDays, true)) { + $date = $date->addDays($sign); + } + } + + $value = $weeks * $sign; + $unit = 'week'; + } + + $timeString = $date->toTimeString(); + } elseif ($canOverflow = (\in_array($unit, [ + 'month', + 'year', + ]) && ($overflow === false || ( + $overflow === null && + ($ucUnit = ucfirst($unit).'s') && + !($this->{'local'.$ucUnit.'Overflow'} ?? static::{'shouldOverflow'.$ucUnit}()) + )))) { + $day = $date->day; + } + + if ($unit === 'milli' || $unit === 'millisecond') { + $unit = 'microsecond'; + $value *= static::MICROSECONDS_PER_MILLISECOND; + } + + $previousException = null; + + try { + $date = self::rawAddUnit($date, $unit, $value); + + if (isset($timeString)) { + $date = $date?->setTimeFromTimeString($timeString); + } elseif (isset($canOverflow, $day) && $canOverflow && $day !== $date?->day) { + $date = $date?->modify('last day of previous month'); + } + } catch (DateMalformedStringException|InvalidFormatException|UnsupportedUnitException $exception) { + $date = null; + $previousException = $exception; + } + + return $date ?? throw new UnitException( + 'Unable to add unit '.var_export($originalArgs, true), + previous: $previousException, + ); + } + + /** + * Subtract given units to the current instance. + */ + public function subUnit(Unit|string $unit, $value = 1, ?bool $overflow = null): static + { + return $this->addUnit($unit, -$value, $overflow); + } + + /** + * Call native PHP DateTime/DateTimeImmutable sub() method. + */ + public function rawSub(DateInterval $interval): static + { + return parent::sub($interval); + } + + /** + * Subtract given units or interval to the current instance. + * + * @example $date->sub('hour', 3) + * @example $date->sub(15, 'days') + * @example $date->sub(CarbonInterval::days(4)) + * + * @param Unit|string|DateInterval|Closure|CarbonConverterInterface $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + #[ReturnTypeWillChange] + public function sub($unit, $value = 1, ?bool $overflow = null): static + { + if (\is_string($unit) && \func_num_args() === 1) { + $unit = CarbonInterval::make($unit, [], true); + } + + if ($unit instanceof CarbonConverterInterface) { + $unit = Closure::fromCallable([$unit, 'convertDate']); + } + + if ($unit instanceof Closure) { + $result = $this->resolveCarbon($unit($this, true)); + + if ($this !== $result && $this->isMutable()) { + return $this->modify($result->rawFormat('Y-m-d H:i:s.u e O')); + } + + return $result; + } + + if ($unit instanceof DateInterval) { + return parent::sub($unit); + } + + if (is_numeric($unit)) { + [$value, $unit] = [$unit, $value]; + } + + return $this->addUnit((string) $unit, -(float) $value, $overflow); + } + + /** + * Subtract given units or interval to the current instance. + * + * @see sub() + * + * @param string|DateInterval $unit + * @param int|float $value + * @param bool|null $overflow + * + * @return static + */ + public function subtract($unit, $value = 1, ?bool $overflow = null): static + { + if (\is_string($unit) && \func_num_args() === 1) { + $unit = CarbonInterval::make($unit, [], true); + } + + return $this->sub($unit, $value, $overflow); + } + + private static function rawAddUnit(self $date, string $unit, int|float $value): ?static + { + try { + return $date->rawAdd( + CarbonInterval::fromString(abs($value)." $unit")->invert($value < 0), + ); + } catch (InvalidIntervalException $exception) { + try { + return $date->modify("$value $unit"); + } catch (InvalidFormatException) { + throw new UnsupportedUnitException($unit, previous: $exception); + } + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Week.php b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Week.php new file mode 100644 index 00000000..0101d055 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Traits/Week.php @@ -0,0 +1,223 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon\Traits; + +use Carbon\CarbonInterval; + +/** + * Trait Week. + * + * week and ISO week number, year and count in year. + * + * Depends on the following properties: + * + * @property int $daysInYear + * @property int $dayOfWeek + * @property int $dayOfYear + * @property int $year + * + * Depends on the following methods: + * + * @method static addWeeks(int $weeks = 1) + * @method static copy() + * @method static dayOfYear(int $dayOfYear) + * @method string getTranslationMessage(string $key, ?string $locale = null, ?string $default = null, $translator = null) + * @method static next(int|string $modifier = null) + * @method static startOfWeek(int $day = null) + * @method static subWeeks(int $weeks = 1) + * @method static year(int $year = null) + */ +trait Week +{ + /** + * Set/get the week number of year using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int|static + */ + public function isoWeekYear($year = null, $dayOfWeek = null, $dayOfYear = null) + { + return $this->weekYear( + $year, + $dayOfWeek ?? static::MONDAY, + $dayOfYear ?? static::THURSDAY, + ); + } + + /** + * Set/get the week number of year using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $year if null, act as a getter, if not null, set the year and return current instance. + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int|static + */ + public function weekYear($year = null, $dayOfWeek = null, $dayOfYear = null) + { + $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? static::SUNDAY; + $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; + + if ($year !== null) { + $year = (int) round($year); + + if ($this->weekYear(null, $dayOfWeek, $dayOfYear) === $year) { + return $this->avoidMutation(); + } + + $week = $this->week(null, $dayOfWeek, $dayOfYear); + $day = $this->dayOfWeek; + $date = $this->year($year); + + $date = match ($date->weekYear(null, $dayOfWeek, $dayOfYear) - $year) { + CarbonInterval::POSITIVE => $date->subWeeks(static::WEEKS_PER_YEAR / 2), + CarbonInterval::NEGATIVE => $date->addWeeks(static::WEEKS_PER_YEAR / 2), + default => $date, + }; + + $date = $date + ->addWeeks($week - $date->week(null, $dayOfWeek, $dayOfYear)) + ->startOfWeek($dayOfWeek); + + if ($date->dayOfWeek === $day) { + return $date; + } + + return $date->next($day); + } + + $year = $this->year; + $day = $this->dayOfYear; + $date = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + + if ($date->year === $year && $day < $date->dayOfYear) { + return $year - 1; + } + + $date = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + + if ($date->year === $year && $day >= $date->dayOfYear) { + return $year + 1; + } + + return $year; + } + + /** + * Get the number of weeks of the current week-year using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int + */ + public function isoWeeksInYear($dayOfWeek = null, $dayOfYear = null) + { + return $this->weeksInYear( + $dayOfWeek ?? static::MONDAY, + $dayOfYear ?? static::THURSDAY, + ); + } + + /** + * Get the number of weeks of the current week-year using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $dayOfWeek first date of week from 0 (Sunday) to 6 (Saturday) + * @param int|null $dayOfYear first day of year included in the week #1 + * + * @return int + */ + public function weeksInYear($dayOfWeek = null, $dayOfYear = null) + { + $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? static::SUNDAY; + $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; + $year = $this->year; + $start = $this->avoidMutation()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + $startDay = $start->dayOfYear; + if ($start->year !== $year) { + $startDay -= $start->daysInYear; + } + $end = $this->avoidMutation()->addYear()->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + $endDay = $end->dayOfYear; + if ($end->year !== $year) { + $endDay += $this->daysInYear; + } + + return (int) round(($endDay - $startDay) / static::DAYS_PER_WEEK); + } + + /** + * Get/set the week number using given first day of week and first + * day of year included in the first week. Or use US format if no settings + * given (Sunday / Jan 6). + * + * @param int|null $week + * @param int|null $dayOfWeek + * @param int|null $dayOfYear + * + * @return int|static + */ + public function week($week = null, $dayOfWeek = null, $dayOfYear = null) + { + $date = $this; + $dayOfWeek = $dayOfWeek ?? $this->getTranslationMessage('first_day_of_week') ?? 0; + $dayOfYear = $dayOfYear ?? $this->getTranslationMessage('day_of_first_week_of_year') ?? 1; + + if ($week !== null) { + return $date->addWeeks(round($week) - $this->week(null, $dayOfWeek, $dayOfYear)); + } + + $start = $date->avoidMutation()->shiftTimezone('UTC')->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + $end = $date->avoidMutation()->shiftTimezone('UTC')->startOfWeek($dayOfWeek); + + if ($start > $end) { + $start = $start->subWeeks(static::WEEKS_PER_YEAR / 2)->dayOfYear($dayOfYear)->startOfWeek($dayOfWeek); + } + + $week = (int) ($start->diffInDays($end) / static::DAYS_PER_WEEK + 1); + + return $week > $end->weeksInYear($dayOfWeek, $dayOfYear) ? 1 : $week; + } + + /** + * Get/set the week number using given first day of week and first + * day of year included in the first week. Or use ISO format if no settings + * given. + * + * @param int|null $week + * @param int|null $dayOfWeek + * @param int|null $dayOfYear + * + * @return int|static + */ + public function isoWeek($week = null, $dayOfWeek = null, $dayOfYear = null) + { + return $this->week( + $week, + $dayOfWeek ?? static::MONDAY, + $dayOfYear ?? static::THURSDAY, + ); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Translator.php b/plugins/vendor/nesbot/carbon/src/Carbon/Translator.php new file mode 100644 index 00000000..9f523b26 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Translator.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use ReflectionMethod; +use Symfony\Component\Translation; +use Symfony\Contracts\Translation\TranslatorInterface; + +$transMethod = new ReflectionMethod( + class_exists(TranslatorInterface::class) + ? TranslatorInterface::class + : Translation\Translator::class, + 'trans', +); + +require $transMethod->hasReturnType() + ? __DIR__.'/../../lazy/Carbon/TranslatorStrongType.php' + : __DIR__.'/../../lazy/Carbon/TranslatorWeakType.php'; + +class Translator extends LazyTranslator +{ + // Proxy dynamically loaded LazyTranslator in a static way +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php b/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php new file mode 100644 index 00000000..ab9933e5 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorImmutable.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\ImmutableException; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; + +class TranslatorImmutable extends Translator +{ + private bool $constructed = false; + + public function __construct($locale, ?MessageFormatterInterface $formatter = null, $cacheDir = null, $debug = false) + { + parent::__construct($locale, $formatter, $cacheDir, $debug); + $this->constructed = true; + } + + /** + * @codeCoverageIgnore + */ + public function setDirectories(array $directories): static + { + $this->disallowMutation(__METHOD__); + + return parent::setDirectories($directories); + } + + public function setLocale($locale): void + { + $this->disallowMutation(__METHOD__); + + parent::setLocale($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setMessages(string $locale, array $messages): static + { + $this->disallowMutation(__METHOD__); + + return parent::setMessages($locale, $messages); + } + + /** + * @codeCoverageIgnore + */ + public function setTranslations(array $messages): static + { + $this->disallowMutation(__METHOD__); + + return parent::setTranslations($messages); + } + + /** + * @codeCoverageIgnore + */ + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void + { + $this->disallowMutation(__METHOD__); + + parent::setConfigCacheFactory($configCacheFactory); + } + + public function resetMessages(?string $locale = null): bool + { + $this->disallowMutation(__METHOD__); + + return parent::resetMessages($locale); + } + + /** + * @codeCoverageIgnore + */ + public function setFallbackLocales(array $locales): void + { + $this->disallowMutation(__METHOD__); + + parent::setFallbackLocales($locales); + } + + private function disallowMutation($method) + { + if ($this->constructed) { + throw new ImmutableException($method.' not allowed on '.static::class); + } + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php b/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php new file mode 100644 index 00000000..54a79809 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/TranslatorStrongTypeInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Mark translator using strong type from symfony/translation >= 6. + */ +interface TranslatorStrongTypeInterface +{ + public function getFromCatalogue(MessageCatalogueInterface $catalogue, string $id, string $domain = 'messages'); +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/Unit.php b/plugins/vendor/nesbot/carbon/src/Carbon/Unit.php new file mode 100644 index 00000000..dc6b3267 --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/Unit.php @@ -0,0 +1,119 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +enum Unit: string +{ + case Microsecond = 'microsecond'; + case Millisecond = 'millisecond'; + case Second = 'second'; + case Minute = 'minute'; + case Hour = 'hour'; + case Day = 'day'; + case Week = 'week'; + case Month = 'month'; + case Quarter = 'quarter'; + case Year = 'year'; + case Decade = 'decade'; + case Century = 'century'; + case Millennium = 'millennium'; + + public static function toName(self|string $unit): string + { + return $unit instanceof self ? $unit->value : $unit; + } + + /** @internal */ + public static function toNameIfUnit(mixed $unit): mixed + { + return $unit instanceof self ? $unit->value : $unit; + } + + public static function fromName(string $name, ?string $locale = null): self + { + if ($locale !== null) { + $messages = Translator::get($locale)->getMessages($locale) ?? []; + + if ($messages !== []) { + $lowerName = mb_strtolower($name); + + foreach (self::cases() as $unit) { + foreach (['', '_from_now', '_ago', '_after', '_before'] as $suffix) { + $message = $messages[$unit->value.$suffix] ?? null; + + if (\is_string($message)) { + $words = explode('|', mb_strtolower(preg_replace( + '/[{\[\]].+?[}\[\]]/', + '', + str_replace(':count', '', $message), + ))); + + foreach ($words as $word) { + if (trim($word) === $lowerName) { + return $unit; + } + } + } + } + } + } + } + + return self::from(CarbonImmutable::singularUnit($name)); + } + + public function singular(?string $locale = null): string + { + if ($locale !== null) { + return trim(Translator::get($locale)->trans($this->value, [ + '%count%' => 1, + ':count' => 1, + ]), "1 \n\r\t\v\0"); + } + + return $this->value; + } + + public function plural(?string $locale = null): string + { + if ($locale !== null) { + return trim(Translator::get($locale)->trans($this->value, [ + '%count%' => 9, + ':count' => 9, + ]), "9 \n\r\t\v\0"); + } + + return CarbonImmutable::pluralUnit($this->value); + } + + public function interval(int|float $value = 1): CarbonInterval + { + return CarbonInterval::fromString("$value $this->name"); + } + + public function locale(string $locale): CarbonInterval + { + return $this->interval()->locale($locale); + } + + public function toPeriod(...$params): CarbonPeriod + { + return $this->interval()->toPeriod(...$params); + } + + public function stepBy(mixed $interval, Unit|string|null $unit = null): CarbonPeriod + { + return $this->interval()->stepBy($interval, $unit); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/WeekDay.php b/plugins/vendor/nesbot/carbon/src/Carbon/WeekDay.php new file mode 100644 index 00000000..69f69ceb --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/WeekDay.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use Carbon\Exceptions\InvalidFormatException; + +enum WeekDay: int +{ + // Using constants is only safe starting from PHP 8.2 + case Sunday = 0; // CarbonInterface::SUNDAY + case Monday = 1; // CarbonInterface::MONDAY + case Tuesday = 2; // CarbonInterface::TUESDAY + case Wednesday = 3; // CarbonInterface::WEDNESDAY + case Thursday = 4; // CarbonInterface::THURSDAY + case Friday = 5; // CarbonInterface::FRIDAY + case Saturday = 6; // CarbonInterface::SATURDAY + + public static function int(self|int|null $value): ?int + { + return $value instanceof self ? $value->value : $value; + } + + public static function fromNumber(int $number): self + { + $day = $number % CarbonInterface::DAYS_PER_WEEK; + + return self::from($day + ($day < 0 ? CarbonInterface::DAYS_PER_WEEK : 0)); + } + + public static function fromName(string $name, ?string $locale = null): self + { + try { + return self::from(CarbonImmutable::parseFromLocale($name, $locale)->dayOfWeek); + } catch (InvalidFormatException $exception) { + // Possibly current language expect a dot after short name, but it's missing + if ($locale !== null && !mb_strlen($name) < 4 && !str_ends_with($name, '.')) { + try { + return self::from(CarbonImmutable::parseFromLocale($name.'.', $locale)->dayOfWeek); + } catch (InvalidFormatException) { + // Throw previous error + } + } + + throw $exception; + } + } + + public function next(?CarbonImmutable $now = null): CarbonImmutable + { + return $now?->modify($this->name) ?? new CarbonImmutable($this->name); + } + + public function locale(string $locale, ?CarbonImmutable $now = null): CarbonImmutable + { + return $this->next($now)->locale($locale); + } +} diff --git a/plugins/vendor/nesbot/carbon/src/Carbon/WrapperClock.php b/plugins/vendor/nesbot/carbon/src/Carbon/WrapperClock.php new file mode 100644 index 00000000..7fb184fe --- /dev/null +++ b/plugins/vendor/nesbot/carbon/src/Carbon/WrapperClock.php @@ -0,0 +1,187 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Carbon; + +use DateTime; +use DateTimeImmutable; +use DateTimeInterface; +use DateTimeZone; +use Psr\Clock\ClockInterface as PsrClockInterface; +use RuntimeException; +use Symfony\Component\Clock\ClockInterface; + +final class WrapperClock implements ClockInterface +{ + public function __construct( + private PsrClockInterface|Factory|DateTimeInterface $currentClock, + ) { + } + + public function unwrap(): PsrClockInterface|Factory|DateTimeInterface + { + return $this->currentClock; + } + + public function getFactory(): Factory + { + if ($this->currentClock instanceof Factory) { + return $this->currentClock; + } + + if ($this->currentClock instanceof DateTime) { + $factory = new Factory(); + $factory->setTestNowAndTimezone($this->currentClock); + + return $factory; + } + + if ($this->currentClock instanceof DateTimeImmutable) { + $factory = new FactoryImmutable(); + $factory->setTestNowAndTimezone($this->currentClock); + + return $factory; + } + + $factory = new FactoryImmutable(); + $factory->setTestNowAndTimezone(fn () => $this->currentClock->now()); + + return $factory; + } + + private function nowRaw(): DateTimeInterface + { + if ($this->currentClock instanceof DateTimeInterface) { + return $this->currentClock; + } + + if ($this->currentClock instanceof Factory) { + return $this->currentClock->__call('now', []); + } + + return $this->currentClock->now(); + } + + public function now(): DateTimeImmutable + { + $now = $this->nowRaw(); + + return $now instanceof DateTimeImmutable + ? $now + : new CarbonImmutable($now); + } + + /** + * @template T of CarbonInterface + * + * @param class-string $class + * + * @return T + */ + public function nowAs(string $class, DateTimeZone|string|int|null $timezone = null): CarbonInterface + { + $now = $this->nowRaw(); + $date = $now instanceof $class ? $now : $class::instance($now); + + return $timezone === null ? $date : $date->setTimezone($timezone); + } + + public function nowAsCarbon(DateTimeZone|string|int|null $timezone = null): CarbonInterface + { + $now = $this->nowRaw(); + + return $now instanceof CarbonInterface + ? ($timezone === null ? $now : $now->setTimezone($timezone)) + : $this->dateAsCarbon($now, $timezone); + } + + private function dateAsCarbon(DateTimeInterface $date, DateTimeZone|string|int|null $timezone): CarbonInterface + { + return $date instanceof DateTimeImmutable + ? new CarbonImmutable($date, $timezone) + : new Carbon($date, $timezone); + } + + public function sleep(float|int $seconds): void + { + if ($seconds === 0 || $seconds === 0.0) { + return; + } + + if ($seconds < 0) { + throw new RuntimeException('Expected positive number of seconds, '.$seconds.' given'); + } + + if ($this->currentClock instanceof DateTimeInterface) { + $this->currentClock = $this->addSeconds($this->currentClock, $seconds); + + return; + } + + if ($this->currentClock instanceof ClockInterface) { + $this->currentClock->sleep($seconds); + + return; + } + + $this->currentClock = $this->addSeconds($this->currentClock->now(), $seconds); + } + + public function withTimeZone(DateTimeZone|string $timezone): static + { + if ($this->currentClock instanceof ClockInterface) { + return new self($this->currentClock->withTimeZone($timezone)); + } + + $now = $this->currentClock instanceof DateTimeInterface + ? $this->currentClock + : $this->currentClock->now(); + + if (!($now instanceof DateTimeImmutable)) { + $now = clone $now; + } + + if (\is_string($timezone)) { + $timezone = new DateTimeZone($timezone); + } + + return new self($now->setTimezone($timezone)); + } + + private function addSeconds(DateTimeInterface $date, float|int $seconds): DateTimeInterface + { + $secondsPerHour = CarbonInterface::SECONDS_PER_MINUTE * CarbonInterface::MINUTES_PER_HOUR; + $hours = number_format( + floor($seconds / $secondsPerHour), + thousands_separator: '', + ); + $microseconds = number_format( + ($seconds - $hours * $secondsPerHour) * CarbonInterface::MICROSECONDS_PER_SECOND, + thousands_separator: '', + ); + + if (!($date instanceof DateTimeImmutable)) { + $date = clone $date; + } + + if ($hours !== '0') { + $date = $date->modify("$hours hours"); + } + + if ($microseconds !== '0') { + $date = $date->modify("$microseconds microseconds"); + } + + return $date; + } +} diff --git a/plugins/vendor/psr/clock/CHANGELOG.md b/plugins/vendor/psr/clock/CHANGELOG.md new file mode 100644 index 00000000..3cd6b9b7 --- /dev/null +++ b/plugins/vendor/psr/clock/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog + +All notable changes to this project will be documented in this file, in reverse chronological order by release. + +## 1.0.0 + +First stable release after PSR-20 acceptance + +## 0.1.0 + +First release diff --git a/plugins/vendor/psr/clock/LICENSE b/plugins/vendor/psr/clock/LICENSE new file mode 100644 index 00000000..be683421 --- /dev/null +++ b/plugins/vendor/psr/clock/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2017 PHP Framework Interoperability Group + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/psr/clock/README.md b/plugins/vendor/psr/clock/README.md new file mode 100644 index 00000000..6ca877ee --- /dev/null +++ b/plugins/vendor/psr/clock/README.md @@ -0,0 +1,61 @@ +# PSR Clock + +This repository holds the interface for [PSR-20][psr-url]. + +Note that this is not a clock of its own. It is merely an interface that +describes a clock. See the specification for more details. + +## Installation + +```bash +composer require psr/clock +``` + +## Usage + +If you need a clock, you can use the interface like this: + +```php +clock = $clock; + } + + public function doSomething() + { + /** @var DateTimeImmutable $currentDateAndTime */ + $currentDateAndTime = $this->clock->now(); + // do something useful with that information + } +} +``` + +You can then pick one of the [implementations][implementation-url] of the interface to get a clock. + +If you want to implement the interface, you can require this package and +implement `Psr\Clock\ClockInterface` in your code. + +Don't forget to add `psr/clock-implementation` to your `composer.json`s `provides`-section like this: + +```json +{ + "provides": { + "psr/clock-implementation": "1.0" + } +} +``` + +And please read the [specification text][specification-url] for details on the interface. + +[psr-url]: https://www.php-fig.org/psr/psr-20 +[package-url]: https://packagist.org/packages/psr/clock +[implementation-url]: https://packagist.org/providers/psr/clock-implementation +[specification-url]: https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md diff --git a/plugins/vendor/psr/clock/composer.json b/plugins/vendor/psr/clock/composer.json new file mode 100644 index 00000000..77992eda --- /dev/null +++ b/plugins/vendor/psr/clock/composer.json @@ -0,0 +1,21 @@ +{ + "name": "psr/clock", + "description": "Common interface for reading the clock.", + "keywords": ["psr", "psr-20", "time", "clock", "now"], + "homepage": "https://github.com/php-fig/clock", + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": "^7.0 || ^8.0" + }, + "autoload": { + "psr-4": { + "Psr\\Clock\\": "src/" + } + } +} diff --git a/plugins/vendor/psr/clock/src/ClockInterface.php b/plugins/vendor/psr/clock/src/ClockInterface.php new file mode 100644 index 00000000..7b6d8d8a --- /dev/null +++ b/plugins/vendor/psr/clock/src/ClockInterface.php @@ -0,0 +1,13 @@ +=7.4.0" + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + } +} diff --git a/plugins/vendor/psr/container/src/ContainerExceptionInterface.php b/plugins/vendor/psr/container/src/ContainerExceptionInterface.php new file mode 100644 index 00000000..0f213f2f --- /dev/null +++ b/plugins/vendor/psr/container/src/ContainerExceptionInterface.php @@ -0,0 +1,12 @@ + Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/plugins/vendor/psr/simple-cache/README.md b/plugins/vendor/psr/simple-cache/README.md new file mode 100644 index 00000000..43641d17 --- /dev/null +++ b/plugins/vendor/psr/simple-cache/README.md @@ -0,0 +1,8 @@ +PHP FIG Simple Cache PSR +======================== + +This repository holds all interfaces related to PSR-16. + +Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details. + +You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package. diff --git a/plugins/vendor/psr/simple-cache/composer.json b/plugins/vendor/psr/simple-cache/composer.json new file mode 100644 index 00000000..f307a845 --- /dev/null +++ b/plugins/vendor/psr/simple-cache/composer.json @@ -0,0 +1,25 @@ +{ + "name": "psr/simple-cache", + "description": "Common interfaces for simple caching", + "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": ">=8.0.0" + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + } +} diff --git a/plugins/vendor/psr/simple-cache/src/CacheException.php b/plugins/vendor/psr/simple-cache/src/CacheException.php new file mode 100644 index 00000000..f61b24c2 --- /dev/null +++ b/plugins/vendor/psr/simple-cache/src/CacheException.php @@ -0,0 +1,10 @@ + $keys A list of keys that can be obtained in a single operation. + * @param mixed $default Default value to return for keys that do not exist. + * + * @return iterable A list of key => value pairs. Cache keys that do not exist or are stale will have $default as value. + * + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $keys is neither an array nor a Traversable, + * or if any of the $keys are not a legal value. + */ + public function getMultiple(iterable $keys, mixed $default = null): iterable; + + /** + * Persists a set of key => value pairs in the cache, with an optional TTL. + * + * @param iterable $values A list of key => value pairs for a multiple-set operation. + * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and + * the driver supports TTL then the library may set a default value + * for it or let the driver take care of that. + * + * @return bool True on success and false on failure. + * + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $values is neither an array nor a Traversable, + * or if any of the $values are not a legal value. + */ + public function setMultiple(iterable $values, null|int|\DateInterval $ttl = null): bool; + + /** + * Deletes multiple cache items in a single operation. + * + * @param iterable $keys A list of string-based keys to be deleted. + * + * @return bool True if the items were successfully removed. False if there was an error. + * + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if $keys is neither an array nor a Traversable, + * or if any of the $keys are not a legal value. + */ + public function deleteMultiple(iterable $keys): bool; + + /** + * Determines whether an item is present in the cache. + * + * NOTE: It is recommended that has() is only to be used for cache warming type purposes + * and not to be used within your live applications operations for get/set, as this method + * is subject to a race condition where your has() will return true and immediately after, + * another script can remove it making the state of your app out of date. + * + * @param string $key The cache item key. + * + * @return bool + * + * @throws \Psr\SimpleCache\InvalidArgumentException + * MUST be thrown if the $key string is not a legal value. + */ + public function has(string $key): bool; +} diff --git a/plugins/vendor/psr/simple-cache/src/InvalidArgumentException.php b/plugins/vendor/psr/simple-cache/src/InvalidArgumentException.php new file mode 100644 index 00000000..6a9524a2 --- /dev/null +++ b/plugins/vendor/psr/simple-cache/src/InvalidArgumentException.php @@ -0,0 +1,13 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +use Psr\Clock\ClockInterface as PsrClockInterface; + +/** + * A global clock. + * + * @author Nicolas Grekas + */ +final class Clock implements ClockInterface +{ + private static ClockInterface $globalClock; + + public function __construct( + private readonly ?PsrClockInterface $clock = null, + private ?\DateTimeZone $timezone = null, + ) { + } + + /** + * Returns the current global clock. + * + * Note that you should prefer injecting a ClockInterface or using + * ClockAwareTrait when possible instead of using this method. + */ + public static function get(): ClockInterface + { + return self::$globalClock ??= new NativeClock(); + } + + public static function set(PsrClockInterface $clock): void + { + self::$globalClock = $clock instanceof ClockInterface ? $clock : new self($clock); + } + + public function now(): DatePoint + { + $now = ($this->clock ?? self::get())->now(); + + if (!$now instanceof DatePoint) { + $now = DatePoint::createFromInterface($now); + } + + return isset($this->timezone) ? $now->setTimezone($this->timezone) : $now; + } + + public function sleep(float|int $seconds): void + { + $clock = $this->clock ?? self::get(); + + if ($clock instanceof ClockInterface) { + $clock->sleep($seconds); + } else { + (new NativeClock())->sleep($seconds); + } + } + + /** + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function withTimeZone(\DateTimeZone|string $timezone): static + { + if (\PHP_VERSION_ID >= 80300 && \is_string($timezone)) { + $timezone = new \DateTimeZone($timezone); + } elseif (\is_string($timezone)) { + try { + $timezone = new \DateTimeZone($timezone); + } catch (\Exception $e) { + throw new \DateInvalidTimeZoneException($e->getMessage(), $e->getCode(), $e); + } + } + + $clone = clone $this; + $clone->timezone = $timezone; + + return $clone; + } +} diff --git a/plugins/vendor/symfony/clock/ClockAwareTrait.php b/plugins/vendor/symfony/clock/ClockAwareTrait.php new file mode 100644 index 00000000..e723d7f8 --- /dev/null +++ b/plugins/vendor/symfony/clock/ClockAwareTrait.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +use Psr\Clock\ClockInterface; +use Symfony\Contracts\Service\Attribute\Required; + +/** + * A trait to help write time-sensitive classes. + * + * @author Nicolas Grekas + */ +trait ClockAwareTrait +{ + private readonly ClockInterface $clock; + + #[Required] + public function setClock(ClockInterface $clock): void + { + $this->clock = $clock; + } + + protected function now(): DatePoint + { + $now = ($this->clock ??= new Clock())->now(); + + return $now instanceof DatePoint ? $now : DatePoint::createFromInterface($now); + } +} diff --git a/plugins/vendor/symfony/clock/ClockInterface.php b/plugins/vendor/symfony/clock/ClockInterface.php new file mode 100644 index 00000000..435775a8 --- /dev/null +++ b/plugins/vendor/symfony/clock/ClockInterface.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +use Psr\Clock\ClockInterface as PsrClockInterface; + +/** + * @author Nicolas Grekas + */ +interface ClockInterface extends PsrClockInterface +{ + public function sleep(float|int $seconds): void; + + public function withTimeZone(\DateTimeZone|string $timezone): static; +} diff --git a/plugins/vendor/symfony/clock/DatePoint.php b/plugins/vendor/symfony/clock/DatePoint.php new file mode 100644 index 00000000..4df35fe0 --- /dev/null +++ b/plugins/vendor/symfony/clock/DatePoint.php @@ -0,0 +1,169 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +/** + * An immmutable DateTime with stricter error handling and return types than the native one. + * + * @author Nicolas Grekas + */ +final class DatePoint extends \DateTimeImmutable +{ + /** + * @throws \DateMalformedStringException When $datetime is invalid + */ + public function __construct(string $datetime = 'now', ?\DateTimeZone $timezone = null, ?parent $reference = null) + { + $now = $reference ?? Clock::get()->now(); + + if ('now' !== $datetime) { + if (!$now instanceof static) { + $now = static::createFromInterface($now); + } + + if (\PHP_VERSION_ID < 80300) { + try { + $builtInDate = new parent($datetime, $timezone ?? $now->getTimezone()); + $timezone = $builtInDate->getTimezone(); + } catch (\Exception $e) { + throw new \DateMalformedStringException($e->getMessage(), $e->getCode(), $e); + } + } else { + $builtInDate = new parent($datetime, $timezone ?? $now->getTimezone()); + $timezone = $builtInDate->getTimezone(); + } + + $now = $now->setTimezone($timezone)->modify($datetime); + + if ('00:00:00.000000' === $builtInDate->format('H:i:s.u')) { + $now = $now->setTime(0, 0); + } + } elseif (null !== $timezone) { + $now = $now->setTimezone($timezone); + } + + $this->__unserialize((array) $now); + } + + /** + * @throws \DateMalformedStringException When $format or $datetime are invalid + */ + public static function createFromFormat(string $format, string $datetime, ?\DateTimeZone $timezone = null): static + { + return parent::createFromFormat($format, $datetime, $timezone) ?: throw new \DateMalformedStringException(static::getLastErrors()['errors'][0] ?? 'Invalid date string or format.'); + } + + public static function createFromInterface(\DateTimeInterface $object): static + { + return parent::createFromInterface($object); + } + + public static function createFromMutable(\DateTime $object): static + { + return parent::createFromMutable($object); + } + + public static function createFromTimestamp(int|float $timestamp): static + { + if (\PHP_VERSION_ID >= 80400) { + return parent::createFromTimestamp($timestamp); + } + + if (\is_int($timestamp) || !$ms = (int) $timestamp - $timestamp) { + return static::createFromFormat('U', (string) $timestamp); + } + + if (!is_finite($timestamp) || \PHP_INT_MAX + 1.0 <= $timestamp || \PHP_INT_MIN > $timestamp) { + throw new \DateRangeError(\sprintf('DateTimeImmutable::createFromTimestamp(): Argument #1 ($timestamp) must be a finite number between %s and %s.999999, %s given', \PHP_INT_MIN, \PHP_INT_MAX, $timestamp)); + } + + if ($timestamp < 0) { + $timestamp = (int) $timestamp - 2.0 + $ms; + } + + return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp)); + } + + public function add(\DateInterval $interval): static + { + return parent::add($interval); + } + + public function sub(\DateInterval $interval): static + { + return parent::sub($interval); + } + + /** + * @throws \DateMalformedStringException When $modifier is invalid + */ + public function modify(string $modifier): static + { + if (\PHP_VERSION_ID < 80300) { + return @parent::modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? \sprintf('Invalid modifier: "%s".', $modifier)); + } + + return parent::modify($modifier); + } + + public function setTimestamp(int $value): static + { + return parent::setTimestamp($value); + } + + public function setDate(int $year, int $month, int $day): static + { + return parent::setDate($year, $month, $day); + } + + public function setISODate(int $year, int $week, int $day = 1): static + { + return parent::setISODate($year, $week, $day); + } + + public function setTime(int $hour, int $minute, int $second = 0, int $microsecond = 0): static + { + return parent::setTime($hour, $minute, $second, $microsecond); + } + + public function setTimezone(\DateTimeZone $timezone): static + { + return parent::setTimezone($timezone); + } + + public function getTimezone(): \DateTimeZone + { + return parent::getTimezone() ?: throw new \DateInvalidTimeZoneException('The DatePoint object has no timezone.'); + } + + public function setMicrosecond(int $microsecond): static + { + if ($microsecond < 0 || $microsecond > 999999) { + throw new \DateRangeError('DatePoint::setMicrosecond(): Argument #1 ($microsecond) must be between 0 and 999999, '.$microsecond.' given'); + } + + if (\PHP_VERSION_ID < 80400) { + return $this->setTime(...explode('.', $this->format('H.i.s.'.$microsecond))); + } + + return parent::setMicrosecond($microsecond); + } + + public function getMicrosecond(): int + { + if (\PHP_VERSION_ID >= 80400) { + return parent::getMicrosecond(); + } + + return $this->format('u'); + } +} diff --git a/plugins/vendor/symfony/clock/LICENSE b/plugins/vendor/symfony/clock/LICENSE new file mode 100644 index 00000000..733c826e --- /dev/null +++ b/plugins/vendor/symfony/clock/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2022-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/clock/MockClock.php b/plugins/vendor/symfony/clock/MockClock.php new file mode 100644 index 00000000..9ba2726b --- /dev/null +++ b/plugins/vendor/symfony/clock/MockClock.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +/** + * A clock that always returns the same date, suitable for testing time-sensitive logic. + * + * Consider using ClockSensitiveTrait in your test cases instead of using this class directly. + * + * @author Nicolas Grekas + */ +final class MockClock implements ClockInterface +{ + private DatePoint $now; + + /** + * @throws \DateMalformedStringException When $now is invalid + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function __construct(\DateTimeImmutable|string $now = 'now', \DateTimeZone|string|null $timezone = null) + { + if (\PHP_VERSION_ID >= 80300 && \is_string($timezone)) { + $timezone = new \DateTimeZone($timezone); + } elseif (\is_string($timezone)) { + try { + $timezone = new \DateTimeZone($timezone); + } catch (\Exception $e) { + throw new \DateInvalidTimeZoneException($e->getMessage(), $e->getCode(), $e); + } + } + + if (\is_string($now)) { + $now = new DatePoint($now, $timezone ?? new \DateTimeZone('UTC')); + } elseif (!$now instanceof DatePoint) { + $now = DatePoint::createFromInterface($now); + } + + $this->now = null !== $timezone ? $now->setTimezone($timezone) : $now; + } + + public function now(): DatePoint + { + return clone $this->now; + } + + public function sleep(float|int $seconds): void + { + $now = (float) $this->now->format('Uu') + $seconds * 1e6; + $now = substr_replace(\sprintf('@%07.0F', $now), '.', -6, 0); + $timezone = $this->now->getTimezone(); + + $this->now = DatePoint::createFromInterface(new \DateTimeImmutable($now, $timezone))->setTimezone($timezone); + } + + /** + * @throws \DateMalformedStringException When $modifier is invalid + */ + public function modify(string $modifier): void + { + if (\PHP_VERSION_ID < 80300) { + $this->now = @$this->now->modify($modifier) ?: throw new \DateMalformedStringException(error_get_last()['message'] ?? \sprintf('Invalid modifier: "%s". Could not modify MockClock.', $modifier)); + + return; + } + + $this->now = $this->now->modify($modifier); + } + + /** + * @throws \DateInvalidTimeZoneException When the timezone name is invalid + */ + public function withTimeZone(\DateTimeZone|string $timezone): static + { + if (\PHP_VERSION_ID >= 80300 && \is_string($timezone)) { + $timezone = new \DateTimeZone($timezone); + } elseif (\is_string($timezone)) { + try { + $timezone = new \DateTimeZone($timezone); + } catch (\Exception $e) { + throw new \DateInvalidTimeZoneException($e->getMessage(), $e->getCode(), $e); + } + } + + $clone = clone $this; + $clone->now = $clone->now->setTimezone($timezone); + + return $clone; + } +} diff --git a/plugins/vendor/symfony/clock/MonotonicClock.php b/plugins/vendor/symfony/clock/MonotonicClock.php new file mode 100644 index 00000000..d27bf9c3 --- /dev/null +++ b/plugins/vendor/symfony/clock/MonotonicClock.php @@ -0,0 +1,93 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +/** + * A monotonic clock suitable for performance profiling. + * + * @author Nicolas Grekas + */ +final class MonotonicClock implements ClockInterface +{ + private int $sOffset; + private int $usOffset; + private \DateTimeZone $timezone; + + /** + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function __construct(\DateTimeZone|string|null $timezone = null) + { + if (false === $offset = hrtime()) { + throw new \RuntimeException('hrtime() returned false: the runtime environment does not provide access to a monotonic timer.'); + } + + $time = explode(' ', microtime(), 2); + $this->sOffset = $time[1] - $offset[0]; + $this->usOffset = (int) ($time[0] * 1000000) - (int) ($offset[1] / 1000); + + $this->timezone = \is_string($timezone ??= date_default_timezone_get()) ? $this->withTimeZone($timezone)->timezone : $timezone; + } + + public function now(): DatePoint + { + [$s, $us] = hrtime(); + + if (1000000 <= $us = (int) ($us / 1000) + $this->usOffset) { + ++$s; + $us -= 1000000; + } elseif (0 > $us) { + --$s; + $us += 1000000; + } + + if (6 !== \strlen($now = (string) $us)) { + $now = str_pad($now, 6, '0', \STR_PAD_LEFT); + } + + $now = '@'.($s + $this->sOffset).'.'.$now; + + return DatePoint::createFromInterface(new \DateTimeImmutable($now, $this->timezone))->setTimezone($this->timezone); + } + + public function sleep(float|int $seconds): void + { + if (0 < $s = (int) $seconds) { + sleep($s); + } + + if (0 < $us = $seconds - $s) { + usleep((int) ($us * 1E6)); + } + } + + /** + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function withTimeZone(\DateTimeZone|string $timezone): static + { + if (\PHP_VERSION_ID >= 80300 && \is_string($timezone)) { + $timezone = new \DateTimeZone($timezone); + } elseif (\is_string($timezone)) { + try { + $timezone = new \DateTimeZone($timezone); + } catch (\Exception $e) { + throw new \DateInvalidTimeZoneException($e->getMessage(), $e->getCode(), $e); + } + } + + $clone = clone $this; + $clone->timezone = $timezone; + + return $clone; + } +} diff --git a/plugins/vendor/symfony/clock/NativeClock.php b/plugins/vendor/symfony/clock/NativeClock.php new file mode 100644 index 00000000..b580a886 --- /dev/null +++ b/plugins/vendor/symfony/clock/NativeClock.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +/** + * A clock that relies the system time. + * + * @author Nicolas Grekas + */ +final class NativeClock implements ClockInterface +{ + private \DateTimeZone $timezone; + + /** + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function __construct(\DateTimeZone|string|null $timezone = null) + { + $this->timezone = \is_string($timezone ??= date_default_timezone_get()) ? $this->withTimeZone($timezone)->timezone : $timezone; + } + + public function now(): DatePoint + { + return DatePoint::createFromInterface(new \DateTimeImmutable('now', $this->timezone)); + } + + public function sleep(float|int $seconds): void + { + if (0 < $s = (int) $seconds) { + sleep($s); + } + + if (0 < $us = $seconds - $s) { + usleep((int) ($us * 1E6)); + } + } + + /** + * @throws \DateInvalidTimeZoneException When $timezone is invalid + */ + public function withTimeZone(\DateTimeZone|string $timezone): static + { + if (\PHP_VERSION_ID >= 80300 && \is_string($timezone)) { + $timezone = new \DateTimeZone($timezone); + } elseif (\is_string($timezone)) { + try { + $timezone = new \DateTimeZone($timezone); + } catch (\Exception $e) { + throw new \DateInvalidTimeZoneException($e->getMessage(), $e->getCode(), $e); + } + } + + $clone = clone $this; + $clone->timezone = $timezone; + + return $clone; + } +} diff --git a/plugins/vendor/symfony/clock/README.md b/plugins/vendor/symfony/clock/README.md new file mode 100644 index 00000000..e80b5d37 --- /dev/null +++ b/plugins/vendor/symfony/clock/README.md @@ -0,0 +1,47 @@ +Clock Component +=============== + +Symfony Clock decouples applications from the system clock. + +Getting Started +--------------- + +```bash +composer require symfony/clock +``` + +```php +use Symfony\Component\Clock\NativeClock; +use Symfony\Component\Clock\ClockInterface; + +class MyClockSensitiveClass +{ + public function __construct( + private ClockInterface $clock, + ) { + // Only if you need to force a timezone: + //$this->clock = $clock->withTimeZone('UTC'); + } + + public function doSomething() + { + $now = $this->clock->now(); + // [...] do something with $now, which is a \DateTimeImmutable object + + $this->clock->sleep(2.5); // Pause execution for 2.5 seconds + } +} + +$clock = new NativeClock(); +$service = new MyClockSensitiveClass($clock); +$service->doSomething(); +``` + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/clock.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/plugins/vendor/symfony/clock/Resources/now.php b/plugins/vendor/symfony/clock/Resources/now.php new file mode 100644 index 00000000..47d086c6 --- /dev/null +++ b/plugins/vendor/symfony/clock/Resources/now.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock; + +if (!\function_exists(now::class)) { + /** + * @throws \DateMalformedStringException When the modifier is invalid + */ + function now(string $modifier = 'now'): DatePoint + { + if ('now' !== $modifier) { + return new DatePoint($modifier); + } + + $now = Clock::get()->now(); + + return $now instanceof DatePoint ? $now : DatePoint::createFromInterface($now); + } +} diff --git a/plugins/vendor/symfony/clock/Test/ClockSensitiveTrait.php b/plugins/vendor/symfony/clock/Test/ClockSensitiveTrait.php new file mode 100644 index 00000000..f71f3a11 --- /dev/null +++ b/plugins/vendor/symfony/clock/Test/ClockSensitiveTrait.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Clock\Test; + +use PHPUnit\Framework\Attributes\After; +use PHPUnit\Framework\Attributes\Before; +use PHPUnit\Framework\Attributes\BeforeClass; +use Symfony\Component\Clock\Clock; +use Symfony\Component\Clock\ClockInterface; +use Symfony\Component\Clock\MockClock; + +use function Symfony\Component\Clock\now; + +/** + * Helps with mocking the time in your test cases. + * + * This trait provides one self::mockTime() method that freezes the time. + * It restores the global clock after each test case. + * self::mockTime() accepts either a string (eg '+1 days' or '2022-12-22'), + * a DateTimeImmutable, or a boolean (to freeze/restore the global clock). + * + * @author Nicolas Grekas + */ +trait ClockSensitiveTrait +{ + public static function mockTime(string|\DateTimeImmutable|bool $when = true): ClockInterface + { + Clock::set(match (true) { + false === $when => self::saveClockBeforeTest(false), + true === $when => new MockClock(), + $when instanceof \DateTimeImmutable => new MockClock($when), + default => new MockClock(now($when)), + }); + + return Clock::get(); + } + + /** + * @beforeClass + * + * @before + * + * @internal + */ + #[Before] + #[BeforeClass] + public static function saveClockBeforeTest(bool $save = true): ClockInterface + { + static $originalClock; + + if ($save && $originalClock) { + self::restoreClockAfterTest(); + } + + return $save ? $originalClock = Clock::get() : $originalClock; + } + + /** + * @after + * + * @internal + */ + #[After] + protected static function restoreClockAfterTest(): void + { + Clock::set(self::saveClockBeforeTest(false)); + } +} diff --git a/plugins/vendor/symfony/clock/composer.json b/plugins/vendor/symfony/clock/composer.json new file mode 100644 index 00000000..491215f6 --- /dev/null +++ b/plugins/vendor/symfony/clock/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/clock", + "type": "library", + "description": "Decouples applications from the system clock", + "keywords": ["clock", "time", "psr20"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "provide": { + "psr/clock-implementation": "1.0" + }, + "require": { + "php": ">=8.2", + "psr/clock": "^1.0", + "symfony/polyfill-php83": "^1.28" + }, + "autoload": { + "files": [ "Resources/now.php" ], + "psr-4": { "Symfony\\Component\\Clock\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/symfony/deprecation-contracts/CHANGELOG.md b/plugins/vendor/symfony/deprecation-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/plugins/vendor/symfony/deprecation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/plugins/vendor/symfony/deprecation-contracts/LICENSE b/plugins/vendor/symfony/deprecation-contracts/LICENSE new file mode 100644 index 00000000..0ed3a246 --- /dev/null +++ b/plugins/vendor/symfony/deprecation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/deprecation-contracts/README.md b/plugins/vendor/symfony/deprecation-contracts/README.md new file mode 100644 index 00000000..9814864c --- /dev/null +++ b/plugins/vendor/symfony/deprecation-contracts/README.md @@ -0,0 +1,26 @@ +Symfony Deprecation Contracts +============================= + +A generic function and convention to trigger deprecation notices. + +This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. + +By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, +the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. + +The function requires at least 3 arguments: + - the name of the Composer package that is triggering the deprecation + - the version of the package that introduced the deprecation + - the message of the deprecation + - more arguments can be provided: they will be inserted in the message using `printf()` formatting + +Example: +```php +trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); +``` + +This will generate the following message: +`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` + +While not recommended, the deprecation notices can be completely ignored by declaring an empty +`function trigger_deprecation() {}` in your application. diff --git a/plugins/vendor/symfony/deprecation-contracts/composer.json b/plugins/vendor/symfony/deprecation-contracts/composer.json new file mode 100644 index 00000000..5533b5c3 --- /dev/null +++ b/plugins/vendor/symfony/deprecation-contracts/composer.json @@ -0,0 +1,35 @@ +{ + "name": "symfony/deprecation-contracts", + "type": "library", + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.1" + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.6-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/plugins/vendor/symfony/deprecation-contracts/function.php b/plugins/vendor/symfony/deprecation-contracts/function.php new file mode 100644 index 00000000..2d56512b --- /dev/null +++ b/plugins/vendor/symfony/deprecation-contracts/function.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (!function_exists('trigger_deprecation')) { + /** + * Triggers a silenced deprecation notice. + * + * @param string $package The name of the Composer package that is triggering the deprecation + * @param string $version The version of the package that introduced the deprecation + * @param string $message The message of the deprecation + * @param mixed ...$args Values to insert in the message using printf() formatting + * + * @author Nicolas Grekas + */ + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + { + @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); + } +} diff --git a/plugins/vendor/symfony/http-foundation/AcceptHeader.php b/plugins/vendor/symfony/http-foundation/AcceptHeader.php new file mode 100644 index 00000000..853c000e --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/AcceptHeader.php @@ -0,0 +1,150 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +// Help opcache.preload discover always-needed symbols +class_exists(AcceptHeaderItem::class); + +/** + * Represents an Accept-* header. + * + * An accept header is compound with a list of items, + * sorted by descending quality. + * + * @author Jean-François Simon + */ +class AcceptHeader +{ + /** + * @var AcceptHeaderItem[] + */ + private array $items = []; + + private bool $sorted = true; + + /** + * @param AcceptHeaderItem[] $items + */ + public function __construct(array $items) + { + foreach ($items as $item) { + $this->add($item); + } + } + + /** + * Builds an AcceptHeader instance from a string. + */ + public static function fromString(?string $headerValue): self + { + $parts = HeaderUtils::split($headerValue ?? '', ',;='); + + return new self(array_map(function ($subParts) { + static $index = 0; + $part = array_shift($subParts); + $attributes = HeaderUtils::combine($subParts); + + $item = new AcceptHeaderItem($part[0], $attributes); + $item->setIndex($index++); + + return $item; + }, $parts)); + } + + /** + * Returns header value's string representation. + */ + public function __toString(): string + { + return implode(',', $this->items); + } + + /** + * Tests if header has given value. + */ + public function has(string $value): bool + { + return isset($this->items[$value]); + } + + /** + * Returns given value's item, if exists. + */ + public function get(string $value): ?AcceptHeaderItem + { + return $this->items[$value] ?? $this->items[explode('/', $value)[0].'/*'] ?? $this->items['*/*'] ?? $this->items['*'] ?? null; + } + + /** + * Adds an item. + * + * @return $this + */ + public function add(AcceptHeaderItem $item): static + { + $this->items[$item->getValue()] = $item; + $this->sorted = false; + + return $this; + } + + /** + * Returns all items. + * + * @return AcceptHeaderItem[] + */ + public function all(): array + { + $this->sort(); + + return $this->items; + } + + /** + * Filters items on their value using given regex. + */ + public function filter(string $pattern): self + { + return new self(array_filter($this->items, fn (AcceptHeaderItem $item) => preg_match($pattern, $item->getValue()))); + } + + /** + * Returns first item. + */ + public function first(): ?AcceptHeaderItem + { + $this->sort(); + + return $this->items ? reset($this->items) : null; + } + + /** + * Sorts items by descending quality. + */ + private function sort(): void + { + if (!$this->sorted) { + uasort($this->items, function (AcceptHeaderItem $a, AcceptHeaderItem $b) { + $qA = $a->getQuality(); + $qB = $b->getQuality(); + + if ($qA === $qB) { + return $a->getIndex() > $b->getIndex() ? 1 : -1; + } + + return $qA > $qB ? -1 : 1; + }); + + $this->sorted = true; + } + } +} diff --git a/plugins/vendor/symfony/http-foundation/AcceptHeaderItem.php b/plugins/vendor/symfony/http-foundation/AcceptHeaderItem.php new file mode 100644 index 00000000..b8b2b8ad --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/AcceptHeaderItem.php @@ -0,0 +1,159 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents an Accept-* header item. + * + * @author Jean-François Simon + */ +class AcceptHeaderItem +{ + private float $quality = 1.0; + private int $index = 0; + private array $attributes = []; + + public function __construct( + private string $value, + array $attributes = [], + ) { + foreach ($attributes as $name => $value) { + $this->setAttribute($name, $value); + } + } + + /** + * Builds an AcceptHeaderInstance instance from a string. + */ + public static function fromString(?string $itemValue): self + { + $parts = HeaderUtils::split($itemValue ?? '', ';='); + + $part = array_shift($parts); + $attributes = HeaderUtils::combine($parts); + + return new self($part[0], $attributes); + } + + /** + * Returns header value's string representation. + */ + public function __toString(): string + { + $string = $this->value.($this->quality < 1 ? ';q='.$this->quality : ''); + if (\count($this->attributes) > 0) { + $string .= '; '.HeaderUtils::toString($this->attributes, ';'); + } + + return $string; + } + + /** + * Set the item value. + * + * @return $this + */ + public function setValue(string $value): static + { + $this->value = $value; + + return $this; + } + + /** + * Returns the item value. + */ + public function getValue(): string + { + return $this->value; + } + + /** + * Set the item quality. + * + * @return $this + */ + public function setQuality(float $quality): static + { + $this->quality = $quality; + + return $this; + } + + /** + * Returns the item quality. + */ + public function getQuality(): float + { + return $this->quality; + } + + /** + * Set the item index. + * + * @return $this + */ + public function setIndex(int $index): static + { + $this->index = $index; + + return $this; + } + + /** + * Returns the item index. + */ + public function getIndex(): int + { + return $this->index; + } + + /** + * Tests if an attribute exists. + */ + public function hasAttribute(string $name): bool + { + return isset($this->attributes[$name]); + } + + /** + * Returns an attribute by its name. + */ + public function getAttribute(string $name, mixed $default = null): mixed + { + return $this->attributes[$name] ?? $default; + } + + /** + * Returns all attributes. + */ + public function getAttributes(): array + { + return $this->attributes; + } + + /** + * Set an attribute. + * + * @return $this + */ + public function setAttribute(string $name, string $value): static + { + if ('q' === $name) { + $this->quality = (float) $value; + } else { + $this->attributes[$name] = $value; + } + + return $this; + } +} diff --git a/plugins/vendor/symfony/http-foundation/BinaryFileResponse.php b/plugins/vendor/symfony/http-foundation/BinaryFileResponse.php new file mode 100644 index 00000000..a7358183 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/BinaryFileResponse.php @@ -0,0 +1,396 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\File\Exception\FileException; +use Symfony\Component\HttpFoundation\File\File; + +/** + * BinaryFileResponse represents an HTTP response delivering a file. + * + * @author Niklas Fiekas + * @author stealth35 + * @author Igor Wiedler + * @author Jordan Alliot + * @author Sergey Linnik + */ +class BinaryFileResponse extends Response +{ + protected static bool $trustXSendfileTypeHeader = false; + + protected File $file; + protected ?\SplTempFileObject $tempFileObject = null; + protected int $offset = 0; + protected int $maxlen = -1; + protected bool $deleteFileAfterSend = false; + protected int $chunkSize = 16 * 1024; + + /** + * @param \SplFileInfo|string $file The file to stream + * @param int $status The response status code (200 "OK" by default) + * @param array $headers An array of response headers + * @param bool $public Files are public by default + * @param string|null $contentDisposition The type of Content-Disposition to set automatically with the filename + * @param bool $autoEtag Whether the ETag header should be automatically set + * @param bool $autoLastModified Whether the Last-Modified header should be automatically set + */ + public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true) + { + parent::__construct(null, $status, $headers); + + $this->setFile($file, $contentDisposition, $autoEtag, $autoLastModified); + + if ($public) { + $this->setPublic(); + } + } + + /** + * Sets the file to stream. + * + * @return $this + * + * @throws FileException + */ + public function setFile(\SplFileInfo|string $file, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true): static + { + $isTemporaryFile = $file instanceof \SplTempFileObject; + $this->tempFileObject = $isTemporaryFile ? $file : null; + + if (!$file instanceof File) { + if ($file instanceof \SplFileInfo) { + $file = new File($file->getPathname(), !$isTemporaryFile); + } else { + $file = new File($file); + } + } + + if (!$file->isReadable() && !$isTemporaryFile) { + throw new FileException('File must be readable.'); + } + + $this->file = $file; + + if ($autoEtag) { + $this->setAutoEtag(); + } + + if ($autoLastModified && !$isTemporaryFile) { + $this->setAutoLastModified(); + } + + if ($contentDisposition) { + $this->setContentDisposition($contentDisposition); + } + + return $this; + } + + /** + * Gets the file. + */ + public function getFile(): File + { + return $this->file; + } + + /** + * Sets the response stream chunk size. + * + * @return $this + */ + public function setChunkSize(int $chunkSize): static + { + if ($chunkSize < 1) { + throw new \InvalidArgumentException('The chunk size of a BinaryFileResponse cannot be less than 1.'); + } + + $this->chunkSize = $chunkSize; + + return $this; + } + + /** + * Automatically sets the Last-Modified header according the file modification date. + * + * @return $this + */ + public function setAutoLastModified(): static + { + $this->setLastModified(\DateTimeImmutable::createFromFormat('U', $this->tempFileObject ? time() : $this->file->getMTime())); + + return $this; + } + + /** + * Automatically sets the ETag header according to the checksum of the file. + * + * @return $this + */ + public function setAutoEtag(): static + { + $this->setEtag(base64_encode(hash_file('xxh128', $this->file->getPathname(), true))); + + return $this; + } + + /** + * Sets the Content-Disposition header with the given filename. + * + * @param string $disposition ResponseHeaderBag::DISPOSITION_INLINE or ResponseHeaderBag::DISPOSITION_ATTACHMENT + * @param string $filename Optionally use this UTF-8 encoded filename instead of the real name of the file + * @param string $filenameFallback A fallback filename, containing only ASCII characters. Defaults to an automatically encoded filename + * + * @return $this + */ + public function setContentDisposition(string $disposition, string $filename = '', string $filenameFallback = ''): static + { + if ('' === $filename) { + $filename = $this->file->getFilename(); + } + + if ('' === $filenameFallback && (!preg_match('/^[\x20-\x7e]*$/', $filename) || str_contains($filename, '%'))) { + $encoding = mb_detect_encoding($filename, null, true) ?: '8bit'; + + for ($i = 0, $filenameLength = mb_strlen($filename, $encoding); $i < $filenameLength; ++$i) { + $char = mb_substr($filename, $i, 1, $encoding); + + if ('%' === $char || \ord($char) < 32 || \ord($char) > 126) { + $filenameFallback .= '_'; + } else { + $filenameFallback .= $char; + } + } + } + + $dispositionHeader = $this->headers->makeDisposition($disposition, $filename, $filenameFallback); + $this->headers->set('Content-Disposition', $dispositionHeader); + + return $this; + } + + public function prepare(Request $request): static + { + if ($this->isInformational() || $this->isEmpty()) { + parent::prepare($request); + + $this->maxlen = 0; + + return $this; + } + + if (!$this->headers->has('Content-Type')) { + $mimeType = null; + if (!$this->tempFileObject) { + $mimeType = $this->file->getMimeType(); + } + + $this->headers->set('Content-Type', $mimeType ?: 'application/octet-stream'); + } + + parent::prepare($request); + + $this->offset = 0; + $this->maxlen = -1; + + if ($this->tempFileObject) { + $fileSize = $this->tempFileObject->fstat()['size']; + } elseif (false === $fileSize = $this->file->getSize()) { + return $this; + } + $this->headers->remove('Transfer-Encoding'); + $this->headers->set('Content-Length', $fileSize); + + if (!$this->headers->has('Accept-Ranges')) { + // Only accept ranges on safe HTTP methods + $this->headers->set('Accept-Ranges', $request->isMethodSafe() ? 'bytes' : 'none'); + } + + if (self::$trustXSendfileTypeHeader && $request->headers->has('X-Sendfile-Type')) { + // Use X-Sendfile, do not send any content. + $type = $request->headers->get('X-Sendfile-Type'); + $path = $this->file->getRealPath(); + // Fall back to scheme://path for stream wrapped locations. + if (false === $path) { + $path = $this->file->getPathname(); + } + if ('x-accel-redirect' === strtolower($type)) { + // Do X-Accel-Mapping substitutions. + // @link https://github.com/rack/rack/blob/main/lib/rack/sendfile.rb + // @link https://mattbrictson.com/blog/accelerated-rails-downloads + if (!$request->headers->has('X-Accel-Mapping')) { + throw new \LogicException('The "X-Accel-Mapping" header must be set when "X-Sendfile-Type" is set to "X-Accel-Redirect".'); + } + $parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping'), ',='); + foreach ($parts as $part) { + [$pathPrefix, $location] = $part; + if (str_starts_with($path, $pathPrefix)) { + $path = $location.substr($path, \strlen($pathPrefix)); + // Only set X-Accel-Redirect header if a valid URI can be produced + // as nginx does not serve arbitrary file paths. + $this->headers->set($type, rawurlencode($path)); + $this->maxlen = 0; + break; + } + } + } else { + $this->headers->set($type, $path); + $this->maxlen = 0; + } + } elseif ($request->headers->has('Range') && $request->isMethod('GET')) { + // Process the range headers. + if (!$request->headers->has('If-Range') || $this->hasValidIfRangeHeader($request->headers->get('If-Range'))) { + $range = $request->headers->get('Range'); + + if (str_starts_with($range, 'bytes=')) { + [$start, $end] = explode('-', substr($range, 6), 2) + [1 => 0]; + + $end = ('' === $end) ? $fileSize - 1 : (int) $end; + + if ('' === $start) { + $start = $fileSize - $end; + $end = $fileSize - 1; + } else { + $start = (int) $start; + } + + if ($start <= $end) { + $end = min($end, $fileSize - 1); + if ($start < 0 || $start > $end) { + $this->setStatusCode(416); + $this->headers->set('Content-Range', \sprintf('bytes */%s', $fileSize)); + } elseif ($end - $start < $fileSize - 1) { + $this->maxlen = $end < $fileSize ? $end - $start + 1 : -1; + $this->offset = $start; + + $this->setStatusCode(206); + $this->headers->set('Content-Range', \sprintf('bytes %s-%s/%s', $start, $end, $fileSize)); + $this->headers->set('Content-Length', $end - $start + 1); + } + } + } + } + } + + if ($request->isMethod('HEAD')) { + $this->maxlen = 0; + } + + return $this; + } + + private function hasValidIfRangeHeader(?string $header): bool + { + if ($this->getEtag() === $header) { + return true; + } + + if (null === $lastModified = $this->getLastModified()) { + return false; + } + + return $lastModified->format('D, d M Y H:i:s').' GMT' === $header; + } + + public function sendContent(): static + { + try { + if (!$this->isSuccessful()) { + return $this; + } + + if (0 === $this->maxlen) { + return $this; + } + + $out = fopen('php://output', 'w'); + + if ($this->tempFileObject) { + $file = $this->tempFileObject; + $file->rewind(); + } else { + $file = new \SplFileObject($this->file->getPathname(), 'r'); + } + + ignore_user_abort(true); + + if (0 !== $this->offset) { + $file->fseek($this->offset); + } + + $length = $this->maxlen; + while ($length && !$file->eof()) { + $read = $length > $this->chunkSize || 0 > $length ? $this->chunkSize : $length; + + if (false === $data = $file->fread($read)) { + break; + } + while ('' !== $data) { + $read = fwrite($out, $data); + if (false === $read || connection_aborted()) { + break 2; + } + if (0 < $length) { + $length -= $read; + } + $data = substr($data, $read); + } + } + + fclose($out); + } finally { + if (null === $this->tempFileObject && $this->deleteFileAfterSend && is_file($this->file->getPathname())) { + unlink($this->file->getPathname()); + } + } + + return $this; + } + + /** + * @throws \LogicException when the content is not null + */ + public function setContent(?string $content): static + { + if (null !== $content) { + throw new \LogicException('The content cannot be set on a BinaryFileResponse instance.'); + } + + return $this; + } + + public function getContent(): string|false + { + return false; + } + + /** + * Trust X-Sendfile-Type header. + */ + public static function trustXSendfileTypeHeader(): void + { + self::$trustXSendfileTypeHeader = true; + } + + /** + * If this is set to true, the file will be unlinked after the request is sent + * Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used. + * + * @return $this + */ + public function deleteFileAfterSend(bool $shouldDelete = true): static + { + $this->deleteFileAfterSend = $shouldDelete; + + return $this; + } +} diff --git a/plugins/vendor/symfony/http-foundation/CHANGELOG.md b/plugins/vendor/symfony/http-foundation/CHANGELOG.md new file mode 100644 index 00000000..374c3188 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/CHANGELOG.md @@ -0,0 +1,396 @@ +CHANGELOG +========= + +7.3 +--- + + * Add support for iterable of string in `StreamedResponse` + * Add `EventStreamResponse` and `ServerEvent` classes to streamline server event streaming + * Add support for `valkey:` / `valkeys:` schemes for sessions + * `Request::getPreferredLanguage()` now favors a more preferred language above exactly matching a locale + * Allow `UriSigner` to use a `ClockInterface` + * Add `UriSigner::verify()` + +7.2 +--- + + * Add optional `$requests` parameter to `RequestStack::__construct()` + * Add optional `$v4Bytes` and `$v6Bytes` parameters to `IpUtils::anonymize()` + * Add `PRIVATE_SUBNETS` as a shortcut for private IP address ranges to `Request::setTrustedProxies()` + * Deprecate passing `referer_check`, `use_only_cookies`, `use_trans_sid`, `trans_sid_hosts`, `trans_sid_tags`, `sid_bits_per_character` and `sid_length` options to `NativeSessionStorage` + +7.1 +--- + + * Add optional `$expirationParameter` argument to `UriSigner::__construct()` + * Add optional `$expiration` argument to `UriSigner::sign()` + * Rename `$parameter` argument of `UriSigner::__construct()` to `$hashParameter` + * Add `UploadedFile::getClientOriginalPath()` + * Add `QueryParameterRequestMatcher` + * Add `HeaderRequestMatcher` + * Add support for `\SplTempFileObject` in `BinaryFileResponse` + * Add `verbose` argument to response test constraints + +7.0 +--- + + * Calling `ParameterBag::filter()` throws an `UnexpectedValueException` on invalid value, unless flag `FILTER_NULL_ON_FAILURE` is set + * Calling `ParameterBag::getInt()` and `ParameterBag::getBool()` throws an `UnexpectedValueException` on invalid value + * Remove classes `RequestMatcher` and `ExpressionRequestMatcher` + * Remove `Request::getContentType()`, use `Request::getContentTypeFormat()` instead + * Throw an `InvalidArgumentException` when calling `Request::create()` with a malformed URI + * Require explicit argument when calling `JsonResponse::setCallback()`, `Response::setExpires/setLastModified/setEtag()`, `MockArraySessionStorage/NativeSessionStorage::setMetadataBag()`, `NativeSessionStorage::setSaveHandler()` + * Add argument `$statusCode` to `Response::sendHeaders()` and `StreamedResponse::sendHeaders()` + +6.4 +--- + + * Make `HeaderBag::getDate()`, `Response::getDate()`, `getExpires()` and `getLastModified()` return a `DateTimeImmutable` + * Support root-level `Generator` in `StreamedJsonResponse` + * Add `UriSigner` from the HttpKernel component + * Add `partitioned` flag to `Cookie` (CHIPS Cookie) + * Add argument `bool $flush = true` to `Response::send()` + * Make `MongoDbSessionHandler` instantiable with the mongodb extension directly + +6.3 +--- + + * Calling `ParameterBag::getDigit()`, `getAlnum()`, `getAlpha()` on an `array` throws a `UnexpectedValueException` instead of a `TypeError` + * Add `ParameterBag::getString()` to convert a parameter into string and throw an exception if the value is invalid + * Add `ParameterBag::getEnum()` + * Create migration for session table when pdo handler is used + * Add support for Relay PHP extension for Redis + * The `Response::sendHeaders()` method now takes an optional HTTP status code as parameter, allowing to send informational responses such as Early Hints responses (103 status code) + * Add `IpUtils::isPrivateIp()` + * Add `Request::getPayload(): InputBag` + * Deprecate conversion of invalid values in `ParameterBag::getInt()` and `ParameterBag::getBoolean()`, + * Deprecate ignoring invalid values when using `ParameterBag::filter()`, unless flag `FILTER_NULL_ON_FAILURE` is set + +6.2 +--- + + * Add `StreamedJsonResponse` class for efficient JSON streaming + * The HTTP cache store uses the `xxh128` algorithm + * Deprecate calling `JsonResponse::setCallback()`, `Response::setExpires/setLastModified/setEtag()`, `MockArraySessionStorage/NativeSessionStorage::setMetadataBag()`, `NativeSessionStorage::setSaveHandler()` without arguments + * Add request matchers under the `Symfony\Component\HttpFoundation\RequestMatcher` namespace + * Deprecate `RequestMatcher` in favor of `ChainRequestMatcher` + * Deprecate `Symfony\Component\HttpFoundation\ExpressionRequestMatcher` in favor of `Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher` + +6.1 +--- + + * Add stale while revalidate and stale if error cache header + * Allow dynamic session "ttl" when using a remote storage + * Deprecate `Request::getContentType()`, use `Request::getContentTypeFormat()` instead + +6.0 +--- + + * Remove the `NamespacedAttributeBag` class + * Removed `Response::create()`, `JsonResponse::create()`, + `RedirectResponse::create()`, `StreamedResponse::create()` and + `BinaryFileResponse::create()` methods (use `__construct()` instead) + * Not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead + * Not passing a `Closure` together with `FILTER_CALLBACK` to `InputBag::filter()` throws an `\InvalidArgumentException`; wrap your filter in a closure instead + * Removed the `Request::HEADER_X_FORWARDED_ALL` constant, use either `Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO` or `Request::HEADER_X_FORWARDED_AWS_ELB` or `Request::HEADER_X_FORWARDED_TRAEFIK`constants instead + * Rename `RequestStack::getMasterRequest()` to `getMainRequest()` + * Not passing `FILTER_REQUIRE_ARRAY` or `FILTER_FORCE_ARRAY` flags to `InputBag::filter()` when filtering an array will throw `BadRequestException` + * Removed the `Request::HEADER_X_FORWARDED_ALL` constant + * Retrieving non-scalar values using `InputBag::get()` will throw `BadRequestException` (use `InputBad::all()` instead to retrieve an array) + * Passing non-scalar default value as the second argument `InputBag::get()` will throw `\InvalidArgumentException` + * Passing non-scalar, non-array value as the second argument `InputBag::set()` will throw `\InvalidArgumentException` + * Passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()` is not supported anymore. + +5.4 +--- + + * Deprecate passing `null` as `$requestIp` to `IpUtils::__checkIp()`, `IpUtils::__checkIp4()` or `IpUtils::__checkIp6()`, pass an empty string instead. + * Add the `litespeed_finish_request` method to work with Litespeed + * Deprecate `upload_progress.*` and `url_rewriter.tags` session options + * Allow setting session options via DSN + +5.3 +--- + + * Add the `SessionFactory`, `NativeSessionStorageFactory`, `PhpBridgeSessionStorageFactory` and `MockFileSessionStorageFactory` classes + * Calling `Request::getSession()` when there is no available session throws a `SessionNotFoundException` + * Add the `RequestStack::getSession` method + * Deprecate the `NamespacedAttributeBag` class + * Add `ResponseFormatSame` PHPUnit constraint + * Deprecate the `RequestStack::getMasterRequest()` method and add `getMainRequest()` as replacement + +5.2.0 +----- + + * added support for `X-Forwarded-Prefix` header + * added `HeaderUtils::parseQuery()`: it does the same as `parse_str()` but preserves dots in variable names + * added `File::getContent()` + * added ability to use comma separated ip addresses for `RequestMatcher::matchIps()` + * added `Request::toArray()` to parse a JSON request body to an array + * added `RateLimiter\RequestRateLimiterInterface` and `RateLimiter\AbstractRequestRateLimiter` + * deprecated not passing a `Closure` together with `FILTER_CALLBACK` to `ParameterBag::filter()`; wrap your filter in a closure instead. + * Deprecated the `Request::HEADER_X_FORWARDED_ALL` constant, use either `HEADER_X_FORWARDED_FOR | HEADER_X_FORWARDED_HOST | HEADER_X_FORWARDED_PORT | HEADER_X_FORWARDED_PROTO` or `HEADER_X_FORWARDED_AWS_ELB` or `HEADER_X_FORWARDED_TRAEFIK` constants instead. + * Deprecated `BinaryFileResponse::create()`, use `__construct()` instead + +5.1.0 +----- + + * added `Cookie::withValue`, `Cookie::withDomain`, `Cookie::withExpires`, + `Cookie::withPath`, `Cookie::withSecure`, `Cookie::withHttpOnly`, + `Cookie::withRaw`, `Cookie::withSameSite` + * Deprecate `Response::create()`, `JsonResponse::create()`, + `RedirectResponse::create()`, and `StreamedResponse::create()` methods (use + `__construct()` instead) + * added `Request::preferSafeContent()` and `Response::setContentSafe()` to handle "safe" HTTP preference + according to [RFC 8674](https://tools.ietf.org/html/rfc8674) + * made the Mime component an optional dependency + * added `MarshallingSessionHandler`, `IdentityMarshaller` + * made `Session` accept a callback to report when the session is being used + * Add support for all core cache control directives + * Added `Symfony\Component\HttpFoundation\InputBag` + * Deprecated retrieving non-string values using `InputBag::get()`, use `InputBag::all()` if you need access to the collection of values + +5.0.0 +----- + + * made `Cookie` auto-secure and lax by default + * removed classes in the `MimeType` namespace, use the Symfony Mime component instead + * removed method `UploadedFile::getClientSize()` and the related constructor argument + * made `Request::getSession()` throw if the session has not been set before + * removed `Response::HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL` + * passing a null url when instantiating a `RedirectResponse` is not allowed + +4.4.0 +----- + + * passing arguments to `Request::isMethodSafe()` is deprecated. + * `ApacheRequest` is deprecated, use the `Request` class instead. + * passing a third argument to `HeaderBag::get()` is deprecated, use method `all()` instead + * [BC BREAK] `PdoSessionHandler` with MySQL changed the type of the lifetime column, + make sure to run `ALTER TABLE sessions MODIFY sess_lifetime INTEGER UNSIGNED NOT NULL` to + update your database. + * `PdoSessionHandler` now precalculates the expiry timestamp in the lifetime column, + make sure to run `CREATE INDEX expiry ON sessions (sess_lifetime)` to update your database + to speed up garbage collection of expired sessions. + * added `SessionHandlerFactory` to create session handlers with a DSN + * added `IpUtils::anonymize()` to help with GDPR compliance. + +4.3.0 +----- + + * added PHPUnit constraints: `RequestAttributeValueSame`, `ResponseCookieValueSame`, `ResponseHasCookie`, + `ResponseHasHeader`, `ResponseHeaderSame`, `ResponseIsRedirected`, `ResponseIsSuccessful`, and `ResponseStatusCodeSame` + * deprecated `MimeTypeGuesserInterface` and `ExtensionGuesserInterface` in favor of `Symfony\Component\Mime\MimeTypesInterface`. + * deprecated `MimeType` and `MimeTypeExtensionGuesser` in favor of `Symfony\Component\Mime\MimeTypes`. + * deprecated `FileBinaryMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileBinaryMimeTypeGuesser`. + * deprecated `FileinfoMimeTypeGuesser` in favor of `Symfony\Component\Mime\FileinfoMimeTypeGuesser`. + * added `UrlHelper` that allows to get an absolute URL and a relative path for a given path + +4.2.0 +----- + + * the default value of the "$secure" and "$samesite" arguments of Cookie's constructor + will respectively change from "false" to "null" and from "null" to "lax" in Symfony + 5.0, you should define their values explicitly or use "Cookie::create()" instead. + * added `matchPort()` in RequestMatcher + +4.1.3 +----- + + * [BC BREAK] Support for the IIS-only `X_ORIGINAL_URL` and `X_REWRITE_URL` + HTTP headers has been dropped for security reasons. + +4.1.0 +----- + + * Query string normalization uses `parse_str()` instead of custom parsing logic. + * Passing the file size to the constructor of the `UploadedFile` class is deprecated. + * The `getClientSize()` method of the `UploadedFile` class is deprecated. Use `getSize()` instead. + * added `RedisSessionHandler` to use Redis as a session storage + * The `get()` method of the `AcceptHeader` class now takes into account the + `*` and `*/*` default values (if they are present in the Accept HTTP header) + when looking for items. + * deprecated `Request::getSession()` when no session has been set. Use `Request::hasSession()` instead. + * added `CannotWriteFileException`, `ExtensionFileException`, `FormSizeFileException`, + `IniSizeFileException`, `NoFileException`, `NoTmpDirFileException`, `PartialFileException` to + handle failed `UploadedFile`. + * added `MigratingSessionHandler` for migrating between two session handlers without losing sessions + * added `HeaderUtils`. + +4.0.0 +----- + + * the `Request::setTrustedHeaderName()` and `Request::getTrustedHeaderName()` + methods have been removed + * the `Request::HEADER_CLIENT_IP` constant has been removed, use + `Request::HEADER_X_FORWARDED_FOR` instead + * the `Request::HEADER_CLIENT_HOST` constant has been removed, use + `Request::HEADER_X_FORWARDED_HOST` instead + * the `Request::HEADER_CLIENT_PROTO` constant has been removed, use + `Request::HEADER_X_FORWARDED_PROTO` instead + * the `Request::HEADER_CLIENT_PORT` constant has been removed, use + `Request::HEADER_X_FORWARDED_PORT` instead + * checking for cacheable HTTP methods using the `Request::isMethodSafe()` + method (by not passing `false` as its argument) is not supported anymore and + throws a `\BadMethodCallException` + * the `WriteCheckSessionHandler`, `NativeSessionHandler` and `NativeProxy` classes have been removed + * setting session save handlers that do not implement `\SessionHandlerInterface` in + `NativeSessionStorage::setSaveHandler()` is not supported anymore and throws a + `\TypeError` + +3.4.0 +----- + + * implemented PHP 7.0's `SessionUpdateTimestampHandlerInterface` with a new + `AbstractSessionHandler` base class and a new `StrictSessionHandler` wrapper + * deprecated the `WriteCheckSessionHandler`, `NativeSessionHandler` and `NativeProxy` classes + * deprecated setting session save handlers that do not implement `\SessionHandlerInterface` in `NativeSessionStorage::setSaveHandler()` + * deprecated using `MongoDbSessionHandler` with the legacy mongo extension; use it with the mongodb/mongodb package and ext-mongodb instead + * deprecated `MemcacheSessionHandler`; use `MemcachedSessionHandler` instead + +3.3.0 +----- + + * the `Request::setTrustedProxies()` method takes a new `$trustedHeaderSet` argument, + see https://symfony.com/doc/current/deployment/proxies.html for more info, + * deprecated the `Request::setTrustedHeaderName()` and `Request::getTrustedHeaderName()` methods, + * added `File\Stream`, to be passed to `BinaryFileResponse` when the size of the served file is unknown, + disabling `Range` and `Content-Length` handling, switching to chunked encoding instead + * added the `Cookie::fromString()` method that allows to create a cookie from a + raw header string + +3.1.0 +----- + + * Added support for creating `JsonResponse` with a string of JSON data + +3.0.0 +----- + + * The precedence of parameters returned from `Request::get()` changed from "GET, PATH, BODY" to "PATH, GET, BODY" + +2.8.0 +----- + + * Finding deep items in `ParameterBag::get()` is deprecated since version 2.8 and + will be removed in 3.0. + +2.6.0 +----- + + * PdoSessionHandler changes + - implemented different session locking strategies to prevent loss of data by concurrent access to the same session + - [BC BREAK] save session data in a binary column without base64_encode + - [BC BREAK] added lifetime column to the session table which allows to have different lifetimes for each session + - implemented lazy connections that are only opened when a session is used by either passing a dsn string + explicitly or falling back to session.save_path ini setting + - added a createTable method that initializes a correctly defined table depending on the database vendor + +2.5.0 +----- + + * added `JsonResponse::setEncodingOptions()` & `JsonResponse::getEncodingOptions()` for easier manipulation + of the options used while encoding data to JSON format. + +2.4.0 +----- + + * added RequestStack + * added Request::getEncodings() + * added accessors methods to session handlers + +2.3.0 +----- + + * added support for ranges of IPs in trusted proxies + * `UploadedFile::isValid` now returns false if the file was not uploaded via HTTP (in a non-test mode) + * Improved error-handling of `\Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler` + to ensure the supplied PDO handler throws Exceptions on error (as the class expects). Added related test cases + to verify that Exceptions are properly thrown when the PDO queries fail. + +2.2.0 +----- + + * fixed the Request::create() precedence (URI information always take precedence now) + * added Request::getTrustedProxies() + * deprecated Request::isProxyTrusted() + * [BC BREAK] JsonResponse does not turn a top level empty array to an object anymore, use an ArrayObject to enforce objects + * added a IpUtils class to check if an IP belongs to a CIDR + * added Request::getRealMethod() to get the "real" HTTP method (getMethod() returns the "intended" HTTP method) + * disabled _method request parameter support by default (call Request::enableHttpMethodParameterOverride() to + enable it, and Request::getHttpMethodParameterOverride() to check if it is supported) + * Request::splitHttpAcceptHeader() method is deprecated and will be removed in 2.3 + * Deprecated Flashbag::count() and \Countable interface, will be removed in 2.3 + +2.1.0 +----- + + * added Request::getSchemeAndHttpHost() and Request::getUserInfo() + * added a fluent interface to the Response class + * added Request::isProxyTrusted() + * added JsonResponse + * added a getTargetUrl method to RedirectResponse + * added support for streamed responses + * made Response::prepare() method the place to enforce HTTP specification + * [BC BREAK] moved management of the locale from the Session class to the Request class + * added a generic access to the PHP built-in filter mechanism: ParameterBag::filter() + * made FileBinaryMimeTypeGuesser command configurable + * added Request::getUser() and Request::getPassword() + * added support for the PATCH method in Request + * removed the ContentTypeMimeTypeGuesser class as it is deprecated and never used on PHP 5.3 + * added ResponseHeaderBag::makeDisposition() (implements RFC 6266) + * made mimetype to extension conversion configurable + * [BC BREAK] Moved all session related classes and interfaces into own namespace, as + `Symfony\Component\HttpFoundation\Session` and renamed classes accordingly. + Session handlers are located in the subnamespace `Symfony\Component\HttpFoundation\Session\Handler`. + * SessionHandlers must implement `\SessionHandlerInterface` or extend from the + `Symfony\Component\HttpFoundation\Storage\Handler\NativeSessionHandler` base class. + * Added internal storage driver proxy mechanism for forward compatibility with + PHP 5.4 `\SessionHandler` class. + * Added session handlers for custom Memcache, Memcached and Null session save handlers. + * [BC BREAK] Removed `NativeSessionStorage` and replaced with `NativeFileSessionHandler`. + * [BC BREAK] `SessionStorageInterface` methods removed: `write()`, `read()` and + `remove()`. Added `getBag()`, `registerBag()`. The `NativeSessionStorage` class + is a mediator for the session storage internals including the session handlers + which do the real work of participating in the internal PHP session workflow. + * [BC BREAK] Introduced mock implementations of `SessionStorage` to enable unit + and functional testing without starting real PHP sessions. Removed + `ArraySessionStorage`, and replaced with `MockArraySessionStorage` for unit + tests; removed `FilesystemSessionStorage`, and replaced with`MockFileSessionStorage` + for functional tests. These do not interact with global session ini + configuration values, session functions or `$_SESSION` superglobal. This means + they can be configured directly allowing multiple instances to work without + conflicting in the same PHP process. + * [BC BREAK] Removed the `close()` method from the `Session` class, as this is + now redundant. + * Deprecated the following methods from the Session class: `setFlash()`, `setFlashes()` + `getFlash()`, `hasFlash()`, and `removeFlash()`. Use `getFlashBag()` instead + which returns a `FlashBagInterface`. + * `Session->clear()` now only clears session attributes as before it cleared + flash messages and attributes. `Session->getFlashBag()->all()` clears flashes now. + * Session data is now managed by `SessionBagInterface` to better encapsulate + session data. + * Refactored session attribute and flash messages system to their own + `SessionBagInterface` implementations. + * Added `FlashBag`. Flashes expire when retrieved by `get()` or `all()`. This + implementation is ESI compatible. + * Added `AutoExpireFlashBag` (default) to replicate Symfony 2.0.x auto expire + behavior of messages auto expiring after one page page load. Messages must + be retrieved by `get()` or `all()`. + * Added `Symfony\Component\HttpFoundation\Attribute\AttributeBag` to replicate + attributes storage behavior from 2.0.x (default). + * Added `Symfony\Component\HttpFoundation\Attribute\NamespacedAttributeBag` for + namespace session attributes. + * Flash API can stores messages in an array so there may be multiple messages + per flash type. The old `Session` class API remains without BC break as it + will allow single messages as before. + * Added basic session meta-data to the session to record session create time, + last updated time, and the lifetime of the session cookie that was provided + to the client. + * Request::getClientIp() method doesn't take a parameter anymore but bases + itself on the trustProxy parameter. + * Added isMethod() to Request object. + * [BC BREAK] The methods `getPathInfo()`, `getBaseUrl()` and `getBasePath()` of + a `Request` now all return a raw value (vs a urldecoded value before). Any call + to one of these methods must be checked and wrapped in a `rawurldecode()` if + needed. diff --git a/plugins/vendor/symfony/http-foundation/ChainRequestMatcher.php b/plugins/vendor/symfony/http-foundation/ChainRequestMatcher.php new file mode 100644 index 00000000..29486fc8 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/ChainRequestMatcher.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ChainRequestMatcher verifies that all checks match against a Request instance. + * + * @author Fabien Potencier + */ +class ChainRequestMatcher implements RequestMatcherInterface +{ + /** + * @param iterable $matchers + */ + public function __construct(private iterable $matchers) + { + } + + public function matches(Request $request): bool + { + foreach ($this->matchers as $matcher) { + if (!$matcher->matches($request)) { + return false; + } + } + + return true; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Cookie.php b/plugins/vendor/symfony/http-foundation/Cookie.php new file mode 100644 index 00000000..19928705 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Cookie.php @@ -0,0 +1,405 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents a cookie. + * + * @author Johannes M. Schmitt + */ +class Cookie +{ + public const SAMESITE_NONE = 'none'; + public const SAMESITE_LAX = 'lax'; + public const SAMESITE_STRICT = 'strict'; + + protected int $expire; + protected string $path; + + private ?string $sameSite = null; + private bool $secureDefault = false; + + private const RESERVED_CHARS_LIST = "=,; \t\r\n\v\f"; + private const RESERVED_CHARS_FROM = ['=', ',', ';', ' ', "\t", "\r", "\n", "\v", "\f"]; + private const RESERVED_CHARS_TO = ['%3D', '%2C', '%3B', '%20', '%09', '%0D', '%0A', '%0B', '%0C']; + + /** + * Creates cookie from raw header string. + */ + public static function fromString(string $cookie, bool $decode = false): static + { + $data = [ + 'expires' => 0, + 'path' => '/', + 'domain' => null, + 'secure' => false, + 'httponly' => false, + 'raw' => !$decode, + 'samesite' => null, + 'partitioned' => false, + ]; + + $parts = HeaderUtils::split($cookie, ';='); + $part = array_shift($parts); + + $name = $decode ? urldecode($part[0]) : $part[0]; + $value = isset($part[1]) ? ($decode ? urldecode($part[1]) : $part[1]) : null; + + $data = HeaderUtils::combine($parts) + $data; + $data['expires'] = self::expiresTimestamp($data['expires']); + + if (isset($data['max-age']) && ($data['max-age'] > 0 || $data['expires'] > time())) { + $data['expires'] = time() + (int) $data['max-age']; + } + + return new static($name, $value, $data['expires'], $data['path'], $data['domain'], $data['secure'], $data['httponly'], $data['raw'], $data['samesite'], $data['partitioned']); + } + + /** + * @see self::__construct + * + * @param self::SAMESITE_*|''|null $sameSite + */ + public static function create(string $name, ?string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', ?string $domain = null, ?bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX, bool $partitioned = false): self + { + return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite, $partitioned); + } + + /** + * @param string $name The name of the cookie + * @param string|null $value The value of the cookie + * @param int|string|\DateTimeInterface $expire The time the cookie expires + * @param string|null $path The path on the server in which the cookie will be available on + * @param string|null $domain The domain that the cookie is available to + * @param bool|null $secure Whether the client should send back the cookie only over HTTPS or null to auto-enable this when the request is already using HTTPS + * @param bool $httpOnly Whether the cookie will be made accessible only through the HTTP protocol + * @param bool $raw Whether the cookie value should be sent with no url encoding + * @param self::SAMESITE_*|''|null $sameSite Whether the cookie will be available for cross-site requests + * + * @throws \InvalidArgumentException + */ + public function __construct( + protected string $name, + protected ?string $value = null, + int|string|\DateTimeInterface $expire = 0, + ?string $path = '/', + protected ?string $domain = null, + protected ?bool $secure = null, + protected bool $httpOnly = true, + private bool $raw = false, + ?string $sameSite = self::SAMESITE_LAX, + private bool $partitioned = false, + ) { + // from PHP source code + if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) { + throw new \InvalidArgumentException(\sprintf('The cookie name "%s" contains invalid characters.', $name)); + } + + if (!$name) { + throw new \InvalidArgumentException('The cookie name cannot be empty.'); + } + + $this->expire = self::expiresTimestamp($expire); + $this->path = $path ?: '/'; + $this->sameSite = $this->withSameSite($sameSite)->sameSite; + } + + /** + * Creates a cookie copy with a new value. + */ + public function withValue(?string $value): static + { + $cookie = clone $this; + $cookie->value = $value; + + return $cookie; + } + + /** + * Creates a cookie copy with a new domain that the cookie is available to. + */ + public function withDomain(?string $domain): static + { + $cookie = clone $this; + $cookie->domain = $domain; + + return $cookie; + } + + /** + * Creates a cookie copy with a new time the cookie expires. + */ + public function withExpires(int|string|\DateTimeInterface $expire = 0): static + { + $cookie = clone $this; + $cookie->expire = self::expiresTimestamp($expire); + + return $cookie; + } + + /** + * Converts expires formats to a unix timestamp. + */ + private static function expiresTimestamp(int|string|\DateTimeInterface $expire = 0): int + { + // convert expiration time to a Unix timestamp + if ($expire instanceof \DateTimeInterface) { + $expire = $expire->format('U'); + } elseif (!is_numeric($expire)) { + $expire = strtotime($expire); + + if (false === $expire) { + throw new \InvalidArgumentException('The cookie expiration time is not valid.'); + } + } + + return 0 < $expire ? (int) $expire : 0; + } + + /** + * Creates a cookie copy with a new path on the server in which the cookie will be available on. + */ + public function withPath(string $path): static + { + $cookie = clone $this; + $cookie->path = '' === $path ? '/' : $path; + + return $cookie; + } + + /** + * Creates a cookie copy that only be transmitted over a secure HTTPS connection from the client. + */ + public function withSecure(bool $secure = true): static + { + $cookie = clone $this; + $cookie->secure = $secure; + + return $cookie; + } + + /** + * Creates a cookie copy that be accessible only through the HTTP protocol. + */ + public function withHttpOnly(bool $httpOnly = true): static + { + $cookie = clone $this; + $cookie->httpOnly = $httpOnly; + + return $cookie; + } + + /** + * Creates a cookie copy that uses no url encoding. + */ + public function withRaw(bool $raw = true): static + { + if ($raw && false !== strpbrk($this->name, self::RESERVED_CHARS_LIST)) { + throw new \InvalidArgumentException(\sprintf('The cookie name "%s" contains invalid characters.', $this->name)); + } + + $cookie = clone $this; + $cookie->raw = $raw; + + return $cookie; + } + + /** + * Creates a cookie copy with SameSite attribute. + * + * @param self::SAMESITE_*|''|null $sameSite + */ + public function withSameSite(?string $sameSite): static + { + if ('' === $sameSite) { + $sameSite = null; + } elseif (null !== $sameSite) { + $sameSite = strtolower($sameSite); + } + + if (!\in_array($sameSite, [self::SAMESITE_LAX, self::SAMESITE_STRICT, self::SAMESITE_NONE, null], true)) { + throw new \InvalidArgumentException('The "sameSite" parameter value is not valid.'); + } + + $cookie = clone $this; + $cookie->sameSite = $sameSite; + + return $cookie; + } + + /** + * Creates a cookie copy that is tied to the top-level site in cross-site context. + */ + public function withPartitioned(bool $partitioned = true): static + { + $cookie = clone $this; + $cookie->partitioned = $partitioned; + + return $cookie; + } + + /** + * Returns the cookie as a string. + */ + public function __toString(): string + { + if ($this->isRaw()) { + $str = $this->getName(); + } else { + $str = str_replace(self::RESERVED_CHARS_FROM, self::RESERVED_CHARS_TO, $this->getName()); + } + + $str .= '='; + + if ('' === (string) $this->getValue()) { + $str .= 'deleted; expires='.gmdate('D, d M Y H:i:s T', time() - 31536001).'; Max-Age=0'; + } else { + $str .= $this->isRaw() ? $this->getValue() : rawurlencode($this->getValue()); + + if (0 !== $this->getExpiresTime()) { + $str .= '; expires='.gmdate('D, d M Y H:i:s T', $this->getExpiresTime()).'; Max-Age='.$this->getMaxAge(); + } + } + + if ($this->getPath()) { + $str .= '; path='.$this->getPath(); + } + + if ($this->getDomain()) { + $str .= '; domain='.$this->getDomain(); + } + + if ($this->isSecure()) { + $str .= '; secure'; + } + + if ($this->isHttpOnly()) { + $str .= '; httponly'; + } + + if (null !== $this->getSameSite()) { + $str .= '; samesite='.$this->getSameSite(); + } + + if ($this->isPartitioned()) { + $str .= '; partitioned'; + } + + return $str; + } + + /** + * Gets the name of the cookie. + */ + public function getName(): string + { + return $this->name; + } + + /** + * Gets the value of the cookie. + */ + public function getValue(): ?string + { + return $this->value; + } + + /** + * Gets the domain that the cookie is available to. + */ + public function getDomain(): ?string + { + return $this->domain; + } + + /** + * Gets the time the cookie expires. + */ + public function getExpiresTime(): int + { + return $this->expire; + } + + /** + * Gets the max-age attribute. + */ + public function getMaxAge(): int + { + $maxAge = $this->expire - time(); + + return max(0, $maxAge); + } + + /** + * Gets the path on the server in which the cookie will be available on. + */ + public function getPath(): string + { + return $this->path; + } + + /** + * Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client. + */ + public function isSecure(): bool + { + return $this->secure ?? $this->secureDefault; + } + + /** + * Checks whether the cookie will be made accessible only through the HTTP protocol. + */ + public function isHttpOnly(): bool + { + return $this->httpOnly; + } + + /** + * Whether this cookie is about to be cleared. + */ + public function isCleared(): bool + { + return 0 !== $this->expire && $this->expire < time(); + } + + /** + * Checks if the cookie value should be sent with no url encoding. + */ + public function isRaw(): bool + { + return $this->raw; + } + + /** + * Checks whether the cookie should be tied to the top-level site in cross-site context. + */ + public function isPartitioned(): bool + { + return $this->partitioned; + } + + /** + * @return self::SAMESITE_*|null + */ + public function getSameSite(): ?string + { + return $this->sameSite; + } + + /** + * @param bool $default The default value of the "secure" flag when it is set to null + */ + public function setSecureDefault(bool $default): void + { + $this->secureDefault = $default; + } +} diff --git a/plugins/vendor/symfony/http-foundation/EventStreamResponse.php b/plugins/vendor/symfony/http-foundation/EventStreamResponse.php new file mode 100644 index 00000000..fe1a2872 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/EventStreamResponse.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Represents a streaming HTTP response for sending server events + * as part of the Server-Sent Events (SSE) streaming technique. + * + * To broadcast events to multiple users at once, for long-running + * connections and for high-traffic websites, prefer using the Mercure + * Symfony Component, which relies on Software designed for these use + * cases: https://symfony.com/doc/current/mercure.html + * + * @see ServerEvent + * + * @author Yonel Ceruto + * + * Example usage: + * + * return new EventStreamResponse(function () { + * yield new ServerEvent(time()); + * + * sleep(1); + * + * yield new ServerEvent(time()); + * }); + */ +class EventStreamResponse extends StreamedResponse +{ + /** + * @param int|null $retry The number of milliseconds the client should wait + * before reconnecting in case of network failure + */ + public function __construct(?callable $callback = null, int $status = 200, array $headers = [], private ?int $retry = null) + { + $headers += [ + 'Connection' => 'keep-alive', + 'Content-Type' => 'text/event-stream', + 'Cache-Control' => 'private, no-cache, no-store, must-revalidate, max-age=0', + 'X-Accel-Buffering' => 'no', + 'Pragma' => 'no-cache', + 'Expire' => '0', + ]; + + parent::__construct($callback, $status, $headers); + } + + public function setCallback(callable $callback): static + { + if ($this->callback) { + return parent::setCallback($callback); + } + + $this->callback = function () use ($callback) { + if (is_iterable($events = $callback($this))) { + foreach ($events as $event) { + $this->sendEvent($event); + + if (connection_aborted()) { + break; + } + } + } + }; + + return $this; + } + + /** + * Sends a server event to the client. + * + * @return $this + */ + public function sendEvent(ServerEvent $event): static + { + if ($this->retry > 0 && !$event->getRetry()) { + $event->setRetry($this->retry); + } + + foreach ($event as $part) { + echo $part; + + if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + static::closeOutputBuffers(0, true); + flush(); + } + } + + return $this; + } + + public function getRetry(): ?int + { + return $this->retry; + } + + public function setRetry(int $retry): void + { + $this->retry = $retry; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/BadRequestException.php b/plugins/vendor/symfony/http-foundation/Exception/BadRequestException.php new file mode 100644 index 00000000..505e1cfd --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/BadRequestException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Raised when a user sends a malformed request. + */ +class BadRequestException extends UnexpectedValueException implements RequestExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php b/plugins/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php new file mode 100644 index 00000000..77aa0e1e --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/ConflictingHeadersException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * The HTTP request contains headers with conflicting information. + * + * @author Magnus Nordlander + */ +class ConflictingHeadersException extends UnexpectedValueException implements RequestExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/ExceptionInterface.php b/plugins/vendor/symfony/http-foundation/Exception/ExceptionInterface.php new file mode 100644 index 00000000..e77c94ff --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/ExceptionInterface.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +interface ExceptionInterface extends \Throwable +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/ExpiredSignedUriException.php b/plugins/vendor/symfony/http-foundation/Exception/ExpiredSignedUriException.php new file mode 100644 index 00000000..613e08ef --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/ExpiredSignedUriException.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * @author Kevin Bond + */ +final class ExpiredSignedUriException extends SignedUriException +{ + /** + * @internal + */ + public function __construct() + { + parent::__construct('The URI has expired.'); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/JsonException.php b/plugins/vendor/symfony/http-foundation/Exception/JsonException.php new file mode 100644 index 00000000..6d1e0aec --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/JsonException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Thrown by Request::toArray() when the content cannot be JSON-decoded. + * + * @author Tobias Nyholm + */ +final class JsonException extends UnexpectedValueException implements RequestExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/LogicException.php b/plugins/vendor/symfony/http-foundation/Exception/LogicException.php new file mode 100644 index 00000000..2d3021f0 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/LogicException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Base LogicException for Http Foundation component. + */ +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php b/plugins/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php new file mode 100644 index 00000000..478d0dc7 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/RequestExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Interface for Request exceptions. + * + * Exceptions implementing this interface should trigger an HTTP 400 response in the application code. + */ +interface RequestExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php b/plugins/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php new file mode 100644 index 00000000..80a21bf1 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/SessionNotFoundException.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Raised when a session does not exist. This happens in the following cases: + * - the session is not enabled + * - attempt to read a session outside a request context (ie. cli script). + * + * @author Jérémy Derussé + */ +class SessionNotFoundException extends \LogicException implements RequestExceptionInterface +{ + public function __construct(string $message = 'There is currently no session available.', int $code = 0, ?\Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/SignedUriException.php b/plugins/vendor/symfony/http-foundation/Exception/SignedUriException.php new file mode 100644 index 00000000..17b729d3 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/SignedUriException.php @@ -0,0 +1,19 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * @author Kevin Bond + */ +abstract class SignedUriException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php b/plugins/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php new file mode 100644 index 00000000..4818ef2c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/SuspiciousOperationException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * Raised when a user has performed an operation that should be considered + * suspicious from a security perspective. + */ +class SuspiciousOperationException extends UnexpectedValueException implements RequestExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/UnexpectedValueException.php b/plugins/vendor/symfony/http-foundation/Exception/UnexpectedValueException.php new file mode 100644 index 00000000..c3e6c9d6 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/UnexpectedValueException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +class UnexpectedValueException extends \UnexpectedValueException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/UnsignedUriException.php b/plugins/vendor/symfony/http-foundation/Exception/UnsignedUriException.php new file mode 100644 index 00000000..5eabb806 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/UnsignedUriException.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * @author Kevin Bond + */ +final class UnsignedUriException extends SignedUriException +{ + /** + * @internal + */ + public function __construct() + { + parent::__construct('The URI is not signed.'); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Exception/UnverifiedSignedUriException.php b/plugins/vendor/symfony/http-foundation/Exception/UnverifiedSignedUriException.php new file mode 100644 index 00000000..cc7e98bf --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Exception/UnverifiedSignedUriException.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Exception; + +/** + * @author Kevin Bond + */ +final class UnverifiedSignedUriException extends SignedUriException +{ + /** + * @internal + */ + public function __construct() + { + parent::__construct('The URI signature is invalid.'); + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php b/plugins/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php new file mode 100644 index 00000000..79ab0fce --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/AccessDeniedException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when the access on a file was denied. + * + * @author Bernhard Schussek + */ +class AccessDeniedException extends FileException +{ + public function __construct(string $path) + { + parent::__construct(\sprintf('The file %s could not be accessed', $path)); + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php new file mode 100644 index 00000000..c49f53a6 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/CannotWriteFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_CANT_WRITE error occurred with UploadedFile. + * + * @author Florent Mata + */ +class CannotWriteFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php new file mode 100644 index 00000000..ed83499c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/ExtensionFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_EXTENSION error occurred with UploadedFile. + * + * @author Florent Mata + */ +class ExtensionFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/FileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/FileException.php new file mode 100644 index 00000000..fad5133e --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/FileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an error occurred in the component File. + * + * @author Bernhard Schussek + */ +class FileException extends \RuntimeException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php b/plugins/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php new file mode 100644 index 00000000..3a5eb039 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/FileNotFoundException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when a file was not found. + * + * @author Bernhard Schussek + */ +class FileNotFoundException extends FileException +{ + public function __construct(string $path) + { + parent::__construct(\sprintf('The file "%s" does not exist', $path)); + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php new file mode 100644 index 00000000..8741be08 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/FormSizeFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_FORM_SIZE error occurred with UploadedFile. + * + * @author Florent Mata + */ +class FormSizeFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php new file mode 100644 index 00000000..c8fde610 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/IniSizeFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_INI_SIZE error occurred with UploadedFile. + * + * @author Florent Mata + */ +class IniSizeFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/NoFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/NoFileException.php new file mode 100644 index 00000000..4b48cc77 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/NoFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_NO_FILE error occurred with UploadedFile. + * + * @author Florent Mata + */ +class NoFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php new file mode 100644 index 00000000..bdead2d9 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/NoTmpDirFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_NO_TMP_DIR error occurred with UploadedFile. + * + * @author Florent Mata + */ +class NoTmpDirFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/PartialFileException.php b/plugins/vendor/symfony/http-foundation/File/Exception/PartialFileException.php new file mode 100644 index 00000000..4641efb5 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/PartialFileException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an UPLOAD_ERR_PARTIAL error occurred with UploadedFile. + * + * @author Florent Mata + */ +class PartialFileException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php b/plugins/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php new file mode 100644 index 00000000..09b1c7e1 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/UnexpectedTypeException.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +class UnexpectedTypeException extends FileException +{ + public function __construct(mixed $value, string $expectedType) + { + parent::__construct(\sprintf('Expected argument of type %s, %s given', $expectedType, get_debug_type($value))); + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/Exception/UploadException.php b/plugins/vendor/symfony/http-foundation/File/Exception/UploadException.php new file mode 100644 index 00000000..7074e765 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Exception/UploadException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File\Exception; + +/** + * Thrown when an error occurred during file upload. + * + * @author Bernhard Schussek + */ +class UploadException extends FileException +{ +} diff --git a/plugins/vendor/symfony/http-foundation/File/File.php b/plugins/vendor/symfony/http-foundation/File/File.php new file mode 100644 index 00000000..2194c178 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/File.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File; + +use Symfony\Component\HttpFoundation\File\Exception\FileException; +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\Mime\MimeTypes; + +/** + * A file in the file system. + * + * @author Bernhard Schussek + */ +class File extends \SplFileInfo +{ + /** + * Constructs a new file from the given path. + * + * @param string $path The path to the file + * @param bool $checkPath Whether to check the path or not + * + * @throws FileNotFoundException If the given path is not a file + */ + public function __construct(string $path, bool $checkPath = true) + { + if ($checkPath && !is_file($path)) { + throw new FileNotFoundException($path); + } + + parent::__construct($path); + } + + /** + * Returns the extension based on the mime type. + * + * If the mime type is unknown, returns null. + * + * This method uses the mime type as guessed by getMimeType() + * to guess the file extension. + * + * @see MimeTypes + * @see getMimeType() + */ + public function guessExtension(): ?string + { + if (!class_exists(MimeTypes::class)) { + throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); + } + + return MimeTypes::getDefault()->getExtensions($this->getMimeType())[0] ?? null; + } + + /** + * Returns the mime type of the file. + * + * The mime type is guessed using a MimeTypeGuesserInterface instance, + * which uses finfo_file() then the "file" system binary, + * depending on which of those are available. + * + * @see MimeTypes + */ + public function getMimeType(): ?string + { + if (!class_exists(MimeTypes::class)) { + throw new \LogicException('You cannot guess the mime type as the Mime component is not installed. Try running "composer require symfony/mime".'); + } + + return MimeTypes::getDefault()->guessMimeType($this->getPathname()); + } + + /** + * Moves the file to a new location. + * + * @throws FileException if the target file could not be created + */ + public function move(string $directory, ?string $name = null): self + { + $target = $this->getTargetFile($directory, $name); + + set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); + try { + $renamed = rename($this->getPathname(), $target); + } finally { + restore_error_handler(); + } + if (!$renamed) { + throw new FileException(\sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error))); + } + + @chmod($target, 0666 & ~umask()); + + return $target; + } + + public function getContent(): string + { + $content = file_get_contents($this->getPathname()); + + if (false === $content) { + throw new FileException(\sprintf('Could not get the content of the file "%s".', $this->getPathname())); + } + + return $content; + } + + protected function getTargetFile(string $directory, ?string $name = null): self + { + if (!is_dir($directory)) { + if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) { + throw new FileException(\sprintf('Unable to create the "%s" directory.', $directory)); + } + } elseif (!is_writable($directory)) { + throw new FileException(\sprintf('Unable to write in the "%s" directory.', $directory)); + } + + $target = rtrim($directory, '/\\').\DIRECTORY_SEPARATOR.(null === $name ? $this->getBasename() : $this->getName($name)); + + return new self($target, false); + } + + /** + * Returns locale independent base name of the given path. + */ + protected function getName(string $name): string + { + $originalName = str_replace('\\', '/', $name); + $pos = strrpos($originalName, '/'); + + return false === $pos ? $originalName : substr($originalName, $pos + 1); + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/Stream.php b/plugins/vendor/symfony/http-foundation/File/Stream.php new file mode 100644 index 00000000..2c156b2e --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/Stream.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File; + +/** + * A PHP stream of unknown size. + * + * @author Nicolas Grekas + */ +class Stream extends File +{ + public function getSize(): int|false + { + return false; + } +} diff --git a/plugins/vendor/symfony/http-foundation/File/UploadedFile.php b/plugins/vendor/symfony/http-foundation/File/UploadedFile.php new file mode 100644 index 00000000..a27a56f9 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/File/UploadedFile.php @@ -0,0 +1,289 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\File; + +use Symfony\Component\HttpFoundation\File\Exception\CannotWriteFileException; +use Symfony\Component\HttpFoundation\File\Exception\ExtensionFileException; +use Symfony\Component\HttpFoundation\File\Exception\FileException; +use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException; +use Symfony\Component\HttpFoundation\File\Exception\FormSizeFileException; +use Symfony\Component\HttpFoundation\File\Exception\IniSizeFileException; +use Symfony\Component\HttpFoundation\File\Exception\NoFileException; +use Symfony\Component\HttpFoundation\File\Exception\NoTmpDirFileException; +use Symfony\Component\HttpFoundation\File\Exception\PartialFileException; +use Symfony\Component\Mime\MimeTypes; + +/** + * A file uploaded through a form. + * + * @author Bernhard Schussek + * @author Florian Eckerstorfer + * @author Fabien Potencier + */ +class UploadedFile extends File +{ + private string $originalName; + private string $mimeType; + private int $error; + private string $originalPath; + + /** + * Accepts the information of the uploaded file as provided by the PHP global $_FILES. + * + * The file object is only created when the uploaded file is valid (i.e. when the + * isValid() method returns true). Otherwise the only methods that could be called + * on an UploadedFile instance are: + * + * * getClientOriginalName, + * * getClientMimeType, + * * isValid, + * * getError. + * + * Calling any other method on an non-valid instance will cause an unpredictable result. + * + * @param string $path The full temporary path to the file + * @param string $originalName The original file name of the uploaded file + * @param string|null $mimeType The type of the file as provided by PHP; null defaults to application/octet-stream + * @param int|null $error The error constant of the upload (one of PHP's UPLOAD_ERR_XXX constants); null defaults to UPLOAD_ERR_OK + * @param bool $test Whether the test mode is active + * Local files are used in test mode hence the code should not enforce HTTP uploads + * + * @throws FileException If file_uploads is disabled + * @throws FileNotFoundException If the file does not exist + */ + public function __construct( + string $path, + string $originalName, + ?string $mimeType = null, + ?int $error = null, + private bool $test = false, + ) { + $this->originalName = $this->getName($originalName); + $this->originalPath = strtr($originalName, '\\', '/'); + $this->mimeType = $mimeType ?: 'application/octet-stream'; + $this->error = $error ?: \UPLOAD_ERR_OK; + + parent::__construct($path, \UPLOAD_ERR_OK === $this->error); + } + + /** + * Returns the original file name. + * + * It is extracted from the request from which the file has been uploaded. + * This should not be considered as a safe value to use for a file name on your servers. + */ + public function getClientOriginalName(): string + { + return $this->originalName; + } + + /** + * Returns the original file extension. + * + * It is extracted from the original file name that was uploaded. + * This should not be considered as a safe value to use for a file name on your servers. + */ + public function getClientOriginalExtension(): string + { + return pathinfo($this->originalName, \PATHINFO_EXTENSION); + } + + /** + * Returns the original file full path. + * + * It is extracted from the request from which the file has been uploaded. + * This should not be considered as a safe value to use for a file name/path on your servers. + * + * If this file was uploaded with the "webkitdirectory" upload directive, this will contain + * the path of the file relative to the uploaded root directory. Otherwise this will be identical + * to getClientOriginalName(). + */ + public function getClientOriginalPath(): string + { + return $this->originalPath; + } + + /** + * Returns the file mime type. + * + * The client mime type is extracted from the request from which the file + * was uploaded, so it should not be considered as a safe value. + * + * For a trusted mime type, use getMimeType() instead (which guesses the mime + * type based on the file content). + * + * @see getMimeType() + */ + public function getClientMimeType(): string + { + return $this->mimeType; + } + + /** + * Returns the extension based on the client mime type. + * + * If the mime type is unknown, returns null. + * + * This method uses the mime type as guessed by getClientMimeType() + * to guess the file extension. As such, the extension returned + * by this method cannot be trusted. + * + * For a trusted extension, use guessExtension() instead (which guesses + * the extension based on the guessed mime type for the file). + * + * @see guessExtension() + * @see getClientMimeType() + */ + public function guessClientExtension(): ?string + { + if (!class_exists(MimeTypes::class)) { + throw new \LogicException('You cannot guess the extension as the Mime component is not installed. Try running "composer require symfony/mime".'); + } + + return MimeTypes::getDefault()->getExtensions($this->getClientMimeType())[0] ?? null; + } + + /** + * Returns the upload error. + * + * If the upload was successful, the constant UPLOAD_ERR_OK is returned. + * Otherwise one of the other UPLOAD_ERR_XXX constants is returned. + */ + public function getError(): int + { + return $this->error; + } + + /** + * Returns whether the file has been uploaded with HTTP and no error occurred. + */ + public function isValid(): bool + { + $isOk = \UPLOAD_ERR_OK === $this->error; + + return $this->test ? $isOk : $isOk && is_uploaded_file($this->getPathname()); + } + + /** + * Moves the file to a new location. + * + * @throws FileException if, for any reason, the file could not have been moved + */ + public function move(string $directory, ?string $name = null): File + { + if ($this->isValid()) { + if ($this->test) { + return parent::move($directory, $name); + } + + $target = $this->getTargetFile($directory, $name); + + set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); + try { + $moved = move_uploaded_file($this->getPathname(), $target); + } finally { + restore_error_handler(); + } + if (!$moved) { + throw new FileException(\sprintf('Could not move the file "%s" to "%s" (%s).', $this->getPathname(), $target, strip_tags($error))); + } + + @chmod($target, 0666 & ~umask()); + + return $target; + } + + switch ($this->error) { + case \UPLOAD_ERR_INI_SIZE: + throw new IniSizeFileException($this->getErrorMessage()); + case \UPLOAD_ERR_FORM_SIZE: + throw new FormSizeFileException($this->getErrorMessage()); + case \UPLOAD_ERR_PARTIAL: + throw new PartialFileException($this->getErrorMessage()); + case \UPLOAD_ERR_NO_FILE: + throw new NoFileException($this->getErrorMessage()); + case \UPLOAD_ERR_CANT_WRITE: + throw new CannotWriteFileException($this->getErrorMessage()); + case \UPLOAD_ERR_NO_TMP_DIR: + throw new NoTmpDirFileException($this->getErrorMessage()); + case \UPLOAD_ERR_EXTENSION: + throw new ExtensionFileException($this->getErrorMessage()); + } + + throw new FileException($this->getErrorMessage()); + } + + /** + * Returns the maximum size of an uploaded file as configured in php.ini. + * + * @return int|float The maximum size of an uploaded file in bytes (returns float if size > PHP_INT_MAX) + */ + public static function getMaxFilesize(): int|float + { + $sizePostMax = self::parseFilesize(\ini_get('post_max_size')); + $sizeUploadMax = self::parseFilesize(\ini_get('upload_max_filesize')); + + return min($sizePostMax ?: \PHP_INT_MAX, $sizeUploadMax ?: \PHP_INT_MAX); + } + + private static function parseFilesize(string $size): int|float + { + if ('' === $size) { + return 0; + } + + $size = strtolower($size); + + $max = ltrim($size, '+'); + if (str_starts_with($max, '0x')) { + $max = \intval($max, 16); + } elseif (str_starts_with($max, '0')) { + $max = \intval($max, 8); + } else { + $max = (int) $max; + } + + switch (substr($size, -1)) { + case 't': $max *= 1024; + // no break + case 'g': $max *= 1024; + // no break + case 'm': $max *= 1024; + // no break + case 'k': $max *= 1024; + } + + return $max; + } + + /** + * Returns an informative upload error message. + */ + public function getErrorMessage(): string + { + static $errors = [ + \UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d KiB).', + \UPLOAD_ERR_FORM_SIZE => 'The file "%s" exceeds the upload limit defined in your form.', + \UPLOAD_ERR_PARTIAL => 'The file "%s" was only partially uploaded.', + \UPLOAD_ERR_NO_FILE => 'No file was uploaded.', + \UPLOAD_ERR_CANT_WRITE => 'The file "%s" could not be written on disk.', + \UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.', + \UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.', + ]; + + $errorCode = $this->error; + $maxFilesize = \UPLOAD_ERR_INI_SIZE === $errorCode ? self::getMaxFilesize() / 1024 : 0; + $message = $errors[$errorCode] ?? 'The file "%s" was not uploaded due to an unknown error.'; + + return \sprintf($message, $this->getClientOriginalName(), $maxFilesize); + } +} diff --git a/plugins/vendor/symfony/http-foundation/FileBag.php b/plugins/vendor/symfony/http-foundation/FileBag.php new file mode 100644 index 00000000..561e7cde --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/FileBag.php @@ -0,0 +1,127 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\File\UploadedFile; + +/** + * FileBag is a container for uploaded files. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + */ +class FileBag extends ParameterBag +{ + private const FILE_KEYS = ['error', 'full_path', 'name', 'size', 'tmp_name', 'type']; + + /** + * @param array|UploadedFile[] $parameters An array of HTTP files + */ + public function __construct(array $parameters = []) + { + $this->replace($parameters); + } + + public function replace(array $files = []): void + { + $this->parameters = []; + $this->add($files); + } + + public function set(string $key, mixed $value): void + { + if (!\is_array($value) && !$value instanceof UploadedFile) { + throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.'); + } + + parent::set($key, $this->convertFileInformation($value)); + } + + public function add(array $files = []): void + { + foreach ($files as $key => $file) { + $this->set($key, $file); + } + } + + /** + * Converts uploaded files to UploadedFile instances. + * + * @return UploadedFile[]|UploadedFile|null + */ + protected function convertFileInformation(array|UploadedFile $file): array|UploadedFile|null + { + if ($file instanceof UploadedFile) { + return $file; + } + + $file = $this->fixPhpFilesArray($file); + $keys = array_keys($file + ['full_path' => null]); + sort($keys); + + if (self::FILE_KEYS === $keys) { + if (\UPLOAD_ERR_NO_FILE === $file['error']) { + $file = null; + } else { + $file = new UploadedFile($file['tmp_name'], $file['full_path'] ?? $file['name'], $file['type'], $file['error'], false); + } + } else { + $file = array_map(fn ($v) => $v instanceof UploadedFile || \is_array($v) ? $this->convertFileInformation($v) : $v, $file); + if (array_is_list($file)) { + $file = array_filter($file); + } + } + + return $file; + } + + /** + * Fixes a malformed PHP $_FILES array. + * + * PHP has a bug that the format of the $_FILES array differs, depending on + * whether the uploaded file fields had normal field names or array-like + * field names ("normal" vs. "parent[child]"). + * + * This method fixes the array to look like the "normal" $_FILES array. + * + * It's safe to pass an already converted array, in which case this method + * just returns the original array unmodified. + */ + protected function fixPhpFilesArray(array $data): array + { + $keys = array_keys($data + ['full_path' => null]); + sort($keys); + + if (self::FILE_KEYS !== $keys || !isset($data['name']) || !\is_array($data['name'])) { + return $data; + } + + $files = $data; + foreach (self::FILE_KEYS as $k) { + unset($files[$k]); + } + + foreach ($data['name'] as $key => $name) { + $files[$key] = $this->fixPhpFilesArray([ + 'error' => $data['error'][$key], + 'name' => $name, + 'type' => $data['type'][$key], + 'tmp_name' => $data['tmp_name'][$key], + 'size' => $data['size'][$key], + ] + (isset($data['full_path'][$key]) ? [ + 'full_path' => $data['full_path'][$key], + ] : [])); + } + + return $files; + } +} diff --git a/plugins/vendor/symfony/http-foundation/HeaderBag.php b/plugins/vendor/symfony/http-foundation/HeaderBag.php new file mode 100644 index 00000000..c2ede560 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/HeaderBag.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * HeaderBag is a container for HTTP headers. + * + * @author Fabien Potencier + * + * @implements \IteratorAggregate> + */ +class HeaderBag implements \IteratorAggregate, \Countable, \Stringable +{ + protected const UPPER = '_ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + protected const LOWER = '-abcdefghijklmnopqrstuvwxyz'; + + /** + * @var array> + */ + protected array $headers = []; + protected array $cacheControl = []; + + public function __construct(array $headers = []) + { + foreach ($headers as $key => $values) { + $this->set($key, $values); + } + } + + /** + * Returns the headers as a string. + */ + public function __toString(): string + { + if (!$headers = $this->all()) { + return ''; + } + + ksort($headers); + $max = max(array_map('strlen', array_keys($headers))) + 1; + $content = ''; + foreach ($headers as $name => $values) { + $name = ucwords($name, '-'); + foreach ($values as $value) { + $content .= \sprintf("%-{$max}s %s\r\n", $name.':', $value); + } + } + + return $content; + } + + /** + * Returns the headers. + * + * @param string|null $key The name of the headers to return or null to get them all + * + * @return ($key is null ? array> : list) + */ + public function all(?string $key = null): array + { + if (null !== $key) { + return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? []; + } + + return $this->headers; + } + + /** + * Returns the parameter keys. + * + * @return string[] + */ + public function keys(): array + { + return array_keys($this->all()); + } + + /** + * Replaces the current HTTP headers by a new set. + */ + public function replace(array $headers = []): void + { + $this->headers = []; + $this->add($headers); + } + + /** + * Adds new headers the current HTTP headers set. + */ + public function add(array $headers): void + { + foreach ($headers as $key => $values) { + $this->set($key, $values); + } + } + + /** + * Returns the first header by name or the default one. + */ + public function get(string $key, ?string $default = null): ?string + { + $headers = $this->all($key); + + if (!$headers) { + return $default; + } + + if (null === $headers[0]) { + return null; + } + + return $headers[0]; + } + + /** + * Sets a header by name. + * + * @param string|string[]|null $values The value or an array of values + * @param bool $replace Whether to replace the actual value or not (true by default) + */ + public function set(string $key, string|array|null $values, bool $replace = true): void + { + $key = strtr($key, self::UPPER, self::LOWER); + + if (\is_array($values)) { + $values = array_values($values); + + if (true === $replace || !isset($this->headers[$key])) { + $this->headers[$key] = $values; + } else { + $this->headers[$key] = array_merge($this->headers[$key], $values); + } + } else { + if (true === $replace || !isset($this->headers[$key])) { + $this->headers[$key] = [$values]; + } else { + $this->headers[$key][] = $values; + } + } + + if ('cache-control' === $key) { + $this->cacheControl = $this->parseCacheControl(implode(', ', $this->headers[$key])); + } + } + + /** + * Returns true if the HTTP header is defined. + */ + public function has(string $key): bool + { + return \array_key_exists(strtr($key, self::UPPER, self::LOWER), $this->all()); + } + + /** + * Returns true if the given HTTP header contains the given value. + */ + public function contains(string $key, string $value): bool + { + return \in_array($value, $this->all($key), true); + } + + /** + * Removes a header. + */ + public function remove(string $key): void + { + $key = strtr($key, self::UPPER, self::LOWER); + + unset($this->headers[$key]); + + if ('cache-control' === $key) { + $this->cacheControl = []; + } + } + + /** + * Returns the HTTP header value converted to a date. + * + * @throws \RuntimeException When the HTTP header is not parseable + */ + public function getDate(string $key, ?\DateTimeInterface $default = null): ?\DateTimeImmutable + { + if (null === $value = $this->get($key)) { + return null !== $default ? \DateTimeImmutable::createFromInterface($default) : null; + } + + if (false === $date = \DateTimeImmutable::createFromFormat(\DATE_RFC2822, $value)) { + throw new \RuntimeException(\sprintf('The "%s" HTTP header is not parseable (%s).', $key, $value)); + } + + return $date; + } + + /** + * Adds a custom Cache-Control directive. + */ + public function addCacheControlDirective(string $key, bool|string $value = true): void + { + $this->cacheControl[$key] = $value; + + $this->set('Cache-Control', $this->getCacheControlHeader()); + } + + /** + * Returns true if the Cache-Control directive is defined. + */ + public function hasCacheControlDirective(string $key): bool + { + return \array_key_exists($key, $this->cacheControl); + } + + /** + * Returns a Cache-Control directive value by name. + */ + public function getCacheControlDirective(string $key): bool|string|null + { + return $this->cacheControl[$key] ?? null; + } + + /** + * Removes a Cache-Control directive. + */ + public function removeCacheControlDirective(string $key): void + { + unset($this->cacheControl[$key]); + + $this->set('Cache-Control', $this->getCacheControlHeader()); + } + + /** + * Returns an iterator for headers. + * + * @return \ArrayIterator> + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator($this->headers); + } + + /** + * Returns the number of headers. + */ + public function count(): int + { + return \count($this->headers); + } + + protected function getCacheControlHeader(): string + { + ksort($this->cacheControl); + + return HeaderUtils::toString($this->cacheControl, ','); + } + + /** + * Parses a Cache-Control HTTP header. + */ + protected function parseCacheControl(string $header): array + { + $parts = HeaderUtils::split($header, ',='); + + return HeaderUtils::combine($parts); + } +} diff --git a/plugins/vendor/symfony/http-foundation/HeaderUtils.php b/plugins/vendor/symfony/http-foundation/HeaderUtils.php new file mode 100644 index 00000000..a7079be9 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/HeaderUtils.php @@ -0,0 +1,298 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * HTTP header utility functions. + * + * @author Christian Schmidt + */ +class HeaderUtils +{ + public const DISPOSITION_ATTACHMENT = 'attachment'; + public const DISPOSITION_INLINE = 'inline'; + + /** + * This class should not be instantiated. + */ + private function __construct() + { + } + + /** + * Splits an HTTP header by one or more separators. + * + * Example: + * + * HeaderUtils::split('da, en-gb;q=0.8', ',;') + * # returns [['da'], ['en-gb', 'q=0.8']] + * + * @param string $separators List of characters to split on, ordered by + * precedence, e.g. ',', ';=', or ',;=' + * + * @return array Nested array with as many levels as there are characters in + * $separators + */ + public static function split(string $header, string $separators): array + { + if ('' === $separators) { + throw new \InvalidArgumentException('At least one separator must be specified.'); + } + + $quotedSeparators = preg_quote($separators, '/'); + + preg_match_all(' + / + (?!\s) + (?: + # quoted-string + "(?:[^"\\\\]|\\\\.)*(?:"|\\\\|$) + | + # token + [^"'.$quotedSeparators.']+ + )+ + (?['.$quotedSeparators.']) + \s* + /x', trim($header), $matches, \PREG_SET_ORDER); + + return self::groupParts($matches, $separators); + } + + /** + * Combines an array of arrays into one associative array. + * + * Each of the nested arrays should have one or two elements. The first + * value will be used as the keys in the associative array, and the second + * will be used as the values, or true if the nested array only contains one + * element. Array keys are lowercased. + * + * Example: + * + * HeaderUtils::combine([['foo', 'abc'], ['bar']]) + * // => ['foo' => 'abc', 'bar' => true] + */ + public static function combine(array $parts): array + { + $assoc = []; + foreach ($parts as $part) { + $name = strtolower($part[0]); + $value = $part[1] ?? true; + $assoc[$name] = $value; + } + + return $assoc; + } + + /** + * Joins an associative array into a string for use in an HTTP header. + * + * The key and value of each entry are joined with '=', and all entries + * are joined with the specified separator and an additional space (for + * readability). Values are quoted if necessary. + * + * Example: + * + * HeaderUtils::toString(['foo' => 'abc', 'bar' => true, 'baz' => 'a b c'], ',') + * // => 'foo=abc, bar, baz="a b c"' + */ + public static function toString(array $assoc, string $separator): string + { + $parts = []; + foreach ($assoc as $name => $value) { + if (true === $value) { + $parts[] = $name; + } else { + $parts[] = $name.'='.self::quote($value); + } + } + + return implode($separator.' ', $parts); + } + + /** + * Encodes a string as a quoted string, if necessary. + * + * If a string contains characters not allowed by the "token" construct in + * the HTTP specification, it is backslash-escaped and enclosed in quotes + * to match the "quoted-string" construct. + */ + public static function quote(string $s): string + { + if (preg_match('/^[a-z0-9!#$%&\'*.^_`|~-]+$/i', $s)) { + return $s; + } + + return '"'.addcslashes($s, '"\\"').'"'; + } + + /** + * Decodes a quoted string. + * + * If passed an unquoted string that matches the "token" construct (as + * defined in the HTTP specification), it is passed through verbatim. + */ + public static function unquote(string $s): string + { + return preg_replace('/\\\\(.)|"/', '$1', $s); + } + + /** + * Generates an HTTP Content-Disposition field-value. + * + * @param string $disposition One of "inline" or "attachment" + * @param string $filename A unicode string + * @param string $filenameFallback A string containing only ASCII characters that + * is semantically equivalent to $filename. If the filename is already ASCII, + * it can be omitted, or just copied from $filename + * + * @throws \InvalidArgumentException + * + * @see RFC 6266 + */ + public static function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string + { + if (!\in_array($disposition, [self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE])) { + throw new \InvalidArgumentException(\sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE)); + } + + if ('' === $filenameFallback) { + $filenameFallback = $filename; + } + + // filenameFallback is not ASCII. + if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) { + throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.'); + } + + // percent characters aren't safe in fallback. + if (str_contains($filenameFallback, '%')) { + throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.'); + } + + // path separators aren't allowed in either. + if (str_contains($filename, '/') || str_contains($filename, '\\') || str_contains($filenameFallback, '/') || str_contains($filenameFallback, '\\')) { + throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.'); + } + + $params = ['filename' => $filenameFallback]; + if ($filename !== $filenameFallback) { + $params['filename*'] = "utf-8''".rawurlencode($filename); + } + + return $disposition.'; '.self::toString($params, ';'); + } + + /** + * Like parse_str(), but preserves dots in variable names. + */ + public static function parseQuery(string $query, bool $ignoreBrackets = false, string $separator = '&'): array + { + $q = []; + + foreach (explode($separator, $query) as $v) { + if (false !== $i = strpos($v, "\0")) { + $v = substr($v, 0, $i); + } + + if (false === $i = strpos($v, '=')) { + $k = urldecode($v); + $v = ''; + } else { + $k = urldecode(substr($v, 0, $i)); + $v = substr($v, $i); + } + + if (false !== $i = strpos($k, "\0")) { + $k = substr($k, 0, $i); + } + + $k = ltrim($k, ' '); + + if ($ignoreBrackets) { + $q[$k][] = urldecode(substr($v, 1)); + + continue; + } + + if (false === $i = strpos($k, '[')) { + $q[] = bin2hex($k).$v; + } else { + $q[] = bin2hex(substr($k, 0, $i)).rawurlencode(substr($k, $i)).$v; + } + } + + if ($ignoreBrackets) { + return $q; + } + + parse_str(implode('&', $q), $q); + + $query = []; + + foreach ($q as $k => $v) { + if (false !== $i = strpos($k, '_')) { + $query[substr_replace($k, hex2bin(substr($k, 0, $i)).'[', 0, 1 + $i)] = $v; + } else { + $query[hex2bin($k)] = $v; + } + } + + return $query; + } + + private static function groupParts(array $matches, string $separators, bool $first = true): array + { + $separator = $separators[0]; + $separators = substr($separators, 1) ?: ''; + $i = 0; + + if ('' === $separators && !$first) { + $parts = ['']; + + foreach ($matches as $match) { + if (!$i && isset($match['separator'])) { + $i = 1; + $parts[1] = ''; + } else { + $parts[$i] .= self::unquote($match[0]); + } + } + + return $parts; + } + + $parts = []; + $partMatches = []; + + foreach ($matches as $match) { + if (($match['separator'] ?? null) === $separator) { + ++$i; + } else { + $partMatches[$i][] = $match; + } + } + + foreach ($partMatches as $matches) { + if ('' === $separators && '' !== $unquoted = self::unquote($matches[0][0])) { + $parts[] = $unquoted; + } elseif ($groupedParts = self::groupParts($matches, $separators, false)) { + $parts[] = $groupedParts; + } + } + + return $parts; + } +} diff --git a/plugins/vendor/symfony/http-foundation/InputBag.php b/plugins/vendor/symfony/http-foundation/InputBag.php new file mode 100644 index 00000000..7411d755 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/InputBag.php @@ -0,0 +1,146 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\Exception\BadRequestException; +use Symfony\Component\HttpFoundation\Exception\UnexpectedValueException; + +/** + * InputBag is a container for user input values such as $_GET, $_POST, $_REQUEST, and $_COOKIE. + * + * @author Saif Eddin Gmati + */ +final class InputBag extends ParameterBag +{ + /** + * Returns a scalar input value by name. + * + * @param string|int|float|bool|null $default The default value if the input key does not exist + * + * @throws BadRequestException if the input contains a non-scalar value + */ + public function get(string $key, mixed $default = null): string|int|float|bool|null + { + if (null !== $default && !\is_scalar($default) && !$default instanceof \Stringable) { + throw new \InvalidArgumentException(\sprintf('Expected a scalar value as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($default))); + } + + $value = parent::get($key, $this); + + if (null !== $value && $this !== $value && !\is_scalar($value) && !$value instanceof \Stringable) { + throw new BadRequestException(\sprintf('Input value "%s" contains a non-scalar value.', $key)); + } + + return $this === $value ? $default : $value; + } + + /** + * Replaces the current input values by a new set. + */ + public function replace(array $inputs = []): void + { + $this->parameters = []; + $this->add($inputs); + } + + /** + * Adds input values. + */ + public function add(array $inputs = []): void + { + foreach ($inputs as $input => $value) { + $this->set($input, $value); + } + } + + /** + * Sets an input by name. + * + * @param string|int|float|bool|array|null $value + */ + public function set(string $key, mixed $value): void + { + if (null !== $value && !\is_scalar($value) && !\is_array($value) && !$value instanceof \Stringable) { + throw new \InvalidArgumentException(\sprintf('Expected a scalar, or an array as a 2nd argument to "%s()", "%s" given.', __METHOD__, get_debug_type($value))); + } + + $this->parameters[$key] = $value; + } + + /** + * Returns the parameter value converted to an enum. + * + * @template T of \BackedEnum + * + * @param class-string $class + * @param ?T $default + * + * @return ?T + * + * @psalm-return ($default is null ? T|null : T) + * + * @throws BadRequestException if the input cannot be converted to an enum + */ + public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum + { + try { + return parent::getEnum($key, $class, $default); + } catch (UnexpectedValueException $e) { + throw new BadRequestException($e->getMessage(), $e->getCode(), $e); + } + } + + /** + * Returns the parameter value converted to string. + * + * @throws BadRequestException if the input contains a non-scalar value + */ + public function getString(string $key, string $default = ''): string + { + // Shortcuts the parent method because the validation on scalar is already done in get(). + return (string) $this->get($key, $default); + } + + /** + * @throws BadRequestException if the input value is an array and \FILTER_REQUIRE_ARRAY or \FILTER_FORCE_ARRAY is not set + * @throws BadRequestException if the input value is invalid and \FILTER_NULL_ON_FAILURE is not set + */ + public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed + { + $value = $this->has($key) ? $this->all()[$key] : $default; + + // Always turn $options into an array - this allows filter_var option shortcuts. + if (!\is_array($options) && $options) { + $options = ['flags' => $options]; + } + + if (\is_array($value) && !(($options['flags'] ?? 0) & (\FILTER_REQUIRE_ARRAY | \FILTER_FORCE_ARRAY))) { + throw new BadRequestException(\sprintf('Input value "%s" contains an array, but "FILTER_REQUIRE_ARRAY" or "FILTER_FORCE_ARRAY" flags were not set.', $key)); + } + + if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { + throw new \InvalidArgumentException(\sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); + } + + $options['flags'] ??= 0; + $nullOnFailure = $options['flags'] & \FILTER_NULL_ON_FAILURE; + $options['flags'] |= \FILTER_NULL_ON_FAILURE; + + $value = filter_var($value, $filter, $options); + + if (null !== $value || $nullOnFailure) { + return $value; + } + + throw new BadRequestException(\sprintf('Input value "%s" is invalid and flag "FILTER_NULL_ON_FAILURE" was not set.', $key)); + } +} diff --git a/plugins/vendor/symfony/http-foundation/IpUtils.php b/plugins/vendor/symfony/http-foundation/IpUtils.php new file mode 100644 index 00000000..f67e314a --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/IpUtils.php @@ -0,0 +1,273 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Http utility functions. + * + * @author Fabien Potencier + */ +class IpUtils +{ + public const PRIVATE_SUBNETS = [ + '127.0.0.0/8', // RFC1700 (Loopback) + '10.0.0.0/8', // RFC1918 + '192.168.0.0/16', // RFC1918 + '172.16.0.0/12', // RFC1918 + '169.254.0.0/16', // RFC3927 + '0.0.0.0/8', // RFC5735 + '240.0.0.0/4', // RFC1112 + '::1/128', // Loopback + 'fc00::/7', // Unique Local Address + 'fe80::/10', // Link Local Address + '::ffff:0:0/96', // IPv4 translations + '::/128', // Unspecified address + ]; + + private static array $checkedIps = []; + + /** + * This class should not be instantiated. + */ + private function __construct() + { + } + + /** + * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets. + * + * @param string|array $ips List of IPs or subnets (can be a string if only a single one) + */ + public static function checkIp(string $requestIp, string|array $ips): bool + { + if (!\is_array($ips)) { + $ips = [$ips]; + } + + $method = substr_count($requestIp, ':') > 1 ? 'checkIp6' : 'checkIp4'; + + foreach ($ips as $ip) { + if (self::$method($requestIp, $ip)) { + return true; + } + } + + return false; + } + + /** + * Compares two IPv4 addresses. + * In case a subnet is given, it checks if it contains the request IP. + * + * @param string $ip IPv4 address or subnet in CIDR notation + * + * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet + */ + public static function checkIp4(string $requestIp, string $ip): bool + { + $cacheKey = $requestIp.'-'.$ip.'-v4'; + if (null !== $cacheValue = self::getCacheResult($cacheKey)) { + return $cacheValue; + } + + if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)) { + return self::setCacheResult($cacheKey, false); + } + + if (str_contains($ip, '/')) { + [$address, $netmask] = explode('/', $ip, 2); + + if ('0' === $netmask) { + return self::setCacheResult($cacheKey, false !== filter_var($address, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV4)); + } + + if ($netmask < 0 || $netmask > 32) { + return self::setCacheResult($cacheKey, false); + } + } else { + $address = $ip; + $netmask = 32; + } + + if (false === ip2long($address)) { + return self::setCacheResult($cacheKey, false); + } + + return self::setCacheResult($cacheKey, 0 === substr_compare(\sprintf('%032b', ip2long($requestIp)), \sprintf('%032b', ip2long($address)), 0, $netmask)); + } + + /** + * Compares two IPv6 addresses. + * In case a subnet is given, it checks if it contains the request IP. + * + * @author David Soria Parra + * + * @see https://github.com/dsp/v6tools + * + * @param string $ip IPv6 address or subnet in CIDR notation + * + * @throws \RuntimeException When IPV6 support is not enabled + */ + public static function checkIp6(string $requestIp, string $ip): bool + { + $cacheKey = $requestIp.'-'.$ip.'-v6'; + if (null !== $cacheValue = self::getCacheResult($cacheKey)) { + return $cacheValue; + } + + if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) { + throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".'); + } + + // Check to see if we were given a IP4 $requestIp or $ip by mistake + if (!filter_var($requestIp, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { + return self::setCacheResult($cacheKey, false); + } + + if (str_contains($ip, '/')) { + [$address, $netmask] = explode('/', $ip, 2); + + if (!filter_var($address, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { + return self::setCacheResult($cacheKey, false); + } + + if ('0' === $netmask) { + return (bool) unpack('n*', @inet_pton($address)); + } + + if ($netmask < 1 || $netmask > 128) { + return self::setCacheResult($cacheKey, false); + } + } else { + if (!filter_var($ip, \FILTER_VALIDATE_IP, \FILTER_FLAG_IPV6)) { + return self::setCacheResult($cacheKey, false); + } + + $address = $ip; + $netmask = 128; + } + + $bytesAddr = unpack('n*', @inet_pton($address)); + $bytesTest = unpack('n*', @inet_pton($requestIp)); + + if (!$bytesAddr || !$bytesTest) { + return self::setCacheResult($cacheKey, false); + } + + for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; ++$i) { + $left = $netmask - 16 * ($i - 1); + $left = ($left <= 16) ? $left : 16; + $mask = ~(0xFFFF >> $left) & 0xFFFF; + if (($bytesAddr[$i] & $mask) != ($bytesTest[$i] & $mask)) { + return self::setCacheResult($cacheKey, false); + } + } + + return self::setCacheResult($cacheKey, true); + } + + /** + * Anonymizes an IP/IPv6. + * + * Removes the last bytes of IPv4 and IPv6 addresses (1 byte for IPv4 and 8 bytes for IPv6 by default). + * + * @param int<0, 4> $v4Bytes + * @param int<0, 16> $v6Bytes + */ + public static function anonymize(string $ip/* , int $v4Bytes = 1, int $v6Bytes = 8 */): string + { + $v4Bytes = 1 < \func_num_args() ? func_get_arg(1) : 1; + $v6Bytes = 2 < \func_num_args() ? func_get_arg(2) : 8; + + if ($v4Bytes < 0 || $v6Bytes < 0) { + throw new \InvalidArgumentException('Cannot anonymize less than 0 bytes.'); + } + + if ($v4Bytes > 4 || $v6Bytes > 16) { + throw new \InvalidArgumentException('Cannot anonymize more than 4 bytes for IPv4 and 16 bytes for IPv6.'); + } + + /* + * If the IP contains a % symbol, then it is a local-link address with scoping according to RFC 4007 + * In that case, we only care about the part before the % symbol, as the following functions, can only work with + * the IP address itself. As the scope can leak information (containing interface name), we do not want to + * include it in our anonymized IP data. + */ + if (str_contains($ip, '%')) { + $ip = substr($ip, 0, strpos($ip, '%')); + } + + $wrappedIPv6 = false; + if (str_starts_with($ip, '[') && str_ends_with($ip, ']')) { + $wrappedIPv6 = true; + $ip = substr($ip, 1, -1); + } + + $mappedIpV4MaskGenerator = function (string $mask, int $bytesToAnonymize) { + $mask .= str_repeat('ff', 4 - $bytesToAnonymize); + $mask .= str_repeat('00', $bytesToAnonymize); + + return '::'.implode(':', str_split($mask, 4)); + }; + + $packedAddress = inet_pton($ip); + if (4 === \strlen($packedAddress)) { + $mask = rtrim(str_repeat('255.', 4 - $v4Bytes).str_repeat('0.', $v4Bytes), '.'); + } elseif ($ip === inet_ntop($packedAddress & inet_pton('::ffff:ffff:ffff'))) { + $mask = $mappedIpV4MaskGenerator('ffff', $v4Bytes); + } elseif ($ip === inet_ntop($packedAddress & inet_pton('::ffff:ffff'))) { + $mask = $mappedIpV4MaskGenerator('', $v4Bytes); + } else { + $mask = str_repeat('ff', 16 - $v6Bytes).str_repeat('00', $v6Bytes); + $mask = implode(':', str_split($mask, 4)); + } + $ip = inet_ntop($packedAddress & inet_pton($mask)); + + if ($wrappedIPv6) { + $ip = '['.$ip.']'; + } + + return $ip; + } + + /** + * Checks if an IPv4 or IPv6 address is contained in the list of private IP subnets. + */ + public static function isPrivateIp(string $requestIp): bool + { + return self::checkIp($requestIp, self::PRIVATE_SUBNETS); + } + + private static function getCacheResult(string $cacheKey): ?bool + { + if (isset(self::$checkedIps[$cacheKey])) { + // Move the item last in cache (LRU) + $value = self::$checkedIps[$cacheKey]; + unset(self::$checkedIps[$cacheKey]); + self::$checkedIps[$cacheKey] = $value; + + return self::$checkedIps[$cacheKey]; + } + + return null; + } + + private static function setCacheResult(string $cacheKey, bool $result): bool + { + if (1000 < \count(self::$checkedIps)) { + // stop memory leak if there are many keys + self::$checkedIps = \array_slice(self::$checkedIps, 500, null, true); + } + + return self::$checkedIps[$cacheKey] = $result; + } +} diff --git a/plugins/vendor/symfony/http-foundation/JsonResponse.php b/plugins/vendor/symfony/http-foundation/JsonResponse.php new file mode 100644 index 00000000..187173b6 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/JsonResponse.php @@ -0,0 +1,187 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * Response represents an HTTP response in JSON format. + * + * Note that this class does not force the returned JSON content to be an + * object. It is however recommended that you do return an object as it + * protects yourself against XSSI and JSON-JavaScript Hijacking. + * + * @see https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/AJAX_Security_Cheat_Sheet.md#always-return-json-with-an-object-on-the-outside + * + * @author Igor Wiedler + */ +class JsonResponse extends Response +{ + protected mixed $data; + protected ?string $callback = null; + + // Encode <, >, ', &, and " characters in the JSON, making it also safe to be embedded into HTML. + // 15 === JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT + public const DEFAULT_ENCODING_OPTIONS = 15; + + protected int $encodingOptions = self::DEFAULT_ENCODING_OPTIONS; + + /** + * @param bool $json If the data is already a JSON string + */ + public function __construct(mixed $data = null, int $status = 200, array $headers = [], bool $json = false) + { + parent::__construct('', $status, $headers); + + if ($json && !\is_string($data) && !is_numeric($data) && !$data instanceof \Stringable) { + throw new \TypeError(\sprintf('"%s": If $json is set to true, argument $data must be a string or object implementing __toString(), "%s" given.', __METHOD__, get_debug_type($data))); + } + + $data ??= new \ArrayObject(); + + $json ? $this->setJson($data) : $this->setData($data); + } + + /** + * Factory method for chainability. + * + * Example: + * + * return JsonResponse::fromJsonString('{"key": "value"}') + * ->setSharedMaxAge(300); + * + * @param string $data The JSON response string + * @param int $status The response status code (200 "OK" by default) + * @param array $headers An array of response headers + */ + public static function fromJsonString(string $data, int $status = 200, array $headers = []): static + { + return new static($data, $status, $headers, true); + } + + /** + * Sets the JSONP callback. + * + * @param string|null $callback The JSONP callback or null to use none + * + * @return $this + * + * @throws \InvalidArgumentException When the callback name is not valid + */ + public function setCallback(?string $callback): static + { + if (null !== $callback) { + // partially taken from https://geekality.net/2011/08/03/valid-javascript-identifier/ + // partially taken from https://github.com/willdurand/JsonpCallbackValidator + // JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details. + // (c) William Durand + $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u'; + $reserved = [ + 'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', + 'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super', 'const', 'export', + 'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false', + ]; + $parts = explode('.', $callback); + foreach ($parts as $part) { + if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) { + throw new \InvalidArgumentException('The callback name is not valid.'); + } + } + } + + $this->callback = $callback; + + return $this->update(); + } + + /** + * Sets a raw string containing a JSON document to be sent. + * + * @return $this + */ + public function setJson(string $json): static + { + $this->data = $json; + + return $this->update(); + } + + /** + * Sets the data to be sent as JSON. + * + * @return $this + * + * @throws \InvalidArgumentException + */ + public function setData(mixed $data = []): static + { + try { + $data = json_encode($data, $this->encodingOptions); + } catch (\Exception $e) { + if ('Exception' === $e::class && str_starts_with($e->getMessage(), 'Failed calling ')) { + throw $e->getPrevious() ?: $e; + } + throw $e; + } + + if (\JSON_THROW_ON_ERROR & $this->encodingOptions) { + return $this->setJson($data); + } + + if (\JSON_ERROR_NONE !== json_last_error()) { + throw new \InvalidArgumentException(json_last_error_msg()); + } + + return $this->setJson($data); + } + + /** + * Returns options used while encoding data to JSON. + */ + public function getEncodingOptions(): int + { + return $this->encodingOptions; + } + + /** + * Sets options used while encoding data to JSON. + * + * @return $this + */ + public function setEncodingOptions(int $encodingOptions): static + { + $this->encodingOptions = $encodingOptions; + + return $this->setData(json_decode($this->data)); + } + + /** + * Updates the content and headers according to the JSON data and callback. + * + * @return $this + */ + protected function update(): static + { + if (null !== $this->callback) { + // Not using application/javascript for compatibility reasons with older browsers. + $this->headers->set('Content-Type', 'text/javascript'); + + return $this->setContent(\sprintf('/**/%s(%s);', $this->callback, $this->data)); + } + + // Only set the header when there is none or when it equals 'text/javascript' (from a previous update with callback) + // in order to not overwrite a custom definition. + if (!$this->headers->has('Content-Type') || 'text/javascript' === $this->headers->get('Content-Type')) { + $this->headers->set('Content-Type', 'application/json'); + } + + return $this->setContent($this->data); + } +} diff --git a/plugins/vendor/symfony/http-foundation/LICENSE b/plugins/vendor/symfony/http-foundation/LICENSE new file mode 100644 index 00000000..0138f8f0 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/http-foundation/ParameterBag.php b/plugins/vendor/symfony/http-foundation/ParameterBag.php new file mode 100644 index 00000000..f37d7b3e --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/ParameterBag.php @@ -0,0 +1,258 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\Exception\BadRequestException; +use Symfony\Component\HttpFoundation\Exception\UnexpectedValueException; + +/** + * ParameterBag is a container for key/value pairs. + * + * @author Fabien Potencier + * + * @implements \IteratorAggregate + */ +class ParameterBag implements \IteratorAggregate, \Countable +{ + public function __construct( + protected array $parameters = [], + ) { + } + + /** + * Returns the parameters. + * + * @param string|null $key The name of the parameter to return or null to get them all + * + * @throws BadRequestException if the value is not an array + */ + public function all(?string $key = null): array + { + if (null === $key) { + return $this->parameters; + } + + if (!\is_array($value = $this->parameters[$key] ?? [])) { + throw new BadRequestException(\sprintf('Unexpected value for parameter "%s": expecting "array", got "%s".', $key, get_debug_type($value))); + } + + return $value; + } + + /** + * Returns the parameter keys. + */ + public function keys(): array + { + return array_keys($this->parameters); + } + + /** + * Replaces the current parameters by a new set. + */ + public function replace(array $parameters = []): void + { + $this->parameters = $parameters; + } + + /** + * Adds parameters. + */ + public function add(array $parameters = []): void + { + $this->parameters = array_replace($this->parameters, $parameters); + } + + public function get(string $key, mixed $default = null): mixed + { + return \array_key_exists($key, $this->parameters) ? $this->parameters[$key] : $default; + } + + public function set(string $key, mixed $value): void + { + $this->parameters[$key] = $value; + } + + /** + * Returns true if the parameter is defined. + */ + public function has(string $key): bool + { + return \array_key_exists($key, $this->parameters); + } + + /** + * Removes a parameter. + */ + public function remove(string $key): void + { + unset($this->parameters[$key]); + } + + /** + * Returns the alphabetic characters of the parameter value. + * + * @throws UnexpectedValueException if the value cannot be converted to string + */ + public function getAlpha(string $key, string $default = ''): string + { + return preg_replace('/[^[:alpha:]]/', '', $this->getString($key, $default)); + } + + /** + * Returns the alphabetic characters and digits of the parameter value. + * + * @throws UnexpectedValueException if the value cannot be converted to string + */ + public function getAlnum(string $key, string $default = ''): string + { + return preg_replace('/[^[:alnum:]]/', '', $this->getString($key, $default)); + } + + /** + * Returns the digits of the parameter value. + * + * @throws UnexpectedValueException if the value cannot be converted to string + */ + public function getDigits(string $key, string $default = ''): string + { + return preg_replace('/[^[:digit:]]/', '', $this->getString($key, $default)); + } + + /** + * Returns the parameter as string. + * + * @throws UnexpectedValueException if the value cannot be converted to string + */ + public function getString(string $key, string $default = ''): string + { + $value = $this->get($key, $default); + if (!\is_scalar($value) && !$value instanceof \Stringable) { + throw new UnexpectedValueException(\sprintf('Parameter value "%s" cannot be converted to "string".', $key)); + } + + return (string) $value; + } + + /** + * Returns the parameter value converted to integer. + * + * @throws UnexpectedValueException if the value cannot be converted to integer + */ + public function getInt(string $key, int $default = 0): int + { + return $this->filter($key, $default, \FILTER_VALIDATE_INT, ['flags' => \FILTER_REQUIRE_SCALAR]); + } + + /** + * Returns the parameter value converted to boolean. + * + * @throws UnexpectedValueException if the value cannot be converted to a boolean + */ + public function getBoolean(string $key, bool $default = false): bool + { + return $this->filter($key, $default, \FILTER_VALIDATE_BOOL, ['flags' => \FILTER_REQUIRE_SCALAR]); + } + + /** + * Returns the parameter value converted to an enum. + * + * @template T of \BackedEnum + * + * @param class-string $class + * @param ?T $default + * + * @return ?T + * + * @psalm-return ($default is null ? T|null : T) + * + * @throws UnexpectedValueException if the parameter value cannot be converted to an enum + */ + public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum + { + $value = $this->get($key); + + if (null === $value) { + return $default; + } + + try { + return $class::from($value); + } catch (\ValueError|\TypeError $e) { + throw new UnexpectedValueException(\sprintf('Parameter "%s" cannot be converted to enum: %s.', $key, $e->getMessage()), $e->getCode(), $e); + } + } + + /** + * Filter key. + * + * @param int $filter FILTER_* constant + * @param int|array{flags?: int, options?: array} $options Flags from FILTER_* constants + * + * @see https://php.net/filter-var + * + * @throws UnexpectedValueException if the parameter value is a non-stringable object + * @throws UnexpectedValueException if the parameter value is invalid and \FILTER_NULL_ON_FAILURE is not set + */ + public function filter(string $key, mixed $default = null, int $filter = \FILTER_DEFAULT, mixed $options = []): mixed + { + $value = $this->get($key, $default); + + // Always turn $options into an array - this allows filter_var option shortcuts. + if (!\is_array($options) && $options) { + $options = ['flags' => $options]; + } + + // Add a convenience check for arrays. + if (\is_array($value) && !isset($options['flags'])) { + $options['flags'] = \FILTER_REQUIRE_ARRAY; + } + + if (\is_object($value) && !$value instanceof \Stringable) { + throw new UnexpectedValueException(\sprintf('Parameter value "%s" cannot be filtered.', $key)); + } + + if ((\FILTER_CALLBACK & $filter) && !(($options['options'] ?? null) instanceof \Closure)) { + throw new \InvalidArgumentException(\sprintf('A Closure must be passed to "%s()" when FILTER_CALLBACK is used, "%s" given.', __METHOD__, get_debug_type($options['options'] ?? null))); + } + + $options['flags'] ??= 0; + $nullOnFailure = $options['flags'] & \FILTER_NULL_ON_FAILURE; + $options['flags'] |= \FILTER_NULL_ON_FAILURE; + + $value = filter_var($value, $filter, $options); + + if (null !== $value || $nullOnFailure) { + return $value; + } + + throw new \UnexpectedValueException(\sprintf('Parameter value "%s" is invalid and flag "FILTER_NULL_ON_FAILURE" was not set.', $key)); + } + + /** + * Returns an iterator for parameters. + * + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator($this->parameters); + } + + /** + * Returns the number of parameters. + */ + public function count(): int + { + return \count($this->parameters); + } +} diff --git a/plugins/vendor/symfony/http-foundation/README.md b/plugins/vendor/symfony/http-foundation/README.md new file mode 100644 index 00000000..5cf90074 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/README.md @@ -0,0 +1,14 @@ +HttpFoundation Component +======================== + +The HttpFoundation component defines an object-oriented layer for the HTTP +specification. + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/http_foundation.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/plugins/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.php b/plugins/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.php new file mode 100644 index 00000000..550090f9 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RateLimiter/AbstractRequestRateLimiter.php @@ -0,0 +1,81 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RateLimiter; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\RateLimiter\LimiterInterface; +use Symfony\Component\RateLimiter\Policy\NoLimiter; +use Symfony\Component\RateLimiter\RateLimit; + +/** + * An implementation of PeekableRequestRateLimiterInterface that + * fits most use-cases. + * + * @author Wouter de Jong + */ +abstract class AbstractRequestRateLimiter implements PeekableRequestRateLimiterInterface +{ + public function consume(Request $request): RateLimit + { + return $this->doConsume($request, 1); + } + + public function peek(Request $request): RateLimit + { + return $this->doConsume($request, 0); + } + + private function doConsume(Request $request, int $tokens): RateLimit + { + $limiters = $this->getLimiters($request); + if (0 === \count($limiters)) { + $limiters = [new NoLimiter()]; + } + + $minimalRateLimit = null; + foreach ($limiters as $limiter) { + $rateLimit = $limiter->consume($tokens); + + $minimalRateLimit = $minimalRateLimit ? self::getMinimalRateLimit($minimalRateLimit, $rateLimit) : $rateLimit; + } + + return $minimalRateLimit; + } + + public function reset(Request $request): void + { + foreach ($this->getLimiters($request) as $limiter) { + $limiter->reset(); + } + } + + /** + * @return LimiterInterface[] a set of limiters using keys extracted from the request + */ + abstract protected function getLimiters(Request $request): array; + + private static function getMinimalRateLimit(RateLimit $first, RateLimit $second): RateLimit + { + if ($first->isAccepted() !== $second->isAccepted()) { + return $first->isAccepted() ? $second : $first; + } + + $firstRemainingTokens = $first->getRemainingTokens(); + $secondRemainingTokens = $second->getRemainingTokens(); + + if ($firstRemainingTokens === $secondRemainingTokens) { + return $first->getRetryAfter() < $second->getRetryAfter() ? $second : $first; + } + + return $firstRemainingTokens > $secondRemainingTokens ? $second : $first; + } +} diff --git a/plugins/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php b/plugins/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php new file mode 100644 index 00000000..63471af2 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RateLimiter/PeekableRequestRateLimiterInterface.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RateLimiter; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\RateLimiter\RateLimit; + +/** + * A request limiter which allows peeking ahead. + * + * This is valuable to reduce the cache backend load in scenarios + * like a login when we only want to consume a token on login failure, + * and where the majority of requests will be successful and thus not + * need to consume a token. + * + * This way we can peek ahead before allowing the request through, and + * only consume if the request failed (1 backend op). This is compared + * to always consuming and then resetting the limit if the request + * is successful (2 backend ops). + * + * @author Jordi Boggiano + */ +interface PeekableRequestRateLimiterInterface extends RequestRateLimiterInterface +{ + public function peek(Request $request): RateLimit; +} diff --git a/plugins/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php b/plugins/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php new file mode 100644 index 00000000..4c87a40a --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RateLimiter/RequestRateLimiterInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RateLimiter; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\RateLimiter\RateLimit; + +/** + * A special type of limiter that deals with requests. + * + * This allows to limit on different types of information + * from the requests. + * + * @author Wouter de Jong + */ +interface RequestRateLimiterInterface +{ + public function consume(Request $request): RateLimit; + + public function reset(Request $request): void; +} diff --git a/plugins/vendor/symfony/http-foundation/RedirectResponse.php b/plugins/vendor/symfony/http-foundation/RedirectResponse.php new file mode 100644 index 00000000..b1b1cf3c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RedirectResponse.php @@ -0,0 +1,92 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * RedirectResponse represents an HTTP response doing a redirect. + * + * @author Fabien Potencier + */ +class RedirectResponse extends Response +{ + protected string $targetUrl; + + /** + * Creates a redirect response so that it conforms to the rules defined for a redirect status code. + * + * @param string $url The URL to redirect to. The URL should be a full URL, with schema etc., + * but practically every browser redirects on paths only as well + * @param int $status The HTTP status code (302 "Found" by default) + * @param array $headers The headers (Location is always set to the given URL) + * + * @throws \InvalidArgumentException + * + * @see https://tools.ietf.org/html/rfc2616#section-10.3 + */ + public function __construct(string $url, int $status = 302, array $headers = []) + { + parent::__construct('', $status, $headers); + + $this->setTargetUrl($url); + + if (!$this->isRedirect()) { + throw new \InvalidArgumentException(\sprintf('The HTTP status code is not a redirect ("%s" given).', $status)); + } + + if (301 == $status && !\array_key_exists('cache-control', array_change_key_case($headers, \CASE_LOWER))) { + $this->headers->remove('cache-control'); + } + } + + /** + * Returns the target URL. + */ + public function getTargetUrl(): string + { + return $this->targetUrl; + } + + /** + * Sets the redirect target of this response. + * + * @return $this + * + * @throws \InvalidArgumentException + */ + public function setTargetUrl(string $url): static + { + if ('' === $url) { + throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); + } + + $this->targetUrl = $url; + + $this->setContent( + \sprintf(' + + + + + + Redirecting to %1$s + + + Redirecting to %1$s. + +', htmlspecialchars($url, \ENT_QUOTES, 'UTF-8'))); + + $this->headers->set('Location', $url); + $this->headers->set('Content-Type', 'text/html; charset=utf-8'); + + return $this; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Request.php b/plugins/vendor/symfony/http-foundation/Request.php new file mode 100644 index 00000000..dba930a2 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Request.php @@ -0,0 +1,2104 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\Exception\BadRequestException; +use Symfony\Component\HttpFoundation\Exception\ConflictingHeadersException; +use Symfony\Component\HttpFoundation\Exception\JsonException; +use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; +use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; +use Symfony\Component\HttpFoundation\Session\SessionInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(AcceptHeader::class); +class_exists(FileBag::class); +class_exists(HeaderBag::class); +class_exists(HeaderUtils::class); +class_exists(InputBag::class); +class_exists(ParameterBag::class); +class_exists(ServerBag::class); + +/** + * Request represents an HTTP request. + * + * The methods dealing with URL accept / return a raw path (% encoded): + * * getBasePath + * * getBaseUrl + * * getPathInfo + * * getRequestUri + * * getUri + * * getUriForPath + * + * @author Fabien Potencier + */ +class Request +{ + public const HEADER_FORWARDED = 0b000001; // When using RFC 7239 + public const HEADER_X_FORWARDED_FOR = 0b000010; + public const HEADER_X_FORWARDED_HOST = 0b000100; + public const HEADER_X_FORWARDED_PROTO = 0b001000; + public const HEADER_X_FORWARDED_PORT = 0b010000; + public const HEADER_X_FORWARDED_PREFIX = 0b100000; + + public const HEADER_X_FORWARDED_AWS_ELB = 0b0011010; // AWS ELB doesn't send X-Forwarded-Host + public const HEADER_X_FORWARDED_TRAEFIK = 0b0111110; // All "X-Forwarded-*" headers sent by Traefik reverse proxy + + public const METHOD_HEAD = 'HEAD'; + public const METHOD_GET = 'GET'; + public const METHOD_POST = 'POST'; + public const METHOD_PUT = 'PUT'; + public const METHOD_PATCH = 'PATCH'; + public const METHOD_DELETE = 'DELETE'; + public const METHOD_PURGE = 'PURGE'; + public const METHOD_OPTIONS = 'OPTIONS'; + public const METHOD_TRACE = 'TRACE'; + public const METHOD_CONNECT = 'CONNECT'; + + /** + * @var string[] + */ + protected static array $trustedProxies = []; + + /** + * @var string[] + */ + protected static array $trustedHostPatterns = []; + + /** + * @var string[] + */ + protected static array $trustedHosts = []; + + protected static bool $httpMethodParameterOverride = false; + + /** + * Custom parameters. + */ + public ParameterBag $attributes; + + /** + * Request body parameters ($_POST). + * + * @see getPayload() for portability between content types + */ + public InputBag $request; + + /** + * Query string parameters ($_GET). + */ + public InputBag $query; + + /** + * Server and execution environment parameters ($_SERVER). + */ + public ServerBag $server; + + /** + * Uploaded files ($_FILES). + */ + public FileBag $files; + + /** + * Cookies ($_COOKIE). + */ + public InputBag $cookies; + + /** + * Headers (taken from the $_SERVER). + */ + public HeaderBag $headers; + + /** + * @var string|resource|false|null + */ + protected $content; + + /** + * @var string[]|null + */ + protected ?array $languages = null; + + /** + * @var string[]|null + */ + protected ?array $charsets = null; + + /** + * @var string[]|null + */ + protected ?array $encodings = null; + + /** + * @var string[]|null + */ + protected ?array $acceptableContentTypes = null; + + protected ?string $pathInfo = null; + protected ?string $requestUri = null; + protected ?string $baseUrl = null; + protected ?string $basePath = null; + protected ?string $method = null; + protected ?string $format = null; + protected SessionInterface|\Closure|null $session = null; + protected ?string $locale = null; + protected string $defaultLocale = 'en'; + + /** + * @var array|null + */ + protected static ?array $formats = null; + + protected static ?\Closure $requestFactory = null; + + private ?string $preferredFormat = null; + + private bool $isHostValid = true; + private bool $isForwardedValid = true; + private bool $isSafeContentPreferred; + + private array $trustedValuesCache = []; + + private static int $trustedHeaderSet = -1; + + private const FORWARDED_PARAMS = [ + self::HEADER_X_FORWARDED_FOR => 'for', + self::HEADER_X_FORWARDED_HOST => 'host', + self::HEADER_X_FORWARDED_PROTO => 'proto', + self::HEADER_X_FORWARDED_PORT => 'host', + ]; + + /** + * Names for headers that can be trusted when + * using trusted proxies. + * + * The FORWARDED header is the standard as of rfc7239. + * + * The other headers are non-standard, but widely used + * by popular reverse proxies (like Apache mod_proxy or Amazon EC2). + */ + private const TRUSTED_HEADERS = [ + self::HEADER_FORWARDED => 'FORWARDED', + self::HEADER_X_FORWARDED_FOR => 'X_FORWARDED_FOR', + self::HEADER_X_FORWARDED_HOST => 'X_FORWARDED_HOST', + self::HEADER_X_FORWARDED_PROTO => 'X_FORWARDED_PROTO', + self::HEADER_X_FORWARDED_PORT => 'X_FORWARDED_PORT', + self::HEADER_X_FORWARDED_PREFIX => 'X_FORWARDED_PREFIX', + ]; + + private bool $isIisRewrite = false; + + /** + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource|null $content The raw body data + */ + public function __construct(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null) + { + $this->initialize($query, $request, $attributes, $cookies, $files, $server, $content); + } + + /** + * Sets the parameters for this request. + * + * This method also re-initializes all properties. + * + * @param array $query The GET parameters + * @param array $request The POST parameters + * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies The COOKIE parameters + * @param array $files The FILES parameters + * @param array $server The SERVER parameters + * @param string|resource|null $content The raw body data + */ + public function initialize(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): void + { + $this->request = new InputBag($request); + $this->query = new InputBag($query); + $this->attributes = new ParameterBag($attributes); + $this->cookies = new InputBag($cookies); + $this->files = new FileBag($files); + $this->server = new ServerBag($server); + $this->headers = new HeaderBag($this->server->getHeaders()); + + $this->content = $content; + $this->languages = null; + $this->charsets = null; + $this->encodings = null; + $this->acceptableContentTypes = null; + $this->pathInfo = null; + $this->requestUri = null; + $this->baseUrl = null; + $this->basePath = null; + $this->method = null; + $this->format = null; + } + + /** + * Creates a new request with values from PHP's super globals. + */ + public static function createFromGlobals(): static + { + $request = self::createRequestFromFactory($_GET, $_POST, [], $_COOKIE, $_FILES, $_SERVER); + + if (str_starts_with($request->headers->get('CONTENT_TYPE', ''), 'application/x-www-form-urlencoded') + && \in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), ['PUT', 'DELETE', 'PATCH'], true) + ) { + parse_str($request->getContent(), $data); + $request->request = new InputBag($data); + } + + return $request; + } + + /** + * Creates a Request based on a given URI and configuration. + * + * The information contained in the URI always take precedence + * over the other information (server and parameters). + * + * @param string $uri The URI + * @param string $method The HTTP method + * @param array $parameters The query (GET) or request (POST) parameters + * @param array $cookies The request cookies ($_COOKIE) + * @param array $files The request files ($_FILES) + * @param array $server The server parameters ($_SERVER) + * @param string|resource|null $content The raw body data + * + * @throws BadRequestException When the URI is invalid + */ + public static function create(string $uri, string $method = 'GET', array $parameters = [], array $cookies = [], array $files = [], array $server = [], $content = null): static + { + $server = array_replace([ + 'SERVER_NAME' => 'localhost', + 'SERVER_PORT' => 80, + 'HTTP_HOST' => 'localhost', + 'HTTP_USER_AGENT' => 'Symfony', + 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', + 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', + 'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', + 'REMOTE_ADDR' => '127.0.0.1', + 'SCRIPT_NAME' => '', + 'SCRIPT_FILENAME' => '', + 'SERVER_PROTOCOL' => 'HTTP/1.1', + 'REQUEST_TIME' => time(), + 'REQUEST_TIME_FLOAT' => microtime(true), + ], $server); + + $server['PATH_INFO'] = ''; + $server['REQUEST_METHOD'] = strtoupper($method); + + if (false === $components = parse_url(\strlen($uri) !== strcspn($uri, '?#') ? $uri : $uri.'#')) { + throw new BadRequestException('Invalid URI.'); + } + + if (false !== ($i = strpos($uri, '\\')) && $i < strcspn($uri, '?#')) { + throw new BadRequestException('Invalid URI: A URI cannot contain a backslash.'); + } + if (\strlen($uri) !== strcspn($uri, "\r\n\t")) { + throw new BadRequestException('Invalid URI: A URI cannot contain CR/LF/TAB characters.'); + } + if ('' !== $uri && (\ord($uri[0]) <= 32 || \ord($uri[-1]) <= 32)) { + throw new BadRequestException('Invalid URI: A URI must not start nor end with ASCII control characters or spaces.'); + } + + if (isset($components['host'])) { + $server['SERVER_NAME'] = $components['host']; + $server['HTTP_HOST'] = $components['host']; + } + + if (isset($components['scheme'])) { + if ('https' === $components['scheme']) { + $server['HTTPS'] = 'on'; + $server['SERVER_PORT'] = 443; + } else { + unset($server['HTTPS']); + $server['SERVER_PORT'] = 80; + } + } + + if (isset($components['port'])) { + $server['SERVER_PORT'] = $components['port']; + $server['HTTP_HOST'] .= ':'.$components['port']; + } + + if (isset($components['user'])) { + $server['PHP_AUTH_USER'] = $components['user']; + } + + if (isset($components['pass'])) { + $server['PHP_AUTH_PW'] = $components['pass']; + } + + if (!isset($components['path'])) { + $components['path'] = '/'; + } + + switch (strtoupper($method)) { + case 'POST': + case 'PUT': + case 'DELETE': + if (!isset($server['CONTENT_TYPE'])) { + $server['CONTENT_TYPE'] = 'application/x-www-form-urlencoded'; + } + // no break + case 'PATCH': + $request = $parameters; + $query = []; + break; + default: + $request = []; + $query = $parameters; + break; + } + + $queryString = ''; + if (isset($components['query'])) { + parse_str(html_entity_decode($components['query']), $qs); + + if ($query) { + $query = array_replace($qs, $query); + $queryString = http_build_query($query, '', '&'); + } else { + $query = $qs; + $queryString = $components['query']; + } + } elseif ($query) { + $queryString = http_build_query($query, '', '&'); + } + + $server['REQUEST_URI'] = $components['path'].('' !== $queryString ? '?'.$queryString : ''); + $server['QUERY_STRING'] = $queryString; + + return self::createRequestFromFactory($query, $request, [], $cookies, $files, $server, $content); + } + + /** + * Sets a callable able to create a Request instance. + * + * This is mainly useful when you need to override the Request class + * to keep BC with an existing system. It should not be used for any + * other purpose. + */ + public static function setFactory(?callable $callable): void + { + self::$requestFactory = null === $callable ? null : $callable(...); + } + + /** + * Clones a request and overrides some of its parameters. + * + * @param array|null $query The GET parameters + * @param array|null $request The POST parameters + * @param array|null $attributes The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array|null $cookies The COOKIE parameters + * @param array|null $files The FILES parameters + * @param array|null $server The SERVER parameters + */ + public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null): static + { + $dup = clone $this; + if (null !== $query) { + $dup->query = new InputBag($query); + } + if (null !== $request) { + $dup->request = new InputBag($request); + } + if (null !== $attributes) { + $dup->attributes = new ParameterBag($attributes); + } + if (null !== $cookies) { + $dup->cookies = new InputBag($cookies); + } + if (null !== $files) { + $dup->files = new FileBag($files); + } + if (null !== $server) { + $dup->server = new ServerBag($server); + $dup->headers = new HeaderBag($dup->server->getHeaders()); + } + $dup->languages = null; + $dup->charsets = null; + $dup->encodings = null; + $dup->acceptableContentTypes = null; + $dup->pathInfo = null; + $dup->requestUri = null; + $dup->baseUrl = null; + $dup->basePath = null; + $dup->method = null; + $dup->format = null; + + if (!$dup->get('_format') && $this->get('_format')) { + $dup->attributes->set('_format', $this->get('_format')); + } + + if (!$dup->getRequestFormat(null)) { + $dup->setRequestFormat($this->getRequestFormat(null)); + } + + return $dup; + } + + /** + * Clones the current request. + * + * Note that the session is not cloned as duplicated requests + * are most of the time sub-requests of the main one. + */ + public function __clone() + { + $this->query = clone $this->query; + $this->request = clone $this->request; + $this->attributes = clone $this->attributes; + $this->cookies = clone $this->cookies; + $this->files = clone $this->files; + $this->server = clone $this->server; + $this->headers = clone $this->headers; + } + + public function __toString(): string + { + $content = $this->getContent(); + + $cookieHeader = ''; + $cookies = []; + + foreach ($this->cookies as $k => $v) { + $cookies[] = \is_array($v) ? http_build_query([$k => $v], '', '; ', \PHP_QUERY_RFC3986) : "$k=$v"; + } + + if ($cookies) { + $cookieHeader = 'Cookie: '.implode('; ', $cookies)."\r\n"; + } + + return + \sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n". + $this->headers. + $cookieHeader."\r\n". + $content; + } + + /** + * Overrides the PHP global variables according to this request instance. + * + * It overrides $_GET, $_POST, $_REQUEST, $_SERVER, $_COOKIE. + * $_FILES is never overridden, see rfc1867 + */ + public function overrideGlobals(): void + { + $this->server->set('QUERY_STRING', static::normalizeQueryString(http_build_query($this->query->all(), '', '&'))); + + $_GET = $this->query->all(); + $_POST = $this->request->all(); + $_SERVER = $this->server->all(); + $_COOKIE = $this->cookies->all(); + + foreach ($this->headers->all() as $key => $value) { + $key = strtoupper(str_replace('-', '_', $key)); + if (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true)) { + $_SERVER[$key] = implode(', ', $value); + } else { + $_SERVER['HTTP_'.$key] = implode(', ', $value); + } + } + + $request = ['g' => $_GET, 'p' => $_POST, 'c' => $_COOKIE]; + + $requestOrder = \ini_get('request_order') ?: \ini_get('variables_order'); + $requestOrder = preg_replace('#[^cgp]#', '', strtolower($requestOrder)) ?: 'gp'; + + $_REQUEST = [[]]; + + foreach (str_split($requestOrder) as $order) { + $_REQUEST[] = $request[$order]; + } + + $_REQUEST = array_merge(...$_REQUEST); + } + + /** + * Sets a list of trusted proxies. + * + * You should only list the reverse proxies that you manage directly. + * + * @param array $proxies A list of trusted proxies, the string 'REMOTE_ADDR' will be replaced with $_SERVER['REMOTE_ADDR'] and 'PRIVATE_SUBNETS' by IpUtils::PRIVATE_SUBNETS + * @param int-mask-of $trustedHeaderSet A bit field to set which headers to trust from your proxies + */ + public static function setTrustedProxies(array $proxies, int $trustedHeaderSet): void + { + if (false !== $i = array_search('REMOTE_ADDR', $proxies, true)) { + if (isset($_SERVER['REMOTE_ADDR'])) { + $proxies[$i] = $_SERVER['REMOTE_ADDR']; + } else { + unset($proxies[$i]); + $proxies = array_values($proxies); + } + } + + if (false !== ($i = array_search('PRIVATE_SUBNETS', $proxies, true)) || false !== ($i = array_search('private_ranges', $proxies, true))) { + unset($proxies[$i]); + $proxies = array_merge($proxies, IpUtils::PRIVATE_SUBNETS); + } + + self::$trustedProxies = $proxies; + self::$trustedHeaderSet = $trustedHeaderSet; + } + + /** + * Gets the list of trusted proxies. + * + * @return string[] + */ + public static function getTrustedProxies(): array + { + return self::$trustedProxies; + } + + /** + * Gets the set of trusted headers from trusted proxies. + * + * @return int A bit field of Request::HEADER_* that defines which headers are trusted from your proxies + */ + public static function getTrustedHeaderSet(): int + { + return self::$trustedHeaderSet; + } + + /** + * Sets a list of trusted host patterns. + * + * You should only list the hosts you manage using regexs. + * + * @param array $hostPatterns A list of trusted host patterns + */ + public static function setTrustedHosts(array $hostPatterns): void + { + self::$trustedHostPatterns = array_map(fn ($hostPattern) => \sprintf('{%s}i', $hostPattern), $hostPatterns); + // we need to reset trusted hosts on trusted host patterns change + self::$trustedHosts = []; + } + + /** + * Gets the list of trusted host patterns. + * + * @return string[] + */ + public static function getTrustedHosts(): array + { + return self::$trustedHostPatterns; + } + + /** + * Normalizes a query string. + * + * It builds a normalized query string, where keys/value pairs are alphabetized, + * have consistent escaping and unneeded delimiters are removed. + */ + public static function normalizeQueryString(?string $qs): string + { + if ('' === ($qs ?? '')) { + return ''; + } + + $qs = HeaderUtils::parseQuery($qs); + ksort($qs); + + return http_build_query($qs, '', '&', \PHP_QUERY_RFC3986); + } + + /** + * Enables support for the _method request parameter to determine the intended HTTP method. + * + * Be warned that enabling this feature might lead to CSRF issues in your code. + * Check that you are using CSRF tokens when required. + * If the HTTP method parameter override is enabled, an html-form with method "POST" can be altered + * and used to send a "PUT" or "DELETE" request via the _method request parameter. + * If these methods are not protected against CSRF, this presents a possible vulnerability. + * + * The HTTP method can only be overridden when the real HTTP method is POST. + */ + public static function enableHttpMethodParameterOverride(): void + { + self::$httpMethodParameterOverride = true; + } + + /** + * Checks whether support for the _method request parameter is enabled. + */ + public static function getHttpMethodParameterOverride(): bool + { + return self::$httpMethodParameterOverride; + } + + /** + * Gets a "parameter" value from any bag. + * + * This method is mainly useful for libraries that want to provide some flexibility. If you don't need the + * flexibility in controllers, it is better to explicitly get request parameters from the appropriate + * public property instead (attributes, query, request). + * + * Order of precedence: PATH (routing placeholders or custom attributes), GET, POST + * + * @internal use explicit input sources instead + */ + public function get(string $key, mixed $default = null): mixed + { + if ($this !== $result = $this->attributes->get($key, $this)) { + return $result; + } + + if ($this->query->has($key)) { + return $this->query->all()[$key]; + } + + if ($this->request->has($key)) { + return $this->request->all()[$key]; + } + + return $default; + } + + /** + * Gets the Session. + * + * @throws SessionNotFoundException When session is not set properly + */ + public function getSession(): SessionInterface + { + $session = $this->session; + if (!$session instanceof SessionInterface && null !== $session) { + $this->setSession($session = $session()); + } + + if (null === $session) { + throw new SessionNotFoundException('Session has not been set.'); + } + + return $session; + } + + /** + * Whether the request contains a Session which was started in one of the + * previous requests. + */ + public function hasPreviousSession(): bool + { + // the check for $this->session avoids malicious users trying to fake a session cookie with proper name + return $this->hasSession() && $this->cookies->has($this->getSession()->getName()); + } + + /** + * Whether the request contains a Session object. + * + * This method does not give any information about the state of the session object, + * like whether the session is started or not. It is just a way to check if this Request + * is associated with a Session instance. + * + * @param bool $skipIfUninitialized When true, ignores factories injected by `setSessionFactory` + */ + public function hasSession(bool $skipIfUninitialized = false): bool + { + return null !== $this->session && (!$skipIfUninitialized || $this->session instanceof SessionInterface); + } + + public function setSession(SessionInterface $session): void + { + $this->session = $session; + } + + /** + * @internal + * + * @param callable(): SessionInterface $factory + */ + public function setSessionFactory(callable $factory): void + { + $this->session = $factory(...); + } + + /** + * Returns the client IP addresses. + * + * In the returned array the most trusted IP address is first, and the + * least trusted one last. The "real" client IP address is the last one, + * but this is also the least trusted one. Trusted proxies are stripped. + * + * Use this method carefully; you should use getClientIp() instead. + * + * @see getClientIp() + */ + public function getClientIps(): array + { + $ip = $this->server->get('REMOTE_ADDR'); + + if (!$this->isFromTrustedProxy()) { + return [$ip]; + } + + return $this->getTrustedValues(self::HEADER_X_FORWARDED_FOR, $ip) ?: [$ip]; + } + + /** + * Returns the client IP address. + * + * This method can read the client IP address from the "X-Forwarded-For" header + * when trusted proxies were set via "setTrustedProxies()". The "X-Forwarded-For" + * header value is a comma+space separated list of IP addresses, the left-most + * being the original client, and each successive proxy that passed the request + * adding the IP address where it received the request from. + * + * If your reverse proxy uses a different header name than "X-Forwarded-For", + * ("Client-Ip" for instance), configure it via the $trustedHeaderSet + * argument of the Request::setTrustedProxies() method instead. + * + * @see getClientIps() + * @see https://wikipedia.org/wiki/X-Forwarded-For + */ + public function getClientIp(): ?string + { + return $this->getClientIps()[0]; + } + + /** + * Returns current script name. + */ + public function getScriptName(): string + { + return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME', '')); + } + + /** + * Returns the path being requested relative to the executed script. + * + * The path info always starts with a /. + * + * Suppose this request is instantiated from /mysite on localhost: + * + * * http://localhost/mysite returns an empty string + * * http://localhost/mysite/about returns '/about' + * * http://localhost/mysite/enco%20ded returns '/enco%20ded' + * * http://localhost/mysite/about?var=1 returns '/about' + * + * @return string The raw path (i.e. not urldecoded) + */ + public function getPathInfo(): string + { + return $this->pathInfo ??= $this->preparePathInfo(); + } + + /** + * Returns the root path from which this request is executed. + * + * Suppose that an index.php file instantiates this request object: + * + * * http://localhost/index.php returns an empty string + * * http://localhost/index.php/page returns an empty string + * * http://localhost/web/index.php returns '/web' + * * http://localhost/we%20b/index.php returns '/we%20b' + * + * @return string The raw path (i.e. not urldecoded) + */ + public function getBasePath(): string + { + return $this->basePath ??= $this->prepareBasePath(); + } + + /** + * Returns the root URL from which this request is executed. + * + * The base URL never ends with a /. + * + * This is similar to getBasePath(), except that it also includes the + * script filename (e.g. index.php) if one exists. + * + * @return string The raw URL (i.e. not urldecoded) + */ + public function getBaseUrl(): string + { + $trustedPrefix = ''; + + // the proxy prefix must be prepended to any prefix being needed at the webserver level + if ($this->isFromTrustedProxy() && $trustedPrefixValues = $this->getTrustedValues(self::HEADER_X_FORWARDED_PREFIX)) { + $trustedPrefix = rtrim($trustedPrefixValues[0], '/'); + } + + return $trustedPrefix.$this->getBaseUrlReal(); + } + + /** + * Returns the real base URL received by the webserver from which this request is executed. + * The URL does not include trusted reverse proxy prefix. + * + * @return string The raw URL (i.e. not urldecoded) + */ + private function getBaseUrlReal(): string + { + return $this->baseUrl ??= $this->prepareBaseUrl(); + } + + /** + * Gets the request's scheme. + */ + public function getScheme(): string + { + return $this->isSecure() ? 'https' : 'http'; + } + + /** + * Returns the port on which the request is made. + * + * This method can read the client port from the "X-Forwarded-Port" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Port" header must contain the client port. + * + * @return int|string|null Can be a string if fetched from the server bag + */ + public function getPort(): int|string|null + { + if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_PORT)) { + $host = $host[0]; + } elseif ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { + $host = $host[0]; + } elseif (!$host = $this->headers->get('HOST')) { + return $this->server->get('SERVER_PORT'); + } + + if ('[' === $host[0]) { + $pos = strpos($host, ':', strrpos($host, ']')); + } else { + $pos = strrpos($host, ':'); + } + + if (false !== $pos && $port = substr($host, $pos + 1)) { + return (int) $port; + } + + return 'https' === $this->getScheme() ? 443 : 80; + } + + /** + * Returns the user. + */ + public function getUser(): ?string + { + return $this->headers->get('PHP_AUTH_USER'); + } + + /** + * Returns the password. + */ + public function getPassword(): ?string + { + return $this->headers->get('PHP_AUTH_PW'); + } + + /** + * Gets the user info. + * + * @return string|null A user name if any and, optionally, scheme-specific information about how to gain authorization to access the server + */ + public function getUserInfo(): ?string + { + $userinfo = $this->getUser(); + + $pass = $this->getPassword(); + if ('' != $pass) { + $userinfo .= ":$pass"; + } + + return $userinfo; + } + + /** + * Returns the HTTP host being requested. + * + * The port name will be appended to the host if it's non-standard. + */ + public function getHttpHost(): string + { + $scheme = $this->getScheme(); + $port = $this->getPort(); + + if (('http' === $scheme && 80 == $port) || ('https' === $scheme && 443 == $port)) { + return $this->getHost(); + } + + return $this->getHost().':'.$port; + } + + /** + * Returns the requested URI (path and query string). + * + * @return string The raw URI (i.e. not URI decoded) + */ + public function getRequestUri(): string + { + return $this->requestUri ??= $this->prepareRequestUri(); + } + + /** + * Gets the scheme and HTTP host. + * + * If the URL was called with basic authentication, the user + * and the password are not added to the generated string. + */ + public function getSchemeAndHttpHost(): string + { + return $this->getScheme().'://'.$this->getHttpHost(); + } + + /** + * Generates a normalized URI (URL) for the Request. + * + * @see getQueryString() + */ + public function getUri(): string + { + if (null !== $qs = $this->getQueryString()) { + $qs = '?'.$qs; + } + + return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs; + } + + /** + * Generates a normalized URI for the given path. + * + * @param string $path A path to use instead of the current one + */ + public function getUriForPath(string $path): string + { + return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path; + } + + /** + * Returns the path as relative reference from the current Request path. + * + * Only the URIs path component (no schema, host etc.) is relevant and must be given. + * Both paths must be absolute and not contain relative parts. + * Relative URLs from one resource to another are useful when generating self-contained downloadable document archives. + * Furthermore, they can be used to reduce the link size in documents. + * + * Example target paths, given a base path of "/a/b/c/d": + * - "/a/b/c/d" -> "" + * - "/a/b/c/" -> "./" + * - "/a/b/" -> "../" + * - "/a/b/c/other" -> "other" + * - "/a/x/y" -> "../../x/y" + */ + public function getRelativeUriForPath(string $path): string + { + // be sure that we are dealing with an absolute path + if (!isset($path[0]) || '/' !== $path[0]) { + return $path; + } + + if ($path === $basePath = $this->getPathInfo()) { + return ''; + } + + $sourceDirs = explode('/', isset($basePath[0]) && '/' === $basePath[0] ? substr($basePath, 1) : $basePath); + $targetDirs = explode('/', substr($path, 1)); + array_pop($sourceDirs); + $targetFile = array_pop($targetDirs); + + foreach ($sourceDirs as $i => $dir) { + if (isset($targetDirs[$i]) && $dir === $targetDirs[$i]) { + unset($sourceDirs[$i], $targetDirs[$i]); + } else { + break; + } + } + + $targetDirs[] = $targetFile; + $path = str_repeat('../', \count($sourceDirs)).implode('/', $targetDirs); + + // A reference to the same base directory or an empty subdirectory must be prefixed with "./". + // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used + // as the first segment of a relative-path reference, as it would be mistaken for a scheme name + // (see https://tools.ietf.org/html/rfc3986#section-4.2). + return !isset($path[0]) || '/' === $path[0] + || false !== ($colonPos = strpos($path, ':')) && ($colonPos < ($slashPos = strpos($path, '/')) || false === $slashPos) + ? "./$path" : $path; + } + + /** + * Generates the normalized query string for the Request. + * + * It builds a normalized query string, where keys/value pairs are alphabetized + * and have consistent escaping. + */ + public function getQueryString(): ?string + { + $qs = static::normalizeQueryString($this->server->get('QUERY_STRING')); + + return '' === $qs ? null : $qs; + } + + /** + * Checks whether the request is secure or not. + * + * This method can read the client protocol from the "X-Forwarded-Proto" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Proto" header must contain the protocol: "https" or "http". + */ + public function isSecure(): bool + { + if ($this->isFromTrustedProxy() && $proto = $this->getTrustedValues(self::HEADER_X_FORWARDED_PROTO)) { + return \in_array(strtolower($proto[0]), ['https', 'on', 'ssl', '1'], true); + } + + $https = $this->server->get('HTTPS'); + + return $https && 'off' !== strtolower($https); + } + + /** + * Returns the host name. + * + * This method can read the client host name from the "X-Forwarded-Host" header + * when trusted proxies were set via "setTrustedProxies()". + * + * The "X-Forwarded-Host" header must contain the client host name. + * + * @throws SuspiciousOperationException when the host name is invalid or not trusted + */ + public function getHost(): string + { + if ($this->isFromTrustedProxy() && $host = $this->getTrustedValues(self::HEADER_X_FORWARDED_HOST)) { + $host = $host[0]; + } elseif (!$host = $this->headers->get('HOST')) { + if (!$host = $this->server->get('SERVER_NAME')) { + $host = $this->server->get('SERVER_ADDR', ''); + } + } + + // trim and remove port number from host + // host is lowercase as per RFC 952/2181 + $host = strtolower(preg_replace('/:\d+$/', '', trim($host))); + + // as the host can come from the user (HTTP_HOST and depending on the configuration, SERVER_NAME too can come from the user) + // check that it does not contain forbidden characters (see RFC 952 and RFC 2181) + // use preg_replace() instead of preg_match() to prevent DoS attacks with long host names + if ($host && '' !== preg_replace('/(?:^\[)?[a-zA-Z0-9-:\]_]+\.?/', '', $host)) { + if (!$this->isHostValid) { + return ''; + } + $this->isHostValid = false; + + throw new SuspiciousOperationException(\sprintf('Invalid Host "%s".', $host)); + } + + if (\count(self::$trustedHostPatterns) > 0) { + // to avoid host header injection attacks, you should provide a list of trusted host patterns + + if (\in_array($host, self::$trustedHosts, true)) { + return $host; + } + + foreach (self::$trustedHostPatterns as $pattern) { + if (preg_match($pattern, $host)) { + self::$trustedHosts[] = $host; + + return $host; + } + } + + if (!$this->isHostValid) { + return ''; + } + $this->isHostValid = false; + + throw new SuspiciousOperationException(\sprintf('Untrusted Host "%s".', $host)); + } + + return $host; + } + + /** + * Sets the request method. + */ + public function setMethod(string $method): void + { + $this->method = null; + $this->server->set('REQUEST_METHOD', $method); + } + + /** + * Gets the request "intended" method. + * + * If the X-HTTP-Method-Override header is set, and if the method is a POST, + * then it is used to determine the "real" intended HTTP method. + * + * The _method request parameter can also be used to determine the HTTP method, + * but only if enableHttpMethodParameterOverride() has been called. + * + * The method is always an uppercased string. + * + * @see getRealMethod() + */ + public function getMethod(): string + { + if (null !== $this->method) { + return $this->method; + } + + $this->method = strtoupper($this->server->get('REQUEST_METHOD', 'GET')); + + if ('POST' !== $this->method) { + return $this->method; + } + + $method = $this->headers->get('X-HTTP-METHOD-OVERRIDE'); + + if (!$method && self::$httpMethodParameterOverride) { + $method = $this->request->get('_method', $this->query->get('_method', 'POST')); + } + + if (!\is_string($method)) { + return $this->method; + } + + $method = strtoupper($method); + + if (\in_array($method, ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'PATCH', 'PURGE', 'TRACE'], true)) { + return $this->method = $method; + } + + if (!preg_match('/^[A-Z]++$/D', $method)) { + throw new SuspiciousOperationException('Invalid HTTP method override.'); + } + + return $this->method = $method; + } + + /** + * Gets the "real" request method. + * + * @see getMethod() + */ + public function getRealMethod(): string + { + return strtoupper($this->server->get('REQUEST_METHOD', 'GET')); + } + + /** + * Gets the mime type associated with the format. + */ + public function getMimeType(string $format): ?string + { + if (null === static::$formats) { + static::initializeFormats(); + } + + return isset(static::$formats[$format]) ? static::$formats[$format][0] : null; + } + + /** + * Gets the mime types associated with the format. + * + * @return string[] + */ + public static function getMimeTypes(string $format): array + { + if (null === static::$formats) { + static::initializeFormats(); + } + + return static::$formats[$format] ?? []; + } + + /** + * Gets the format associated with the mime type. + */ + public function getFormat(?string $mimeType): ?string + { + $canonicalMimeType = null; + if ($mimeType && false !== $pos = strpos($mimeType, ';')) { + $canonicalMimeType = trim(substr($mimeType, 0, $pos)); + } + + if (null === static::$formats) { + static::initializeFormats(); + } + + foreach (static::$formats as $format => $mimeTypes) { + if (\in_array($mimeType, (array) $mimeTypes, true)) { + return $format; + } + if (null !== $canonicalMimeType && \in_array($canonicalMimeType, (array) $mimeTypes, true)) { + return $format; + } + } + + return null; + } + + /** + * Associates a format with mime types. + * + * @param string|string[] $mimeTypes The associated mime types (the preferred one must be the first as it will be used as the content type) + */ + public function setFormat(?string $format, string|array $mimeTypes): void + { + if (null === static::$formats) { + static::initializeFormats(); + } + + static::$formats[$format] = \is_array($mimeTypes) ? $mimeTypes : [$mimeTypes]; + } + + /** + * Gets the request format. + * + * Here is the process to determine the format: + * + * * format defined by the user (with setRequestFormat()) + * * _format request attribute + * * $default + * + * @see getPreferredFormat + */ + public function getRequestFormat(?string $default = 'html'): ?string + { + $this->format ??= $this->attributes->get('_format'); + + return $this->format ?? $default; + } + + /** + * Sets the request format. + */ + public function setRequestFormat(?string $format): void + { + $this->format = $format; + } + + /** + * Gets the usual name of the format associated with the request's media type (provided in the Content-Type header). + * + * @see Request::$formats + */ + public function getContentTypeFormat(): ?string + { + return $this->getFormat($this->headers->get('CONTENT_TYPE', '')); + } + + /** + * Sets the default locale. + */ + public function setDefaultLocale(string $locale): void + { + $this->defaultLocale = $locale; + + if (null === $this->locale) { + $this->setPhpDefaultLocale($locale); + } + } + + /** + * Get the default locale. + */ + public function getDefaultLocale(): string + { + return $this->defaultLocale; + } + + /** + * Sets the locale. + */ + public function setLocale(string $locale): void + { + $this->setPhpDefaultLocale($this->locale = $locale); + } + + /** + * Get the locale. + */ + public function getLocale(): string + { + return $this->locale ?? $this->defaultLocale; + } + + /** + * Checks if the request method is of specified type. + * + * @param string $method Uppercase request method (GET, POST etc) + */ + public function isMethod(string $method): bool + { + return $this->getMethod() === strtoupper($method); + } + + /** + * Checks whether or not the method is safe. + * + * @see https://tools.ietf.org/html/rfc7231#section-4.2.1 + */ + public function isMethodSafe(): bool + { + return \in_array($this->getMethod(), ['GET', 'HEAD', 'OPTIONS', 'TRACE']); + } + + /** + * Checks whether or not the method is idempotent. + */ + public function isMethodIdempotent(): bool + { + return \in_array($this->getMethod(), ['HEAD', 'GET', 'PUT', 'DELETE', 'TRACE', 'OPTIONS', 'PURGE']); + } + + /** + * Checks whether the method is cacheable or not. + * + * @see https://tools.ietf.org/html/rfc7231#section-4.2.3 + */ + public function isMethodCacheable(): bool + { + return \in_array($this->getMethod(), ['GET', 'HEAD']); + } + + /** + * Returns the protocol version. + * + * If the application is behind a proxy, the protocol version used in the + * requests between the client and the proxy and between the proxy and the + * server might be different. This returns the former (from the "Via" header) + * if the proxy is trusted (see "setTrustedProxies()"), otherwise it returns + * the latter (from the "SERVER_PROTOCOL" server parameter). + */ + public function getProtocolVersion(): ?string + { + if ($this->isFromTrustedProxy()) { + preg_match('~^(HTTP/)?([1-9]\.[0-9])\b~', $this->headers->get('Via') ?? '', $matches); + + if ($matches) { + return 'HTTP/'.$matches[2]; + } + } + + return $this->server->get('SERVER_PROTOCOL'); + } + + /** + * Returns the request body content. + * + * @param bool $asResource If true, a resource will be returned + * + * @return string|resource + * + * @psalm-return ($asResource is true ? resource : string) + */ + public function getContent(bool $asResource = false) + { + $currentContentIsResource = \is_resource($this->content); + + if (true === $asResource) { + if ($currentContentIsResource) { + rewind($this->content); + + return $this->content; + } + + // Content passed in parameter (test) + if (\is_string($this->content)) { + $resource = fopen('php://temp', 'r+'); + fwrite($resource, $this->content); + rewind($resource); + + return $resource; + } + + $this->content = false; + + return fopen('php://input', 'r'); + } + + if ($currentContentIsResource) { + rewind($this->content); + + return stream_get_contents($this->content); + } + + if (null === $this->content || false === $this->content) { + $this->content = file_get_contents('php://input'); + } + + return $this->content; + } + + /** + * Gets the decoded form or json request body. + * + * @throws JsonException When the body cannot be decoded to an array + */ + public function getPayload(): InputBag + { + if ($this->request->count()) { + return clone $this->request; + } + + if ('' === $content = $this->getContent()) { + return new InputBag([]); + } + + try { + $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR); + } catch (\JsonException $e) { + throw new JsonException('Could not decode request body.', $e->getCode(), $e); + } + + if (!\is_array($content)) { + throw new JsonException(\sprintf('JSON content was expected to decode to an array, "%s" returned.', get_debug_type($content))); + } + + return new InputBag($content); + } + + /** + * Gets the request body decoded as array, typically from a JSON payload. + * + * @see getPayload() for portability between content types + * + * @throws JsonException When the body cannot be decoded to an array + */ + public function toArray(): array + { + if ('' === $content = $this->getContent()) { + throw new JsonException('Request body is empty.'); + } + + try { + $content = json_decode($content, true, 512, \JSON_BIGINT_AS_STRING | \JSON_THROW_ON_ERROR); + } catch (\JsonException $e) { + throw new JsonException('Could not decode request body.', $e->getCode(), $e); + } + + if (!\is_array($content)) { + throw new JsonException(\sprintf('JSON content was expected to decode to an array, "%s" returned.', get_debug_type($content))); + } + + return $content; + } + + /** + * Gets the Etags. + */ + public function getETags(): array + { + return preg_split('/\s*,\s*/', $this->headers->get('If-None-Match', ''), -1, \PREG_SPLIT_NO_EMPTY); + } + + public function isNoCache(): bool + { + return $this->headers->hasCacheControlDirective('no-cache') || 'no-cache' == $this->headers->get('Pragma'); + } + + /** + * Gets the preferred format for the response by inspecting, in the following order: + * * the request format set using setRequestFormat; + * * the values of the Accept HTTP header. + * + * Note that if you use this method, you should send the "Vary: Accept" header + * in the response to prevent any issues with intermediary HTTP caches. + */ + public function getPreferredFormat(?string $default = 'html'): ?string + { + if (!isset($this->preferredFormat) && null !== $preferredFormat = $this->getRequestFormat(null)) { + $this->preferredFormat = $preferredFormat; + } + + if ($this->preferredFormat ?? null) { + return $this->preferredFormat; + } + + foreach ($this->getAcceptableContentTypes() as $mimeType) { + if ($this->preferredFormat = $this->getFormat($mimeType)) { + return $this->preferredFormat; + } + } + + return $default; + } + + /** + * Returns the preferred language. + * + * @param string[] $locales An array of ordered available locales + */ + public function getPreferredLanguage(?array $locales = null): ?string + { + $preferredLanguages = $this->getLanguages(); + + if (!$locales) { + return $preferredLanguages[0] ?? null; + } + + $locales = array_map($this->formatLocale(...), $locales); + if (!$preferredLanguages) { + return $locales[0]; + } + + $combinations = array_merge(...array_map($this->getLanguageCombinations(...), $preferredLanguages)); + foreach ($combinations as $combination) { + foreach ($locales as $locale) { + if (str_starts_with($locale, $combination)) { + return $locale; + } + } + } + + return $locales[0]; + } + + /** + * Gets a list of languages acceptable by the client browser ordered in the user browser preferences. + * + * @return string[] + */ + public function getLanguages(): array + { + if (null !== $this->languages) { + return $this->languages; + } + + $languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all(); + $this->languages = []; + foreach ($languages as $acceptHeaderItem) { + $lang = $acceptHeaderItem->getValue(); + $this->languages[] = self::formatLocale($lang); + } + $this->languages = array_unique($this->languages); + + return $this->languages; + } + + /** + * Strips the locale to only keep the canonicalized language value. + * + * Depending on the $locale value, this method can return values like : + * - language_Script_REGION: "fr_Latn_FR", "zh_Hans_TW" + * - language_Script: "fr_Latn", "zh_Hans" + * - language_REGION: "fr_FR", "zh_TW" + * - language: "fr", "zh" + * + * Invalid locale values are returned as is. + * + * @see https://wikipedia.org/wiki/IETF_language_tag + * @see https://datatracker.ietf.org/doc/html/rfc5646 + */ + private static function formatLocale(string $locale): string + { + [$language, $script, $region] = self::getLanguageComponents($locale); + + return implode('_', array_filter([$language, $script, $region])); + } + + /** + * Returns an array of all possible combinations of the language components. + * + * For instance, if the locale is "fr_Latn_FR", this method will return: + * - "fr_Latn_FR" + * - "fr_Latn" + * - "fr_FR" + * - "fr" + * + * @return string[] + */ + private static function getLanguageCombinations(string $locale): array + { + [$language, $script, $region] = self::getLanguageComponents($locale); + + return array_unique([ + implode('_', array_filter([$language, $script, $region])), + implode('_', array_filter([$language, $script])), + implode('_', array_filter([$language, $region])), + $language, + ]); + } + + /** + * Returns an array with the language components of the locale. + * + * For example: + * - If the locale is "fr_Latn_FR", this method will return "fr", "Latn", "FR" + * - If the locale is "fr_FR", this method will return "fr", null, "FR" + * - If the locale is "zh_Hans", this method will return "zh", "Hans", null + * + * @see https://wikipedia.org/wiki/IETF_language_tag + * @see https://datatracker.ietf.org/doc/html/rfc5646 + * + * @return array{string, string|null, string|null} + */ + private static function getLanguageComponents(string $locale): array + { + $locale = str_replace('_', '-', strtolower($locale)); + $pattern = '/^([a-zA-Z]{2,3}|i-[a-zA-Z]{5,})(?:-([a-zA-Z]{4}))?(?:-([a-zA-Z]{2}))?(?:-(.+))?$/'; + if (!preg_match($pattern, $locale, $matches)) { + return [$locale, null, null]; + } + if (str_starts_with($matches[1], 'i-')) { + // Language not listed in ISO 639 that are not variants + // of any listed language, which can be registered with the + // i-prefix, such as i-cherokee + $matches[1] = substr($matches[1], 2); + } + + return [ + $matches[1], + isset($matches[2]) ? ucfirst(strtolower($matches[2])) : null, + isset($matches[3]) ? strtoupper($matches[3]) : null, + ]; + } + + /** + * Gets a list of charsets acceptable by the client browser in preferable order. + * + * @return string[] + */ + public function getCharsets(): array + { + return $this->charsets ??= array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all())); + } + + /** + * Gets a list of encodings acceptable by the client browser in preferable order. + * + * @return string[] + */ + public function getEncodings(): array + { + return $this->encodings ??= array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all())); + } + + /** + * Gets a list of content types acceptable by the client browser in preferable order. + * + * @return string[] + */ + public function getAcceptableContentTypes(): array + { + return $this->acceptableContentTypes ??= array_map('strval', array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all())); + } + + /** + * Returns true if the request is an XMLHttpRequest. + * + * It works if your JavaScript library sets an X-Requested-With HTTP header. + * It is known to work with common JavaScript frameworks: + * + * @see https://wikipedia.org/wiki/List_of_Ajax_frameworks#JavaScript + */ + public function isXmlHttpRequest(): bool + { + return 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); + } + + /** + * Checks whether the client browser prefers safe content or not according to RFC8674. + * + * @see https://tools.ietf.org/html/rfc8674 + */ + public function preferSafeContent(): bool + { + if (isset($this->isSafeContentPreferred)) { + return $this->isSafeContentPreferred; + } + + if (!$this->isSecure()) { + // see https://tools.ietf.org/html/rfc8674#section-3 + return $this->isSafeContentPreferred = false; + } + + return $this->isSafeContentPreferred = AcceptHeader::fromString($this->headers->get('Prefer'))->has('safe'); + } + + /* + * The following methods are derived from code of the Zend Framework (1.10dev - 2010-01-24) + * + * Code subject to the new BSD license (https://framework.zend.com/license). + * + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (https://www.zend.com/) + */ + + protected function prepareRequestUri(): string + { + $requestUri = ''; + + if ($this->isIisRewrite() && '' != $this->server->get('UNENCODED_URL')) { + // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem) + $requestUri = $this->server->get('UNENCODED_URL'); + $this->server->remove('UNENCODED_URL'); + } elseif ($this->server->has('REQUEST_URI')) { + $requestUri = $this->server->get('REQUEST_URI'); + + if ('' !== $requestUri && '/' === $requestUri[0]) { + // To only use path and query remove the fragment. + if (false !== $pos = strpos($requestUri, '#')) { + $requestUri = substr($requestUri, 0, $pos); + } + } else { + // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, + // only use URL path. + $uriComponents = parse_url($requestUri); + + if (isset($uriComponents['path'])) { + $requestUri = $uriComponents['path']; + } + + if (isset($uriComponents['query'])) { + $requestUri .= '?'.$uriComponents['query']; + } + } + } elseif ($this->server->has('ORIG_PATH_INFO')) { + // IIS 5.0, PHP as CGI + $requestUri = $this->server->get('ORIG_PATH_INFO'); + if ('' != $this->server->get('QUERY_STRING')) { + $requestUri .= '?'.$this->server->get('QUERY_STRING'); + } + $this->server->remove('ORIG_PATH_INFO'); + } + + // normalize the request URI to ease creating sub-requests from this request + $this->server->set('REQUEST_URI', $requestUri); + + return $requestUri; + } + + /** + * Prepares the base URL. + */ + protected function prepareBaseUrl(): string + { + $filename = basename($this->server->get('SCRIPT_FILENAME', '')); + + if (basename($this->server->get('SCRIPT_NAME', '')) === $filename) { + $baseUrl = $this->server->get('SCRIPT_NAME'); + } elseif (basename($this->server->get('PHP_SELF', '')) === $filename) { + $baseUrl = $this->server->get('PHP_SELF'); + } elseif (basename($this->server->get('ORIG_SCRIPT_NAME', '')) === $filename) { + $baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); // 1and1 shared hosting compatibility + } else { + // Backtrack up the script_filename to find the portion matching + // php_self + $path = $this->server->get('PHP_SELF', ''); + $file = $this->server->get('SCRIPT_FILENAME', ''); + $segs = explode('/', trim($file, '/')); + $segs = array_reverse($segs); + $index = 0; + $last = \count($segs); + $baseUrl = ''; + do { + $seg = $segs[$index]; + $baseUrl = '/'.$seg.$baseUrl; + ++$index; + } while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos); + } + + // Does the baseUrl have anything in common with the request_uri? + $requestUri = $this->getRequestUri(); + if ('' !== $requestUri && '/' !== $requestUri[0]) { + $requestUri = '/'.$requestUri; + } + + if ($baseUrl && null !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) { + // full $baseUrl matches + return $prefix; + } + + if ($baseUrl && null !== $prefix = $this->getUrlencodedPrefix($requestUri, rtrim(\dirname($baseUrl), '/'.\DIRECTORY_SEPARATOR).'/')) { + // directory portion of $baseUrl matches + return rtrim($prefix, '/'.\DIRECTORY_SEPARATOR); + } + + $truncatedRequestUri = $requestUri; + if (false !== $pos = strpos($requestUri, '?')) { + $truncatedRequestUri = substr($requestUri, 0, $pos); + } + + $basename = basename($baseUrl ?? ''); + if (!$basename || !strpos(rawurldecode($truncatedRequestUri), $basename)) { + // no match whatsoever; set it blank + return ''; + } + + // If using mod_rewrite or ISAPI_Rewrite strip the script filename + // out of baseUrl. $pos !== 0 makes sure it is not matching a value + // from PATH_INFO or QUERY_STRING + if (\strlen($requestUri) >= \strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && 0 !== $pos) { + $baseUrl = substr($requestUri, 0, $pos + \strlen($baseUrl)); + } + + return rtrim($baseUrl, '/'.\DIRECTORY_SEPARATOR); + } + + /** + * Prepares the base path. + */ + protected function prepareBasePath(): string + { + $baseUrl = $this->getBaseUrl(); + if (!$baseUrl) { + return ''; + } + + $filename = basename($this->server->get('SCRIPT_FILENAME')); + if (basename($baseUrl) === $filename) { + $basePath = \dirname($baseUrl); + } else { + $basePath = $baseUrl; + } + + if ('\\' === \DIRECTORY_SEPARATOR) { + $basePath = str_replace('\\', '/', $basePath); + } + + return rtrim($basePath, '/'); + } + + /** + * Prepares the path info. + */ + protected function preparePathInfo(): string + { + if (null === ($requestUri = $this->getRequestUri())) { + return '/'; + } + + // Remove the query string from REQUEST_URI + if (false !== $pos = strpos($requestUri, '?')) { + $requestUri = substr($requestUri, 0, $pos); + } + if ('' !== $requestUri && '/' !== $requestUri[0]) { + $requestUri = '/'.$requestUri; + } + + if (null === ($baseUrl = $this->getBaseUrlReal())) { + return $requestUri; + } + + $pathInfo = substr($requestUri, \strlen($baseUrl)); + if ('' === $pathInfo) { + // If substr() returns false then PATH_INFO is set to an empty string + return '/'; + } + + return $pathInfo; + } + + /** + * Initializes HTTP request formats. + */ + protected static function initializeFormats(): void + { + static::$formats = [ + 'html' => ['text/html', 'application/xhtml+xml'], + 'txt' => ['text/plain'], + 'js' => ['application/javascript', 'application/x-javascript', 'text/javascript'], + 'css' => ['text/css'], + 'json' => ['application/json', 'application/x-json'], + 'jsonld' => ['application/ld+json'], + 'xml' => ['text/xml', 'application/xml', 'application/x-xml'], + 'rdf' => ['application/rdf+xml'], + 'atom' => ['application/atom+xml'], + 'rss' => ['application/rss+xml'], + 'form' => ['application/x-www-form-urlencoded', 'multipart/form-data'], + ]; + } + + private function setPhpDefaultLocale(string $locale): void + { + // if either the class Locale doesn't exist, or an exception is thrown when + // setting the default locale, the intl module is not installed, and + // the call can be ignored: + try { + if (class_exists(\Locale::class, false)) { + \Locale::setDefault($locale); + } + } catch (\Exception) { + } + } + + /** + * Returns the prefix as encoded in the string when the string starts with + * the given prefix, null otherwise. + */ + private function getUrlencodedPrefix(string $string, string $prefix): ?string + { + if ($this->isIisRewrite()) { + // ISS with UrlRewriteModule might report SCRIPT_NAME/PHP_SELF with wrong case + // see https://github.com/php/php-src/issues/11981 + if (0 !== stripos(rawurldecode($string), $prefix)) { + return null; + } + } elseif (!str_starts_with(rawurldecode($string), $prefix)) { + return null; + } + + $len = \strlen($prefix); + + if (preg_match(\sprintf('#^(%%[[:xdigit:]]{2}|.){%d}#', $len), $string, $match)) { + return $match[0]; + } + + return null; + } + + private static function createRequestFromFactory(array $query = [], array $request = [], array $attributes = [], array $cookies = [], array $files = [], array $server = [], $content = null): static + { + if (self::$requestFactory) { + $request = (self::$requestFactory)($query, $request, $attributes, $cookies, $files, $server, $content); + + if (!$request instanceof self) { + throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.'); + } + + return $request; + } + + return new static($query, $request, $attributes, $cookies, $files, $server, $content); + } + + /** + * Indicates whether this request originated from a trusted proxy. + * + * This can be useful to determine whether or not to trust the + * contents of a proxy-specific header. + */ + public function isFromTrustedProxy(): bool + { + return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies); + } + + /** + * This method is rather heavy because it splits and merges headers, and it's called by many other methods such as + * getPort(), isSecure(), getHost(), getClientIps(), getBaseUrl() etc. Thus, we try to cache the results for + * best performance. + */ + private function getTrustedValues(int $type, ?string $ip = null): array + { + $cacheKey = $type."\0".((self::$trustedHeaderSet & $type) ? $this->headers->get(self::TRUSTED_HEADERS[$type]) : ''); + $cacheKey .= "\0".$ip."\0".$this->headers->get(self::TRUSTED_HEADERS[self::HEADER_FORWARDED]); + + if (isset($this->trustedValuesCache[$cacheKey])) { + return $this->trustedValuesCache[$cacheKey]; + } + + $clientValues = []; + $forwardedValues = []; + + if ((self::$trustedHeaderSet & $type) && $this->headers->has(self::TRUSTED_HEADERS[$type])) { + foreach (explode(',', $this->headers->get(self::TRUSTED_HEADERS[$type])) as $v) { + $clientValues[] = (self::HEADER_X_FORWARDED_PORT === $type ? '0.0.0.0:' : '').trim($v); + } + } + + if ((self::$trustedHeaderSet & self::HEADER_FORWARDED) && (isset(self::FORWARDED_PARAMS[$type])) && $this->headers->has(self::TRUSTED_HEADERS[self::HEADER_FORWARDED])) { + $forwarded = $this->headers->get(self::TRUSTED_HEADERS[self::HEADER_FORWARDED]); + $parts = HeaderUtils::split($forwarded, ',;='); + $param = self::FORWARDED_PARAMS[$type]; + foreach ($parts as $subParts) { + if (null === $v = HeaderUtils::combine($subParts)[$param] ?? null) { + continue; + } + if (self::HEADER_X_FORWARDED_PORT === $type) { + if (str_ends_with($v, ']') || false === $v = strrchr($v, ':')) { + $v = $this->isSecure() ? ':443' : ':80'; + } + $v = '0.0.0.0'.$v; + } + $forwardedValues[] = $v; + } + } + + if (null !== $ip) { + $clientValues = $this->normalizeAndFilterClientIps($clientValues, $ip); + $forwardedValues = $this->normalizeAndFilterClientIps($forwardedValues, $ip); + } + + if ($forwardedValues === $clientValues || !$clientValues) { + return $this->trustedValuesCache[$cacheKey] = $forwardedValues; + } + + if (!$forwardedValues) { + return $this->trustedValuesCache[$cacheKey] = $clientValues; + } + + if (!$this->isForwardedValid) { + return $this->trustedValuesCache[$cacheKey] = null !== $ip ? ['0.0.0.0', $ip] : []; + } + $this->isForwardedValid = false; + + throw new ConflictingHeadersException(\sprintf('The request has both a trusted "%s" header and a trusted "%s" header, conflicting with each other. You should either configure your proxy to remove one of them, or configure your project to distrust the offending one.', self::TRUSTED_HEADERS[self::HEADER_FORWARDED], self::TRUSTED_HEADERS[$type])); + } + + private function normalizeAndFilterClientIps(array $clientIps, string $ip): array + { + if (!$clientIps) { + return []; + } + $clientIps[] = $ip; // Complete the IP chain with the IP the request actually came from + $firstTrustedIp = null; + + foreach ($clientIps as $key => $clientIp) { + if (strpos($clientIp, '.')) { + // Strip :port from IPv4 addresses. This is allowed in Forwarded + // and may occur in X-Forwarded-For. + $i = strpos($clientIp, ':'); + if ($i) { + $clientIps[$key] = $clientIp = substr($clientIp, 0, $i); + } + } elseif (str_starts_with($clientIp, '[')) { + // Strip brackets and :port from IPv6 addresses. + $i = strpos($clientIp, ']', 1); + $clientIps[$key] = $clientIp = substr($clientIp, 1, $i - 1); + } + + if (!filter_var($clientIp, \FILTER_VALIDATE_IP)) { + unset($clientIps[$key]); + + continue; + } + + if (IpUtils::checkIp($clientIp, self::$trustedProxies)) { + unset($clientIps[$key]); + + // Fallback to this when the client IP falls into the range of trusted proxies + $firstTrustedIp ??= $clientIp; + } + } + + // Now the IP chain contains only untrusted proxies and the client IP + return $clientIps ? array_reverse($clientIps) : [$firstTrustedIp]; + } + + /** + * Is this IIS with UrlRewriteModule? + * + * This method consumes, caches and removed the IIS_WasUrlRewritten env var, + * so we don't inherit it to sub-requests. + */ + private function isIisRewrite(): bool + { + if (1 === $this->server->getInt('IIS_WasUrlRewritten')) { + $this->isIisRewrite = true; + $this->server->remove('IIS_WasUrlRewritten'); + } + + return $this->isIisRewrite; + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php new file mode 100644 index 00000000..09d6f49d --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/AttributesRequestMatcher.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the Request attributes matches all regular expressions. + * + * @author Fabien Potencier + */ +class AttributesRequestMatcher implements RequestMatcherInterface +{ + /** + * @param array $regexps + */ + public function __construct(private array $regexps) + { + } + + public function matches(Request $request): bool + { + foreach ($this->regexps as $key => $regexp) { + $attribute = $request->attributes->get($key); + if (!\is_string($attribute)) { + return false; + } + if (!preg_match('{'.$regexp.'}', $attribute)) { + return false; + } + } + + return true; + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.php new file mode 100644 index 00000000..935853f1 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/ExpressionRequestMatcher.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\ExpressionLanguage\Expression; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * ExpressionRequestMatcher uses an expression to match a Request. + * + * @author Fabien Potencier + */ +class ExpressionRequestMatcher implements RequestMatcherInterface +{ + public function __construct( + private ExpressionLanguage $language, + private Expression|string $expression, + ) { + } + + public function matches(Request $request): bool + { + return $this->language->evaluate($this->expression, [ + 'request' => $request, + 'method' => $request->getMethod(), + 'path' => rawurldecode($request->getPathInfo()), + 'host' => $request->getHost(), + 'ip' => $request->getClientIp(), + 'attributes' => $request->attributes->all(), + ]); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/HeaderRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/HeaderRequestMatcher.php new file mode 100644 index 00000000..8617a8ac --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/HeaderRequestMatcher.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the presence of HTTP headers in a Request. + * + * @author Alexandre Daubois + */ +class HeaderRequestMatcher implements RequestMatcherInterface +{ + /** + * @var string[] + */ + private array $headers; + + /** + * @param string[]|string $headers A header or a list of headers + * Strings can contain a comma-delimited list of headers + */ + public function __construct(array|string $headers) + { + $this->headers = array_reduce((array) $headers, static fn (array $headers, string $header) => array_merge($headers, preg_split('/\s*,\s*/', $header)), []); + } + + public function matches(Request $request): bool + { + if (!$this->headers) { + return true; + } + + foreach ($this->headers as $header) { + if (!$request->headers->has($header)) { + return false; + } + } + + return true; + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.php new file mode 100644 index 00000000..2836759c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/HostRequestMatcher.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the Request URL host name matches a regular expression. + * + * @author Fabien Potencier + */ +class HostRequestMatcher implements RequestMatcherInterface +{ + public function __construct(private string $regexp) + { + } + + public function matches(Request $request): bool + { + return preg_match('{'.$this->regexp.'}i', $request->getHost()); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php new file mode 100644 index 00000000..333612e2 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/IpsRequestMatcher.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\IpUtils; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the client IP of a Request. + * + * @author Fabien Potencier + */ +class IpsRequestMatcher implements RequestMatcherInterface +{ + private array $ips; + + /** + * @param string[]|string $ips A specific IP address or a range specified using IP/netmask like 192.168.1.0/24 + * Strings can contain a comma-delimited list of IPs/ranges + */ + public function __construct(array|string $ips) + { + $this->ips = array_reduce((array) $ips, static fn (array $ips, string $ip) => array_merge($ips, preg_split('/\s*,\s*/', $ip)), []); + } + + public function matches(Request $request): bool + { + if (!$this->ips) { + return true; + } + + return IpUtils::checkIp($request->getClientIp() ?? '', $this->ips); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php new file mode 100644 index 00000000..875f992b --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/IsJsonRequestMatcher.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the Request content is valid JSON. + * + * @author Fabien Potencier + */ +class IsJsonRequestMatcher implements RequestMatcherInterface +{ + public function matches(Request $request): bool + { + return json_validate($request->getContent()); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php new file mode 100644 index 00000000..b37f6e3c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/MethodRequestMatcher.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the HTTP method of a Request. + * + * @author Fabien Potencier + */ +class MethodRequestMatcher implements RequestMatcherInterface +{ + /** + * @var string[] + */ + private array $methods = []; + + /** + * @param string[]|string $methods An HTTP method or an array of HTTP methods + * Strings can contain a comma-delimited list of methods + */ + public function __construct(array|string $methods) + { + $this->methods = array_reduce(array_map('strtoupper', (array) $methods), static fn (array $methods, string $method) => array_merge($methods, preg_split('/\s*,\s*/', $method)), []); + } + + public function matches(Request $request): bool + { + if (!$this->methods) { + return true; + } + + return \in_array($request->getMethod(), $this->methods, true); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.php new file mode 100644 index 00000000..c7c7a02c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/PathRequestMatcher.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the Request URL path info matches a regular expression. + * + * @author Fabien Potencier + */ +class PathRequestMatcher implements RequestMatcherInterface +{ + public function __construct(private string $regexp) + { + } + + public function matches(Request $request): bool + { + return preg_match('{'.$this->regexp.'}', rawurldecode($request->getPathInfo())); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.php new file mode 100644 index 00000000..5a01ce95 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/PortRequestMatcher.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the HTTP port of a Request. + * + * @author Fabien Potencier + */ +class PortRequestMatcher implements RequestMatcherInterface +{ + public function __construct(private int $port) + { + } + + public function matches(Request $request): bool + { + return $request->getPort() === $this->port; + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/QueryParameterRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/QueryParameterRequestMatcher.php new file mode 100644 index 00000000..86161e7c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/QueryParameterRequestMatcher.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the presence of HTTP query parameters of a Request. + * + * @author Alexandre Daubois + */ +class QueryParameterRequestMatcher implements RequestMatcherInterface +{ + /** + * @var string[] + */ + private array $parameters; + + /** + * @param string[]|string $parameters A parameter or a list of parameters + * Strings can contain a comma-delimited list of query parameters + */ + public function __construct(array|string $parameters) + { + $this->parameters = array_reduce(array_map(strtolower(...), (array) $parameters), static fn (array $parameters, string $parameter) => array_merge($parameters, preg_split('/\s*,\s*/', $parameter)), []); + } + + public function matches(Request $request): bool + { + if (!$this->parameters) { + return true; + } + + return 0 === \count(array_diff_assoc($this->parameters, $request->query->keys())); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php b/plugins/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php new file mode 100644 index 00000000..9c9cd58b --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcher/SchemeRequestMatcher.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\RequestMatcher; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\RequestMatcherInterface; + +/** + * Checks the HTTP scheme of a Request. + * + * @author Fabien Potencier + */ +class SchemeRequestMatcher implements RequestMatcherInterface +{ + /** + * @var string[] + */ + private array $schemes; + + /** + * @param string[]|string $schemes A scheme or a list of schemes + * Strings can contain a comma-delimited list of schemes + */ + public function __construct(array|string $schemes) + { + $this->schemes = array_reduce(array_map('strtolower', (array) $schemes), static fn (array $schemes, string $scheme) => array_merge($schemes, preg_split('/\s*,\s*/', $scheme)), []); + } + + public function matches(Request $request): bool + { + if (!$this->schemes) { + return true; + } + + return \in_array($request->getScheme(), $this->schemes, true); + } +} diff --git a/plugins/vendor/symfony/http-foundation/RequestMatcherInterface.php b/plugins/vendor/symfony/http-foundation/RequestMatcherInterface.php new file mode 100644 index 00000000..6dcc3e0f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestMatcherInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * RequestMatcherInterface is an interface for strategies to match a Request. + * + * @author Fabien Potencier + */ +interface RequestMatcherInterface +{ + /** + * Decides whether the rule(s) implemented by the strategy matches the supplied request. + */ + public function matches(Request $request): bool; +} diff --git a/plugins/vendor/symfony/http-foundation/RequestStack.php b/plugins/vendor/symfony/http-foundation/RequestStack.php new file mode 100644 index 00000000..153bd9ad --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/RequestStack.php @@ -0,0 +1,124 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException; +use Symfony\Component\HttpFoundation\Session\SessionInterface; + +/** + * Request stack that controls the lifecycle of requests. + * + * @author Benjamin Eberlei + */ +class RequestStack +{ + /** + * @var Request[] + */ + private array $requests = []; + + /** + * @param Request[] $requests + */ + public function __construct(array $requests = []) + { + foreach ($requests as $request) { + $this->push($request); + } + } + + /** + * Pushes a Request on the stack. + * + * This method should generally not be called directly as the stack + * management should be taken care of by the application itself. + */ + public function push(Request $request): void + { + $this->requests[] = $request; + } + + /** + * Pops the current request from the stack. + * + * This operation lets the current request go out of scope. + * + * This method should generally not be called directly as the stack + * management should be taken care of by the application itself. + */ + public function pop(): ?Request + { + if (!$this->requests) { + return null; + } + + return array_pop($this->requests); + } + + public function getCurrentRequest(): ?Request + { + return end($this->requests) ?: null; + } + + /** + * Gets the main request. + * + * Be warned that making your code aware of the main request + * might make it un-compatible with other features of your framework + * like ESI support. + */ + public function getMainRequest(): ?Request + { + if (!$this->requests) { + return null; + } + + return $this->requests[0]; + } + + /** + * Returns the parent request of the current. + * + * Be warned that making your code aware of the parent request + * might make it un-compatible with other features of your framework + * like ESI support. + * + * If current Request is the main request, it returns null. + */ + public function getParentRequest(): ?Request + { + $pos = \count($this->requests) - 2; + + return $this->requests[$pos] ?? null; + } + + /** + * Gets the current session. + * + * @throws SessionNotFoundException + */ + public function getSession(): SessionInterface + { + if ((null !== $request = end($this->requests) ?: null) && $request->hasSession()) { + return $request->getSession(); + } + + throw new SessionNotFoundException(); + } + + public function resetRequestFormats(): void + { + static $resetRequestFormats; + $resetRequestFormats ??= \Closure::bind(static fn () => self::$formats = null, null, Request::class); + $resetRequestFormats(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Response.php b/plugins/vendor/symfony/http-foundation/Response.php new file mode 100644 index 00000000..638b5bf6 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Response.php @@ -0,0 +1,1317 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +// Help opcache.preload discover always-needed symbols +class_exists(ResponseHeaderBag::class); + +/** + * Response represents an HTTP response. + * + * @author Fabien Potencier + */ +class Response +{ + public const HTTP_CONTINUE = 100; + public const HTTP_SWITCHING_PROTOCOLS = 101; + public const HTTP_PROCESSING = 102; // RFC2518 + public const HTTP_EARLY_HINTS = 103; // RFC8297 + public const HTTP_OK = 200; + public const HTTP_CREATED = 201; + public const HTTP_ACCEPTED = 202; + public const HTTP_NON_AUTHORITATIVE_INFORMATION = 203; + public const HTTP_NO_CONTENT = 204; + public const HTTP_RESET_CONTENT = 205; + public const HTTP_PARTIAL_CONTENT = 206; + public const HTTP_MULTI_STATUS = 207; // RFC4918 + public const HTTP_ALREADY_REPORTED = 208; // RFC5842 + public const HTTP_IM_USED = 226; // RFC3229 + public const HTTP_MULTIPLE_CHOICES = 300; + public const HTTP_MOVED_PERMANENTLY = 301; + public const HTTP_FOUND = 302; + public const HTTP_SEE_OTHER = 303; + public const HTTP_NOT_MODIFIED = 304; + public const HTTP_USE_PROXY = 305; + public const HTTP_RESERVED = 306; + public const HTTP_TEMPORARY_REDIRECT = 307; + public const HTTP_PERMANENTLY_REDIRECT = 308; // RFC7238 + public const HTTP_BAD_REQUEST = 400; + public const HTTP_UNAUTHORIZED = 401; + public const HTTP_PAYMENT_REQUIRED = 402; + public const HTTP_FORBIDDEN = 403; + public const HTTP_NOT_FOUND = 404; + public const HTTP_METHOD_NOT_ALLOWED = 405; + public const HTTP_NOT_ACCEPTABLE = 406; + public const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407; + public const HTTP_REQUEST_TIMEOUT = 408; + public const HTTP_CONFLICT = 409; + public const HTTP_GONE = 410; + public const HTTP_LENGTH_REQUIRED = 411; + public const HTTP_PRECONDITION_FAILED = 412; + public const HTTP_REQUEST_ENTITY_TOO_LARGE = 413; + public const HTTP_REQUEST_URI_TOO_LONG = 414; + public const HTTP_UNSUPPORTED_MEDIA_TYPE = 415; + public const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416; + public const HTTP_EXPECTATION_FAILED = 417; + public const HTTP_I_AM_A_TEAPOT = 418; // RFC2324 + public const HTTP_MISDIRECTED_REQUEST = 421; // RFC7540 + public const HTTP_UNPROCESSABLE_ENTITY = 422; // RFC4918 + public const HTTP_LOCKED = 423; // RFC4918 + public const HTTP_FAILED_DEPENDENCY = 424; // RFC4918 + public const HTTP_TOO_EARLY = 425; // RFC-ietf-httpbis-replay-04 + public const HTTP_UPGRADE_REQUIRED = 426; // RFC2817 + public const HTTP_PRECONDITION_REQUIRED = 428; // RFC6585 + public const HTTP_TOO_MANY_REQUESTS = 429; // RFC6585 + public const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; // RFC6585 + public const HTTP_UNAVAILABLE_FOR_LEGAL_REASONS = 451; // RFC7725 + public const HTTP_INTERNAL_SERVER_ERROR = 500; + public const HTTP_NOT_IMPLEMENTED = 501; + public const HTTP_BAD_GATEWAY = 502; + public const HTTP_SERVICE_UNAVAILABLE = 503; + public const HTTP_GATEWAY_TIMEOUT = 504; + public const HTTP_VERSION_NOT_SUPPORTED = 505; + public const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; // RFC2295 + public const HTTP_INSUFFICIENT_STORAGE = 507; // RFC4918 + public const HTTP_LOOP_DETECTED = 508; // RFC5842 + public const HTTP_NOT_EXTENDED = 510; // RFC2774 + public const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 + + /** + * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control + */ + private const HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES = [ + 'must_revalidate' => false, + 'no_cache' => false, + 'no_store' => false, + 'no_transform' => false, + 'public' => false, + 'private' => false, + 'proxy_revalidate' => false, + 'max_age' => true, + 's_maxage' => true, + 'stale_if_error' => true, // RFC5861 + 'stale_while_revalidate' => true, // RFC5861 + 'immutable' => false, + 'last_modified' => true, + 'etag' => true, + ]; + + public ResponseHeaderBag $headers; + + protected string $content; + protected string $version; + protected int $statusCode; + protected string $statusText; + protected ?string $charset = null; + + /** + * Status codes translation table. + * + * The list of codes is complete according to the + * {@link https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml Hypertext Transfer Protocol (HTTP) Status Code Registry} + * (last updated 2021-10-01). + * + * Unless otherwise noted, the status code is defined in RFC2616. + * + * @var array + */ + public static array $statusTexts = [ + 100 => 'Continue', + 101 => 'Switching Protocols', + 102 => 'Processing', // RFC2518 + 103 => 'Early Hints', + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + 207 => 'Multi-Status', // RFC4918 + 208 => 'Already Reported', // RFC5842 + 226 => 'IM Used', // RFC3229 + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + 308 => 'Permanent Redirect', // RFC7238 + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Content Too Large', // RFC-ietf-httpbis-semantics + 414 => 'URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Range Not Satisfiable', + 417 => 'Expectation Failed', + 418 => 'I\'m a teapot', // RFC2324 + 421 => 'Misdirected Request', // RFC7540 + 422 => 'Unprocessable Content', // RFC-ietf-httpbis-semantics + 423 => 'Locked', // RFC4918 + 424 => 'Failed Dependency', // RFC4918 + 425 => 'Too Early', // RFC-ietf-httpbis-replay-04 + 426 => 'Upgrade Required', // RFC2817 + 428 => 'Precondition Required', // RFC6585 + 429 => 'Too Many Requests', // RFC6585 + 431 => 'Request Header Fields Too Large', // RFC6585 + 451 => 'Unavailable For Legal Reasons', // RFC7725 + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 506 => 'Variant Also Negotiates', // RFC2295 + 507 => 'Insufficient Storage', // RFC4918 + 508 => 'Loop Detected', // RFC5842 + 510 => 'Not Extended', // RFC2774 + 511 => 'Network Authentication Required', // RFC6585 + ]; + + /** + * Tracks headers already sent in informational responses. + */ + private array $sentHeaders; + + /** + * @param int $status The HTTP status code (200 "OK" by default) + * + * @throws \InvalidArgumentException When the HTTP status code is not valid + */ + public function __construct(?string $content = '', int $status = 200, array $headers = []) + { + $this->headers = new ResponseHeaderBag($headers); + $this->setContent($content); + $this->setStatusCode($status); + $this->setProtocolVersion('1.0'); + } + + /** + * Returns the Response as an HTTP string. + * + * The string representation of the Response is the same as the + * one that will be sent to the client only if the prepare() method + * has been called before. + * + * @see prepare() + */ + public function __toString(): string + { + return + \sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n". + $this->headers."\r\n". + $this->getContent(); + } + + /** + * Clones the current Response instance. + */ + public function __clone() + { + $this->headers = clone $this->headers; + } + + /** + * Prepares the Response before it is sent to the client. + * + * This method tweaks the Response to ensure that it is + * compliant with RFC 2616. Most of the changes are based on + * the Request that is "associated" with this Response. + * + * @return $this + */ + public function prepare(Request $request): static + { + $headers = $this->headers; + + if ($this->isInformational() || $this->isEmpty()) { + $this->setContent(null); + $headers->remove('Content-Type'); + $headers->remove('Content-Length'); + // prevent PHP from sending the Content-Type header based on default_mimetype + ini_set('default_mimetype', ''); + } else { + // Content-type based on the Request + if (!$headers->has('Content-Type')) { + $format = $request->getRequestFormat(null); + if (null !== $format && $mimeType = $request->getMimeType($format)) { + $headers->set('Content-Type', $mimeType); + } + } + + // Fix Content-Type + $charset = $this->charset ?: 'UTF-8'; + if (!$headers->has('Content-Type')) { + $headers->set('Content-Type', 'text/html; charset='.$charset); + } elseif (0 === stripos($headers->get('Content-Type') ?? '', 'text/') && false === stripos($headers->get('Content-Type') ?? '', 'charset')) { + // add the charset + $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); + } + + // Fix Content-Length + if ($headers->has('Transfer-Encoding')) { + $headers->remove('Content-Length'); + } + + if ($request->isMethod('HEAD')) { + // cf. RFC2616 14.13 + $length = $headers->get('Content-Length'); + $this->setContent(null); + if ($length) { + $headers->set('Content-Length', $length); + } + } + } + + // Fix protocol + if ('HTTP/1.0' != $request->server->get('SERVER_PROTOCOL')) { + $this->setProtocolVersion('1.1'); + } + + // Check if we need to send extra expire info headers + if ('1.0' == $this->getProtocolVersion() && str_contains($headers->get('Cache-Control', ''), 'no-cache')) { + $headers->set('pragma', 'no-cache'); + $headers->set('expires', -1); + } + + $this->ensureIEOverSSLCompatibility($request); + + if ($request->isSecure()) { + foreach ($headers->getCookies() as $cookie) { + $cookie->setSecureDefault(true); + } + } + + return $this; + } + + /** + * Sends HTTP headers. + * + * @param positive-int|null $statusCode The status code to use, override the statusCode property if set and not null + * + * @return $this + */ + public function sendHeaders(?int $statusCode = null): static + { + // headers have already been sent by the developer + if (headers_sent()) { + return $this; + } + + $informationalResponse = $statusCode >= 100 && $statusCode < 200; + if ($informationalResponse && !\function_exists('headers_send')) { + // skip informational responses if not supported by the SAPI + return $this; + } + + // headers + foreach ($this->headers->allPreserveCaseWithoutCookies() as $name => $values) { + // As recommended by RFC 8297, PHP automatically copies headers from previous 103 responses, we need to deal with that if headers changed + $previousValues = $this->sentHeaders[$name] ?? null; + if ($previousValues === $values) { + // Header already sent in a previous response, it will be automatically copied in this response by PHP + continue; + } + + $replace = 0 === strcasecmp($name, 'Content-Type'); + + if (null !== $previousValues && array_diff($previousValues, $values)) { + header_remove($name); + $previousValues = null; + } + + $newValues = null === $previousValues ? $values : array_diff($values, $previousValues); + + foreach ($newValues as $value) { + header($name.': '.$value, $replace, $this->statusCode); + } + + if ($informationalResponse) { + $this->sentHeaders[$name] = $values; + } + } + + // cookies + foreach ($this->headers->getCookies() as $cookie) { + header('Set-Cookie: '.$cookie, false, $this->statusCode); + } + + if ($informationalResponse) { + headers_send($statusCode); + + return $this; + } + + $statusCode ??= $this->statusCode; + + // status + header(\sprintf('HTTP/%s %s %s', $this->version, $statusCode, $this->statusText), true, $statusCode); + + return $this; + } + + /** + * Sends content for the current web response. + * + * @return $this + */ + public function sendContent(): static + { + echo $this->content; + + return $this; + } + + /** + * Sends HTTP headers and content. + * + * @param bool $flush Whether output buffers should be flushed + * + * @return $this + */ + public function send(bool $flush = true): static + { + $this->sendHeaders(); + $this->sendContent(); + + if (!$flush) { + return $this; + } + + if (\function_exists('fastcgi_finish_request')) { + fastcgi_finish_request(); + } elseif (\function_exists('litespeed_finish_request')) { + litespeed_finish_request(); + } elseif (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) { + static::closeOutputBuffers(0, true); + flush(); + } + + return $this; + } + + /** + * Sets the response content. + * + * @return $this + */ + public function setContent(?string $content): static + { + $this->content = $content ?? ''; + + return $this; + } + + /** + * Gets the current response content. + */ + public function getContent(): string|false + { + return $this->content; + } + + /** + * Sets the HTTP protocol version (1.0 or 1.1). + * + * @return $this + * + * @final + */ + public function setProtocolVersion(string $version): static + { + $this->version = $version; + + return $this; + } + + /** + * Gets the HTTP protocol version. + * + * @final + */ + public function getProtocolVersion(): string + { + return $this->version; + } + + /** + * Sets the response status code. + * + * If the status text is null it will be automatically populated for the known + * status codes and left empty otherwise. + * + * @return $this + * + * @throws \InvalidArgumentException When the HTTP status code is not valid + * + * @final + */ + public function setStatusCode(int $code, ?string $text = null): static + { + $this->statusCode = $code; + if ($this->isInvalid()) { + throw new \InvalidArgumentException(\sprintf('The HTTP status code "%s" is not valid.', $code)); + } + + if (null === $text) { + $this->statusText = self::$statusTexts[$code] ?? 'unknown status'; + + return $this; + } + + $this->statusText = $text; + + return $this; + } + + /** + * Retrieves the status code for the current web response. + * + * @final + */ + public function getStatusCode(): int + { + return $this->statusCode; + } + + /** + * Sets the response charset. + * + * @return $this + * + * @final + */ + public function setCharset(string $charset): static + { + $this->charset = $charset; + + return $this; + } + + /** + * Retrieves the response charset. + * + * @final + */ + public function getCharset(): ?string + { + return $this->charset; + } + + /** + * Returns true if the response may safely be kept in a shared (surrogate) cache. + * + * Responses marked "private" with an explicit Cache-Control directive are + * considered uncacheable. + * + * Responses with neither a freshness lifetime (Expires, max-age) nor cache + * validator (Last-Modified, ETag) are considered uncacheable because there is + * no way to tell when or how to remove them from the cache. + * + * Note that RFC 7231 and RFC 7234 possibly allow for a more permissive implementation, + * for example "status codes that are defined as cacheable by default [...] + * can be reused by a cache with heuristic expiration unless otherwise indicated" + * (https://tools.ietf.org/html/rfc7231#section-6.1) + * + * @final + */ + public function isCacheable(): bool + { + if (!\in_array($this->statusCode, [200, 203, 300, 301, 302, 404, 410])) { + return false; + } + + if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) { + return false; + } + + return $this->isValidateable() || $this->isFresh(); + } + + /** + * Returns true if the response is "fresh". + * + * Fresh responses may be served from cache without any interaction with the + * origin. A response is considered fresh when it includes a Cache-Control/max-age + * indicator or Expires header and the calculated age is less than the freshness lifetime. + * + * @final + */ + public function isFresh(): bool + { + return $this->getTtl() > 0; + } + + /** + * Returns true if the response includes headers that can be used to validate + * the response with the origin server using a conditional GET request. + * + * @final + */ + public function isValidateable(): bool + { + return $this->headers->has('Last-Modified') || $this->headers->has('ETag'); + } + + /** + * Marks the response as "private". + * + * It makes the response ineligible for serving other clients. + * + * @return $this + * + * @final + */ + public function setPrivate(): static + { + $this->headers->removeCacheControlDirective('public'); + $this->headers->addCacheControlDirective('private'); + + return $this; + } + + /** + * Marks the response as "public". + * + * It makes the response eligible for serving other clients. + * + * @return $this + * + * @final + */ + public function setPublic(): static + { + $this->headers->addCacheControlDirective('public'); + $this->headers->removeCacheControlDirective('private'); + + return $this; + } + + /** + * Marks the response as "immutable". + * + * @return $this + * + * @final + */ + public function setImmutable(bool $immutable = true): static + { + if ($immutable) { + $this->headers->addCacheControlDirective('immutable'); + } else { + $this->headers->removeCacheControlDirective('immutable'); + } + + return $this; + } + + /** + * Returns true if the response is marked as "immutable". + * + * @final + */ + public function isImmutable(): bool + { + return $this->headers->hasCacheControlDirective('immutable'); + } + + /** + * Returns true if the response must be revalidated by shared caches once it has become stale. + * + * This method indicates that the response must not be served stale by a + * cache in any circumstance without first revalidating with the origin. + * When present, the TTL of the response should not be overridden to be + * greater than the value provided by the origin. + * + * @final + */ + public function mustRevalidate(): bool + { + return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->hasCacheControlDirective('proxy-revalidate'); + } + + /** + * Returns the Date header as a DateTime instance. + * + * @throws \RuntimeException When the header is not parseable + * + * @final + */ + public function getDate(): ?\DateTimeImmutable + { + return $this->headers->getDate('Date'); + } + + /** + * Sets the Date header. + * + * @return $this + * + * @final + */ + public function setDate(\DateTimeInterface $date): static + { + $date = \DateTimeImmutable::createFromInterface($date); + $date = $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT'); + + return $this; + } + + /** + * Returns the age of the response in seconds. + * + * @final + */ + public function getAge(): int + { + if (null !== $age = $this->headers->get('Age')) { + return (int) $age; + } + + return max(time() - (int) $this->getDate()->format('U'), 0); + } + + /** + * Marks the response stale by setting the Age header to be equal to the maximum age of the response. + * + * @return $this + */ + public function expire(): static + { + if ($this->isFresh()) { + $this->headers->set('Age', $this->getMaxAge()); + $this->headers->remove('Expires'); + } + + return $this; + } + + /** + * Returns the value of the Expires header as a DateTime instance. + * + * @final + */ + public function getExpires(): ?\DateTimeImmutable + { + try { + return $this->headers->getDate('Expires'); + } catch (\RuntimeException) { + // according to RFC 2616 invalid date formats (e.g. "0" and "-1") must be treated as in the past + return \DateTimeImmutable::createFromFormat('U', time() - 172800); + } + } + + /** + * Sets the Expires HTTP header with a DateTime instance. + * + * Passing null as value will remove the header. + * + * @return $this + * + * @final + */ + public function setExpires(?\DateTimeInterface $date): static + { + if (null === $date) { + $this->headers->remove('Expires'); + + return $this; + } + + $date = \DateTimeImmutable::createFromInterface($date); + $date = $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT'); + + return $this; + } + + /** + * Returns the number of seconds after the time specified in the response's Date + * header when the response should no longer be considered fresh. + * + * First, it checks for a s-maxage directive, then a max-age directive, and then it falls + * back on an expires header. It returns null when no maximum age can be established. + * + * @final + */ + public function getMaxAge(): ?int + { + if ($this->headers->hasCacheControlDirective('s-maxage')) { + return (int) $this->headers->getCacheControlDirective('s-maxage'); + } + + if ($this->headers->hasCacheControlDirective('max-age')) { + return (int) $this->headers->getCacheControlDirective('max-age'); + } + + if (null !== $expires = $this->getExpires()) { + $maxAge = (int) $expires->format('U') - (int) $this->getDate()->format('U'); + + return max($maxAge, 0); + } + + return null; + } + + /** + * Sets the number of seconds after which the response should no longer be considered fresh. + * + * This method sets the Cache-Control max-age directive. + * + * @return $this + * + * @final + */ + public function setMaxAge(int $value): static + { + $this->headers->addCacheControlDirective('max-age', $value); + + return $this; + } + + /** + * Sets the number of seconds after which the response should no longer be returned by shared caches when backend is down. + * + * This method sets the Cache-Control stale-if-error directive. + * + * @return $this + * + * @final + */ + public function setStaleIfError(int $value): static + { + $this->headers->addCacheControlDirective('stale-if-error', $value); + + return $this; + } + + /** + * Sets the number of seconds after which the response should no longer return stale content by shared caches. + * + * This method sets the Cache-Control stale-while-revalidate directive. + * + * @return $this + * + * @final + */ + public function setStaleWhileRevalidate(int $value): static + { + $this->headers->addCacheControlDirective('stale-while-revalidate', $value); + + return $this; + } + + /** + * Sets the number of seconds after which the response should no longer be considered fresh by shared caches. + * + * This method sets the Cache-Control s-maxage directive. + * + * @return $this + * + * @final + */ + public function setSharedMaxAge(int $value): static + { + $this->setPublic(); + $this->headers->addCacheControlDirective('s-maxage', $value); + + return $this; + } + + /** + * Returns the response's time-to-live in seconds. + * + * It returns null when no freshness information is present in the response. + * + * When the response's TTL is 0, the response may not be served from cache without first + * revalidating with the origin. + * + * @final + */ + public function getTtl(): ?int + { + $maxAge = $this->getMaxAge(); + + return null !== $maxAge ? max($maxAge - $this->getAge(), 0) : null; + } + + /** + * Sets the response's time-to-live for shared caches in seconds. + * + * This method adjusts the Cache-Control/s-maxage directive. + * + * @return $this + * + * @final + */ + public function setTtl(int $seconds): static + { + $this->setSharedMaxAge($this->getAge() + $seconds); + + return $this; + } + + /** + * Sets the response's time-to-live for private/client caches in seconds. + * + * This method adjusts the Cache-Control/max-age directive. + * + * @return $this + * + * @final + */ + public function setClientTtl(int $seconds): static + { + $this->setMaxAge($this->getAge() + $seconds); + + return $this; + } + + /** + * Returns the Last-Modified HTTP header as a DateTime instance. + * + * @throws \RuntimeException When the HTTP header is not parseable + * + * @final + */ + public function getLastModified(): ?\DateTimeImmutable + { + return $this->headers->getDate('Last-Modified'); + } + + /** + * Sets the Last-Modified HTTP header with a DateTime instance. + * + * Passing null as value will remove the header. + * + * @return $this + * + * @final + */ + public function setLastModified(?\DateTimeInterface $date): static + { + if (null === $date) { + $this->headers->remove('Last-Modified'); + + return $this; + } + + $date = \DateTimeImmutable::createFromInterface($date); + $date = $date->setTimezone(new \DateTimeZone('UTC')); + $this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT'); + + return $this; + } + + /** + * Returns the literal value of the ETag HTTP header. + * + * @final + */ + public function getEtag(): ?string + { + return $this->headers->get('ETag'); + } + + /** + * Sets the ETag value. + * + * @param string|null $etag The ETag unique identifier or null to remove the header + * @param bool $weak Whether you want a weak ETag or not + * + * @return $this + * + * @final + */ + public function setEtag(?string $etag, bool $weak = false): static + { + if (null === $etag) { + $this->headers->remove('Etag'); + } else { + if (!str_starts_with($etag, '"')) { + $etag = '"'.$etag.'"'; + } + + $this->headers->set('ETag', (true === $weak ? 'W/' : '').$etag); + } + + return $this; + } + + /** + * Sets the response's cache headers (validation and/or expiration). + * + * Available options are: must_revalidate, no_cache, no_store, no_transform, public, private, proxy_revalidate, max_age, s_maxage, immutable, last_modified and etag. + * + * @return $this + * + * @throws \InvalidArgumentException + * + * @final + */ + public function setCache(array $options): static + { + if ($diff = array_diff(array_keys($options), array_keys(self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES))) { + throw new \InvalidArgumentException(\sprintf('Response does not support the following options: "%s".', implode('", "', $diff))); + } + + if (isset($options['etag'])) { + $this->setEtag($options['etag']); + } + + if (isset($options['last_modified'])) { + $this->setLastModified($options['last_modified']); + } + + if (isset($options['max_age'])) { + $this->setMaxAge($options['max_age']); + } + + if (isset($options['s_maxage'])) { + $this->setSharedMaxAge($options['s_maxage']); + } + + if (isset($options['stale_while_revalidate'])) { + $this->setStaleWhileRevalidate($options['stale_while_revalidate']); + } + + if (isset($options['stale_if_error'])) { + $this->setStaleIfError($options['stale_if_error']); + } + + foreach (self::HTTP_RESPONSE_CACHE_CONTROL_DIRECTIVES as $directive => $hasValue) { + if (!$hasValue && isset($options[$directive])) { + if ($options[$directive]) { + $this->headers->addCacheControlDirective(str_replace('_', '-', $directive)); + } else { + $this->headers->removeCacheControlDirective(str_replace('_', '-', $directive)); + } + } + } + + if (isset($options['public'])) { + if ($options['public']) { + $this->setPublic(); + } else { + $this->setPrivate(); + } + } + + if (isset($options['private'])) { + if ($options['private']) { + $this->setPrivate(); + } else { + $this->setPublic(); + } + } + + return $this; + } + + /** + * Modifies the response so that it conforms to the rules defined for a 304 status code. + * + * This sets the status, removes the body, and discards any headers + * that MUST NOT be included in 304 responses. + * + * @return $this + * + * @see https://tools.ietf.org/html/rfc2616#section-10.3.5 + * + * @final + */ + public function setNotModified(): static + { + $this->setStatusCode(304); + $this->setContent(null); + + // remove headers that MUST NOT be included with 304 Not Modified responses + foreach (['Allow', 'Content-Encoding', 'Content-Language', 'Content-Length', 'Content-MD5', 'Content-Type', 'Last-Modified'] as $header) { + $this->headers->remove($header); + } + + return $this; + } + + /** + * Returns true if the response includes a Vary header. + * + * @final + */ + public function hasVary(): bool + { + return null !== $this->headers->get('Vary'); + } + + /** + * Returns an array of header names given in the Vary header. + * + * @final + */ + public function getVary(): array + { + if (!$vary = $this->headers->all('Vary')) { + return []; + } + + $ret = []; + foreach ($vary as $item) { + $ret[] = preg_split('/[\s,]+/', $item); + } + + return array_merge([], ...$ret); + } + + /** + * Sets the Vary header. + * + * @param bool $replace Whether to replace the actual value or not (true by default) + * + * @return $this + * + * @final + */ + public function setVary(string|array $headers, bool $replace = true): static + { + $this->headers->set('Vary', $headers, $replace); + + return $this; + } + + /** + * Determines if the Response validators (ETag, Last-Modified) match + * a conditional value specified in the Request. + * + * If the Response is not modified, it sets the status code to 304 and + * removes the actual content by calling the setNotModified() method. + * + * @final + */ + public function isNotModified(Request $request): bool + { + if (!$request->isMethodCacheable()) { + return false; + } + + $notModified = false; + $lastModified = $this->headers->get('Last-Modified'); + $modifiedSince = $request->headers->get('If-Modified-Since'); + + if (($ifNoneMatchEtags = $request->getETags()) && (null !== $etag = $this->getEtag())) { + if (0 == strncmp($etag, 'W/', 2)) { + $etag = substr($etag, 2); + } + + // Use weak comparison as per https://tools.ietf.org/html/rfc7232#section-3.2. + foreach ($ifNoneMatchEtags as $ifNoneMatchEtag) { + if (0 == strncmp($ifNoneMatchEtag, 'W/', 2)) { + $ifNoneMatchEtag = substr($ifNoneMatchEtag, 2); + } + + if ($ifNoneMatchEtag === $etag || '*' === $ifNoneMatchEtag) { + $notModified = true; + break; + } + } + } + // Only do If-Modified-Since date comparison when If-None-Match is not present as per https://tools.ietf.org/html/rfc7232#section-3.3. + elseif ($modifiedSince && $lastModified) { + $notModified = strtotime($modifiedSince) >= strtotime($lastModified); + } + + if ($notModified) { + $this->setNotModified(); + } + + return $notModified; + } + + /** + * Is response invalid? + * + * @see https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + * + * @final + */ + public function isInvalid(): bool + { + return $this->statusCode < 100 || $this->statusCode >= 600; + } + + /** + * Is response informative? + * + * @final + */ + public function isInformational(): bool + { + return $this->statusCode >= 100 && $this->statusCode < 200; + } + + /** + * Is response successful? + * + * @final + */ + public function isSuccessful(): bool + { + return $this->statusCode >= 200 && $this->statusCode < 300; + } + + /** + * Is the response a redirect? + * + * @final + */ + public function isRedirection(): bool + { + return $this->statusCode >= 300 && $this->statusCode < 400; + } + + /** + * Is there a client error? + * + * @final + */ + public function isClientError(): bool + { + return $this->statusCode >= 400 && $this->statusCode < 500; + } + + /** + * Was there a server side error? + * + * @final + */ + public function isServerError(): bool + { + return $this->statusCode >= 500 && $this->statusCode < 600; + } + + /** + * Is the response OK? + * + * @final + */ + public function isOk(): bool + { + return 200 === $this->statusCode; + } + + /** + * Is the response forbidden? + * + * @final + */ + public function isForbidden(): bool + { + return 403 === $this->statusCode; + } + + /** + * Is the response a not found error? + * + * @final + */ + public function isNotFound(): bool + { + return 404 === $this->statusCode; + } + + /** + * Is the response a redirect of some form? + * + * @final + */ + public function isRedirect(?string $location = null): bool + { + return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location')); + } + + /** + * Is the response empty? + * + * @final + */ + public function isEmpty(): bool + { + return \in_array($this->statusCode, [204, 304]); + } + + /** + * Cleans or flushes output buffers up to target level. + * + * Resulting level can be greater than target level if a non-removable buffer has been encountered. + * + * @final + */ + public static function closeOutputBuffers(int $targetLevel, bool $flush): void + { + $status = ob_get_status(true); + $level = \count($status); + $flags = \PHP_OUTPUT_HANDLER_REMOVABLE | ($flush ? \PHP_OUTPUT_HANDLER_FLUSHABLE : \PHP_OUTPUT_HANDLER_CLEANABLE); + + while ($level-- > $targetLevel && ($s = $status[$level]) && (!isset($s['del']) ? !isset($s['flags']) || ($s['flags'] & $flags) === $flags : $s['del'])) { + if ($flush) { + ob_end_flush(); + } else { + ob_end_clean(); + } + } + } + + /** + * Marks a response as safe according to RFC8674. + * + * @see https://tools.ietf.org/html/rfc8674 + */ + public function setContentSafe(bool $safe = true): void + { + if ($safe) { + $this->headers->set('Preference-Applied', 'safe'); + } elseif ('safe' === $this->headers->get('Preference-Applied')) { + $this->headers->remove('Preference-Applied'); + } + + $this->setVary('Prefer', false); + } + + /** + * Checks if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9. + * + * @see http://support.microsoft.com/kb/323308 + * + * @final + */ + protected function ensureIEOverSSLCompatibility(Request $request): void + { + if (false !== stripos($this->headers->get('Content-Disposition') ?? '', 'attachment') && 1 == preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT') ?? '', $match) && true === $request->isSecure()) { + if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) { + $this->headers->remove('Cache-Control'); + } + } + } +} diff --git a/plugins/vendor/symfony/http-foundation/ResponseHeaderBag.php b/plugins/vendor/symfony/http-foundation/ResponseHeaderBag.php new file mode 100644 index 00000000..b2bdb500 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/ResponseHeaderBag.php @@ -0,0 +1,271 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ResponseHeaderBag is a container for Response HTTP headers. + * + * @author Fabien Potencier + */ +class ResponseHeaderBag extends HeaderBag +{ + public const COOKIES_FLAT = 'flat'; + public const COOKIES_ARRAY = 'array'; + + public const DISPOSITION_ATTACHMENT = 'attachment'; + public const DISPOSITION_INLINE = 'inline'; + + protected array $computedCacheControl = []; + protected array $cookies = []; + protected array $headerNames = []; + + public function __construct(array $headers = []) + { + parent::__construct($headers); + + if (!isset($this->headers['cache-control'])) { + $this->set('Cache-Control', ''); + } + + /* RFC2616 - 14.18 says all Responses need to have a Date */ + if (!isset($this->headers['date'])) { + $this->initDate(); + } + } + + /** + * Returns the headers, with original capitalizations. + */ + public function allPreserveCase(): array + { + $headers = []; + foreach ($this->all() as $name => $value) { + $headers[$this->headerNames[$name] ?? $name] = $value; + } + + return $headers; + } + + public function allPreserveCaseWithoutCookies(): array + { + $headers = $this->allPreserveCase(); + if (isset($this->headerNames['set-cookie'])) { + unset($headers[$this->headerNames['set-cookie']]); + } + + return $headers; + } + + public function replace(array $headers = []): void + { + $this->headerNames = []; + + parent::replace($headers); + + if (!isset($this->headers['cache-control'])) { + $this->set('Cache-Control', ''); + } + + if (!isset($this->headers['date'])) { + $this->initDate(); + } + } + + public function all(?string $key = null): array + { + $headers = parent::all(); + + if (null !== $key) { + $key = strtr($key, self::UPPER, self::LOWER); + + return 'set-cookie' !== $key ? $headers[$key] ?? [] : array_map('strval', $this->getCookies()); + } + + foreach ($this->getCookies() as $cookie) { + $headers['set-cookie'][] = (string) $cookie; + } + + return $headers; + } + + public function set(string $key, string|array|null $values, bool $replace = true): void + { + $uniqueKey = strtr($key, self::UPPER, self::LOWER); + + if ('set-cookie' === $uniqueKey) { + if ($replace) { + $this->cookies = []; + } + foreach ((array) $values as $cookie) { + $this->setCookie(Cookie::fromString($cookie)); + } + $this->headerNames[$uniqueKey] = $key; + + return; + } + + $this->headerNames[$uniqueKey] = $key; + + parent::set($key, $values, $replace); + + // ensure the cache-control header has sensible defaults + if (\in_array($uniqueKey, ['cache-control', 'etag', 'last-modified', 'expires'], true) && '' !== $computed = $this->computeCacheControlValue()) { + $this->headers['cache-control'] = [$computed]; + $this->headerNames['cache-control'] = 'Cache-Control'; + $this->computedCacheControl = $this->parseCacheControl($computed); + } + } + + public function remove(string $key): void + { + $uniqueKey = strtr($key, self::UPPER, self::LOWER); + unset($this->headerNames[$uniqueKey]); + + if ('set-cookie' === $uniqueKey) { + $this->cookies = []; + + return; + } + + parent::remove($key); + + if ('cache-control' === $uniqueKey) { + $this->computedCacheControl = []; + } + + if ('date' === $uniqueKey) { + $this->initDate(); + } + } + + public function hasCacheControlDirective(string $key): bool + { + return \array_key_exists($key, $this->computedCacheControl); + } + + public function getCacheControlDirective(string $key): bool|string|null + { + return $this->computedCacheControl[$key] ?? null; + } + + public function setCookie(Cookie $cookie): void + { + $this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie; + $this->headerNames['set-cookie'] = 'Set-Cookie'; + } + + /** + * Removes a cookie from the array, but does not unset it in the browser. + */ + public function removeCookie(string $name, ?string $path = '/', ?string $domain = null): void + { + $path ??= '/'; + + unset($this->cookies[$domain][$path][$name]); + + if (empty($this->cookies[$domain][$path])) { + unset($this->cookies[$domain][$path]); + + if (empty($this->cookies[$domain])) { + unset($this->cookies[$domain]); + } + } + + if (!$this->cookies) { + unset($this->headerNames['set-cookie']); + } + } + + /** + * Returns an array with all cookies. + * + * @return Cookie[] + * + * @throws \InvalidArgumentException When the $format is invalid + */ + public function getCookies(string $format = self::COOKIES_FLAT): array + { + if (!\in_array($format, [self::COOKIES_FLAT, self::COOKIES_ARRAY])) { + throw new \InvalidArgumentException(\sprintf('Format "%s" invalid (%s).', $format, implode(', ', [self::COOKIES_FLAT, self::COOKIES_ARRAY]))); + } + + if (self::COOKIES_ARRAY === $format) { + return $this->cookies; + } + + $flattenedCookies = []; + foreach ($this->cookies as $path) { + foreach ($path as $cookies) { + foreach ($cookies as $cookie) { + $flattenedCookies[] = $cookie; + } + } + } + + return $flattenedCookies; + } + + /** + * Clears a cookie in the browser. + * + * @param bool $partitioned + */ + public function clearCookie(string $name, ?string $path = '/', ?string $domain = null, bool $secure = false, bool $httpOnly = true, ?string $sameSite = null /* , bool $partitioned = false */): void + { + $partitioned = 6 < \func_num_args() ? func_get_arg(6) : false; + + $this->setCookie(new Cookie($name, null, 1, $path, $domain, $secure, $httpOnly, false, $sameSite, $partitioned)); + } + + /** + * @see HeaderUtils::makeDisposition() + */ + public function makeDisposition(string $disposition, string $filename, string $filenameFallback = ''): string + { + return HeaderUtils::makeDisposition($disposition, $filename, $filenameFallback); + } + + /** + * Returns the calculated value of the cache-control header. + * + * This considers several other headers and calculates or modifies the + * cache-control header to a sensible, conservative value. + */ + protected function computeCacheControlValue(): string + { + if (!$this->cacheControl) { + if ($this->has('Last-Modified') || $this->has('Expires')) { + return 'private, must-revalidate'; // allows for heuristic expiration (RFC 7234 Section 4.2.2) in the case of "Last-Modified" + } + + // conservative by default + return 'no-cache, private'; + } + + $header = $this->getCacheControlHeader(); + if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) { + return $header; + } + + // public if s-maxage is defined, private otherwise + if (!isset($this->cacheControl['s-maxage'])) { + return $header.', private'; + } + + return $header; + } + + private function initDate(): void + { + $this->set('Date', gmdate('D, d M Y H:i:s').' GMT'); + } +} diff --git a/plugins/vendor/symfony/http-foundation/ServerBag.php b/plugins/vendor/symfony/http-foundation/ServerBag.php new file mode 100644 index 00000000..09fc3866 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/ServerBag.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * ServerBag is a container for HTTP headers from the $_SERVER variable. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + * @author Robert Kiss + */ +class ServerBag extends ParameterBag +{ + /** + * Gets the HTTP headers. + */ + public function getHeaders(): array + { + $headers = []; + foreach ($this->parameters as $key => $value) { + if (str_starts_with($key, 'HTTP_')) { + $headers[substr($key, 5)] = $value; + } elseif (\in_array($key, ['CONTENT_TYPE', 'CONTENT_LENGTH', 'CONTENT_MD5'], true) && '' !== $value) { + $headers[$key] = $value; + } + } + + if (isset($this->parameters['PHP_AUTH_USER'])) { + $headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER']; + $headers['PHP_AUTH_PW'] = $this->parameters['PHP_AUTH_PW'] ?? ''; + } else { + /* + * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default + * For this workaround to work, add these lines to your .htaccess file: + * RewriteCond %{HTTP:Authorization} .+ + * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0] + * + * A sample .htaccess file: + * RewriteEngine On + * RewriteCond %{HTTP:Authorization} .+ + * RewriteRule ^ - [E=HTTP_AUTHORIZATION:%0] + * RewriteCond %{REQUEST_FILENAME} !-f + * RewriteRule ^(.*)$ index.php [QSA,L] + */ + + $authorizationHeader = null; + if (isset($this->parameters['HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION']; + } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) { + $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION']; + } + + if (null !== $authorizationHeader) { + if (0 === stripos($authorizationHeader, 'basic ')) { + // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic + $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)), 2); + if (2 == \count($exploded)) { + [$headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']] = $exploded; + } + } elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader, 'digest '))) { + // In some circumstances PHP_AUTH_DIGEST needs to be set + $headers['PHP_AUTH_DIGEST'] = $authorizationHeader; + $this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader; + } elseif (0 === stripos($authorizationHeader, 'bearer ')) { + /* + * XXX: Since there is no PHP_AUTH_BEARER in PHP predefined variables, + * I'll just set $headers['AUTHORIZATION'] here. + * https://php.net/reserved.variables.server + */ + $headers['AUTHORIZATION'] = $authorizationHeader; + } + } + } + + if (isset($headers['AUTHORIZATION'])) { + return $headers; + } + + // PHP_AUTH_USER/PHP_AUTH_PW + if (isset($headers['PHP_AUTH_USER'])) { + $headers['AUTHORIZATION'] = 'Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.($headers['PHP_AUTH_PW'] ?? '')); + } elseif (isset($headers['PHP_AUTH_DIGEST'])) { + $headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST']; + } + + return $headers; + } +} diff --git a/plugins/vendor/symfony/http-foundation/ServerEvent.php b/plugins/vendor/symfony/http-foundation/ServerEvent.php new file mode 100644 index 00000000..ea2b5c88 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/ServerEvent.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * An event generated on the server intended for streaming to the client + * as part of the SSE streaming technique. + * + * @implements \IteratorAggregate + * + * @author Yonel Ceruto + */ +class ServerEvent implements \IteratorAggregate +{ + /** + * @param string|iterable $data The event data field for the message + * @param string|null $type The event type + * @param int|null $retry The number of milliseconds the client should wait + * before reconnecting in case of network failure + * @param string|null $id The event ID to set the EventSource object's last event ID value + * @param string|null $comment The event comment + */ + public function __construct( + private string|iterable $data, + private ?string $type = null, + private ?int $retry = null, + private ?string $id = null, + private ?string $comment = null, + ) { + } + + public function getData(): iterable|string + { + return $this->data; + } + + /** + * @return $this + */ + public function setData(iterable|string $data): static + { + $this->data = $data; + + return $this; + } + + public function getType(): ?string + { + return $this->type; + } + + /** + * @return $this + */ + public function setType(string $type): static + { + $this->type = $type; + + return $this; + } + + public function getRetry(): ?int + { + return $this->retry; + } + + /** + * @return $this + */ + public function setRetry(?int $retry): static + { + $this->retry = $retry; + + return $this; + } + + public function getId(): ?string + { + return $this->id; + } + + /** + * @return $this + */ + public function setId(string $id): static + { + $this->id = $id; + + return $this; + } + + public function getComment(): ?string + { + return $this->comment; + } + + public function setComment(string $comment): static + { + $this->comment = $comment; + + return $this; + } + + /** + * @return \Traversable + */ + public function getIterator(): \Traversable + { + static $lastRetry = null; + + $head = ''; + if ($this->comment) { + $head .= \sprintf(': %s', $this->comment)."\n"; + } + if ($this->id) { + $head .= \sprintf('id: %s', $this->id)."\n"; + } + if ($this->retry > 0 && $this->retry !== $lastRetry) { + $head .= \sprintf('retry: %s', $lastRetry = $this->retry)."\n"; + } + if ($this->type) { + $head .= \sprintf('event: %s', $this->type)."\n"; + } + yield $head; + + if ($this->data) { + if (is_iterable($this->data)) { + foreach ($this->data as $data) { + yield \sprintf('data: %s', $data)."\n"; + } + } else { + yield \sprintf('data: %s', $this->data)."\n"; + } + } + + yield "\n"; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php b/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php new file mode 100644 index 00000000..e34a497c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBag.php @@ -0,0 +1,117 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +/** + * This class relates to session attribute storage. + * + * @implements \IteratorAggregate + */ +class AttributeBag implements AttributeBagInterface, \IteratorAggregate, \Countable +{ + protected array $attributes = []; + + private string $name = 'attributes'; + + /** + * @param string $storageKey The key used to store attributes in the session + */ + public function __construct( + private string $storageKey = '_sf2_attributes', + ) { + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function initialize(array &$attributes): void + { + $this->attributes = &$attributes; + } + + public function getStorageKey(): string + { + return $this->storageKey; + } + + public function has(string $name): bool + { + return \array_key_exists($name, $this->attributes); + } + + public function get(string $name, mixed $default = null): mixed + { + return \array_key_exists($name, $this->attributes) ? $this->attributes[$name] : $default; + } + + public function set(string $name, mixed $value): void + { + $this->attributes[$name] = $value; + } + + public function all(): array + { + return $this->attributes; + } + + public function replace(array $attributes): void + { + $this->attributes = []; + foreach ($attributes as $key => $value) { + $this->set($key, $value); + } + } + + public function remove(string $name): mixed + { + $retval = null; + if (\array_key_exists($name, $this->attributes)) { + $retval = $this->attributes[$name]; + unset($this->attributes[$name]); + } + + return $retval; + } + + public function clear(): mixed + { + $return = $this->attributes; + $this->attributes = []; + + return $return; + } + + /** + * Returns an iterator for attributes. + * + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator($this->attributes); + } + + /** + * Returns the number of attributes. + */ + public function count(): int + { + return \count($this->attributes); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php b/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php new file mode 100644 index 00000000..39ec9d75 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Attribute; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * Attributes store. + * + * @author Drak + */ +interface AttributeBagInterface extends SessionBagInterface +{ + /** + * Checks if an attribute is defined. + */ + public function has(string $name): bool; + + /** + * Returns an attribute. + */ + public function get(string $name, mixed $default = null): mixed; + + /** + * Sets an attribute. + */ + public function set(string $name, mixed $value): void; + + /** + * Returns attributes. + * + * @return array + */ + public function all(): array; + + public function replace(array $attributes): void; + + /** + * Removes an attribute. + * + * @return mixed The removed value or null when it does not exist + */ + public function remove(string $name): mixed; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php b/plugins/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php new file mode 100644 index 00000000..bfb856d5 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Flash/AutoExpireFlashBag.php @@ -0,0 +1,121 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +/** + * AutoExpireFlashBag flash message container. + * + * @author Drak + */ +class AutoExpireFlashBag implements FlashBagInterface +{ + private string $name = 'flashes'; + private array $flashes = ['display' => [], 'new' => []]; + + /** + * @param string $storageKey The key used to store flashes in the session + */ + public function __construct( + private string $storageKey = '_symfony_flashes', + ) { + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function initialize(array &$flashes): void + { + $this->flashes = &$flashes; + + // The logic: messages from the last request will be stored in new, so we move them to previous + // This request we will show what is in 'display'. What is placed into 'new' this time round will + // be moved to display next time round. + $this->flashes['display'] = \array_key_exists('new', $this->flashes) ? $this->flashes['new'] : []; + $this->flashes['new'] = []; + } + + public function add(string $type, mixed $message): void + { + $this->flashes['new'][$type][] = $message; + } + + public function peek(string $type, array $default = []): array + { + return $this->has($type) ? $this->flashes['display'][$type] : $default; + } + + public function peekAll(): array + { + return \array_key_exists('display', $this->flashes) ? $this->flashes['display'] : []; + } + + public function get(string $type, array $default = []): array + { + $return = $default; + + if (!$this->has($type)) { + return $return; + } + + if (isset($this->flashes['display'][$type])) { + $return = $this->flashes['display'][$type]; + unset($this->flashes['display'][$type]); + } + + return $return; + } + + public function all(): array + { + $return = $this->flashes['display']; + $this->flashes['display'] = []; + + return $return; + } + + public function setAll(array $messages): void + { + $this->flashes['new'] = $messages; + } + + public function set(string $type, string|array $messages): void + { + $this->flashes['new'][$type] = (array) $messages; + } + + public function has(string $type): bool + { + return \array_key_exists($type, $this->flashes['display']) && $this->flashes['display'][$type]; + } + + public function keys(): array + { + return array_keys($this->flashes['display']); + } + + public function getStorageKey(): string + { + return $this->storageKey; + } + + public function clear(): mixed + { + return $this->all(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBag.php b/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBag.php new file mode 100644 index 00000000..72753a66 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBag.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +/** + * FlashBag flash message container. + * + * @author Drak + */ +class FlashBag implements FlashBagInterface +{ + private string $name = 'flashes'; + private array $flashes = []; + + /** + * @param string $storageKey The key used to store flashes in the session + */ + public function __construct( + private string $storageKey = '_symfony_flashes', + ) { + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function initialize(array &$flashes): void + { + $this->flashes = &$flashes; + } + + public function add(string $type, mixed $message): void + { + $this->flashes[$type][] = $message; + } + + public function peek(string $type, array $default = []): array + { + return $this->has($type) ? $this->flashes[$type] : $default; + } + + public function peekAll(): array + { + return $this->flashes; + } + + public function get(string $type, array $default = []): array + { + if (!$this->has($type)) { + return $default; + } + + $return = $this->flashes[$type]; + + unset($this->flashes[$type]); + + return $return; + } + + public function all(): array + { + $return = $this->peekAll(); + $this->flashes = []; + + return $return; + } + + public function set(string $type, string|array $messages): void + { + $this->flashes[$type] = (array) $messages; + } + + public function setAll(array $messages): void + { + $this->flashes = $messages; + } + + public function has(string $type): bool + { + return \array_key_exists($type, $this->flashes) && $this->flashes[$type]; + } + + public function keys(): array + { + return array_keys($this->flashes); + } + + public function getStorageKey(): string + { + return $this->storageKey; + } + + public function clear(): mixed + { + return $this->all(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php b/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php new file mode 100644 index 00000000..79e98f54 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Flash; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * FlashBagInterface. + * + * @author Drak + */ +interface FlashBagInterface extends SessionBagInterface +{ + /** + * Adds a flash message for the given type. + */ + public function add(string $type, mixed $message): void; + + /** + * Registers one or more messages for a given type. + */ + public function set(string $type, string|array $messages): void; + + /** + * Gets flash messages for a given type. + * + * @param string $type Message category type + * @param array $default Default value if $type does not exist + */ + public function peek(string $type, array $default = []): array; + + /** + * Gets all flash messages. + */ + public function peekAll(): array; + + /** + * Gets and clears flash from the stack. + * + * @param array $default Default value if $type does not exist + */ + public function get(string $type, array $default = []): array; + + /** + * Gets and clears flashes from the stack. + */ + public function all(): array; + + /** + * Sets all flash messages. + */ + public function setAll(array $messages): void; + + /** + * Has flash messages for a given type? + */ + public function has(string $type): bool; + + /** + * Returns a list of all defined types. + */ + public function keys(): array; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php b/plugins/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php new file mode 100644 index 00000000..90151d38 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; + +/** + * Interface for session with a flashbag. + */ +interface FlashBagAwareSessionInterface extends SessionInterface +{ + public function getFlashBag(): FlashBagInterface; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Session.php b/plugins/vendor/symfony/http-foundation/Session/Session.php new file mode 100644 index 00000000..972021fd --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Session.php @@ -0,0 +1,223 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; +use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; +use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; +use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; +use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(AttributeBag::class); +class_exists(FlashBag::class); +class_exists(SessionBagProxy::class); + +/** + * @author Fabien Potencier + * @author Drak + * + * @implements \IteratorAggregate + */ +class Session implements FlashBagAwareSessionInterface, \IteratorAggregate, \Countable +{ + protected SessionStorageInterface $storage; + + private string $flashName; + private string $attributeName; + private array $data = []; + private int $usageIndex = 0; + private ?\Closure $usageReporter; + + public function __construct(?SessionStorageInterface $storage = null, ?AttributeBagInterface $attributes = null, ?FlashBagInterface $flashes = null, ?callable $usageReporter = null) + { + $this->storage = $storage ?? new NativeSessionStorage(); + $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); + + $attributes ??= new AttributeBag(); + $this->attributeName = $attributes->getName(); + $this->registerBag($attributes); + + $flashes ??= new FlashBag(); + $this->flashName = $flashes->getName(); + $this->registerBag($flashes); + } + + public function start(): bool + { + return $this->storage->start(); + } + + public function has(string $name): bool + { + return $this->getAttributeBag()->has($name); + } + + public function get(string $name, mixed $default = null): mixed + { + return $this->getAttributeBag()->get($name, $default); + } + + public function set(string $name, mixed $value): void + { + $this->getAttributeBag()->set($name, $value); + } + + public function all(): array + { + return $this->getAttributeBag()->all(); + } + + public function replace(array $attributes): void + { + $this->getAttributeBag()->replace($attributes); + } + + public function remove(string $name): mixed + { + return $this->getAttributeBag()->remove($name); + } + + public function clear(): void + { + $this->getAttributeBag()->clear(); + } + + public function isStarted(): bool + { + return $this->storage->isStarted(); + } + + /** + * Returns an iterator for attributes. + * + * @return \ArrayIterator + */ + public function getIterator(): \ArrayIterator + { + return new \ArrayIterator($this->getAttributeBag()->all()); + } + + /** + * Returns the number of attributes. + */ + public function count(): int + { + return \count($this->getAttributeBag()->all()); + } + + public function &getUsageIndex(): int + { + return $this->usageIndex; + } + + /** + * @internal + */ + public function isEmpty(): bool + { + if ($this->isStarted()) { + ++$this->usageIndex; + if ($this->usageReporter && 0 <= $this->usageIndex) { + ($this->usageReporter)(); + } + } + foreach ($this->data as &$data) { + if ($data) { + return false; + } + } + + return true; + } + + public function invalidate(?int $lifetime = null): bool + { + $this->storage->clear(); + + return $this->migrate(true, $lifetime); + } + + public function migrate(bool $destroy = false, ?int $lifetime = null): bool + { + return $this->storage->regenerate($destroy, $lifetime); + } + + public function save(): void + { + $this->storage->save(); + } + + public function getId(): string + { + return $this->storage->getId(); + } + + public function setId(string $id): void + { + if ($this->storage->getId() !== $id) { + $this->storage->setId($id); + } + } + + public function getName(): string + { + return $this->storage->getName(); + } + + public function setName(string $name): void + { + $this->storage->setName($name); + } + + public function getMetadataBag(): MetadataBag + { + ++$this->usageIndex; + if ($this->usageReporter && 0 <= $this->usageIndex) { + ($this->usageReporter)(); + } + + return $this->storage->getMetadataBag(); + } + + public function registerBag(SessionBagInterface $bag): void + { + $this->storage->registerBag(new SessionBagProxy($bag, $this->data, $this->usageIndex, $this->usageReporter)); + } + + public function getBag(string $name): SessionBagInterface + { + $bag = $this->storage->getBag($name); + + return method_exists($bag, 'getBag') ? $bag->getBag() : $bag; + } + + /** + * Gets the flashbag interface. + */ + public function getFlashBag(): FlashBagInterface + { + return $this->getBag($this->flashName); + } + + /** + * Gets the attributebag interface. + * + * Note that this method was added to help with IDE autocompletion. + */ + private function getAttributeBag(): AttributeBagInterface + { + return $this->getBag($this->attributeName); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionBagInterface.php b/plugins/vendor/symfony/http-foundation/Session/SessionBagInterface.php new file mode 100644 index 00000000..6a224cf1 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionBagInterface.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +/** + * Session Bag store. + * + * @author Drak + */ +interface SessionBagInterface +{ + /** + * Gets this bag's name. + */ + public function getName(): string; + + /** + * Initializes the Bag. + */ + public function initialize(array &$array): void; + + /** + * Gets the storage key for this bag. + */ + public function getStorageKey(): string; + + /** + * Clears out data from bag. + * + * @return mixed Whatever data was contained + */ + public function clear(): mixed; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionBagProxy.php b/plugins/vendor/symfony/http-foundation/Session/SessionBagProxy.php new file mode 100644 index 00000000..a389bd8b --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionBagProxy.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +/** + * @author Nicolas Grekas + * + * @internal + */ +final class SessionBagProxy implements SessionBagInterface +{ + private array $data; + private ?int $usageIndex; + private ?\Closure $usageReporter; + + public function __construct( + private SessionBagInterface $bag, + array &$data, + ?int &$usageIndex, + ?callable $usageReporter, + ) { + $this->bag = $bag; + $this->data = &$data; + $this->usageIndex = &$usageIndex; + $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); + } + + public function getBag(): SessionBagInterface + { + ++$this->usageIndex; + if ($this->usageReporter && 0 <= $this->usageIndex) { + ($this->usageReporter)(); + } + + return $this->bag; + } + + public function isEmpty(): bool + { + if (!isset($this->data[$this->bag->getStorageKey()])) { + return true; + } + ++$this->usageIndex; + if ($this->usageReporter && 0 <= $this->usageIndex) { + ($this->usageReporter)(); + } + + return empty($this->data[$this->bag->getStorageKey()]); + } + + public function getName(): string + { + return $this->bag->getName(); + } + + public function initialize(array &$array): void + { + ++$this->usageIndex; + if ($this->usageReporter && 0 <= $this->usageIndex) { + ($this->usageReporter)(); + } + + $this->data[$this->bag->getStorageKey()] = &$array; + + $this->bag->initialize($array); + } + + public function getStorageKey(): string + { + return $this->bag->getStorageKey(); + } + + public function clear(): mixed + { + return $this->bag->clear(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionFactory.php b/plugins/vendor/symfony/http-foundation/Session/SessionFactory.php new file mode 100644 index 00000000..b875a23c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionFactory.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\RequestStack; +use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageFactoryInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(Session::class); + +/** + * @author Jérémy Derussé + */ +class SessionFactory implements SessionFactoryInterface +{ + private ?\Closure $usageReporter; + + public function __construct( + private RequestStack $requestStack, + private SessionStorageFactoryInterface $storageFactory, + ?callable $usageReporter = null, + ) { + $this->usageReporter = null === $usageReporter ? null : $usageReporter(...); + } + + public function createSession(): SessionInterface + { + return new Session($this->storageFactory->createStorage($this->requestStack->getMainRequest()), null, null, $this->usageReporter); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php b/plugins/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php new file mode 100644 index 00000000..b24fdc49 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionFactoryInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +/** + * @author Kevin Bond + */ +interface SessionFactoryInterface +{ + public function createSession(): SessionInterface; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionInterface.php b/plugins/vendor/symfony/http-foundation/Session/SessionInterface.php new file mode 100644 index 00000000..3e29ba42 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionInterface.php @@ -0,0 +1,140 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; + +/** + * Interface for the session. + * + * @author Drak + */ +interface SessionInterface +{ + /** + * Starts the session storage. + * + * @throws \RuntimeException if session fails to start + */ + public function start(): bool; + + /** + * Returns the session ID. + */ + public function getId(): string; + + /** + * Sets the session ID. + */ + public function setId(string $id): void; + + /** + * Returns the session name. + */ + public function getName(): string; + + /** + * Sets the session name. + */ + public function setName(string $name): void; + + /** + * Invalidates the current session. + * + * Clears all session attributes and flashes and regenerates the + * session and deletes the old session from persistence. + * + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + */ + public function invalidate(?int $lifetime = null): bool; + + /** + * Migrates the current session to a new session id while maintaining all + * session attributes. + * + * @param bool $destroy Whether to delete the old session or leave it to garbage collection + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + */ + public function migrate(bool $destroy = false, ?int $lifetime = null): bool; + + /** + * Force the session to be saved and closed. + * + * This method is generally not required for real sessions as + * the session will be automatically saved at the end of + * code execution. + */ + public function save(): void; + + /** + * Checks if an attribute is defined. + */ + public function has(string $name): bool; + + /** + * Returns an attribute. + */ + public function get(string $name, mixed $default = null): mixed; + + /** + * Sets an attribute. + */ + public function set(string $name, mixed $value): void; + + /** + * Returns attributes. + */ + public function all(): array; + + /** + * Sets attributes. + */ + public function replace(array $attributes): void; + + /** + * Removes an attribute. + * + * @return mixed The removed value or null when it does not exist + */ + public function remove(string $name): mixed; + + /** + * Clears all attributes. + */ + public function clear(): void; + + /** + * Checks if the session was started. + */ + public function isStarted(): bool; + + /** + * Registers a SessionBagInterface with the session. + */ + public function registerBag(SessionBagInterface $bag): void; + + /** + * Gets a bag instance by name. + */ + public function getBag(string $name): SessionBagInterface; + + /** + * Gets session meta. + */ + public function getMetadataBag(): MetadataBag; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/SessionUtils.php b/plugins/vendor/symfony/http-foundation/Session/SessionUtils.php new file mode 100644 index 00000000..57aa565f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/SessionUtils.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session; + +/** + * Session utility functions. + * + * @author Nicolas Grekas + * @author Rémon van de Kamp + * + * @internal + */ +final class SessionUtils +{ + /** + * Finds the session header amongst the headers that are to be sent, removes it, and returns + * it so the caller can process it further. + */ + public static function popSessionCookie(string $sessionName, #[\SensitiveParameter] string $sessionId): ?string + { + $sessionCookie = null; + $sessionCookiePrefix = \sprintf(' %s=', urlencode($sessionName)); + $sessionCookieWithId = \sprintf('%s%s;', $sessionCookiePrefix, urlencode($sessionId)); + $otherCookies = []; + foreach (headers_list() as $h) { + if (0 !== stripos($h, 'Set-Cookie:')) { + continue; + } + if (11 === strpos($h, $sessionCookiePrefix, 11)) { + $sessionCookie = $h; + + if (11 !== strpos($h, $sessionCookieWithId, 11)) { + $otherCookies[] = $h; + } + } else { + $otherCookies[] = $h; + } + } + if (null === $sessionCookie) { + return null; + } + + header_remove('Set-Cookie'); + foreach ($otherCookies as $h) { + header($h, false); + } + + return $sessionCookie; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php new file mode 100644 index 00000000..fd856237 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/AbstractSessionHandler.php @@ -0,0 +1,111 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Symfony\Component\HttpFoundation\Session\SessionUtils; + +/** + * This abstract session handler provides a generic implementation + * of the PHP 7.0 SessionUpdateTimestampHandlerInterface, + * enabling strict and lazy session handling. + * + * @author Nicolas Grekas + */ +abstract class AbstractSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface +{ + private string $sessionName; + private string $prefetchId; + private string $prefetchData; + private ?string $newSessionId = null; + private string $igbinaryEmptyData; + + public function open(string $savePath, string $sessionName): bool + { + $this->sessionName = $sessionName; + if (!headers_sent() && !\ini_get('session.cache_limiter') && '0' !== \ini_get('session.cache_limiter')) { + header(\sprintf('Cache-Control: max-age=%d, private, must-revalidate', 60 * (int) \ini_get('session.cache_expire'))); + } + + return true; + } + + abstract protected function doRead(#[\SensitiveParameter] string $sessionId): string; + + abstract protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool; + + abstract protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool; + + public function validateId(#[\SensitiveParameter] string $sessionId): bool + { + $this->prefetchData = $this->read($sessionId); + $this->prefetchId = $sessionId; + + return '' !== $this->prefetchData; + } + + public function read(#[\SensitiveParameter] string $sessionId): string + { + if (isset($this->prefetchId)) { + $prefetchId = $this->prefetchId; + $prefetchData = $this->prefetchData; + unset($this->prefetchId, $this->prefetchData); + + if ($prefetchId === $sessionId || '' === $prefetchData) { + $this->newSessionId = '' === $prefetchData ? $sessionId : null; + + return $prefetchData; + } + } + + $data = $this->doRead($sessionId); + $this->newSessionId = '' === $data ? $sessionId : null; + + return $data; + } + + public function write(#[\SensitiveParameter] string $sessionId, string $data): bool + { + // see https://github.com/igbinary/igbinary/issues/146 + $this->igbinaryEmptyData ??= \function_exists('igbinary_serialize') ? igbinary_serialize([]) : ''; + if ('' === $data || $this->igbinaryEmptyData === $data) { + return $this->destroy($sessionId); + } + $this->newSessionId = null; + + return $this->doWrite($sessionId, $data); + } + + public function destroy(#[\SensitiveParameter] string $sessionId): bool + { + if (!headers_sent() && filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL)) { + if (!isset($this->sessionName)) { + throw new \LogicException(\sprintf('Session name cannot be empty, did you forget to call "parent::open()" in "%s"?.', static::class)); + } + $cookie = SessionUtils::popSessionCookie($this->sessionName, $sessionId); + + /* + * We send an invalidation Set-Cookie header (zero lifetime) + * when either the session was started or a cookie with + * the session name was sent by the client (in which case + * we know it's invalid as a valid session cookie would've + * started the session). + */ + if (null === $cookie || isset($_COOKIE[$this->sessionName])) { + $params = session_get_cookie_params(); + unset($params['lifetime']); + setcookie($this->sessionName, '', $params); + } + } + + return $this->newSessionId === $sessionId || $this->doDestroy($sessionId); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php new file mode 100644 index 00000000..70ac7624 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/IdentityMarshaller.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Symfony\Component\Cache\Marshaller\MarshallerInterface; + +/** + * @author Ahmed TAILOULOUTE + */ +class IdentityMarshaller implements MarshallerInterface +{ + public function marshall(array $values, ?array &$failed): array + { + foreach ($values as $key => $value) { + if (!\is_string($value)) { + throw new \LogicException(\sprintf('%s accepts only string as data.', __METHOD__)); + } + } + + return $values; + } + + public function unmarshall(string $value): string + { + return $value; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php new file mode 100644 index 00000000..8e82f184 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MarshallingSessionHandler.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Symfony\Component\Cache\Marshaller\MarshallerInterface; + +/** + * @author Ahmed TAILOULOUTE + */ +class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface +{ + public function __construct( + private AbstractSessionHandler $handler, + private MarshallerInterface $marshaller, + ) { + } + + public function open(string $savePath, string $name): bool + { + return $this->handler->open($savePath, $name); + } + + public function close(): bool + { + return $this->handler->close(); + } + + public function destroy(#[\SensitiveParameter] string $sessionId): bool + { + return $this->handler->destroy($sessionId); + } + + public function gc(int $maxlifetime): int|false + { + return $this->handler->gc($maxlifetime); + } + + public function read(#[\SensitiveParameter] string $sessionId): string + { + return $this->marshaller->unmarshall($this->handler->read($sessionId)); + } + + public function write(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $failed = []; + $marshalledData = $this->marshaller->marshall(['data' => $data], $failed); + + if (isset($failed['data'])) { + return false; + } + + return $this->handler->write($sessionId, $marshalledData['data']); + } + + public function validateId(#[\SensitiveParameter] string $sessionId): bool + { + return $this->handler->validateId($sessionId); + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->handler->updateTimestamp($sessionId, $data); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php new file mode 100644 index 00000000..4b95d887 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MemcachedSessionHandler.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Memcached based session storage handler based on the Memcached class + * provided by the PHP memcached extension. + * + * @see https://php.net/memcached + * + * @author Drak + */ +class MemcachedSessionHandler extends AbstractSessionHandler +{ + /** + * Time to live in seconds. + */ + private int|\Closure|null $ttl; + + /** + * Key prefix for shared environments. + */ + private string $prefix; + + /** + * Constructor. + * + * List of available options: + * * prefix: The prefix to use for the memcached keys in order to avoid collision + * * ttl: The time to live in seconds. + * + * @throws \InvalidArgumentException When unsupported options are passed + */ + public function __construct( + private \Memcached $memcached, + array $options = [], + ) { + if ($diff = array_diff(array_keys($options), ['prefix', 'expiretime', 'ttl'])) { + throw new \InvalidArgumentException(\sprintf('The following options are not supported "%s".', implode(', ', $diff))); + } + + $this->ttl = $options['expiretime'] ?? $options['ttl'] ?? null; + $this->prefix = $options['prefix'] ?? 'sf2s'; + } + + public function close(): bool + { + return $this->memcached->quit(); + } + + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + return $this->memcached->get($this->prefix.$sessionId) ?: ''; + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $this->memcached->touch($this->prefix.$sessionId, $this->getCompatibleTtl()); + + return true; + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->memcached->set($this->prefix.$sessionId, $data, $this->getCompatibleTtl()); + } + + private function getCompatibleTtl(): int + { + $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); + + // If the relative TTL that is used exceeds 30 days, memcached will treat the value as Unix time. + // We have to convert it to an absolute Unix time at this point, to make sure the TTL is correct. + if ($ttl > 60 * 60 * 24 * 30) { + $ttl += time(); + } + + return $ttl; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + $result = $this->memcached->delete($this->prefix.$sessionId); + + return $result || \Memcached::RES_NOTFOUND == $this->memcached->getResultCode(); + } + + public function gc(int $maxlifetime): int|false + { + // not required here because memcached will auto expire the records anyhow. + return 0; + } + + /** + * Return a Memcached instance. + */ + protected function getMemcached(): \Memcached + { + return $this->memcached; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php new file mode 100644 index 00000000..8ed6a7b3 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MigratingSessionHandler.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Migrating session handler for migrating from one handler to another. It reads + * from the current handler and writes both the current and new ones. + * + * It ignores errors from the new handler. + * + * @author Ross Motley + * @author Oliver Radwell + */ +class MigratingSessionHandler implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface +{ + private \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface $currentHandler; + private \SessionHandlerInterface&\SessionUpdateTimestampHandlerInterface $writeOnlyHandler; + + public function __construct(\SessionHandlerInterface $currentHandler, \SessionHandlerInterface $writeOnlyHandler) + { + if (!$currentHandler instanceof \SessionUpdateTimestampHandlerInterface) { + $currentHandler = new StrictSessionHandler($currentHandler); + } + if (!$writeOnlyHandler instanceof \SessionUpdateTimestampHandlerInterface) { + $writeOnlyHandler = new StrictSessionHandler($writeOnlyHandler); + } + + $this->currentHandler = $currentHandler; + $this->writeOnlyHandler = $writeOnlyHandler; + } + + public function close(): bool + { + $result = $this->currentHandler->close(); + $this->writeOnlyHandler->close(); + + return $result; + } + + public function destroy(#[\SensitiveParameter] string $sessionId): bool + { + $result = $this->currentHandler->destroy($sessionId); + $this->writeOnlyHandler->destroy($sessionId); + + return $result; + } + + public function gc(int $maxlifetime): int|false + { + $result = $this->currentHandler->gc($maxlifetime); + $this->writeOnlyHandler->gc($maxlifetime); + + return $result; + } + + public function open(string $savePath, string $sessionName): bool + { + $result = $this->currentHandler->open($savePath, $sessionName); + $this->writeOnlyHandler->open($savePath, $sessionName); + + return $result; + } + + public function read(#[\SensitiveParameter] string $sessionId): string + { + // No reading from new handler until switch-over + return $this->currentHandler->read($sessionId); + } + + public function write(#[\SensitiveParameter] string $sessionId, string $sessionData): bool + { + $result = $this->currentHandler->write($sessionId, $sessionData); + $this->writeOnlyHandler->write($sessionId, $sessionData); + + return $result; + } + + public function validateId(#[\SensitiveParameter] string $sessionId): bool + { + // No reading from new handler until switch-over + return $this->currentHandler->validateId($sessionId); + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $sessionData): bool + { + $result = $this->currentHandler->updateTimestamp($sessionId, $sessionData); + $this->writeOnlyHandler->updateTimestamp($sessionId, $sessionData); + + return $result; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php new file mode 100644 index 00000000..d5586030 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -0,0 +1,186 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use MongoDB\BSON\Binary; +use MongoDB\BSON\UTCDateTime; +use MongoDB\Client; +use MongoDB\Driver\BulkWrite; +use MongoDB\Driver\Manager; +use MongoDB\Driver\Query; + +/** + * Session handler using the MongoDB driver extension. + * + * @author Markus Bachmann + * @author Jérôme Tamarelle + * + * @see https://php.net/mongodb + */ +class MongoDbSessionHandler extends AbstractSessionHandler +{ + private Manager $manager; + private string $namespace; + private array $options; + private int|\Closure|null $ttl; + + /** + * Constructor. + * + * List of available options: + * * database: The name of the database [required] + * * collection: The name of the collection [required] + * * id_field: The field name for storing the session id [default: _id] + * * data_field: The field name for storing the session data [default: data] + * * time_field: The field name for storing the timestamp [default: time] + * * expiry_field: The field name for storing the expiry-timestamp [default: expires_at] + * * ttl: The time to live in seconds. + * + * It is strongly recommended to put an index on the `expiry_field` for + * garbage-collection. Alternatively it's possible to automatically expire + * the sessions in the database as described below: + * + * A TTL collections can be used on MongoDB 2.2+ to cleanup expired sessions + * automatically. Such an index can for example look like this: + * + * db..createIndex( + * { "": 1 }, + * { "expireAfterSeconds": 0 } + * ) + * + * More details on: https://docs.mongodb.org/manual/tutorial/expire-data/ + * + * If you use such an index, you can drop `gc_probability` to 0 since + * no garbage-collection is required. + * + * @throws \InvalidArgumentException When "database" or "collection" not provided + */ + public function __construct(Client|Manager $mongo, array $options) + { + if (!isset($options['database']) || !isset($options['collection'])) { + throw new \InvalidArgumentException('You must provide the "database" and "collection" option for MongoDBSessionHandler.'); + } + + if ($mongo instanceof Client) { + $mongo = $mongo->getManager(); + } + + $this->manager = $mongo; + $this->namespace = $options['database'].'.'.$options['collection']; + + $this->options = array_merge([ + 'id_field' => '_id', + 'data_field' => 'data', + 'time_field' => 'time', + 'expiry_field' => 'expires_at', + ], $options); + $this->ttl = $this->options['ttl'] ?? null; + } + + public function close(): bool + { + return true; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + $write = new BulkWrite(); + $write->delete( + [$this->options['id_field'] => $sessionId], + ['limit' => 1] + ); + + $this->manager->executeBulkWrite($this->namespace, $write); + + return true; + } + + public function gc(int $maxlifetime): int|false + { + $write = new BulkWrite(); + $write->delete( + [$this->options['expiry_field'] => ['$lt' => $this->getUTCDateTime()]], + ); + $result = $this->manager->executeBulkWrite($this->namespace, $write); + + return $result->getDeletedCount() ?? false; + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); + $expiry = $this->getUTCDateTime($ttl); + + $fields = [ + $this->options['time_field'] => $this->getUTCDateTime(), + $this->options['expiry_field'] => $expiry, + $this->options['data_field'] => new Binary($data, Binary::TYPE_GENERIC), + ]; + + $write = new BulkWrite(); + $write->update( + [$this->options['id_field'] => $sessionId], + ['$set' => $fields], + ['upsert' => true] + ); + + $this->manager->executeBulkWrite($this->namespace, $write); + + return true; + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); + $expiry = $this->getUTCDateTime($ttl); + + $write = new BulkWrite(); + $write->update( + [$this->options['id_field'] => $sessionId], + ['$set' => [ + $this->options['time_field'] => $this->getUTCDateTime(), + $this->options['expiry_field'] => $expiry, + ]], + ['multi' => false], + ); + + $this->manager->executeBulkWrite($this->namespace, $write); + + return true; + } + + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + $cursor = $this->manager->executeQuery($this->namespace, new Query([ + $this->options['id_field'] => $sessionId, + $this->options['expiry_field'] => ['$gte' => $this->getUTCDateTime()], + ], [ + 'projection' => [ + '_id' => false, + $this->options['data_field'] => true, + ], + 'limit' => 1, + ])); + + foreach ($cursor as $document) { + return (string) $document->{$this->options['data_field']} ?? ''; + } + + // Not found + return ''; + } + + private function getUTCDateTime(int $additionalSeconds = 0): UTCDateTime + { + return new UTCDateTime((time() + $additionalSeconds) * 1000); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php new file mode 100644 index 00000000..284cd869 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NativeFileSessionHandler.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Native session handler using PHP's built in file storage. + * + * @author Drak + */ +class NativeFileSessionHandler extends \SessionHandler +{ + /** + * @param string|null $savePath Path of directory to save session files + * Default null will leave setting as defined by PHP. + * '/path', 'N;/path', or 'N;octal-mode;/path + * + * @see https://php.net/session.configuration#ini.session.save-path for further details. + * + * @throws \InvalidArgumentException On invalid $savePath + * @throws \RuntimeException When failing to create the save directory + */ + public function __construct(?string $savePath = null) + { + $baseDir = $savePath ??= \ini_get('session.save_path'); + + if ($count = substr_count($savePath, ';')) { + if ($count > 2) { + throw new \InvalidArgumentException(\sprintf('Invalid argument $savePath \'%s\'.', $savePath)); + } + + // characters after last ';' are the path + $baseDir = ltrim(strrchr($savePath, ';'), ';'); + } + + if ($baseDir && !is_dir($baseDir) && !@mkdir($baseDir, 0777, true) && !is_dir($baseDir)) { + throw new \RuntimeException(\sprintf('Session Storage was not able to create directory "%s".', $baseDir)); + } + + if ($savePath !== \ini_get('session.save_path')) { + ini_set('session.save_path', $savePath); + } + if ('files' !== \ini_get('session.save_handler')) { + ini_set('session.save_handler', 'files'); + } + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php new file mode 100644 index 00000000..a77185e2 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/NullSessionHandler.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Can be used in unit testing or in a situations where persisted sessions are not desired. + * + * @author Drak + */ +class NullSessionHandler extends AbstractSessionHandler +{ + public function close(): bool + { + return true; + } + + public function validateId(#[\SensitiveParameter] string $sessionId): bool + { + return true; + } + + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + return ''; + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return true; + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return true; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + return true; + } + + public function gc(int $maxlifetime): int|false + { + return 0; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php new file mode 100644 index 00000000..e2fb4f12 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/PdoSessionHandler.php @@ -0,0 +1,908 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Doctrine\DBAL\Schema\Name\Identifier; +use Doctrine\DBAL\Schema\Name\UnqualifiedName; +use Doctrine\DBAL\Schema\PrimaryKeyConstraint; +use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Types\Types; + +/** + * Session handler using a PDO connection to read and write data. + * + * It works with MySQL, PostgreSQL, Oracle, SQL Server and SQLite and implements + * different locking strategies to handle concurrent access to the same session. + * Locking is necessary to prevent loss of data due to race conditions and to keep + * the session data consistent between read() and write(). With locking, requests + * for the same session will wait until the other one finished writing. For this + * reason it's best practice to close a session as early as possible to improve + * concurrency. PHPs internal files session handler also implements locking. + * + * Attention: Since SQLite does not support row level locks but locks the whole database, + * it means only one session can be accessed at a time. Even different sessions would wait + * for another to finish. So saving session in SQLite should only be considered for + * development or prototypes. + * + * Session data is a binary string that can contain non-printable characters like the null byte. + * For this reason it must be saved in a binary column in the database like BLOB in MySQL. + * Saving it in a character column could corrupt the data. You can use createTable() + * to initialize a correctly defined table. + * + * @see https://php.net/sessionhandlerinterface + * + * @author Fabien Potencier + * @author Michael Williams + * @author Tobias Schultze + */ +class PdoSessionHandler extends AbstractSessionHandler +{ + /** + * No locking is done. This means sessions are prone to loss of data due to + * race conditions of concurrent requests to the same session. The last session + * write will win in this case. It might be useful when you implement your own + * logic to deal with this like an optimistic approach. + */ + public const LOCK_NONE = 0; + + /** + * Creates an application-level lock on a session. The disadvantage is that the + * lock is not enforced by the database and thus other, unaware parts of the + * application could still concurrently modify the session. The advantage is it + * does not require a transaction. + * This mode is not available for SQLite and not yet implemented for oci and sqlsrv. + */ + public const LOCK_ADVISORY = 1; + + /** + * Issues a real row lock. Since it uses a transaction between opening and + * closing a session, you have to be careful when you use same database connection + * that you also use for your application logic. This mode is the default because + * it's the only reliable solution across DBMSs. + */ + public const LOCK_TRANSACTIONAL = 2; + + private \PDO $pdo; + + /** + * DSN string or null for session.save_path or false when lazy connection disabled. + */ + private string|false|null $dsn = false; + + private string $driver; + private string $table = 'sessions'; + private string $idCol = 'sess_id'; + private string $dataCol = 'sess_data'; + private string $lifetimeCol = 'sess_lifetime'; + private string $timeCol = 'sess_time'; + + /** + * Time to live in seconds. + */ + private int|\Closure|null $ttl; + + /** + * Username when lazy-connect. + */ + private ?string $username = null; + + /** + * Password when lazy-connect. + */ + private ?string $password = null; + + /** + * Connection options when lazy-connect. + */ + private array $connectionOptions = []; + + /** + * The strategy for locking, see constants. + */ + private int $lockMode = self::LOCK_TRANSACTIONAL; + + /** + * It's an array to support multiple reads before closing which is manual, non-standard usage. + * + * @var \PDOStatement[] An array of statements to release advisory locks + */ + private array $unlockStatements = []; + + /** + * True when the current session exists but expired according to session.gc_maxlifetime. + */ + private bool $sessionExpired = false; + + /** + * Whether a transaction is active. + */ + private bool $inTransaction = false; + + /** + * Whether gc() has been called. + */ + private bool $gcCalled = false; + + /** + * You can either pass an existing database connection as PDO instance or + * pass a DSN string that will be used to lazy-connect to the database + * when the session is actually used. Furthermore it's possible to pass null + * which will then use the session.save_path ini setting as PDO DSN parameter. + * + * List of available options: + * * db_table: The name of the table [default: sessions] + * * db_id_col: The column where to store the session id [default: sess_id] + * * db_data_col: The column where to store the session data [default: sess_data] + * * db_lifetime_col: The column where to store the lifetime [default: sess_lifetime] + * * db_time_col: The column where to store the timestamp [default: sess_time] + * * db_username: The username when lazy-connect [default: ''] + * * db_password: The password when lazy-connect [default: ''] + * * db_connection_options: An array of driver-specific connection options [default: []] + * * lock_mode: The strategy for locking, see constants [default: LOCK_TRANSACTIONAL] + * * ttl: The time to live in seconds. + * + * @param \PDO|string|null $pdoOrDsn A \PDO instance or DSN string or URL string or null + * + * @throws \InvalidArgumentException When PDO error mode is not PDO::ERRMODE_EXCEPTION + */ + public function __construct(#[\SensitiveParameter] \PDO|string|null $pdoOrDsn = null, #[\SensitiveParameter] array $options = []) + { + if ($pdoOrDsn instanceof \PDO) { + if (\PDO::ERRMODE_EXCEPTION !== $pdoOrDsn->getAttribute(\PDO::ATTR_ERRMODE)) { + throw new \InvalidArgumentException(\sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION)).', __CLASS__)); + } + + $this->pdo = $pdoOrDsn; + $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); + } elseif (\is_string($pdoOrDsn) && str_contains($pdoOrDsn, '://')) { + $this->dsn = $this->buildDsnFromUrl($pdoOrDsn); + } else { + $this->dsn = $pdoOrDsn; + } + + $this->table = $options['db_table'] ?? $this->table; + $this->idCol = $options['db_id_col'] ?? $this->idCol; + $this->dataCol = $options['db_data_col'] ?? $this->dataCol; + $this->lifetimeCol = $options['db_lifetime_col'] ?? $this->lifetimeCol; + $this->timeCol = $options['db_time_col'] ?? $this->timeCol; + $this->username = $options['db_username'] ?? $this->username; + $this->password = $options['db_password'] ?? $this->password; + $this->connectionOptions = $options['db_connection_options'] ?? $this->connectionOptions; + $this->lockMode = $options['lock_mode'] ?? $this->lockMode; + $this->ttl = $options['ttl'] ?? null; + } + + /** + * Adds the Table to the Schema if it doesn't exist. + */ + public function configureSchema(Schema $schema, ?\Closure $isSameDatabase = null): void + { + if ($schema->hasTable($this->table) || ($isSameDatabase && !$isSameDatabase($this->getConnection()->exec(...)))) { + return; + } + + $table = $schema->createTable($this->table); + switch ($this->driver) { + case 'mysql': + $table->addColumn($this->idCol, Types::BINARY)->setLength(128)->setNotnull(true); + $table->addColumn($this->dataCol, Types::BLOB)->setNotnull(true); + $table->addColumn($this->lifetimeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true); + $table->addColumn($this->timeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true); + $table->addOption('collate', 'utf8mb4_bin'); + $table->addOption('engine', 'InnoDB'); + break; + case 'sqlite': + $table->addColumn($this->idCol, Types::TEXT)->setNotnull(true); + $table->addColumn($this->dataCol, Types::BLOB)->setNotnull(true); + $table->addColumn($this->lifetimeCol, Types::INTEGER)->setNotnull(true); + $table->addColumn($this->timeCol, Types::INTEGER)->setNotnull(true); + break; + case 'pgsql': + $table->addColumn($this->idCol, Types::STRING)->setLength(128)->setNotnull(true); + $table->addColumn($this->dataCol, Types::BINARY)->setNotnull(true); + $table->addColumn($this->lifetimeCol, Types::INTEGER)->setNotnull(true); + $table->addColumn($this->timeCol, Types::INTEGER)->setNotnull(true); + break; + case 'oci': + $table->addColumn($this->idCol, Types::STRING)->setLength(128)->setNotnull(true); + $table->addColumn($this->dataCol, Types::BLOB)->setNotnull(true); + $table->addColumn($this->lifetimeCol, Types::INTEGER)->setNotnull(true); + $table->addColumn($this->timeCol, Types::INTEGER)->setNotnull(true); + break; + case 'sqlsrv': + $table->addColumn($this->idCol, Types::TEXT)->setLength(128)->setNotnull(true); + $table->addColumn($this->dataCol, Types::BLOB)->setNotnull(true); + $table->addColumn($this->lifetimeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true); + $table->addColumn($this->timeCol, Types::INTEGER)->setUnsigned(true)->setNotnull(true); + break; + default: + throw new \DomainException(\sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver)); + } + + if (class_exists(PrimaryKeyConstraint::class)) { + $table->addPrimaryKeyConstraint(new PrimaryKeyConstraint(null, [new UnqualifiedName(Identifier::unquoted($this->idCol))], true)); + } else { + $table->setPrimaryKey([$this->idCol]); + } + + $table->addIndex([$this->lifetimeCol], $this->lifetimeCol.'_idx'); + } + + /** + * Creates the table to store sessions which can be called once for setup. + * + * Session ID is saved in a column of maximum length 128 because that is enough even + * for a 512 bit configured session.hash_function like Whirlpool. Session data is + * saved in a BLOB. One could also use a shorter inlined varbinary column + * if one was sure the data fits into it. + * + * @throws \PDOException When the table already exists + * @throws \DomainException When an unsupported PDO driver is used + */ + public function createTable(): void + { + // connect if we are not yet + $this->getConnection(); + + $sql = match ($this->driver) { + // We use varbinary for the ID column because it prevents unwanted conversions: + // - character set conversions between server and client + // - trailing space removal + // - case-insensitivity + // - language processing like é == e + 'mysql' => "CREATE TABLE $this->table ($this->idCol VARBINARY(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER UNSIGNED NOT NULL, $this->timeCol INTEGER UNSIGNED NOT NULL) COLLATE utf8mb4_bin, ENGINE = InnoDB", + 'sqlite' => "CREATE TABLE $this->table ($this->idCol TEXT NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", + 'pgsql' => "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol BYTEA NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", + 'oci' => "CREATE TABLE $this->table ($this->idCol VARCHAR2(128) NOT NULL PRIMARY KEY, $this->dataCol BLOB NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", + 'sqlsrv' => "CREATE TABLE $this->table ($this->idCol VARCHAR(128) NOT NULL PRIMARY KEY, $this->dataCol VARBINARY(MAX) NOT NULL, $this->lifetimeCol INTEGER NOT NULL, $this->timeCol INTEGER NOT NULL)", + default => throw new \DomainException(\sprintf('Creating the session table is currently not implemented for PDO driver "%s".', $this->driver)), + }; + + try { + $this->pdo->exec($sql); + $this->pdo->exec("CREATE INDEX {$this->lifetimeCol}_idx ON $this->table ($this->lifetimeCol)"); + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + } + + /** + * Returns true when the current session exists but expired according to session.gc_maxlifetime. + * + * Can be used to distinguish between a new session and one that expired due to inactivity. + */ + public function isSessionExpired(): bool + { + return $this->sessionExpired; + } + + public function open(string $savePath, string $sessionName): bool + { + $this->sessionExpired = false; + + if (!isset($this->pdo)) { + $this->connect($this->dsn ?: $savePath); + } + + return parent::open($savePath, $sessionName); + } + + public function read(#[\SensitiveParameter] string $sessionId): string + { + try { + return parent::read($sessionId); + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + } + + public function gc(int $maxlifetime): int|false + { + // We delay gc() to close() so that it is executed outside the transactional and blocking read-write process. + // This way, pruning expired sessions does not block them from being started while the current session is used. + $this->gcCalled = true; + + return 0; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + // delete the record associated with this id + $sql = "DELETE FROM $this->table WHERE $this->idCol = :id"; + + try { + $stmt = $this->pdo->prepare($sql); + $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $stmt->execute(); + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + + return true; + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $maxlifetime = (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime')); + + try { + // We use a single MERGE SQL query when supported by the database. + $mergeStmt = $this->getMergeStatement($sessionId, $data, $maxlifetime); + if (null !== $mergeStmt) { + $mergeStmt->execute(); + + return true; + } + + $updateStmt = $this->getUpdateStatement($sessionId, $data, $maxlifetime); + $updateStmt->execute(); + + // When MERGE is not supported, like in Postgres < 9.5, we have to use this approach that can result in + // duplicate key errors when the same session is written simultaneously (given the LOCK_NONE behavior). + // We can just catch such an error and re-execute the update. This is similar to a serializable + // transaction with retry logic on serialization failures but without the overhead and without possible + // false positives due to longer gap locking. + if (!$updateStmt->rowCount()) { + try { + $insertStmt = $this->getInsertStatement($sessionId, $data, $maxlifetime); + $insertStmt->execute(); + } catch (\PDOException $e) { + // Handle integrity violation SQLSTATE 23000 (or a subclass like 23505 in Postgres) for duplicate keys + if (str_starts_with($e->getCode(), '23')) { + $updateStmt->execute(); + } else { + throw $e; + } + } + } + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + + return true; + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $expiry = time() + (int) (($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime')); + + try { + $updateStmt = $this->pdo->prepare( + "UPDATE $this->table SET $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id" + ); + $updateStmt->bindValue(':id', $sessionId, \PDO::PARAM_STR); + $updateStmt->bindValue(':expiry', $expiry, \PDO::PARAM_INT); + $updateStmt->bindValue(':time', time(), \PDO::PARAM_INT); + $updateStmt->execute(); + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + + return true; + } + + public function close(): bool + { + $this->commit(); + + while ($unlockStmt = array_shift($this->unlockStatements)) { + $unlockStmt->execute(); + } + + if ($this->gcCalled) { + $this->gcCalled = false; + + // delete the session records that have expired + $sql = "DELETE FROM $this->table WHERE $this->lifetimeCol < :time"; + $stmt = $this->pdo->prepare($sql); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + $stmt->execute(); + } + + if (false !== $this->dsn) { + unset($this->pdo, $this->driver); // only close lazy-connection + } + + return true; + } + + /** + * Lazy-connects to the database. + */ + private function connect(#[\SensitiveParameter] string $dsn): void + { + $this->pdo = new \PDO($dsn, $this->username, $this->password, $this->connectionOptions); + $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); + $this->driver = $this->pdo->getAttribute(\PDO::ATTR_DRIVER_NAME); + } + + /** + * Builds a PDO DSN from a URL-like connection string. + * + * @todo implement missing support for oci DSN (which look totally different from other PDO ones) + */ + private function buildDsnFromUrl(#[\SensitiveParameter] string $dsnOrUrl): string + { + // (pdo_)?sqlite3?:///... => (pdo_)?sqlite3?://localhost/... or else the URL will be invalid + $url = preg_replace('#^((?:pdo_)?sqlite3?):///#', '$1://localhost/', $dsnOrUrl); + + $params = parse_url($url); + + if (false === $params) { + return $dsnOrUrl; // If the URL is not valid, let's assume it might be a DSN already. + } + + $params = array_map('rawurldecode', $params); + + // Override the default username and password. Values passed through options will still win over these in the constructor. + if (isset($params['user'])) { + $this->username = $params['user']; + } + + if (isset($params['pass'])) { + $this->password = $params['pass']; + } + + if (!isset($params['scheme'])) { + throw new \InvalidArgumentException('URLs without scheme are not supported to configure the PdoSessionHandler.'); + } + + $driverAliasMap = [ + 'mssql' => 'sqlsrv', + 'mysql2' => 'mysql', // Amazon RDS, for some weird reason + 'postgres' => 'pgsql', + 'postgresql' => 'pgsql', + 'sqlite3' => 'sqlite', + ]; + + $driver = $driverAliasMap[$params['scheme']] ?? $params['scheme']; + + // Doctrine DBAL supports passing its internal pdo_* driver names directly too (allowing both dashes and underscores). This allows supporting the same here. + if (str_starts_with($driver, 'pdo_') || str_starts_with($driver, 'pdo-')) { + $driver = substr($driver, 4); + } + + $dsn = null; + switch ($driver) { + case 'mysql': + $dsn = 'mysql:'; + if ('' !== ($params['query'] ?? '')) { + $queryParams = []; + parse_str($params['query'], $queryParams); + if ('' !== ($queryParams['charset'] ?? '')) { + $dsn .= 'charset='.$queryParams['charset'].';'; + } + + if ('' !== ($queryParams['unix_socket'] ?? '')) { + $dsn .= 'unix_socket='.$queryParams['unix_socket'].';'; + + if (isset($params['path'])) { + $dbName = substr($params['path'], 1); // Remove the leading slash + $dsn .= 'dbname='.$dbName.';'; + } + + return $dsn; + } + } + // If "unix_socket" is not in the query, we continue with the same process as pgsql + // no break + case 'pgsql': + $dsn ??= 'pgsql:'; + + if (isset($params['host']) && '' !== $params['host']) { + $dsn .= 'host='.$params['host'].';'; + } + + if (isset($params['port']) && '' !== $params['port']) { + $dsn .= 'port='.$params['port'].';'; + } + + if (isset($params['path'])) { + $dbName = substr($params['path'], 1); // Remove the leading slash + $dsn .= 'dbname='.$dbName.';'; + } + + return $dsn; + + case 'sqlite': + return 'sqlite:'.substr($params['path'], 1); + + case 'sqlsrv': + $dsn = 'sqlsrv:server='; + + if (isset($params['host'])) { + $dsn .= $params['host']; + } + + if (isset($params['port']) && '' !== $params['port']) { + $dsn .= ','.$params['port']; + } + + if (isset($params['path'])) { + $dbName = substr($params['path'], 1); // Remove the leading slash + $dsn .= ';Database='.$dbName; + } + + return $dsn; + + default: + throw new \InvalidArgumentException(\sprintf('The scheme "%s" is not supported by the PdoSessionHandler URL configuration. Pass a PDO DSN directly.', $params['scheme'])); + } + } + + /** + * Helper method to begin a transaction. + * + * Since SQLite does not support row level locks, we have to acquire a reserved lock + * on the database immediately. Because of https://bugs.php.net/42766 we have to create + * such a transaction manually which also means we cannot use PDO::commit or + * PDO::rollback or PDO::inTransaction for SQLite. + * + * Also MySQLs default isolation, REPEATABLE READ, causes deadlock for different sessions + * due to https://percona.com/blog/2013/12/12/one-more-innodb-gap-lock-to-avoid/ . + * So we change it to READ COMMITTED. + */ + private function beginTransaction(): void + { + if (!$this->inTransaction) { + if ('sqlite' === $this->driver) { + $this->pdo->exec('BEGIN IMMEDIATE TRANSACTION'); + } else { + if ('mysql' === $this->driver) { + $this->pdo->exec('SET TRANSACTION ISOLATION LEVEL READ COMMITTED'); + } + $this->pdo->beginTransaction(); + } + $this->inTransaction = true; + } + } + + /** + * Helper method to commit a transaction. + */ + private function commit(): void + { + if ($this->inTransaction) { + try { + // commit read-write transaction which also releases the lock + if ('sqlite' === $this->driver) { + $this->pdo->exec('COMMIT'); + } else { + $this->pdo->commit(); + } + $this->inTransaction = false; + } catch (\PDOException $e) { + $this->rollback(); + + throw $e; + } + } + } + + /** + * Helper method to rollback a transaction. + */ + private function rollback(): void + { + // We only need to rollback if we are in a transaction. Otherwise the resulting + // error would hide the real problem why rollback was called. We might not be + // in a transaction when not using the transactional locking behavior or when + // two callbacks (e.g. destroy and write) are invoked that both fail. + if ($this->inTransaction) { + if ('sqlite' === $this->driver) { + $this->pdo->exec('ROLLBACK'); + } else { + $this->pdo->rollBack(); + } + $this->inTransaction = false; + } + } + + /** + * Reads the session data in respect to the different locking strategies. + * + * We need to make sure we do not return session data that is already considered garbage according + * to the session.gc_maxlifetime setting because gc() is called after read() and only sometimes. + */ + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + if (self::LOCK_ADVISORY === $this->lockMode) { + $this->unlockStatements[] = $this->doAdvisoryLock($sessionId); + } + + $selectSql = $this->getSelectSql(); + $selectStmt = $this->pdo->prepare($selectSql); + $selectStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $insertStmt = null; + + while (true) { + $selectStmt->execute(); + $sessionRows = $selectStmt->fetchAll(\PDO::FETCH_NUM); + + if ($sessionRows) { + $expiry = (int) $sessionRows[0][1]; + + if ($expiry < time()) { + $this->sessionExpired = true; + + return ''; + } + + return \is_resource($sessionRows[0][0]) ? stream_get_contents($sessionRows[0][0]) : $sessionRows[0][0]; + } + + if (null !== $insertStmt) { + $this->rollback(); + throw new \RuntimeException('Failed to read session: INSERT reported a duplicate id but next SELECT did not return any data.'); + } + + if (!filter_var(\ini_get('session.use_strict_mode'), \FILTER_VALIDATE_BOOL) && self::LOCK_TRANSACTIONAL === $this->lockMode && 'sqlite' !== $this->driver) { + // In strict mode, session fixation is not possible: new sessions always start with a unique + // random id, so that concurrency is not possible and this code path can be skipped. + // Exclusive-reading of non-existent rows does not block, so we need to do an insert to block + // until other connections to the session are committed. + try { + $insertStmt = $this->getInsertStatement($sessionId, '', 0); + $insertStmt->execute(); + } catch (\PDOException $e) { + // Catch duplicate key error because other connection created the session already. + // It would only not be the case when the other connection destroyed the session. + if (str_starts_with($e->getCode(), '23')) { + // Retrieve finished session data written by concurrent connection by restarting the loop. + // We have to start a new transaction as a failed query will mark the current transaction as + // aborted in PostgreSQL and disallow further queries within it. + $this->rollback(); + $this->beginTransaction(); + continue; + } + + throw $e; + } + } + + return ''; + } + } + + /** + * Executes an application-level lock on the database. + * + * @return \PDOStatement The statement that needs to be executed later to release the lock + * + * @throws \DomainException When an unsupported PDO driver is used + * + * @todo implement missing advisory locks + * - for oci using DBMS_LOCK.REQUEST + * - for sqlsrv using sp_getapplock with LockOwner = Session + */ + private function doAdvisoryLock(#[\SensitiveParameter] string $sessionId): \PDOStatement + { + switch ($this->driver) { + case 'mysql': + // MySQL 5.7.5 and later enforces a maximum length on lock names of 64 characters. Previously, no limit was enforced. + $lockId = substr($sessionId, 0, 64); + // should we handle the return value? 0 on timeout, null on error + // we use a timeout of 50 seconds which is also the default for innodb_lock_wait_timeout + $stmt = $this->pdo->prepare('SELECT GET_LOCK(:key, 50)'); + $stmt->bindValue(':key', $lockId, \PDO::PARAM_STR); + $stmt->execute(); + + $releaseStmt = $this->pdo->prepare('DO RELEASE_LOCK(:key)'); + $releaseStmt->bindValue(':key', $lockId, \PDO::PARAM_STR); + + return $releaseStmt; + case 'pgsql': + // Obtaining an exclusive session level advisory lock requires an integer key. + // When session.sid_bits_per_character > 4, the session id can contain non-hex-characters. + // So we cannot just use hexdec(). + if (4 === \PHP_INT_SIZE) { + $sessionInt1 = $this->convertStringToInt($sessionId); + $sessionInt2 = $this->convertStringToInt(substr($sessionId, 4, 4)); + + $stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key1, :key2)'); + $stmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT); + $stmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT); + $stmt->execute(); + + $releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key1, :key2)'); + $releaseStmt->bindValue(':key1', $sessionInt1, \PDO::PARAM_INT); + $releaseStmt->bindValue(':key2', $sessionInt2, \PDO::PARAM_INT); + } else { + $sessionBigInt = $this->convertStringToInt($sessionId); + + $stmt = $this->pdo->prepare('SELECT pg_advisory_lock(:key)'); + $stmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT); + $stmt->execute(); + + $releaseStmt = $this->pdo->prepare('SELECT pg_advisory_unlock(:key)'); + $releaseStmt->bindValue(':key', $sessionBigInt, \PDO::PARAM_INT); + } + + return $releaseStmt; + case 'sqlite': + throw new \DomainException('SQLite does not support advisory locks.'); + default: + throw new \DomainException(\sprintf('Advisory locks are currently not implemented for PDO driver "%s".', $this->driver)); + } + } + + /** + * Encodes the first 4 (when PHP_INT_SIZE == 4) or 8 characters of the string as an integer. + * + * Keep in mind, PHP integers are signed. + */ + private function convertStringToInt(string $string): int + { + if (4 === \PHP_INT_SIZE) { + return (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]); + } + + $int1 = (\ord($string[7]) << 24) + (\ord($string[6]) << 16) + (\ord($string[5]) << 8) + \ord($string[4]); + $int2 = (\ord($string[3]) << 24) + (\ord($string[2]) << 16) + (\ord($string[1]) << 8) + \ord($string[0]); + + return $int2 + ($int1 << 32); + } + + /** + * Return a locking or nonlocking SQL query to read session information. + * + * @throws \DomainException When an unsupported PDO driver is used + */ + private function getSelectSql(): string + { + if (self::LOCK_TRANSACTIONAL === $this->lockMode) { + $this->beginTransaction(); + + switch ($this->driver) { + case 'mysql': + case 'oci': + case 'pgsql': + return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id FOR UPDATE"; + case 'sqlsrv': + return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WITH (UPDLOCK, ROWLOCK) WHERE $this->idCol = :id"; + case 'sqlite': + // we already locked when starting transaction + break; + default: + throw new \DomainException(\sprintf('Transactional locks are currently not implemented for PDO driver "%s".', $this->driver)); + } + } + + return "SELECT $this->dataCol, $this->lifetimeCol FROM $this->table WHERE $this->idCol = :id"; + } + + /** + * Returns an insert statement supported by the database for writing session data. + */ + private function getInsertStatement(#[\SensitiveParameter] string $sessionId, string $sessionData, int $maxlifetime): \PDOStatement + { + switch ($this->driver) { + case 'oci': + $data = fopen('php://memory', 'r+'); + fwrite($data, $sessionData); + rewind($data); + $sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, EMPTY_BLOB(), :expiry, :time) RETURNING $this->dataCol into :data"; + break; + default: + $data = $sessionData; + $sql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time)"; + break; + } + + $stmt = $this->pdo->prepare($sql); + $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $stmt->bindParam(':data', $data, \PDO::PARAM_LOB); + $stmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + + return $stmt; + } + + /** + * Returns an update statement supported by the database for writing session data. + */ + private function getUpdateStatement(#[\SensitiveParameter] string $sessionId, string $sessionData, int $maxlifetime): \PDOStatement + { + switch ($this->driver) { + case 'oci': + $data = fopen('php://memory', 'r+'); + fwrite($data, $sessionData); + rewind($data); + $sql = "UPDATE $this->table SET $this->dataCol = EMPTY_BLOB(), $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id RETURNING $this->dataCol into :data"; + break; + default: + $data = $sessionData; + $sql = "UPDATE $this->table SET $this->dataCol = :data, $this->lifetimeCol = :expiry, $this->timeCol = :time WHERE $this->idCol = :id"; + break; + } + + $stmt = $this->pdo->prepare($sql); + $stmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $stmt->bindParam(':data', $data, \PDO::PARAM_LOB); + $stmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); + $stmt->bindValue(':time', time(), \PDO::PARAM_INT); + + return $stmt; + } + + /** + * Returns a merge/upsert (i.e. insert or update) statement when supported by the database for writing session data. + */ + private function getMergeStatement(#[\SensitiveParameter] string $sessionId, string $data, int $maxlifetime): ?\PDOStatement + { + switch (true) { + case 'mysql' === $this->driver: + $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time) ". + "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->lifetimeCol = VALUES($this->lifetimeCol), $this->timeCol = VALUES($this->timeCol)"; + break; + case 'sqlsrv' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='): + // MERGE is only available since SQL Server 2008 and must be terminated by semicolon + // It also requires HOLDLOCK according to https://weblogs.sqlteam.com/dang/2009/01/31/upsert-race-condition-with-merge/ + $mergeSql = "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = ?) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (?, ?, ?, ?) ". + "WHEN MATCHED THEN UPDATE SET $this->dataCol = ?, $this->lifetimeCol = ?, $this->timeCol = ?;"; + break; + case 'sqlite' === $this->driver: + $mergeSql = "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time)"; + break; + case 'pgsql' === $this->driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '9.5', '>='): + $mergeSql = "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->lifetimeCol, $this->timeCol) VALUES (:id, :data, :expiry, :time) ". + "ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->lifetimeCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->lifetimeCol, EXCLUDED.$this->timeCol)"; + break; + default: + // MERGE is not supported with LOBs: https://oracle.com/technetwork/articles/fuecks-lobs-095315.html + return null; + } + + $mergeStmt = $this->pdo->prepare($mergeSql); + + if ('sqlsrv' === $this->driver) { + $mergeStmt->bindParam(1, $sessionId, \PDO::PARAM_STR); + $mergeStmt->bindParam(2, $sessionId, \PDO::PARAM_STR); + $mergeStmt->bindParam(3, $data, \PDO::PARAM_LOB); + $mergeStmt->bindValue(4, time() + $maxlifetime, \PDO::PARAM_INT); + $mergeStmt->bindValue(5, time(), \PDO::PARAM_INT); + $mergeStmt->bindParam(6, $data, \PDO::PARAM_LOB); + $mergeStmt->bindValue(7, time() + $maxlifetime, \PDO::PARAM_INT); + $mergeStmt->bindValue(8, time(), \PDO::PARAM_INT); + } else { + $mergeStmt->bindParam(':id', $sessionId, \PDO::PARAM_STR); + $mergeStmt->bindParam(':data', $data, \PDO::PARAM_LOB); + $mergeStmt->bindValue(':expiry', time() + $maxlifetime, \PDO::PARAM_INT); + $mergeStmt->bindValue(':time', time(), \PDO::PARAM_INT); + } + + return $mergeStmt; + } + + /** + * Return a PDO instance. + */ + protected function getConnection(): \PDO + { + if (!isset($this->pdo)) { + $this->connect($this->dsn ?: \ini_get('session.save_path')); + } + + return $this->pdo; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php new file mode 100644 index 00000000..78cd4e7c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/RedisSessionHandler.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Predis\Response\ErrorInterface; +use Relay\Relay; + +/** + * Redis based session storage handler based on the Redis class + * provided by the PHP redis extension. + * + * @author Dalibor Karlović + */ +class RedisSessionHandler extends AbstractSessionHandler +{ + /** + * Key prefix for shared environments. + */ + private string $prefix; + + /** + * Time to live in seconds. + */ + private int|\Closure|null $ttl; + + /** + * List of available options: + * * prefix: The prefix to use for the keys in order to avoid collision on the Redis server + * * ttl: The time to live in seconds. + * + * @throws \InvalidArgumentException When unsupported client or options are passed + */ + public function __construct( + private \Redis|Relay|\RedisArray|\RedisCluster|\Predis\ClientInterface $redis, + array $options = [], + ) { + if ($diff = array_diff(array_keys($options), ['prefix', 'ttl'])) { + throw new \InvalidArgumentException(\sprintf('The following options are not supported "%s".', implode(', ', $diff))); + } + + $this->prefix = $options['prefix'] ?? 'sf_s'; + $this->ttl = $options['ttl'] ?? null; + } + + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + return $this->redis->get($this->prefix.$sessionId) ?: ''; + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); + $result = $this->redis->setEx($this->prefix.$sessionId, (int) $ttl, $data); + + return $result && !$result instanceof ErrorInterface; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + static $unlink = true; + + if ($unlink) { + try { + $unlink = false !== $this->redis->unlink($this->prefix.$sessionId); + } catch (\Throwable) { + $unlink = false; + } + } + + if (!$unlink) { + $this->redis->del($this->prefix.$sessionId); + } + + return true; + } + + #[\ReturnTypeWillChange] + public function close(): bool + { + return true; + } + + public function gc(int $maxlifetime): int|false + { + return 0; + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + $ttl = ($this->ttl instanceof \Closure ? ($this->ttl)() : $this->ttl) ?? \ini_get('session.gc_maxlifetime'); + + return $this->redis->expire($this->prefix.$sessionId, (int) $ttl); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php new file mode 100644 index 00000000..cb0b6f8a --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/SessionHandlerFactory.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +use Doctrine\DBAL\Configuration; +use Doctrine\DBAL\DriverManager; +use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory; +use Doctrine\DBAL\Tools\DsnParser; +use Relay\Relay; +use Symfony\Component\Cache\Adapter\AbstractAdapter; + +/** + * @author Nicolas Grekas + */ +class SessionHandlerFactory +{ + public static function createHandler(object|string $connection, array $options = []): AbstractSessionHandler + { + if ($query = \is_string($connection) ? parse_url($connection) : false) { + parse_str($query['query'] ?? '', $query); + + if (($options['ttl'] ?? null) instanceof \Closure) { + $query['ttl'] = $options['ttl']; + } + } + $options = ($query ?: []) + $options; + + switch (true) { + case $connection instanceof \Redis: + case $connection instanceof Relay: + case $connection instanceof \RedisArray: + case $connection instanceof \RedisCluster: + case $connection instanceof \Predis\ClientInterface: + return new RedisSessionHandler($connection); + + case $connection instanceof \Memcached: + return new MemcachedSessionHandler($connection); + + case $connection instanceof \PDO: + return new PdoSessionHandler($connection); + + case !\is_string($connection): + throw new \InvalidArgumentException(\sprintf('Unsupported Connection: "%s".', get_debug_type($connection))); + case str_starts_with($connection, 'file://'): + $savePath = substr($connection, 7); + + return new StrictSessionHandler(new NativeFileSessionHandler('' === $savePath ? null : $savePath)); + + case str_starts_with($connection, 'redis:'): + case str_starts_with($connection, 'rediss:'): + case str_starts_with($connection, 'valkey:'): + case str_starts_with($connection, 'valkeys:'): + case str_starts_with($connection, 'memcached:'): + if (!class_exists(AbstractAdapter::class)) { + throw new \InvalidArgumentException('Unsupported Redis or Memcached DSN. Try running "composer require symfony/cache".'); + } + $handlerClass = str_starts_with($connection, 'memcached:') ? MemcachedSessionHandler::class : RedisSessionHandler::class; + $connection = AbstractAdapter::createConnection($connection, ['lazy' => true]); + + return new $handlerClass($connection, array_intersect_key($options, ['prefix' => 1, 'ttl' => 1])); + + case str_starts_with($connection, 'pdo_oci://'): + if (!class_exists(DriverManager::class)) { + throw new \InvalidArgumentException('Unsupported PDO OCI DSN. Try running "composer require doctrine/dbal".'); + } + $connection[3] = '-'; + $params = (new DsnParser())->parse($connection); + $config = new Configuration(); + $config->setSchemaManagerFactory(new DefaultSchemaManagerFactory()); + + $connection = DriverManager::getConnection($params, $config)->getNativeConnection(); + // no break; + + case str_starts_with($connection, 'mssql://'): + case str_starts_with($connection, 'mysql://'): + case str_starts_with($connection, 'mysql2://'): + case str_starts_with($connection, 'pgsql://'): + case str_starts_with($connection, 'postgres://'): + case str_starts_with($connection, 'postgresql://'): + case str_starts_with($connection, 'sqlsrv://'): + case str_starts_with($connection, 'sqlite://'): + case str_starts_with($connection, 'sqlite3://'): + return new PdoSessionHandler($connection, $options); + } + + throw new \InvalidArgumentException(\sprintf('Unsupported Connection: "%s".', $connection)); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php new file mode 100644 index 00000000..0d84eac3 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php @@ -0,0 +1,87 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; + +/** + * Adds basic `SessionUpdateTimestampHandlerInterface` behaviors to another `SessionHandlerInterface`. + * + * @author Nicolas Grekas + */ +class StrictSessionHandler extends AbstractSessionHandler +{ + private bool $doDestroy; + + public function __construct( + private \SessionHandlerInterface $handler, + ) { + if ($handler instanceof \SessionUpdateTimestampHandlerInterface) { + throw new \LogicException(\sprintf('"%s" is already an instance of "SessionUpdateTimestampHandlerInterface", you cannot wrap it with "%s".', get_debug_type($handler), self::class)); + } + } + + /** + * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + * + * @internal + */ + public function isWrapper(): bool + { + return $this->handler instanceof \SessionHandler; + } + + public function open(string $savePath, string $sessionName): bool + { + parent::open($savePath, $sessionName); + + return $this->handler->open($savePath, $sessionName); + } + + protected function doRead(#[\SensitiveParameter] string $sessionId): string + { + return $this->handler->read($sessionId); + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->write($sessionId, $data); + } + + protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->handler->write($sessionId, $data); + } + + public function destroy(#[\SensitiveParameter] string $sessionId): bool + { + $this->doDestroy = true; + $destroyed = parent::destroy($sessionId); + + return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed; + } + + protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool + { + $this->doDestroy = false; + + return $this->handler->destroy($sessionId); + } + + public function close(): bool + { + return $this->handler->close(); + } + + public function gc(int $maxlifetime): int|false + { + return $this->handler->gc($maxlifetime); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php b/plugins/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php new file mode 100644 index 00000000..c9e0bdd3 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/MetadataBag.php @@ -0,0 +1,131 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * Metadata container. + * + * Adds metadata to the session. + * + * @author Drak + */ +class MetadataBag implements SessionBagInterface +{ + public const CREATED = 'c'; + public const UPDATED = 'u'; + public const LIFETIME = 'l'; + + protected array $meta = [self::CREATED => 0, self::UPDATED => 0, self::LIFETIME => 0]; + + private string $name = '__metadata'; + private int $lastUsed; + + /** + * @param string $storageKey The key used to store bag in the session + * @param int $updateThreshold The time to wait between two UPDATED updates + */ + public function __construct( + private string $storageKey = '_sf2_meta', + private int $updateThreshold = 0, + ) { + } + + public function initialize(array &$array): void + { + $this->meta = &$array; + + if (isset($array[self::CREATED])) { + $this->lastUsed = $this->meta[self::UPDATED]; + + $timeStamp = time(); + if ($timeStamp - $array[self::UPDATED] >= $this->updateThreshold) { + $this->meta[self::UPDATED] = $timeStamp; + } + } else { + $this->stampCreated(); + } + } + + /** + * Gets the lifetime that the session cookie was set with. + */ + public function getLifetime(): int + { + return $this->meta[self::LIFETIME]; + } + + /** + * Stamps a new session's metadata. + * + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + */ + public function stampNew(?int $lifetime = null): void + { + $this->stampCreated($lifetime); + } + + public function getStorageKey(): string + { + return $this->storageKey; + } + + /** + * Gets the created timestamp metadata. + * + * @return int Unix timestamp + */ + public function getCreated(): int + { + return $this->meta[self::CREATED]; + } + + /** + * Gets the last used metadata. + * + * @return int Unix timestamp + */ + public function getLastUsed(): int + { + return $this->lastUsed; + } + + public function clear(): mixed + { + // nothing to do + return null; + } + + public function getName(): string + { + return $this->name; + } + + /** + * Sets name. + */ + public function setName(string $name): void + { + $this->name = $name; + } + + private function stampCreated(?int $lifetime = null): void + { + $timeStamp = time(); + $this->meta[self::CREATED] = $this->meta[self::UPDATED] = $this->lastUsed = $timeStamp; + $this->meta[self::LIFETIME] = $lifetime ?? (int) \ini_get('session.cookie_lifetime'); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php b/plugins/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php new file mode 100644 index 00000000..a32a43d4 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/MockArraySessionStorage.php @@ -0,0 +1,188 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * MockArraySessionStorage mocks the session for unit tests. + * + * No PHP session is actually started since a session can be initialized + * and shutdown only once per PHP execution cycle. + * + * When doing functional testing, you should use MockFileSessionStorage instead. + * + * @author Fabien Potencier + * @author Bulat Shakirzyanov + * @author Drak + */ +class MockArraySessionStorage implements SessionStorageInterface +{ + protected string $id = ''; + protected bool $started = false; + protected bool $closed = false; + protected array $data = []; + protected MetadataBag $metadataBag; + + /** + * @var SessionBagInterface[] + */ + protected array $bags = []; + + public function __construct( + protected string $name = 'MOCKSESSID', + ?MetadataBag $metaBag = null, + ) { + $this->setMetadataBag($metaBag); + } + + public function setSessionData(array $array): void + { + $this->data = $array; + } + + public function start(): bool + { + if ($this->started) { + return true; + } + + if (!$this->id) { + $this->id = $this->generateId(); + } + + $this->loadSession(); + + return true; + } + + public function regenerate(bool $destroy = false, ?int $lifetime = null): bool + { + if (!$this->started) { + $this->start(); + } + + $this->metadataBag->stampNew($lifetime); + $this->id = $this->generateId(); + + return true; + } + + public function getId(): string + { + return $this->id; + } + + public function setId(string $id): void + { + if ($this->started) { + throw new \LogicException('Cannot set session ID after the session has started.'); + } + + $this->id = $id; + } + + public function getName(): string + { + return $this->name; + } + + public function setName(string $name): void + { + $this->name = $name; + } + + public function save(): void + { + if (!$this->started || $this->closed) { + throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.'); + } + // nothing to do since we don't persist the session data + $this->closed = false; + $this->started = false; + } + + public function clear(): void + { + // clear out the bags + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // clear out the session + $this->data = []; + + // reconnect the bags to the session + $this->loadSession(); + } + + public function registerBag(SessionBagInterface $bag): void + { + $this->bags[$bag->getName()] = $bag; + } + + public function getBag(string $name): SessionBagInterface + { + if (!isset($this->bags[$name])) { + throw new \InvalidArgumentException(\sprintf('The SessionBagInterface "%s" is not registered.', $name)); + } + + if (!$this->started) { + $this->start(); + } + + return $this->bags[$name]; + } + + public function isStarted(): bool + { + return $this->started; + } + + public function setMetadataBag(?MetadataBag $bag): void + { + $this->metadataBag = $bag ?? new MetadataBag(); + } + + /** + * Gets the MetadataBag. + */ + public function getMetadataBag(): MetadataBag + { + return $this->metadataBag; + } + + /** + * Generates a session ID. + * + * This doesn't need to be particularly cryptographically secure since this is just + * a mock. + */ + protected function generateId(): string + { + return bin2hex(random_bytes(16)); + } + + protected function loadSession(): void + { + $bags = array_merge($this->bags, [$this->metadataBag]); + + foreach ($bags as $bag) { + $key = $bag->getStorageKey(); + $this->data[$key] ??= []; + $bag->initialize($this->data[$key]); + } + + $this->started = true; + $this->closed = false; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php b/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php new file mode 100644 index 00000000..c230c701 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorage.php @@ -0,0 +1,149 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +/** + * MockFileSessionStorage is used to mock sessions for + * functional testing where you may need to persist session data + * across separate PHP processes. + * + * No PHP session is actually started since a session can be initialized + * and shutdown only once per PHP execution cycle and this class does + * not pollute any session related globals, including session_*() functions + * or session.* PHP ini directives. + * + * @author Drak + */ +class MockFileSessionStorage extends MockArraySessionStorage +{ + private string $savePath; + + /** + * @param string|null $savePath Path of directory to save session files + */ + public function __construct(?string $savePath = null, string $name = 'MOCKSESSID', ?MetadataBag $metaBag = null) + { + $savePath ??= sys_get_temp_dir(); + + if (!is_dir($savePath) && !@mkdir($savePath, 0777, true) && !is_dir($savePath)) { + throw new \RuntimeException(\sprintf('Session Storage was not able to create directory "%s".', $savePath)); + } + + $this->savePath = $savePath; + + parent::__construct($name, $metaBag); + } + + public function start(): bool + { + if ($this->started) { + return true; + } + + if (!$this->id) { + $this->id = $this->generateId(); + } + + $this->read(); + + $this->started = true; + + return true; + } + + public function regenerate(bool $destroy = false, ?int $lifetime = null): bool + { + if (!$this->started) { + $this->start(); + } + + if ($destroy) { + $this->destroy(); + } + + return parent::regenerate($destroy, $lifetime); + } + + public function save(): void + { + if (!$this->started) { + throw new \RuntimeException('Trying to save a session that was not started yet or was already closed.'); + } + + $data = $this->data; + + foreach ($this->bags as $bag) { + if (empty($data[$key = $bag->getStorageKey()])) { + unset($data[$key]); + } + } + if ([$key = $this->metadataBag->getStorageKey()] === array_keys($data)) { + unset($data[$key]); + } + + try { + if ($data) { + $path = $this->getFilePath(); + $tmp = $path.bin2hex(random_bytes(6)); + file_put_contents($tmp, serialize($data)); + rename($tmp, $path); + } else { + $this->destroy(); + } + } finally { + $this->data = $data; + } + + // this is needed when the session object is re-used across multiple requests + // in functional tests. + $this->started = false; + } + + /** + * Deletes a session from persistent storage. + * Deliberately leaves session data in memory intact. + */ + private function destroy(): void + { + set_error_handler(static function () {}); + try { + unlink($this->getFilePath()); + } finally { + restore_error_handler(); + } + } + + /** + * Calculate path to file. + */ + private function getFilePath(): string + { + return $this->savePath.'/'.$this->id.'.mocksess'; + } + + /** + * Reads session from storage and loads session. + */ + private function read(): void + { + set_error_handler(static function () {}); + try { + $data = file_get_contents($this->getFilePath()); + } finally { + restore_error_handler(); + } + + $this->data = $data ? unserialize($data) : []; + + $this->loadSession(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php b/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php new file mode 100644 index 00000000..77ee7b65 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/MockFileSessionStorageFactory.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Request; + +// Help opcache.preload discover always-needed symbols +class_exists(MockFileSessionStorage::class); + +/** + * @author Jérémy Derussé + */ +class MockFileSessionStorageFactory implements SessionStorageFactoryInterface +{ + /** + * @see MockFileSessionStorage constructor. + */ + public function __construct( + private ?string $savePath = null, + private string $name = 'MOCKSESSID', + private ?MetadataBag $metaBag = null, + ) { + } + + public function createStorage(?Request $request): SessionStorageInterface + { + return new MockFileSessionStorage($this->savePath, $this->name, $this->metaBag); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php b/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php new file mode 100644 index 00000000..5c085134 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php @@ -0,0 +1,408 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; +use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; + +// Help opcache.preload discover always-needed symbols +class_exists(MetadataBag::class); +class_exists(StrictSessionHandler::class); +class_exists(SessionHandlerProxy::class); + +/** + * This provides a base class for session attribute storage. + * + * @author Drak + */ +class NativeSessionStorage implements SessionStorageInterface +{ + /** + * @var SessionBagInterface[] + */ + protected array $bags = []; + protected bool $started = false; + protected bool $closed = false; + protected AbstractProxy|\SessionHandlerInterface $saveHandler; + protected MetadataBag $metadataBag; + + /** + * Depending on how you want the storage driver to behave you probably + * want to override this constructor entirely. + * + * List of options for $options array with their defaults. + * + * @see https://php.net/session.configuration for options + * but we omit 'session.' from the beginning of the keys for convenience. + * + * ("auto_start", is not supported as it tells PHP to start a session before + * PHP starts to execute user-land code. Setting during runtime has no effect). + * + * cache_limiter, "" (use "0" to prevent headers from being sent entirely). + * cache_expire, "0" + * cookie_domain, "" + * cookie_httponly, "" + * cookie_lifetime, "0" + * cookie_path, "/" + * cookie_secure, "" + * cookie_samesite, null + * gc_divisor, "100" + * gc_maxlifetime, "1440" + * gc_probability, "1" + * lazy_write, "1" + * name, "PHPSESSID" + * referer_check, "" (deprecated since Symfony 7.2, to be removed in Symfony 8.0) + * serialize_handler, "php" + * use_strict_mode, "1" + * use_cookies, "1" + * use_only_cookies, "1" (deprecated since Symfony 7.2, to be removed in Symfony 8.0) + * use_trans_sid, "0" (deprecated since Symfony 7.2, to be removed in Symfony 8.0) + * sid_length, "32" (@deprecated since Symfony 7.2, to be removed in 8.0) + * sid_bits_per_character, "5" (@deprecated since Symfony 7.2, to be removed in 8.0) + * trans_sid_hosts, $_SERVER['HTTP_HOST'] (deprecated since Symfony 7.2, to be removed in Symfony 8.0) + * trans_sid_tags, "a=href,area=href,frame=src,form=" (deprecated since Symfony 7.2, to be removed in Symfony 8.0) + */ + public function __construct(array $options = [], AbstractProxy|\SessionHandlerInterface|null $handler = null, ?MetadataBag $metaBag = null) + { + if (!\extension_loaded('session')) { + throw new \LogicException('PHP extension "session" is required.'); + } + + $options += [ + 'cache_limiter' => '', + 'cache_expire' => 0, + 'use_cookies' => 1, + 'lazy_write' => 1, + 'use_strict_mode' => 1, + ]; + + session_register_shutdown(); + + $this->setMetadataBag($metaBag); + $this->setOptions($options); + $this->setSaveHandler($handler); + } + + /** + * Gets the save handler instance. + */ + public function getSaveHandler(): AbstractProxy|\SessionHandlerInterface + { + return $this->saveHandler; + } + + public function start(): bool + { + if ($this->started) { + return true; + } + + if (\PHP_SESSION_ACTIVE === session_status()) { + throw new \RuntimeException('Failed to start the session: already started by PHP.'); + } + + if (filter_var(\ini_get('session.use_cookies'), \FILTER_VALIDATE_BOOL) && headers_sent($file, $line)) { + throw new \RuntimeException(\sprintf('Failed to start the session because headers have already been sent by "%s" at line %d.', $file, $line)); + } + + $sessionId = $_COOKIE[session_name()] ?? null; + /* + * Explanation of the session ID regular expression: `/^[a-zA-Z0-9,-]{22,250}$/`. + * + * ---------- Part 1 + * + * The part `[a-zA-Z0-9,-]` is related to the PHP ini directive `session.sid_bits_per_character` defined as 6. + * See https://php.net/session.configuration#ini.session.sid-bits-per-character + * Allowed values are integers such as: + * - 4 for range `a-f0-9` + * - 5 for range `a-v0-9` (@deprecated since Symfony 7.2, it will default to 4 and the option will be ignored in Symfony 8.0) + * - 6 for range `a-zA-Z0-9,-` (@deprecated since Symfony 7.2, it will default to 4 and the option will be ignored in Symfony 8.0) + * + * ---------- Part 2 + * + * The part `{22,250}` is related to the PHP ini directive `session.sid_length`. + * See https://php.net/session.configuration#ini.session.sid-length + * Allowed values are integers between 22 and 256, but we use 250 for the max. + * + * Where does the 250 come from? + * - The length of Windows and Linux filenames is limited to 255 bytes. Then the max must not exceed 255. + * - The session filename prefix is `sess_`, a 5 bytes string. Then the max must not exceed 255 - 5 = 250. + * + * This is @deprecated since Symfony 7.2, the sid length will default to 32 and the option will be ignored in Symfony 8.0. + * + * ---------- Conclusion + * + * The parts 1 and 2 prevent the warning below: + * `PHP Warning: SessionHandler::read(): Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed.` + * + * The part 2 prevents the warning below: + * `PHP Warning: SessionHandler::read(): open(filepath, O_RDWR) failed: No such file or directory (2).` + */ + if ($sessionId && $this->saveHandler instanceof AbstractProxy && 'files' === $this->saveHandler->getSaveHandlerName() && !preg_match('/^[a-zA-Z0-9,-]{22,250}$/', $sessionId)) { + // the session ID in the header is invalid, create a new one + session_id(session_create_id()); + } + + // ok to try and start the session + if (!session_start()) { + throw new \RuntimeException('Failed to start the session.'); + } + + $this->loadSession(); + + return true; + } + + public function getId(): string + { + return $this->saveHandler->getId(); + } + + public function setId(string $id): void + { + $this->saveHandler->setId($id); + } + + public function getName(): string + { + return $this->saveHandler->getName(); + } + + public function setName(string $name): void + { + $this->saveHandler->setName($name); + } + + public function regenerate(bool $destroy = false, ?int $lifetime = null): bool + { + // Cannot regenerate the session ID for non-active sessions. + if (\PHP_SESSION_ACTIVE !== session_status()) { + return false; + } + + if (headers_sent()) { + return false; + } + + if (null !== $lifetime && $lifetime != \ini_get('session.cookie_lifetime')) { + $this->save(); + ini_set('session.cookie_lifetime', $lifetime); + $this->start(); + } + + if ($destroy) { + $this->metadataBag->stampNew(); + } + + return session_regenerate_id($destroy); + } + + public function save(): void + { + // Store a copy so we can restore the bags in case the session was not left empty + $session = $_SESSION; + + foreach ($this->bags as $bag) { + if (empty($_SESSION[$key = $bag->getStorageKey()])) { + unset($_SESSION[$key]); + } + } + if ($_SESSION && [$key = $this->metadataBag->getStorageKey()] === array_keys($_SESSION)) { + unset($_SESSION[$key]); + } + + // Register error handler to add information about the current save handler + $previousHandler = set_error_handler(function ($type, $msg, $file, $line) use (&$previousHandler) { + if (\E_WARNING === $type && str_starts_with($msg, 'session_write_close():')) { + $handler = $this->saveHandler instanceof SessionHandlerProxy ? $this->saveHandler->getHandler() : $this->saveHandler; + $msg = \sprintf('session_write_close(): Failed to write session data with "%s" handler', $handler::class); + } + + return $previousHandler ? $previousHandler($type, $msg, $file, $line) : false; + }); + + try { + session_write_close(); + } finally { + restore_error_handler(); + + // Restore only if not empty + if ($_SESSION) { + $_SESSION = $session; + } + } + + $this->closed = true; + $this->started = false; + } + + public function clear(): void + { + // clear out the bags + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // clear out the session + $_SESSION = []; + + // reconnect the bags to the session + $this->loadSession(); + } + + public function registerBag(SessionBagInterface $bag): void + { + if ($this->started) { + throw new \LogicException('Cannot register a bag when the session is already started.'); + } + + $this->bags[$bag->getName()] = $bag; + } + + public function getBag(string $name): SessionBagInterface + { + if (!isset($this->bags[$name])) { + throw new \InvalidArgumentException(\sprintf('The SessionBagInterface "%s" is not registered.', $name)); + } + + if (!$this->started && $this->saveHandler->isActive()) { + $this->loadSession(); + } elseif (!$this->started) { + $this->start(); + } + + return $this->bags[$name]; + } + + public function setMetadataBag(?MetadataBag $metaBag): void + { + $this->metadataBag = $metaBag ?? new MetadataBag(); + } + + /** + * Gets the MetadataBag. + */ + public function getMetadataBag(): MetadataBag + { + return $this->metadataBag; + } + + public function isStarted(): bool + { + return $this->started; + } + + /** + * Sets session.* ini variables. + * + * For convenience we omit 'session.' from the beginning of the keys. + * Explicitly ignores other ini keys. + * + * @param array $options Session ini directives [key => value] + * + * @see https://php.net/session.configuration + */ + public function setOptions(array $options): void + { + if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { + return; + } + + $validOptions = array_flip([ + 'cache_expire', 'cache_limiter', 'cookie_domain', 'cookie_httponly', + 'cookie_lifetime', 'cookie_path', 'cookie_secure', 'cookie_samesite', + 'gc_divisor', 'gc_maxlifetime', 'gc_probability', + 'lazy_write', 'name', 'referer_check', + 'serialize_handler', 'use_strict_mode', 'use_cookies', + 'use_only_cookies', 'use_trans_sid', + 'sid_length', 'sid_bits_per_character', 'trans_sid_hosts', 'trans_sid_tags', + ]); + + foreach ($options as $key => $value) { + if (\in_array($key, ['referer_check', 'use_only_cookies', 'use_trans_sid', 'trans_sid_hosts', 'trans_sid_tags', 'sid_length', 'sid_bits_per_character'], true)) { + trigger_deprecation('symfony/http-foundation', '7.2', 'NativeSessionStorage\'s "%s" option is deprecated and will be ignored in Symfony 8.0.', $key); + } + + if (isset($validOptions[$key])) { + if ('cookie_secure' === $key && 'auto' === $value) { + continue; + } + ini_set('session.'.$key, $value); + } + } + } + + /** + * Registers session save handler as a PHP session handler. + * + * To use internal PHP session save handlers, override this method using ini_set with + * session.save_handler and session.save_path e.g. + * + * ini_set('session.save_handler', 'files'); + * ini_set('session.save_path', '/tmp'); + * + * or pass in a \SessionHandler instance which configures session.save_handler in the + * constructor, for a template see NativeFileSessionHandler. + * + * @see https://php.net/session-set-save-handler + * @see https://php.net/sessionhandlerinterface + * @see https://php.net/sessionhandler + * + * @throws \InvalidArgumentException + */ + public function setSaveHandler(AbstractProxy|\SessionHandlerInterface|null $saveHandler): void + { + // Wrap $saveHandler in proxy and prevent double wrapping of proxy + if (!$saveHandler instanceof AbstractProxy && $saveHandler instanceof \SessionHandlerInterface) { + $saveHandler = new SessionHandlerProxy($saveHandler); + } elseif (!$saveHandler instanceof AbstractProxy) { + $saveHandler = new SessionHandlerProxy(new StrictSessionHandler(new \SessionHandler())); + } + $this->saveHandler = $saveHandler; + + if (headers_sent() || \PHP_SESSION_ACTIVE === session_status()) { + return; + } + + if ($this->saveHandler instanceof SessionHandlerProxy) { + session_set_save_handler($this->saveHandler, false); + } + } + + /** + * Load the session with attributes. + * + * After starting the session, PHP retrieves the session from whatever handlers + * are set to (either PHP's internal, or a custom save handler set with session_set_save_handler()). + * PHP takes the return value from the read() handler, unserializes it + * and populates $_SESSION with the result automatically. + */ + protected function loadSession(?array &$session = null): void + { + if (null === $session) { + $session = &$_SESSION; + } + + $bags = array_merge($this->bags, [$this->metadataBag]); + + foreach ($bags as $bag) { + $key = $bag->getStorageKey(); + $session[$key] = isset($session[$key]) && \is_array($session[$key]) ? $session[$key] : []; + $bag->initialize($session[$key]); + } + + $this->started = true; + $this->closed = false; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php b/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php new file mode 100644 index 00000000..cb8c5353 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorageFactory.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; + +// Help opcache.preload discover always-needed symbols +class_exists(NativeSessionStorage::class); + +/** + * @author Jérémy Derussé + */ +class NativeSessionStorageFactory implements SessionStorageFactoryInterface +{ + /** + * @see NativeSessionStorage constructor. + */ + public function __construct( + private array $options = [], + private AbstractProxy|\SessionHandlerInterface|null $handler = null, + private ?MetadataBag $metaBag = null, + private bool $secure = false, + ) { + } + + public function createStorage(?Request $request): SessionStorageInterface + { + $storage = new NativeSessionStorage($this->options, $this->handler, $this->metaBag); + if ($this->secure && $request?->isSecure()) { + $storage->setOptions(['cookie_secure' => true]); + } + + return $storage; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php b/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php new file mode 100644 index 00000000..8a8c50c9 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorage.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; + +/** + * Allows session to be started by PHP and managed by Symfony. + * + * @author Drak + */ +class PhpBridgeSessionStorage extends NativeSessionStorage +{ + public function __construct(AbstractProxy|\SessionHandlerInterface|null $handler = null, ?MetadataBag $metaBag = null) + { + if (!\extension_loaded('session')) { + throw new \LogicException('PHP extension "session" is required.'); + } + + $this->setMetadataBag($metaBag); + $this->setSaveHandler($handler); + } + + public function start(): bool + { + if ($this->started) { + return true; + } + + $this->loadSession(); + + return true; + } + + public function clear(): void + { + // clear out the bags and nothing else that may be set + // since the purpose of this driver is to share a handler + foreach ($this->bags as $bag) { + $bag->clear(); + } + + // reconnect the bags to the session + $this->loadSession(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php b/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php new file mode 100644 index 00000000..357e5c71 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/PhpBridgeSessionStorageFactory.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; + +// Help opcache.preload discover always-needed symbols +class_exists(PhpBridgeSessionStorage::class); + +/** + * @author Jérémy Derussé + */ +class PhpBridgeSessionStorageFactory implements SessionStorageFactoryInterface +{ + public function __construct( + private AbstractProxy|\SessionHandlerInterface|null $handler = null, + private ?MetadataBag $metaBag = null, + private bool $secure = false, + ) { + } + + public function createStorage(?Request $request): SessionStorageInterface + { + $storage = new PhpBridgeSessionStorage($this->handler, $this->metaBag); + if ($this->secure && $request?->isSecure()) { + $storage->setOptions(['cookie_secure' => true]); + } + + return $storage; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php new file mode 100644 index 00000000..c3a0278f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/AbstractProxy.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; + +/** + * @author Drak + */ +abstract class AbstractProxy +{ + protected bool $wrapper = false; + + protected ?string $saveHandlerName = null; + + /** + * Gets the session.save_handler name. + */ + public function getSaveHandlerName(): ?string + { + return $this->saveHandlerName; + } + + /** + * Is this proxy handler and instance of \SessionHandlerInterface. + */ + public function isSessionHandlerInterface(): bool + { + return $this instanceof \SessionHandlerInterface; + } + + /** + * Returns true if this handler wraps an internal PHP session save handler using \SessionHandler. + */ + public function isWrapper(): bool + { + return $this->wrapper; + } + + /** + * Has a session started? + */ + public function isActive(): bool + { + return \PHP_SESSION_ACTIVE === session_status(); + } + + /** + * Gets the session ID. + */ + public function getId(): string + { + return session_id(); + } + + /** + * Sets the session ID. + * + * @throws \LogicException + */ + public function setId(string $id): void + { + if ($this->isActive()) { + throw new \LogicException('Cannot change the ID of an active session.'); + } + + session_id($id); + } + + /** + * Gets the session name. + */ + public function getName(): string + { + return session_name(); + } + + /** + * Sets the session name. + * + * @throws \LogicException + */ + public function setName(string $name): void + { + if ($this->isActive()) { + throw new \LogicException('Cannot change the name of an active session.'); + } + + session_name($name); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php b/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php new file mode 100644 index 00000000..0316362f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/Proxy/SessionHandlerProxy.php @@ -0,0 +1,74 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage\Proxy; + +use Symfony\Component\HttpFoundation\Session\Storage\Handler\StrictSessionHandler; + +/** + * @author Drak + */ +class SessionHandlerProxy extends AbstractProxy implements \SessionHandlerInterface, \SessionUpdateTimestampHandlerInterface +{ + public function __construct( + protected \SessionHandlerInterface $handler, + ) { + $this->wrapper = $handler instanceof \SessionHandler; + $this->saveHandlerName = $this->wrapper || ($handler instanceof StrictSessionHandler && $handler->isWrapper()) ? \ini_get('session.save_handler') : 'user'; + } + + public function getHandler(): \SessionHandlerInterface + { + return $this->handler; + } + + // \SessionHandlerInterface + + public function open(string $savePath, string $sessionName): bool + { + return $this->handler->open($savePath, $sessionName); + } + + public function close(): bool + { + return $this->handler->close(); + } + + public function read(#[\SensitiveParameter] string $sessionId): string|false + { + return $this->handler->read($sessionId); + } + + public function write(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->handler->write($sessionId, $data); + } + + public function destroy(#[\SensitiveParameter] string $sessionId): bool + { + return $this->handler->destroy($sessionId); + } + + public function gc(int $maxlifetime): int|false + { + return $this->handler->gc($maxlifetime); + } + + public function validateId(#[\SensitiveParameter] string $sessionId): bool + { + return !$this->handler instanceof \SessionUpdateTimestampHandlerInterface || $this->handler->validateId($sessionId); + } + + public function updateTimestamp(#[\SensitiveParameter] string $sessionId, string $data): bool + { + return $this->handler instanceof \SessionUpdateTimestampHandlerInterface ? $this->handler->updateTimestamp($sessionId, $data) : $this->write($sessionId, $data); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php b/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php new file mode 100644 index 00000000..d03f0da4 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageFactoryInterface.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Request; + +/** + * @author Jérémy Derussé + */ +interface SessionStorageFactoryInterface +{ + /** + * Creates a new instance of SessionStorageInterface. + */ + public function createStorage(?Request $request): SessionStorageInterface; +} diff --git a/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php b/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php new file mode 100644 index 00000000..c51850de --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Session/Storage/SessionStorageInterface.php @@ -0,0 +1,116 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Session\Storage; + +use Symfony\Component\HttpFoundation\Session\SessionBagInterface; + +/** + * StorageInterface. + * + * @author Fabien Potencier + * @author Drak + */ +interface SessionStorageInterface +{ + /** + * Starts the session. + * + * @throws \RuntimeException if something goes wrong starting the session + */ + public function start(): bool; + + /** + * Checks if the session is started. + */ + public function isStarted(): bool; + + /** + * Returns the session ID. + */ + public function getId(): string; + + /** + * Sets the session ID. + */ + public function setId(string $id): void; + + /** + * Returns the session name. + */ + public function getName(): string; + + /** + * Sets the session name. + */ + public function setName(string $name): void; + + /** + * Regenerates id that represents this storage. + * + * This method must invoke session_regenerate_id($destroy) unless + * this interface is used for a storage object designed for unit + * or functional testing where a real PHP session would interfere + * with testing. + * + * Note regenerate+destroy should not clear the session data in memory + * only delete the session data from persistent storage. + * + * Care: When regenerating the session ID no locking is involved in PHP's + * session design. See https://bugs.php.net/61470 for a discussion. + * So you must make sure the regenerated session is saved BEFORE sending the + * headers with the new ID. Symfony's HttpKernel offers a listener for this. + * See Symfony\Component\HttpKernel\EventListener\SaveSessionListener. + * Otherwise session data could get lost again for concurrent requests with the + * new ID. One result could be that you get logged out after just logging in. + * + * @param bool $destroy Destroy session when regenerating? + * @param int|null $lifetime Sets the cookie lifetime for the session cookie. A null value + * will leave the system settings unchanged, 0 sets the cookie + * to expire with browser session. Time is in seconds, and is + * not a Unix timestamp. + * + * @throws \RuntimeException If an error occurs while regenerating this storage + */ + public function regenerate(bool $destroy = false, ?int $lifetime = null): bool; + + /** + * Force the session to be saved and closed. + * + * This method must invoke session_write_close() unless this interface is + * used for a storage object design for unit or functional testing where + * a real PHP session would interfere with testing, in which case + * it should actually persist the session data if required. + * + * @throws \RuntimeException if the session is saved without being started, or if the session + * is already closed + */ + public function save(): void; + + /** + * Clear all session data in memory. + */ + public function clear(): void; + + /** + * Gets a SessionBagInterface by name. + * + * @throws \InvalidArgumentException If the bag does not exist + */ + public function getBag(string $name): SessionBagInterface; + + /** + * Registers a SessionBagInterface for use. + */ + public function registerBag(SessionBagInterface $bag): void; + + public function getMetadataBag(): MetadataBag; +} diff --git a/plugins/vendor/symfony/http-foundation/StreamedJsonResponse.php b/plugins/vendor/symfony/http-foundation/StreamedJsonResponse.php new file mode 100644 index 00000000..5b20ce91 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/StreamedJsonResponse.php @@ -0,0 +1,162 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * StreamedJsonResponse represents a streamed HTTP response for JSON. + * + * A StreamedJsonResponse uses a structure and generics to create an + * efficient resource-saving JSON response. + * + * It is recommended to use flush() function after a specific number of items to directly stream the data. + * + * @see flush() + * + * @author Alexander Schranz + * + * Example usage: + * + * function loadArticles(): \Generator + * // some streamed loading + * yield ['title' => 'Article 1']; + * yield ['title' => 'Article 2']; + * yield ['title' => 'Article 3']; + * // recommended to use flush() after every specific number of items + * }), + * + * $response = new StreamedJsonResponse( + * // json structure with generators in which will be streamed + * [ + * '_embedded' => [ + * 'articles' => loadArticles(), // any generator which you want to stream as list of data + * ], + * ], + * ); + */ +class StreamedJsonResponse extends StreamedResponse +{ + private const PLACEHOLDER = '__symfony_json__'; + + /** + * @param mixed[] $data JSON Data containing PHP generators which will be streamed as list of data or a Generator + * @param int $status The HTTP status code (200 "OK" by default) + * @param array $headers An array of HTTP headers + * @param int $encodingOptions Flags for the json_encode() function + */ + public function __construct( + private readonly iterable $data, + int $status = 200, + array $headers = [], + private int $encodingOptions = JsonResponse::DEFAULT_ENCODING_OPTIONS, + ) { + parent::__construct($this->stream(...), $status, $headers); + + if (!$this->headers->get('Content-Type')) { + $this->headers->set('Content-Type', 'application/json'); + } + } + + private function stream(): void + { + $jsonEncodingOptions = \JSON_THROW_ON_ERROR | $this->encodingOptions; + $keyEncodingOptions = $jsonEncodingOptions & ~\JSON_NUMERIC_CHECK; + + $this->streamData($this->data, $jsonEncodingOptions, $keyEncodingOptions); + } + + private function streamData(mixed $data, int $jsonEncodingOptions, int $keyEncodingOptions): void + { + if (\is_array($data)) { + $this->streamArray($data, $jsonEncodingOptions, $keyEncodingOptions); + + return; + } + + if (is_iterable($data) && !$data instanceof \JsonSerializable) { + $this->streamIterable($data, $jsonEncodingOptions, $keyEncodingOptions); + + return; + } + + echo json_encode($data, $jsonEncodingOptions); + } + + private function streamArray(array $data, int $jsonEncodingOptions, int $keyEncodingOptions): void + { + $generators = []; + + array_walk_recursive($data, function (&$item, $key) use (&$generators) { + if (self::PLACEHOLDER === $key) { + // if the placeholder is already in the structure it should be replaced with a new one that explode + // works like expected for the structure + $generators[] = $key; + } + + // generators should be used but for better DX all kind of Traversable and objects are supported + if (\is_object($item)) { + $generators[] = $item; + $item = self::PLACEHOLDER; + } elseif (self::PLACEHOLDER === $item) { + // if the placeholder is already in the structure it should be replaced with a new one that explode + // works like expected for the structure + $generators[] = $item; + } + }); + + $jsonParts = explode('"'.self::PLACEHOLDER.'"', json_encode($data, $jsonEncodingOptions)); + + foreach ($generators as $index => $generator) { + // send first and between parts of the structure + echo $jsonParts[$index]; + + $this->streamData($generator, $jsonEncodingOptions, $keyEncodingOptions); + } + + // send last part of the structure + echo $jsonParts[array_key_last($jsonParts)]; + } + + private function streamIterable(iterable $iterable, int $jsonEncodingOptions, int $keyEncodingOptions): void + { + $isFirstItem = true; + $startTag = '['; + + foreach ($iterable as $key => $item) { + if ($isFirstItem) { + $isFirstItem = false; + // depending on the first elements key the generator is detected as a list or map + // we can not check for a whole list or map because that would hurt the performance + // of the streamed response which is the main goal of this response class + if (0 !== $key) { + $startTag = '{'; + } + + echo $startTag; + } else { + // if not first element of the generic, a separator is required between the elements + echo ','; + } + + if ('{' === $startTag) { + echo json_encode((string) $key, $keyEncodingOptions).':'; + } + + $this->streamData($item, $jsonEncodingOptions, $keyEncodingOptions); + } + + if ($isFirstItem) { // indicates that the generator was empty + echo '['; + } + + echo '[' === $startTag ? ']' : '}'; + } +} diff --git a/plugins/vendor/symfony/http-foundation/StreamedResponse.php b/plugins/vendor/symfony/http-foundation/StreamedResponse.php new file mode 100644 index 00000000..4e755a7c --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/StreamedResponse.php @@ -0,0 +1,150 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +/** + * StreamedResponse represents a streamed HTTP response. + * + * A StreamedResponse uses a callback or an iterable of strings for its content. + * + * The callback should use the standard PHP functions like echo + * to stream the response back to the client. The flush() function + * can also be used if needed. + * + * @see flush() + * + * @author Fabien Potencier + */ +class StreamedResponse extends Response +{ + protected ?\Closure $callback = null; + protected bool $streamed = false; + + private bool $headersSent = false; + + /** + * @param callable|iterable|null $callbackOrChunks + * @param int $status The HTTP status code (200 "OK" by default) + */ + public function __construct(callable|iterable|null $callbackOrChunks = null, int $status = 200, array $headers = []) + { + parent::__construct(null, $status, $headers); + + if (\is_callable($callbackOrChunks)) { + $this->setCallback($callbackOrChunks); + } elseif ($callbackOrChunks) { + $this->setChunks($callbackOrChunks); + } + $this->streamed = false; + $this->headersSent = false; + } + + /** + * @param iterable $chunks + */ + public function setChunks(iterable $chunks): static + { + $this->callback = static function () use ($chunks): void { + foreach ($chunks as $chunk) { + echo $chunk; + @ob_flush(); + flush(); + } + }; + + return $this; + } + + /** + * Sets the PHP callback associated with this Response. + * + * @return $this + */ + public function setCallback(callable $callback): static + { + $this->callback = $callback(...); + + return $this; + } + + public function getCallback(): ?\Closure + { + if (!isset($this->callback)) { + return null; + } + + return ($this->callback)(...); + } + + /** + * This method only sends the headers once. + * + * @param positive-int|null $statusCode The status code to use, override the statusCode property if set and not null + * + * @return $this + */ + public function sendHeaders(?int $statusCode = null): static + { + if ($this->headersSent) { + return $this; + } + + if ($statusCode < 100 || $statusCode >= 200) { + $this->headersSent = true; + } + + return parent::sendHeaders($statusCode); + } + + /** + * This method only sends the content once. + * + * @return $this + */ + public function sendContent(): static + { + if ($this->streamed) { + return $this; + } + + $this->streamed = true; + + if (!isset($this->callback)) { + throw new \LogicException('The Response callback must be set.'); + } + + ($this->callback)(); + + return $this; + } + + /** + * @return $this + * + * @throws \LogicException when the content is not null + */ + public function setContent(?string $content): static + { + if (null !== $content) { + throw new \LogicException('The content cannot be set on a StreamedResponse instance.'); + } + + $this->streamed = true; + + return $this; + } + + public function getContent(): string|false + { + return false; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php new file mode 100644 index 00000000..c570848f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/RequestAttributeValueSame.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Request; + +final class RequestAttributeValueSame extends Constraint +{ + public function __construct( + private string $name, + private string $value, + ) { + } + + public function toString(): string + { + return \sprintf('has attribute "%s" with value "%s"', $this->name, $this->value); + } + + /** + * @param Request $request + */ + protected function matches($request): bool + { + return $this->value === $request->attributes->get($this->name); + } + + /** + * @param Request $request + */ + protected function failureDescription($request): string + { + return 'the Request '.$this->toString(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php new file mode 100644 index 00000000..dbf9add6 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseCookieValueSame.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Cookie; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseCookieValueSame extends Constraint +{ + public function __construct( + private string $name, + private string $value, + private string $path = '/', + private ?string $domain = null, + ) { + } + + public function toString(): string + { + $str = \sprintf('has cookie "%s"', $this->name); + if ('/' !== $this->path) { + $str .= \sprintf(' with path "%s"', $this->path); + } + if ($this->domain) { + $str .= \sprintf(' for domain "%s"', $this->domain); + } + + return $str.\sprintf(' with value "%s"', $this->value); + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + $cookie = $this->getCookie($response); + if (!$cookie) { + return false; + } + + return $this->value === (string) $cookie->getValue(); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + protected function getCookie(Response $response): ?Cookie + { + $cookies = $response->headers->getCookies(); + + $filteredCookies = array_filter($cookies, fn (Cookie $cookie) => $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain); + + return reset($filteredCookies) ?: null; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php new file mode 100644 index 00000000..cc3655ae --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseFormatSame.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +/** + * Asserts that the response is in the given format. + * + * @author Kévin Dunglas + */ +final class ResponseFormatSame extends Constraint +{ + public function __construct( + private Request $request, + private ?string $format, + private readonly bool $verbose = true, + ) { + } + + public function toString(): string + { + return 'format is '.($this->format ?? 'null'); + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $this->format === $this->request->getFormat($response->headers->get('Content-Type')); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + /** + * @param Response $response + */ + protected function additionalFailureDescription($response): string + { + return $this->verbose ? (string) $response : explode("\r\n\r\n", (string) $response)[0]; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php new file mode 100644 index 00000000..0bc58036 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasCookie.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Cookie; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseHasCookie extends Constraint +{ + public function __construct( + private string $name, + private string $path = '/', + private ?string $domain = null, + ) { + } + + public function toString(): string + { + $str = \sprintf('has cookie "%s"', $this->name); + if ('/' !== $this->path) { + $str .= \sprintf(' with path "%s"', $this->path); + } + if ($this->domain) { + $str .= \sprintf(' for domain "%s"', $this->domain); + } + + return $str; + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return null !== $this->getCookie($response); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + private function getCookie(Response $response): ?Cookie + { + $cookies = $response->headers->getCookies(); + + $filteredCookies = array_filter($cookies, fn (Cookie $cookie) => $cookie->getName() === $this->name && $cookie->getPath() === $this->path && $cookie->getDomain() === $this->domain); + + return reset($filteredCookies) ?: null; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php new file mode 100644 index 00000000..52fd3c18 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHasHeader.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseHasHeader extends Constraint +{ + public function __construct( + private string $headerName, + ) { + } + + public function toString(): string + { + return \sprintf('has header "%s"', $this->headerName); + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $response->headers->has($this->headerName); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderLocationSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderLocationSame.php new file mode 100644 index 00000000..833ffd9f --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderLocationSame.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseHeaderLocationSame extends Constraint +{ + public function __construct(private Request $request, private string $expectedValue) + { + } + + public function toString(): string + { + return \sprintf('has header "Location" matching "%s"', $this->expectedValue); + } + + protected function matches($other): bool + { + if (!$other instanceof Response) { + return false; + } + + $location = $other->headers->get('Location'); + + if (null === $location) { + return false; + } + + return $this->toFullUrl($this->expectedValue) === $this->toFullUrl($location); + } + + protected function failureDescription($other): string + { + return 'the Response '.$this->toString(); + } + + private function toFullUrl(string $url): string + { + if (null === parse_url($url, \PHP_URL_PATH)) { + $url .= '/'; + } + + if (str_starts_with($url, '//')) { + return \sprintf('%s:%s', $this->request->getScheme(), $url); + } + + if (str_starts_with($url, '/')) { + return $this->request->getSchemeAndHttpHost().$url; + } + + return $url; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php new file mode 100644 index 00000000..f2ae27f5 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseHeaderSame.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseHeaderSame extends Constraint +{ + public function __construct( + private string $headerName, + private string $expectedValue, + ) { + } + + public function toString(): string + { + return \sprintf('has header "%s" with value "%s"', $this->headerName, $this->expectedValue); + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $this->expectedValue === $response->headers->get($this->headerName, null); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php new file mode 100644 index 00000000..b7ae15e7 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsRedirected.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseIsRedirected extends Constraint +{ + /** + * @param bool $verbose If true, the entire response is printed on failure. If false, the response body is omitted. + */ + public function __construct(private readonly bool $verbose = true) + { + } + + public function toString(): string + { + return 'is redirected'; + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $response->isRedirect(); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + /** + * @param Response $response + */ + protected function additionalFailureDescription($response): string + { + return $this->verbose ? (string) $response : explode("\r\n\r\n", (string) $response)[0]; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php new file mode 100644 index 00000000..94a65eda --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsSuccessful.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseIsSuccessful extends Constraint +{ + /** + * @param bool $verbose If true, the entire response is printed on failure. If false, the response body is omitted. + */ + public function __construct(private readonly bool $verbose = true) + { + } + + public function toString(): string + { + return 'is successful'; + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $response->isSuccessful(); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + /** + * @param Response $response + */ + protected function additionalFailureDescription($response): string + { + return $this->verbose ? (string) $response : explode("\r\n\r\n", (string) $response)[0]; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php new file mode 100644 index 00000000..799d5583 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseIsUnprocessable.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseIsUnprocessable extends Constraint +{ + /** + * @param bool $verbose If true, the entire response is printed on failure. If false, the response body is omitted. + */ + public function __construct(private readonly bool $verbose = true) + { + } + + public function toString(): string + { + return 'is unprocessable'; + } + + /** + * @param Response $other + */ + protected function matches($other): bool + { + return Response::HTTP_UNPROCESSABLE_ENTITY === $other->getStatusCode(); + } + + /** + * @param Response $other + */ + protected function failureDescription($other): string + { + return 'the Response '.$this->toString(); + } + + /** + * @param Response $response + */ + protected function additionalFailureDescription($response): string + { + return $this->verbose ? (string) $response : explode("\r\n\r\n", (string) $response)[0]; + } +} diff --git a/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php new file mode 100644 index 00000000..1223608b --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/Test/Constraint/ResponseStatusCodeSame.php @@ -0,0 +1,53 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation\Test\Constraint; + +use PHPUnit\Framework\Constraint\Constraint; +use Symfony\Component\HttpFoundation\Response; + +final class ResponseStatusCodeSame extends Constraint +{ + public function __construct( + private int $statusCode, + private readonly bool $verbose = true, + ) { + } + + public function toString(): string + { + return 'status code is '.$this->statusCode; + } + + /** + * @param Response $response + */ + protected function matches($response): bool + { + return $this->statusCode === $response->getStatusCode(); + } + + /** + * @param Response $response + */ + protected function failureDescription($response): string + { + return 'the Response '.$this->toString(); + } + + /** + * @param Response $response + */ + protected function additionalFailureDescription($response): string + { + return $this->verbose ? (string) $response : explode("\r\n\r\n", (string) $response)[0]; + } +} diff --git a/plugins/vendor/symfony/http-foundation/UriSigner.php b/plugins/vendor/symfony/http-foundation/UriSigner.php new file mode 100644 index 00000000..bb870e43 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/UriSigner.php @@ -0,0 +1,223 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Psr\Clock\ClockInterface; +use Symfony\Component\HttpFoundation\Exception\ExpiredSignedUriException; +use Symfony\Component\HttpFoundation\Exception\LogicException; +use Symfony\Component\HttpFoundation\Exception\SignedUriException; +use Symfony\Component\HttpFoundation\Exception\UnsignedUriException; +use Symfony\Component\HttpFoundation\Exception\UnverifiedSignedUriException; + +/** + * @author Fabien Potencier + */ +class UriSigner +{ + private const STATUS_VALID = 1; + private const STATUS_INVALID = 2; + private const STATUS_MISSING = 3; + private const STATUS_EXPIRED = 4; + + /** + * @param string $hashParameter Query string parameter to use + * @param string $expirationParameter Query string parameter to use for expiration + */ + public function __construct( + #[\SensitiveParameter] private string $secret, + private string $hashParameter = '_hash', + private string $expirationParameter = '_expiration', + private ?ClockInterface $clock = null, + ) { + if (!$secret) { + throw new \InvalidArgumentException('A non-empty secret is required.'); + } + } + + /** + * Signs a URI. + * + * The given URI is signed by adding the query string parameter + * which value depends on the URI and the secret. + * + * @param \DateTimeInterface|\DateInterval|int|null $expiration The expiration for the given URI. + * If $expiration is a \DateTimeInterface, it's expected to be the exact date + time. + * If $expiration is a \DateInterval, the interval is added to "now" to get the date + time. + * If $expiration is an int, it's expected to be a timestamp in seconds of the exact date + time. + * If $expiration is null, no expiration. + * + * The expiration is added as a query string parameter. + */ + public function sign(string $uri/* , \DateTimeInterface|\DateInterval|int|null $expiration = null */): string + { + $expiration = null; + + if (1 < \func_num_args()) { + $expiration = func_get_arg(1); + } + + if (null !== $expiration && !$expiration instanceof \DateTimeInterface && !$expiration instanceof \DateInterval && !\is_int($expiration)) { + throw new \TypeError(\sprintf('The second argument of "%s()" must be an instance of "%s" or "%s", an integer or null (%s given).', __METHOD__, \DateTimeInterface::class, \DateInterval::class, get_debug_type($expiration))); + } + + $url = parse_url($uri); + $params = []; + + if (isset($url['query'])) { + parse_str($url['query'], $params); + } + + if (isset($params[$this->hashParameter])) { + throw new LogicException(\sprintf('URI query parameter conflict: parameter name "%s" is reserved.', $this->hashParameter)); + } + + if (isset($params[$this->expirationParameter])) { + throw new LogicException(\sprintf('URI query parameter conflict: parameter name "%s" is reserved.', $this->expirationParameter)); + } + + if (null !== $expiration) { + $params[$this->expirationParameter] = $this->getExpirationTime($expiration); + } + + $uri = $this->buildUrl($url, $params); + $params[$this->hashParameter] = $this->computeHash($uri); + + return $this->buildUrl($url, $params); + } + + /** + * Checks that a URI contains the correct hash. + * Also checks if the URI has not expired (If you used expiration during signing). + */ + public function check(string $uri): bool + { + return self::STATUS_VALID === $this->doVerify($uri); + } + + public function checkRequest(Request $request): bool + { + return self::STATUS_VALID === $this->doVerify(self::normalize($request)); + } + + /** + * Verify a Request or string URI. + * + * @throws UnsignedUriException If the URI is not signed + * @throws UnverifiedSignedUriException If the signature is invalid + * @throws ExpiredSignedUriException If the URI has expired + * @throws SignedUriException + */ + public function verify(Request|string $uri): void + { + $uri = self::normalize($uri); + $status = $this->doVerify($uri); + + if (self::STATUS_VALID === $status) { + return; + } + + if (self::STATUS_MISSING === $status) { + throw new UnsignedUriException(); + } + + if (self::STATUS_INVALID === $status) { + throw new UnverifiedSignedUriException(); + } + + throw new ExpiredSignedUriException(); + } + + private function computeHash(string $uri): string + { + return strtr(rtrim(base64_encode(hash_hmac('sha256', $uri, $this->secret, true)), '='), ['/' => '_', '+' => '-']); + } + + private function buildUrl(array $url, array $params = []): string + { + ksort($params, \SORT_STRING); + $url['query'] = http_build_query($params, '', '&'); + + $scheme = isset($url['scheme']) ? $url['scheme'].'://' : ''; + $host = $url['host'] ?? ''; + $port = isset($url['port']) ? ':'.$url['port'] : ''; + $user = $url['user'] ?? ''; + $pass = isset($url['pass']) ? ':'.$url['pass'] : ''; + $pass = ($user || $pass) ? "$pass@" : ''; + $path = $url['path'] ?? ''; + $query = $url['query'] ? '?'.$url['query'] : ''; + $fragment = isset($url['fragment']) ? '#'.$url['fragment'] : ''; + + return $scheme.$user.$pass.$host.$port.$path.$query.$fragment; + } + + private function getExpirationTime(\DateTimeInterface|\DateInterval|int $expiration): string + { + if ($expiration instanceof \DateTimeInterface) { + return $expiration->format('U'); + } + + if ($expiration instanceof \DateInterval) { + return $this->now()->add($expiration)->format('U'); + } + + return (string) $expiration; + } + + private function now(): \DateTimeImmutable + { + return $this->clock?->now() ?? \DateTimeImmutable::createFromFormat('U', time()); + } + + /** + * @return self::STATUS_* + */ + private function doVerify(string $uri): int + { + $url = parse_url($uri); + $params = []; + + if (isset($url['query'])) { + parse_str($url['query'], $params); + } + + if (empty($params[$this->hashParameter])) { + return self::STATUS_MISSING; + } + + $hash = $params[$this->hashParameter]; + unset($params[$this->hashParameter]); + + if (!hash_equals($this->computeHash($this->buildUrl($url, $params)), strtr(rtrim($hash, '='), ['/' => '_', '+' => '-']))) { + return self::STATUS_INVALID; + } + + if (!$expiration = $params[$this->expirationParameter] ?? false) { + return self::STATUS_VALID; + } + + if ($this->now()->getTimestamp() < $expiration) { + return self::STATUS_VALID; + } + + return self::STATUS_EXPIRED; + } + + private static function normalize(Request|string $uri): string + { + if ($uri instanceof Request) { + $qs = ($qs = $uri->server->get('QUERY_STRING')) ? '?'.$qs : ''; + $uri = $uri->getSchemeAndHttpHost().$uri->getBaseUrl().$uri->getPathInfo().$qs; + } + + return $uri; + } +} diff --git a/plugins/vendor/symfony/http-foundation/UrlHelper.php b/plugins/vendor/symfony/http-foundation/UrlHelper.php new file mode 100644 index 00000000..f971cf66 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/UrlHelper.php @@ -0,0 +1,108 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\HttpFoundation; + +use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\RequestContextAwareInterface; + +/** + * A helper service for manipulating URLs within and outside the request scope. + * + * @author Valentin Udaltsov + */ +final class UrlHelper +{ + public function __construct( + private RequestStack $requestStack, + private RequestContextAwareInterface|RequestContext|null $requestContext = null, + ) { + } + + public function getAbsoluteUrl(string $path): string + { + if (str_contains($path, '://') || str_starts_with($path, '//')) { + return $path; + } + + if (null === $request = $this->requestStack->getMainRequest()) { + return $this->getAbsoluteUrlFromContext($path); + } + + if ('#' === $path[0]) { + $path = $request->getRequestUri().$path; + } elseif ('?' === $path[0]) { + $path = $request->getPathInfo().$path; + } + + if (!$path || '/' !== $path[0]) { + $prefix = $request->getPathInfo(); + $last = \strlen($prefix) - 1; + if ($last !== $pos = strrpos($prefix, '/')) { + $prefix = substr($prefix, 0, $pos).'/'; + } + + return $request->getUriForPath($prefix.$path); + } + + return $request->getSchemeAndHttpHost().$path; + } + + public function getRelativePath(string $path): string + { + if (str_contains($path, '://') || str_starts_with($path, '//')) { + return $path; + } + + if (null === $request = $this->requestStack->getMainRequest()) { + return $path; + } + + return $request->getRelativeUriForPath($path); + } + + private function getAbsoluteUrlFromContext(string $path): string + { + if (null === $context = $this->requestContext) { + return $path; + } + + if ($context instanceof RequestContextAwareInterface) { + $context = $context->getContext(); + } + + if ('' === $host = $context->getHost()) { + return $path; + } + + $scheme = $context->getScheme(); + $port = ''; + + if ('http' === $scheme && 80 !== $context->getHttpPort()) { + $port = ':'.$context->getHttpPort(); + } elseif ('https' === $scheme && 443 !== $context->getHttpsPort()) { + $port = ':'.$context->getHttpsPort(); + } + + if ('#' === $path[0]) { + $queryString = $context->getQueryString(); + $path = $context->getPathInfo().($queryString ? '?'.$queryString : '').$path; + } elseif ('?' === $path[0]) { + $path = $context->getPathInfo().$path; + } + + if ('/' !== $path[0]) { + $path = rtrim($context->getBaseUrl(), '/').'/'.$path; + } + + return $scheme.'://'.$host.$port.$path; + } +} diff --git a/plugins/vendor/symfony/http-foundation/composer.json b/plugins/vendor/symfony/http-foundation/composer.json new file mode 100644 index 00000000..a86b21b7 --- /dev/null +++ b/plugins/vendor/symfony/http-foundation/composer.json @@ -0,0 +1,46 @@ +{ + "name": "symfony/http-foundation", + "type": "library", + "description": "Defines an object-oriented layer for the HTTP specification", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-mbstring": "~1.1", + "symfony/polyfill-php83": "^1.27" + }, + "require-dev": { + "doctrine/dbal": "^3.6|^4", + "predis/predis": "^1.1|^2.0", + "symfony/cache": "^6.4.12|^7.1.5", + "symfony/clock": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/mime": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/rate-limiter": "^6.4|^7.0" + }, + "conflict": { + "doctrine/dbal": "<3.6", + "symfony/cache": "<6.4.12|>=7.0,<7.1.5" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\HttpFoundation\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/symfony/polyfill-mbstring/LICENSE b/plugins/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100644 index 00000000..6e3afce6 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/polyfill-mbstring/Mbstring.php b/plugins/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100644 index 00000000..31e36a36 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,1045 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * - mb_ucfirst - Make a string's first character uppercase + * - mb_lcfirst - Make a string's first character lowercase + * - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string + * - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string + * - mb_rtrim - Strip whitespace (or other characters) from the end of a string + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + public const MB_CASE_FOLD = \PHP_INT_MAX; + + private const SIMPLE_CASE_FOLD = [ + ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], + ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], + ]; + + private static $encodingList = ['ASCII', 'UTF-8']; + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($s)) { + $r = []; + foreach ($s as $str) { + $r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding); + } + + return $r; + } + + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) + { + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return self::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); + + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !\is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (\MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); + } else { + if (\MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $normalizedEncoding = self::getEncoding($encoding); + + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + self::$internalEncoding = $normalizedEncoding; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($normalizedLang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $normalizedLang; + + return true; + } + + if (80000 > \PHP_VERSION_ID) { + return false; + } + + throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); + } + + public static function mb_list_encodings() + { + return ['UTF-8']; + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return ['utf8']; + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + if (80000 > \PHP_VERSION_ID) { + trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); + + return false; + } + + return 0; + } + + return iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = '' !== $needle || 80000 > \PHP_VERSION_ID + ? iconv_strrpos($haystack, $needle, $encoding) + : self::mb_strlen($haystack, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + public static function mb_str_split($string, $split_length = 1, $encoding = null) + { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); + + return null; + } + + if (1 > $split_length = (int) $split_length) { + if (80000 > \PHP_VERSION_ID) { + trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + + return false; + } + + throw new \ValueError('Argument #2 ($length) must be greater than 0'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + } + + $result = []; + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (null === $c) { + return 'none'; + } + if (0 === strcasecmp($c, 'none')) { + return true; + } + if (80000 > \PHP_VERSION_ID) { + return false; + } + if (\is_int($c) || 'long' === $c || 'entity' === $c) { + return false; + } + + throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return (string) substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + return (string) iconv_substr($s, $start, $length, $encoding); + } + + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) + { + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); + } + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = [ + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ]; + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given'); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given'); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } + + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } else { + self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given'); + } + + if ('' === $characters) { + return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $string)) { + $string = @iconv('UTF-8', 'UTF-8//IGNORE', $string); + } + if (null !== $characters && !preg_match('//u', $characters)) { + $characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters); + } + } else { + $string = iconv($encoding, 'UTF-8//IGNORE', $string); + + if (null !== $characters) { + $characters = iconv($encoding, 'UTF-8//IGNORE', $characters); + } + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if (null === $encoding) { + return $string; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $string); + } + + private static function assertEncoding(string $encoding, string $errorFormat): void + { + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf($errorFormat, $encoding)); + } + } +} diff --git a/plugins/vendor/symfony/polyfill-mbstring/README.md b/plugins/vendor/symfony/polyfill-mbstring/README.md new file mode 100644 index 00000000..478b40da --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Mbstring +=========================== + +This component provides a partial, native PHP implementation for the +[Mbstring](https://php.net/mbstring) extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 00000000..512bba0b --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100644 index 00000000..fac60b08 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1397 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + 'À' => 'à', + 'Á' => 'á', + 'Â' => 'â', + 'Ã' => 'ã', + 'Ä' => 'ä', + 'Å' => 'å', + 'Æ' => 'æ', + 'Ç' => 'ç', + 'È' => 'è', + 'É' => 'é', + 'Ê' => 'ê', + 'Ë' => 'ë', + 'Ì' => 'ì', + 'Í' => 'í', + 'Î' => 'î', + 'Ï' => 'ï', + 'Ð' => 'ð', + 'Ñ' => 'ñ', + 'Ò' => 'ò', + 'Ó' => 'ó', + 'Ô' => 'ô', + 'Õ' => 'õ', + 'Ö' => 'ö', + 'Ø' => 'ø', + 'Ù' => 'ù', + 'Ú' => 'ú', + 'Û' => 'û', + 'Ü' => 'ü', + 'Ý' => 'ý', + 'Þ' => 'þ', + 'Ā' => 'ā', + 'Ă' => 'ă', + 'Ą' => 'ą', + 'Ć' => 'ć', + 'Ĉ' => 'ĉ', + 'Ċ' => 'ċ', + 'Č' => 'č', + 'Ď' => 'ď', + 'Đ' => 'đ', + 'Ē' => 'ē', + 'Ĕ' => 'ĕ', + 'Ė' => 'ė', + 'Ę' => 'ę', + 'Ě' => 'ě', + 'Ĝ' => 'ĝ', + 'Ğ' => 'ğ', + 'Ġ' => 'ġ', + 'Ģ' => 'ģ', + 'Ĥ' => 'ĥ', + 'Ħ' => 'ħ', + 'Ĩ' => 'ĩ', + 'Ī' => 'ī', + 'Ĭ' => 'ĭ', + 'Į' => 'į', + 'İ' => 'i̇', + 'IJ' => 'ij', + 'Ĵ' => 'ĵ', + 'Ķ' => 'ķ', + 'Ĺ' => 'ĺ', + 'Ļ' => 'ļ', + 'Ľ' => 'ľ', + 'Ŀ' => 'ŀ', + 'Ł' => 'ł', + 'Ń' => 'ń', + 'Ņ' => 'ņ', + 'Ň' => 'ň', + 'Ŋ' => 'ŋ', + 'Ō' => 'ō', + 'Ŏ' => 'ŏ', + 'Ő' => 'ő', + 'Œ' => 'œ', + 'Ŕ' => 'ŕ', + 'Ŗ' => 'ŗ', + 'Ř' => 'ř', + 'Ś' => 'ś', + 'Ŝ' => 'ŝ', + 'Ş' => 'ş', + 'Š' => 'š', + 'Ţ' => 'ţ', + 'Ť' => 'ť', + 'Ŧ' => 'ŧ', + 'Ũ' => 'ũ', + 'Ū' => 'ū', + 'Ŭ' => 'ŭ', + 'Ů' => 'ů', + 'Ű' => 'ű', + 'Ų' => 'ų', + 'Ŵ' => 'ŵ', + 'Ŷ' => 'ŷ', + 'Ÿ' => 'ÿ', + 'Ź' => 'ź', + 'Ż' => 'ż', + 'Ž' => 'ž', + 'Ɓ' => 'ɓ', + 'Ƃ' => 'ƃ', + 'Ƅ' => 'ƅ', + 'Ɔ' => 'ɔ', + 'Ƈ' => 'ƈ', + 'Ɖ' => 'ɖ', + 'Ɗ' => 'ɗ', + 'Ƌ' => 'ƌ', + 'Ǝ' => 'ǝ', + 'Ə' => 'ə', + 'Ɛ' => 'ɛ', + 'Ƒ' => 'ƒ', + 'Ɠ' => 'ɠ', + 'Ɣ' => 'ɣ', + 'Ɩ' => 'ɩ', + 'Ɨ' => 'ɨ', + 'Ƙ' => 'ƙ', + 'Ɯ' => 'ɯ', + 'Ɲ' => 'ɲ', + 'Ɵ' => 'ɵ', + 'Ơ' => 'ơ', + 'Ƣ' => 'ƣ', + 'Ƥ' => 'ƥ', + 'Ʀ' => 'ʀ', + 'Ƨ' => 'ƨ', + 'Ʃ' => 'ʃ', + 'Ƭ' => 'ƭ', + 'Ʈ' => 'ʈ', + 'Ư' => 'ư', + 'Ʊ' => 'ʊ', + 'Ʋ' => 'ʋ', + 'Ƴ' => 'ƴ', + 'Ƶ' => 'ƶ', + 'Ʒ' => 'ʒ', + 'Ƹ' => 'ƹ', + 'Ƽ' => 'ƽ', + 'DŽ' => 'dž', + 'Dž' => 'dž', + 'LJ' => 'lj', + 'Lj' => 'lj', + 'NJ' => 'nj', + 'Nj' => 'nj', + 'Ǎ' => 'ǎ', + 'Ǐ' => 'ǐ', + 'Ǒ' => 'ǒ', + 'Ǔ' => 'ǔ', + 'Ǖ' => 'ǖ', + 'Ǘ' => 'ǘ', + 'Ǚ' => 'ǚ', + 'Ǜ' => 'ǜ', + 'Ǟ' => 'ǟ', + 'Ǡ' => 'ǡ', + 'Ǣ' => 'ǣ', + 'Ǥ' => 'ǥ', + 'Ǧ' => 'ǧ', + 'Ǩ' => 'ǩ', + 'Ǫ' => 'ǫ', + 'Ǭ' => 'ǭ', + 'Ǯ' => 'ǯ', + 'DZ' => 'dz', + 'Dz' => 'dz', + 'Ǵ' => 'ǵ', + 'Ƕ' => 'ƕ', + 'Ƿ' => 'ƿ', + 'Ǹ' => 'ǹ', + 'Ǻ' => 'ǻ', + 'Ǽ' => 'ǽ', + 'Ǿ' => 'ǿ', + 'Ȁ' => 'ȁ', + 'Ȃ' => 'ȃ', + 'Ȅ' => 'ȅ', + 'Ȇ' => 'ȇ', + 'Ȉ' => 'ȉ', + 'Ȋ' => 'ȋ', + 'Ȍ' => 'ȍ', + 'Ȏ' => 'ȏ', + 'Ȑ' => 'ȑ', + 'Ȓ' => 'ȓ', + 'Ȕ' => 'ȕ', + 'Ȗ' => 'ȗ', + 'Ș' => 'ș', + 'Ț' => 'ț', + 'Ȝ' => 'ȝ', + 'Ȟ' => 'ȟ', + 'Ƞ' => 'ƞ', + 'Ȣ' => 'ȣ', + 'Ȥ' => 'ȥ', + 'Ȧ' => 'ȧ', + 'Ȩ' => 'ȩ', + 'Ȫ' => 'ȫ', + 'Ȭ' => 'ȭ', + 'Ȯ' => 'ȯ', + 'Ȱ' => 'ȱ', + 'Ȳ' => 'ȳ', + 'Ⱥ' => 'ⱥ', + 'Ȼ' => 'ȼ', + 'Ƚ' => 'ƚ', + 'Ⱦ' => 'ⱦ', + 'Ɂ' => 'ɂ', + 'Ƀ' => 'ƀ', + 'Ʉ' => 'ʉ', + 'Ʌ' => 'ʌ', + 'Ɇ' => 'ɇ', + 'Ɉ' => 'ɉ', + 'Ɋ' => 'ɋ', + 'Ɍ' => 'ɍ', + 'Ɏ' => 'ɏ', + 'Ͱ' => 'ͱ', + 'Ͳ' => 'ͳ', + 'Ͷ' => 'ͷ', + 'Ϳ' => 'ϳ', + 'Ά' => 'ά', + 'Έ' => 'έ', + 'Ή' => 'ή', + 'Ί' => 'ί', + 'Ό' => 'ό', + 'Ύ' => 'ύ', + 'Ώ' => 'ώ', + 'Α' => 'α', + 'Β' => 'β', + 'Γ' => 'γ', + 'Δ' => 'δ', + 'Ε' => 'ε', + 'Ζ' => 'ζ', + 'Η' => 'η', + 'Θ' => 'θ', + 'Ι' => 'ι', + 'Κ' => 'κ', + 'Λ' => 'λ', + 'Μ' => 'μ', + 'Ν' => 'ν', + 'Ξ' => 'ξ', + 'Ο' => 'ο', + 'Π' => 'π', + 'Ρ' => 'ρ', + 'Σ' => 'σ', + 'Τ' => 'τ', + 'Υ' => 'υ', + 'Φ' => 'φ', + 'Χ' => 'χ', + 'Ψ' => 'ψ', + 'Ω' => 'ω', + 'Ϊ' => 'ϊ', + 'Ϋ' => 'ϋ', + 'Ϗ' => 'ϗ', + 'Ϙ' => 'ϙ', + 'Ϛ' => 'ϛ', + 'Ϝ' => 'ϝ', + 'Ϟ' => 'ϟ', + 'Ϡ' => 'ϡ', + 'Ϣ' => 'ϣ', + 'Ϥ' => 'ϥ', + 'Ϧ' => 'ϧ', + 'Ϩ' => 'ϩ', + 'Ϫ' => 'ϫ', + 'Ϭ' => 'ϭ', + 'Ϯ' => 'ϯ', + 'ϴ' => 'θ', + 'Ϸ' => 'ϸ', + 'Ϲ' => 'ϲ', + 'Ϻ' => 'ϻ', + 'Ͻ' => 'ͻ', + 'Ͼ' => 'ͼ', + 'Ͽ' => 'ͽ', + 'Ѐ' => 'ѐ', + 'Ё' => 'ё', + 'Ђ' => 'ђ', + 'Ѓ' => 'ѓ', + 'Є' => 'є', + 'Ѕ' => 'ѕ', + 'І' => 'і', + 'Ї' => 'ї', + 'Ј' => 'ј', + 'Љ' => 'љ', + 'Њ' => 'њ', + 'Ћ' => 'ћ', + 'Ќ' => 'ќ', + 'Ѝ' => 'ѝ', + 'Ў' => 'ў', + 'Џ' => 'џ', + 'А' => 'а', + 'Б' => 'б', + 'В' => 'в', + 'Г' => 'г', + 'Д' => 'д', + 'Е' => 'е', + 'Ж' => 'ж', + 'З' => 'з', + 'И' => 'и', + 'Й' => 'й', + 'К' => 'к', + 'Л' => 'л', + 'М' => 'м', + 'Н' => 'н', + 'О' => 'о', + 'П' => 'п', + 'Р' => 'р', + 'С' => 'с', + 'Т' => 'т', + 'У' => 'у', + 'Ф' => 'ф', + 'Х' => 'х', + 'Ц' => 'ц', + 'Ч' => 'ч', + 'Ш' => 'ш', + 'Щ' => 'щ', + 'Ъ' => 'ъ', + 'Ы' => 'ы', + 'Ь' => 'ь', + 'Э' => 'э', + 'Ю' => 'ю', + 'Я' => 'я', + 'Ѡ' => 'ѡ', + 'Ѣ' => 'ѣ', + 'Ѥ' => 'ѥ', + 'Ѧ' => 'ѧ', + 'Ѩ' => 'ѩ', + 'Ѫ' => 'ѫ', + 'Ѭ' => 'ѭ', + 'Ѯ' => 'ѯ', + 'Ѱ' => 'ѱ', + 'Ѳ' => 'ѳ', + 'Ѵ' => 'ѵ', + 'Ѷ' => 'ѷ', + 'Ѹ' => 'ѹ', + 'Ѻ' => 'ѻ', + 'Ѽ' => 'ѽ', + 'Ѿ' => 'ѿ', + 'Ҁ' => 'ҁ', + 'Ҋ' => 'ҋ', + 'Ҍ' => 'ҍ', + 'Ҏ' => 'ҏ', + 'Ґ' => 'ґ', + 'Ғ' => 'ғ', + 'Ҕ' => 'ҕ', + 'Җ' => 'җ', + 'Ҙ' => 'ҙ', + 'Қ' => 'қ', + 'Ҝ' => 'ҝ', + 'Ҟ' => 'ҟ', + 'Ҡ' => 'ҡ', + 'Ң' => 'ң', + 'Ҥ' => 'ҥ', + 'Ҧ' => 'ҧ', + 'Ҩ' => 'ҩ', + 'Ҫ' => 'ҫ', + 'Ҭ' => 'ҭ', + 'Ү' => 'ү', + 'Ұ' => 'ұ', + 'Ҳ' => 'ҳ', + 'Ҵ' => 'ҵ', + 'Ҷ' => 'ҷ', + 'Ҹ' => 'ҹ', + 'Һ' => 'һ', + 'Ҽ' => 'ҽ', + 'Ҿ' => 'ҿ', + 'Ӏ' => 'ӏ', + 'Ӂ' => 'ӂ', + 'Ӄ' => 'ӄ', + 'Ӆ' => 'ӆ', + 'Ӈ' => 'ӈ', + 'Ӊ' => 'ӊ', + 'Ӌ' => 'ӌ', + 'Ӎ' => 'ӎ', + 'Ӑ' => 'ӑ', + 'Ӓ' => 'ӓ', + 'Ӕ' => 'ӕ', + 'Ӗ' => 'ӗ', + 'Ә' => 'ә', + 'Ӛ' => 'ӛ', + 'Ӝ' => 'ӝ', + 'Ӟ' => 'ӟ', + 'Ӡ' => 'ӡ', + 'Ӣ' => 'ӣ', + 'Ӥ' => 'ӥ', + 'Ӧ' => 'ӧ', + 'Ө' => 'ө', + 'Ӫ' => 'ӫ', + 'Ӭ' => 'ӭ', + 'Ӯ' => 'ӯ', + 'Ӱ' => 'ӱ', + 'Ӳ' => 'ӳ', + 'Ӵ' => 'ӵ', + 'Ӷ' => 'ӷ', + 'Ӹ' => 'ӹ', + 'Ӻ' => 'ӻ', + 'Ӽ' => 'ӽ', + 'Ӿ' => 'ӿ', + 'Ԁ' => 'ԁ', + 'Ԃ' => 'ԃ', + 'Ԅ' => 'ԅ', + 'Ԇ' => 'ԇ', + 'Ԉ' => 'ԉ', + 'Ԋ' => 'ԋ', + 'Ԍ' => 'ԍ', + 'Ԏ' => 'ԏ', + 'Ԑ' => 'ԑ', + 'Ԓ' => 'ԓ', + 'Ԕ' => 'ԕ', + 'Ԗ' => 'ԗ', + 'Ԙ' => 'ԙ', + 'Ԛ' => 'ԛ', + 'Ԝ' => 'ԝ', + 'Ԟ' => 'ԟ', + 'Ԡ' => 'ԡ', + 'Ԣ' => 'ԣ', + 'Ԥ' => 'ԥ', + 'Ԧ' => 'ԧ', + 'Ԩ' => 'ԩ', + 'Ԫ' => 'ԫ', + 'Ԭ' => 'ԭ', + 'Ԯ' => 'ԯ', + 'Ա' => 'ա', + 'Բ' => 'բ', + 'Գ' => 'գ', + 'Դ' => 'դ', + 'Ե' => 'ե', + 'Զ' => 'զ', + 'Է' => 'է', + 'Ը' => 'ը', + 'Թ' => 'թ', + 'Ժ' => 'ժ', + 'Ի' => 'ի', + 'Լ' => 'լ', + 'Խ' => 'խ', + 'Ծ' => 'ծ', + 'Կ' => 'կ', + 'Հ' => 'հ', + 'Ձ' => 'ձ', + 'Ղ' => 'ղ', + 'Ճ' => 'ճ', + 'Մ' => 'մ', + 'Յ' => 'յ', + 'Ն' => 'ն', + 'Շ' => 'շ', + 'Ո' => 'ո', + 'Չ' => 'չ', + 'Պ' => 'պ', + 'Ջ' => 'ջ', + 'Ռ' => 'ռ', + 'Ս' => 'ս', + 'Վ' => 'վ', + 'Տ' => 'տ', + 'Ր' => 'ր', + 'Ց' => 'ց', + 'Ւ' => 'ւ', + 'Փ' => 'փ', + 'Ք' => 'ք', + 'Օ' => 'օ', + 'Ֆ' => 'ֆ', + 'Ⴀ' => 'ⴀ', + 'Ⴁ' => 'ⴁ', + 'Ⴂ' => 'ⴂ', + 'Ⴃ' => 'ⴃ', + 'Ⴄ' => 'ⴄ', + 'Ⴅ' => 'ⴅ', + 'Ⴆ' => 'ⴆ', + 'Ⴇ' => 'ⴇ', + 'Ⴈ' => 'ⴈ', + 'Ⴉ' => 'ⴉ', + 'Ⴊ' => 'ⴊ', + 'Ⴋ' => 'ⴋ', + 'Ⴌ' => 'ⴌ', + 'Ⴍ' => 'ⴍ', + 'Ⴎ' => 'ⴎ', + 'Ⴏ' => 'ⴏ', + 'Ⴐ' => 'ⴐ', + 'Ⴑ' => 'ⴑ', + 'Ⴒ' => 'ⴒ', + 'Ⴓ' => 'ⴓ', + 'Ⴔ' => 'ⴔ', + 'Ⴕ' => 'ⴕ', + 'Ⴖ' => 'ⴖ', + 'Ⴗ' => 'ⴗ', + 'Ⴘ' => 'ⴘ', + 'Ⴙ' => 'ⴙ', + 'Ⴚ' => 'ⴚ', + 'Ⴛ' => 'ⴛ', + 'Ⴜ' => 'ⴜ', + 'Ⴝ' => 'ⴝ', + 'Ⴞ' => 'ⴞ', + 'Ⴟ' => 'ⴟ', + 'Ⴠ' => 'ⴠ', + 'Ⴡ' => 'ⴡ', + 'Ⴢ' => 'ⴢ', + 'Ⴣ' => 'ⴣ', + 'Ⴤ' => 'ⴤ', + 'Ⴥ' => 'ⴥ', + 'Ⴧ' => 'ⴧ', + 'Ⴭ' => 'ⴭ', + 'Ꭰ' => 'ꭰ', + 'Ꭱ' => 'ꭱ', + 'Ꭲ' => 'ꭲ', + 'Ꭳ' => 'ꭳ', + 'Ꭴ' => 'ꭴ', + 'Ꭵ' => 'ꭵ', + 'Ꭶ' => 'ꭶ', + 'Ꭷ' => 'ꭷ', + 'Ꭸ' => 'ꭸ', + 'Ꭹ' => 'ꭹ', + 'Ꭺ' => 'ꭺ', + 'Ꭻ' => 'ꭻ', + 'Ꭼ' => 'ꭼ', + 'Ꭽ' => 'ꭽ', + 'Ꭾ' => 'ꭾ', + 'Ꭿ' => 'ꭿ', + 'Ꮀ' => 'ꮀ', + 'Ꮁ' => 'ꮁ', + 'Ꮂ' => 'ꮂ', + 'Ꮃ' => 'ꮃ', + 'Ꮄ' => 'ꮄ', + 'Ꮅ' => 'ꮅ', + 'Ꮆ' => 'ꮆ', + 'Ꮇ' => 'ꮇ', + 'Ꮈ' => 'ꮈ', + 'Ꮉ' => 'ꮉ', + 'Ꮊ' => 'ꮊ', + 'Ꮋ' => 'ꮋ', + 'Ꮌ' => 'ꮌ', + 'Ꮍ' => 'ꮍ', + 'Ꮎ' => 'ꮎ', + 'Ꮏ' => 'ꮏ', + 'Ꮐ' => 'ꮐ', + 'Ꮑ' => 'ꮑ', + 'Ꮒ' => 'ꮒ', + 'Ꮓ' => 'ꮓ', + 'Ꮔ' => 'ꮔ', + 'Ꮕ' => 'ꮕ', + 'Ꮖ' => 'ꮖ', + 'Ꮗ' => 'ꮗ', + 'Ꮘ' => 'ꮘ', + 'Ꮙ' => 'ꮙ', + 'Ꮚ' => 'ꮚ', + 'Ꮛ' => 'ꮛ', + 'Ꮜ' => 'ꮜ', + 'Ꮝ' => 'ꮝ', + 'Ꮞ' => 'ꮞ', + 'Ꮟ' => 'ꮟ', + 'Ꮠ' => 'ꮠ', + 'Ꮡ' => 'ꮡ', + 'Ꮢ' => 'ꮢ', + 'Ꮣ' => 'ꮣ', + 'Ꮤ' => 'ꮤ', + 'Ꮥ' => 'ꮥ', + 'Ꮦ' => 'ꮦ', + 'Ꮧ' => 'ꮧ', + 'Ꮨ' => 'ꮨ', + 'Ꮩ' => 'ꮩ', + 'Ꮪ' => 'ꮪ', + 'Ꮫ' => 'ꮫ', + 'Ꮬ' => 'ꮬ', + 'Ꮭ' => 'ꮭ', + 'Ꮮ' => 'ꮮ', + 'Ꮯ' => 'ꮯ', + 'Ꮰ' => 'ꮰ', + 'Ꮱ' => 'ꮱ', + 'Ꮲ' => 'ꮲ', + 'Ꮳ' => 'ꮳ', + 'Ꮴ' => 'ꮴ', + 'Ꮵ' => 'ꮵ', + 'Ꮶ' => 'ꮶ', + 'Ꮷ' => 'ꮷ', + 'Ꮸ' => 'ꮸ', + 'Ꮹ' => 'ꮹ', + 'Ꮺ' => 'ꮺ', + 'Ꮻ' => 'ꮻ', + 'Ꮼ' => 'ꮼ', + 'Ꮽ' => 'ꮽ', + 'Ꮾ' => 'ꮾ', + 'Ꮿ' => 'ꮿ', + 'Ᏸ' => 'ᏸ', + 'Ᏹ' => 'ᏹ', + 'Ᏺ' => 'ᏺ', + 'Ᏻ' => 'ᏻ', + 'Ᏼ' => 'ᏼ', + 'Ᏽ' => 'ᏽ', + 'Ა' => 'ა', + 'Ბ' => 'ბ', + 'Გ' => 'გ', + 'Დ' => 'დ', + 'Ე' => 'ე', + 'Ვ' => 'ვ', + 'Ზ' => 'ზ', + 'Თ' => 'თ', + 'Ი' => 'ი', + 'Კ' => 'კ', + 'Ლ' => 'ლ', + 'Მ' => 'მ', + 'Ნ' => 'ნ', + 'Ო' => 'ო', + 'Პ' => 'პ', + 'Ჟ' => 'ჟ', + 'Რ' => 'რ', + 'Ს' => 'ს', + 'Ტ' => 'ტ', + 'Უ' => 'უ', + 'Ფ' => 'ფ', + 'Ქ' => 'ქ', + 'Ღ' => 'ღ', + 'Ყ' => 'ყ', + 'Შ' => 'შ', + 'Ჩ' => 'ჩ', + 'Ც' => 'ც', + 'Ძ' => 'ძ', + 'Წ' => 'წ', + 'Ჭ' => 'ჭ', + 'Ხ' => 'ხ', + 'Ჯ' => 'ჯ', + 'Ჰ' => 'ჰ', + 'Ჱ' => 'ჱ', + 'Ჲ' => 'ჲ', + 'Ჳ' => 'ჳ', + 'Ჴ' => 'ჴ', + 'Ჵ' => 'ჵ', + 'Ჶ' => 'ჶ', + 'Ჷ' => 'ჷ', + 'Ჸ' => 'ჸ', + 'Ჹ' => 'ჹ', + 'Ჺ' => 'ჺ', + 'Ჽ' => 'ჽ', + 'Ჾ' => 'ჾ', + 'Ჿ' => 'ჿ', + 'Ḁ' => 'ḁ', + 'Ḃ' => 'ḃ', + 'Ḅ' => 'ḅ', + 'Ḇ' => 'ḇ', + 'Ḉ' => 'ḉ', + 'Ḋ' => 'ḋ', + 'Ḍ' => 'ḍ', + 'Ḏ' => 'ḏ', + 'Ḑ' => 'ḑ', + 'Ḓ' => 'ḓ', + 'Ḕ' => 'ḕ', + 'Ḗ' => 'ḗ', + 'Ḙ' => 'ḙ', + 'Ḛ' => 'ḛ', + 'Ḝ' => 'ḝ', + 'Ḟ' => 'ḟ', + 'Ḡ' => 'ḡ', + 'Ḣ' => 'ḣ', + 'Ḥ' => 'ḥ', + 'Ḧ' => 'ḧ', + 'Ḩ' => 'ḩ', + 'Ḫ' => 'ḫ', + 'Ḭ' => 'ḭ', + 'Ḯ' => 'ḯ', + 'Ḱ' => 'ḱ', + 'Ḳ' => 'ḳ', + 'Ḵ' => 'ḵ', + 'Ḷ' => 'ḷ', + 'Ḹ' => 'ḹ', + 'Ḻ' => 'ḻ', + 'Ḽ' => 'ḽ', + 'Ḿ' => 'ḿ', + 'Ṁ' => 'ṁ', + 'Ṃ' => 'ṃ', + 'Ṅ' => 'ṅ', + 'Ṇ' => 'ṇ', + 'Ṉ' => 'ṉ', + 'Ṋ' => 'ṋ', + 'Ṍ' => 'ṍ', + 'Ṏ' => 'ṏ', + 'Ṑ' => 'ṑ', + 'Ṓ' => 'ṓ', + 'Ṕ' => 'ṕ', + 'Ṗ' => 'ṗ', + 'Ṙ' => 'ṙ', + 'Ṛ' => 'ṛ', + 'Ṝ' => 'ṝ', + 'Ṟ' => 'ṟ', + 'Ṡ' => 'ṡ', + 'Ṣ' => 'ṣ', + 'Ṥ' => 'ṥ', + 'Ṧ' => 'ṧ', + 'Ṩ' => 'ṩ', + 'Ṫ' => 'ṫ', + 'Ṭ' => 'ṭ', + 'Ṯ' => 'ṯ', + 'Ṱ' => 'ṱ', + 'Ṳ' => 'ṳ', + 'Ṵ' => 'ṵ', + 'Ṷ' => 'ṷ', + 'Ṹ' => 'ṹ', + 'Ṻ' => 'ṻ', + 'Ṽ' => 'ṽ', + 'Ṿ' => 'ṿ', + 'Ẁ' => 'ẁ', + 'Ẃ' => 'ẃ', + 'Ẅ' => 'ẅ', + 'Ẇ' => 'ẇ', + 'Ẉ' => 'ẉ', + 'Ẋ' => 'ẋ', + 'Ẍ' => 'ẍ', + 'Ẏ' => 'ẏ', + 'Ẑ' => 'ẑ', + 'Ẓ' => 'ẓ', + 'Ẕ' => 'ẕ', + 'ẞ' => 'ß', + 'Ạ' => 'ạ', + 'Ả' => 'ả', + 'Ấ' => 'ấ', + 'Ầ' => 'ầ', + 'Ẩ' => 'ẩ', + 'Ẫ' => 'ẫ', + 'Ậ' => 'ậ', + 'Ắ' => 'ắ', + 'Ằ' => 'ằ', + 'Ẳ' => 'ẳ', + 'Ẵ' => 'ẵ', + 'Ặ' => 'ặ', + 'Ẹ' => 'ẹ', + 'Ẻ' => 'ẻ', + 'Ẽ' => 'ẽ', + 'Ế' => 'ế', + 'Ề' => 'ề', + 'Ể' => 'ể', + 'Ễ' => 'ễ', + 'Ệ' => 'ệ', + 'Ỉ' => 'ỉ', + 'Ị' => 'ị', + 'Ọ' => 'ọ', + 'Ỏ' => 'ỏ', + 'Ố' => 'ố', + 'Ồ' => 'ồ', + 'Ổ' => 'ổ', + 'Ỗ' => 'ỗ', + 'Ộ' => 'ộ', + 'Ớ' => 'ớ', + 'Ờ' => 'ờ', + 'Ở' => 'ở', + 'Ỡ' => 'ỡ', + 'Ợ' => 'ợ', + 'Ụ' => 'ụ', + 'Ủ' => 'ủ', + 'Ứ' => 'ứ', + 'Ừ' => 'ừ', + 'Ử' => 'ử', + 'Ữ' => 'ữ', + 'Ự' => 'ự', + 'Ỳ' => 'ỳ', + 'Ỵ' => 'ỵ', + 'Ỷ' => 'ỷ', + 'Ỹ' => 'ỹ', + 'Ỻ' => 'ỻ', + 'Ỽ' => 'ỽ', + 'Ỿ' => 'ỿ', + 'Ἀ' => 'ἀ', + 'Ἁ' => 'ἁ', + 'Ἂ' => 'ἂ', + 'Ἃ' => 'ἃ', + 'Ἄ' => 'ἄ', + 'Ἅ' => 'ἅ', + 'Ἆ' => 'ἆ', + 'Ἇ' => 'ἇ', + 'Ἐ' => 'ἐ', + 'Ἑ' => 'ἑ', + 'Ἒ' => 'ἒ', + 'Ἓ' => 'ἓ', + 'Ἔ' => 'ἔ', + 'Ἕ' => 'ἕ', + 'Ἠ' => 'ἠ', + 'Ἡ' => 'ἡ', + 'Ἢ' => 'ἢ', + 'Ἣ' => 'ἣ', + 'Ἤ' => 'ἤ', + 'Ἥ' => 'ἥ', + 'Ἦ' => 'ἦ', + 'Ἧ' => 'ἧ', + 'Ἰ' => 'ἰ', + 'Ἱ' => 'ἱ', + 'Ἲ' => 'ἲ', + 'Ἳ' => 'ἳ', + 'Ἴ' => 'ἴ', + 'Ἵ' => 'ἵ', + 'Ἶ' => 'ἶ', + 'Ἷ' => 'ἷ', + 'Ὀ' => 'ὀ', + 'Ὁ' => 'ὁ', + 'Ὂ' => 'ὂ', + 'Ὃ' => 'ὃ', + 'Ὄ' => 'ὄ', + 'Ὅ' => 'ὅ', + 'Ὑ' => 'ὑ', + 'Ὓ' => 'ὓ', + 'Ὕ' => 'ὕ', + 'Ὗ' => 'ὗ', + 'Ὠ' => 'ὠ', + 'Ὡ' => 'ὡ', + 'Ὢ' => 'ὢ', + 'Ὣ' => 'ὣ', + 'Ὤ' => 'ὤ', + 'Ὥ' => 'ὥ', + 'Ὦ' => 'ὦ', + 'Ὧ' => 'ὧ', + 'ᾈ' => 'ᾀ', + 'ᾉ' => 'ᾁ', + 'ᾊ' => 'ᾂ', + 'ᾋ' => 'ᾃ', + 'ᾌ' => 'ᾄ', + 'ᾍ' => 'ᾅ', + 'ᾎ' => 'ᾆ', + 'ᾏ' => 'ᾇ', + 'ᾘ' => 'ᾐ', + 'ᾙ' => 'ᾑ', + 'ᾚ' => 'ᾒ', + 'ᾛ' => 'ᾓ', + 'ᾜ' => 'ᾔ', + 'ᾝ' => 'ᾕ', + 'ᾞ' => 'ᾖ', + 'ᾟ' => 'ᾗ', + 'ᾨ' => 'ᾠ', + 'ᾩ' => 'ᾡ', + 'ᾪ' => 'ᾢ', + 'ᾫ' => 'ᾣ', + 'ᾬ' => 'ᾤ', + 'ᾭ' => 'ᾥ', + 'ᾮ' => 'ᾦ', + 'ᾯ' => 'ᾧ', + 'Ᾰ' => 'ᾰ', + 'Ᾱ' => 'ᾱ', + 'Ὰ' => 'ὰ', + 'Ά' => 'ά', + 'ᾼ' => 'ᾳ', + 'Ὲ' => 'ὲ', + 'Έ' => 'έ', + 'Ὴ' => 'ὴ', + 'Ή' => 'ή', + 'ῌ' => 'ῃ', + 'Ῐ' => 'ῐ', + 'Ῑ' => 'ῑ', + 'Ὶ' => 'ὶ', + 'Ί' => 'ί', + 'Ῠ' => 'ῠ', + 'Ῡ' => 'ῡ', + 'Ὺ' => 'ὺ', + 'Ύ' => 'ύ', + 'Ῥ' => 'ῥ', + 'Ὸ' => 'ὸ', + 'Ό' => 'ό', + 'Ὼ' => 'ὼ', + 'Ώ' => 'ώ', + 'ῼ' => 'ῳ', + 'Ω' => 'ω', + 'K' => 'k', + 'Å' => 'å', + 'Ⅎ' => 'ⅎ', + 'Ⅰ' => 'ⅰ', + 'Ⅱ' => 'ⅱ', + 'Ⅲ' => 'ⅲ', + 'Ⅳ' => 'ⅳ', + 'Ⅴ' => 'ⅴ', + 'Ⅵ' => 'ⅵ', + 'Ⅶ' => 'ⅶ', + 'Ⅷ' => 'ⅷ', + 'Ⅸ' => 'ⅸ', + 'Ⅹ' => 'ⅹ', + 'Ⅺ' => 'ⅺ', + 'Ⅻ' => 'ⅻ', + 'Ⅼ' => 'ⅼ', + 'Ⅽ' => 'ⅽ', + 'Ⅾ' => 'ⅾ', + 'Ⅿ' => 'ⅿ', + 'Ↄ' => 'ↄ', + 'Ⓐ' => 'ⓐ', + 'Ⓑ' => 'ⓑ', + 'Ⓒ' => 'ⓒ', + 'Ⓓ' => 'ⓓ', + 'Ⓔ' => 'ⓔ', + 'Ⓕ' => 'ⓕ', + 'Ⓖ' => 'ⓖ', + 'Ⓗ' => 'ⓗ', + 'Ⓘ' => 'ⓘ', + 'Ⓙ' => 'ⓙ', + 'Ⓚ' => 'ⓚ', + 'Ⓛ' => 'ⓛ', + 'Ⓜ' => 'ⓜ', + 'Ⓝ' => 'ⓝ', + 'Ⓞ' => 'ⓞ', + 'Ⓟ' => 'ⓟ', + 'Ⓠ' => 'ⓠ', + 'Ⓡ' => 'ⓡ', + 'Ⓢ' => 'ⓢ', + 'Ⓣ' => 'ⓣ', + 'Ⓤ' => 'ⓤ', + 'Ⓥ' => 'ⓥ', + 'Ⓦ' => 'ⓦ', + 'Ⓧ' => 'ⓧ', + 'Ⓨ' => 'ⓨ', + 'Ⓩ' => 'ⓩ', + 'Ⰰ' => 'ⰰ', + 'Ⰱ' => 'ⰱ', + 'Ⰲ' => 'ⰲ', + 'Ⰳ' => 'ⰳ', + 'Ⰴ' => 'ⰴ', + 'Ⰵ' => 'ⰵ', + 'Ⰶ' => 'ⰶ', + 'Ⰷ' => 'ⰷ', + 'Ⰸ' => 'ⰸ', + 'Ⰹ' => 'ⰹ', + 'Ⰺ' => 'ⰺ', + 'Ⰻ' => 'ⰻ', + 'Ⰼ' => 'ⰼ', + 'Ⰽ' => 'ⰽ', + 'Ⰾ' => 'ⰾ', + 'Ⰿ' => 'ⰿ', + 'Ⱀ' => 'ⱀ', + 'Ⱁ' => 'ⱁ', + 'Ⱂ' => 'ⱂ', + 'Ⱃ' => 'ⱃ', + 'Ⱄ' => 'ⱄ', + 'Ⱅ' => 'ⱅ', + 'Ⱆ' => 'ⱆ', + 'Ⱇ' => 'ⱇ', + 'Ⱈ' => 'ⱈ', + 'Ⱉ' => 'ⱉ', + 'Ⱊ' => 'ⱊ', + 'Ⱋ' => 'ⱋ', + 'Ⱌ' => 'ⱌ', + 'Ⱍ' => 'ⱍ', + 'Ⱎ' => 'ⱎ', + 'Ⱏ' => 'ⱏ', + 'Ⱐ' => 'ⱐ', + 'Ⱑ' => 'ⱑ', + 'Ⱒ' => 'ⱒ', + 'Ⱓ' => 'ⱓ', + 'Ⱔ' => 'ⱔ', + 'Ⱕ' => 'ⱕ', + 'Ⱖ' => 'ⱖ', + 'Ⱗ' => 'ⱗ', + 'Ⱘ' => 'ⱘ', + 'Ⱙ' => 'ⱙ', + 'Ⱚ' => 'ⱚ', + 'Ⱛ' => 'ⱛ', + 'Ⱜ' => 'ⱜ', + 'Ⱝ' => 'ⱝ', + 'Ⱞ' => 'ⱞ', + 'Ⱡ' => 'ⱡ', + 'Ɫ' => 'ɫ', + 'Ᵽ' => 'ᵽ', + 'Ɽ' => 'ɽ', + 'Ⱨ' => 'ⱨ', + 'Ⱪ' => 'ⱪ', + 'Ⱬ' => 'ⱬ', + 'Ɑ' => 'ɑ', + 'Ɱ' => 'ɱ', + 'Ɐ' => 'ɐ', + 'Ɒ' => 'ɒ', + 'Ⱳ' => 'ⱳ', + 'Ⱶ' => 'ⱶ', + 'Ȿ' => 'ȿ', + 'Ɀ' => 'ɀ', + 'Ⲁ' => 'ⲁ', + 'Ⲃ' => 'ⲃ', + 'Ⲅ' => 'ⲅ', + 'Ⲇ' => 'ⲇ', + 'Ⲉ' => 'ⲉ', + 'Ⲋ' => 'ⲋ', + 'Ⲍ' => 'ⲍ', + 'Ⲏ' => 'ⲏ', + 'Ⲑ' => 'ⲑ', + 'Ⲓ' => 'ⲓ', + 'Ⲕ' => 'ⲕ', + 'Ⲗ' => 'ⲗ', + 'Ⲙ' => 'ⲙ', + 'Ⲛ' => 'ⲛ', + 'Ⲝ' => 'ⲝ', + 'Ⲟ' => 'ⲟ', + 'Ⲡ' => 'ⲡ', + 'Ⲣ' => 'ⲣ', + 'Ⲥ' => 'ⲥ', + 'Ⲧ' => 'ⲧ', + 'Ⲩ' => 'ⲩ', + 'Ⲫ' => 'ⲫ', + 'Ⲭ' => 'ⲭ', + 'Ⲯ' => 'ⲯ', + 'Ⲱ' => 'ⲱ', + 'Ⲳ' => 'ⲳ', + 'Ⲵ' => 'ⲵ', + 'Ⲷ' => 'ⲷ', + 'Ⲹ' => 'ⲹ', + 'Ⲻ' => 'ⲻ', + 'Ⲽ' => 'ⲽ', + 'Ⲿ' => 'ⲿ', + 'Ⳁ' => 'ⳁ', + 'Ⳃ' => 'ⳃ', + 'Ⳅ' => 'ⳅ', + 'Ⳇ' => 'ⳇ', + 'Ⳉ' => 'ⳉ', + 'Ⳋ' => 'ⳋ', + 'Ⳍ' => 'ⳍ', + 'Ⳏ' => 'ⳏ', + 'Ⳑ' => 'ⳑ', + 'Ⳓ' => 'ⳓ', + 'Ⳕ' => 'ⳕ', + 'Ⳗ' => 'ⳗ', + 'Ⳙ' => 'ⳙ', + 'Ⳛ' => 'ⳛ', + 'Ⳝ' => 'ⳝ', + 'Ⳟ' => 'ⳟ', + 'Ⳡ' => 'ⳡ', + 'Ⳣ' => 'ⳣ', + 'Ⳬ' => 'ⳬ', + 'Ⳮ' => 'ⳮ', + 'Ⳳ' => 'ⳳ', + 'Ꙁ' => 'ꙁ', + 'Ꙃ' => 'ꙃ', + 'Ꙅ' => 'ꙅ', + 'Ꙇ' => 'ꙇ', + 'Ꙉ' => 'ꙉ', + 'Ꙋ' => 'ꙋ', + 'Ꙍ' => 'ꙍ', + 'Ꙏ' => 'ꙏ', + 'Ꙑ' => 'ꙑ', + 'Ꙓ' => 'ꙓ', + 'Ꙕ' => 'ꙕ', + 'Ꙗ' => 'ꙗ', + 'Ꙙ' => 'ꙙ', + 'Ꙛ' => 'ꙛ', + 'Ꙝ' => 'ꙝ', + 'Ꙟ' => 'ꙟ', + 'Ꙡ' => 'ꙡ', + 'Ꙣ' => 'ꙣ', + 'Ꙥ' => 'ꙥ', + 'Ꙧ' => 'ꙧ', + 'Ꙩ' => 'ꙩ', + 'Ꙫ' => 'ꙫ', + 'Ꙭ' => 'ꙭ', + 'Ꚁ' => 'ꚁ', + 'Ꚃ' => 'ꚃ', + 'Ꚅ' => 'ꚅ', + 'Ꚇ' => 'ꚇ', + 'Ꚉ' => 'ꚉ', + 'Ꚋ' => 'ꚋ', + 'Ꚍ' => 'ꚍ', + 'Ꚏ' => 'ꚏ', + 'Ꚑ' => 'ꚑ', + 'Ꚓ' => 'ꚓ', + 'Ꚕ' => 'ꚕ', + 'Ꚗ' => 'ꚗ', + 'Ꚙ' => 'ꚙ', + 'Ꚛ' => 'ꚛ', + 'Ꜣ' => 'ꜣ', + 'Ꜥ' => 'ꜥ', + 'Ꜧ' => 'ꜧ', + 'Ꜩ' => 'ꜩ', + 'Ꜫ' => 'ꜫ', + 'Ꜭ' => 'ꜭ', + 'Ꜯ' => 'ꜯ', + 'Ꜳ' => 'ꜳ', + 'Ꜵ' => 'ꜵ', + 'Ꜷ' => 'ꜷ', + 'Ꜹ' => 'ꜹ', + 'Ꜻ' => 'ꜻ', + 'Ꜽ' => 'ꜽ', + 'Ꜿ' => 'ꜿ', + 'Ꝁ' => 'ꝁ', + 'Ꝃ' => 'ꝃ', + 'Ꝅ' => 'ꝅ', + 'Ꝇ' => 'ꝇ', + 'Ꝉ' => 'ꝉ', + 'Ꝋ' => 'ꝋ', + 'Ꝍ' => 'ꝍ', + 'Ꝏ' => 'ꝏ', + 'Ꝑ' => 'ꝑ', + 'Ꝓ' => 'ꝓ', + 'Ꝕ' => 'ꝕ', + 'Ꝗ' => 'ꝗ', + 'Ꝙ' => 'ꝙ', + 'Ꝛ' => 'ꝛ', + 'Ꝝ' => 'ꝝ', + 'Ꝟ' => 'ꝟ', + 'Ꝡ' => 'ꝡ', + 'Ꝣ' => 'ꝣ', + 'Ꝥ' => 'ꝥ', + 'Ꝧ' => 'ꝧ', + 'Ꝩ' => 'ꝩ', + 'Ꝫ' => 'ꝫ', + 'Ꝭ' => 'ꝭ', + 'Ꝯ' => 'ꝯ', + 'Ꝺ' => 'ꝺ', + 'Ꝼ' => 'ꝼ', + 'Ᵹ' => 'ᵹ', + 'Ꝿ' => 'ꝿ', + 'Ꞁ' => 'ꞁ', + 'Ꞃ' => 'ꞃ', + 'Ꞅ' => 'ꞅ', + 'Ꞇ' => 'ꞇ', + 'Ꞌ' => 'ꞌ', + 'Ɥ' => 'ɥ', + 'Ꞑ' => 'ꞑ', + 'Ꞓ' => 'ꞓ', + 'Ꞗ' => 'ꞗ', + 'Ꞙ' => 'ꞙ', + 'Ꞛ' => 'ꞛ', + 'Ꞝ' => 'ꞝ', + 'Ꞟ' => 'ꞟ', + 'Ꞡ' => 'ꞡ', + 'Ꞣ' => 'ꞣ', + 'Ꞥ' => 'ꞥ', + 'Ꞧ' => 'ꞧ', + 'Ꞩ' => 'ꞩ', + 'Ɦ' => 'ɦ', + 'Ɜ' => 'ɜ', + 'Ɡ' => 'ɡ', + 'Ɬ' => 'ɬ', + 'Ɪ' => 'ɪ', + 'Ʞ' => 'ʞ', + 'Ʇ' => 'ʇ', + 'Ʝ' => 'ʝ', + 'Ꭓ' => 'ꭓ', + 'Ꞵ' => 'ꞵ', + 'Ꞷ' => 'ꞷ', + 'Ꞹ' => 'ꞹ', + 'Ꞻ' => 'ꞻ', + 'Ꞽ' => 'ꞽ', + 'Ꞿ' => 'ꞿ', + 'Ꟃ' => 'ꟃ', + 'Ꞔ' => 'ꞔ', + 'Ʂ' => 'ʂ', + 'Ᶎ' => 'ᶎ', + 'Ꟈ' => 'ꟈ', + 'Ꟊ' => 'ꟊ', + 'Ꟶ' => 'ꟶ', + 'A' => 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + '𐐀' => '𐐨', + '𐐁' => '𐐩', + '𐐂' => '𐐪', + '𐐃' => '𐐫', + '𐐄' => '𐐬', + '𐐅' => '𐐭', + '𐐆' => '𐐮', + '𐐇' => '𐐯', + '𐐈' => '𐐰', + '𐐉' => '𐐱', + '𐐊' => '𐐲', + '𐐋' => '𐐳', + '𐐌' => '𐐴', + '𐐍' => '𐐵', + '𐐎' => '𐐶', + '𐐏' => '𐐷', + '𐐐' => '𐐸', + '𐐑' => '𐐹', + '𐐒' => '𐐺', + '𐐓' => '𐐻', + '𐐔' => '𐐼', + '𐐕' => '𐐽', + '𐐖' => '𐐾', + '𐐗' => '𐐿', + '𐐘' => '𐑀', + '𐐙' => '𐑁', + '𐐚' => '𐑂', + '𐐛' => '𐑃', + '𐐜' => '𐑄', + '𐐝' => '𐑅', + '𐐞' => '𐑆', + '𐐟' => '𐑇', + '𐐠' => '𐑈', + '𐐡' => '𐑉', + '𐐢' => '𐑊', + '𐐣' => '𐑋', + '𐐤' => '𐑌', + '𐐥' => '𐑍', + '𐐦' => '𐑎', + '𐐧' => '𐑏', + '𐒰' => '𐓘', + '𐒱' => '𐓙', + '𐒲' => '𐓚', + '𐒳' => '𐓛', + '𐒴' => '𐓜', + '𐒵' => '𐓝', + '𐒶' => '𐓞', + '𐒷' => '𐓟', + '𐒸' => '𐓠', + '𐒹' => '𐓡', + '𐒺' => '𐓢', + '𐒻' => '𐓣', + '𐒼' => '𐓤', + '𐒽' => '𐓥', + '𐒾' => '𐓦', + '𐒿' => '𐓧', + '𐓀' => '𐓨', + '𐓁' => '𐓩', + '𐓂' => '𐓪', + '𐓃' => '𐓫', + '𐓄' => '𐓬', + '𐓅' => '𐓭', + '𐓆' => '𐓮', + '𐓇' => '𐓯', + '𐓈' => '𐓰', + '𐓉' => '𐓱', + '𐓊' => '𐓲', + '𐓋' => '𐓳', + '𐓌' => '𐓴', + '𐓍' => '𐓵', + '𐓎' => '𐓶', + '𐓏' => '𐓷', + '𐓐' => '𐓸', + '𐓑' => '𐓹', + '𐓒' => '𐓺', + '𐓓' => '𐓻', + '𐲀' => '𐳀', + '𐲁' => '𐳁', + '𐲂' => '𐳂', + '𐲃' => '𐳃', + '𐲄' => '𐳄', + '𐲅' => '𐳅', + '𐲆' => '𐳆', + '𐲇' => '𐳇', + '𐲈' => '𐳈', + '𐲉' => '𐳉', + '𐲊' => '𐳊', + '𐲋' => '𐳋', + '𐲌' => '𐳌', + '𐲍' => '𐳍', + '𐲎' => '𐳎', + '𐲏' => '𐳏', + '𐲐' => '𐳐', + '𐲑' => '𐳑', + '𐲒' => '𐳒', + '𐲓' => '𐳓', + '𐲔' => '𐳔', + '𐲕' => '𐳕', + '𐲖' => '𐳖', + '𐲗' => '𐳗', + '𐲘' => '𐳘', + '𐲙' => '𐳙', + '𐲚' => '𐳚', + '𐲛' => '𐳛', + '𐲜' => '𐳜', + '𐲝' => '𐳝', + '𐲞' => '𐳞', + '𐲟' => '𐳟', + '𐲠' => '𐳠', + '𐲡' => '𐳡', + '𐲢' => '𐳢', + '𐲣' => '𐳣', + '𐲤' => '𐳤', + '𐲥' => '𐳥', + '𐲦' => '𐳦', + '𐲧' => '𐳧', + '𐲨' => '𐳨', + '𐲩' => '𐳩', + '𐲪' => '𐳪', + '𐲫' => '𐳫', + '𐲬' => '𐳬', + '𐲭' => '𐳭', + '𐲮' => '𐳮', + '𐲯' => '𐳯', + '𐲰' => '𐳰', + '𐲱' => '𐳱', + '𐲲' => '𐳲', + '𑢠' => '𑣀', + '𑢡' => '𑣁', + '𑢢' => '𑣂', + '𑢣' => '𑣃', + '𑢤' => '𑣄', + '𑢥' => '𑣅', + '𑢦' => '𑣆', + '𑢧' => '𑣇', + '𑢨' => '𑣈', + '𑢩' => '𑣉', + '𑢪' => '𑣊', + '𑢫' => '𑣋', + '𑢬' => '𑣌', + '𑢭' => '𑣍', + '𑢮' => '𑣎', + '𑢯' => '𑣏', + '𑢰' => '𑣐', + '𑢱' => '𑣑', + '𑢲' => '𑣒', + '𑢳' => '𑣓', + '𑢴' => '𑣔', + '𑢵' => '𑣕', + '𑢶' => '𑣖', + '𑢷' => '𑣗', + '𑢸' => '𑣘', + '𑢹' => '𑣙', + '𑢺' => '𑣚', + '𑢻' => '𑣛', + '𑢼' => '𑣜', + '𑢽' => '𑣝', + '𑢾' => '𑣞', + '𑢿' => '𑣟', + '𖹀' => '𖹠', + '𖹁' => '𖹡', + '𖹂' => '𖹢', + '𖹃' => '𖹣', + '𖹄' => '𖹤', + '𖹅' => '𖹥', + '𖹆' => '𖹦', + '𖹇' => '𖹧', + '𖹈' => '𖹨', + '𖹉' => '𖹩', + '𖹊' => '𖹪', + '𖹋' => '𖹫', + '𖹌' => '𖹬', + '𖹍' => '𖹭', + '𖹎' => '𖹮', + '𖹏' => '𖹯', + '𖹐' => '𖹰', + '𖹑' => '𖹱', + '𖹒' => '𖹲', + '𖹓' => '𖹳', + '𖹔' => '𖹴', + '𖹕' => '𖹵', + '𖹖' => '𖹶', + '𖹗' => '𖹷', + '𖹘' => '𖹸', + '𖹙' => '𖹹', + '𖹚' => '𖹺', + '𖹛' => '𖹻', + '𖹜' => '𖹼', + '𖹝' => '𖹽', + '𖹞' => '𖹾', + '𖹟' => '𖹿', + '𞤀' => '𞤢', + '𞤁' => '𞤣', + '𞤂' => '𞤤', + '𞤃' => '𞤥', + '𞤄' => '𞤦', + '𞤅' => '𞤧', + '𞤆' => '𞤨', + '𞤇' => '𞤩', + '𞤈' => '𞤪', + '𞤉' => '𞤫', + '𞤊' => '𞤬', + '𞤋' => '𞤭', + '𞤌' => '𞤮', + '𞤍' => '𞤯', + '𞤎' => '𞤰', + '𞤏' => '𞤱', + '𞤐' => '𞤲', + '𞤑' => '𞤳', + '𞤒' => '𞤴', + '𞤓' => '𞤵', + '𞤔' => '𞤶', + '𞤕' => '𞤷', + '𞤖' => '𞤸', + '𞤗' => '𞤹', + '𞤘' => '𞤺', + '𞤙' => '𞤻', + '𞤚' => '𞤼', + '𞤛' => '𞤽', + '𞤜' => '𞤾', + '𞤝' => '𞤿', + '𞤞' => '𞥀', + '𞤟' => '𞥁', + '𞤠' => '𞥂', + '𞤡' => '𞥃', +); diff --git a/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100644 index 00000000..2a8f6e73 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + 'µ' => 'Μ', + 'à' => 'À', + 'á' => 'Á', + 'â' => 'Â', + 'ã' => 'Ã', + 'ä' => 'Ä', + 'å' => 'Å', + 'æ' => 'Æ', + 'ç' => 'Ç', + 'è' => 'È', + 'é' => 'É', + 'ê' => 'Ê', + 'ë' => 'Ë', + 'ì' => 'Ì', + 'í' => 'Í', + 'î' => 'Î', + 'ï' => 'Ï', + 'ð' => 'Ð', + 'ñ' => 'Ñ', + 'ò' => 'Ò', + 'ó' => 'Ó', + 'ô' => 'Ô', + 'õ' => 'Õ', + 'ö' => 'Ö', + 'ø' => 'Ø', + 'ù' => 'Ù', + 'ú' => 'Ú', + 'û' => 'Û', + 'ü' => 'Ü', + 'ý' => 'Ý', + 'þ' => 'Þ', + 'ÿ' => 'Ÿ', + 'ā' => 'Ā', + 'ă' => 'Ă', + 'ą' => 'Ą', + 'ć' => 'Ć', + 'ĉ' => 'Ĉ', + 'ċ' => 'Ċ', + 'č' => 'Č', + 'ď' => 'Ď', + 'đ' => 'Đ', + 'ē' => 'Ē', + 'ĕ' => 'Ĕ', + 'ė' => 'Ė', + 'ę' => 'Ę', + 'ě' => 'Ě', + 'ĝ' => 'Ĝ', + 'ğ' => 'Ğ', + 'ġ' => 'Ġ', + 'ģ' => 'Ģ', + 'ĥ' => 'Ĥ', + 'ħ' => 'Ħ', + 'ĩ' => 'Ĩ', + 'ī' => 'Ī', + 'ĭ' => 'Ĭ', + 'į' => 'Į', + 'ı' => 'I', + 'ij' => 'IJ', + 'ĵ' => 'Ĵ', + 'ķ' => 'Ķ', + 'ĺ' => 'Ĺ', + 'ļ' => 'Ļ', + 'ľ' => 'Ľ', + 'ŀ' => 'Ŀ', + 'ł' => 'Ł', + 'ń' => 'Ń', + 'ņ' => 'Ņ', + 'ň' => 'Ň', + 'ŋ' => 'Ŋ', + 'ō' => 'Ō', + 'ŏ' => 'Ŏ', + 'ő' => 'Ő', + 'œ' => 'Œ', + 'ŕ' => 'Ŕ', + 'ŗ' => 'Ŗ', + 'ř' => 'Ř', + 'ś' => 'Ś', + 'ŝ' => 'Ŝ', + 'ş' => 'Ş', + 'š' => 'Š', + 'ţ' => 'Ţ', + 'ť' => 'Ť', + 'ŧ' => 'Ŧ', + 'ũ' => 'Ũ', + 'ū' => 'Ū', + 'ŭ' => 'Ŭ', + 'ů' => 'Ů', + 'ű' => 'Ű', + 'ų' => 'Ų', + 'ŵ' => 'Ŵ', + 'ŷ' => 'Ŷ', + 'ź' => 'Ź', + 'ż' => 'Ż', + 'ž' => 'Ž', + 'ſ' => 'S', + 'ƀ' => 'Ƀ', + 'ƃ' => 'Ƃ', + 'ƅ' => 'Ƅ', + 'ƈ' => 'Ƈ', + 'ƌ' => 'Ƌ', + 'ƒ' => 'Ƒ', + 'ƕ' => 'Ƕ', + 'ƙ' => 'Ƙ', + 'ƚ' => 'Ƚ', + 'ƞ' => 'Ƞ', + 'ơ' => 'Ơ', + 'ƣ' => 'Ƣ', + 'ƥ' => 'Ƥ', + 'ƨ' => 'Ƨ', + 'ƭ' => 'Ƭ', + 'ư' => 'Ư', + 'ƴ' => 'Ƴ', + 'ƶ' => 'Ƶ', + 'ƹ' => 'Ƹ', + 'ƽ' => 'Ƽ', + 'ƿ' => 'Ƿ', + 'Dž' => 'DŽ', + 'dž' => 'DŽ', + 'Lj' => 'LJ', + 'lj' => 'LJ', + 'Nj' => 'NJ', + 'nj' => 'NJ', + 'ǎ' => 'Ǎ', + 'ǐ' => 'Ǐ', + 'ǒ' => 'Ǒ', + 'ǔ' => 'Ǔ', + 'ǖ' => 'Ǖ', + 'ǘ' => 'Ǘ', + 'ǚ' => 'Ǚ', + 'ǜ' => 'Ǜ', + 'ǝ' => 'Ǝ', + 'ǟ' => 'Ǟ', + 'ǡ' => 'Ǡ', + 'ǣ' => 'Ǣ', + 'ǥ' => 'Ǥ', + 'ǧ' => 'Ǧ', + 'ǩ' => 'Ǩ', + 'ǫ' => 'Ǫ', + 'ǭ' => 'Ǭ', + 'ǯ' => 'Ǯ', + 'Dz' => 'DZ', + 'dz' => 'DZ', + 'ǵ' => 'Ǵ', + 'ǹ' => 'Ǹ', + 'ǻ' => 'Ǻ', + 'ǽ' => 'Ǽ', + 'ǿ' => 'Ǿ', + 'ȁ' => 'Ȁ', + 'ȃ' => 'Ȃ', + 'ȅ' => 'Ȅ', + 'ȇ' => 'Ȇ', + 'ȉ' => 'Ȉ', + 'ȋ' => 'Ȋ', + 'ȍ' => 'Ȍ', + 'ȏ' => 'Ȏ', + 'ȑ' => 'Ȑ', + 'ȓ' => 'Ȓ', + 'ȕ' => 'Ȕ', + 'ȗ' => 'Ȗ', + 'ș' => 'Ș', + 'ț' => 'Ț', + 'ȝ' => 'Ȝ', + 'ȟ' => 'Ȟ', + 'ȣ' => 'Ȣ', + 'ȥ' => 'Ȥ', + 'ȧ' => 'Ȧ', + 'ȩ' => 'Ȩ', + 'ȫ' => 'Ȫ', + 'ȭ' => 'Ȭ', + 'ȯ' => 'Ȯ', + 'ȱ' => 'Ȱ', + 'ȳ' => 'Ȳ', + 'ȼ' => 'Ȼ', + 'ȿ' => 'Ȿ', + 'ɀ' => 'Ɀ', + 'ɂ' => 'Ɂ', + 'ɇ' => 'Ɇ', + 'ɉ' => 'Ɉ', + 'ɋ' => 'Ɋ', + 'ɍ' => 'Ɍ', + 'ɏ' => 'Ɏ', + 'ɐ' => 'Ɐ', + 'ɑ' => 'Ɑ', + 'ɒ' => 'Ɒ', + 'ɓ' => 'Ɓ', + 'ɔ' => 'Ɔ', + 'ɖ' => 'Ɖ', + 'ɗ' => 'Ɗ', + 'ə' => 'Ə', + 'ɛ' => 'Ɛ', + 'ɜ' => 'Ɜ', + 'ɠ' => 'Ɠ', + 'ɡ' => 'Ɡ', + 'ɣ' => 'Ɣ', + 'ɥ' => 'Ɥ', + 'ɦ' => 'Ɦ', + 'ɨ' => 'Ɨ', + 'ɩ' => 'Ɩ', + 'ɪ' => 'Ɪ', + 'ɫ' => 'Ɫ', + 'ɬ' => 'Ɬ', + 'ɯ' => 'Ɯ', + 'ɱ' => 'Ɱ', + 'ɲ' => 'Ɲ', + 'ɵ' => 'Ɵ', + 'ɽ' => 'Ɽ', + 'ʀ' => 'Ʀ', + 'ʂ' => 'Ʂ', + 'ʃ' => 'Ʃ', + 'ʇ' => 'Ʇ', + 'ʈ' => 'Ʈ', + 'ʉ' => 'Ʉ', + 'ʊ' => 'Ʊ', + 'ʋ' => 'Ʋ', + 'ʌ' => 'Ʌ', + 'ʒ' => 'Ʒ', + 'ʝ' => 'Ʝ', + 'ʞ' => 'Ʞ', + 'ͅ' => 'Ι', + 'ͱ' => 'Ͱ', + 'ͳ' => 'Ͳ', + 'ͷ' => 'Ͷ', + 'ͻ' => 'Ͻ', + 'ͼ' => 'Ͼ', + 'ͽ' => 'Ͽ', + 'ά' => 'Ά', + 'έ' => 'Έ', + 'ή' => 'Ή', + 'ί' => 'Ί', + 'α' => 'Α', + 'β' => 'Β', + 'γ' => 'Γ', + 'δ' => 'Δ', + 'ε' => 'Ε', + 'ζ' => 'Ζ', + 'η' => 'Η', + 'θ' => 'Θ', + 'ι' => 'Ι', + 'κ' => 'Κ', + 'λ' => 'Λ', + 'μ' => 'Μ', + 'ν' => 'Ν', + 'ξ' => 'Ξ', + 'ο' => 'Ο', + 'π' => 'Π', + 'ρ' => 'Ρ', + 'ς' => 'Σ', + 'σ' => 'Σ', + 'τ' => 'Τ', + 'υ' => 'Υ', + 'φ' => 'Φ', + 'χ' => 'Χ', + 'ψ' => 'Ψ', + 'ω' => 'Ω', + 'ϊ' => 'Ϊ', + 'ϋ' => 'Ϋ', + 'ό' => 'Ό', + 'ύ' => 'Ύ', + 'ώ' => 'Ώ', + 'ϐ' => 'Β', + 'ϑ' => 'Θ', + 'ϕ' => 'Φ', + 'ϖ' => 'Π', + 'ϗ' => 'Ϗ', + 'ϙ' => 'Ϙ', + 'ϛ' => 'Ϛ', + 'ϝ' => 'Ϝ', + 'ϟ' => 'Ϟ', + 'ϡ' => 'Ϡ', + 'ϣ' => 'Ϣ', + 'ϥ' => 'Ϥ', + 'ϧ' => 'Ϧ', + 'ϩ' => 'Ϩ', + 'ϫ' => 'Ϫ', + 'ϭ' => 'Ϭ', + 'ϯ' => 'Ϯ', + 'ϰ' => 'Κ', + 'ϱ' => 'Ρ', + 'ϲ' => 'Ϲ', + 'ϳ' => 'Ϳ', + 'ϵ' => 'Ε', + 'ϸ' => 'Ϸ', + 'ϻ' => 'Ϻ', + 'а' => 'А', + 'б' => 'Б', + 'в' => 'В', + 'г' => 'Г', + 'д' => 'Д', + 'е' => 'Е', + 'ж' => 'Ж', + 'з' => 'З', + 'и' => 'И', + 'й' => 'Й', + 'к' => 'К', + 'л' => 'Л', + 'м' => 'М', + 'н' => 'Н', + 'о' => 'О', + 'п' => 'П', + 'р' => 'Р', + 'с' => 'С', + 'т' => 'Т', + 'у' => 'У', + 'ф' => 'Ф', + 'х' => 'Х', + 'ц' => 'Ц', + 'ч' => 'Ч', + 'ш' => 'Ш', + 'щ' => 'Щ', + 'ъ' => 'Ъ', + 'ы' => 'Ы', + 'ь' => 'Ь', + 'э' => 'Э', + 'ю' => 'Ю', + 'я' => 'Я', + 'ѐ' => 'Ѐ', + 'ё' => 'Ё', + 'ђ' => 'Ђ', + 'ѓ' => 'Ѓ', + 'є' => 'Є', + 'ѕ' => 'Ѕ', + 'і' => 'І', + 'ї' => 'Ї', + 'ј' => 'Ј', + 'љ' => 'Љ', + 'њ' => 'Њ', + 'ћ' => 'Ћ', + 'ќ' => 'Ќ', + 'ѝ' => 'Ѝ', + 'ў' => 'Ў', + 'џ' => 'Џ', + 'ѡ' => 'Ѡ', + 'ѣ' => 'Ѣ', + 'ѥ' => 'Ѥ', + 'ѧ' => 'Ѧ', + 'ѩ' => 'Ѩ', + 'ѫ' => 'Ѫ', + 'ѭ' => 'Ѭ', + 'ѯ' => 'Ѯ', + 'ѱ' => 'Ѱ', + 'ѳ' => 'Ѳ', + 'ѵ' => 'Ѵ', + 'ѷ' => 'Ѷ', + 'ѹ' => 'Ѹ', + 'ѻ' => 'Ѻ', + 'ѽ' => 'Ѽ', + 'ѿ' => 'Ѿ', + 'ҁ' => 'Ҁ', + 'ҋ' => 'Ҋ', + 'ҍ' => 'Ҍ', + 'ҏ' => 'Ҏ', + 'ґ' => 'Ґ', + 'ғ' => 'Ғ', + 'ҕ' => 'Ҕ', + 'җ' => 'Җ', + 'ҙ' => 'Ҙ', + 'қ' => 'Қ', + 'ҝ' => 'Ҝ', + 'ҟ' => 'Ҟ', + 'ҡ' => 'Ҡ', + 'ң' => 'Ң', + 'ҥ' => 'Ҥ', + 'ҧ' => 'Ҧ', + 'ҩ' => 'Ҩ', + 'ҫ' => 'Ҫ', + 'ҭ' => 'Ҭ', + 'ү' => 'Ү', + 'ұ' => 'Ұ', + 'ҳ' => 'Ҳ', + 'ҵ' => 'Ҵ', + 'ҷ' => 'Ҷ', + 'ҹ' => 'Ҹ', + 'һ' => 'Һ', + 'ҽ' => 'Ҽ', + 'ҿ' => 'Ҿ', + 'ӂ' => 'Ӂ', + 'ӄ' => 'Ӄ', + 'ӆ' => 'Ӆ', + 'ӈ' => 'Ӈ', + 'ӊ' => 'Ӊ', + 'ӌ' => 'Ӌ', + 'ӎ' => 'Ӎ', + 'ӏ' => 'Ӏ', + 'ӑ' => 'Ӑ', + 'ӓ' => 'Ӓ', + 'ӕ' => 'Ӕ', + 'ӗ' => 'Ӗ', + 'ә' => 'Ә', + 'ӛ' => 'Ӛ', + 'ӝ' => 'Ӝ', + 'ӟ' => 'Ӟ', + 'ӡ' => 'Ӡ', + 'ӣ' => 'Ӣ', + 'ӥ' => 'Ӥ', + 'ӧ' => 'Ӧ', + 'ө' => 'Ө', + 'ӫ' => 'Ӫ', + 'ӭ' => 'Ӭ', + 'ӯ' => 'Ӯ', + 'ӱ' => 'Ӱ', + 'ӳ' => 'Ӳ', + 'ӵ' => 'Ӵ', + 'ӷ' => 'Ӷ', + 'ӹ' => 'Ӹ', + 'ӻ' => 'Ӻ', + 'ӽ' => 'Ӽ', + 'ӿ' => 'Ӿ', + 'ԁ' => 'Ԁ', + 'ԃ' => 'Ԃ', + 'ԅ' => 'Ԅ', + 'ԇ' => 'Ԇ', + 'ԉ' => 'Ԉ', + 'ԋ' => 'Ԋ', + 'ԍ' => 'Ԍ', + 'ԏ' => 'Ԏ', + 'ԑ' => 'Ԑ', + 'ԓ' => 'Ԓ', + 'ԕ' => 'Ԕ', + 'ԗ' => 'Ԗ', + 'ԙ' => 'Ԙ', + 'ԛ' => 'Ԛ', + 'ԝ' => 'Ԝ', + 'ԟ' => 'Ԟ', + 'ԡ' => 'Ԡ', + 'ԣ' => 'Ԣ', + 'ԥ' => 'Ԥ', + 'ԧ' => 'Ԧ', + 'ԩ' => 'Ԩ', + 'ԫ' => 'Ԫ', + 'ԭ' => 'Ԭ', + 'ԯ' => 'Ԯ', + 'ա' => 'Ա', + 'բ' => 'Բ', + 'գ' => 'Գ', + 'դ' => 'Դ', + 'ե' => 'Ե', + 'զ' => 'Զ', + 'է' => 'Է', + 'ը' => 'Ը', + 'թ' => 'Թ', + 'ժ' => 'Ժ', + 'ի' => 'Ի', + 'լ' => 'Լ', + 'խ' => 'Խ', + 'ծ' => 'Ծ', + 'կ' => 'Կ', + 'հ' => 'Հ', + 'ձ' => 'Ձ', + 'ղ' => 'Ղ', + 'ճ' => 'Ճ', + 'մ' => 'Մ', + 'յ' => 'Յ', + 'ն' => 'Ն', + 'շ' => 'Շ', + 'ո' => 'Ո', + 'չ' => 'Չ', + 'պ' => 'Պ', + 'ջ' => 'Ջ', + 'ռ' => 'Ռ', + 'ս' => 'Ս', + 'վ' => 'Վ', + 'տ' => 'Տ', + 'ր' => 'Ր', + 'ց' => 'Ց', + 'ւ' => 'Ւ', + 'փ' => 'Փ', + 'ք' => 'Ք', + 'օ' => 'Օ', + 'ֆ' => 'Ֆ', + 'ა' => 'Ა', + 'ბ' => 'Ბ', + 'გ' => 'Გ', + 'დ' => 'Დ', + 'ე' => 'Ე', + 'ვ' => 'Ვ', + 'ზ' => 'Ზ', + 'თ' => 'Თ', + 'ი' => 'Ი', + 'კ' => 'Კ', + 'ლ' => 'Ლ', + 'მ' => 'Მ', + 'ნ' => 'Ნ', + 'ო' => 'Ო', + 'პ' => 'Პ', + 'ჟ' => 'Ჟ', + 'რ' => 'Რ', + 'ს' => 'Ს', + 'ტ' => 'Ტ', + 'უ' => 'Უ', + 'ფ' => 'Ფ', + 'ქ' => 'Ქ', + 'ღ' => 'Ღ', + 'ყ' => 'Ყ', + 'შ' => 'Შ', + 'ჩ' => 'Ჩ', + 'ც' => 'Ც', + 'ძ' => 'Ძ', + 'წ' => 'Წ', + 'ჭ' => 'Ჭ', + 'ხ' => 'Ხ', + 'ჯ' => 'Ჯ', + 'ჰ' => 'Ჰ', + 'ჱ' => 'Ჱ', + 'ჲ' => 'Ჲ', + 'ჳ' => 'Ჳ', + 'ჴ' => 'Ჴ', + 'ჵ' => 'Ჵ', + 'ჶ' => 'Ჶ', + 'ჷ' => 'Ჷ', + 'ჸ' => 'Ჸ', + 'ჹ' => 'Ჹ', + 'ჺ' => 'Ჺ', + 'ჽ' => 'Ჽ', + 'ჾ' => 'Ჾ', + 'ჿ' => 'Ჿ', + 'ᏸ' => 'Ᏸ', + 'ᏹ' => 'Ᏹ', + 'ᏺ' => 'Ᏺ', + 'ᏻ' => 'Ᏻ', + 'ᏼ' => 'Ᏼ', + 'ᏽ' => 'Ᏽ', + 'ᲀ' => 'В', + 'ᲁ' => 'Д', + 'ᲂ' => 'О', + 'ᲃ' => 'С', + 'ᲄ' => 'Т', + 'ᲅ' => 'Т', + 'ᲆ' => 'Ъ', + 'ᲇ' => 'Ѣ', + 'ᲈ' => 'Ꙋ', + 'ᵹ' => 'Ᵹ', + 'ᵽ' => 'Ᵽ', + 'ᶎ' => 'Ᶎ', + 'ḁ' => 'Ḁ', + 'ḃ' => 'Ḃ', + 'ḅ' => 'Ḅ', + 'ḇ' => 'Ḇ', + 'ḉ' => 'Ḉ', + 'ḋ' => 'Ḋ', + 'ḍ' => 'Ḍ', + 'ḏ' => 'Ḏ', + 'ḑ' => 'Ḑ', + 'ḓ' => 'Ḓ', + 'ḕ' => 'Ḕ', + 'ḗ' => 'Ḗ', + 'ḙ' => 'Ḙ', + 'ḛ' => 'Ḛ', + 'ḝ' => 'Ḝ', + 'ḟ' => 'Ḟ', + 'ḡ' => 'Ḡ', + 'ḣ' => 'Ḣ', + 'ḥ' => 'Ḥ', + 'ḧ' => 'Ḧ', + 'ḩ' => 'Ḩ', + 'ḫ' => 'Ḫ', + 'ḭ' => 'Ḭ', + 'ḯ' => 'Ḯ', + 'ḱ' => 'Ḱ', + 'ḳ' => 'Ḳ', + 'ḵ' => 'Ḵ', + 'ḷ' => 'Ḷ', + 'ḹ' => 'Ḹ', + 'ḻ' => 'Ḻ', + 'ḽ' => 'Ḽ', + 'ḿ' => 'Ḿ', + 'ṁ' => 'Ṁ', + 'ṃ' => 'Ṃ', + 'ṅ' => 'Ṅ', + 'ṇ' => 'Ṇ', + 'ṉ' => 'Ṉ', + 'ṋ' => 'Ṋ', + 'ṍ' => 'Ṍ', + 'ṏ' => 'Ṏ', + 'ṑ' => 'Ṑ', + 'ṓ' => 'Ṓ', + 'ṕ' => 'Ṕ', + 'ṗ' => 'Ṗ', + 'ṙ' => 'Ṙ', + 'ṛ' => 'Ṛ', + 'ṝ' => 'Ṝ', + 'ṟ' => 'Ṟ', + 'ṡ' => 'Ṡ', + 'ṣ' => 'Ṣ', + 'ṥ' => 'Ṥ', + 'ṧ' => 'Ṧ', + 'ṩ' => 'Ṩ', + 'ṫ' => 'Ṫ', + 'ṭ' => 'Ṭ', + 'ṯ' => 'Ṯ', + 'ṱ' => 'Ṱ', + 'ṳ' => 'Ṳ', + 'ṵ' => 'Ṵ', + 'ṷ' => 'Ṷ', + 'ṹ' => 'Ṹ', + 'ṻ' => 'Ṻ', + 'ṽ' => 'Ṽ', + 'ṿ' => 'Ṿ', + 'ẁ' => 'Ẁ', + 'ẃ' => 'Ẃ', + 'ẅ' => 'Ẅ', + 'ẇ' => 'Ẇ', + 'ẉ' => 'Ẉ', + 'ẋ' => 'Ẋ', + 'ẍ' => 'Ẍ', + 'ẏ' => 'Ẏ', + 'ẑ' => 'Ẑ', + 'ẓ' => 'Ẓ', + 'ẕ' => 'Ẕ', + 'ẛ' => 'Ṡ', + 'ạ' => 'Ạ', + 'ả' => 'Ả', + 'ấ' => 'Ấ', + 'ầ' => 'Ầ', + 'ẩ' => 'Ẩ', + 'ẫ' => 'Ẫ', + 'ậ' => 'Ậ', + 'ắ' => 'Ắ', + 'ằ' => 'Ằ', + 'ẳ' => 'Ẳ', + 'ẵ' => 'Ẵ', + 'ặ' => 'Ặ', + 'ẹ' => 'Ẹ', + 'ẻ' => 'Ẻ', + 'ẽ' => 'Ẽ', + 'ế' => 'Ế', + 'ề' => 'Ề', + 'ể' => 'Ể', + 'ễ' => 'Ễ', + 'ệ' => 'Ệ', + 'ỉ' => 'Ỉ', + 'ị' => 'Ị', + 'ọ' => 'Ọ', + 'ỏ' => 'Ỏ', + 'ố' => 'Ố', + 'ồ' => 'Ồ', + 'ổ' => 'Ổ', + 'ỗ' => 'Ỗ', + 'ộ' => 'Ộ', + 'ớ' => 'Ớ', + 'ờ' => 'Ờ', + 'ở' => 'Ở', + 'ỡ' => 'Ỡ', + 'ợ' => 'Ợ', + 'ụ' => 'Ụ', + 'ủ' => 'Ủ', + 'ứ' => 'Ứ', + 'ừ' => 'Ừ', + 'ử' => 'Ử', + 'ữ' => 'Ữ', + 'ự' => 'Ự', + 'ỳ' => 'Ỳ', + 'ỵ' => 'Ỵ', + 'ỷ' => 'Ỷ', + 'ỹ' => 'Ỹ', + 'ỻ' => 'Ỻ', + 'ỽ' => 'Ỽ', + 'ỿ' => 'Ỿ', + 'ἀ' => 'Ἀ', + 'ἁ' => 'Ἁ', + 'ἂ' => 'Ἂ', + 'ἃ' => 'Ἃ', + 'ἄ' => 'Ἄ', + 'ἅ' => 'Ἅ', + 'ἆ' => 'Ἆ', + 'ἇ' => 'Ἇ', + 'ἐ' => 'Ἐ', + 'ἑ' => 'Ἑ', + 'ἒ' => 'Ἒ', + 'ἓ' => 'Ἓ', + 'ἔ' => 'Ἔ', + 'ἕ' => 'Ἕ', + 'ἠ' => 'Ἠ', + 'ἡ' => 'Ἡ', + 'ἢ' => 'Ἢ', + 'ἣ' => 'Ἣ', + 'ἤ' => 'Ἤ', + 'ἥ' => 'Ἥ', + 'ἦ' => 'Ἦ', + 'ἧ' => 'Ἧ', + 'ἰ' => 'Ἰ', + 'ἱ' => 'Ἱ', + 'ἲ' => 'Ἲ', + 'ἳ' => 'Ἳ', + 'ἴ' => 'Ἴ', + 'ἵ' => 'Ἵ', + 'ἶ' => 'Ἶ', + 'ἷ' => 'Ἷ', + 'ὀ' => 'Ὀ', + 'ὁ' => 'Ὁ', + 'ὂ' => 'Ὂ', + 'ὃ' => 'Ὃ', + 'ὄ' => 'Ὄ', + 'ὅ' => 'Ὅ', + 'ὑ' => 'Ὑ', + 'ὓ' => 'Ὓ', + 'ὕ' => 'Ὕ', + 'ὗ' => 'Ὗ', + 'ὠ' => 'Ὠ', + 'ὡ' => 'Ὡ', + 'ὢ' => 'Ὢ', + 'ὣ' => 'Ὣ', + 'ὤ' => 'Ὤ', + 'ὥ' => 'Ὥ', + 'ὦ' => 'Ὦ', + 'ὧ' => 'Ὧ', + 'ὰ' => 'Ὰ', + 'ά' => 'Ά', + 'ὲ' => 'Ὲ', + 'έ' => 'Έ', + 'ὴ' => 'Ὴ', + 'ή' => 'Ή', + 'ὶ' => 'Ὶ', + 'ί' => 'Ί', + 'ὸ' => 'Ὸ', + 'ό' => 'Ό', + 'ὺ' => 'Ὺ', + 'ύ' => 'Ύ', + 'ὼ' => 'Ὼ', + 'ώ' => 'Ώ', + 'ᾀ' => 'ἈΙ', + 'ᾁ' => 'ἉΙ', + 'ᾂ' => 'ἊΙ', + 'ᾃ' => 'ἋΙ', + 'ᾄ' => 'ἌΙ', + 'ᾅ' => 'ἍΙ', + 'ᾆ' => 'ἎΙ', + 'ᾇ' => 'ἏΙ', + 'ᾐ' => 'ἨΙ', + 'ᾑ' => 'ἩΙ', + 'ᾒ' => 'ἪΙ', + 'ᾓ' => 'ἫΙ', + 'ᾔ' => 'ἬΙ', + 'ᾕ' => 'ἭΙ', + 'ᾖ' => 'ἮΙ', + 'ᾗ' => 'ἯΙ', + 'ᾠ' => 'ὨΙ', + 'ᾡ' => 'ὩΙ', + 'ᾢ' => 'ὪΙ', + 'ᾣ' => 'ὫΙ', + 'ᾤ' => 'ὬΙ', + 'ᾥ' => 'ὭΙ', + 'ᾦ' => 'ὮΙ', + 'ᾧ' => 'ὯΙ', + 'ᾰ' => 'Ᾰ', + 'ᾱ' => 'Ᾱ', + 'ᾳ' => 'ΑΙ', + 'ι' => 'Ι', + 'ῃ' => 'ΗΙ', + 'ῐ' => 'Ῐ', + 'ῑ' => 'Ῑ', + 'ῠ' => 'Ῠ', + 'ῡ' => 'Ῡ', + 'ῥ' => 'Ῥ', + 'ῳ' => 'ΩΙ', + 'ⅎ' => 'Ⅎ', + 'ⅰ' => 'Ⅰ', + 'ⅱ' => 'Ⅱ', + 'ⅲ' => 'Ⅲ', + 'ⅳ' => 'Ⅳ', + 'ⅴ' => 'Ⅴ', + 'ⅵ' => 'Ⅵ', + 'ⅶ' => 'Ⅶ', + 'ⅷ' => 'Ⅷ', + 'ⅸ' => 'Ⅸ', + 'ⅹ' => 'Ⅹ', + 'ⅺ' => 'Ⅺ', + 'ⅻ' => 'Ⅻ', + 'ⅼ' => 'Ⅼ', + 'ⅽ' => 'Ⅽ', + 'ⅾ' => 'Ⅾ', + 'ⅿ' => 'Ⅿ', + 'ↄ' => 'Ↄ', + 'ⓐ' => 'Ⓐ', + 'ⓑ' => 'Ⓑ', + 'ⓒ' => 'Ⓒ', + 'ⓓ' => 'Ⓓ', + 'ⓔ' => 'Ⓔ', + 'ⓕ' => 'Ⓕ', + 'ⓖ' => 'Ⓖ', + 'ⓗ' => 'Ⓗ', + 'ⓘ' => 'Ⓘ', + 'ⓙ' => 'Ⓙ', + 'ⓚ' => 'Ⓚ', + 'ⓛ' => 'Ⓛ', + 'ⓜ' => 'Ⓜ', + 'ⓝ' => 'Ⓝ', + 'ⓞ' => 'Ⓞ', + 'ⓟ' => 'Ⓟ', + 'ⓠ' => 'Ⓠ', + 'ⓡ' => 'Ⓡ', + 'ⓢ' => 'Ⓢ', + 'ⓣ' => 'Ⓣ', + 'ⓤ' => 'Ⓤ', + 'ⓥ' => 'Ⓥ', + 'ⓦ' => 'Ⓦ', + 'ⓧ' => 'Ⓧ', + 'ⓨ' => 'Ⓨ', + 'ⓩ' => 'Ⓩ', + 'ⰰ' => 'Ⰰ', + 'ⰱ' => 'Ⰱ', + 'ⰲ' => 'Ⰲ', + 'ⰳ' => 'Ⰳ', + 'ⰴ' => 'Ⰴ', + 'ⰵ' => 'Ⰵ', + 'ⰶ' => 'Ⰶ', + 'ⰷ' => 'Ⰷ', + 'ⰸ' => 'Ⰸ', + 'ⰹ' => 'Ⰹ', + 'ⰺ' => 'Ⰺ', + 'ⰻ' => 'Ⰻ', + 'ⰼ' => 'Ⰼ', + 'ⰽ' => 'Ⰽ', + 'ⰾ' => 'Ⰾ', + 'ⰿ' => 'Ⰿ', + 'ⱀ' => 'Ⱀ', + 'ⱁ' => 'Ⱁ', + 'ⱂ' => 'Ⱂ', + 'ⱃ' => 'Ⱃ', + 'ⱄ' => 'Ⱄ', + 'ⱅ' => 'Ⱅ', + 'ⱆ' => 'Ⱆ', + 'ⱇ' => 'Ⱇ', + 'ⱈ' => 'Ⱈ', + 'ⱉ' => 'Ⱉ', + 'ⱊ' => 'Ⱊ', + 'ⱋ' => 'Ⱋ', + 'ⱌ' => 'Ⱌ', + 'ⱍ' => 'Ⱍ', + 'ⱎ' => 'Ⱎ', + 'ⱏ' => 'Ⱏ', + 'ⱐ' => 'Ⱐ', + 'ⱑ' => 'Ⱑ', + 'ⱒ' => 'Ⱒ', + 'ⱓ' => 'Ⱓ', + 'ⱔ' => 'Ⱔ', + 'ⱕ' => 'Ⱕ', + 'ⱖ' => 'Ⱖ', + 'ⱗ' => 'Ⱗ', + 'ⱘ' => 'Ⱘ', + 'ⱙ' => 'Ⱙ', + 'ⱚ' => 'Ⱚ', + 'ⱛ' => 'Ⱛ', + 'ⱜ' => 'Ⱜ', + 'ⱝ' => 'Ⱝ', + 'ⱞ' => 'Ⱞ', + 'ⱡ' => 'Ⱡ', + 'ⱥ' => 'Ⱥ', + 'ⱦ' => 'Ⱦ', + 'ⱨ' => 'Ⱨ', + 'ⱪ' => 'Ⱪ', + 'ⱬ' => 'Ⱬ', + 'ⱳ' => 'Ⱳ', + 'ⱶ' => 'Ⱶ', + 'ⲁ' => 'Ⲁ', + 'ⲃ' => 'Ⲃ', + 'ⲅ' => 'Ⲅ', + 'ⲇ' => 'Ⲇ', + 'ⲉ' => 'Ⲉ', + 'ⲋ' => 'Ⲋ', + 'ⲍ' => 'Ⲍ', + 'ⲏ' => 'Ⲏ', + 'ⲑ' => 'Ⲑ', + 'ⲓ' => 'Ⲓ', + 'ⲕ' => 'Ⲕ', + 'ⲗ' => 'Ⲗ', + 'ⲙ' => 'Ⲙ', + 'ⲛ' => 'Ⲛ', + 'ⲝ' => 'Ⲝ', + 'ⲟ' => 'Ⲟ', + 'ⲡ' => 'Ⲡ', + 'ⲣ' => 'Ⲣ', + 'ⲥ' => 'Ⲥ', + 'ⲧ' => 'Ⲧ', + 'ⲩ' => 'Ⲩ', + 'ⲫ' => 'Ⲫ', + 'ⲭ' => 'Ⲭ', + 'ⲯ' => 'Ⲯ', + 'ⲱ' => 'Ⲱ', + 'ⲳ' => 'Ⲳ', + 'ⲵ' => 'Ⲵ', + 'ⲷ' => 'Ⲷ', + 'ⲹ' => 'Ⲹ', + 'ⲻ' => 'Ⲻ', + 'ⲽ' => 'Ⲽ', + 'ⲿ' => 'Ⲿ', + 'ⳁ' => 'Ⳁ', + 'ⳃ' => 'Ⳃ', + 'ⳅ' => 'Ⳅ', + 'ⳇ' => 'Ⳇ', + 'ⳉ' => 'Ⳉ', + 'ⳋ' => 'Ⳋ', + 'ⳍ' => 'Ⳍ', + 'ⳏ' => 'Ⳏ', + 'ⳑ' => 'Ⳑ', + 'ⳓ' => 'Ⳓ', + 'ⳕ' => 'Ⳕ', + 'ⳗ' => 'Ⳗ', + 'ⳙ' => 'Ⳙ', + 'ⳛ' => 'Ⳛ', + 'ⳝ' => 'Ⳝ', + 'ⳟ' => 'Ⳟ', + 'ⳡ' => 'Ⳡ', + 'ⳣ' => 'Ⳣ', + 'ⳬ' => 'Ⳬ', + 'ⳮ' => 'Ⳮ', + 'ⳳ' => 'Ⳳ', + 'ⴀ' => 'Ⴀ', + 'ⴁ' => 'Ⴁ', + 'ⴂ' => 'Ⴂ', + 'ⴃ' => 'Ⴃ', + 'ⴄ' => 'Ⴄ', + 'ⴅ' => 'Ⴅ', + 'ⴆ' => 'Ⴆ', + 'ⴇ' => 'Ⴇ', + 'ⴈ' => 'Ⴈ', + 'ⴉ' => 'Ⴉ', + 'ⴊ' => 'Ⴊ', + 'ⴋ' => 'Ⴋ', + 'ⴌ' => 'Ⴌ', + 'ⴍ' => 'Ⴍ', + 'ⴎ' => 'Ⴎ', + 'ⴏ' => 'Ⴏ', + 'ⴐ' => 'Ⴐ', + 'ⴑ' => 'Ⴑ', + 'ⴒ' => 'Ⴒ', + 'ⴓ' => 'Ⴓ', + 'ⴔ' => 'Ⴔ', + 'ⴕ' => 'Ⴕ', + 'ⴖ' => 'Ⴖ', + 'ⴗ' => 'Ⴗ', + 'ⴘ' => 'Ⴘ', + 'ⴙ' => 'Ⴙ', + 'ⴚ' => 'Ⴚ', + 'ⴛ' => 'Ⴛ', + 'ⴜ' => 'Ⴜ', + 'ⴝ' => 'Ⴝ', + 'ⴞ' => 'Ⴞ', + 'ⴟ' => 'Ⴟ', + 'ⴠ' => 'Ⴠ', + 'ⴡ' => 'Ⴡ', + 'ⴢ' => 'Ⴢ', + 'ⴣ' => 'Ⴣ', + 'ⴤ' => 'Ⴤ', + 'ⴥ' => 'Ⴥ', + 'ⴧ' => 'Ⴧ', + 'ⴭ' => 'Ⴭ', + 'ꙁ' => 'Ꙁ', + 'ꙃ' => 'Ꙃ', + 'ꙅ' => 'Ꙅ', + 'ꙇ' => 'Ꙇ', + 'ꙉ' => 'Ꙉ', + 'ꙋ' => 'Ꙋ', + 'ꙍ' => 'Ꙍ', + 'ꙏ' => 'Ꙏ', + 'ꙑ' => 'Ꙑ', + 'ꙓ' => 'Ꙓ', + 'ꙕ' => 'Ꙕ', + 'ꙗ' => 'Ꙗ', + 'ꙙ' => 'Ꙙ', + 'ꙛ' => 'Ꙛ', + 'ꙝ' => 'Ꙝ', + 'ꙟ' => 'Ꙟ', + 'ꙡ' => 'Ꙡ', + 'ꙣ' => 'Ꙣ', + 'ꙥ' => 'Ꙥ', + 'ꙧ' => 'Ꙧ', + 'ꙩ' => 'Ꙩ', + 'ꙫ' => 'Ꙫ', + 'ꙭ' => 'Ꙭ', + 'ꚁ' => 'Ꚁ', + 'ꚃ' => 'Ꚃ', + 'ꚅ' => 'Ꚅ', + 'ꚇ' => 'Ꚇ', + 'ꚉ' => 'Ꚉ', + 'ꚋ' => 'Ꚋ', + 'ꚍ' => 'Ꚍ', + 'ꚏ' => 'Ꚏ', + 'ꚑ' => 'Ꚑ', + 'ꚓ' => 'Ꚓ', + 'ꚕ' => 'Ꚕ', + 'ꚗ' => 'Ꚗ', + 'ꚙ' => 'Ꚙ', + 'ꚛ' => 'Ꚛ', + 'ꜣ' => 'Ꜣ', + 'ꜥ' => 'Ꜥ', + 'ꜧ' => 'Ꜧ', + 'ꜩ' => 'Ꜩ', + 'ꜫ' => 'Ꜫ', + 'ꜭ' => 'Ꜭ', + 'ꜯ' => 'Ꜯ', + 'ꜳ' => 'Ꜳ', + 'ꜵ' => 'Ꜵ', + 'ꜷ' => 'Ꜷ', + 'ꜹ' => 'Ꜹ', + 'ꜻ' => 'Ꜻ', + 'ꜽ' => 'Ꜽ', + 'ꜿ' => 'Ꜿ', + 'ꝁ' => 'Ꝁ', + 'ꝃ' => 'Ꝃ', + 'ꝅ' => 'Ꝅ', + 'ꝇ' => 'Ꝇ', + 'ꝉ' => 'Ꝉ', + 'ꝋ' => 'Ꝋ', + 'ꝍ' => 'Ꝍ', + 'ꝏ' => 'Ꝏ', + 'ꝑ' => 'Ꝑ', + 'ꝓ' => 'Ꝓ', + 'ꝕ' => 'Ꝕ', + 'ꝗ' => 'Ꝗ', + 'ꝙ' => 'Ꝙ', + 'ꝛ' => 'Ꝛ', + 'ꝝ' => 'Ꝝ', + 'ꝟ' => 'Ꝟ', + 'ꝡ' => 'Ꝡ', + 'ꝣ' => 'Ꝣ', + 'ꝥ' => 'Ꝥ', + 'ꝧ' => 'Ꝧ', + 'ꝩ' => 'Ꝩ', + 'ꝫ' => 'Ꝫ', + 'ꝭ' => 'Ꝭ', + 'ꝯ' => 'Ꝯ', + 'ꝺ' => 'Ꝺ', + 'ꝼ' => 'Ꝼ', + 'ꝿ' => 'Ꝿ', + 'ꞁ' => 'Ꞁ', + 'ꞃ' => 'Ꞃ', + 'ꞅ' => 'Ꞅ', + 'ꞇ' => 'Ꞇ', + 'ꞌ' => 'Ꞌ', + 'ꞑ' => 'Ꞑ', + 'ꞓ' => 'Ꞓ', + 'ꞔ' => 'Ꞔ', + 'ꞗ' => 'Ꞗ', + 'ꞙ' => 'Ꞙ', + 'ꞛ' => 'Ꞛ', + 'ꞝ' => 'Ꞝ', + 'ꞟ' => 'Ꞟ', + 'ꞡ' => 'Ꞡ', + 'ꞣ' => 'Ꞣ', + 'ꞥ' => 'Ꞥ', + 'ꞧ' => 'Ꞧ', + 'ꞩ' => 'Ꞩ', + 'ꞵ' => 'Ꞵ', + 'ꞷ' => 'Ꞷ', + 'ꞹ' => 'Ꞹ', + 'ꞻ' => 'Ꞻ', + 'ꞽ' => 'Ꞽ', + 'ꞿ' => 'Ꞿ', + 'ꟃ' => 'Ꟃ', + 'ꟈ' => 'Ꟈ', + 'ꟊ' => 'Ꟊ', + 'ꟶ' => 'Ꟶ', + 'ꭓ' => 'Ꭓ', + 'ꭰ' => 'Ꭰ', + 'ꭱ' => 'Ꭱ', + 'ꭲ' => 'Ꭲ', + 'ꭳ' => 'Ꭳ', + 'ꭴ' => 'Ꭴ', + 'ꭵ' => 'Ꭵ', + 'ꭶ' => 'Ꭶ', + 'ꭷ' => 'Ꭷ', + 'ꭸ' => 'Ꭸ', + 'ꭹ' => 'Ꭹ', + 'ꭺ' => 'Ꭺ', + 'ꭻ' => 'Ꭻ', + 'ꭼ' => 'Ꭼ', + 'ꭽ' => 'Ꭽ', + 'ꭾ' => 'Ꭾ', + 'ꭿ' => 'Ꭿ', + 'ꮀ' => 'Ꮀ', + 'ꮁ' => 'Ꮁ', + 'ꮂ' => 'Ꮂ', + 'ꮃ' => 'Ꮃ', + 'ꮄ' => 'Ꮄ', + 'ꮅ' => 'Ꮅ', + 'ꮆ' => 'Ꮆ', + 'ꮇ' => 'Ꮇ', + 'ꮈ' => 'Ꮈ', + 'ꮉ' => 'Ꮉ', + 'ꮊ' => 'Ꮊ', + 'ꮋ' => 'Ꮋ', + 'ꮌ' => 'Ꮌ', + 'ꮍ' => 'Ꮍ', + 'ꮎ' => 'Ꮎ', + 'ꮏ' => 'Ꮏ', + 'ꮐ' => 'Ꮐ', + 'ꮑ' => 'Ꮑ', + 'ꮒ' => 'Ꮒ', + 'ꮓ' => 'Ꮓ', + 'ꮔ' => 'Ꮔ', + 'ꮕ' => 'Ꮕ', + 'ꮖ' => 'Ꮖ', + 'ꮗ' => 'Ꮗ', + 'ꮘ' => 'Ꮘ', + 'ꮙ' => 'Ꮙ', + 'ꮚ' => 'Ꮚ', + 'ꮛ' => 'Ꮛ', + 'ꮜ' => 'Ꮜ', + 'ꮝ' => 'Ꮝ', + 'ꮞ' => 'Ꮞ', + 'ꮟ' => 'Ꮟ', + 'ꮠ' => 'Ꮠ', + 'ꮡ' => 'Ꮡ', + 'ꮢ' => 'Ꮢ', + 'ꮣ' => 'Ꮣ', + 'ꮤ' => 'Ꮤ', + 'ꮥ' => 'Ꮥ', + 'ꮦ' => 'Ꮦ', + 'ꮧ' => 'Ꮧ', + 'ꮨ' => 'Ꮨ', + 'ꮩ' => 'Ꮩ', + 'ꮪ' => 'Ꮪ', + 'ꮫ' => 'Ꮫ', + 'ꮬ' => 'Ꮬ', + 'ꮭ' => 'Ꮭ', + 'ꮮ' => 'Ꮮ', + 'ꮯ' => 'Ꮯ', + 'ꮰ' => 'Ꮰ', + 'ꮱ' => 'Ꮱ', + 'ꮲ' => 'Ꮲ', + 'ꮳ' => 'Ꮳ', + 'ꮴ' => 'Ꮴ', + 'ꮵ' => 'Ꮵ', + 'ꮶ' => 'Ꮶ', + 'ꮷ' => 'Ꮷ', + 'ꮸ' => 'Ꮸ', + 'ꮹ' => 'Ꮹ', + 'ꮺ' => 'Ꮺ', + 'ꮻ' => 'Ꮻ', + 'ꮼ' => 'Ꮼ', + 'ꮽ' => 'Ꮽ', + 'ꮾ' => 'Ꮾ', + 'ꮿ' => 'Ꮿ', + 'a' => 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + '𐐨' => '𐐀', + '𐐩' => '𐐁', + '𐐪' => '𐐂', + '𐐫' => '𐐃', + '𐐬' => '𐐄', + '𐐭' => '𐐅', + '𐐮' => '𐐆', + '𐐯' => '𐐇', + '𐐰' => '𐐈', + '𐐱' => '𐐉', + '𐐲' => '𐐊', + '𐐳' => '𐐋', + '𐐴' => '𐐌', + '𐐵' => '𐐍', + '𐐶' => '𐐎', + '𐐷' => '𐐏', + '𐐸' => '𐐐', + '𐐹' => '𐐑', + '𐐺' => '𐐒', + '𐐻' => '𐐓', + '𐐼' => '𐐔', + '𐐽' => '𐐕', + '𐐾' => '𐐖', + '𐐿' => '𐐗', + '𐑀' => '𐐘', + '𐑁' => '𐐙', + '𐑂' => '𐐚', + '𐑃' => '𐐛', + '𐑄' => '𐐜', + '𐑅' => '𐐝', + '𐑆' => '𐐞', + '𐑇' => '𐐟', + '𐑈' => '𐐠', + '𐑉' => '𐐡', + '𐑊' => '𐐢', + '𐑋' => '𐐣', + '𐑌' => '𐐤', + '𐑍' => '𐐥', + '𐑎' => '𐐦', + '𐑏' => '𐐧', + '𐓘' => '𐒰', + '𐓙' => '𐒱', + '𐓚' => '𐒲', + '𐓛' => '𐒳', + '𐓜' => '𐒴', + '𐓝' => '𐒵', + '𐓞' => '𐒶', + '𐓟' => '𐒷', + '𐓠' => '𐒸', + '𐓡' => '𐒹', + '𐓢' => '𐒺', + '𐓣' => '𐒻', + '𐓤' => '𐒼', + '𐓥' => '𐒽', + '𐓦' => '𐒾', + '𐓧' => '𐒿', + '𐓨' => '𐓀', + '𐓩' => '𐓁', + '𐓪' => '𐓂', + '𐓫' => '𐓃', + '𐓬' => '𐓄', + '𐓭' => '𐓅', + '𐓮' => '𐓆', + '𐓯' => '𐓇', + '𐓰' => '𐓈', + '𐓱' => '𐓉', + '𐓲' => '𐓊', + '𐓳' => '𐓋', + '𐓴' => '𐓌', + '𐓵' => '𐓍', + '𐓶' => '𐓎', + '𐓷' => '𐓏', + '𐓸' => '𐓐', + '𐓹' => '𐓑', + '𐓺' => '𐓒', + '𐓻' => '𐓓', + '𐳀' => '𐲀', + '𐳁' => '𐲁', + '𐳂' => '𐲂', + '𐳃' => '𐲃', + '𐳄' => '𐲄', + '𐳅' => '𐲅', + '𐳆' => '𐲆', + '𐳇' => '𐲇', + '𐳈' => '𐲈', + '𐳉' => '𐲉', + '𐳊' => '𐲊', + '𐳋' => '𐲋', + '𐳌' => '𐲌', + '𐳍' => '𐲍', + '𐳎' => '𐲎', + '𐳏' => '𐲏', + '𐳐' => '𐲐', + '𐳑' => '𐲑', + '𐳒' => '𐲒', + '𐳓' => '𐲓', + '𐳔' => '𐲔', + '𐳕' => '𐲕', + '𐳖' => '𐲖', + '𐳗' => '𐲗', + '𐳘' => '𐲘', + '𐳙' => '𐲙', + '𐳚' => '𐲚', + '𐳛' => '𐲛', + '𐳜' => '𐲜', + '𐳝' => '𐲝', + '𐳞' => '𐲞', + '𐳟' => '𐲟', + '𐳠' => '𐲠', + '𐳡' => '𐲡', + '𐳢' => '𐲢', + '𐳣' => '𐲣', + '𐳤' => '𐲤', + '𐳥' => '𐲥', + '𐳦' => '𐲦', + '𐳧' => '𐲧', + '𐳨' => '𐲨', + '𐳩' => '𐲩', + '𐳪' => '𐲪', + '𐳫' => '𐲫', + '𐳬' => '𐲬', + '𐳭' => '𐲭', + '𐳮' => '𐲮', + '𐳯' => '𐲯', + '𐳰' => '𐲰', + '𐳱' => '𐲱', + '𐳲' => '𐲲', + '𑣀' => '𑢠', + '𑣁' => '𑢡', + '𑣂' => '𑢢', + '𑣃' => '𑢣', + '𑣄' => '𑢤', + '𑣅' => '𑢥', + '𑣆' => '𑢦', + '𑣇' => '𑢧', + '𑣈' => '𑢨', + '𑣉' => '𑢩', + '𑣊' => '𑢪', + '𑣋' => '𑢫', + '𑣌' => '𑢬', + '𑣍' => '𑢭', + '𑣎' => '𑢮', + '𑣏' => '𑢯', + '𑣐' => '𑢰', + '𑣑' => '𑢱', + '𑣒' => '𑢲', + '𑣓' => '𑢳', + '𑣔' => '𑢴', + '𑣕' => '𑢵', + '𑣖' => '𑢶', + '𑣗' => '𑢷', + '𑣘' => '𑢸', + '𑣙' => '𑢹', + '𑣚' => '𑢺', + '𑣛' => '𑢻', + '𑣜' => '𑢼', + '𑣝' => '𑢽', + '𑣞' => '𑢾', + '𑣟' => '𑢿', + '𖹠' => '𖹀', + '𖹡' => '𖹁', + '𖹢' => '𖹂', + '𖹣' => '𖹃', + '𖹤' => '𖹄', + '𖹥' => '𖹅', + '𖹦' => '𖹆', + '𖹧' => '𖹇', + '𖹨' => '𖹈', + '𖹩' => '𖹉', + '𖹪' => '𖹊', + '𖹫' => '𖹋', + '𖹬' => '𖹌', + '𖹭' => '𖹍', + '𖹮' => '𖹎', + '𖹯' => '𖹏', + '𖹰' => '𖹐', + '𖹱' => '𖹑', + '𖹲' => '𖹒', + '𖹳' => '𖹓', + '𖹴' => '𖹔', + '𖹵' => '𖹕', + '𖹶' => '𖹖', + '𖹷' => '𖹗', + '𖹸' => '𖹘', + '𖹹' => '𖹙', + '𖹺' => '𖹚', + '𖹻' => '𖹛', + '𖹼' => '𖹜', + '𖹽' => '𖹝', + '𖹾' => '𖹞', + '𖹿' => '𖹟', + '𞤢' => '𞤀', + '𞤣' => '𞤁', + '𞤤' => '𞤂', + '𞤥' => '𞤃', + '𞤦' => '𞤄', + '𞤧' => '𞤅', + '𞤨' => '𞤆', + '𞤩' => '𞤇', + '𞤪' => '𞤈', + '𞤫' => '𞤉', + '𞤬' => '𞤊', + '𞤭' => '𞤋', + '𞤮' => '𞤌', + '𞤯' => '𞤍', + '𞤰' => '𞤎', + '𞤱' => '𞤏', + '𞤲' => '𞤐', + '𞤳' => '𞤑', + '𞤴' => '𞤒', + '𞤵' => '𞤓', + '𞤶' => '𞤔', + '𞤷' => '𞤕', + '𞤸' => '𞤖', + '𞤹' => '𞤗', + '𞤺' => '𞤘', + '𞤻' => '𞤙', + '𞤼' => '𞤚', + '𞤽' => '𞤛', + '𞤾' => '𞤜', + '𞤿' => '𞤝', + '𞥀' => '𞤞', + '𞥁' => '𞤟', + '𞥂' => '𞤠', + '𞥃' => '𞤡', + 'ß' => 'SS', + 'ff' => 'FF', + 'fi' => 'FI', + 'fl' => 'FL', + 'ffi' => 'FFI', + 'ffl' => 'FFL', + 'ſt' => 'ST', + 'st' => 'ST', + 'և' => 'ԵՒ', + 'ﬓ' => 'ՄՆ', + 'ﬔ' => 'ՄԵ', + 'ﬕ' => 'ՄԻ', + 'ﬖ' => 'ՎՆ', + 'ﬗ' => 'ՄԽ', + 'ʼn' => 'ʼN', + 'ΐ' => 'Ϊ́', + 'ΰ' => 'Ϋ́', + 'ǰ' => 'J̌', + 'ẖ' => 'H̱', + 'ẗ' => 'T̈', + 'ẘ' => 'W̊', + 'ẙ' => 'Y̊', + 'ẚ' => 'Aʾ', + 'ὐ' => 'Υ̓', + 'ὒ' => 'Υ̓̀', + 'ὔ' => 'Υ̓́', + 'ὖ' => 'Υ̓͂', + 'ᾶ' => 'Α͂', + 'ῆ' => 'Η͂', + 'ῒ' => 'Ϊ̀', + 'ΐ' => 'Ϊ́', + 'ῖ' => 'Ι͂', + 'ῗ' => 'Ϊ͂', + 'ῢ' => 'Ϋ̀', + 'ΰ' => 'Ϋ́', + 'ῤ' => 'Ρ̓', + 'ῦ' => 'Υ͂', + 'ῧ' => 'Ϋ͂', + 'ῶ' => 'Ω͂', + 'ᾈ' => 'ἈΙ', + 'ᾉ' => 'ἉΙ', + 'ᾊ' => 'ἊΙ', + 'ᾋ' => 'ἋΙ', + 'ᾌ' => 'ἌΙ', + 'ᾍ' => 'ἍΙ', + 'ᾎ' => 'ἎΙ', + 'ᾏ' => 'ἏΙ', + 'ᾘ' => 'ἨΙ', + 'ᾙ' => 'ἩΙ', + 'ᾚ' => 'ἪΙ', + 'ᾛ' => 'ἫΙ', + 'ᾜ' => 'ἬΙ', + 'ᾝ' => 'ἭΙ', + 'ᾞ' => 'ἮΙ', + 'ᾟ' => 'ἯΙ', + 'ᾨ' => 'ὨΙ', + 'ᾩ' => 'ὩΙ', + 'ᾪ' => 'ὪΙ', + 'ᾫ' => 'ὫΙ', + 'ᾬ' => 'ὬΙ', + 'ᾭ' => 'ὭΙ', + 'ᾮ' => 'ὮΙ', + 'ᾯ' => 'ὯΙ', + 'ᾼ' => 'ΑΙ', + 'ῌ' => 'ΗΙ', + 'ῼ' => 'ΩΙ', + 'ᾲ' => 'ᾺΙ', + 'ᾴ' => 'ΆΙ', + 'ῂ' => 'ῊΙ', + 'ῄ' => 'ΉΙ', + 'ῲ' => 'ῺΙ', + 'ῴ' => 'ΏΙ', + 'ᾷ' => 'Α͂Ι', + 'ῇ' => 'Η͂Ι', + 'ῷ' => 'Ω͂Ι', +); diff --git a/plugins/vendor/symfony/polyfill-mbstring/bootstrap.php b/plugins/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100644 index 00000000..ff51ae07 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,172 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (\PHP_VERSION_ID >= 80000) { + return require __DIR__.'/bootstrap80.php'; +} + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/plugins/vendor/symfony/polyfill-mbstring/bootstrap80.php b/plugins/vendor/symfony/polyfill-mbstring/bootstrap80.php new file mode 100644 index 00000000..5236e6dc --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -0,0 +1,167 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } +} +if (!function_exists('mb_strlen')) { + function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } +} + +if (!function_exists('mb_convert_variables')) { + function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } +} + +if (!function_exists('mb_ord')) { + function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } +} + +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + +if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } +} + +if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } +} + +if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } +} + +if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } +} + +if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/plugins/vendor/symfony/polyfill-mbstring/composer.json b/plugins/vendor/symfony/polyfill-mbstring/composer.json new file mode 100644 index 00000000..daa07f86 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-mbstring/composer.json @@ -0,0 +1,39 @@ +{ + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2", + "ext-iconv": "*" + }, + "provide": { + "ext-mbstring": "*" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/LICENSE b/plugins/vendor/symfony/polyfill-php83/LICENSE new file mode 100644 index 00000000..733c826e --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2022-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/polyfill-php83/Php83.php b/plugins/vendor/symfony/polyfill-php83/Php83.php new file mode 100644 index 00000000..8b7ee4c7 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Php83.php @@ -0,0 +1,197 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php83; + +/** + * @author Ion Bazan + * @author Pierre Ambroise + * + * @internal + */ +final class Php83 +{ + private const JSON_MAX_DEPTH = 0x7FFFFFFF; // see https://www.php.net/manual/en/function.json-decode.php + + public static function json_validate(string $json, int $depth = 512, int $flags = 0): bool + { + if (0 !== $flags && \defined('JSON_INVALID_UTF8_IGNORE') && \JSON_INVALID_UTF8_IGNORE !== $flags) { + throw new \ValueError('json_validate(): Argument #3 ($flags) must be a valid flag (allowed flags: JSON_INVALID_UTF8_IGNORE)'); + } + + if ($depth <= 0) { + throw new \ValueError('json_validate(): Argument #2 ($depth) must be greater than 0'); + } + + if ($depth > self::JSON_MAX_DEPTH) { + throw new \ValueError(sprintf('json_validate(): Argument #2 ($depth) must be less than %d', self::JSON_MAX_DEPTH)); + } + + json_decode($json, true, $depth, $flags); + + return \JSON_ERROR_NONE === json_last_error(); + } + + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + try { + $validEncoding = @mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + if (mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + + public static function str_increment(string $string): string + { + if ('' === $string) { + throw new \ValueError('str_increment(): Argument #1 ($string) cannot be empty'); + } + + if (!preg_match('/^[a-zA-Z0-9]+$/', $string)) { + throw new \ValueError('str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters'); + } + + if (is_numeric($string)) { + $offset = stripos($string, 'e'); + if (false !== $offset) { + $char = $string[$offset]; + ++$char; + $string[$offset] = $char; + ++$string; + + switch ($string[$offset]) { + case 'f': + $string[$offset] = 'e'; + break; + case 'F': + $string[$offset] = 'E'; + break; + case 'g': + $string[$offset] = 'f'; + break; + case 'G': + $string[$offset] = 'F'; + break; + } + + return $string; + } + } + + return ++$string; + } + + public static function str_decrement(string $string): string + { + if ('' === $string) { + throw new \ValueError('str_decrement(): Argument #1 ($string) cannot be empty'); + } + + if (!preg_match('/^[a-zA-Z0-9]+$/', $string)) { + throw new \ValueError('str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters'); + } + + if (preg_match('/\A(?:0[aA0]?|[aA])\z/', $string)) { + throw new \ValueError(sprintf('str_decrement(): Argument #1 ($string) "%s" is out of decrement range', $string)); + } + + if (!\in_array(substr($string, -1), ['A', 'a', '0'], true)) { + return implode('', \array_slice(str_split($string), 0, -1)).\chr(\ord(substr($string, -1)) - 1); + } + + $carry = ''; + $decremented = ''; + + for ($i = \strlen($string) - 1; $i >= 0; --$i) { + $char = $string[$i]; + + switch ($char) { + case 'A': + if ('' !== $carry) { + $decremented = $carry.$decremented; + $carry = ''; + } + $carry = 'Z'; + + break; + case 'a': + if ('' !== $carry) { + $decremented = $carry.$decremented; + $carry = ''; + } + $carry = 'z'; + + break; + case '0': + if ('' !== $carry) { + $decremented = $carry.$decremented; + $carry = ''; + } + $carry = '9'; + + break; + case '1': + if ('' !== $carry) { + $decremented = $carry.$decremented; + $carry = ''; + } + + break; + default: + if ('' !== $carry) { + $decremented = $carry.$decremented; + $carry = ''; + } + + if (!\in_array($char, ['A', 'a', '0'], true)) { + $decremented = \chr(\ord($char) - 1).$decremented; + } + } + } + + return $decremented; + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/README.md b/plugins/vendor/symfony/polyfill-php83/README.md new file mode 100644 index 00000000..f2987768 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/README.md @@ -0,0 +1,22 @@ +Symfony Polyfill / Php83 +======================== + +This component provides features added to PHP 8.3 core: + +- [`json_validate`](https://wiki.php.net/rfc/json_validate) +- [`Override`](https://wiki.php.net/rfc/marking_overriden_methods) +- [`mb_str_pad`](https://wiki.php.net/rfc/mb_str_pad) +- [`ldap_exop_sync`](https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures) +- [`ldap_connect_wallet`](https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures) +- [`stream_context_set_options`](https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures) +- [`str_increment` and `str_decrement`](https://wiki.php.net/rfc/saner-inc-dec-operators) +- [`Date*Exception/Error classes`](https://wiki.php.net/rfc/datetime-exceptions) +- [`SQLite3Exception`](https://wiki.php.net/rfc/sqlite3_exceptions) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateError.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateError.php new file mode 100644 index 00000000..6e7ed8c8 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateError extends Error + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateException.php new file mode 100644 index 00000000..041710af --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateException extends Exception + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidOperationException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidOperationException.php new file mode 100644 index 00000000..e2e9dfc9 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidOperationException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateInvalidOperationException extends DateException + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidTimeZoneException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidTimeZoneException.php new file mode 100644 index 00000000..75bcd267 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateInvalidTimeZoneException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateInvalidTimeZoneException extends DateException + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedIntervalStringException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedIntervalStringException.php new file mode 100644 index 00000000..af91b8e4 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedIntervalStringException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateMalformedIntervalStringException extends DateException + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedPeriodStringException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedPeriodStringException.php new file mode 100644 index 00000000..9b6d2764 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedPeriodStringException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateMalformedPeriodStringException extends DateException + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedStringException.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedStringException.php new file mode 100644 index 00000000..7ad04849 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateMalformedStringException.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateMalformedStringException extends DateException + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateObjectError.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateObjectError.php new file mode 100644 index 00000000..11f0edc6 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateObjectError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateObjectError extends DateError + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateRangeError.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateRangeError.php new file mode 100644 index 00000000..98e67036 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/DateRangeError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class DateRangeError extends DateError + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/Override.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/Override.php new file mode 100644 index 00000000..d3e6b3e1 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/Override.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + #[Attribute(Attribute::TARGET_METHOD)] + final class Override + { + public function __construct() + { + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php new file mode 100644 index 00000000..ecb7c98e --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/Resources/stubs/SQLite3Exception.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80300) { + class SQLite3Exception extends Exception + { + } +} diff --git a/plugins/vendor/symfony/polyfill-php83/bootstrap.php b/plugins/vendor/symfony/polyfill-php83/bootstrap.php new file mode 100644 index 00000000..a92799cb --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/bootstrap.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php83 as p; + +if (\PHP_VERSION_ID >= 80300) { + return; +} + +if (!function_exists('json_validate')) { + function json_validate(string $json, int $depth = 512, int $flags = 0): bool { return p\Php83::json_validate($json, $depth, $flags); } +} + +if (extension_loaded('mbstring')) { + if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Php83::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } + } +} + +if (!function_exists('stream_context_set_options')) { + function stream_context_set_options($context, array $options): bool { return stream_context_set_option($context, $options); } +} + +if (!function_exists('str_increment')) { + function str_increment(string $string): string { return p\Php83::str_increment($string); } +} + +if (!function_exists('str_decrement')) { + function str_decrement(string $string): string { return p\Php83::str_decrement($string); } +} + +if (\PHP_VERSION_ID >= 80100) { + return require __DIR__.'/bootstrap81.php'; +} + +if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) { + function ldap_exop_sync($ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } +} + +if (!function_exists('ldap_connect_wallet') && function_exists('ldap_connect')) { + function ldap_connect_wallet(?string $uri, string $wallet, string $password, int $auth_mode = \GSLC_SSL_NO_AUTH) { return ldap_connect($uri, $wallet, $password, $auth_mode); } +} diff --git a/plugins/vendor/symfony/polyfill-php83/bootstrap81.php b/plugins/vendor/symfony/polyfill-php83/bootstrap81.php new file mode 100644 index 00000000..68395b43 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/bootstrap81.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID >= 80300) { + return; +} + +if (!function_exists('ldap_exop_sync') && function_exists('ldap_exop')) { + function ldap_exop_sync(\LDAP\Connection $ldap, string $request_oid, ?string $request_data = null, ?array $controls = null, &$response_data = null, &$response_oid = null): bool { return ldap_exop($ldap, $request_oid, $request_data, $controls, $response_data, $response_oid); } +} + +if (!function_exists('ldap_connect_wallet') && function_exists('ldap_connect')) { + function ldap_connect_wallet(?string $uri, string $wallet, #[\SensitiveParameter] string $password, int $auth_mode = \GSLC_SSL_NO_AUTH): \LDAP\Connection|false { return ldap_connect($uri, $wallet, $password, $auth_mode); } +} diff --git a/plugins/vendor/symfony/polyfill-php83/composer.json b/plugins/vendor/symfony/polyfill-php83/composer.json new file mode 100644 index 00000000..a8b8ba70 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php83/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/polyfill-php83", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php83\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php84/LICENSE b/plugins/vendor/symfony/polyfill-php84/LICENSE new file mode 100644 index 00000000..e374a5c8 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2024-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/polyfill-php84/Php84.php b/plugins/vendor/symfony/polyfill-php84/Php84.php new file mode 100644 index 00000000..1eea63af --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/Php84.php @@ -0,0 +1,217 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php84; + +/** + * @author Ayesh Karunaratne + * @author Pierre Ambroise + * + * @internal + */ +final class Php84 +{ + public static function mb_ucfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + try { + $validEncoding = @mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function mb_lcfirst(string $string, ?string $encoding = null): string + { + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + try { + $validEncoding = @mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + $firstChar = mb_substr($string, 0, 1, $encoding); + $firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding); + + return $firstChar.mb_substr($string, 1, null, $encoding); + } + + public static function array_find(array $array, callable $callback) + { + foreach ($array as $key => $value) { + if ($callback($value, $key)) { + return $value; + } + } + + return null; + } + + public static function array_find_key(array $array, callable $callback) + { + foreach ($array as $key => $value) { + if ($callback($value, $key)) { + return $key; + } + } + + return null; + } + + public static function array_any(array $array, callable $callback): bool + { + foreach ($array as $key => $value) { + if ($callback($value, $key)) { + return true; + } + } + + return false; + } + + public static function array_all(array $array, callable $callback): bool + { + foreach ($array as $key => $value) { + if (!$callback($value, $key)) { + return false; + } + } + + return true; + } + + public static function fpow(float $num, float $exponent): float + { + return $num ** $exponent; + } + + public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__); + } + + public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string + { + return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__); + } + + private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string + { + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + try { + $validEncoding = @mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('%s(): Argument #3 ($encoding) must be a valid encoding, "%s" given', $function, $encoding)); + } + + if ('' === $characters) { + return null === $encoding ? $string : mb_convert_encoding($string, $encoding); + } + + if ('UTF-8' === $encoding || \in_array(strtolower($encoding), ['utf-8', 'utf8'], true)) { + $encoding = 'UTF-8'; + } + + $string = mb_convert_encoding($string, 'UTF-8', $encoding); + + if (null !== $characters) { + $characters = mb_convert_encoding($characters, 'UTF-8', $encoding); + } + + if (null === $characters) { + $characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}"; + } else { + $characters = preg_quote($characters); + } + + $string = preg_replace(sprintf($regex, $characters), '', $string); + + if ('UTF-8' === $encoding) { + return $string; + } + + return mb_convert_encoding($string, $encoding, 'UTF-8'); + } + + public static function grapheme_str_split(string $string, int $length) + { + if (0 > $length || 1073741823 < $length) { + throw new \ValueError('grapheme_str_split(): Argument #2 ($length) must be greater than 0 and less than or equal to 1073741823.'); + } + + if ('' === $string) { + return []; + } + + $regex = ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) + ? '\X' + : '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; + + if (!preg_match_all('/'. $regex .'/u', $string, $matches)) { + return false; + } + + if (1 === $length) { + return $matches[0]; + } + + $chunks = array_chunk($matches[0], $length); + foreach ($chunks as &$chunk) { + $chunk = implode('', $chunk); + } + + return $chunks; + } + + public static function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array + { + if (null === $quot = \bcdiv($num1, $num2, 0)) { + return null; + } + $scale = $scale ?? (\PHP_VERSION_ID >= 70300 ? \bcscale() : (ini_get('bcmath.scale') ?: 0)); + + return [$quot, \bcmod($num1, $num2, $scale)]; + } +} diff --git a/plugins/vendor/symfony/polyfill-php84/README.md b/plugins/vendor/symfony/polyfill-php84/README.md new file mode 100644 index 00000000..15445c6d --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/README.md @@ -0,0 +1,22 @@ +Symfony Polyfill / Php84 +======================== + +This component provides features added to PHP 8.4 core: + +- [`array_find`, `array_find_key`, `array_any` and `array_all`](https://wiki.php.net/rfc/array_find) +- [`bcdivmod`](https://wiki.php.net/rfc/add_bcdivmod_to_bcmath) +- [`Deprecated`](https://wiki.php.net/rfc/deprecated_attribute) +- `CURL_HTTP_VERSION_3` and `CURL_HTTP_VERSION_3ONLY` constants +- [`fpow`](https://wiki.php.net/rfc/raising_zero_to_power_of_negative_number) +- [`grapheme_str_split`](https://wiki.php.net/rfc/grapheme_str_split) +- [`mb_trim`, `mb_ltrim` and `mb_rtrim`](https://wiki.php.net/rfc/mb_trim) +- [`mb_ucfirst` and `mb_lcfirst`](https://wiki.php.net/rfc/mb_ucfirst) +- [`ReflectionConstant`](https://github.com/php/php-src/pull/13669) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/plugins/vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php b/plugins/vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php new file mode 100644 index 00000000..f3e6a4f8 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/Resources/stubs/Deprecated.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80400) { + #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION | Attribute::TARGET_CLASS_CONSTANT)] + final class Deprecated + { + public readonly ?string $message; + public readonly ?string $since; + + public function __construct(?string $message = null, ?string $since = null) + { + $this->message = $message; + $this->since = $since; + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php b/plugins/vendor/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php new file mode 100644 index 00000000..f4c8448b --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/Resources/stubs/ReflectionConstant.php @@ -0,0 +1,158 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80400) { + /** + * @author Daniel Scherzer + */ + final class ReflectionConstant + { + /** + * @var string + * + * @readonly + */ + public $name; + + private $value; + private $deprecated; + + private static $persistentConstants = []; + + public function __construct(string $name) + { + if (!defined($name) || false !== strpos($name, '::')) { + throw new ReflectionException("Constant \"$name\" does not exist"); + } + + $this->name = ltrim($name, '\\'); + $deprecated = false; + $eh = set_error_handler(static function ($type, $msg, $file, $line) use ($name, &$deprecated, &$eh) { + if (\E_DEPRECATED === $type && "Constant $name is deprecated" === $msg) { + return $deprecated = true; + } + + return $eh && $eh($type, $msg, $file, $line); + }); + + try { + $this->value = constant($name); + $this->deprecated = $deprecated; + } finally { + restore_error_handler(); + } + } + + public function getName(): string + { + return $this->name; + } + + public function getValue() + { + return $this->value; + } + + public function getNamespaceName(): string + { + if (false === $slashPos = strrpos($this->name, '\\')) { + return ''; + } + + return substr($this->name, 0, $slashPos); + } + + public function getShortName(): string + { + if (false === $slashPos = strrpos($this->name, '\\')) { + return $this->name; + } + + return substr($this->name, $slashPos + 1); + } + + public function isDeprecated(): bool + { + return $this->deprecated; + } + + public function __toString(): string + { + // A constant is persistent if provided by PHP itself rather than + // being defined by users. If we got here, we know that it *is* + // defined, so we just need to figure out if it is defined by the + // user or not + if (!self::$persistentConstants) { + $persistentConstants = get_defined_constants(true); + unset($persistentConstants['user']); + foreach ($persistentConstants as $constants) { + self::$persistentConstants += $constants; + } + } + $persistent = array_key_exists($this->name, self::$persistentConstants); + + // Can't match the inclusion of `no_file_cache` but the rest is + // possible to match + $result = 'Constant [ '; + if ($persistent || $this->deprecated) { + $result .= '<'; + if ($persistent) { + $result .= 'persistent'; + if ($this->deprecated) { + $result .= ', '; + } + } + if ($this->deprecated) { + $result .= 'deprecated'; + } + $result .= '> '; + } + // Cannot just use gettype() to match zend_zval_type_name() + if (is_object($this->value)) { + $result .= \PHP_VERSION_ID >= 80000 ? get_debug_type($this->value) : gettype($this->value); + } elseif (is_bool($this->value)) { + $result .= 'bool'; + } elseif (is_int($this->value)) { + $result .= 'int'; + } elseif (is_float($this->value)) { + $result .= 'float'; + } elseif (null === $this->value) { + $result .= 'null'; + } else { + $result .= gettype($this->value); + } + $result .= ' '; + $result .= $this->name; + $result .= ' ] { '; + if (is_array($this->value)) { + $result .= 'Array'; + } else { + // This will throw an exception if the value is an object that + // cannot be converted to string; that is expected and matches + // the behavior of zval_get_string_func() + $result .= (string) $this->value; + } + $result .= " }\n"; + + return $result; + } + + public function __sleep(): array + { + throw new Exception("Serialization of 'ReflectionConstant' is not allowed"); + } + + public function __wakeup(): void + { + throw new Exception("Unserialization of 'ReflectionConstant' is not allowed"); + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php84/bootstrap.php b/plugins/vendor/symfony/polyfill-php84/bootstrap.php new file mode 100644 index 00000000..4bd1c17d --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/bootstrap.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php84 as p; + +if (\PHP_VERSION_ID >= 80400) { + return; +} + +if (defined('CURL_VERSION_HTTP3') || PHP_VERSION_ID < 80200 && function_exists('curl_version') && curl_version()['version'] >= 0x074200) { // libcurl >= 7.66.0 + if (!defined('CURL_HTTP_VERSION_3')) { + define('CURL_HTTP_VERSION_3', 30); + } + + if (!defined('CURL_HTTP_VERSION_3ONLY') && defined('CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256')) { // libcurl >= 7.80.0 (7.88 would be better but is slow to check) + define('CURL_HTTP_VERSION_3ONLY', 31); + } +} + +if (!function_exists('array_find')) { + function array_find(array $array, callable $callback) { return p\Php84::array_find($array, $callback); } +} + +if (!function_exists('array_find_key')) { + function array_find_key(array $array, callable $callback) { return p\Php84::array_find_key($array, $callback); } +} + +if (!function_exists('array_any')) { + function array_any(array $array, callable $callback): bool { return p\Php84::array_any($array, $callback); } +} + +if (!function_exists('array_all')) { + function array_all(array $array, callable $callback): bool { return p\Php84::array_all($array, $callback); } +} + +if (!function_exists('fpow')) { + function fpow(float $num, float $exponent): float { return p\Php84::fpow($num, $exponent); } +} + +if (extension_loaded('mbstring')) { + if (!function_exists('mb_ucfirst')) { + function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_ucfirst($string, $encoding); } + } + + if (!function_exists('mb_lcfirst')) { + function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Php84::mb_lcfirst($string, $encoding); } + } + + if (!function_exists('mb_trim')) { + function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim($string, $characters, $encoding); } + } + + if (!function_exists('mb_ltrim')) { + function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim($string, $characters, $encoding); } + } + + if (!function_exists('mb_rtrim')) { + function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim($string, $characters, $encoding); } + } +} + +if (extension_loaded('bcmath')) { + if (!function_exists('bcdivmod')) { + function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array { return p\Php84::bcdivmod($num1, $num2, $scale); } + } +} + +if (\PHP_VERSION_ID >= 80200) { + return require __DIR__.'/bootstrap82.php'; +} + +if (extension_loaded('intl') && !function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1) { return p\Php84::grapheme_str_split($string, $length); } +} diff --git a/plugins/vendor/symfony/polyfill-php84/bootstrap82.php b/plugins/vendor/symfony/polyfill-php84/bootstrap82.php new file mode 100644 index 00000000..216ad021 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/bootstrap82.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php84 as p; + +if (\PHP_VERSION_ID >= 80400) { + return; +} + +if (extension_loaded('intl') && !function_exists('grapheme_str_split')) { + function grapheme_str_split(string $string, int $length = 1): array|false { return p\Php84::grapheme_str_split($string, $length); } +} diff --git a/plugins/vendor/symfony/polyfill-php84/composer.json b/plugins/vendor/symfony/polyfill-php84/composer.json new file mode 100644 index 00000000..8bbc2812 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php84/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/polyfill-php84", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php84\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php85/LICENSE b/plugins/vendor/symfony/polyfill-php85/LICENSE new file mode 100644 index 00000000..bc38d714 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2025-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/polyfill-php85/Php85.php b/plugins/vendor/symfony/polyfill-php85/Php85.php new file mode 100644 index 00000000..b6619d5b --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/Php85.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php85; + +/** + * @author Pierre Ambroise + * + * @internal + */ +final class Php85 +{ + public static function get_error_handler(): ?callable + { + $handler = set_error_handler(null); + restore_error_handler(); + + return $handler; + } + + public static function get_exception_handler(): ?callable + { + $handler = set_exception_handler(null); + restore_exception_handler(); + + return $handler; + } + + public static function array_first(array $array) + { + foreach ($array as $value) { + return $value; + } + + return null; + } + + public static function array_last(array $array) + { + return $array ? current(array_slice($array, -1)) : null; + } +} diff --git a/plugins/vendor/symfony/polyfill-php85/README.md b/plugins/vendor/symfony/polyfill-php85/README.md new file mode 100644 index 00000000..a374d9e2 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/README.md @@ -0,0 +1,16 @@ +Symfony Polyfill / Php85 +======================== + +This component provides features added to PHP 8.5 core: + +- [`get_error_handler` and `get_exception_handler`](https://wiki.php.net/rfc/get-error-exception-handler) +- [`NoDiscard`](https://wiki.php.net/rfc/marking_return_value_as_important) +- [`array_first` and `array_last`](https://wiki.php.net/rfc/array_first_last) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/plugins/vendor/symfony/polyfill-php85/Resources/stubs/NoDiscard.php b/plugins/vendor/symfony/polyfill-php85/Resources/stubs/NoDiscard.php new file mode 100644 index 00000000..bc2c36d9 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/Resources/stubs/NoDiscard.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80500) { + #[Attribute(Attribute::TARGET_METHOD | Attribute::TARGET_FUNCTION)] + final class NoDiscard + { + public ?string $message; + + public function __construct(?string $message = null) + { + $this->message = $message; + } + } +} diff --git a/plugins/vendor/symfony/polyfill-php85/bootstrap.php b/plugins/vendor/symfony/polyfill-php85/bootstrap.php new file mode 100644 index 00000000..44e872b1 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/bootstrap.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php85 as p; + +if (\PHP_VERSION_ID >= 80500) { + return; +} + +if (!function_exists('get_error_handler')) { + function get_error_handler(): ?callable { return p\Php85::get_error_handler(); } +} + +if (!function_exists('get_exception_handler')) { + function get_exception_handler(): ?callable { return p\Php85::get_exception_handler(); } +} + +if (!function_exists('array_first')) { + function array_first(array $array) { return p\Php85::array_first($array); } +} + +if (!function_exists('array_last')) { + function array_last(array $array) { return p\Php85::array_last($array); } +} diff --git a/plugins/vendor/symfony/polyfill-php85/composer.json b/plugins/vendor/symfony/polyfill-php85/composer.json new file mode 100644 index 00000000..ef0ec8d1 --- /dev/null +++ b/plugins/vendor/symfony/polyfill-php85/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/polyfill-php85", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php85\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/plugins/vendor/symfony/translation-contracts/CHANGELOG.md b/plugins/vendor/symfony/translation-contracts/CHANGELOG.md new file mode 100644 index 00000000..7932e261 --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/CHANGELOG.md @@ -0,0 +1,5 @@ +CHANGELOG +========= + +The changelog is maintained for all Symfony contracts at the following URL: +https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/plugins/vendor/symfony/translation-contracts/LICENSE b/plugins/vendor/symfony/translation-contracts/LICENSE new file mode 100644 index 00000000..7536caea --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/translation-contracts/LocaleAwareInterface.php b/plugins/vendor/symfony/translation-contracts/LocaleAwareInterface.php new file mode 100644 index 00000000..db40ba13 --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/LocaleAwareInterface.php @@ -0,0 +1,29 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +interface LocaleAwareInterface +{ + /** + * Sets the current locale. + * + * @return void + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function setLocale(string $locale); + + /** + * Returns the current locale. + */ + public function getLocale(): string; +} diff --git a/plugins/vendor/symfony/translation-contracts/README.md b/plugins/vendor/symfony/translation-contracts/README.md new file mode 100644 index 00000000..b211d584 --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/README.md @@ -0,0 +1,9 @@ +Symfony Translation Contracts +============================= + +A set of abstractions extracted out of the Symfony components. + +Can be used to build on semantics that the Symfony components proved useful and +that already have battle tested implementations. + +See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/plugins/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/plugins/vendor/symfony/translation-contracts/Test/TranslatorTest.php new file mode 100644 index 00000000..da19d09b --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -0,0 +1,398 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation\Test; + +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\RequiresPhpExtension; +use PHPUnit\Framework\TestCase; +use Symfony\Contracts\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorTrait; + +/** + * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms + * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms. + * + * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. + * The mozilla code is also interesting to check for. + * + * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 + * + * The goal to cover all languages is to far fetched so this test case is smaller. + * + * @author Clemens Tolboom clemens@build2be.nl + */ +class TranslatorTest extends TestCase +{ + private string $defaultLocale; + + protected function setUp(): void + { + $this->defaultLocale = \Locale::getDefault(); + \Locale::setDefault('en'); + } + + protected function tearDown(): void + { + \Locale::setDefault($this->defaultLocale); + } + + public function getTranslator(): TranslatorInterface + { + return new class implements TranslatorInterface { + use TranslatorTrait; + }; + } + + /** + * @dataProvider getTransTests + */ + #[DataProvider('getTransTests')] + public function testTrans($expected, $id, $parameters) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, $parameters)); + } + + /** + * @dataProvider getTransChoiceTests + */ + #[DataProvider('getTransChoiceTests')] + public function testTransChoiceWithExplicitLocale($expected, $id, $number) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + /** + * @requires extension intl + * + * @dataProvider getTransChoiceTests + */ + #[DataProvider('getTransChoiceTests')] + #[RequiresPhpExtension('intl')] + public function testTransChoiceWithDefaultLocale($expected, $id, $number) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + /** + * @dataProvider getTransChoiceTests + */ + #[DataProvider('getTransChoiceTests')] + public function testTransChoiceWithEnUsPosix($expected, $id, $number) + { + $translator = $this->getTranslator(); + $translator->setLocale('en_US_POSIX'); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number])); + } + + public function testGetSetLocale() + { + $translator = $this->getTranslator(); + + $this->assertEquals('en', $translator->getLocale()); + } + + /** + * @requires extension intl + */ + #[RequiresPhpExtension('intl')] + public function testGetLocaleReturnsDefaultLocaleIfNotSet() + { + $translator = $this->getTranslator(); + + \Locale::setDefault('pt_BR'); + $this->assertEquals('pt_BR', $translator->getLocale()); + + \Locale::setDefault('en'); + $this->assertEquals('en', $translator->getLocale()); + } + + public static function getTransTests() + { + return [ + ['Symfony is great!', 'Symfony is great!', []], + ['Symfony is awesome!', 'Symfony is %what%!', ['%what%' => 'awesome']], + ]; + } + + public static function getTransChoiceTests() + { + return [ + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + ['There are 0 apples', 'There is 1 apple|There are %count% apples', 0], + ['There is 1 apple', 'There is 1 apple|There are %count% apples', 1], + ['There are 10 apples', 'There is 1 apple|There are %count% apples', 10], + // custom validation messages may be coded with a fixed value + ['There are 2 apples', 'There are 2 apples', 2], + ]; + } + + /** + * @dataProvider getInterval + */ + #[DataProvider('getInterval')] + public function testInterval($expected, $number, $interval) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($interval.' foo|[1,Inf[ bar', ['%count%' => $number])); + } + + public static function getInterval() + { + return [ + ['foo', 3, '{1,2, 3 ,4}'], + ['bar', 10, '{1,2, 3 ,4}'], + ['bar', 3, '[1,2]'], + ['foo', 1, '[1,2]'], + ['foo', 2, '[1,2]'], + ['bar', 1, ']1,2['], + ['bar', 2, ']1,2['], + ['foo', log(0), '[-Inf,2['], + ['foo', -log(0), '[-2,+Inf]'], + ]; + } + + /** + * @dataProvider getChooseTests + */ + #[DataProvider('getChooseTests')] + public function testChoose($expected, $id, $number, $locale = null) + { + $translator = $this->getTranslator(); + + $this->assertEquals($expected, $translator->trans($id, ['%count%' => $number], null, $locale)); + } + + public function testReturnMessageIfExactlyOneStandardRuleIsGiven() + { + $translator = $this->getTranslator(); + + $this->assertEquals('There are two apples', $translator->trans('There are two apples', ['%count%' => 2])); + } + + /** + * @dataProvider getNonMatchingMessages + */ + #[DataProvider('getNonMatchingMessages')] + public function testThrowExceptionIfMatchingMessageCannotBeFound($id, $number) + { + $translator = $this->getTranslator(); + + $this->expectException(\InvalidArgumentException::class); + + $translator->trans($id, ['%count%' => $number]); + } + + public static function getNonMatchingMessages() + { + return [ + ['{0} There are no apples|{1} There is one apple', 2], + ['{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['{1} There is one apple|]2,Inf] There are %count% apples', 2], + ['{0} There are no apples|There is one apple', 2], + ]; + } + + public static function getChooseTests() + { + return [ + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There are no apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['There are no apples', '{0}There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 0], + + ['There is one apple', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 1], + + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf]There are %count% apples', 10], + ['There are 10 apples', '{0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples', 10], + + ['There are 0 apples', 'There is one apple|There are %count% apples', 0], + ['There is one apple', 'There is one apple|There are %count% apples', 1], + ['There are 10 apples', 'There is one apple|There are %count% apples', 10], + + ['There are 0 apples', 'one: There is one apple|more: There are %count% apples', 0], + ['There is one apple', 'one: There is one apple|more: There are %count% apples', 1], + ['There are 10 apples', 'one: There is one apple|more: There are %count% apples', 10], + + ['There are no apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 0], + ['There is one apple', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 1], + ['There are 10 apples', '{0} There are no apples|one: There is one apple|more: There are %count% apples', 10], + + ['', '{0}|{1} There is one apple|]1,Inf] There are %count% apples', 0], + ['', '{0} There are no apples|{1}|]1,Inf] There are %count% apples', 1], + + // Indexed only tests which are Gettext PoFile* compatible strings. + ['There are 0 apples', 'There is one apple|There are %count% apples', 0], + ['There is one apple', 'There is one apple|There are %count% apples', 1], + ['There are 2 apples', 'There is one apple|There are %count% apples', 2], + + // Tests for float numbers + ['There is almost one apple', '{0} There are no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7], + ['There is one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1], + ['There is more than one apple', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7], + ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], + ['There are no apples', '{0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0], + ['There are no apples', '{0.0} There are no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0], + + // Test texts with new-lines + // with double-quotes and \n in id & double-quotes and actual newlines in text + ["This is a text with a\n new-line in it. Selector = 0.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 0], + // with double-quotes and \n in id and single-quotes and actual newlines in text + ["This is a text with a\n new-line in it. Selector = 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1], + ["This is a text with a\n new-line in it. Selector > 1.", '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5], + // with double-quotes and id split across lines + ['This is a text with a + new-line in it. Selector = 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 1], + // with single-quotes and id split across lines + ['This is a text with a + new-line in it. Selector > 1.', '{0}This is a text with a + new-line in it. Selector = 0.|{1}This is a text with a + new-line in it. Selector = 1.|[1,Inf]This is a text with a + new-line in it. Selector > 1.', 5], + // with single-quotes and \n in text + ['This is a text with a\nnew-line in it. Selector = 0.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0], + // with double-quotes and id split across lines + ["This is a text with a\nnew-line in it. Selector = 1.", "{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.", 1], + // escape pipe + ['This is a text with | in it. Selector = 0.', '{0}This is a text with || in it. Selector = 0.|{1}This is a text with || in it. Selector = 1.', 0], + // Empty plural set (2 plural forms) from a .PO file + ['', '|', 1], + // Empty plural set (3 plural forms) from a .PO file + ['', '||', 1], + + // Floating values + ['1.5 liters', '%count% liter|%count% liters', 1.5], + ['1.5 litre', '%count% litre|%count% litres', 1.5, 'fr'], + + // Negative values + ['-1 degree', '%count% degree|%count% degrees', -1], + ['-1 degré', '%count% degré|%count% degrés', -1], + ['-1.5 degrees', '%count% degree|%count% degrees', -1.5], + ['-1.5 degré', '%count% degré|%count% degrés', -1.5, 'fr'], + ['-2 degrees', '%count% degree|%count% degrees', -2], + ['-2 degrés', '%count% degré|%count% degrés', -2], + ]; + } + + /** + * @dataProvider failingLangcodes + */ + #[DataProvider('failingLangcodes')] + public function testFailedLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix, false); + } + + /** + * @dataProvider successLangcodes + */ + #[DataProvider('successLangcodes')] + public function testLangcodes($nplural, $langCodes) + { + $matrix = $this->generateTestData($langCodes); + $this->validateMatrix($nplural, $matrix); + } + + /** + * This array should contain all currently known langcodes. + * + * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. + */ + public static function successLangcodes(): array + { + return [ + ['1', ['ay', 'bo', 'cgg', 'dz', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky']], + ['2', ['nl', 'fr', 'en', 'de', 'de_GE', 'hy', 'hy_AM', 'en_US_POSIX']], + ['3', ['be', 'bs', 'cs', 'hr']], + ['4', ['cy', 'mt', 'sl']], + ['6', ['ar']], + ]; + } + + /** + * This array should be at least empty within the near future. + * + * This both depends on a complete list trying to add above as understanding + * the plural rules of the current failing languages. + * + * @return array with nplural together with langcodes + */ + public static function failingLangcodes(): array + { + return [ + ['1', ['fa']], + ['2', ['jbo']], + ['3', ['cbs']], + ['4', ['gd', 'kw']], + ['5', ['ga']], + ]; + } + + /** + * We validate only on the plural coverage. Thus the real rules is not tested. + * + * @param string $nplural Plural expected + * @param array $matrix Containing langcodes and their plural index values + */ + protected function validateMatrix(string $nplural, array $matrix, bool $expectSuccess = true) + { + foreach ($matrix as $langCode => $data) { + $indexes = array_flip($data); + if ($expectSuccess) { + $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); + } else { + $this->assertNotCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); + } + } + } + + protected function generateTestData($langCodes) + { + $translator = new class { + use TranslatorTrait { + getPluralizationRule as public; + } + }; + + $matrix = []; + foreach ($langCodes as $langCode) { + for ($count = 0; $count < 200; ++$count) { + $plural = $translator->getPluralizationRule($count, $langCode); + $matrix[$langCode][$count] = $plural; + } + } + + return $matrix; + } +} diff --git a/plugins/vendor/symfony/translation-contracts/TranslatableInterface.php b/plugins/vendor/symfony/translation-contracts/TranslatableInterface.php new file mode 100644 index 00000000..8554697e --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/TranslatableInterface.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +/** + * @author Nicolas Grekas + */ +interface TranslatableInterface +{ + public function trans(TranslatorInterface $translator, ?string $locale = null): string; +} diff --git a/plugins/vendor/symfony/translation-contracts/TranslatorInterface.php b/plugins/vendor/symfony/translation-contracts/TranslatorInterface.php new file mode 100644 index 00000000..7fa69878 --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/TranslatorInterface.php @@ -0,0 +1,68 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +/** + * @author Fabien Potencier + */ +interface TranslatorInterface +{ + /** + * Translates the given message. + * + * When a number is provided as a parameter named "%count%", the message is parsed for plural + * forms and a translation is chosen according to this number using the following rules: + * + * Given a message with different plural translations separated by a + * pipe (|), this method returns the correct portion of the message based + * on the given number, locale and the pluralization rules in the message + * itself. + * + * The message supports two different types of pluralization rules: + * + * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples + * indexed: There is one apple|There are %count% apples + * + * The indexed solution can also contain labels (e.g. one: There is one apple). + * This is purely for making the translations more clear - it does not + * affect the functionality. + * + * The two methods can also be mixed: + * {0} There are no apples|one: There is one apple|more: There are %count% apples + * + * An interval can represent a finite set of numbers: + * {1,2,3,4} + * + * An interval can represent numbers between two numbers: + * [1, +Inf] + * ]-1,2[ + * + * The left delimiter can be [ (inclusive) or ] (exclusive). + * The right delimiter can be [ (exclusive) or ] (inclusive). + * Beside numbers, you can use -Inf and +Inf for the infinite. + * + * @see https://en.wikipedia.org/wiki/ISO_31-11 + * + * @param string $id The message id (may also be an object that can be cast to string) + * @param array $parameters An array of parameters for the message + * @param string|null $domain The domain for the message or null to use the default + * @param string|null $locale The locale or null to use the default + * + * @throws \InvalidArgumentException If the locale contains invalid characters + */ + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string; + + /** + * Returns the default locale. + */ + public function getLocale(): string; +} diff --git a/plugins/vendor/symfony/translation-contracts/TranslatorTrait.php b/plugins/vendor/symfony/translation-contracts/TranslatorTrait.php new file mode 100644 index 00000000..06210b0e --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/TranslatorTrait.php @@ -0,0 +1,225 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Contracts\Translation; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; + +/** + * A trait to help implement TranslatorInterface and LocaleAwareInterface. + * + * @author Fabien Potencier + */ +trait TranslatorTrait +{ + private ?string $locale = null; + + /** + * @return void + */ + public function setLocale(string $locale) + { + $this->locale = $locale; + } + + public function getLocale(): string + { + return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); + } + + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + if (null === $id || '' === $id) { + return ''; + } + + if (!isset($parameters['%count%']) || !is_numeric($parameters['%count%'])) { + return strtr($id, $parameters); + } + + $number = (float) $parameters['%count%']; + $locale = $locale ?: $this->getLocale(); + + $parts = []; + if (preg_match('/^\|++$/', $id)) { + $parts = explode('|', $id); + } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { + $parts = $matches[0]; + } + + $intervalRegexp = <<<'EOF' +/^(?P + ({\s* + (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) + \s*}) + + | + + (?P[\[\]]) + \s* + (?P-Inf|\-?\d+(\.\d+)?) + \s*,\s* + (?P\+?Inf|\-?\d+(\.\d+)?) + \s* + (?P[\[\]]) +)\s*(?P.*?)$/xs +EOF; + + $standardRules = []; + foreach ($parts as $part) { + $part = trim(str_replace('||', '|', $part)); + + // try to match an explicit rule, then fallback to the standard ones + if (preg_match($intervalRegexp, $part, $matches)) { + if ($matches[2]) { + foreach (explode(',', $matches[3]) as $n) { + if ($number == $n) { + return strtr($matches['message'], $parameters); + } + } + } else { + $leftNumber = '-Inf' === $matches['left'] ? -\INF : (float) $matches['left']; + $rightNumber = is_numeric($matches['right']) ? (float) $matches['right'] : \INF; + + if (('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) + && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) + ) { + return strtr($matches['message'], $parameters); + } + } + } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { + $standardRules[] = $matches[1]; + } else { + $standardRules[] = $part; + } + } + + $position = $this->getPluralizationRule($number, $locale); + + if (!isset($standardRules[$position])) { + // when there's exactly one rule given, and that rule is a standard + // rule, use this rule + if (1 === \count($parts) && isset($standardRules[0])) { + return strtr($standardRules[0], $parameters); + } + + $message = \sprintf('Unable to choose a translation for "%s" with locale "%s" for value "%d". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $id, $locale, $number); + + if (class_exists(InvalidArgumentException::class)) { + throw new InvalidArgumentException($message); + } + + throw new \InvalidArgumentException($message); + } + + return strtr($standardRules[$position], $parameters); + } + + /** + * Returns the plural position to use for the given locale and number. + * + * The plural rules are derived from code of the Zend Framework (2010-09-25), + * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). + * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + */ + private function getPluralizationRule(float $number, string $locale): int + { + $number = abs($number); + + return match ('pt_BR' !== $locale && 'en_US_POSIX' !== $locale && \strlen($locale) > 3 ? substr($locale, 0, strrpos($locale, '_')) : $locale) { + 'af', + 'bn', + 'bg', + 'ca', + 'da', + 'de', + 'el', + 'en', + 'en_US_POSIX', + 'eo', + 'es', + 'et', + 'eu', + 'fa', + 'fi', + 'fo', + 'fur', + 'fy', + 'gl', + 'gu', + 'ha', + 'he', + 'hu', + 'is', + 'it', + 'ku', + 'lb', + 'ml', + 'mn', + 'mr', + 'nah', + 'nb', + 'ne', + 'nl', + 'nn', + 'no', + 'oc', + 'om', + 'or', + 'pa', + 'pap', + 'ps', + 'pt', + 'so', + 'sq', + 'sv', + 'sw', + 'ta', + 'te', + 'tk', + 'ur', + 'zu' => (1 == $number) ? 0 : 1, + 'am', + 'bh', + 'fil', + 'fr', + 'gun', + 'hi', + 'hy', + 'ln', + 'mg', + 'nso', + 'pt_BR', + 'ti', + 'wa' => ($number < 2) ? 0 : 1, + 'be', + 'bs', + 'hr', + 'ru', + 'sh', + 'sr', + 'uk' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), + 'cs', + 'sk' => (1 == $number) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2), + 'ga' => (1 == $number) ? 0 : ((2 == $number) ? 1 : 2), + 'lt' => ((1 == $number % 10) && (11 != $number % 100)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2), + 'sl' => (1 == $number % 100) ? 0 : ((2 == $number % 100) ? 1 : (((3 == $number % 100) || (4 == $number % 100)) ? 2 : 3)), + 'mk' => (1 == $number % 10) ? 0 : 1, + 'mt' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)), + 'lv' => (0 == $number) ? 0 : (((1 == $number % 10) && (11 != $number % 100)) ? 1 : 2), + 'pl' => (1 == $number) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2), + 'cy' => (1 == $number) ? 0 : ((2 == $number) ? 1 : (((8 == $number) || (11 == $number)) ? 2 : 3)), + 'ro' => (1 == $number) ? 0 : (((0 == $number) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2), + 'ar' => (0 == $number) ? 0 : ((1 == $number) ? 1 : ((2 == $number) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : 5)))), + default => 0, + }; + } +} diff --git a/plugins/vendor/symfony/translation-contracts/composer.json b/plugins/vendor/symfony/translation-contracts/composer.json new file mode 100644 index 00000000..b7220b84 --- /dev/null +++ b/plugins/vendor/symfony/translation-contracts/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/translation-contracts", + "type": "library", + "description": "Generic abstractions related to translation", + "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.1" + }, + "autoload": { + "psr-4": { "Symfony\\Contracts\\Translation\\": "" }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "3.6-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + } +} diff --git a/plugins/vendor/symfony/translation/CHANGELOG.md b/plugins/vendor/symfony/translation/CHANGELOG.md new file mode 100644 index 00000000..365c5cf1 --- /dev/null +++ b/plugins/vendor/symfony/translation/CHANGELOG.md @@ -0,0 +1,235 @@ +CHANGELOG +========= + +7.3 +--- + + * Add `Translator::addGlobalParameter()` to allow defining global translation parameters + +7.2 +--- + + * Deprecate `ProviderFactoryTestCase`, extend `AbstractProviderFactoryTestCase` instead + + The `testIncompleteDsnException()` test is no longer provided by default. If you make use of it by implementing the `incompleteDsnProvider()` data providers, + you now need to use the `IncompleteDsnTestTrait`. + + * Make `ProviderFactoryTestCase` and `ProviderTestCase` compatible with PHPUnit 10+ + * Add `lint:translations` command + * Deprecate passing an escape character to `CsvFileLoader::setCsvControl()` + * Make Xliff 2.0 attributes in segment element available as `segment-attributes` + metadata returned by `XliffFileLoader` and make `XliffFileDumper` write them to the file + +7.1 +--- + + * Mark class `DataCollectorTranslator` as `final` + +7.0 +--- + + * Remove `PhpStringTokenParser` + * Remove `PhpExtractor` in favor of `PhpAstExtractor` + +6.4 +--- + + * Give current locale to `LocaleSwitcher::runWithLocale()`'s callback + * Add `--as-tree` option to `translation:pull` command to write YAML messages as a tree-like structure + * [BC BREAK] Add argument `$buildDir` to `DataCollectorTranslator::warmUp()` + * Add `DataCollectorTranslatorPass` and `LoggingTranslatorPass` (moved from `FrameworkBundle`) + * Add `PhraseTranslationProvider` + +6.2.7 +----- + + * [BC BREAK] The following data providers for `ProviderFactoryTestCase` are now static: + `supportsProvider()`, `createProvider()`, `unsupportedSchemeProvider()`and `incompleteDsnProvider()` + * [BC BREAK] `ProviderTestCase::toStringProvider()` is now static + +6.2 +--- + + * Deprecate `PhpStringTokenParser` + * Deprecate `PhpExtractor` in favor of `PhpAstExtractor` + * Add `PhpAstExtractor` (requires [nikic/php-parser](https://github.com/nikic/php-parser) to be installed) + +6.1 +--- + + * Parameters implementing `TranslatableInterface` are processed + * Add the file extension to the `XliffFileDumper` constructor + +5.4 +--- + + * Add `github` format & autodetection to render errors as annotations when + running the XLIFF linter command in a Github Actions environment. + * Translation providers are not experimental anymore + +5.3 +--- + + * Add `translation:pull` and `translation:push` commands to manage translations with third-party providers + * Add `TranslatorBagInterface::getCatalogues` method + * Add support to load XLIFF string in `XliffFileLoader` + +5.2.0 +----- + + * added support for calling `trans` with ICU formatted messages + * added `PseudoLocalizationTranslator` + * added `TranslatableMessage` objects that represent a message that can be translated + * added the `t()` function to easily create `TranslatableMessage` objects + * Added support for extracting messages from `TranslatableMessage` objects + +5.1.0 +----- + + * added support for `name` attribute on `unit` element from xliff2 to be used as a translation key instead of always the `source` element + +5.0.0 +----- + + * removed support for using `null` as the locale in `Translator` + * removed `TranslatorInterface` + * removed `MessageSelector` + * removed `ChoiceMessageFormatterInterface` + * removed `PluralizationRule` + * removed `Interval` + * removed `transChoice()` methods, use the trans() method instead with a %count% parameter + * removed `FileDumper::setBackup()` and `TranslationWriter::disableBackup()` + * removed `MessageFormatter::choiceFormat()` + * added argument `$filename` to `PhpExtractor::parseTokens()` + * removed support for implicit STDIN usage in the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. + +4.4.0 +----- + + * deprecated support for using `null` as the locale in `Translator` + * deprecated accepting STDIN implicitly when using the `lint:xliff` command, use `lint:xliff -` (append a dash) instead to make it explicit. + * Marked the `TranslationDataCollector` class as `@final`. + +4.3.0 +----- + + * Improved Xliff 1.2 loader to load the original file's metadata + * Added `TranslatorPathsPass` + +4.2.0 +----- + + * Started using ICU parent locales as fallback locales. + * allow using the ICU message format using domains with the "+intl-icu" suffix + * deprecated `Translator::transChoice()` in favor of using `Translator::trans()` with a `%count%` parameter + * deprecated `TranslatorInterface` in favor of `Symfony\Contracts\Translation\TranslatorInterface` + * deprecated `MessageSelector`, `Interval` and `PluralizationRules`; use `IdentityTranslator` instead + * Added `IntlFormatter` and `IntlFormatterInterface` + * added support for multiple files and directories in `XliffLintCommand` + * Marked `Translator::getFallbackLocales()` and `TranslationDataCollector::getFallbackLocales()` as internal + +4.1.0 +----- + + * The `FileDumper::setBackup()` method is deprecated. + * The `TranslationWriter::disableBackup()` method is deprecated. + * The `XliffFileDumper` will write "name" on the "unit" node when dumping XLIFF 2.0. + +4.0.0 +----- + + * removed the backup feature of the `FileDumper` class + * removed `TranslationWriter::writeTranslations()` method + * removed support for passing `MessageSelector` instances to the constructor of the `Translator` class + +3.4.0 +----- + + * Added `TranslationDumperPass` + * Added `TranslationExtractorPass` + * Added `TranslatorPass` + * Added `TranslationReader` and `TranslationReaderInterface` + * Added `` section to the Xliff 2.0 dumper. + * Improved Xliff 2.0 loader to load `` section. + * Added `TranslationWriterInterface` + * Deprecated `TranslationWriter::writeTranslations` in favor of `TranslationWriter::write` + * added support for adding custom message formatter and decoupling the default one. + * Added `PhpExtractor` + * Added `PhpStringTokenParser` + +3.2.0 +----- + + * Added support for escaping `|` in plural translations with double pipe. + +3.1.0 +----- + + * Deprecated the backup feature of the file dumper classes. + +3.0.0 +----- + + * removed `FileDumper::format()` method. + * Changed the visibility of the locale property in `Translator` from protected to private. + +2.8.0 +----- + + * deprecated FileDumper::format(), overwrite FileDumper::formatCatalogue() instead. + * deprecated Translator::getMessages(), rely on TranslatorBagInterface::getCatalogue() instead. + * added `FileDumper::formatCatalogue` which allows format the catalogue without dumping it into file. + * added option `json_encoding` to JsonFileDumper + * added options `as_tree`, `inline` to YamlFileDumper + * added support for XLIFF 2.0. + * added support for XLIFF target and tool attributes. + * added message parameters to DataCollectorTranslator. + * [DEPRECATION] The `DiffOperation` class has been deprecated and + will be removed in Symfony 3.0, since its operation has nothing to do with 'diff', + so the class name is misleading. The `TargetOperation` class should be used for + this use-case instead. + +2.7.0 +----- + + * added DataCollectorTranslator for collecting the translated messages. + +2.6.0 +----- + + * added possibility to cache catalogues + * added TranslatorBagInterface + * added LoggingTranslator + * added Translator::getMessages() for retrieving the message catalogue as an array + +2.5.0 +----- + + * added relative file path template to the file dumpers + * added optional backup to the file dumpers + * changed IcuResFileDumper to extend FileDumper + +2.3.0 +----- + + * added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues) + * added Translator::getFallbackLocales() + * deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method + +2.2.0 +----- + + * QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3. + * [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now + throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found + and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid. + * changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException + (IcuDatFileLoader, IcuResFileLoader and QtFileLoader) + +2.1.0 +----- + + * added support for more than one fallback locale + * added support for extracting translation messages from templates (Twig and PHP) + * added dumpers for translation catalogs + * added support for QT, gettext, and ResourceBundles diff --git a/plugins/vendor/symfony/translation/Catalogue/AbstractOperation.php b/plugins/vendor/symfony/translation/Catalogue/AbstractOperation.php new file mode 100644 index 00000000..4e825a2b --- /dev/null +++ b/plugins/vendor/symfony/translation/Catalogue/AbstractOperation.php @@ -0,0 +1,183 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\LogicException; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Base catalogues binary operation class. + * + * A catalogue binary operation performs operation on + * source (the left argument) and target (the right argument) catalogues. + * + * @author Jean-François Simon + */ +abstract class AbstractOperation implements OperationInterface +{ + public const OBSOLETE_BATCH = 'obsolete'; + public const NEW_BATCH = 'new'; + public const ALL_BATCH = 'all'; + + protected MessageCatalogue $result; + + /** + * This array stores 'all', 'new' and 'obsolete' messages for all valid domains. + * + * The data structure of this array is as follows: + * + * [ + * 'domain 1' => [ + * 'all' => [...], + * 'new' => [...], + * 'obsolete' => [...] + * ], + * 'domain 2' => [ + * 'all' => [...], + * 'new' => [...], + * 'obsolete' => [...] + * ], + * ... + * ] + * + * @var array The array that stores 'all', 'new' and 'obsolete' messages + */ + protected array $messages; + + private array $domains; + + /** + * @throws LogicException + */ + public function __construct( + protected MessageCatalogueInterface $source, + protected MessageCatalogueInterface $target, + ) { + if ($source->getLocale() !== $target->getLocale()) { + throw new LogicException('Operated catalogues must belong to the same locale.'); + } + + $this->result = new MessageCatalogue($source->getLocale()); + $this->messages = []; + } + + public function getDomains(): array + { + if (!isset($this->domains)) { + $domains = []; + foreach ([$this->source, $this->target] as $catalogue) { + foreach ($catalogue->getDomains() as $domain) { + $domains[$domain] = $domain; + + if ($catalogue->all($domainIcu = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX)) { + $domains[$domainIcu] = $domainIcu; + } + } + } + + $this->domains = array_values($domains); + } + + return $this->domains; + } + + public function getMessages(string $domain): array + { + if (!\in_array($domain, $this->getDomains(), true)) { + throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); + } + + if (!isset($this->messages[$domain][self::ALL_BATCH])) { + $this->processDomain($domain); + } + + return $this->messages[$domain][self::ALL_BATCH]; + } + + public function getNewMessages(string $domain): array + { + if (!\in_array($domain, $this->getDomains(), true)) { + throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); + } + + if (!isset($this->messages[$domain][self::NEW_BATCH])) { + $this->processDomain($domain); + } + + return $this->messages[$domain][self::NEW_BATCH]; + } + + public function getObsoleteMessages(string $domain): array + { + if (!\in_array($domain, $this->getDomains(), true)) { + throw new InvalidArgumentException(\sprintf('Invalid domain: "%s".', $domain)); + } + + if (!isset($this->messages[$domain][self::OBSOLETE_BATCH])) { + $this->processDomain($domain); + } + + return $this->messages[$domain][self::OBSOLETE_BATCH]; + } + + public function getResult(): MessageCatalogueInterface + { + foreach ($this->getDomains() as $domain) { + if (!isset($this->messages[$domain])) { + $this->processDomain($domain); + } + } + + return $this->result; + } + + /** + * @param self::*_BATCH $batch + */ + public function moveMessagesToIntlDomainsIfPossible(string $batch = self::ALL_BATCH): void + { + // If MessageFormatter class does not exists, intl domains are not supported. + if (!class_exists(\MessageFormatter::class)) { + return; + } + + foreach ($this->getDomains() as $domain) { + $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + $messages = match ($batch) { + self::OBSOLETE_BATCH => $this->getObsoleteMessages($domain), + self::NEW_BATCH => $this->getNewMessages($domain), + self::ALL_BATCH => $this->getMessages($domain), + default => throw new \InvalidArgumentException(\sprintf('$batch argument must be one of ["%s", "%s", "%s"].', self::ALL_BATCH, self::NEW_BATCH, self::OBSOLETE_BATCH)), + }; + + if (!$messages || (!$this->source->all($intlDomain) && $this->source->all($domain))) { + continue; + } + + $result = $this->getResult(); + $allIntlMessages = $result->all($intlDomain); + $currentMessages = array_diff_key($messages, $result->all($domain)); + $result->replace($currentMessages, $domain); + $result->replace($allIntlMessages + $messages, $intlDomain); + } + } + + /** + * Performs operation on source and target catalogues for the given domain and + * stores the results. + * + * @param string $domain The domain which the operation will be performed for + */ + abstract protected function processDomain(string $domain): void; +} diff --git a/plugins/vendor/symfony/translation/Catalogue/MergeOperation.php b/plugins/vendor/symfony/translation/Catalogue/MergeOperation.php new file mode 100644 index 00000000..e242dbee --- /dev/null +++ b/plugins/vendor/symfony/translation/Catalogue/MergeOperation.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Merge operation between two catalogues as follows: + * all = source ∪ target = {x: x ∈ source ∨ x ∈ target} + * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} + * obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ source ∧ x ∉ target} = ∅ + * Basically, the result contains messages from both catalogues. + * + * @author Jean-François Simon + */ +class MergeOperation extends AbstractOperation +{ + protected function processDomain(string $domain): void + { + $this->messages[$domain] = [ + 'all' => [], + 'new' => [], + 'obsolete' => [], + ]; + $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + + foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $domain)) { + $this->result->setCatalogueMetadata($key, $value, $domain); + } + } + + foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { + $this->result->setCatalogueMetadata($key, $value, $intlDomain); + } + } + + foreach ($this->source->all($domain) as $id => $message) { + $this->messages[$domain]['all'][$id] = $message; + $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; + $this->result->add([$id => $message], $d); + if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { + $this->result->setMetadata($id, $keyMetadata, $d); + } + } + + foreach ($this->target->all($domain) as $id => $message) { + if (!$this->source->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $this->messages[$domain]['new'][$id] = $message; + $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; + $this->result->add([$id => $message], $d); + if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) { + $this->result->setMetadata($id, $keyMetadata, $d); + } + } + } + } +} diff --git a/plugins/vendor/symfony/translation/Catalogue/OperationInterface.php b/plugins/vendor/symfony/translation/Catalogue/OperationInterface.php new file mode 100644 index 00000000..1fe9534e --- /dev/null +++ b/plugins/vendor/symfony/translation/Catalogue/OperationInterface.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Represents an operation on catalogue(s). + * + * An instance of this interface performs an operation on one or more catalogues and + * stores intermediate and final results of the operation. + * + * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and + * the following results are stored: + * + * Messages: also called 'all', are valid messages for the given domain after the operation is performed. + * + * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). + * + * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). + * + * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. + * + * @author Jean-François Simon + */ +interface OperationInterface +{ + /** + * Returns domains affected by operation. + */ + public function getDomains(): array; + + /** + * Returns all valid messages ('all') after operation. + */ + public function getMessages(string $domain): array; + + /** + * Returns new messages ('new') after operation. + */ + public function getNewMessages(string $domain): array; + + /** + * Returns obsolete messages ('obsolete') after operation. + */ + public function getObsoleteMessages(string $domain): array; + + /** + * Returns resulting catalogue ('result'). + */ + public function getResult(): MessageCatalogueInterface; +} diff --git a/plugins/vendor/symfony/translation/Catalogue/TargetOperation.php b/plugins/vendor/symfony/translation/Catalogue/TargetOperation.php new file mode 100644 index 00000000..e3e0878b --- /dev/null +++ b/plugins/vendor/symfony/translation/Catalogue/TargetOperation.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Catalogue; + +use Symfony\Component\Translation\MessageCatalogueInterface; + +/** + * Target operation between two catalogues: + * intersection = source ∩ target = {x: x ∈ source ∧ x ∈ target} + * all = intersection ∪ (target ∖ intersection) = target + * new = all ∖ source = {x: x ∈ target ∧ x ∉ source} + * obsolete = source ∖ all = source ∖ target = {x: x ∈ source ∧ x ∉ target} + * Basically, the result contains messages from the target catalogue. + * + * @author Michael Lee + */ +class TargetOperation extends AbstractOperation +{ + protected function processDomain(string $domain): void + { + $this->messages[$domain] = [ + 'all' => [], + 'new' => [], + 'obsolete' => [], + ]; + $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + + foreach ($this->target->getCatalogueMetadata('', $domain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $domain)) { + $this->result->setCatalogueMetadata($key, $value, $domain); + } + } + + foreach ($this->target->getCatalogueMetadata('', $intlDomain) ?? [] as $key => $value) { + if (null === $this->result->getCatalogueMetadata($key, $intlDomain)) { + $this->result->setCatalogueMetadata($key, $value, $intlDomain); + } + } + + // For 'all' messages, the code can't be simplified as ``$this->messages[$domain]['all'] = $target->all($domain);``, + // because doing so will drop messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} + // + // For 'new' messages, the code can't be simplified as ``array_diff_assoc($this->target->all($domain), $this->source->all($domain));`` + // because doing so will not exclude messages like {x: x ∈ target ∧ x ∉ source.all ∧ x ∈ source.fallback} + // + // For 'obsolete' messages, the code can't be simplified as ``array_diff_assoc($this->source->all($domain), $this->target->all($domain))`` + // because doing so will not exclude messages like {x: x ∈ source ∧ x ∉ target.all ∧ x ∈ target.fallback} + + foreach ($this->source->all($domain) as $id => $message) { + if ($this->target->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain; + $this->result->add([$id => $message], $d); + if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) { + $this->result->setMetadata($id, $keyMetadata, $d); + } + } else { + $this->messages[$domain]['obsolete'][$id] = $message; + } + } + + foreach ($this->target->all($domain) as $id => $message) { + if (!$this->source->has($id, $domain)) { + $this->messages[$domain]['all'][$id] = $message; + $this->messages[$domain]['new'][$id] = $message; + $d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain; + $this->result->add([$id => $message], $d); + if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) { + $this->result->setMetadata($id, $keyMetadata, $d); + } + } + } + } +} diff --git a/plugins/vendor/symfony/translation/CatalogueMetadataAwareInterface.php b/plugins/vendor/symfony/translation/CatalogueMetadataAwareInterface.php new file mode 100644 index 00000000..19965eae --- /dev/null +++ b/plugins/vendor/symfony/translation/CatalogueMetadataAwareInterface.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * This interface is used to get, set, and delete metadata about the Catalogue. + * + * @author Hugo Alliaume + */ +interface CatalogueMetadataAwareInterface +{ + /** + * Gets catalogue metadata for the given domain and key. + * + * Passing an empty domain will return an array with all catalogue metadata indexed by + * domain and then by key. Passing an empty key will return an array with all + * catalogue metadata for the given domain. + * + * @return mixed The value that was set or an array with the domains/keys or null + */ + public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed; + + /** + * Adds catalogue metadata to a message domain. + */ + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'): void; + + /** + * Deletes catalogue metadata for the given key and domain. + * + * Passing an empty domain will delete all catalogue metadata. Passing an empty key will + * delete all metadata for the given domain. + */ + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'): void; +} diff --git a/plugins/vendor/symfony/translation/Command/TranslationLintCommand.php b/plugins/vendor/symfony/translation/Command/TranslationLintCommand.php new file mode 100644 index 00000000..e525fc07 --- /dev/null +++ b/plugins/vendor/symfony/translation/Command/TranslationLintCommand.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Translation\Exception\ExceptionInterface; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * Lint translations files syntax and outputs encountered errors. + * + * @author Hugo Alliaume + */ +#[AsCommand(name: 'lint:translations', description: 'Lint translations files syntax and outputs encountered errors')] +class TranslationLintCommand extends Command +{ + private SymfonyStyle $io; + + public function __construct( + private TranslatorInterface&TranslatorBagInterface $translator, + private array $enabledLocales = [], + ) { + parent::__construct(); + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('locale')) { + $suggestions->suggestValues($this->enabledLocales); + } + } + + protected function configure(): void + { + $this + ->setDefinition([ + new InputOption('locale', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the locales to lint.', $this->enabledLocales), + ]) + ->setHelp(<<<'EOF' +The %command.name% command lint translations. + + php %command.full_name% +EOF + ); + } + + protected function initialize(InputInterface $input, OutputInterface $output): void + { + $this->io = new SymfonyStyle($input, $output); + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $locales = $input->getOption('locale'); + + /** @var array> $errors */ + $errors = []; + $domainsByLocales = []; + + foreach ($locales as $locale) { + $messageCatalogue = $this->translator->getCatalogue($locale); + + foreach ($domainsByLocales[$locale] = $messageCatalogue->getDomains() as $domain) { + foreach ($messageCatalogue->all($domain) as $id => $translation) { + try { + $this->translator->trans($id, [], $domain, $messageCatalogue->getLocale()); + } catch (ExceptionInterface $e) { + $errors[$locale][$domain][$id] = $e; + } + } + } + } + + if (!$domainsByLocales) { + $this->io->error('No translation files were found.'); + + return Command::SUCCESS; + } + + $this->io->table( + ['Locale', 'Domains', 'Valid?'], + array_map( + static fn (string $locale, array $domains) => [ + $locale, + implode(', ', $domains), + !\array_key_exists($locale, $errors) ? 'Yes' : 'No', + ], + array_keys($domainsByLocales), + $domainsByLocales + ), + ); + + if ($errors) { + foreach ($errors as $locale => $domains) { + foreach ($domains as $domain => $domainsErrors) { + $this->io->section(\sprintf('Errors for locale "%s" and domain "%s"', $locale, $domain)); + + foreach ($domainsErrors as $id => $error) { + $this->io->text(\sprintf('Translation key "%s" is invalid:', $id)); + $this->io->error($error->getMessage()); + } + } + } + + return Command::FAILURE; + } + + $this->io->success('All translations are valid.'); + + return Command::SUCCESS; + } +} diff --git a/plugins/vendor/symfony/translation/Command/TranslationPullCommand.php b/plugins/vendor/symfony/translation/Command/TranslationPullCommand.php new file mode 100644 index 00000000..3324bd56 --- /dev/null +++ b/plugins/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -0,0 +1,176 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Translation\Catalogue\TargetOperation; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Provider\TranslationProviderCollection; +use Symfony\Component\Translation\Reader\TranslationReaderInterface; +use Symfony\Component\Translation\Writer\TranslationWriterInterface; + +/** + * @author Mathieu Santostefano + */ +#[AsCommand(name: 'translation:pull', description: 'Pull translations from a given provider.')] +final class TranslationPullCommand extends Command +{ + use TranslationTrait; + + public function __construct( + private TranslationProviderCollection $providerCollection, + private TranslationWriterInterface $writer, + private TranslationReaderInterface $reader, + private string $defaultLocale, + private array $transPaths = [], + private array $enabledLocales = [], + ) { + parent::__construct(); + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providerCollection->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providerCollection->get($input->getArgument('provider')); + + if (method_exists($provider, 'getDomains')) { + $suggestions->suggestValues($provider->getDomains()); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + + return; + } + + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues(['php', 'xlf', 'xlf12', 'xlf20', 'po', 'mo', 'yml', 'yaml', 'ts', 'csv', 'json', 'ini', 'res']); + } + } + + protected function configure(): void + { + $keys = $this->providerCollection->keys(); + $defaultProvider = 1 === \count($keys) ? $keys[0] : null; + + $this + ->setDefinition([ + new InputArgument('provider', null !== $defaultProvider ? InputArgument::OPTIONAL : InputArgument::REQUIRED, 'The provider to pull translations from.', $defaultProvider), + new InputOption('force', null, InputOption::VALUE_NONE, 'Override existing translations with provider ones (it will delete not synchronized messages).'), + new InputOption('intl-icu', null, InputOption::VALUE_NONE, 'Associated to --force option, it will write messages in "%domain%+intl-icu.%locale%.xlf" files.'), + new InputOption('domains', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the domains to pull.'), + new InputOption('locales', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the locales to pull.'), + new InputOption('format', null, InputOption::VALUE_REQUIRED, 'Override the default output format.', 'xlf12'), + new InputOption('as-tree', null, InputOption::VALUE_REQUIRED, 'Write messages as a tree-like structure. Needs --format=yaml. The given value defines the level where to switch to inline YAML'), + ]) + ->setHelp(<<<'EOF' +The %command.name% command pulls translations from the given provider. Only +new translations are pulled, existing ones are not overwritten. + +You can overwrite existing translations (and remove the missing ones on local side) by using the --force flag: + + php %command.full_name% --force provider + +Full example: + + php %command.full_name% provider --force --domains=messages --domains=validators --locales=en + +This command pulls all translations associated with the messages and validators domains for the en locale. +Local translations for the specified domains and locale are deleted if they're not present on the provider and overwritten if it's the case. +Local translations for others domains and locales are ignored. +EOF + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + + $provider = $this->providerCollection->get($input->getArgument('provider')); + $force = $input->getOption('force'); + $intlIcu = $input->getOption('intl-icu'); + $locales = $input->getOption('locales') ?: $this->enabledLocales; + $domains = $input->getOption('domains'); + $format = $input->getOption('format'); + $asTree = (int) $input->getOption('as-tree'); + $xliffVersion = '1.2'; + + if ($intlIcu && !$force) { + $io->note('--intl-icu option only has an effect when used with --force. Here, it will be ignored.'); + } + + switch ($format) { + case 'xlf20': $xliffVersion = '2.0'; + // no break + case 'xlf12': $format = 'xlf'; + } + + $writeOptions = [ + 'path' => end($this->transPaths), + 'xliff_version' => $xliffVersion, + 'default_locale' => $this->defaultLocale, + 'as_tree' => (bool) $asTree, + 'inline' => $asTree, + ]; + + if (!$domains) { + $domains = $provider->getDomains(); + } + + $providerTranslations = $provider->read($domains, $locales); + + if ($force) { + foreach ($providerTranslations->getCatalogues() as $catalogue) { + $operation = new TargetOperation(new MessageCatalogue($catalogue->getLocale()), $catalogue); + if ($intlIcu) { + $operation->moveMessagesToIntlDomainsIfPossible(); + } + $this->writer->write($operation->getResult(), $format, $writeOptions); + } + + $io->success(\sprintf('Local translations has been updated from "%s" (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); + + return 0; + } + + $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths); + + // Append pulled translations to local ones. + $localTranslations->addBag($providerTranslations->diff($localTranslations)); + + foreach ($localTranslations->getCatalogues() as $catalogue) { + $this->writer->write($catalogue, $format, $writeOptions); + } + + $io->success(\sprintf('New translations from "%s" has been written locally (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); + + return 0; + } +} diff --git a/plugins/vendor/symfony/translation/Command/TranslationPushCommand.php b/plugins/vendor/symfony/translation/Command/TranslationPushCommand.php new file mode 100644 index 00000000..7208ca25 --- /dev/null +++ b/plugins/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -0,0 +1,176 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Exception\InvalidArgumentException; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Translation\Provider\FilteringProvider; +use Symfony\Component\Translation\Provider\TranslationProviderCollection; +use Symfony\Component\Translation\Reader\TranslationReaderInterface; +use Symfony\Component\Translation\TranslatorBag; + +/** + * @author Mathieu Santostefano + */ +#[AsCommand(name: 'translation:push', description: 'Push translations to a given provider.')] +final class TranslationPushCommand extends Command +{ + use TranslationTrait; + + public function __construct( + private TranslationProviderCollection $providers, + private TranslationReaderInterface $reader, + private array $transPaths = [], + private array $enabledLocales = [], + ) { + parent::__construct(); + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestArgumentValuesFor('provider')) { + $suggestions->suggestValues($this->providers->keys()); + + return; + } + + if ($input->mustSuggestOptionValuesFor('domains')) { + $provider = $this->providers->get($input->getArgument('provider')); + + if (method_exists($provider, 'getDomains')) { + $domains = $provider->getDomains(); + $suggestions->suggestValues($domains); + } + + return; + } + + if ($input->mustSuggestOptionValuesFor('locales')) { + $suggestions->suggestValues($this->enabledLocales); + } + } + + protected function configure(): void + { + $keys = $this->providers->keys(); + $defaultProvider = 1 === \count($keys) ? $keys[0] : null; + + $this + ->setDefinition([ + new InputArgument('provider', null !== $defaultProvider ? InputArgument::OPTIONAL : InputArgument::REQUIRED, 'The provider to push translations to.', $defaultProvider), + new InputOption('force', null, InputOption::VALUE_NONE, 'Override existing translations with local ones (it will delete not synchronized messages).'), + new InputOption('delete-missing', null, InputOption::VALUE_NONE, 'Delete translations available on provider but not locally.'), + new InputOption('domains', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the domains to push.'), + new InputOption('locales', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Specify the locales to push.', $this->enabledLocales), + ]) + ->setHelp(<<<'EOF' +The %command.name% command pushes translations to the given provider. Only new +translations are pushed, existing ones are not overwritten. + +You can overwrite existing translations by using the --force flag: + + php %command.full_name% --force provider + +You can delete provider translations which are not present locally by using the --delete-missing flag: + + php %command.full_name% --delete-missing provider + +Full example: + + php %command.full_name% provider --force --delete-missing --domains=messages --domains=validators --locales=en + +This command pushes all translations associated with the messages and validators domains for the en locale. +Provider translations for the specified domains and locale are deleted if they're not present locally and overwritten if it's the case. +Provider translations for others domains and locales are ignored. +EOF + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $provider = $this->providers->get($input->getArgument('provider')); + + if (!$this->enabledLocales) { + throw new InvalidArgumentException(\sprintf('You must define "framework.enabled_locales" or "framework.translator.providers.%s.locales" config key in order to work with translation providers.', parse_url($provider, \PHP_URL_SCHEME))); + } + + $io = new SymfonyStyle($input, $output); + $domains = $input->getOption('domains'); + $locales = $input->getOption('locales'); + $force = $input->getOption('force'); + $deleteMissing = $input->getOption('delete-missing'); + + if (!$domains && $provider instanceof FilteringProvider) { + $domains = $provider->getDomains(); + } + + // Reading local translations must be done after retrieving the domains from the provider + // in order to manage only translations from configured domains + $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths); + + if (!$domains) { + $domains = $this->getDomainsFromTranslatorBag($localTranslations); + } + + if (!$deleteMissing && $force) { + $provider->write($localTranslations); + + $io->success(\sprintf('All local translations has been sent to "%s" (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); + + return 0; + } + + $providerTranslations = $provider->read($domains, $locales); + + if ($deleteMissing) { + $provider->delete($providerTranslations->diff($localTranslations)); + + $io->success(\sprintf('Missing translations on "%s" has been deleted (for "%s" locale(s), and "%s" domain(s)).', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); + + // Read provider translations again, after missing translations deletion, + // to avoid push freshly deleted translations. + $providerTranslations = $provider->read($domains, $locales); + } + + $translationsToWrite = $localTranslations->diff($providerTranslations); + + if ($force) { + $translationsToWrite->addBag($localTranslations->intersect($providerTranslations)); + } + + $provider->write($translationsToWrite); + + $io->success(\sprintf('%s local translations has been sent to "%s" (for "%s" locale(s), and "%s" domain(s)).', $force ? 'All' : 'New', parse_url($provider, \PHP_URL_SCHEME), implode(', ', $locales), implode(', ', $domains))); + + return 0; + } + + private function getDomainsFromTranslatorBag(TranslatorBag $translatorBag): array + { + $domains = []; + + foreach ($translatorBag->getCatalogues() as $catalogue) { + $domains += $catalogue->getDomains(); + } + + return array_unique($domains); + } +} diff --git a/plugins/vendor/symfony/translation/Command/TranslationTrait.php b/plugins/vendor/symfony/translation/Command/TranslationTrait.php new file mode 100644 index 00000000..eafaffd3 --- /dev/null +++ b/plugins/vendor/symfony/translation/Command/TranslationTrait.php @@ -0,0 +1,77 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Command; + +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\MessageCatalogueInterface; +use Symfony\Component\Translation\TranslatorBag; + +/** + * @internal + */ +trait TranslationTrait +{ + private function readLocalTranslations(array $locales, array $domains, array $transPaths): TranslatorBag + { + $bag = new TranslatorBag(); + + foreach ($locales as $locale) { + $catalogue = new MessageCatalogue($locale); + foreach ($transPaths as $path) { + $this->reader->read($path, $catalogue); + } + + if ($domains) { + foreach ($domains as $domain) { + $bag->addCatalogue($this->filterCatalogue($catalogue, $domain)); + } + } else { + $bag->addCatalogue($catalogue); + } + } + + return $bag; + } + + private function filterCatalogue(MessageCatalogue $catalogue, string $domain): MessageCatalogue + { + $filteredCatalogue = new MessageCatalogue($catalogue->getLocale()); + + // extract intl-icu messages only + $intlDomain = $domain.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX; + if ($intlMessages = $catalogue->all($intlDomain)) { + $filteredCatalogue->add($intlMessages, $intlDomain); + } + + // extract all messages and subtract intl-icu messages + if ($messages = array_diff($catalogue->all($domain), $intlMessages)) { + $filteredCatalogue->add($messages, $domain); + } + foreach ($catalogue->getResources() as $resource) { + $filteredCatalogue->addResource($resource); + } + + if ($metadata = $catalogue->getMetadata('', $intlDomain)) { + foreach ($metadata as $k => $v) { + $filteredCatalogue->setMetadata($k, $v, $intlDomain); + } + } + + if ($metadata = $catalogue->getMetadata('', $domain)) { + foreach ($metadata as $k => $v) { + $filteredCatalogue->setMetadata($k, $v, $domain); + } + } + + return $filteredCatalogue; + } +} diff --git a/plugins/vendor/symfony/translation/Command/XliffLintCommand.php b/plugins/vendor/symfony/translation/Command/XliffLintCommand.php new file mode 100644 index 00000000..82a9571c --- /dev/null +++ b/plugins/vendor/symfony/translation/Command/XliffLintCommand.php @@ -0,0 +1,288 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Command; + +use Symfony\Component\Console\Attribute\AsCommand; +use Symfony\Component\Console\CI\GithubActionReporter; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Completion\CompletionInput; +use Symfony\Component\Console\Completion\CompletionSuggestions; +use Symfony\Component\Console\Exception\RuntimeException; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\Console\Output\OutputInterface; +use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Util\XliffUtils; + +/** + * Validates XLIFF files syntax and outputs encountered errors. + * + * @author Grégoire Pineau + * @author Robin Chalas + * @author Javier Eguiluz + */ +#[AsCommand(name: 'lint:xliff', description: 'Lint an XLIFF file and outputs encountered errors')] +class XliffLintCommand extends Command +{ + private string $format; + private bool $displayCorrectFiles; + private ?\Closure $directoryIteratorProvider; + private ?\Closure $isReadableProvider; + + public function __construct( + ?string $name = null, + ?callable $directoryIteratorProvider = null, + ?callable $isReadableProvider = null, + private bool $requireStrictFileNames = true, + ) { + parent::__construct($name); + + $this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...); + $this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...); + } + + protected function configure(): void + { + $this + ->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN') + ->addOption('format', null, InputOption::VALUE_REQUIRED, \sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions()))) + ->setHelp(<<%command.name% command lints an XLIFF file and outputs to STDOUT +the first encountered syntax error. + +You can validates XLIFF contents passed from STDIN: + + cat filename | php %command.full_name% - + +You can also validate the syntax of a file: + + php %command.full_name% filename + +Or of a whole directory: + + php %command.full_name% dirname + +The --format option specifies the format of the command output: + + php %command.full_name% dirname --format=json + +EOF + ) + ; + } + + protected function execute(InputInterface $input, OutputInterface $output): int + { + $io = new SymfonyStyle($input, $output); + $filenames = (array) $input->getArgument('filename'); + $this->format = $input->getOption('format') ?? (GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt'); + $this->displayCorrectFiles = $output->isVerbose(); + + if (['-'] === $filenames) { + return $this->display($io, [$this->validate(file_get_contents('php://stdin'))]); + } + + if (!$filenames) { + throw new RuntimeException('Please provide a filename or pipe file content to STDIN.'); + } + + $filesInfo = []; + foreach ($filenames as $filename) { + if (!$this->isReadable($filename)) { + throw new RuntimeException(\sprintf('File or directory "%s" is not readable.', $filename)); + } + + foreach ($this->getFiles($filename) as $file) { + $filesInfo[] = $this->validate(file_get_contents($file), $file); + } + } + + return $this->display($io, $filesInfo); + } + + private function validate(string $content, ?string $file = null): array + { + $errors = []; + + // Avoid: Warning DOMDocument::loadXML(): Empty string supplied as input + if ('' === trim($content)) { + return ['file' => $file, 'valid' => true]; + } + + $internal = libxml_use_internal_errors(true); + + $document = new \DOMDocument(); + $document->loadXML($content); + + if (null !== $targetLanguage = $this->getTargetLanguageFromFile($document)) { + $normalizedLocalePattern = \sprintf('(%s|%s)', preg_quote($targetLanguage, '/'), preg_quote(str_replace('-', '_', $targetLanguage), '/')); + // strict file names require translation files to be named '____.locale.xlf' + // otherwise, both '____.locale.xlf' and 'locale.____.xlf' are allowed + // also, the regexp matching must be case-insensitive, as defined for 'target-language' values + // http://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html#target-language + $expectedFilenamePattern = $this->requireStrictFileNames ? \sprintf('/^.*\.(?i:%s)\.(?:xlf|xliff)/', $normalizedLocalePattern) : \sprintf('/^(?:.*\.(?i:%s)|(?i:%s)\..*)\.(?:xlf|xliff)/', $normalizedLocalePattern, $normalizedLocalePattern); + + if (0 === preg_match($expectedFilenamePattern, basename($file))) { + $errors[] = [ + 'line' => -1, + 'column' => -1, + 'message' => \sprintf('There is a mismatch between the language included in the file name ("%s") and the "%s" value used in the "target-language" attribute of the file.', basename($file), $targetLanguage), + ]; + } + } + + foreach (XliffUtils::validateSchema($document) as $xmlError) { + $errors[] = [ + 'line' => $xmlError['line'], + 'column' => $xmlError['column'], + 'message' => $xmlError['message'], + ]; + } + + libxml_clear_errors(); + libxml_use_internal_errors($internal); + + return ['file' => $file, 'valid' => 0 === \count($errors), 'messages' => $errors]; + } + + private function display(SymfonyStyle $io, array $files): int + { + return match ($this->format) { + 'txt' => $this->displayTxt($io, $files), + 'json' => $this->displayJson($io, $files), + 'github' => $this->displayTxt($io, $files, true), + default => throw new InvalidArgumentException(\sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))), + }; + } + + private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int + { + $countFiles = \count($filesInfo); + $erroredFiles = 0; + $githubReporter = $errorAsGithubAnnotations ? new GithubActionReporter($io) : null; + + foreach ($filesInfo as $info) { + if ($info['valid'] && $this->displayCorrectFiles) { + $io->comment('OK'.($info['file'] ? \sprintf(' in %s', $info['file']) : '')); + } elseif (!$info['valid']) { + ++$erroredFiles; + $io->text(' ERROR '.($info['file'] ? \sprintf(' in %s', $info['file']) : '')); + $io->listing(array_map(function ($error) use ($info, $githubReporter) { + // general document errors have a '-1' line number + $line = -1 === $error['line'] ? null : $error['line']; + + $githubReporter?->error($error['message'], $info['file'], $line, null !== $line ? $error['column'] : null); + + return null === $line ? $error['message'] : \sprintf('Line %d, Column %d: %s', $line, $error['column'], $error['message']); + }, $info['messages'])); + } + } + + if (0 === $erroredFiles) { + $io->success(\sprintf('All %d XLIFF files contain valid syntax.', $countFiles)); + } else { + $io->warning(\sprintf('%d XLIFF files have valid syntax and %d contain errors.', $countFiles - $erroredFiles, $erroredFiles)); + } + + return min($erroredFiles, 1); + } + + private function displayJson(SymfonyStyle $io, array $filesInfo): int + { + $errors = 0; + + array_walk($filesInfo, function (&$v) use (&$errors) { + $v['file'] = (string) $v['file']; + if (!$v['valid']) { + ++$errors; + } + }); + + $io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES)); + + return min($errors, 1); + } + + /** + * @return iterable<\SplFileInfo> + */ + private function getFiles(string $fileOrDirectory): iterable + { + if (is_file($fileOrDirectory)) { + yield new \SplFileInfo($fileOrDirectory); + + return; + } + + foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) { + if (!\in_array($file->getExtension(), ['xlf', 'xliff'])) { + continue; + } + + yield $file; + } + } + + /** + * @return iterable<\SplFileInfo> + */ + private function getDirectoryIterator(string $directory): iterable + { + $default = fn ($directory) => new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS), + \RecursiveIteratorIterator::LEAVES_ONLY + ); + + if (null !== $this->directoryIteratorProvider) { + return ($this->directoryIteratorProvider)($directory, $default); + } + + return $default($directory); + } + + private function isReadable(string $fileOrDirectory): bool + { + $default = fn ($fileOrDirectory) => is_readable($fileOrDirectory); + + if (null !== $this->isReadableProvider) { + return ($this->isReadableProvider)($fileOrDirectory, $default); + } + + return $default($fileOrDirectory); + } + + private function getTargetLanguageFromFile(\DOMDocument $xliffContents): ?string + { + foreach ($xliffContents->getElementsByTagName('file')[0]->attributes ?? [] as $attribute) { + if ('target-language' === $attribute->nodeName) { + return $attribute->nodeValue; + } + } + + return null; + } + + public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void + { + if ($input->mustSuggestOptionValuesFor('format')) { + $suggestions->suggestValues($this->getAvailableFormatOptions()); + } + } + + /** @return string[] */ + private function getAvailableFormatOptions(): array + { + return ['txt', 'json', 'github']; + } +} diff --git a/plugins/vendor/symfony/translation/DataCollector/TranslationDataCollector.php b/plugins/vendor/symfony/translation/DataCollector/TranslationDataCollector.php new file mode 100644 index 00000000..e2e597a7 --- /dev/null +++ b/plugins/vendor/symfony/translation/DataCollector/TranslationDataCollector.php @@ -0,0 +1,155 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DataCollector; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\HttpKernel\DataCollector\DataCollector; +use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface; +use Symfony\Component\Translation\DataCollectorTranslator; +use Symfony\Component\VarDumper\Cloner\Data; + +/** + * @author Abdellatif Ait boudad + * + * @final + */ +class TranslationDataCollector extends DataCollector implements LateDataCollectorInterface +{ + public function __construct( + private DataCollectorTranslator $translator, + ) { + } + + public function lateCollect(): void + { + $messages = $this->sanitizeCollectedMessages($this->translator->getCollectedMessages()); + + $this->data += $this->computeCount($messages); + $this->data['messages'] = $messages; + + $this->data = $this->cloneVar($this->data); + } + + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void + { + $this->data['locale'] = $this->translator->getLocale(); + $this->data['fallback_locales'] = $this->translator->getFallbackLocales(); + $this->data['global_parameters'] = $this->translator->getGlobalParameters(); + } + + public function reset(): void + { + $this->data = []; + } + + public function getMessages(): array|Data + { + return $this->data['messages'] ?? []; + } + + public function getCountMissings(): int + { + return $this->data[DataCollectorTranslator::MESSAGE_MISSING] ?? 0; + } + + public function getCountFallbacks(): int + { + return $this->data[DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK] ?? 0; + } + + public function getCountDefines(): int + { + return $this->data[DataCollectorTranslator::MESSAGE_DEFINED] ?? 0; + } + + public function getLocale(): ?string + { + return !empty($this->data['locale']) ? $this->data['locale'] : null; + } + + /** + * @internal + */ + public function getFallbackLocales(): Data|array + { + return (isset($this->data['fallback_locales']) && \count($this->data['fallback_locales']) > 0) ? $this->data['fallback_locales'] : []; + } + + /** + * @internal + */ + public function getGlobalParameters(): Data|array + { + return $this->data['global_parameters'] ?? []; + } + + public function getName(): string + { + return 'translation'; + } + + private function sanitizeCollectedMessages(array $messages): array + { + $result = []; + foreach ($messages as $key => $message) { + $messageId = $message['locale'].$message['domain'].$message['id']; + + if (!isset($result[$messageId])) { + $message['count'] = 1; + $message['parameters'] = !empty($message['parameters']) ? [$message['parameters']] : []; + $messages[$key]['translation'] = $this->sanitizeString($message['translation']); + $result[$messageId] = $message; + } else { + if (!empty($message['parameters'])) { + $result[$messageId]['parameters'][] = $message['parameters']; + } + + ++$result[$messageId]['count']; + } + + unset($messages[$key]); + } + + return $result; + } + + private function computeCount(array $messages): array + { + $count = [ + DataCollectorTranslator::MESSAGE_DEFINED => 0, + DataCollectorTranslator::MESSAGE_MISSING => 0, + DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK => 0, + ]; + + foreach ($messages as $message) { + ++$count[$message['state']]; + } + + return $count; + } + + private function sanitizeString(string $string, int $length = 80): string + { + $string = trim(preg_replace('/\s+/', ' ', $string)); + + if (false !== $encoding = mb_detect_encoding($string, null, true)) { + if (mb_strlen($string, $encoding) > $length) { + return mb_substr($string, 0, $length - 3, $encoding).'...'; + } + } elseif (\strlen($string) > $length) { + return substr($string, 0, $length - 3).'...'; + } + + return $string; + } +} diff --git a/plugins/vendor/symfony/translation/DataCollectorTranslator.php b/plugins/vendor/symfony/translation/DataCollectorTranslator.php new file mode 100644 index 00000000..c85318f7 --- /dev/null +++ b/plugins/vendor/symfony/translation/DataCollectorTranslator.php @@ -0,0 +1,139 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\HttpKernel\CacheWarmer\WarmableInterface; +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * @author Abdellatif Ait boudad + * + * @final since Symfony 7.1 + */ +class DataCollectorTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface, WarmableInterface +{ + public const MESSAGE_DEFINED = 0; + public const MESSAGE_MISSING = 1; + public const MESSAGE_EQUALS_FALLBACK = 2; + + private array $messages = []; + + public function __construct( + private TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator, + ) { + } + + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); + $this->collectMessage($locale, $domain, $id, $trans, $parameters); + + return $trans; + } + + public function setLocale(string $locale): void + { + $this->translator->setLocale($locale); + } + + public function getLocale(): string + { + return $this->translator->getLocale(); + } + + public function getCatalogue(?string $locale = null): MessageCatalogueInterface + { + return $this->translator->getCatalogue($locale); + } + + public function getCatalogues(): array + { + return $this->translator->getCatalogues(); + } + + public function warmUp(string $cacheDir, ?string $buildDir = null): array + { + if ($this->translator instanceof WarmableInterface) { + return $this->translator->warmUp($cacheDir, $buildDir); + } + + return []; + } + + /** + * Gets the fallback locales. + */ + public function getFallbackLocales(): array + { + if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { + return $this->translator->getFallbackLocales(); + } + + return []; + } + + public function getGlobalParameters(): array + { + if ($this->translator instanceof Translator || method_exists($this->translator, 'getGlobalParameters')) { + return $this->translator->getGlobalParameters(); + } + + return []; + } + + public function __call(string $method, array $args): mixed + { + return $this->translator->{$method}(...$args); + } + + public function getCollectedMessages(): array + { + return $this->messages; + } + + private function collectMessage(?string $locale, ?string $domain, string $id, string $translation, ?array $parameters = []): void + { + $domain ??= 'messages'; + + $catalogue = $this->translator->getCatalogue($locale); + $locale = $catalogue->getLocale(); + $fallbackLocale = null; + if ($catalogue->defines($id, $domain)) { + $state = self::MESSAGE_DEFINED; + } elseif ($catalogue->has($id, $domain)) { + $state = self::MESSAGE_EQUALS_FALLBACK; + + $fallbackCatalogue = $catalogue->getFallbackCatalogue(); + while ($fallbackCatalogue) { + if ($fallbackCatalogue->defines($id, $domain)) { + $fallbackLocale = $fallbackCatalogue->getLocale(); + break; + } + $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); + } + } else { + $state = self::MESSAGE_MISSING; + } + + $this->messages[] = [ + 'locale' => $locale, + 'fallbackLocale' => $fallbackLocale, + 'domain' => $domain, + 'id' => $id, + 'translation' => $translation, + 'parameters' => $parameters, + 'state' => $state, + 'transChoiceNumber' => isset($parameters['%count%']) && is_numeric($parameters['%count%']) ? $parameters['%count%'] : null, + ]; + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php b/plugins/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php new file mode 100644 index 00000000..cdf63be4 --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/DataCollectorTranslatorPass.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\Translation\TranslatorBagInterface; + +/** + * @author Christian Flothmann + */ +class DataCollectorTranslatorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->has('translator')) { + return; + } + + $translatorClass = $container->getParameterBag()->resolveValue($container->findDefinition('translator')->getClass()); + + if (!is_subclass_of($translatorClass, TranslatorBagInterface::class)) { + $container->removeDefinition('translator.data_collector'); + $container->removeDefinition('data_collector.translation'); + } + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php b/plugins/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php new file mode 100644 index 00000000..fba86981 --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/LoggingTranslatorPass.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * @author Abdellatif Ait boudad + */ +class LoggingTranslatorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->hasAlias('logger') || !$container->hasAlias('translator')) { + return; + } + + if (!$container->hasParameter('translator.logging') || !$container->getParameter('translator.logging')) { + return; + } + + $translatorAlias = $container->getAlias('translator'); + $definition = $container->getDefinition((string) $translatorAlias); + $class = $container->getParameterBag()->resolveValue($definition->getClass()); + + if (!$r = $container->getReflectionClass($class)) { + throw new InvalidArgumentException(\sprintf('Class "%s" used for service "%s" cannot be found.', $class, $translatorAlias)); + } + + if (!$r->isSubclassOf(TranslatorInterface::class) || !$r->isSubclassOf(TranslatorBagInterface::class)) { + return; + } + + $container->getDefinition('translator.logging')->setDecoratedService('translator'); + $warmer = $container->getDefinition('translation.warmer'); + $subscriberAttributes = $warmer->getTag('container.service_subscriber'); + $warmer->clearTag('container.service_subscriber'); + + foreach ($subscriberAttributes as $k => $v) { + if ((!isset($v['id']) || 'translator' !== $v['id']) && (!isset($v['key']) || 'translator' !== $v['key'])) { + $warmer->addTag('container.service_subscriber', $v); + } + } + $warmer->addTag('container.service_subscriber', ['key' => 'translator', 'id' => 'translator.logging.inner']); + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php b/plugins/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php new file mode 100644 index 00000000..0331ef58 --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/TranslationDumperPass.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Adds tagged translation.formatter services to translation writer. + */ +class TranslationDumperPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->hasDefinition('translation.writer')) { + return; + } + + $definition = $container->getDefinition('translation.writer'); + + foreach ($container->findTaggedServiceIds('translation.dumper', true) as $id => $attributes) { + $definition->addMethodCall('addDumper', [$attributes[0]['alias'], new Reference($id)]); + } + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php b/plugins/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php new file mode 100644 index 00000000..864a1210 --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/TranslationExtractorPass.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Exception\RuntimeException; +use Symfony\Component\DependencyInjection\Reference; + +/** + * Adds tagged translation.extractor services to translation extractor. + */ +class TranslationExtractorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->hasDefinition('translation.extractor')) { + return; + } + + $definition = $container->getDefinition('translation.extractor'); + + foreach ($container->findTaggedServiceIds('translation.extractor', true) as $id => $attributes) { + if (!isset($attributes[0]['alias'])) { + throw new RuntimeException(\sprintf('The alias for the tag "translation.extractor" of service "%s" must be set.', $id)); + } + + $definition->addMethodCall('addExtractor', [$attributes[0]['alias'], new Reference($id)]); + } + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPass.php b/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPass.php new file mode 100644 index 00000000..948f378d --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPass.php @@ -0,0 +1,91 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; +use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Reference; + +class TranslatorPass implements CompilerPassInterface +{ + public function process(ContainerBuilder $container): void + { + if (!$container->hasDefinition('translator.default')) { + return; + } + + $loaders = []; + $loaderRefs = []; + foreach ($container->findTaggedServiceIds('translation.loader', true) as $id => $attributes) { + $loaderRefs[$id] = new Reference($id); + $loaders[$id][] = $attributes[0]['alias']; + if (isset($attributes[0]['legacy-alias'])) { + $loaders[$id][] = $attributes[0]['legacy-alias']; + } + } + + if ($container->hasDefinition('translation.reader')) { + $definition = $container->getDefinition('translation.reader'); + foreach ($loaders as $id => $formats) { + foreach ($formats as $format) { + $definition->addMethodCall('addLoader', [$format, $loaderRefs[$id]]); + } + } + } + + $container + ->findDefinition('translator.default') + ->replaceArgument(0, ServiceLocatorTagPass::register($container, $loaderRefs)) + ->replaceArgument(3, $loaders) + ; + + if ($container->hasDefinition('validator') && $container->hasDefinition('translation.extractor.visitor.constraint')) { + $constraintVisitorDefinition = $container->getDefinition('translation.extractor.visitor.constraint'); + $constraintClassNames = []; + + foreach ($container->getDefinitions() as $definition) { + if (!$definition->hasTag('validator.constraint_validator')) { + continue; + } + // Resolve constraint validator FQCN even if defined as %foo.validator.class% parameter + $className = $container->getParameterBag()->resolveValue($definition->getClass()); + // Extraction of the constraint class name from the Constraint Validator FQCN + $constraintClassNames[] = str_replace('Validator', '', substr(strrchr($className, '\\'), 1)); + } + + $constraintVisitorDefinition->setArgument(0, $constraintClassNames); + } + + if (!$container->hasParameter('twig.default_path')) { + return; + } + + $paths = array_keys($container->getDefinition('twig.template_iterator')->getArgument(1)); + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); + $definition->replaceArgument(4, $container->getParameter('twig.default_path')); + + if (\count($definition->getArguments()) > 6) { + $definition->replaceArgument(6, $paths); + } + } + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); + $definition->replaceArgument(5, $container->getParameter('twig.default_path')); + + if (\count($definition->getArguments()) > 7) { + $definition->replaceArgument(7, $paths); + } + } + } +} diff --git a/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php new file mode 100644 index 00000000..4f5fc2de --- /dev/null +++ b/plugins/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -0,0 +1,142 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\DependencyInjection; + +use Symfony\Component\DependencyInjection\Compiler\AbstractRecursivePass; +use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Definition; +use Symfony\Component\DependencyInjection\Reference; +use Symfony\Component\DependencyInjection\ServiceLocator; +use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver; + +/** + * @author Yonel Ceruto + */ +class TranslatorPathsPass extends AbstractRecursivePass +{ + protected bool $skipScalars = true; + + private int $level = 0; + + /** + * @var array + */ + private array $paths = []; + + /** + * @var array + */ + private array $definitions = []; + + /** + * @var array> + */ + private array $controllers = []; + + public function process(ContainerBuilder $container): void + { + if (!$container->hasDefinition('translator')) { + return; + } + + foreach ($this->findControllerArguments($container) as $controller => $argument) { + $id = substr($controller, 0, strpos($controller, ':') ?: \strlen($controller)); + if ($container->hasDefinition($id)) { + [$locatorRef] = $argument->getValues(); + $this->controllers[(string) $locatorRef][$container->getDefinition($id)->getClass()] = true; + } + } + + try { + parent::process($container); + + $paths = []; + foreach ($this->paths as $class => $_) { + if (($r = $container->getReflectionClass($class)) && !$r->isInterface()) { + $paths[] = $r->getFileName(); + foreach ($r->getTraits() as $trait) { + $paths[] = $trait->getFileName(); + } + } + } + if ($paths) { + if ($container->hasDefinition('console.command.translation_debug')) { + $definition = $container->getDefinition('console.command.translation_debug'); + $definition->replaceArgument(6, array_merge($definition->getArgument(6), $paths)); + } + if ($container->hasDefinition('console.command.translation_extract')) { + $definition = $container->getDefinition('console.command.translation_extract'); + $definition->replaceArgument(7, array_merge($definition->getArgument(7), $paths)); + } + } + } finally { + $this->level = 0; + $this->paths = []; + $this->definitions = []; + } + } + + protected function processValue(mixed $value, bool $isRoot = false): mixed + { + if ($value instanceof Reference) { + if ('translator' === (string) $value) { + for ($i = $this->level - 1; $i >= 0; --$i) { + $class = $this->definitions[$i]->getClass(); + + if (ServiceLocator::class === $class) { + if (!isset($this->controllers[$this->currentId])) { + continue; + } + foreach ($this->controllers[$this->currentId] as $class => $_) { + $this->paths[$class] = true; + } + } else { + $this->paths[$class] = true; + } + + break; + } + } + + return $value; + } + + if ($value instanceof Definition) { + $this->definitions[$this->level++] = $value; + $value = parent::processValue($value, $isRoot); + unset($this->definitions[--$this->level]); + + return $value; + } + + return parent::processValue($value, $isRoot); + } + + private function findControllerArguments(ContainerBuilder $container): array + { + if (!$container->has('argument_resolver.service')) { + return []; + } + $resolverDef = $container->findDefinition('argument_resolver.service'); + + if (TraceableValueResolver::class === $resolverDef->getClass()) { + $resolverDef = $container->getDefinition($resolverDef->getArgument(0)); + } + + $argument = $resolverDef->getArgument(0); + if ($argument instanceof Reference) { + $argument = $container->getDefinition($argument); + } + + return $argument->getArgument(0); + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/CsvFileDumper.php b/plugins/vendor/symfony/translation/Dumper/CsvFileDumper.php new file mode 100644 index 00000000..7dfbba49 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/CsvFileDumper.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * CsvFileDumper generates a csv formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class CsvFileDumper extends FileDumper +{ + private string $delimiter = ';'; + private string $enclosure = '"'; + + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $handle = fopen('php://memory', 'r+'); + + foreach ($messages->all($domain) as $source => $target) { + fputcsv($handle, [$source, $target], $this->delimiter, $this->enclosure, '\\'); + } + + rewind($handle); + $output = stream_get_contents($handle); + fclose($handle); + + return $output; + } + + /** + * Sets the delimiter and escape character for CSV. + */ + public function setCsvControl(string $delimiter = ';', string $enclosure = '"'): void + { + $this->delimiter = $delimiter; + $this->enclosure = $enclosure; + } + + protected function getExtension(): string + { + return 'csv'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/DumperInterface.php b/plugins/vendor/symfony/translation/Dumper/DumperInterface.php new file mode 100644 index 00000000..c151de02 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/DumperInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * DumperInterface is the interface implemented by all translation dumpers. + * There is no common option. + * + * @author Michel Salib + */ +interface DumperInterface +{ + /** + * Dumps the message catalogue. + * + * @param array $options Options that are used by the dumper + */ + public function dump(MessageCatalogue $messages, array $options = []): void; +} diff --git a/plugins/vendor/symfony/translation/Dumper/FileDumper.php b/plugins/vendor/symfony/translation/Dumper/FileDumper.php new file mode 100644 index 00000000..2e1880f7 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/FileDumper.php @@ -0,0 +1,101 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\RuntimeException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). + * + * Options: + * - path (mandatory): the directory where the files should be saved + * + * @author Michel Salib + */ +abstract class FileDumper implements DumperInterface +{ + /** + * A template for the relative paths to files. + */ + protected string $relativePathTemplate = '%domain%.%locale%.%extension%'; + + /** + * Sets the template for the relative paths to files. + */ + public function setRelativePathTemplate(string $relativePathTemplate): void + { + $this->relativePathTemplate = $relativePathTemplate; + } + + public function dump(MessageCatalogue $messages, array $options = []): void + { + if (!\array_key_exists('path', $options)) { + throw new InvalidArgumentException('The file dumper needs a path option.'); + } + + // save a file for each domain + foreach ($messages->getDomains() as $domain) { + $fullpath = $options['path'].'/'.$this->getRelativePath($domain, $messages->getLocale()); + if (!file_exists($fullpath)) { + $directory = \dirname($fullpath); + if (!file_exists($directory) && !@mkdir($directory, 0777, true)) { + throw new RuntimeException(\sprintf('Unable to create directory "%s".', $directory)); + } + } + + $intlDomain = $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX; + $intlMessages = $messages->all($intlDomain); + + if ($intlMessages) { + $intlPath = $options['path'].'/'.$this->getRelativePath($intlDomain, $messages->getLocale()); + file_put_contents($intlPath, $this->formatCatalogue($messages, $intlDomain, $options)); + + $messages->replace([], $intlDomain); + + try { + if ($messages->all($domain)) { + file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); + } + continue; + } finally { + $messages->replace($intlMessages, $intlDomain); + } + } + + file_put_contents($fullpath, $this->formatCatalogue($messages, $domain, $options)); + } + } + + /** + * Transforms a domain of a message catalogue to its string representation. + */ + abstract public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string; + + /** + * Gets the file extension of the dumper. + */ + abstract protected function getExtension(): string; + + /** + * Gets the relative file path using the template. + */ + private function getRelativePath(string $domain, string $locale): string + { + return strtr($this->relativePathTemplate, [ + '%domain%' => $domain, + '%locale%' => $locale, + '%extension%' => $this->getExtension(), + ]); + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/plugins/vendor/symfony/translation/Dumper/IcuResFileDumper.php new file mode 100644 index 00000000..e603ee8c --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class IcuResFileDumper extends FileDumper +{ + protected string $relativePathTemplate = '%domain%/%locale%.%extension%'; + + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $data = $indexes = $resources = ''; + + foreach ($messages->all($domain) as $source => $target) { + $indexes .= pack('v', \strlen($data) + 28); + $data .= $source."\0"; + } + + $data .= $this->writePadding($data); + + $keyTop = $this->getPosition($data); + + foreach ($messages->all($domain) as $source => $target) { + $resources .= pack('V', $this->getPosition($data)); + + $data .= pack('V', \strlen($target)) + .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') + .$this->writePadding($data) + ; + } + + $resOffset = $this->getPosition($data); + + $data .= pack('v', \count($messages->all($domain))) + .$indexes + .$this->writePadding($data) + .$resources + ; + + $bundleTop = $this->getPosition($data); + + $root = pack('V7', + $resOffset + (2 << 28), // Resource Offset + Resource Type + 6, // Index length + $keyTop, // Index keys top + $bundleTop, // Index resources top + $bundleTop, // Index bundle top + \count($messages->all($domain)), // Index max table length + 0 // Index attributes + ); + + $header = pack('vC2v4C12@32', + 32, // Header size + 0xDA, 0x27, // Magic number 1 and 2 + 20, 0, 0, 2, // Rest of the header, ..., Size of a char + 0x52, 0x65, 0x73, 0x42, // Data format identifier + 1, 2, 0, 0, // Data version + 1, 4, 0, 0 // Unicode version + ); + + return $header.$root.$data; + } + + private function writePadding(string $data): ?string + { + $padding = \strlen($data) % 4; + + return $padding ? str_repeat("\xAA", 4 - $padding) : null; + } + + private function getPosition(string $data): float|int + { + return (\strlen($data) + 28) / 4; + } + + protected function getExtension(): string + { + return 'res'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/IniFileDumper.php b/plugins/vendor/symfony/translation/Dumper/IniFileDumper.php new file mode 100644 index 00000000..6cbdef60 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/IniFileDumper.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IniFileDumper generates an ini formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class IniFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $output = ''; + + foreach ($messages->all($domain) as $source => $target) { + $escapeTarget = str_replace('"', '\"', $target); + $output .= $source.'="'.$escapeTarget."\"\n"; + } + + return $output; + } + + protected function getExtension(): string + { + return 'ini'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/JsonFileDumper.php b/plugins/vendor/symfony/translation/Dumper/JsonFileDumper.php new file mode 100644 index 00000000..e5035397 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/JsonFileDumper.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * JsonFileDumper generates an json formatted string representation of a message catalogue. + * + * @author singles + */ +class JsonFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $flags = $options['json_encoding'] ?? \JSON_PRETTY_PRINT; + + return json_encode($messages->all($domain), $flags); + } + + protected function getExtension(): string + { + return 'json'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/MoFileDumper.php b/plugins/vendor/symfony/translation/Dumper/MoFileDumper.php new file mode 100644 index 00000000..a7b4b338 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -0,0 +1,73 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\Loader\MoFileLoader; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * MoFileDumper generates a gettext formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class MoFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $sources = $targets = $sourceOffsets = $targetOffsets = ''; + $offsets = []; + $size = 0; + + foreach ($messages->all($domain) as $source => $target) { + $offsets[] = array_map('strlen', [$sources, $source, $targets, $target]); + $sources .= "\0".$source; + $targets .= "\0".$target; + ++$size; + } + + $header = [ + 'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC, + 'formatRevision' => 0, + 'count' => $size, + 'offsetId' => MoFileLoader::MO_HEADER_SIZE, + 'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size), + 'sizeHashes' => 0, + 'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size), + ]; + + $sourcesSize = \strlen($sources); + $sourcesStart = $header['offsetHashes'] + 1; + + foreach ($offsets as $offset) { + $sourceOffsets .= $this->writeLong($offset[1]) + .$this->writeLong($offset[0] + $sourcesStart); + $targetOffsets .= $this->writeLong($offset[3]) + .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); + } + + return implode('', array_map($this->writeLong(...), $header)) + .$sourceOffsets + .$targetOffsets + .$sources + .$targets; + } + + protected function getExtension(): string + { + return 'mo'; + } + + private function writeLong(mixed $str): string + { + return pack('V*', $str); + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/PhpFileDumper.php b/plugins/vendor/symfony/translation/Dumper/PhpFileDumper.php new file mode 100644 index 00000000..51e90665 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/PhpFileDumper.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PhpFileDumper generates PHP files from a message catalogue. + * + * @author Michel Salib + */ +class PhpFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + return "all($domain), true).";\n"; + } + + protected function getExtension(): string + { + return 'php'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/PoFileDumper.php b/plugins/vendor/symfony/translation/Dumper/PoFileDumper.php new file mode 100644 index 00000000..c68fb141 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/PoFileDumper.php @@ -0,0 +1,131 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PoFileDumper generates a gettext formatted string representation of a message catalogue. + * + * @author Stealth35 + */ +class PoFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $output = 'msgid ""'."\n"; + $output .= 'msgstr ""'."\n"; + $output .= '"Content-Type: text/plain; charset=UTF-8\n"'."\n"; + $output .= '"Content-Transfer-Encoding: 8bit\n"'."\n"; + $output .= '"Language: '.$messages->getLocale().'\n"'."\n"; + $output .= "\n"; + + $newLine = false; + foreach ($messages->all($domain) as $source => $target) { + if ($newLine) { + $output .= "\n"; + } else { + $newLine = true; + } + $metadata = $messages->getMetadata($source, $domain); + + if (isset($metadata['comments'])) { + $output .= $this->formatComments($metadata['comments']); + } + if (isset($metadata['flags'])) { + $output .= $this->formatComments(implode(',', (array) $metadata['flags']), ','); + } + if (isset($metadata['sources'])) { + $output .= $this->formatComments(implode(' ', (array) $metadata['sources']), ':'); + } + + $sourceRules = $this->getStandardRules($source); + $targetRules = $this->getStandardRules($target); + if (2 == \count($sourceRules) && [] !== $targetRules) { + $output .= \sprintf('msgid "%s"'."\n", $this->escape($sourceRules[0])); + $output .= \sprintf('msgid_plural "%s"'."\n", $this->escape($sourceRules[1])); + foreach ($targetRules as $i => $targetRule) { + $output .= \sprintf('msgstr[%d] "%s"'."\n", $i, $this->escape($targetRule)); + } + } else { + $output .= \sprintf('msgid "%s"'."\n", $this->escape($source)); + $output .= \sprintf('msgstr "%s"'."\n", $this->escape($target)); + } + } + + return $output; + } + + private function getStandardRules(string $id): array + { + // Partly copied from TranslatorTrait::trans. + $parts = []; + if (preg_match('/^\|++$/', $id)) { + $parts = explode('|', $id); + } elseif (preg_match_all('/(?:\|\||[^\|])++/', $id, $matches)) { + $parts = $matches[0]; + } + + $intervalRegexp = <<<'EOF' +/^(?P + ({\s* + (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) + \s*}) + + | + + (?P[\[\]]) + \s* + (?P-Inf|\-?\d+(\.\d+)?) + \s*,\s* + (?P\+?Inf|\-?\d+(\.\d+)?) + \s* + (?P[\[\]]) +)\s*(?P.*?)$/xs +EOF; + + $standardRules = []; + foreach ($parts as $part) { + $part = trim(str_replace('||', '|', $part)); + + if (preg_match($intervalRegexp, $part)) { + // Explicit rule is not a standard rule. + return []; + } + + $standardRules[] = $part; + } + + return $standardRules; + } + + protected function getExtension(): string + { + return 'po'; + } + + private function escape(string $str): string + { + return addcslashes($str, "\0..\37\42\134"); + } + + private function formatComments(string|array $comments, string $prefix = ''): ?string + { + $output = null; + + foreach ((array) $comments as $comment) { + $output .= \sprintf('#%s %s'."\n", $prefix, $comment); + } + + return $output; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/QtFileDumper.php b/plugins/vendor/symfony/translation/Dumper/QtFileDumper.php new file mode 100644 index 00000000..0373e9c1 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/QtFileDumper.php @@ -0,0 +1,55 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * QtFileDumper generates ts files from a message catalogue. + * + * @author Benjamin Eberlei + */ +class QtFileDumper extends FileDumper +{ + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + $ts = $dom->appendChild($dom->createElement('TS')); + $context = $ts->appendChild($dom->createElement('context')); + $context->appendChild($dom->createElement('name', $domain)); + + foreach ($messages->all($domain) as $source => $target) { + $message = $context->appendChild($dom->createElement('message')); + $metadata = $messages->getMetadata($source, $domain); + if (isset($metadata['sources'])) { + foreach ((array) $metadata['sources'] as $location) { + $loc = explode(':', $location, 2); + $location = $message->appendChild($dom->createElement('location')); + $location->setAttribute('filename', $loc[0]); + if (isset($loc[1])) { + $location->setAttribute('line', $loc[1]); + } + } + } + $message->appendChild($dom->createElement('source', $source)); + $message->appendChild($dom->createElement('translation', $target)); + } + + return $dom->saveXML(); + } + + protected function getExtension(): string + { + return 'ts'; + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/XliffFileDumper.php b/plugins/vendor/symfony/translation/Dumper/XliffFileDumper.php new file mode 100644 index 00000000..98444bca --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/XliffFileDumper.php @@ -0,0 +1,227 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * XliffFileDumper generates xliff files from a message catalogue. + * + * @author Michel Salib + */ +class XliffFileDumper extends FileDumper +{ + public function __construct( + private string $extension = 'xlf', + ) { + } + + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + $xliffVersion = '1.2'; + if (\array_key_exists('xliff_version', $options)) { + $xliffVersion = $options['xliff_version']; + } + + if (\array_key_exists('default_locale', $options)) { + $defaultLocale = $options['default_locale']; + } else { + $defaultLocale = \Locale::getDefault(); + } + + if ('1.2' === $xliffVersion) { + return $this->dumpXliff1($defaultLocale, $messages, $domain, $options); + } + if ('2.0' === $xliffVersion) { + return $this->dumpXliff2($defaultLocale, $messages, $domain); + } + + throw new InvalidArgumentException(\sprintf('No support implemented for dumping XLIFF version "%s".', $xliffVersion)); + } + + protected function getExtension(): string + { + return $this->extension; + } + + private function dumpXliff1(string $defaultLocale, MessageCatalogue $messages, ?string $domain, array $options = []): string + { + $toolInfo = ['tool-id' => 'symfony', 'tool-name' => 'Symfony']; + if (\array_key_exists('tool_info', $options)) { + $toolInfo = array_merge($toolInfo, $options['tool_info']); + } + + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + + $xliff = $dom->appendChild($dom->createElement('xliff')); + $xliff->setAttribute('version', '1.2'); + $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'); + + $xliffFile = $xliff->appendChild($dom->createElement('file')); + $xliffFile->setAttribute('source-language', str_replace('_', '-', $defaultLocale)); + $xliffFile->setAttribute('target-language', str_replace('_', '-', $messages->getLocale())); + $xliffFile->setAttribute('datatype', 'plaintext'); + $xliffFile->setAttribute('original', 'file.ext'); + + $xliffHead = $xliffFile->appendChild($dom->createElement('header')); + $xliffTool = $xliffHead->appendChild($dom->createElement('tool')); + foreach ($toolInfo as $id => $value) { + $xliffTool->setAttribute($id, $value); + } + + if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { + $xliffPropGroup = $xliffHead->appendChild($dom->createElement('prop-group')); + foreach ($catalogueMetadata as $key => $value) { + $xliffProp = $xliffPropGroup->appendChild($dom->createElement('prop')); + $xliffProp->setAttribute('prop-type', $key); + $xliffProp->appendChild($dom->createTextNode($value)); + } + } + + $xliffBody = $xliffFile->appendChild($dom->createElement('body')); + foreach ($messages->all($domain) as $source => $target) { + $translation = $dom->createElement('trans-unit'); + + $translation->setAttribute('id', strtr(substr(base64_encode(hash('xxh128', $source, true)), 0, 7), '/+', '._')); + $translation->setAttribute('resname', $source); + + $s = $translation->appendChild($dom->createElement('source')); + $s->appendChild($dom->createTextNode($source)); + + // Does the target contain characters requiring a CDATA section? + $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); + + $targetElement = $dom->createElement('target'); + $metadata = $messages->getMetadata($source, $domain); + if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { + foreach ($metadata['target-attributes'] as $name => $value) { + $targetElement->setAttribute($name, $value); + } + } + $t = $translation->appendChild($targetElement); + $t->appendChild($text); + + if ($this->hasMetadataArrayInfo('notes', $metadata)) { + foreach ($metadata['notes'] as $note) { + if (!isset($note['content'])) { + continue; + } + + $n = $translation->appendChild($dom->createElement('note')); + $n->appendChild($dom->createTextNode($note['content'])); + + if (isset($note['priority'])) { + $n->setAttribute('priority', $note['priority']); + } + + if (isset($note['from'])) { + $n->setAttribute('from', $note['from']); + } + } + } + + $xliffBody->appendChild($translation); + } + + return $dom->saveXML(); + } + + private function dumpXliff2(string $defaultLocale, MessageCatalogue $messages, ?string $domain): string + { + $dom = new \DOMDocument('1.0', 'utf-8'); + $dom->formatOutput = true; + + $xliff = $dom->appendChild($dom->createElement('xliff')); + $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:2.0'); + $xliff->setAttribute('version', '2.0'); + $xliff->setAttribute('srcLang', str_replace('_', '-', $defaultLocale)); + $xliff->setAttribute('trgLang', str_replace('_', '-', $messages->getLocale())); + + $xliffFile = $xliff->appendChild($dom->createElement('file')); + if (str_ends_with($domain, MessageCatalogue::INTL_DOMAIN_SUFFIX)) { + $xliffFile->setAttribute('id', substr($domain, 0, -\strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX)).'.'.$messages->getLocale()); + } else { + $xliffFile->setAttribute('id', $domain.'.'.$messages->getLocale()); + } + + if ($catalogueMetadata = $messages->getCatalogueMetadata('', $domain) ?? []) { + $xliff->setAttribute('xmlns:m', 'urn:oasis:names:tc:xliff:metadata:2.0'); + $xliffMetadata = $xliffFile->appendChild($dom->createElement('m:metadata')); + foreach ($catalogueMetadata as $key => $value) { + $xliffMeta = $xliffMetadata->appendChild($dom->createElement('prop')); + $xliffMeta->setAttribute('type', $key); + $xliffMeta->appendChild($dom->createTextNode($value)); + } + } + + foreach ($messages->all($domain) as $source => $target) { + $translation = $dom->createElement('unit'); + $translation->setAttribute('id', strtr(substr(base64_encode(hash('xxh128', $source, true)), 0, 7), '/+', '._')); + + if (\strlen($source) <= 80) { + $translation->setAttribute('name', $source); + } + + $metadata = $messages->getMetadata($source, $domain); + + // Add notes section + if ($this->hasMetadataArrayInfo('notes', $metadata) && $metadata['notes']) { + $notesElement = $dom->createElement('notes'); + foreach ($metadata['notes'] as $note) { + $n = $dom->createElement('note'); + $n->appendChild($dom->createTextNode($note['content'] ?? '')); + unset($note['content']); + + foreach ($note as $name => $value) { + $n->setAttribute($name, $value); + } + $notesElement->appendChild($n); + } + $translation->appendChild($notesElement); + } + + $segment = $translation->appendChild($dom->createElement('segment')); + + if ($this->hasMetadataArrayInfo('segment-attributes', $metadata)) { + foreach ($metadata['segment-attributes'] as $name => $value) { + $segment->setAttribute($name, $value); + } + } + + $s = $segment->appendChild($dom->createElement('source')); + $s->appendChild($dom->createTextNode($source)); + + // Does the target contain characters requiring a CDATA section? + $text = 1 === preg_match('/[&<>]/', $target) ? $dom->createCDATASection($target) : $dom->createTextNode($target); + + $targetElement = $dom->createElement('target'); + if ($this->hasMetadataArrayInfo('target-attributes', $metadata)) { + foreach ($metadata['target-attributes'] as $name => $value) { + $targetElement->setAttribute($name, $value); + } + } + $t = $segment->appendChild($targetElement); + $t->appendChild($text); + + $xliffFile->appendChild($translation); + } + + return $dom->saveXML(); + } + + private function hasMetadataArrayInfo(string $key, ?array $metadata = null): bool + { + return is_iterable($metadata[$key] ?? null); + } +} diff --git a/plugins/vendor/symfony/translation/Dumper/YamlFileDumper.php b/plugins/vendor/symfony/translation/Dumper/YamlFileDumper.php new file mode 100644 index 00000000..a30eaa31 --- /dev/null +++ b/plugins/vendor/symfony/translation/Dumper/YamlFileDumper.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Dumper; + +use Symfony\Component\Translation\Exception\LogicException; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Util\ArrayConverter; +use Symfony\Component\Yaml\Yaml; + +/** + * YamlFileDumper generates yaml files from a message catalogue. + * + * @author Michel Salib + */ +class YamlFileDumper extends FileDumper +{ + public function __construct( + private string $extension = 'yml', + ) { + } + + public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []): string + { + if (!class_exists(Yaml::class)) { + throw new LogicException('Dumping translations in the YAML format requires the Symfony Yaml component.'); + } + + $data = $messages->all($domain); + + if (isset($options['as_tree']) && $options['as_tree']) { + $data = ArrayConverter::expandToTree($data); + } + + if (isset($options['inline']) && ($inline = (int) $options['inline']) > 0) { + return Yaml::dump($data, $inline); + } + + return Yaml::dump($data); + } + + protected function getExtension(): string + { + return $this->extension; + } +} diff --git a/plugins/vendor/symfony/translation/Exception/ExceptionInterface.php b/plugins/vendor/symfony/translation/Exception/ExceptionInterface.php new file mode 100644 index 00000000..8f9c54ef --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/ExceptionInterface.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Exception interface for all exceptions thrown by the component. + * + * @author Fabien Potencier + */ +interface ExceptionInterface extends \Throwable +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/IncompleteDsnException.php b/plugins/vendor/symfony/translation/Exception/IncompleteDsnException.php new file mode 100644 index 00000000..6c9247f8 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/IncompleteDsnException.php @@ -0,0 +1,24 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +class IncompleteDsnException extends InvalidArgumentException +{ + public function __construct(string $message, ?string $dsn = null, ?\Throwable $previous = null) + { + if ($dsn) { + $message = \sprintf('Invalid "%s" provider DSN: ', $dsn).$message; + } + + parent::__construct($message, 0, $previous); + } +} diff --git a/plugins/vendor/symfony/translation/Exception/InvalidArgumentException.php b/plugins/vendor/symfony/translation/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..90d06690 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/InvalidArgumentException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Base InvalidArgumentException for the Translation component. + * + * @author Abdellatif Ait boudad + */ +class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/InvalidResourceException.php b/plugins/vendor/symfony/translation/Exception/InvalidResourceException.php new file mode 100644 index 00000000..cf079432 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/InvalidResourceException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Thrown when a resource cannot be loaded. + * + * @author Fabien Potencier + */ +class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/LogicException.php b/plugins/vendor/symfony/translation/Exception/LogicException.php new file mode 100644 index 00000000..9019c7e7 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/LogicException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Base LogicException for Translation component. + * + * @author Abdellatif Ait boudad + */ +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/MissingRequiredOptionException.php b/plugins/vendor/symfony/translation/Exception/MissingRequiredOptionException.php new file mode 100644 index 00000000..8cef03a8 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/MissingRequiredOptionException.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * @author Oskar Stark + */ +class MissingRequiredOptionException extends IncompleteDsnException +{ + public function __construct(string $option, ?string $dsn = null, ?\Throwable $previous = null) + { + $message = \sprintf('The option "%s" is required but missing.', $option); + + parent::__construct($message, $dsn, $previous); + } +} diff --git a/plugins/vendor/symfony/translation/Exception/NotFoundResourceException.php b/plugins/vendor/symfony/translation/Exception/NotFoundResourceException.php new file mode 100644 index 00000000..cff73ae3 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/NotFoundResourceException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Thrown when a resource does not exist. + * + * @author Fabien Potencier + */ +class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/ProviderException.php b/plugins/vendor/symfony/translation/Exception/ProviderException.php new file mode 100644 index 00000000..70e93fc1 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/ProviderException.php @@ -0,0 +1,43 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +use Symfony\Contracts\HttpClient\ResponseInterface; + +/** + * @author Fabien Potencier + */ +class ProviderException extends RuntimeException implements ProviderExceptionInterface +{ + private string $debug; + + public function __construct( + string $message, + private ResponseInterface $response, + int $code = 0, + ?\Exception $previous = null, + ) { + $this->debug = $response->getInfo('debug') ?? ''; + + parent::__construct($message, $code, $previous); + } + + public function getResponse(): ResponseInterface + { + return $this->response; + } + + public function getDebug(): string + { + return $this->debug; + } +} diff --git a/plugins/vendor/symfony/translation/Exception/ProviderExceptionInterface.php b/plugins/vendor/symfony/translation/Exception/ProviderExceptionInterface.php new file mode 100644 index 00000000..922e8272 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/ProviderExceptionInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * @author Fabien Potencier + */ +interface ProviderExceptionInterface extends ExceptionInterface +{ + /* + * Returns debug info coming from the Symfony\Contracts\HttpClient\ResponseInterface + */ + public function getDebug(): string; +} diff --git a/plugins/vendor/symfony/translation/Exception/RuntimeException.php b/plugins/vendor/symfony/translation/Exception/RuntimeException.php new file mode 100644 index 00000000..dcd79408 --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/RuntimeException.php @@ -0,0 +1,21 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +/** + * Base RuntimeException for the Translation component. + * + * @author Abdellatif Ait boudad + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/plugins/vendor/symfony/translation/Exception/UnsupportedSchemeException.php b/plugins/vendor/symfony/translation/Exception/UnsupportedSchemeException.php new file mode 100644 index 00000000..ca18444e --- /dev/null +++ b/plugins/vendor/symfony/translation/Exception/UnsupportedSchemeException.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Exception; + +use Symfony\Component\Translation\Bridge; +use Symfony\Component\Translation\Provider\Dsn; + +class UnsupportedSchemeException extends LogicException +{ + private const SCHEME_TO_PACKAGE_MAP = [ + 'crowdin' => [ + 'class' => Bridge\Crowdin\CrowdinProviderFactory::class, + 'package' => 'symfony/crowdin-translation-provider', + ], + 'loco' => [ + 'class' => Bridge\Loco\LocoProviderFactory::class, + 'package' => 'symfony/loco-translation-provider', + ], + 'lokalise' => [ + 'class' => Bridge\Lokalise\LokaliseProviderFactory::class, + 'package' => 'symfony/lokalise-translation-provider', + ], + 'phrase' => [ + 'class' => Bridge\Phrase\PhraseProviderFactory::class, + 'package' => 'symfony/phrase-translation-provider', + ], + ]; + + public function __construct(Dsn $dsn, ?string $name = null, array $supported = []) + { + $provider = $dsn->getScheme(); + if (false !== $pos = strpos($provider, '+')) { + $provider = substr($provider, 0, $pos); + } + $package = self::SCHEME_TO_PACKAGE_MAP[$provider] ?? null; + if ($package && !class_exists($package['class'])) { + parent::__construct(\sprintf('Unable to synchronize translations via "%s" as the provider is not installed. Try running "composer require %s".', $provider, $package['package'])); + + return; + } + + $message = \sprintf('The "%s" scheme is not supported', $dsn->getScheme()); + if ($name && $supported) { + $message .= \sprintf('; supported schemes for translation provider "%s" are: "%s"', $name, implode('", "', $supported)); + } + + parent::__construct($message.'.'); + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/AbstractFileExtractor.php b/plugins/vendor/symfony/translation/Extractor/AbstractFileExtractor.php new file mode 100644 index 00000000..da4a929f --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/AbstractFileExtractor.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; + +/** + * Base class used by classes that extract translation messages from files. + * + * @author Marcos D. Sánchez + */ +abstract class AbstractFileExtractor +{ + protected function extractFiles(string|iterable $resource): iterable + { + if (is_iterable($resource)) { + $files = []; + foreach ($resource as $file) { + if ($this->canBeExtracted($file)) { + $files[] = $this->toSplFileInfo($file); + } + } + } elseif (is_file($resource)) { + $files = $this->canBeExtracted($resource) ? [$this->toSplFileInfo($resource)] : []; + } else { + $files = $this->extractFromDirectory($resource); + } + + return $files; + } + + private function toSplFileInfo(string $file): \SplFileInfo + { + return new \SplFileInfo($file); + } + + /** + * @throws InvalidArgumentException + */ + protected function isFile(string $file): bool + { + if (!is_file($file)) { + throw new InvalidArgumentException(\sprintf('The "%s" file does not exist.', $file)); + } + + return true; + } + + abstract protected function canBeExtracted(string $file): bool; + + abstract protected function extractFromDirectory(string|array $resource): iterable; +} diff --git a/plugins/vendor/symfony/translation/Extractor/ChainExtractor.php b/plugins/vendor/symfony/translation/Extractor/ChainExtractor.php new file mode 100644 index 00000000..ec9982da --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/ChainExtractor.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * ChainExtractor extracts translation messages from template files. + * + * @author Michel Salib + */ +class ChainExtractor implements ExtractorInterface +{ + /** + * The extractors. + * + * @var ExtractorInterface[] + */ + private array $extractors = []; + + /** + * Adds a loader to the translation extractor. + */ + public function addExtractor(string $format, ExtractorInterface $extractor): void + { + $this->extractors[$format] = $extractor; + } + + public function setPrefix(string $prefix): void + { + foreach ($this->extractors as $extractor) { + $extractor->setPrefix($prefix); + } + } + + public function extract(string|iterable $directory, MessageCatalogue $catalogue): void + { + foreach ($this->extractors as $extractor) { + $extractor->extract($directory, $catalogue); + } + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/ExtractorInterface.php b/plugins/vendor/symfony/translation/Extractor/ExtractorInterface.php new file mode 100644 index 00000000..642130af --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/ExtractorInterface.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * Extracts translation messages from a directory or files to the catalogue. + * New found messages are injected to the catalogue using the prefix. + * + * @author Michel Salib + */ +interface ExtractorInterface +{ + /** + * Extracts translation messages from files, a file or a directory to the catalogue. + * + * @param string|iterable $resource Files, a file or a directory + * + * @return void + */ + public function extract(string|iterable $resource, MessageCatalogue $catalogue); + + /** + * Sets the prefix that should be used for new found messages. + * + * @return void + */ + public function setPrefix(string $prefix); +} diff --git a/plugins/vendor/symfony/translation/Extractor/PhpAstExtractor.php b/plugins/vendor/symfony/translation/Extractor/PhpAstExtractor.php new file mode 100644 index 00000000..a5375f48 --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/PhpAstExtractor.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor; + +use PhpParser\NodeTraverser; +use PhpParser\NodeVisitor; +use PhpParser\Parser; +use PhpParser\ParserFactory; +use Symfony\Component\Finder\Finder; +use Symfony\Component\Translation\Extractor\Visitor\AbstractVisitor; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * PhpAstExtractor extracts translation messages from a PHP AST. + * + * @author Mathieu Santostefano + */ +final class PhpAstExtractor extends AbstractFileExtractor implements ExtractorInterface +{ + private Parser $parser; + + public function __construct( + /** + * @param iterable $visitors + */ + private readonly iterable $visitors, + private string $prefix = '', + ) { + if (!class_exists(ParserFactory::class)) { + throw new \LogicException(\sprintf('You cannot use "%s" as the "nikic/php-parser" package is not installed. Try running "composer require nikic/php-parser".', static::class)); + } + + $this->parser = (new ParserFactory())->createForHostVersion(); + } + + public function extract(iterable|string $resource, MessageCatalogue $catalogue): void + { + foreach ($this->extractFiles($resource) as $file) { + $traverser = new NodeTraverser(); + + // This is needed to resolve namespaces in class methods/constants. + $nameResolver = new NodeVisitor\NameResolver(); + $traverser->addVisitor($nameResolver); + + /** @var AbstractVisitor&NodeVisitor $visitor */ + foreach ($this->visitors as $visitor) { + $visitor->initialize($catalogue, $file, $this->prefix); + $traverser->addVisitor($visitor); + } + + $nodes = $this->parser->parse(file_get_contents($file)); + $traverser->traverse($nodes); + } + } + + public function setPrefix(string $prefix): void + { + $this->prefix = $prefix; + } + + protected function canBeExtracted(string $file): bool + { + return 'php' === pathinfo($file, \PATHINFO_EXTENSION) + && $this->isFile($file) + && preg_match('/\bt\(|->trans\(|TranslatableMessage|Symfony\\\\Component\\\\Validator\\\\Constraints/i', file_get_contents($file)); + } + + protected function extractFromDirectory(array|string $resource): iterable|Finder + { + if (!class_exists(Finder::class)) { + throw new \LogicException(\sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class)); + } + + return (new Finder())->files()->name('*.php')->in($resource); + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php b/plugins/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php new file mode 100644 index 00000000..c3368961 --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/Visitor/AbstractVisitor.php @@ -0,0 +1,135 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * @author Mathieu Santostefano + */ +abstract class AbstractVisitor +{ + private MessageCatalogue $catalogue; + private \SplFileInfo $file; + private string $messagePrefix; + + public function initialize(MessageCatalogue $catalogue, \SplFileInfo $file, string $messagePrefix): void + { + $this->catalogue = $catalogue; + $this->file = $file; + $this->messagePrefix = $messagePrefix; + } + + protected function addMessageToCatalogue(string $message, ?string $domain, int $line): void + { + $domain ??= 'messages'; + $this->catalogue->set($message, $this->messagePrefix.$message, $domain); + $metadata = $this->catalogue->getMetadata($message, $domain) ?? []; + $normalizedFilename = preg_replace('{[\\\\/]+}', '/', $this->file); + $metadata['sources'][] = $normalizedFilename.':'.$line; + $this->catalogue->setMetadata($message, $metadata, $domain); + } + + protected function getStringArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node, int|string $index, bool $indexIsRegex = false): array + { + if (\is_string($index)) { + return $this->getStringNamedArguments($node, $index, $indexIsRegex); + } + + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + if (!($arg = $args[$index] ?? null) instanceof Node\Arg) { + return []; + } + + return (array) $this->getStringValue($arg->value); + } + + protected function hasNodeNamedArguments(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node): bool + { + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + foreach ($args as $arg) { + if ($arg instanceof Node\Arg && null !== $arg->name) { + return true; + } + } + + return false; + } + + protected function nodeFirstNamedArgumentIndex(Node\Expr\CallLike|Node\Attribute|Node\Expr\New_ $node): int + { + $args = $node instanceof Node\Expr\CallLike ? $node->getRawArgs() : $node->args; + + foreach ($args as $i => $arg) { + if ($arg instanceof Node\Arg && null !== $arg->name) { + return $i; + } + } + + return \PHP_INT_MAX; + } + + private function getStringNamedArguments(Node\Expr\CallLike|Node\Attribute $node, ?string $argumentName = null, bool $isArgumentNamePattern = false): array + { + $args = $node instanceof Node\Expr\CallLike ? $node->getArgs() : $node->args; + $argumentValues = []; + + foreach ($args as $arg) { + if (!$isArgumentNamePattern && $arg->name?->toString() === $argumentName) { + $argumentValues[] = $this->getStringValue($arg->value); + } elseif ($isArgumentNamePattern && preg_match($argumentName, $arg->name?->toString() ?? '') > 0) { + $argumentValues[] = $this->getStringValue($arg->value); + } + } + + return array_filter($argumentValues); + } + + private function getStringValue(Node $node): ?string + { + if ($node instanceof Node\Scalar\String_) { + return $node->value; + } + + if ($node instanceof Node\Expr\BinaryOp\Concat) { + if (null === $left = $this->getStringValue($node->left)) { + return null; + } + + if (null === $right = $this->getStringValue($node->right)) { + return null; + } + + return $left.$right; + } + + if ($node instanceof Node\Expr\Assign && $node->expr instanceof Node\Scalar\String_) { + return $node->expr->value; + } + + if ($node instanceof Node\Expr\ClassConstFetch) { + try { + $reflection = new \ReflectionClass($node->class->toString()); + $constant = $reflection->getReflectionConstant($node->name->toString()); + if (false !== $constant && \is_string($constant->getValue())) { + return $constant->getValue(); + } + } catch (\ReflectionException) { + } + } + + return null; + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php b/plugins/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php new file mode 100644 index 00000000..45cae353 --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/Visitor/ConstraintVisitor.php @@ -0,0 +1,112 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + * + * Code mostly comes from https://github.com/php-translation/extractor/blob/master/src/Visitor/Php/Symfony/Constraint.php + */ +final class ConstraintVisitor extends AbstractVisitor implements NodeVisitor +{ + public function __construct( + private readonly array $constraintClassNames = [], + ) { + } + + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\New_ && !$node instanceof Node\Attribute) { + return null; + } + + $className = $node instanceof Node\Attribute ? $node->name : $node->class; + if (!$className instanceof Node\Name) { + return null; + } + + $parts = $className->getParts(); + $isConstraintClass = false; + + foreach ($parts as $part) { + if (\in_array($part, $this->constraintClassNames, true)) { + $isConstraintClass = true; + + break; + } + } + + if (!$isConstraintClass) { + return null; + } + + $arg = $node->args[0] ?? null; + if (!$arg instanceof Node\Arg) { + return null; + } + + if ($this->hasNodeNamedArguments($node)) { + $messages = $this->getStringArguments($node, '/message/i', true); + } else { + if (!$arg->value instanceof Node\Expr\Array_) { + // There is no way to guess which argument is a message to be translated. + return null; + } + + $messages = []; + $options = $arg->value; + + /** @var Node\Expr\ArrayItem $item */ + foreach ($options->items as $item) { + if (!$item->key instanceof Node\Scalar\String_) { + continue; + } + + if (false === stripos($item->key->value ?? '', 'message')) { + continue; + } + + if (!$item->value instanceof Node\Scalar\String_) { + continue; + } + + $messages[] = $item->value->value; + + break; + } + } + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, 'validators', $node->getStartLine()); + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php b/plugins/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php new file mode 100644 index 00000000..a3dcd6d2 --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/Visitor/TransMethodVisitor.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + */ +final class TransMethodVisitor extends AbstractVisitor implements NodeVisitor +{ + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\MethodCall && !$node instanceof Node\Expr\FuncCall) { + return null; + } + + if (!\is_string($node->name) && !$node->name instanceof Node\Identifier && !$node->name instanceof Node\Name) { + return null; + } + + $name = $node->name instanceof Node\Name ? $node->name->getLast() : (string) $node->name; + + if ('trans' === $name || 't' === $name) { + $firstNamedArgumentIndex = $this->nodeFirstNamedArgumentIndex($node); + + if (!$messages = $this->getStringArguments($node, 0 < $firstNamedArgumentIndex ? 0 : 'id')) { + return null; + } + + $domain = $this->getStringArguments($node, 2 < $firstNamedArgumentIndex ? 2 : 'domain')[0] ?? null; + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); + } + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/plugins/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php b/plugins/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php new file mode 100644 index 00000000..6bd8bb02 --- /dev/null +++ b/plugins/vendor/symfony/translation/Extractor/Visitor/TranslatableMessageVisitor.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Extractor\Visitor; + +use PhpParser\Node; +use PhpParser\NodeVisitor; + +/** + * @author Mathieu Santostefano + */ +final class TranslatableMessageVisitor extends AbstractVisitor implements NodeVisitor +{ + public function beforeTraverse(array $nodes): ?Node + { + return null; + } + + public function enterNode(Node $node): ?Node + { + return null; + } + + public function leaveNode(Node $node): ?Node + { + if (!$node instanceof Node\Expr\New_) { + return null; + } + + if (!($className = $node->class) instanceof Node\Name) { + return null; + } + + if (!\in_array('TranslatableMessage', $className->getParts(), true)) { + return null; + } + + $firstNamedArgumentIndex = $this->nodeFirstNamedArgumentIndex($node); + + if (!$messages = $this->getStringArguments($node, 0 < $firstNamedArgumentIndex ? 0 : 'message')) { + return null; + } + + $domain = $this->getStringArguments($node, 2 < $firstNamedArgumentIndex ? 2 : 'domain')[0] ?? null; + + foreach ($messages as $message) { + $this->addMessageToCatalogue($message, $domain, $node->getStartLine()); + } + + return null; + } + + public function afterTraverse(array $nodes): ?Node + { + return null; + } +} diff --git a/plugins/vendor/symfony/translation/Formatter/IntlFormatter.php b/plugins/vendor/symfony/translation/Formatter/IntlFormatter.php new file mode 100644 index 00000000..87cb0073 --- /dev/null +++ b/plugins/vendor/symfony/translation/Formatter/IntlFormatter.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Formatter; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\LogicException; + +/** + * @author Guilherme Blanco + * @author Abdellatif Ait boudad + */ +class IntlFormatter implements IntlFormatterInterface +{ + private bool $hasMessageFormatter; + private array $cache = []; + + public function formatIntl(string $message, string $locale, array $parameters = []): string + { + // MessageFormatter constructor throws an exception if the message is empty + if ('' === $message) { + return ''; + } + + if (!$formatter = $this->cache[$locale][$message] ?? null) { + if (!$this->hasMessageFormatter ??= class_exists(\MessageFormatter::class)) { + throw new LogicException('Cannot parse message translation: please install the "intl" PHP extension or the "symfony/polyfill-intl-messageformatter" package.'); + } + try { + $this->cache[$locale][$message] = $formatter = new \MessageFormatter($locale, $message); + } catch (\IntlException $e) { + throw new InvalidArgumentException(\sprintf('Invalid message format (error #%d): ', intl_get_error_code()).intl_get_error_message(), 0, $e); + } + } + + foreach ($parameters as $key => $value) { + if (\in_array($key[0] ?? null, ['%', '{'], true)) { + unset($parameters[$key]); + $parameters[trim($key, '%{ }')] = $value; + } + } + + if (false === $message = $formatter->format($parameters)) { + throw new InvalidArgumentException(\sprintf('Unable to format message (error #%s): ', $formatter->getErrorCode()).$formatter->getErrorMessage()); + } + + return $message; + } +} diff --git a/plugins/vendor/symfony/translation/Formatter/IntlFormatterInterface.php b/plugins/vendor/symfony/translation/Formatter/IntlFormatterInterface.php new file mode 100644 index 00000000..02fc6acb --- /dev/null +++ b/plugins/vendor/symfony/translation/Formatter/IntlFormatterInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Formatter; + +/** + * Formats ICU message patterns. + * + * @author Nicolas Grekas + */ +interface IntlFormatterInterface +{ + /** + * Formats a localized message using rules defined by ICU MessageFormat. + * + * @see http://icu-project.org/apiref/icu4c/classMessageFormat.html#details + */ + public function formatIntl(string $message, string $locale, array $parameters = []): string; +} diff --git a/plugins/vendor/symfony/translation/Formatter/MessageFormatter.php b/plugins/vendor/symfony/translation/Formatter/MessageFormatter.php new file mode 100644 index 00000000..d5255bdc --- /dev/null +++ b/plugins/vendor/symfony/translation/Formatter/MessageFormatter.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Formatter; + +use Symfony\Component\Translation\IdentityTranslator; +use Symfony\Contracts\Translation\TranslatorInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(IntlFormatter::class); + +/** + * @author Abdellatif Ait boudad + */ +class MessageFormatter implements MessageFormatterInterface, IntlFormatterInterface +{ + private TranslatorInterface $translator; + private IntlFormatterInterface $intlFormatter; + + /** + * @param TranslatorInterface|null $translator An identity translator to use as selector for pluralization + */ + public function __construct(?TranslatorInterface $translator = null, ?IntlFormatterInterface $intlFormatter = null) + { + $this->translator = $translator ?? new IdentityTranslator(); + $this->intlFormatter = $intlFormatter ?? new IntlFormatter(); + } + + public function format(string $message, string $locale, array $parameters = []): string + { + return $this->translator->trans($message, $parameters, null, $locale); + } + + public function formatIntl(string $message, string $locale, array $parameters = []): string + { + return $this->intlFormatter->formatIntl($message, $locale, $parameters); + } +} diff --git a/plugins/vendor/symfony/translation/Formatter/MessageFormatterInterface.php b/plugins/vendor/symfony/translation/Formatter/MessageFormatterInterface.php new file mode 100644 index 00000000..d5c41c19 --- /dev/null +++ b/plugins/vendor/symfony/translation/Formatter/MessageFormatterInterface.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Formatter; + +/** + * @author Guilherme Blanco + * @author Abdellatif Ait boudad + */ +interface MessageFormatterInterface +{ + /** + * Formats a localized message pattern with given arguments. + * + * @param string $message The message (may also be an object that can be cast to string) + * @param string $locale The message locale + * @param array $parameters An array of parameters for the message + */ + public function format(string $message, string $locale, array $parameters = []): string; +} diff --git a/plugins/vendor/symfony/translation/IdentityTranslator.php b/plugins/vendor/symfony/translation/IdentityTranslator.php new file mode 100644 index 00000000..46875edf --- /dev/null +++ b/plugins/vendor/symfony/translation/IdentityTranslator.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatorInterface; +use Symfony\Contracts\Translation\TranslatorTrait; + +/** + * IdentityTranslator does not translate anything. + * + * @author Fabien Potencier + */ +class IdentityTranslator implements TranslatorInterface, LocaleAwareInterface +{ + use TranslatorTrait; +} diff --git a/plugins/vendor/symfony/translation/LICENSE b/plugins/vendor/symfony/translation/LICENSE new file mode 100644 index 00000000..0138f8f0 --- /dev/null +++ b/plugins/vendor/symfony/translation/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/symfony/translation/Loader/ArrayLoader.php b/plugins/vendor/symfony/translation/Loader/ArrayLoader.php new file mode 100644 index 00000000..e63a7d05 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/ArrayLoader.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * ArrayLoader loads translations from a PHP array. + * + * @author Fabien Potencier + */ +class ArrayLoader implements LoaderInterface +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + $resource = $this->flatten($resource); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($resource, $domain); + + return $catalogue; + } + + /** + * Flattens an nested array of translations. + * + * The scheme used is: + * 'key' => ['key2' => ['key3' => 'value']] + * Becomes: + * 'key.key2.key3' => 'value' + */ + private function flatten(array $messages): array + { + $result = []; + foreach ($messages as $key => $value) { + if (\is_array($value)) { + foreach ($this->flatten($value) as $k => $v) { + if (null !== $v) { + $result[$key.'.'.$k] = $v; + } + } + } elseif (null !== $value) { + $result[$key] = $value; + } + } + + return $result; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/CsvFileLoader.php b/plugins/vendor/symfony/translation/Loader/CsvFileLoader.php new file mode 100644 index 00000000..9b610f65 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/CsvFileLoader.php @@ -0,0 +1,69 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\NotFoundResourceException; + +/** + * CsvFileLoader loads translations from CSV files. + * + * @author Saša Stamenković + */ +class CsvFileLoader extends FileLoader +{ + private string $delimiter = ';'; + private string $enclosure = '"'; + /** + * @deprecated since Symfony 7.2, to be removed in 8.0 + */ + private string $escape = ''; + + protected function loadResource(string $resource): array + { + $messages = []; + + try { + $file = new \SplFileObject($resource, 'rb'); + } catch (\RuntimeException $e) { + throw new NotFoundResourceException(\sprintf('Error opening file "%s".', $resource), 0, $e); + } + + $file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY); + $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); + + foreach ($file as $data) { + if (false === $data) { + continue; + } + + if (!str_starts_with($data[0], '#') && isset($data[1]) && 2 === \count($data)) { + $messages[$data[0]] = $data[1]; + } + } + + return $messages; + } + + /** + * Sets the delimiter, enclosure, and escape character for CSV. + */ + public function setCsvControl(string $delimiter = ';', string $enclosure = '"', string $escape = ''): void + { + $this->delimiter = $delimiter; + $this->enclosure = $enclosure; + if ('' !== $escape) { + trigger_deprecation('symfony/translation', '7.2', 'The "escape" parameter of the "%s" method is deprecated. It will be removed in 8.0.', __METHOD__); + } + + $this->escape = $escape; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/FileLoader.php b/plugins/vendor/symfony/translation/Loader/FileLoader.php new file mode 100644 index 00000000..94f6e202 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/FileLoader.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * @author Abdellatif Ait boudad + */ +abstract class FileLoader extends ArrayLoader +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); + } + + $messages = $this->loadResource($resource); + + // empty resource + $messages ??= []; + + // not an array + if (!\is_array($messages)) { + throw new InvalidResourceException(\sprintf('Unable to load file "%s".', $resource)); + } + + $catalogue = parent::load($messages, $locale, $domain); + + if (class_exists(FileResource::class)) { + $catalogue->addResource(new FileResource($resource)); + } + + return $catalogue; + } + + /** + * @throws InvalidResourceException if stream content has an invalid format + */ + abstract protected function loadResource(string $resource): array; +} diff --git a/plugins/vendor/symfony/translation/Loader/IcuDatFileLoader.php b/plugins/vendor/symfony/translation/Loader/IcuDatFileLoader.php new file mode 100644 index 00000000..1af86430 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/IcuDatFileLoader.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IcuResFileLoader loads translations from a resource bundle. + * + * @author stealth35 + */ +class IcuDatFileLoader extends IcuResFileLoader +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + if (!stream_is_local($resource.'.dat')) { + throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource.'.dat')) { + throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); + } + + try { + $rb = new \ResourceBundle($locale, $resource); + } catch (\Exception) { + $rb = null; + } + + if (!$rb) { + throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource)); + } elseif (intl_is_failure($rb->getErrorCode())) { + throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); + } + + $messages = $this->flatten($rb); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($messages, $domain); + + if (class_exists(FileResource::class)) { + $catalogue->addResource(new FileResource($resource.'.dat')); + } + + return $catalogue; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/IcuResFileLoader.php b/plugins/vendor/symfony/translation/Loader/IcuResFileLoader.php new file mode 100644 index 00000000..8ada43dc --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -0,0 +1,86 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Resource\DirectoryResource; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * IcuResFileLoader loads translations from a resource bundle. + * + * @author stealth35 + */ +class IcuResFileLoader implements LoaderInterface +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); + } + + if (!is_dir($resource)) { + throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); + } + + try { + $rb = new \ResourceBundle($locale, $resource); + } catch (\Exception) { + $rb = null; + } + + if (!$rb) { + throw new InvalidResourceException(\sprintf('Cannot load resource "%s".', $resource)); + } elseif (intl_is_failure($rb->getErrorCode())) { + throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); + } + + $messages = $this->flatten($rb); + $catalogue = new MessageCatalogue($locale); + $catalogue->add($messages, $domain); + + if (class_exists(DirectoryResource::class)) { + $catalogue->addResource(new DirectoryResource($resource)); + } + + return $catalogue; + } + + /** + * Flattens an ResourceBundle. + * + * The scheme used is: + * key { key2 { key3 { "value" } } } + * Becomes: + * 'key.key2.key3' => 'value' + * + * This function takes an array by reference and will modify it + * + * @param \ResourceBundle $rb The ResourceBundle that will be flattened + * @param array $messages Used internally for recursive calls + * @param string|null $path Current path being parsed, used internally for recursive calls + */ + protected function flatten(\ResourceBundle $rb, array &$messages = [], ?string $path = null): array + { + foreach ($rb as $key => $value) { + $nodePath = $path ? $path.'.'.$key : $key; + if ($value instanceof \ResourceBundle) { + $this->flatten($value, $messages, $nodePath); + } else { + $messages[$nodePath] = $value; + } + } + + return $messages; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/IniFileLoader.php b/plugins/vendor/symfony/translation/Loader/IniFileLoader.php new file mode 100644 index 00000000..3126896c --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/IniFileLoader.php @@ -0,0 +1,25 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * IniFileLoader loads translations from an ini file. + * + * @author stealth35 + */ +class IniFileLoader extends FileLoader +{ + protected function loadResource(string $resource): array + { + return parse_ini_file($resource, true); + } +} diff --git a/plugins/vendor/symfony/translation/Loader/JsonFileLoader.php b/plugins/vendor/symfony/translation/Loader/JsonFileLoader.php new file mode 100644 index 00000000..385553ef --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/JsonFileLoader.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; + +/** + * JsonFileLoader loads translations from an json file. + * + * @author singles + */ +class JsonFileLoader extends FileLoader +{ + protected function loadResource(string $resource): array + { + $messages = []; + if ($data = file_get_contents($resource)) { + $messages = json_decode($data, true); + + if (0 < $errorCode = json_last_error()) { + throw new InvalidResourceException('Error parsing JSON: '.$this->getJSONErrorMessage($errorCode)); + } + } + + return $messages; + } + + /** + * Translates JSON_ERROR_* constant into meaningful message. + */ + private function getJSONErrorMessage(int $errorCode): string + { + return match ($errorCode) { + \JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + \JSON_ERROR_STATE_MISMATCH => 'Underflow or the modes mismatch', + \JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + \JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON', + \JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly incorrectly encoded', + default => 'Unknown error', + }; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/LoaderInterface.php b/plugins/vendor/symfony/translation/Loader/LoaderInterface.php new file mode 100644 index 00000000..29d5560d --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/LoaderInterface.php @@ -0,0 +1,32 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * LoaderInterface is the interface implemented by all translation loaders. + * + * @author Fabien Potencier + */ +interface LoaderInterface +{ + /** + * Loads a locale. + * + * @throws NotFoundResourceException when the resource cannot be found + * @throws InvalidResourceException when the resource cannot be loaded + */ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue; +} diff --git a/plugins/vendor/symfony/translation/Loader/MoFileLoader.php b/plugins/vendor/symfony/translation/Loader/MoFileLoader.php new file mode 100644 index 00000000..8427c393 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/MoFileLoader.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; + +/** + * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) + */ +class MoFileLoader extends FileLoader +{ + /** + * Magic used for validating the format of an MO file as well as + * detecting if the machine used to create that file was little endian. + */ + public const MO_LITTLE_ENDIAN_MAGIC = 0x950412DE; + + /** + * Magic used for validating the format of an MO file as well as + * detecting if the machine used to create that file was big endian. + */ + public const MO_BIG_ENDIAN_MAGIC = 0xDE120495; + + /** + * The size of the header of an MO file in bytes. + */ + public const MO_HEADER_SIZE = 28; + + /** + * Parses machine object (MO) format, independent of the machine's endian it + * was created on. Both 32bit and 64bit systems are supported. + */ + protected function loadResource(string $resource): array + { + $stream = fopen($resource, 'r'); + + $stat = fstat($stream); + + if ($stat['size'] < self::MO_HEADER_SIZE) { + throw new InvalidResourceException('MO stream content has an invalid format.'); + } + $magic = unpack('V1', fread($stream, 4)); + $magic = hexdec(substr(dechex(current($magic)), -8)); + + if (self::MO_LITTLE_ENDIAN_MAGIC == $magic) { + $isBigEndian = false; + } elseif (self::MO_BIG_ENDIAN_MAGIC == $magic) { + $isBigEndian = true; + } else { + throw new InvalidResourceException('MO stream content has an invalid format.'); + } + + // formatRevision + $this->readLong($stream, $isBigEndian); + $count = $this->readLong($stream, $isBigEndian); + $offsetId = $this->readLong($stream, $isBigEndian); + $offsetTranslated = $this->readLong($stream, $isBigEndian); + // sizeHashes + $this->readLong($stream, $isBigEndian); + // offsetHashes + $this->readLong($stream, $isBigEndian); + + $messages = []; + + for ($i = 0; $i < $count; ++$i) { + $pluralId = null; + $translated = null; + + fseek($stream, $offsetId + $i * 8); + + $length = $this->readLong($stream, $isBigEndian); + $offset = $this->readLong($stream, $isBigEndian); + + if ($length < 1) { + continue; + } + + fseek($stream, $offset); + $singularId = fread($stream, $length); + + if (str_contains($singularId, "\000")) { + [$singularId, $pluralId] = explode("\000", $singularId); + } + + fseek($stream, $offsetTranslated + $i * 8); + $length = $this->readLong($stream, $isBigEndian); + $offset = $this->readLong($stream, $isBigEndian); + + if ($length < 1) { + continue; + } + + fseek($stream, $offset); + $translated = fread($stream, $length); + + if (str_contains($translated, "\000")) { + $translated = explode("\000", $translated); + } + + $ids = ['singular' => $singularId, 'plural' => $pluralId]; + $item = compact('ids', 'translated'); + + if (!empty($item['ids']['singular'])) { + $id = $item['ids']['singular']; + if (isset($item['ids']['plural'])) { + $id .= '|'.$item['ids']['plural']; + } + $messages[$id] = stripcslashes(implode('|', (array) $item['translated'])); + } + } + + fclose($stream); + + return array_filter($messages); + } + + /** + * Reads an unsigned long from stream respecting endianness. + * + * @param resource $stream + */ + private function readLong($stream, bool $isBigEndian): int + { + $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); + $result = current($result); + + return (int) substr($result, -8); + } +} diff --git a/plugins/vendor/symfony/translation/Loader/PhpFileLoader.php b/plugins/vendor/symfony/translation/Loader/PhpFileLoader.php new file mode 100644 index 00000000..541b6c83 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * PhpFileLoader loads translations from PHP files returning an array of translations. + * + * @author Fabien Potencier + */ +class PhpFileLoader extends FileLoader +{ + private static ?array $cache = []; + + protected function loadResource(string $resource): array + { + if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOL) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOL))) { + self::$cache = null; + } + + if (null === self::$cache) { + return require $resource; + } + + return self::$cache[$resource] ??= require $resource; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/PoFileLoader.php b/plugins/vendor/symfony/translation/Loader/PoFileLoader.php new file mode 100644 index 00000000..4f8aeb2c --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/PoFileLoader.php @@ -0,0 +1,147 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +/** + * @copyright Copyright (c) 2010, Union of RAD https://github.com/UnionOfRAD/lithium + * @copyright Copyright (c) 2012, Clemens Tolboom + */ +class PoFileLoader extends FileLoader +{ + /** + * Parses portable object (PO) format. + * + * From https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files + * we should be able to parse files having: + * + * white-space + * # translator-comments + * #. extracted-comments + * #: reference... + * #, flag... + * #| msgid previous-untranslated-string + * msgid untranslated-string + * msgstr translated-string + * + * extra or different lines are: + * + * #| msgctxt previous-context + * #| msgid previous-untranslated-string + * msgctxt context + * + * #| msgid previous-untranslated-string-singular + * #| msgid_plural previous-untranslated-string-plural + * msgid untranslated-string-singular + * msgid_plural untranslated-string-plural + * msgstr[0] translated-string-case-0 + * ... + * msgstr[N] translated-string-case-n + * + * The definition states: + * - white-space and comments are optional. + * - msgid "" that an empty singleline defines a header. + * + * This parser sacrifices some features of the reference implementation the + * differences to that implementation are as follows. + * - No support for comments spanning multiple lines. + * - Translator and extracted comments are treated as being the same type. + * - Message IDs are allowed to have other encodings as just US-ASCII. + * + * Items with an empty id are ignored. + */ + protected function loadResource(string $resource): array + { + $stream = fopen($resource, 'r'); + + $defaults = [ + 'ids' => [], + 'translated' => null, + ]; + + $messages = []; + $item = $defaults; + $flags = []; + + while ($line = fgets($stream)) { + $line = trim($line); + + if ('' === $line) { + // Whitespace indicated current item is done + if (!\in_array('fuzzy', $flags, true)) { + $this->addMessage($messages, $item); + } + $item = $defaults; + $flags = []; + } elseif (str_starts_with($line, '#,')) { + $flags = array_map('trim', explode(',', substr($line, 2))); + } elseif (str_starts_with($line, 'msgid "')) { + // We start a new msg so save previous + // TODO: this fails when comments or contexts are added + $this->addMessage($messages, $item); + $item = $defaults; + $item['ids']['singular'] = substr($line, 7, -1); + } elseif (str_starts_with($line, 'msgstr "')) { + $item['translated'] = substr($line, 8, -1); + } elseif ('"' === $line[0]) { + $continues = isset($item['translated']) ? 'translated' : 'ids'; + + if (\is_array($item[$continues])) { + end($item[$continues]); + $item[$continues][key($item[$continues])] .= substr($line, 1, -1); + } else { + $item[$continues] .= substr($line, 1, -1); + } + } elseif (str_starts_with($line, 'msgid_plural "')) { + $item['ids']['plural'] = substr($line, 14, -1); + } elseif (str_starts_with($line, 'msgstr[')) { + $size = strpos($line, ']'); + $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); + } + } + // save last item + if (!\in_array('fuzzy', $flags, true)) { + $this->addMessage($messages, $item); + } + fclose($stream); + + return $messages; + } + + /** + * Save a translation item to the messages. + * + * A .po file could contain by error missing plural indexes. We need to + * fix these before saving them. + */ + private function addMessage(array &$messages, array $item): void + { + if (!empty($item['ids']['singular'])) { + $id = stripcslashes($item['ids']['singular']); + if (isset($item['ids']['plural'])) { + $id .= '|'.stripcslashes($item['ids']['plural']); + } + + $translated = (array) $item['translated']; + // PO are by definition indexed so sort by index. + ksort($translated); + // Make sure every index is filled. + end($translated); + $count = key($translated); + // Fill missing spots with '-'. + $empties = array_fill(0, $count + 1, '-'); + $translated += $empties; + ksort($translated); + + $messages[$id] = stripcslashes(implode('|', $translated)); + } + } +} diff --git a/plugins/vendor/symfony/translation/Loader/QtFileLoader.php b/plugins/vendor/symfony/translation/Loader/QtFileLoader.php new file mode 100644 index 00000000..c9554bf5 --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/QtFileLoader.php @@ -0,0 +1,78 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\Exception\RuntimeException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * QtFileLoader loads translations from QT Translations XML files. + * + * @author Benjamin Eberlei + */ +class QtFileLoader implements LoaderInterface +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + if (!class_exists(XmlUtils::class)) { + throw new RuntimeException('Loading translations from the QT format requires the Symfony Config component.'); + } + + if (!stream_is_local($resource)) { + throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); + } + + try { + $dom = XmlUtils::loadFile($resource); + } catch (\InvalidArgumentException $e) { + throw new InvalidResourceException(\sprintf('Unable to load "%s".', $resource), $e->getCode(), $e); + } + + $internalErrors = libxml_use_internal_errors(true); + libxml_clear_errors(); + + $xpath = new \DOMXPath($dom); + $nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]'); + + $catalogue = new MessageCatalogue($locale); + if (1 == $nodes->length) { + $translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message'); + foreach ($translations as $translation) { + $translationValue = (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue; + + if ($translationValue) { + $catalogue->set( + (string) $translation->getElementsByTagName('source')->item(0)->nodeValue, + $translationValue, + $domain + ); + } + } + + if (class_exists(FileResource::class)) { + $catalogue->addResource(new FileResource($resource)); + } + } + + libxml_use_internal_errors($internalErrors); + + return $catalogue; + } +} diff --git a/plugins/vendor/symfony/translation/Loader/XliffFileLoader.php b/plugins/vendor/symfony/translation/Loader/XliffFileLoader.php new file mode 100644 index 00000000..e76245da --- /dev/null +++ b/plugins/vendor/symfony/translation/Loader/XliffFileLoader.php @@ -0,0 +1,248 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Config\Resource\FileResource; +use Symfony\Component\Config\Util\Exception\InvalidXmlException; +use Symfony\Component\Config\Util\Exception\XmlParsingException; +use Symfony\Component\Config\Util\XmlUtils; +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\Exception\RuntimeException; +use Symfony\Component\Translation\MessageCatalogue; +use Symfony\Component\Translation\Util\XliffUtils; + +/** + * XliffFileLoader loads translations from XLIFF files. + * + * @author Fabien Potencier + */ +class XliffFileLoader implements LoaderInterface +{ + public function load(mixed $resource, string $locale, string $domain = 'messages'): MessageCatalogue + { + if (!class_exists(XmlUtils::class)) { + throw new RuntimeException('Loading translations from the Xliff format requires the Symfony Config component.'); + } + + if (!$this->isXmlString($resource)) { + if (!stream_is_local($resource)) { + throw new InvalidResourceException(\sprintf('This is not a local file "%s".', $resource)); + } + + if (!file_exists($resource)) { + throw new NotFoundResourceException(\sprintf('File "%s" not found.', $resource)); + } + + if (!is_file($resource)) { + throw new InvalidResourceException(\sprintf('This is neither a file nor an XLIFF string "%s".', $resource)); + } + } + + try { + if ($this->isXmlString($resource)) { + $dom = XmlUtils::parse($resource); + } else { + $dom = XmlUtils::loadFile($resource); + } + } catch (\InvalidArgumentException|XmlParsingException|InvalidXmlException $e) { + throw new InvalidResourceException(\sprintf('Unable to load "%s": ', $resource).$e->getMessage(), $e->getCode(), $e); + } + + if ($errors = XliffUtils::validateSchema($dom)) { + throw new InvalidResourceException(\sprintf('Invalid resource provided: "%s"; Errors: ', $resource).XliffUtils::getErrorsAsString($errors)); + } + + $catalogue = new MessageCatalogue($locale); + $this->extract($dom, $catalogue, $domain); + + if (is_file($resource) && class_exists(FileResource::class)) { + $catalogue->addResource(new FileResource($resource)); + } + + return $catalogue; + } + + private function extract(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void + { + $xliffVersion = XliffUtils::getVersionNumber($dom); + + if ('1.2' === $xliffVersion) { + $this->extractXliff1($dom, $catalogue, $domain); + } + + if ('2.0' === $xliffVersion) { + $this->extractXliff2($dom, $catalogue, $domain); + } + } + + /** + * Extract messages and metadata from DOMDocument into a MessageCatalogue. + */ + private function extractXliff1(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void + { + $xml = simplexml_import_dom($dom); + $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; + + $namespace = 'urn:oasis:names:tc:xliff:document:1.2'; + $xml->registerXPathNamespace('xliff', $namespace); + + foreach ($xml->xpath('//xliff:file') as $file) { + $fileAttributes = $file->attributes(); + + $file->registerXPathNamespace('xliff', $namespace); + + foreach ($file->xpath('.//xliff:prop') as $prop) { + $catalogue->setCatalogueMetadata($prop->attributes()['prop-type'], (string) $prop, $domain); + } + + foreach ($file->xpath('.//xliff:trans-unit') as $translation) { + $attributes = $translation->attributes(); + + if (!(isset($attributes['resname']) || isset($translation->source))) { + continue; + } + + $source = (string) (isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source); + + if (isset($translation->target) + && 'needs-translation' === (string) $translation->target->attributes()['state'] + && \in_array((string) $translation->target, [$source, (string) $translation->source], true) + ) { + continue; + } + + // If the xlf file has another encoding specified, try to convert it because + // simple_xml will always return utf-8 encoded values + $target = $this->utf8ToCharset((string) ($translation->target ?? $translation->source), $encoding); + + $catalogue->set($source, $target, $domain); + + $metadata = [ + 'source' => (string) $translation->source, + 'file' => [ + 'original' => (string) $fileAttributes['original'], + ], + ]; + if ($notes = $this->parseNotesMetadata($translation->note, $encoding)) { + $metadata['notes'] = $notes; + } + + if (isset($translation->target) && $translation->target->attributes()) { + $metadata['target-attributes'] = []; + foreach ($translation->target->attributes() as $key => $value) { + $metadata['target-attributes'][$key] = (string) $value; + } + } + + if (isset($attributes['id'])) { + $metadata['id'] = (string) $attributes['id']; + } + + $catalogue->setMetadata($source, $metadata, $domain); + } + } + } + + private function extractXliff2(\DOMDocument $dom, MessageCatalogue $catalogue, string $domain): void + { + $xml = simplexml_import_dom($dom); + $encoding = $dom->encoding ? strtoupper($dom->encoding) : null; + + $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:2.0'); + + foreach ($xml->xpath('//xliff:unit') as $unit) { + foreach ($unit->segment as $segment) { + $attributes = $unit->attributes(); + $source = $attributes['name'] ?? $segment->source; + + // If the xlf file has another encoding specified, try to convert it because + // simple_xml will always return utf-8 encoded values + $target = $this->utf8ToCharset((string) ($segment->target ?? $segment->source), $encoding); + + $catalogue->set((string) $source, $target, $domain); + + $metadata = []; + if ($segment->attributes()) { + $metadata['segment-attributes'] = []; + foreach ($segment->attributes() as $key => $value) { + $metadata['segment-attributes'][$key] = (string) $value; + } + } + + if (isset($segment->target) && $segment->target->attributes()) { + $metadata['target-attributes'] = []; + foreach ($segment->target->attributes() as $key => $value) { + $metadata['target-attributes'][$key] = (string) $value; + } + } + + if (isset($unit->notes)) { + $metadata['notes'] = []; + foreach ($unit->notes->note as $noteNode) { + $note = []; + foreach ($noteNode->attributes() as $key => $value) { + $note[$key] = (string) $value; + } + $note['content'] = (string) $noteNode; + $metadata['notes'][] = $note; + } + } + + $catalogue->setMetadata((string) $source, $metadata, $domain); + } + } + } + + /** + * Convert a UTF8 string to the specified encoding. + */ + private function utf8ToCharset(string $content, ?string $encoding = null): string + { + if ('UTF-8' !== $encoding && $encoding) { + return mb_convert_encoding($content, $encoding, 'UTF-8'); + } + + return $content; + } + + private function parseNotesMetadata(?\SimpleXMLElement $noteElement = null, ?string $encoding = null): array + { + $notes = []; + + if (null === $noteElement) { + return $notes; + } + + /** @var \SimpleXMLElement $xmlNote */ + foreach ($noteElement as $xmlNote) { + $noteAttributes = $xmlNote->attributes(); + $note = ['content' => $this->utf8ToCharset((string) $xmlNote, $encoding)]; + if (isset($noteAttributes['priority'])) { + $note['priority'] = (int) $noteAttributes['priority']; + } + + if (isset($noteAttributes['from'])) { + $note['from'] = (string) $noteAttributes['from']; + } + + $notes[] = $note; + } + + return $notes; + } + + private function isXmlString(string $resource): bool + { + return str_starts_with($resource, ' + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Loader; + +use Symfony\Component\Translation\Exception\InvalidResourceException; +use Symfony\Component\Translation\Exception\LogicException; +use Symfony\Component\Yaml\Exception\ParseException; +use Symfony\Component\Yaml\Parser as YamlParser; +use Symfony\Component\Yaml\Yaml; + +/** + * YamlFileLoader loads translations from Yaml files. + * + * @author Fabien Potencier + */ +class YamlFileLoader extends FileLoader +{ + private YamlParser $yamlParser; + + protected function loadResource(string $resource): array + { + if (!isset($this->yamlParser)) { + if (!class_exists(YamlParser::class)) { + throw new LogicException('Loading translations from the YAML format requires the Symfony Yaml component.'); + } + + $this->yamlParser = new YamlParser(); + } + + try { + $messages = $this->yamlParser->parseFile($resource, Yaml::PARSE_CONSTANT); + } catch (ParseException $e) { + throw new InvalidResourceException(\sprintf('The file "%s" does not contain valid YAML: ', $resource).$e->getMessage(), 0, $e); + } + + if (null !== $messages && !\is_array($messages)) { + throw new InvalidResourceException(\sprintf('Unable to load file "%s".', $resource)); + } + + return $messages ?: []; + } +} diff --git a/plugins/vendor/symfony/translation/LocaleSwitcher.php b/plugins/vendor/symfony/translation/LocaleSwitcher.php new file mode 100644 index 00000000..4950a56b --- /dev/null +++ b/plugins/vendor/symfony/translation/LocaleSwitcher.php @@ -0,0 +1,83 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Routing\RequestContext; +use Symfony\Contracts\Translation\LocaleAwareInterface; + +/** + * @author Kevin Bond + */ +class LocaleSwitcher implements LocaleAwareInterface +{ + private string $defaultLocale; + + /** + * @param LocaleAwareInterface[] $localeAwareServices + */ + public function __construct( + private string $locale, + private iterable $localeAwareServices, + private ?RequestContext $requestContext = null, + ) { + $this->defaultLocale = $locale; + } + + public function setLocale(string $locale): void + { + // Silently ignore if the intl extension is not loaded + try { + if (class_exists(\Locale::class, false)) { + \Locale::setDefault($locale); + } + } catch (\Exception) { + } + + $this->locale = $locale; + $this->requestContext?->setParameter('_locale', $locale); + + foreach ($this->localeAwareServices as $service) { + $service->setLocale($locale); + } + } + + public function getLocale(): string + { + return $this->locale; + } + + /** + * Switch to a new locale, execute a callback, then switch back to the original. + * + * @template T + * + * @param callable(string $locale):T $callback + * + * @return T + */ + public function runWithLocale(string $locale, callable $callback): mixed + { + $original = $this->getLocale(); + $this->setLocale($locale); + + try { + return $callback($locale); + } finally { + $this->setLocale($original); + } + } + + public function reset(): void + { + $this->setLocale($this->defaultLocale); + } +} diff --git a/plugins/vendor/symfony/translation/LoggingTranslator.php b/plugins/vendor/symfony/translation/LoggingTranslator.php new file mode 100644 index 00000000..84020d8a --- /dev/null +++ b/plugins/vendor/symfony/translation/LoggingTranslator.php @@ -0,0 +1,98 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Psr\Log\LoggerInterface; +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * @author Abdellatif Ait boudad + */ +class LoggingTranslator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface +{ + public function __construct( + private TranslatorInterface&TranslatorBagInterface&LocaleAwareInterface $translator, + private LoggerInterface $logger, + ) { + } + + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + $trans = $this->translator->trans($id = (string) $id, $parameters, $domain, $locale); + $this->log($id, $domain, $locale); + + return $trans; + } + + public function setLocale(string $locale): void + { + $prev = $this->translator->getLocale(); + $this->translator->setLocale($locale); + if ($prev === $locale) { + return; + } + + $this->logger->debug(\sprintf('The locale of the translator has changed from "%s" to "%s".', $prev, $locale)); + } + + public function getLocale(): string + { + return $this->translator->getLocale(); + } + + public function getCatalogue(?string $locale = null): MessageCatalogueInterface + { + return $this->translator->getCatalogue($locale); + } + + public function getCatalogues(): array + { + return $this->translator->getCatalogues(); + } + + /** + * Gets the fallback locales. + */ + public function getFallbackLocales(): array + { + if ($this->translator instanceof Translator || method_exists($this->translator, 'getFallbackLocales')) { + return $this->translator->getFallbackLocales(); + } + + return []; + } + + public function __call(string $method, array $args): mixed + { + return $this->translator->{$method}(...$args); + } + + /** + * Logs for missing translations. + */ + private function log(string $id, ?string $domain, ?string $locale): void + { + $domain ??= 'messages'; + + $catalogue = $this->translator->getCatalogue($locale); + if ($catalogue->defines($id, $domain)) { + return; + } + + if ($catalogue->has($id, $domain)) { + $this->logger->debug('Translation use fallback catalogue.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); + } else { + $this->logger->warning('Translation not found.', ['id' => $id, 'domain' => $domain, 'locale' => $catalogue->getLocale()]); + } + } +} diff --git a/plugins/vendor/symfony/translation/MessageCatalogue.php b/plugins/vendor/symfony/translation/MessageCatalogue.php new file mode 100644 index 00000000..eac50bb1 --- /dev/null +++ b/plugins/vendor/symfony/translation/MessageCatalogue.php @@ -0,0 +1,316 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Config\Resource\ResourceInterface; +use Symfony\Component\Translation\Exception\LogicException; + +/** + * @author Fabien Potencier + */ +class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface, CatalogueMetadataAwareInterface +{ + private array $metadata = []; + private array $catalogueMetadata = []; + private array $resources = []; + private ?MessageCatalogueInterface $fallbackCatalogue = null; + private ?self $parent = null; + + /** + * @param array $messages An array of messages classified by domain + */ + public function __construct( + private string $locale, + private array $messages = [], + ) { + } + + public function getLocale(): string + { + return $this->locale; + } + + public function getDomains(): array + { + $domains = []; + + foreach ($this->messages as $domain => $messages) { + if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { + $domain = substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)); + } + $domains[$domain] = $domain; + } + + return array_values($domains); + } + + public function all(?string $domain = null): array + { + if (null !== $domain) { + // skip messages merge if intl-icu requested explicitly + if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { + return $this->messages[$domain] ?? []; + } + + return ($this->messages[$domain.self::INTL_DOMAIN_SUFFIX] ?? []) + ($this->messages[$domain] ?? []); + } + + $allMessages = []; + + foreach ($this->messages as $domain => $messages) { + if (str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { + $domain = substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)); + $allMessages[$domain] = $messages + ($allMessages[$domain] ?? []); + } else { + $allMessages[$domain] = ($allMessages[$domain] ?? []) + $messages; + } + } + + return $allMessages; + } + + public function set(string $id, string $translation, string $domain = 'messages'): void + { + $this->add([$id => $translation], $domain); + } + + public function has(string $id, string $domain = 'messages'): bool + { + if (isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { + return true; + } + + if (null !== $this->fallbackCatalogue) { + return $this->fallbackCatalogue->has($id, $domain); + } + + return false; + } + + public function defines(string $id, string $domain = 'messages'): bool + { + return isset($this->messages[$domain][$id]) || isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]); + } + + public function get(string $id, string $domain = 'messages'): string + { + if (isset($this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id])) { + return $this->messages[$domain.self::INTL_DOMAIN_SUFFIX][$id]; + } + + if (isset($this->messages[$domain][$id])) { + return $this->messages[$domain][$id]; + } + + if (null !== $this->fallbackCatalogue) { + return $this->fallbackCatalogue->get($id, $domain); + } + + return $id; + } + + public function replace(array $messages, string $domain = 'messages'): void + { + unset($this->messages[$domain], $this->messages[$domain.self::INTL_DOMAIN_SUFFIX]); + + $this->add($messages, $domain); + } + + public function add(array $messages, string $domain = 'messages'): void + { + $altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX; + foreach ($messages as $id => $message) { + unset($this->messages[$altDomain][$id]); + $this->messages[$domain][$id] = $message; + } + + if ([] === ($this->messages[$altDomain] ?? null)) { + unset($this->messages[$altDomain]); + } + } + + public function addCatalogue(MessageCatalogueInterface $catalogue): void + { + if ($catalogue->getLocale() !== $this->locale) { + throw new LogicException(\sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s".', $catalogue->getLocale(), $this->locale)); + } + + foreach ($catalogue->all() as $domain => $messages) { + if ($intlMessages = $catalogue->all($domain.self::INTL_DOMAIN_SUFFIX)) { + $this->add($intlMessages, $domain.self::INTL_DOMAIN_SUFFIX); + $messages = array_diff_key($messages, $intlMessages); + } + $this->add($messages, $domain); + } + + foreach ($catalogue->getResources() as $resource) { + $this->addResource($resource); + } + + if ($catalogue instanceof MetadataAwareInterface) { + $metadata = $catalogue->getMetadata('', ''); + $this->addMetadata($metadata); + } + + if ($catalogue instanceof CatalogueMetadataAwareInterface) { + $catalogueMetadata = $catalogue->getCatalogueMetadata('', ''); + $this->addCatalogueMetadata($catalogueMetadata); + } + } + + public function addFallbackCatalogue(MessageCatalogueInterface $catalogue): void + { + // detect circular references + $c = $catalogue; + while ($c = $c->getFallbackCatalogue()) { + if ($c->getLocale() === $this->getLocale()) { + throw new LogicException(\sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); + } + } + + $c = $this; + do { + if ($c->getLocale() === $catalogue->getLocale()) { + throw new LogicException(\sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); + } + + foreach ($catalogue->getResources() as $resource) { + $c->addResource($resource); + } + } while ($c = $c->parent); + + $catalogue->parent = $this; + $this->fallbackCatalogue = $catalogue; + + foreach ($catalogue->getResources() as $resource) { + $this->addResource($resource); + } + } + + public function getFallbackCatalogue(): ?MessageCatalogueInterface + { + return $this->fallbackCatalogue; + } + + public function getResources(): array + { + return array_values($this->resources); + } + + public function addResource(ResourceInterface $resource): void + { + $this->resources[$resource->__toString()] = $resource; + } + + public function getMetadata(string $key = '', string $domain = 'messages'): mixed + { + if ('' == $domain) { + return $this->metadata; + } + + if (isset($this->metadata[$domain.self::INTL_DOMAIN_SUFFIX])) { + if ('' === $key) { + return $this->metadata[$domain.self::INTL_DOMAIN_SUFFIX]; + } + + if (isset($this->metadata[$domain.self::INTL_DOMAIN_SUFFIX][$key])) { + return $this->metadata[$domain.self::INTL_DOMAIN_SUFFIX][$key]; + } + } + + if (isset($this->metadata[$domain])) { + if ('' == $key) { + return $this->metadata[$domain]; + } + + if (isset($this->metadata[$domain][$key])) { + return $this->metadata[$domain][$key]; + } + } + + return null; + } + + public function setMetadata(string $key, mixed $value, string $domain = 'messages'): void + { + $this->metadata[$domain][$key] = $value; + } + + public function deleteMetadata(string $key = '', string $domain = 'messages'): void + { + if ('' == $domain) { + $this->metadata = []; + } elseif ('' == $key) { + unset($this->metadata[$domain]); + } else { + unset($this->metadata[$domain][$key]); + } + } + + public function getCatalogueMetadata(string $key = '', string $domain = 'messages'): mixed + { + if (!$domain) { + return $this->catalogueMetadata; + } + + if (isset($this->catalogueMetadata[$domain])) { + if (!$key) { + return $this->catalogueMetadata[$domain]; + } + + if (isset($this->catalogueMetadata[$domain][$key])) { + return $this->catalogueMetadata[$domain][$key]; + } + } + + return null; + } + + public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages'): void + { + $this->catalogueMetadata[$domain][$key] = $value; + } + + public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages'): void + { + if (!$domain) { + $this->catalogueMetadata = []; + } elseif (!$key) { + unset($this->catalogueMetadata[$domain]); + } else { + unset($this->catalogueMetadata[$domain][$key]); + } + } + + /** + * Adds current values with the new values. + * + * @param array $values Values to add + */ + private function addMetadata(array $values): void + { + foreach ($values as $domain => $keys) { + foreach ($keys as $key => $value) { + $this->setMetadata($key, $value, $domain); + } + } + } + + private function addCatalogueMetadata(array $values): void + { + foreach ($values as $domain => $keys) { + foreach ($keys as $key => $value) { + $this->setCatalogueMetadata($key, $value, $domain); + } + } + } +} diff --git a/plugins/vendor/symfony/translation/MessageCatalogueInterface.php b/plugins/vendor/symfony/translation/MessageCatalogueInterface.php new file mode 100644 index 00000000..5d635605 --- /dev/null +++ b/plugins/vendor/symfony/translation/MessageCatalogueInterface.php @@ -0,0 +1,122 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Config\Resource\ResourceInterface; + +/** + * MessageCatalogueInterface. + * + * @author Fabien Potencier + */ +interface MessageCatalogueInterface +{ + public const INTL_DOMAIN_SUFFIX = '+intl-icu'; + + /** + * Gets the catalogue locale. + */ + public function getLocale(): string; + + /** + * Gets the domains. + */ + public function getDomains(): array; + + /** + * Gets the messages within a given domain. + * + * If $domain is null, it returns all messages. + */ + public function all(?string $domain = null): array; + + /** + * Sets a message translation. + * + * @param string $id The message id + * @param string $translation The messages translation + * @param string $domain The domain name + */ + public function set(string $id, string $translation, string $domain = 'messages'): void; + + /** + * Checks if a message has a translation. + * + * @param string $id The message id + * @param string $domain The domain name + */ + public function has(string $id, string $domain = 'messages'): bool; + + /** + * Checks if a message has a translation (it does not take into account the fallback mechanism). + * + * @param string $id The message id + * @param string $domain The domain name + */ + public function defines(string $id, string $domain = 'messages'): bool; + + /** + * Gets a message translation. + * + * @param string $id The message id + * @param string $domain The domain name + */ + public function get(string $id, string $domain = 'messages'): string; + + /** + * Sets translations for a given domain. + * + * @param array $messages An array of translations + * @param string $domain The domain name + */ + public function replace(array $messages, string $domain = 'messages'): void; + + /** + * Adds translations for a given domain. + * + * @param array $messages An array of translations + * @param string $domain The domain name + */ + public function add(array $messages, string $domain = 'messages'): void; + + /** + * Merges translations from the given Catalogue into the current one. + * + * The two catalogues must have the same locale. + */ + public function addCatalogue(self $catalogue): void; + + /** + * Merges translations from the given Catalogue into the current one + * only when the translation does not exist. + * + * This is used to provide default translations when they do not exist for the current locale. + */ + public function addFallbackCatalogue(self $catalogue): void; + + /** + * Gets the fallback catalogue. + */ + public function getFallbackCatalogue(): ?self; + + /** + * Returns an array of resources loaded to build this collection. + * + * @return ResourceInterface[] + */ + public function getResources(): array; + + /** + * Adds a resource for this collection. + */ + public function addResource(ResourceInterface $resource): void; +} diff --git a/plugins/vendor/symfony/translation/MetadataAwareInterface.php b/plugins/vendor/symfony/translation/MetadataAwareInterface.php new file mode 100644 index 00000000..12e4f33b --- /dev/null +++ b/plugins/vendor/symfony/translation/MetadataAwareInterface.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +/** + * This interface is used to get, set, and delete metadata about the translation messages. + * + * @author Fabien Potencier + */ +interface MetadataAwareInterface +{ + /** + * Gets metadata for the given domain and key. + * + * Passing an empty domain will return an array with all metadata indexed by + * domain and then by key. Passing an empty key will return an array with all + * metadata for the given domain. + * + * @return mixed The value that was set or an array with the domains/keys or null + */ + public function getMetadata(string $key = '', string $domain = 'messages'): mixed; + + /** + * Adds metadata to a message domain. + */ + public function setMetadata(string $key, mixed $value, string $domain = 'messages'): void; + + /** + * Deletes metadata for the given key and domain. + * + * Passing an empty domain will delete all metadata. Passing an empty key will + * delete all metadata for the given domain. + */ + public function deleteMetadata(string $key = '', string $domain = 'messages'): void; +} diff --git a/plugins/vendor/symfony/translation/Provider/AbstractProviderFactory.php b/plugins/vendor/symfony/translation/Provider/AbstractProviderFactory.php new file mode 100644 index 00000000..f0c11d85 --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/AbstractProviderFactory.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\IncompleteDsnException; + +abstract class AbstractProviderFactory implements ProviderFactoryInterface +{ + public function supports(Dsn $dsn): bool + { + return \in_array($dsn->getScheme(), $this->getSupportedSchemes(), true); + } + + /** + * @return string[] + */ + abstract protected function getSupportedSchemes(): array; + + protected function getUser(Dsn $dsn): string + { + return $dsn->getUser() ?? throw new IncompleteDsnException('User is not set.', $dsn->getScheme().'://'.$dsn->getHost()); + } + + protected function getPassword(Dsn $dsn): string + { + return $dsn->getPassword() ?? throw new IncompleteDsnException('Password is not set.', $dsn->getOriginalDsn()); + } +} diff --git a/plugins/vendor/symfony/translation/Provider/Dsn.php b/plugins/vendor/symfony/translation/Provider/Dsn.php new file mode 100644 index 00000000..1d90e27f --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/Dsn.php @@ -0,0 +1,110 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\MissingRequiredOptionException; + +/** + * @author Fabien Potencier + * @author Oskar Stark + */ +final class Dsn +{ + private ?string $scheme; + private ?string $host; + private ?string $user; + private ?string $password; + private ?int $port; + private ?string $path; + private array $options = []; + private string $originalDsn; + + public function __construct(#[\SensitiveParameter] string $dsn) + { + $this->originalDsn = $dsn; + + if (false === $params = parse_url($dsn)) { + throw new InvalidArgumentException('The translation provider DSN is invalid.'); + } + + if (!isset($params['scheme'])) { + throw new InvalidArgumentException('The translation provider DSN must contain a scheme.'); + } + $this->scheme = $params['scheme']; + + if (!isset($params['host'])) { + throw new InvalidArgumentException('The translation provider DSN must contain a host (use "default" by default).'); + } + $this->host = $params['host']; + + $this->user = '' !== ($params['user'] ?? '') ? rawurldecode($params['user']) : null; + $this->password = '' !== ($params['pass'] ?? '') ? rawurldecode($params['pass']) : null; + $this->port = $params['port'] ?? null; + $this->path = $params['path'] ?? null; + parse_str($params['query'] ?? '', $this->options); + } + + public function getScheme(): string + { + return $this->scheme; + } + + public function getHost(): string + { + return $this->host; + } + + public function getUser(): ?string + { + return $this->user; + } + + public function getPassword(): ?string + { + return $this->password; + } + + public function getPort(?int $default = null): ?int + { + return $this->port ?? $default; + } + + public function getOption(string $key, mixed $default = null): mixed + { + return $this->options[$key] ?? $default; + } + + public function getRequiredOption(string $key): mixed + { + if (!\array_key_exists($key, $this->options) || '' === trim($this->options[$key])) { + throw new MissingRequiredOptionException($key); + } + + return $this->options[$key]; + } + + public function getOptions(): array + { + return $this->options; + } + + public function getPath(): ?string + { + return $this->path; + } + + public function getOriginalDsn(): string + { + return $this->originalDsn; + } +} diff --git a/plugins/vendor/symfony/translation/Provider/FilteringProvider.php b/plugins/vendor/symfony/translation/Provider/FilteringProvider.php new file mode 100644 index 00000000..cc11dc3d --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/FilteringProvider.php @@ -0,0 +1,58 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\TranslatorBag; +use Symfony\Component\Translation\TranslatorBagInterface; + +/** + * Filters domains and locales between the Translator config values and those specific to each provider. + * + * @author Mathieu Santostefano + */ +class FilteringProvider implements ProviderInterface +{ + public function __construct( + private ProviderInterface $provider, + private array $locales, + private array $domains = [], + ) { + } + + public function __toString(): string + { + return (string) $this->provider; + } + + public function write(TranslatorBagInterface $translatorBag): void + { + $this->provider->write($translatorBag); + } + + public function read(array $domains, array $locales): TranslatorBag + { + $domains = !$this->domains ? $domains : array_intersect($this->domains, $domains); + $locales = array_intersect($this->locales, $locales); + + return $this->provider->read($domains, $locales); + } + + public function delete(TranslatorBagInterface $translatorBag): void + { + $this->provider->delete($translatorBag); + } + + public function getDomains(): array + { + return $this->domains; + } +} diff --git a/plugins/vendor/symfony/translation/Provider/NullProvider.php b/plugins/vendor/symfony/translation/Provider/NullProvider.php new file mode 100644 index 00000000..f00392ea --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/NullProvider.php @@ -0,0 +1,39 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\TranslatorBag; +use Symfony\Component\Translation\TranslatorBagInterface; + +/** + * @author Mathieu Santostefano + */ +class NullProvider implements ProviderInterface +{ + public function __toString(): string + { + return 'null'; + } + + public function write(TranslatorBagInterface $translatorBag, bool $override = false): void + { + } + + public function read(array $domains, array $locales): TranslatorBag + { + return new TranslatorBag(); + } + + public function delete(TranslatorBagInterface $translatorBag): void + { + } +} diff --git a/plugins/vendor/symfony/translation/Provider/NullProviderFactory.php b/plugins/vendor/symfony/translation/Provider/NullProviderFactory.php new file mode 100644 index 00000000..f350f160 --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/NullProviderFactory.php @@ -0,0 +1,34 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\UnsupportedSchemeException; + +/** + * @author Mathieu Santostefano + */ +final class NullProviderFactory extends AbstractProviderFactory +{ + public function create(Dsn $dsn): ProviderInterface + { + if ('null' === $dsn->getScheme()) { + return new NullProvider(); + } + + throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes()); + } + + protected function getSupportedSchemes(): array + { + return ['null']; + } +} diff --git a/plugins/vendor/symfony/translation/Provider/ProviderFactoryInterface.php b/plugins/vendor/symfony/translation/Provider/ProviderFactoryInterface.php new file mode 100644 index 00000000..3fd4494b --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/ProviderFactoryInterface.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\IncompleteDsnException; +use Symfony\Component\Translation\Exception\UnsupportedSchemeException; + +interface ProviderFactoryInterface +{ + /** + * @throws UnsupportedSchemeException + * @throws IncompleteDsnException + */ + public function create(Dsn $dsn): ProviderInterface; + + public function supports(Dsn $dsn): bool; +} diff --git a/plugins/vendor/symfony/translation/Provider/ProviderInterface.php b/plugins/vendor/symfony/translation/Provider/ProviderInterface.php new file mode 100644 index 00000000..0e47083b --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/ProviderInterface.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\TranslatorBag; +use Symfony\Component\Translation\TranslatorBagInterface; + +interface ProviderInterface extends \Stringable +{ + /** + * Translations available in the TranslatorBag only must be created. + * Translations available in both the TranslatorBag and on the provider + * must be overwritten. + * Translations available on the provider only must be kept. + */ + public function write(TranslatorBagInterface $translatorBag): void; + + public function read(array $domains, array $locales): TranslatorBag; + + public function delete(TranslatorBagInterface $translatorBag): void; +} diff --git a/plugins/vendor/symfony/translation/Provider/TranslationProviderCollection.php b/plugins/vendor/symfony/translation/Provider/TranslationProviderCollection.php new file mode 100644 index 00000000..878998fe --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/TranslationProviderCollection.php @@ -0,0 +1,57 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; + +/** + * @author Mathieu Santostefano + */ +final class TranslationProviderCollection +{ + /** + * @var array + */ + private array $providers; + + /** + * @param array $providers + */ + public function __construct(iterable $providers) + { + $this->providers = \is_array($providers) ? $providers : iterator_to_array($providers); + } + + public function __toString(): string + { + return '['.implode(',', array_keys($this->providers)).']'; + } + + public function has(string $name): bool + { + return isset($this->providers[$name]); + } + + public function get(string $name): ProviderInterface + { + if (!$this->has($name)) { + throw new InvalidArgumentException(\sprintf('Provider "%s" not found. Available: "%s".', $name, (string) $this)); + } + + return $this->providers[$name]; + } + + public function keys(): array + { + return array_keys($this->providers); + } +} diff --git a/plugins/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php b/plugins/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php new file mode 100644 index 00000000..2c8c5515 --- /dev/null +++ b/plugins/vendor/symfony/translation/Provider/TranslationProviderCollectionFactory.php @@ -0,0 +1,54 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Provider; + +use Symfony\Component\Translation\Exception\UnsupportedSchemeException; + +/** + * @author Mathieu Santostefano + */ +class TranslationProviderCollectionFactory +{ + /** + * @param iterable $factories + */ + public function __construct( + private iterable $factories, + private array $enabledLocales, + ) { + } + + public function fromConfig(array $config): TranslationProviderCollection + { + $providers = []; + foreach ($config as $name => $currentConfig) { + $providers[$name] = $this->fromDsnObject( + new Dsn($currentConfig['dsn']), + !$currentConfig['locales'] ? $this->enabledLocales : $currentConfig['locales'], + !$currentConfig['domains'] ? [] : $currentConfig['domains'] + ); + } + + return new TranslationProviderCollection($providers); + } + + public function fromDsnObject(Dsn $dsn, array $locales, array $domains = []): ProviderInterface + { + foreach ($this->factories as $factory) { + if ($factory->supports($dsn)) { + return new FilteringProvider($factory->create($dsn), $locales, $domains); + } + } + + throw new UnsupportedSchemeException($dsn); + } +} diff --git a/plugins/vendor/symfony/translation/PseudoLocalizationTranslator.php b/plugins/vendor/symfony/translation/PseudoLocalizationTranslator.php new file mode 100644 index 00000000..fe5b0adc --- /dev/null +++ b/plugins/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -0,0 +1,385 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Translation\Exception\LogicException; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * This translator should only be used in a development environment. + */ +final class PseudoLocalizationTranslator implements TranslatorInterface, TranslatorBagInterface +{ + private const EXPANSION_CHARACTER = '~'; + + private bool $accents; + private float $expansionFactor; + private bool $brackets; + private bool $parseHTML; + + /** + * @var string[] + */ + private array $localizableHTMLAttributes; + + /** + * Available options: + * * accents: + * type: boolean + * default: true + * description: replace ASCII characters of the translated string with accented versions or similar characters + * example: if true, "foo" => "ƒöö". + * + * * expansion_factor: + * type: float + * default: 1 + * validation: it must be greater than or equal to 1 + * description: expand the translated string by the given factor with spaces and tildes + * example: if 2, "foo" => "~foo ~" + * + * * brackets: + * type: boolean + * default: true + * description: wrap the translated string with brackets + * example: if true, "foo" => "[foo]" + * + * * parse_html: + * type: boolean + * default: false + * description: parse the translated string as HTML - looking for HTML tags has a performance impact but allows to preserve them from alterations - it also allows to compute the visible translated string length which is useful to correctly expand ot when it contains HTML + * warning: unclosed tags are unsupported, they will be fixed (closed) by the parser - eg, "foo
bar" => "foo
bar
" + * + * * localizable_html_attributes: + * type: string[] + * default: [] + * description: the list of HTML attributes whose values can be altered - it is only useful when the "parse_html" option is set to true + * example: if ["title"], and with the "accents" option set to true, "Profile" => "Þŕöƒîļé" - if "title" was not in the "localizable_html_attributes" list, the title attribute data would be left unchanged. + */ + public function __construct( + private TranslatorInterface $translator, + array $options = [], + ) { + $this->translator = $translator; + $this->accents = $options['accents'] ?? true; + + if (1.0 > ($this->expansionFactor = $options['expansion_factor'] ?? 1.0)) { + throw new \InvalidArgumentException('The expansion factor must be greater than or equal to 1.'); + } + + $this->brackets = $options['brackets'] ?? true; + + $this->parseHTML = $options['parse_html'] ?? false; + if ($this->parseHTML && !$this->accents && 1.0 === $this->expansionFactor) { + $this->parseHTML = false; + } + + $this->localizableHTMLAttributes = $options['localizable_html_attributes'] ?? []; + } + + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + $trans = ''; + $visibleText = ''; + + foreach ($this->getParts($this->translator->trans($id, $parameters, $domain, $locale)) as [$visible, $localizable, $text]) { + if ($visible) { + $visibleText .= $text; + } + + if (!$localizable) { + $trans .= $text; + + continue; + } + + $this->addAccents($trans, $text); + } + + $this->expand($trans, $visibleText); + + $this->addBrackets($trans); + + return $trans; + } + + public function getLocale(): string + { + return $this->translator->getLocale(); + } + + public function getCatalogue(?string $locale = null): MessageCatalogueInterface + { + if (!$this->translator instanceof TranslatorBagInterface) { + throw new LogicException(\sprintf('The "%s()" method cannot be called as the wrapped translator class "%s" does not implement the "%s".', __METHOD__, $this->translator::class, TranslatorBagInterface::class)); + } + + return $this->translator->getCatalogue($locale); + } + + public function getCatalogues(): array + { + if (!$this->translator instanceof TranslatorBagInterface) { + throw new LogicException(\sprintf('The "%s()" method cannot be called as the wrapped translator class "%s" does not implement the "%s".', __METHOD__, $this->translator::class, TranslatorBagInterface::class)); + } + + return $this->translator->getCatalogues(); + } + + private function getParts(string $originalTrans): array + { + if (!$this->parseHTML) { + return [[true, true, $originalTrans]]; + } + + $html = mb_encode_numericentity($originalTrans, [0x80, 0x10FFFF, 0, 0x1FFFFF], mb_detect_encoding($originalTrans, null, true) ?: 'UTF-8'); + + $useInternalErrors = libxml_use_internal_errors(true); + + $dom = new \DOMDocument(); + $dom->loadHTML(''.$html.''); + + libxml_clear_errors(); + libxml_use_internal_errors($useInternalErrors); + + return $this->parseNode($dom->childNodes->item(1)->childNodes->item(0)->childNodes->item(0)); + } + + private function parseNode(\DOMNode $node): array + { + $parts = []; + + foreach ($node->childNodes as $childNode) { + if (!$childNode instanceof \DOMElement) { + $parts[] = [true, true, $childNode->nodeValue]; + + continue; + } + + $parts[] = [false, false, '<'.$childNode->tagName]; + + /** @var \DOMAttr $attribute */ + foreach ($childNode->attributes as $attribute) { + $parts[] = [false, false, ' '.$attribute->nodeName.'="']; + + $localizableAttribute = \in_array($attribute->nodeName, $this->localizableHTMLAttributes, true); + foreach (preg_split('/(&(?:amp|quot|#039|lt|gt);+)/', htmlspecialchars($attribute->nodeValue, \ENT_QUOTES, 'UTF-8'), -1, \PREG_SPLIT_DELIM_CAPTURE) as $i => $match) { + if ('' === $match) { + continue; + } + + $parts[] = [false, $localizableAttribute && 0 === $i % 2, $match]; + } + + $parts[] = [false, false, '"']; + } + + $parts[] = [false, false, '>']; + + $parts = array_merge($parts, $this->parseNode($childNode, $parts)); + + $parts[] = [false, false, 'tagName.'>']; + } + + return $parts; + } + + private function addAccents(string &$trans, string $text): void + { + $trans .= $this->accents ? strtr($text, [ + ' ' => ' ', + '!' => '¡', + '"' => '″', + '#' => '♯', + '$' => '€', + '%' => '‰', + '&' => '⅋', + '\'' => '´', + '(' => '{', + ')' => '}', + '*' => '⁎', + '+' => '⁺', + ',' => '،', + '-' => '‐', + '.' => '·', + '/' => '⁄', + '0' => '⓪', + '1' => '①', + '2' => '②', + '3' => '③', + '4' => '④', + '5' => '⑤', + '6' => '⑥', + '7' => '⑦', + '8' => '⑧', + '9' => '⑨', + ':' => '∶', + ';' => '⁏', + '<' => '≤', + '=' => '≂', + '>' => '≥', + '?' => '¿', + '@' => '՞', + 'A' => 'Å', + 'B' => 'Ɓ', + 'C' => 'Ç', + 'D' => 'Ð', + 'E' => 'É', + 'F' => 'Ƒ', + 'G' => 'Ĝ', + 'H' => 'Ĥ', + 'I' => 'Î', + 'J' => 'Ĵ', + 'K' => 'Ķ', + 'L' => 'Ļ', + 'M' => 'Ṁ', + 'N' => 'Ñ', + 'O' => 'Ö', + 'P' => 'Þ', + 'Q' => 'Ǫ', + 'R' => 'Ŕ', + 'S' => 'Š', + 'T' => 'Ţ', + 'U' => 'Û', + 'V' => 'Ṽ', + 'W' => 'Ŵ', + 'X' => 'Ẋ', + 'Y' => 'Ý', + 'Z' => 'Ž', + '[' => '⁅', + '\\' => '∖', + ']' => '⁆', + '^' => '˄', + '_' => '‿', + '`' => '‵', + 'a' => 'å', + 'b' => 'ƀ', + 'c' => 'ç', + 'd' => 'ð', + 'e' => 'é', + 'f' => 'ƒ', + 'g' => 'ĝ', + 'h' => 'ĥ', + 'i' => 'î', + 'j' => 'ĵ', + 'k' => 'ķ', + 'l' => 'ļ', + 'm' => 'ɱ', + 'n' => 'ñ', + 'o' => 'ö', + 'p' => 'þ', + 'q' => 'ǫ', + 'r' => 'ŕ', + 's' => 'š', + 't' => 'ţ', + 'u' => 'û', + 'v' => 'ṽ', + 'w' => 'ŵ', + 'x' => 'ẋ', + 'y' => 'ý', + 'z' => 'ž', + '{' => '(', + '|' => '¦', + '}' => ')', + '~' => '˞', + ]) : $text; + } + + private function expand(string &$trans, string $visibleText): void + { + if (1.0 >= $this->expansionFactor) { + return; + } + + $visibleLength = $this->strlen($visibleText); + $missingLength = (int) ceil($visibleLength * $this->expansionFactor) - $visibleLength; + if ($this->brackets) { + $missingLength -= 2; + } + + if (0 >= $missingLength) { + return; + } + + $words = []; + $wordsCount = 0; + foreach (preg_split('/ +/', $visibleText, -1, \PREG_SPLIT_NO_EMPTY) as $word) { + $wordLength = $this->strlen($word); + + if ($wordLength >= $missingLength) { + continue; + } + + if (!isset($words[$wordLength])) { + $words[$wordLength] = 0; + } + + ++$words[$wordLength]; + ++$wordsCount; + } + + if (!$words) { + $trans .= 1 === $missingLength ? self::EXPANSION_CHARACTER : ' '.str_repeat(self::EXPANSION_CHARACTER, $missingLength - 1); + + return; + } + + arsort($words, \SORT_NUMERIC); + + $longestWordLength = max(array_keys($words)); + + while (true) { + $r = mt_rand(1, $wordsCount); + + foreach ($words as $length => $count) { + $r -= $count; + if ($r <= 0) { + break; + } + } + + $trans .= ' '.str_repeat(self::EXPANSION_CHARACTER, $length); + + $missingLength -= $length + 1; + + if (0 === $missingLength) { + return; + } + + while ($longestWordLength >= $missingLength) { + $wordsCount -= $words[$longestWordLength]; + unset($words[$longestWordLength]); + + if (!$words) { + $trans .= 1 === $missingLength ? self::EXPANSION_CHARACTER : ' '.str_repeat(self::EXPANSION_CHARACTER, $missingLength - 1); + + return; + } + + $longestWordLength = max(array_keys($words)); + } + } + } + + private function addBrackets(string &$trans): void + { + if (!$this->brackets) { + return; + } + + $trans = '['.$trans.']'; + } + + private function strlen(string $s): int + { + return false === ($encoding = mb_detect_encoding($s, null, true)) ? \strlen($s) : mb_strlen($s, $encoding); + } +} diff --git a/plugins/vendor/symfony/translation/README.md b/plugins/vendor/symfony/translation/README.md new file mode 100644 index 00000000..e9174ecc --- /dev/null +++ b/plugins/vendor/symfony/translation/README.md @@ -0,0 +1,46 @@ +Translation Component +===================== + +The Translation component provides tools to internationalize your application. + +Getting Started +--------------- + +```bash +composer require symfony/translation +``` + +```php +use Symfony\Component\Translation\Translator; +use Symfony\Component\Translation\Loader\ArrayLoader; + +$translator = new Translator('fr_FR'); +$translator->addLoader('array', new ArrayLoader()); +$translator->addResource('array', [ + 'Hello World!' => 'Bonjour !', +], 'fr_FR'); + +echo $translator->trans('Hello World!'); // outputs « Bonjour ! » +``` + +Sponsor +------- + +The Translation component for Symfony 7.1 is [backed][1] by: + + * [Crowdin][2], a cloud-based localization management software helping teams to go global and stay agile. + +Help Symfony by [sponsoring][3] its development! + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/translation.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) + +[1]: https://symfony.com/backers +[2]: https://crowdin.com +[3]: https://symfony.com/sponsor diff --git a/plugins/vendor/symfony/translation/Reader/TranslationReader.php b/plugins/vendor/symfony/translation/Reader/TranslationReader.php new file mode 100644 index 00000000..928e2c56 --- /dev/null +++ b/plugins/vendor/symfony/translation/Reader/TranslationReader.php @@ -0,0 +1,59 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Reader; + +use Symfony\Component\Finder\Finder; +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * TranslationReader reads translation messages from translation files. + * + * @author Michel Salib + */ +class TranslationReader implements TranslationReaderInterface +{ + /** + * Loaders used for import. + * + * @var array + */ + private array $loaders = []; + + /** + * Adds a loader to the translation extractor. + * + * @param string $format The format of the loader + */ + public function addLoader(string $format, LoaderInterface $loader): void + { + $this->loaders[$format] = $loader; + } + + public function read(string $directory, MessageCatalogue $catalogue): void + { + if (!is_dir($directory)) { + return; + } + + foreach ($this->loaders as $format => $loader) { + // load any existing translation files + $finder = new Finder(); + $extension = $catalogue->getLocale().'.'.$format; + $files = $finder->files()->name('*.'.$extension)->in($directory); + foreach ($files as $file) { + $domain = substr($file->getFilename(), 0, -1 * \strlen($extension) - 1); + $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); + } + } + } +} diff --git a/plugins/vendor/symfony/translation/Reader/TranslationReaderInterface.php b/plugins/vendor/symfony/translation/Reader/TranslationReaderInterface.php new file mode 100644 index 00000000..bab6e59b --- /dev/null +++ b/plugins/vendor/symfony/translation/Reader/TranslationReaderInterface.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Reader; + +use Symfony\Component\Translation\MessageCatalogue; + +/** + * TranslationReader reads translation messages from translation files. + * + * @author Tobias Nyholm + */ +interface TranslationReaderInterface +{ + /** + * Reads translation messages from a directory to the catalogue. + */ + public function read(string $directory, MessageCatalogue $catalogue): void; +} diff --git a/plugins/vendor/symfony/translation/Resources/bin/translation-status.php b/plugins/vendor/symfony/translation/Resources/bin/translation-status.php new file mode 100644 index 00000000..42fa1c69 --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/bin/translation-status.php @@ -0,0 +1,274 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if ('cli' !== \PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + +$usageInstructions = << false, + // NULL = analyze all locales + 'locale_to_analyze' => null, + // append --incomplete to only show incomplete languages + 'include_completed_languages' => true, + // the reference files all the other translations are compared to + 'original_files' => [ + 'src/Symfony/Component/Form/Resources/translations/validators.en.xlf', + 'src/Symfony/Component/Security/Core/Resources/translations/security.en.xlf', + 'src/Symfony/Component/Validator/Resources/translations/validators.en.xlf', + ], +]; + +$argc = $_SERVER['argc']; +$argv = $_SERVER['argv']; + +if ($argc > 4) { + echo str_replace('translation-status.php', $argv[0], $usageInstructions); + exit(1); +} + +foreach (array_slice($argv, 1) as $argumentOrOption) { + if ('--incomplete' === $argumentOrOption) { + $config['include_completed_languages'] = false; + continue; + } + + if (str_starts_with($argumentOrOption, '-')) { + $config['verbose_output'] = true; + } else { + $config['locale_to_analyze'] = $argumentOrOption; + } +} + +foreach ($config['original_files'] as $originalFilePath) { + if (!file_exists($originalFilePath)) { + echo sprintf('The following file does not exist. Make sure that you execute this command at the root dir of the Symfony code repository.%s %s', \PHP_EOL, $originalFilePath); + exit(1); + } +} + +$totalMissingTranslations = 0; +$totalTranslationMismatches = 0; + +foreach ($config['original_files'] as $originalFilePath) { + $translationFilePaths = findTranslationFiles($originalFilePath, $config['locale_to_analyze']); + $translationStatus = calculateTranslationStatus($originalFilePath, $translationFilePaths); + + $totalMissingTranslations += array_sum(array_map(fn ($translation) => count($translation['missingKeys']), array_values($translationStatus))); + $totalTranslationMismatches += array_sum(array_map(fn ($translation) => count($translation['mismatches']), array_values($translationStatus))); + + printTranslationStatus($originalFilePath, $translationStatus, $config['verbose_output'], $config['include_completed_languages']); +} + +exit($totalTranslationMismatches > 0 ? 1 : 0); + +function findTranslationFiles($originalFilePath, $localeToAnalyze): array +{ + $translations = []; + + $translationsDir = dirname($originalFilePath); + $originalFileName = basename($originalFilePath); + $translationFileNamePattern = str_replace('.en.', '.*.', $originalFileName); + + $translationFiles = glob($translationsDir.'/'.$translationFileNamePattern, \GLOB_NOSORT); + sort($translationFiles); + foreach ($translationFiles as $filePath) { + $locale = extractLocaleFromFilePath($filePath); + + if (null !== $localeToAnalyze && $locale !== $localeToAnalyze) { + continue; + } + + $translations[$locale] = $filePath; + } + + return $translations; +} + +function calculateTranslationStatus($originalFilePath, $translationFilePaths): array +{ + $translationStatus = []; + $allTranslationKeys = extractTranslationKeys($originalFilePath); + + foreach ($translationFilePaths as $locale => $translationPath) { + $translatedKeys = extractTranslationKeys($translationPath); + $missingKeys = array_diff_key($allTranslationKeys, $translatedKeys); + $mismatches = findTransUnitMismatches($allTranslationKeys, $translatedKeys); + + $translationStatus[$locale] = [ + 'total' => count($allTranslationKeys), + 'translated' => count($translatedKeys), + 'missingKeys' => $missingKeys, + 'mismatches' => $mismatches, + ]; + $translationStatus[$locale]['is_completed'] = isTranslationCompleted($translationStatus[$locale]); + } + + return $translationStatus; +} + +function isTranslationCompleted(array $translationStatus): bool +{ + return $translationStatus['total'] === $translationStatus['translated'] && 0 === count($translationStatus['mismatches']); +} + +function printTranslationStatus($originalFilePath, $translationStatus, $verboseOutput, $includeCompletedLanguages) +{ + printTitle($originalFilePath); + printTable($translationStatus, $verboseOutput, $includeCompletedLanguages); + echo \PHP_EOL.\PHP_EOL; +} + +function extractLocaleFromFilePath($filePath) +{ + $parts = explode('.', $filePath); + + return $parts[count($parts) - 2]; +} + +function extractTranslationKeys($filePath): array +{ + $translationKeys = []; + $contents = new SimpleXMLElement(file_get_contents($filePath)); + + foreach ($contents->file->body->{'trans-unit'} as $translationKey) { + $translationId = (string) $translationKey['id']; + $translationKey = (string) ($translationKey['resname'] ?? $translationKey->source); + + $translationKeys[$translationId] = $translationKey; + } + + return $translationKeys; +} + +/** + * Check whether the trans-unit id and source match with the base translation. + */ +function findTransUnitMismatches(array $baseTranslationKeys, array $translatedKeys): array +{ + $mismatches = []; + + foreach ($baseTranslationKeys as $translationId => $translationKey) { + if (!isset($translatedKeys[$translationId])) { + continue; + } + if ($translatedKeys[$translationId] !== $translationKey) { + $mismatches[$translationId] = [ + 'found' => $translatedKeys[$translationId], + 'expected' => $translationKey, + ]; + } + } + + return $mismatches; +} + +function printTitle($title) +{ + echo $title.\PHP_EOL; + echo str_repeat('=', strlen($title)).\PHP_EOL.\PHP_EOL; +} + +function printTable($translations, $verboseOutput, bool $includeCompletedLanguages) +{ + if (0 === count($translations)) { + echo 'No translations found'; + + return; + } + $longestLocaleNameLength = max(array_map('strlen', array_keys($translations))); + + foreach ($translations as $locale => $translation) { + if (!$includeCompletedLanguages && $translation['is_completed']) { + continue; + } + + if ($translation['translated'] > $translation['total']) { + textColorRed(); + } elseif (count($translation['mismatches']) > 0) { + textColorRed(); + } elseif ($translation['is_completed']) { + textColorGreen(); + } + + echo sprintf( + '| Locale: %-'.$longestLocaleNameLength.'s | Translated: %2d/%2d | Mismatches: %d |', + $locale, + $translation['translated'], + $translation['total'], + count($translation['mismatches']) + ).\PHP_EOL; + + textColorNormal(); + + $shouldBeClosed = false; + if (true === $verboseOutput && count($translation['missingKeys']) > 0) { + echo '| Missing Translations:'.\PHP_EOL; + + foreach ($translation['missingKeys'] as $id => $content) { + echo sprintf('| (id=%s) %s', $id, $content).\PHP_EOL; + } + $shouldBeClosed = true; + } + if (true === $verboseOutput && count($translation['mismatches']) > 0) { + echo '| Mismatches between trans-unit id and source:'.\PHP_EOL; + + foreach ($translation['mismatches'] as $id => $content) { + echo sprintf('| (id=%s) Expected: %s', $id, $content['expected']).\PHP_EOL; + echo sprintf('| Found: %s', $content['found']).\PHP_EOL; + } + $shouldBeClosed = true; + } + if ($shouldBeClosed) { + echo str_repeat('-', 80).\PHP_EOL; + } + } +} + +function textColorGreen() +{ + echo "\033[32m"; +} + +function textColorRed() +{ + echo "\033[31m"; +} + +function textColorNormal() +{ + echo "\033[0m"; +} diff --git a/plugins/vendor/symfony/translation/Resources/data/parents.json b/plugins/vendor/symfony/translation/Resources/data/parents.json new file mode 100644 index 00000000..c9e52fd9 --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/data/parents.json @@ -0,0 +1,153 @@ +{ + "az_Cyrl": "root", + "bs_Cyrl": "root", + "en_150": "en_001", + "en_AG": "en_001", + "en_AI": "en_001", + "en_AT": "en_150", + "en_AU": "en_001", + "en_BB": "en_001", + "en_BE": "en_150", + "en_BM": "en_001", + "en_BS": "en_001", + "en_BW": "en_001", + "en_BZ": "en_001", + "en_CC": "en_001", + "en_CH": "en_150", + "en_CK": "en_001", + "en_CM": "en_001", + "en_CX": "en_001", + "en_CY": "en_001", + "en_CZ": "en_150", + "en_DE": "en_150", + "en_DG": "en_001", + "en_DK": "en_150", + "en_DM": "en_001", + "en_ER": "en_001", + "en_ES": "en_150", + "en_FI": "en_150", + "en_FJ": "en_001", + "en_FK": "en_001", + "en_FM": "en_001", + "en_FR": "en_150", + "en_GB": "en_001", + "en_GD": "en_001", + "en_GG": "en_001", + "en_GH": "en_001", + "en_GI": "en_001", + "en_GM": "en_001", + "en_GS": "en_001", + "en_GY": "en_001", + "en_HK": "en_001", + "en_HU": "en_150", + "en_ID": "en_001", + "en_IE": "en_001", + "en_IL": "en_001", + "en_IM": "en_001", + "en_IN": "en_001", + "en_IO": "en_001", + "en_IT": "en_150", + "en_JE": "en_001", + "en_JM": "en_001", + "en_KE": "en_001", + "en_KI": "en_001", + "en_KN": "en_001", + "en_KY": "en_001", + "en_LC": "en_001", + "en_LR": "en_001", + "en_LS": "en_001", + "en_MG": "en_001", + "en_MO": "en_001", + "en_MS": "en_001", + "en_MT": "en_001", + "en_MU": "en_001", + "en_MV": "en_001", + "en_MW": "en_001", + "en_MY": "en_001", + "en_NA": "en_001", + "en_NF": "en_001", + "en_NG": "en_001", + "en_NL": "en_150", + "en_NO": "en_150", + "en_NR": "en_001", + "en_NU": "en_001", + "en_NZ": "en_001", + "en_PG": "en_001", + "en_PK": "en_001", + "en_PL": "en_150", + "en_PN": "en_001", + "en_PT": "en_150", + "en_PW": "en_001", + "en_RO": "en_150", + "en_RW": "en_001", + "en_SB": "en_001", + "en_SC": "en_001", + "en_SD": "en_001", + "en_SE": "en_150", + "en_SG": "en_001", + "en_SH": "en_001", + "en_SI": "en_150", + "en_SK": "en_150", + "en_SL": "en_001", + "en_SS": "en_001", + "en_SX": "en_001", + "en_SZ": "en_001", + "en_TC": "en_001", + "en_TK": "en_001", + "en_TO": "en_001", + "en_TT": "en_001", + "en_TV": "en_001", + "en_TZ": "en_001", + "en_UG": "en_001", + "en_VC": "en_001", + "en_VG": "en_001", + "en_VU": "en_001", + "en_WS": "en_001", + "en_ZA": "en_001", + "en_ZM": "en_001", + "en_ZW": "en_001", + "es_AR": "es_419", + "es_BO": "es_419", + "es_BR": "es_419", + "es_BZ": "es_419", + "es_CL": "es_419", + "es_CO": "es_419", + "es_CR": "es_419", + "es_CU": "es_419", + "es_DO": "es_419", + "es_EC": "es_419", + "es_GT": "es_419", + "es_HN": "es_419", + "es_MX": "es_419", + "es_NI": "es_419", + "es_PA": "es_419", + "es_PE": "es_419", + "es_PR": "es_419", + "es_PY": "es_419", + "es_SV": "es_419", + "es_US": "es_419", + "es_UY": "es_419", + "es_VE": "es_419", + "ff_Adlm": "root", + "hi_Latn": "en_IN", + "ks_Deva": "root", + "nb": "no", + "nn": "no", + "pa_Arab": "root", + "pt_AO": "pt_PT", + "pt_CH": "pt_PT", + "pt_CV": "pt_PT", + "pt_GQ": "pt_PT", + "pt_GW": "pt_PT", + "pt_LU": "pt_PT", + "pt_MO": "pt_PT", + "pt_MZ": "pt_PT", + "pt_ST": "pt_PT", + "pt_TL": "pt_PT", + "sd_Deva": "root", + "sr_Latn": "root", + "uz_Arab": "root", + "uz_Cyrl": "root", + "zh_Hant": "root", + "zh_Hant_MO": "zh_Hant_HK" +} diff --git a/plugins/vendor/symfony/translation/Resources/functions.php b/plugins/vendor/symfony/translation/Resources/functions.php new file mode 100644 index 00000000..0d2a037a --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/functions.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +if (!\function_exists(t::class)) { + /** + * @author Nate Wiebe + */ + function t(string $message, array $parameters = [], ?string $domain = null): TranslatableMessage + { + return new TranslatableMessage($message, $parameters, $domain); + } +} diff --git a/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd b/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd new file mode 100644 index 00000000..1f38de72 --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-1.2-transitional.xsd @@ -0,0 +1,2261 @@ + + + + + + + + + + + + + + Values for the attribute 'context-type'. + + + + + Indicates a database content. + + + + + Indicates the content of an element within an XML document. + + + + + Indicates the name of an element within an XML document. + + + + + Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found. + + + + + Indicates a the number of parameters contained within the <source>. + + + + + Indicates notes pertaining to the parameters in the <source>. + + + + + Indicates the content of a record within a database. + + + + + Indicates the name of a record within a database. + + + + + Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file. + + + + + + + Values for the attribute 'count-type'. + + + + + Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts. + + + + + Indicates the count units are translation units existing already in the same document. + + + + + Indicates a total count. + + + + + + + Values for the attribute 'ctype' when used other elements than <ph> or <x>. + + + + + Indicates a run of bolded text. + + + + + Indicates a run of text in italics. + + + + + Indicates a run of underlined text. + + + + + Indicates a run of hyper-text. + + + + + + + Values for the attribute 'ctype' when used with <ph> or <x>. + + + + + Indicates a inline image. + + + + + Indicates a page break. + + + + + Indicates a line break. + + + + + + + + + + + + Values for the attribute 'datatype'. + + + + + Indicates Active Server Page data. + + + + + Indicates C source file data. + + + + + Indicates Channel Definition Format (CDF) data. + + + + + Indicates ColdFusion data. + + + + + Indicates C++ source file data. + + + + + Indicates C-Sharp data. + + + + + Indicates strings from C, ASM, and driver files data. + + + + + Indicates comma-separated values data. + + + + + Indicates database data. + + + + + Indicates portions of document that follows data and contains metadata. + + + + + Indicates portions of document that precedes data and contains metadata. + + + + + Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import). + + + + + Indicates standard user input screen data. + + + + + Indicates HyperText Markup Language (HTML) data - document instance. + + + + + Indicates content within an HTML document’s <body> element. + + + + + Indicates Windows INI file data. + + + + + Indicates Interleaf data. + + + + + Indicates Java source file data (extension '.java'). + + + + + Indicates Java property resource bundle data. + + + + + Indicates Java list resource bundle data. + + + + + Indicates JavaScript source file data. + + + + + Indicates JScript source file data. + + + + + Indicates information relating to formatting. + + + + + Indicates LISP source file data. + + + + + Indicates information relating to margin formats. + + + + + Indicates a file containing menu. + + + + + Indicates numerically identified string table. + + + + + Indicates Maker Interchange Format (MIF) data. + + + + + Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute. + + + + + Indicates GNU Machine Object data. + + + + + Indicates Message Librarian strings created by Novell's Message Librarian Tool. + + + + + Indicates information to be displayed at the bottom of each page of a document. + + + + + Indicates information to be displayed at the top of each page of a document. + + + + + Indicates a list of property values (e.g., settings within INI files or preferences dialog). + + + + + Indicates Pascal source file data. + + + + + Indicates Hypertext Preprocessor data. + + + + + Indicates plain text file (no formatting other than, possibly, wrapping). + + + + + Indicates GNU Portable Object file. + + + + + Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc. + + + + + Indicates Windows .NET binary resources. + + + + + Indicates Windows .NET Resources. + + + + + Indicates Rich Text Format (RTF) data. + + + + + Indicates Standard Generalized Markup Language (SGML) data - document instance. + + + + + Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD). + + + + + Indicates Scalable Vector Graphic (SVG) data. + + + + + Indicates VisualBasic Script source file. + + + + + Indicates warning message. + + + + + Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file). + + + + + Indicates Extensible HyperText Markup Language (XHTML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - document instance. + + + + + Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD). + + + + + Indicates Extensible Stylesheet Language (XSL) data. + + + + + Indicates XUL elements. + + + + + + + Values for the attribute 'mtype'. + + + + + Indicates the marked text is an abbreviation. + + + + + ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept. + + + + + ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective'). + + + + + ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging'). + + + + + ISO-12620: A proper-name term, such as the name of an agency or other proper entity. + + + + + ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another. + + + + + ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language. + + + + + Indicates the marked text is a date and/or time. + + + + + ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign. + + + + + ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form. + + + + + ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula. + + + + + ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record. + + + + + ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy'). + + + + + ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body. + + + + + ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages. + + + + + ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like. + + + + + ISO-12620 2.1.17: A unit to track object. + + + + + Indicates the marked text is a name. + + + + + ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others. + + + + + ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system. + + + + + Indicates the marked text is a phrase. + + + + + ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase. + + + + + Indicates the marked text should not be translated. + + + + + ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet. + + + + + Indicates that the marked text represents a segment. + + + + + ISO-12620 2.1.18.2: A fixed, lexicalized phrase. + + + + + ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs'). + + + + + ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system. + + + + + ISO-12620 2.1.19: A fixed chunk of recurring text. + + + + + ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof. + + + + + ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry. + + + + + ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language. + + + + + Indicates the marked text is a term. + + + + + ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted. + + + + + ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system. + + + + + ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza'). + + + + + ISO-12620 2.1.9: One of the alternate forms of a term. + + + + + + + Values for the attribute 'restype'. + + + + + Indicates a Windows RC AUTO3STATE control. + + + + + Indicates a Windows RC AUTOCHECKBOX control. + + + + + Indicates a Windows RC AUTORADIOBUTTON control. + + + + + Indicates a Windows RC BEDIT control. + + + + + Indicates a bitmap, for example a BITMAP resource in Windows. + + + + + Indicates a button object, for example a BUTTON control Windows. + + + + + Indicates a caption, such as the caption of a dialog box. + + + + + Indicates the cell in a table, for example the content of the <td> element in HTML. + + + + + Indicates check box object, for example a CHECKBOX control in Windows. + + + + + Indicates a menu item with an associated checkbox. + + + + + Indicates a list box, but with a check-box for each item. + + + + + Indicates a color selection dialog. + + + + + Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows. + + + + + Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234). + + + + + Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403). + + + + + Indicates a UI base class element that cannot be represented by any other element. + + + + + Indicates a context menu. + + + + + Indicates a Windows RC CTEXT control. + + + + + Indicates a cursor, for example a CURSOR resource in Windows. + + + + + Indicates a date/time picker. + + + + + Indicates a Windows RC DEFPUSHBUTTON control. + + + + + Indicates a dialog box. + + + + + Indicates a Windows RC DLGINIT resource block. + + + + + Indicates an edit box object, for example an EDIT control in Windows. + + + + + Indicates a filename. + + + + + Indicates a file dialog. + + + + + Indicates a footnote. + + + + + Indicates a font name. + + + + + Indicates a footer. + + + + + Indicates a frame object. + + + + + Indicates a XUL grid element. + + + + + Indicates a groupbox object, for example a GROUPBOX control in Windows. + + + + + Indicates a header item. + + + + + Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML. + + + + + Indicates a Windows RC HEDIT control. + + + + + Indicates a horizontal scrollbar. + + + + + Indicates an icon, for example an ICON resource in Windows. + + + + + Indicates a Windows RC IEDIT control. + + + + + Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF. + + + + + Indicates a label object. + + + + + Indicates a label that is also a HTML link (not necessarily a URL). + + + + + Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML). + + + + + Indicates a listbox object, for example an LISTBOX control in Windows. + + + + + Indicates an list item (an entry in a list). + + + + + Indicates a Windows RC LTEXT control. + + + + + Indicates a menu (a group of menu-items). + + + + + Indicates a toolbar containing one or more tope level menus. + + + + + Indicates a menu item (an entry in a menu). + + + + + Indicates a XUL menuseparator element. + + + + + Indicates a message, for example an entry in a MESSAGETABLE resource in Windows. + + + + + Indicates a calendar control. + + + + + Indicates an edit box beside a spin control. + + + + + Indicates a catch all for rectangular areas. + + + + + Indicates a standalone menu not necessarily associated with a menubar. + + + + + Indicates a pushbox object, for example a PUSHBOX control in Windows. + + + + + Indicates a Windows RC PUSHBUTTON control. + + + + + Indicates a radio button object. + + + + + Indicates a menuitem with associated radio button. + + + + + Indicates raw data resources for an application. + + + + + Indicates a row in a table. + + + + + Indicates a Windows RC RTEXT control. + + + + + Indicates a user navigable container used to show a portion of a document. + + + + + Indicates a generic divider object (e.g. menu group separator). + + + + + Windows accelerators, shortcuts in resource or property files. + + + + + Indicates a UI control to indicate process activity but not progress. + + + + + Indicates a splitter bar. + + + + + Indicates a Windows RC STATE3 control. + + + + + Indicates a window for providing feedback to the users, like 'read-only', etc. + + + + + Indicates a string, for example an entry in a STRINGTABLE resource in Windows. + + + + + Indicates a layers of controls with a tab to select layers. + + + + + Indicates a display and edits regular two-dimensional tables of cells. + + + + + Indicates a XUL textbox element. + + + + + Indicates a UI button that can be toggled to on or off state. + + + + + Indicates an array of controls, usually buttons. + + + + + Indicates a pop up tool tip text. + + + + + Indicates a bar with a pointer indicating a position within a certain range. + + + + + Indicates a control that displays a set of hierarchical data. + + + + + Indicates a URI (URN or URL). + + + + + Indicates a Windows RC USERBUTTON control. + + + + + Indicates a user-defined control like CONTROL control in Windows. + + + + + Indicates the text of a variable. + + + + + Indicates version information about a resource like VERSIONINFO in Windows. + + + + + Indicates a vertical scrollbar. + + + + + Indicates a graphical window. + + + + + + + Values for the attribute 'size-unit'. + + + + + Indicates a size in 8-bit bytes. + + + + + Indicates a size in Unicode characters. + + + + + Indicates a size in columns. Used for HTML text area. + + + + + Indicates a size in centimeters. + + + + + Indicates a size in dialog units, as defined in Windows resources. + + + + + Indicates a size in 'font-size' units (as defined in CSS). + + + + + Indicates a size in 'x-height' units (as defined in CSS). + + + + + Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster' + + + + + Indicates a size in inches. + + + + + Indicates a size in millimeters. + + + + + Indicates a size in percentage. + + + + + Indicates a size in pixels. + + + + + Indicates a size in point. + + + + + Indicates a size in rows. Used for HTML text area. + + + + + + + Values for the attribute 'state'. + + + + + Indicates the terminating state. + + + + + Indicates only non-textual information needs adaptation. + + + + + Indicates both text and non-textual information needs adaptation. + + + + + Indicates only non-textual information needs review. + + + + + Indicates both text and non-textual information needs review. + + + + + Indicates that only the text of the item needs to be reviewed. + + + + + Indicates that the item needs to be translated. + + + + + Indicates that the item is new. For example, translation units that were not in a previous version of the document. + + + + + Indicates that changes are reviewed and approved. + + + + + Indicates that the item has been translated. + + + + + + + Values for the attribute 'state-qualifier'. + + + + + Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously. + + + + + Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.). + + + + + Indicates a match based on matching IDs (in addition to matching text). + + + + + Indicates a translation derived from a glossary. + + + + + Indicates a translation derived from existing translation. + + + + + Indicates a translation derived from machine translation. + + + + + Indicates a translation derived from a translation repository. + + + + + Indicates a translation derived from a translation memory. + + + + + Indicates the translation is suggested by machine translation. + + + + + Indicates that the item has been rejected because of incorrect grammar. + + + + + Indicates that the item has been rejected because it is incorrect. + + + + + Indicates that the item has been rejected because it is too long or too short. + + + + + Indicates that the item has been rejected because of incorrect spelling. + + + + + Indicates the translation is suggested by translation memory. + + + + + + + Values for the attribute 'unit'. + + + + + Refers to words. + + + + + Refers to pages. + + + + + Refers to <trans-unit> elements. + + + + + Refers to <bin-unit> elements. + + + + + Refers to glyphs. + + + + + Refers to <trans-unit> and/or <bin-unit> elements. + + + + + Refers to the occurrences of instances defined by the count-type value. + + + + + Refers to characters. + + + + + Refers to lines. + + + + + Refers to sentences. + + + + + Refers to paragraphs. + + + + + Refers to segments. + + + + + Refers to placeables (inline elements). + + + + + + + Values for the attribute 'priority'. + + + + + Highest priority. + + + + + High priority. + + + + + High priority, but not as important as 2. + + + + + High priority, but not as important as 3. + + + + + Medium priority, but more important than 6. + + + + + Medium priority, but less important than 5. + + + + + Low priority, but more important than 8. + + + + + Low priority, but more important than 9. + + + + + Low priority. + + + + + Lowest priority. + + + + + + + + + This value indicates that all properties can be reformatted. This value must be used alone. + + + + + This value indicates that no properties should be reformatted. This value must be used alone. + + + + + + + + + + + + + This value indicates that all information in the coord attribute can be modified. + + + + + This value indicates that the x information in the coord attribute can be modified. + + + + + This value indicates that the y information in the coord attribute can be modified. + + + + + This value indicates that the cx information in the coord attribute can be modified. + + + + + This value indicates that the cy information in the coord attribute can be modified. + + + + + This value indicates that all the information in the font attribute can be modified. + + + + + This value indicates that the name information in the font attribute can be modified. + + + + + This value indicates that the size information in the font attribute can be modified. + + + + + This value indicates that the weight information in the font attribute can be modified. + + + + + This value indicates that the information in the css-style attribute can be modified. + + + + + This value indicates that the information in the style attribute can be modified. + + + + + This value indicates that the information in the exstyle attribute can be modified. + + + + + + + + + + + + + Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document. + + + + + Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed. + + + + + Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed. + + + + + + + + + Represents a translation proposal from a translation memory or other resource. + + + + + Represents a previous version of the target element. + + + + + Represents a rejected version of the target element. + + + + + Represents a translation to be used for reference purposes only, for example from a related product or a different language. + + + + + Represents a proposed translation that was used for the translation of the trans-unit, possibly modified. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Values for the attribute 'coord'. + + + + + + + + Version values: 1.0 and 1.1 are allowed for backward compatibility. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd b/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd new file mode 100644 index 00000000..963232f9 --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/schemas/xliff-core-2.0.xsd @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/vendor/symfony/translation/Resources/schemas/xml.xsd b/plugins/vendor/symfony/translation/Resources/schemas/xml.xsd new file mode 100644 index 00000000..a46162a7 --- /dev/null +++ b/plugins/vendor/symfony/translation/Resources/schemas/xml.xsd @@ -0,0 +1,309 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+ +

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+ +
+
+ + + + +
+ +

lang (as an attribute name)

+

+ + denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ + See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ + The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + + +
+ + + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + + +
+ + + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+ +
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ + denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+ +
+ + + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ + In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+ +

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema.. .>
+          .. .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type.. .>
+          .. .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+ +
+
+
+
+ + + +
+

Versioning policy for this schema document

+ +
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+ +

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ + Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
diff --git a/plugins/vendor/symfony/translation/Test/AbstractProviderFactoryTestCase.php b/plugins/vendor/symfony/translation/Test/AbstractProviderFactoryTestCase.php new file mode 100644 index 00000000..75e7dd2d --- /dev/null +++ b/plugins/vendor/symfony/translation/Test/AbstractProviderFactoryTestCase.php @@ -0,0 +1,79 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Test; + +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\TestCase; +use Symfony\Component\Translation\Exception\UnsupportedSchemeException; +use Symfony\Component\Translation\Provider\Dsn; +use Symfony\Component\Translation\Provider\ProviderFactoryInterface; + +abstract class AbstractProviderFactoryTestCase extends TestCase +{ + abstract public function createFactory(): ProviderFactoryInterface; + + /** + * @return iterable + */ + abstract public static function supportsProvider(): iterable; + + /** + * @return iterable + */ + abstract public static function createProvider(): iterable; + + /** + * @return iterable + */ + abstract public static function unsupportedSchemeProvider(): iterable; + + /** + * @dataProvider supportsProvider + */ + #[DataProvider('supportsProvider')] + public function testSupports(bool $expected, string $dsn) + { + $factory = $this->createFactory(); + + $this->assertSame($expected, $factory->supports(new Dsn($dsn))); + } + + /** + * @dataProvider createProvider + */ + #[DataProvider('createProvider')] + public function testCreate(string $expected, string $dsn) + { + $factory = $this->createFactory(); + $provider = $factory->create(new Dsn($dsn)); + + $this->assertSame($expected, (string) $provider); + } + + /** + * @dataProvider unsupportedSchemeProvider + */ + #[DataProvider('unsupportedSchemeProvider')] + public function testUnsupportedSchemeException(string $dsn, ?string $message = null) + { + $factory = $this->createFactory(); + + $dsn = new Dsn($dsn); + + $this->expectException(UnsupportedSchemeException::class); + if (null !== $message) { + $this->expectExceptionMessage($message); + } + + $factory->create($dsn); + } +} diff --git a/plugins/vendor/symfony/translation/Test/IncompleteDsnTestTrait.php b/plugins/vendor/symfony/translation/Test/IncompleteDsnTestTrait.php new file mode 100644 index 00000000..892f6bf7 --- /dev/null +++ b/plugins/vendor/symfony/translation/Test/IncompleteDsnTestTrait.php @@ -0,0 +1,42 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Test; + +use PHPUnit\Framework\Attributes\DataProvider; +use Symfony\Component\Translation\Exception\IncompleteDsnException; +use Symfony\Component\Translation\Provider\Dsn; + +trait IncompleteDsnTestTrait +{ + /** + * @return iterable + */ + abstract public static function incompleteDsnProvider(): iterable; + + /** + * @dataProvider incompleteDsnProvider + */ + #[DataProvider('incompleteDsnProvider')] + public function testIncompleteDsnException(string $dsn, ?string $message = null) + { + $factory = $this->createFactory(); + + $dsn = new Dsn($dsn); + + $this->expectException(IncompleteDsnException::class); + if (null !== $message) { + $this->expectExceptionMessage($message); + } + + $factory->create($dsn); + } +} diff --git a/plugins/vendor/symfony/translation/Test/ProviderFactoryTestCase.php b/plugins/vendor/symfony/translation/Test/ProviderFactoryTestCase.php new file mode 100644 index 00000000..e82f3290 --- /dev/null +++ b/plugins/vendor/symfony/translation/Test/ProviderFactoryTestCase.php @@ -0,0 +1,85 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Test; + +use PHPUnit\Framework\MockObject\MockObject; +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpClient\MockHttpClient; +use Symfony\Component\Translation\Dumper\XliffFileDumper; +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\HttpClient\HttpClientInterface; + +/** + * A test case to ease testing a translation provider factory. + * + * @author Mathieu Santostefano + * + * @deprecated since Symfony 7.2, use AbstractProviderFactoryTestCase instead + */ +abstract class ProviderFactoryTestCase extends AbstractProviderFactoryTestCase +{ + use IncompleteDsnTestTrait; + + protected HttpClientInterface $client; + protected LoggerInterface|MockObject $logger; + protected string $defaultLocale; + protected LoaderInterface|MockObject $loader; + protected XliffFileDumper|MockObject $xliffFileDumper; + protected TranslatorBagInterface|MockObject $translatorBag; + + /** + * @return iterable + */ + public static function unsupportedSchemeProvider(): iterable + { + return []; + } + + /** + * @return iterable + */ + public static function incompleteDsnProvider(): iterable + { + return []; + } + + protected function getClient(): HttpClientInterface + { + return $this->client ??= new MockHttpClient(); + } + + protected function getLogger(): LoggerInterface + { + return $this->logger ??= $this->createMock(LoggerInterface::class); + } + + protected function getDefaultLocale(): string + { + return $this->defaultLocale ??= 'en'; + } + + protected function getLoader(): LoaderInterface + { + return $this->loader ??= $this->createMock(LoaderInterface::class); + } + + protected function getXliffFileDumper(): XliffFileDumper + { + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); + } + + protected function getTranslatorBag(): TranslatorBagInterface + { + return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); + } +} diff --git a/plugins/vendor/symfony/translation/Test/ProviderTestCase.php b/plugins/vendor/symfony/translation/Test/ProviderTestCase.php new file mode 100644 index 00000000..7907986c --- /dev/null +++ b/plugins/vendor/symfony/translation/Test/ProviderTestCase.php @@ -0,0 +1,84 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Test; + +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; +use Symfony\Component\HttpClient\MockHttpClient; +use Symfony\Component\Translation\Dumper\XliffFileDumper; +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Component\Translation\Provider\ProviderInterface; +use Symfony\Component\Translation\TranslatorBagInterface; +use Symfony\Contracts\HttpClient\HttpClientInterface; + +/** + * A test case to ease testing a translation provider. + * + * @author Mathieu Santostefano + */ +abstract class ProviderTestCase extends TestCase +{ + protected HttpClientInterface $client; + protected LoggerInterface|MockObject $logger; + protected string $defaultLocale; + protected LoaderInterface|MockObject $loader; + protected XliffFileDumper|MockObject $xliffFileDumper; + protected TranslatorBagInterface|MockObject $translatorBag; + + abstract public static function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; + + /** + * @return iterable + */ + abstract public static function toStringProvider(): iterable; + + /** + * @dataProvider toStringProvider + */ + #[DataProvider('toStringProvider')] + public function testToString(ProviderInterface $provider, string $expected) + { + $this->assertSame($expected, (string) $provider); + } + + protected function getClient(): MockHttpClient + { + return $this->client ??= new MockHttpClient(); + } + + protected function getLoader(): LoaderInterface + { + return $this->loader ??= $this->createMock(LoaderInterface::class); + } + + protected function getLogger(): LoggerInterface + { + return $this->logger ??= $this->createMock(LoggerInterface::class); + } + + protected function getDefaultLocale(): string + { + return $this->defaultLocale ??= 'en'; + } + + protected function getXliffFileDumper(): XliffFileDumper + { + return $this->xliffFileDumper ??= $this->createMock(XliffFileDumper::class); + } + + protected function getTranslatorBag(): TranslatorBagInterface + { + return $this->translatorBag ??= $this->createMock(TranslatorBagInterface::class); + } +} diff --git a/plugins/vendor/symfony/translation/TranslatableMessage.php b/plugins/vendor/symfony/translation/TranslatableMessage.php new file mode 100644 index 00000000..3c4986a6 --- /dev/null +++ b/plugins/vendor/symfony/translation/TranslatableMessage.php @@ -0,0 +1,60 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Contracts\Translation\TranslatableInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +/** + * @author Nate Wiebe + */ +class TranslatableMessage implements TranslatableInterface +{ + public function __construct( + private string $message, + private array $parameters = [], + private ?string $domain = null, + ) { + } + + public function __toString(): string + { + return $this->getMessage(); + } + + public function getMessage(): string + { + return $this->message; + } + + public function getParameters(): array + { + return $this->parameters; + } + + public function getDomain(): ?string + { + return $this->domain; + } + + public function trans(TranslatorInterface $translator, ?string $locale = null): string + { + $parameters = $this->getParameters(); + foreach ($parameters as $k => $v) { + if ($v instanceof TranslatableInterface) { + $parameters[$k] = $v->trans($translator, $locale); + } + } + + return $translator->trans($this->getMessage(), $parameters, $this->getDomain(), $locale); + } +} diff --git a/plugins/vendor/symfony/translation/Translator.php b/plugins/vendor/symfony/translation/Translator.php new file mode 100644 index 00000000..0553da7d --- /dev/null +++ b/plugins/vendor/symfony/translation/Translator.php @@ -0,0 +1,483 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Config\ConfigCacheFactory; +use Symfony\Component\Config\ConfigCacheFactoryInterface; +use Symfony\Component\Config\ConfigCacheInterface; +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\NotFoundResourceException; +use Symfony\Component\Translation\Exception\RuntimeException; +use Symfony\Component\Translation\Formatter\IntlFormatterInterface; +use Symfony\Component\Translation\Formatter\MessageFormatter; +use Symfony\Component\Translation\Formatter\MessageFormatterInterface; +use Symfony\Component\Translation\Loader\LoaderInterface; +use Symfony\Contracts\Translation\LocaleAwareInterface; +use Symfony\Contracts\Translation\TranslatableInterface; +use Symfony\Contracts\Translation\TranslatorInterface; + +// Help opcache.preload discover always-needed symbols +class_exists(MessageCatalogue::class); + +/** + * @author Fabien Potencier + */ +class Translator implements TranslatorInterface, TranslatorBagInterface, LocaleAwareInterface +{ + /** + * @var MessageCatalogueInterface[] + */ + protected array $catalogues = []; + + private string $locale; + + /** + * @var string[] + */ + private array $fallbackLocales = []; + + /** + * @var LoaderInterface[] + */ + private array $loaders = []; + + private array $resources = []; + + private MessageFormatterInterface $formatter; + + private ?ConfigCacheFactoryInterface $configCacheFactory; + + private array $parentLocales; + + private bool $hasIntlFormatter; + + /** + * @var array + */ + private array $globalParameters = []; + + /** + * @var array + */ + private array $globalTranslatedParameters = []; + + /** + * @throws InvalidArgumentException If a locale contains invalid characters + */ + public function __construct( + string $locale, + ?MessageFormatterInterface $formatter = null, + private ?string $cacheDir = null, + private bool $debug = false, + private array $cacheVary = [], + ) { + $this->setLocale($locale); + + $this->formatter = $formatter ??= new MessageFormatter(); + $this->hasIntlFormatter = $formatter instanceof IntlFormatterInterface; + } + + public function setConfigCacheFactory(ConfigCacheFactoryInterface $configCacheFactory): void + { + $this->configCacheFactory = $configCacheFactory; + } + + /** + * Adds a Loader. + * + * @param string $format The name of the loader (@see addResource()) + */ + public function addLoader(string $format, LoaderInterface $loader): void + { + $this->loaders[$format] = $loader; + } + + /** + * Adds a Resource. + * + * @param string $format The name of the loader (@see addLoader()) + * @param mixed $resource The resource name + * + * @throws InvalidArgumentException If the locale contains invalid characters + */ + public function addResource(string $format, mixed $resource, string $locale, ?string $domain = null): void + { + $domain ??= 'messages'; + + $this->assertValidLocale($locale); + $locale ?: $locale = class_exists(\Locale::class) ? \Locale::getDefault() : 'en'; + + $this->resources[$locale][] = [$format, $resource, $domain]; + + if (\in_array($locale, $this->fallbackLocales, true)) { + $this->catalogues = []; + } else { + unset($this->catalogues[$locale]); + } + } + + public function setLocale(string $locale): void + { + $this->assertValidLocale($locale); + $this->locale = $locale; + } + + public function getLocale(): string + { + return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en'); + } + + /** + * Sets the fallback locales. + * + * @param string[] $locales + * + * @throws InvalidArgumentException If a locale contains invalid characters + */ + public function setFallbackLocales(array $locales): void + { + // needed as the fallback locales are linked to the already loaded catalogues + $this->catalogues = []; + + foreach ($locales as $locale) { + $this->assertValidLocale($locale); + } + + $this->fallbackLocales = $this->cacheVary['fallback_locales'] = $locales; + } + + /** + * Gets the fallback locales. + * + * @internal + */ + public function getFallbackLocales(): array + { + return $this->fallbackLocales; + } + + public function addGlobalParameter(string $id, string|int|float|TranslatableInterface $value): void + { + $this->globalParameters[$id] = $value; + $this->globalTranslatedParameters = []; + } + + public function getGlobalParameters(): array + { + return $this->globalParameters; + } + + public function trans(?string $id, array $parameters = [], ?string $domain = null, ?string $locale = null): string + { + if (null === $id || '' === $id) { + return ''; + } + + $domain ??= 'messages'; + + $catalogue = $this->getCatalogue($locale); + $locale = $catalogue->getLocale(); + while (!$catalogue->defines($id, $domain)) { + if ($cat = $catalogue->getFallbackCatalogue()) { + $catalogue = $cat; + $locale = $catalogue->getLocale(); + } else { + break; + } + } + + foreach ($parameters as $key => $value) { + if ($value instanceof TranslatableInterface) { + $parameters[$key] = $value->trans($this, $locale); + } + } + + if (null === $globalParameters = &$this->globalTranslatedParameters[$locale]) { + $globalParameters = $this->globalParameters; + foreach ($globalParameters as $key => $value) { + if ($value instanceof TranslatableInterface) { + $globalParameters[$key] = $value->trans($this, $locale); + } + } + } + + if ($globalParameters) { + $parameters += $globalParameters; + } + + $len = \strlen(MessageCatalogue::INTL_DOMAIN_SUFFIX); + if ($this->hasIntlFormatter + && ($catalogue->defines($id, $domain.MessageCatalogue::INTL_DOMAIN_SUFFIX) + || (\strlen($domain) > $len && 0 === substr_compare($domain, MessageCatalogue::INTL_DOMAIN_SUFFIX, -$len, $len))) + ) { + return $this->formatter->formatIntl($catalogue->get($id, $domain), $locale, $parameters); + } + + return $this->formatter->format($catalogue->get($id, $domain), $locale, $parameters); + } + + public function getCatalogue(?string $locale = null): MessageCatalogueInterface + { + if (!$locale) { + $locale = $this->getLocale(); + } else { + $this->assertValidLocale($locale); + } + + if (!isset($this->catalogues[$locale])) { + $this->loadCatalogue($locale); + } + + return $this->catalogues[$locale]; + } + + public function getCatalogues(): array + { + return array_values($this->catalogues); + } + + /** + * Gets the loaders. + * + * @return LoaderInterface[] + */ + protected function getLoaders(): array + { + return $this->loaders; + } + + protected function loadCatalogue(string $locale): void + { + if (null === $this->cacheDir) { + $this->initializeCatalogue($locale); + } else { + $this->initializeCacheCatalogue($locale); + } + } + + protected function initializeCatalogue(string $locale): void + { + $this->assertValidLocale($locale); + + try { + $this->doLoadCatalogue($locale); + } catch (NotFoundResourceException $e) { + if (!$this->computeFallbackLocales($locale)) { + throw $e; + } + } + $this->loadFallbackCatalogues($locale); + } + + private function initializeCacheCatalogue(string $locale): void + { + if (isset($this->catalogues[$locale])) { + /* Catalogue already initialized. */ + return; + } + + $this->assertValidLocale($locale); + $cache = $this->getConfigCacheFactory()->cache($this->getCatalogueCachePath($locale), + function (ConfigCacheInterface $cache) use ($locale) { + $this->dumpCatalogue($locale, $cache); + } + ); + + if (isset($this->catalogues[$locale])) { + /* Catalogue has been initialized as it was written out to cache. */ + return; + } + + /* Read catalogue from cache. */ + $this->catalogues[$locale] = include $cache->getPath(); + } + + private function dumpCatalogue(string $locale, ConfigCacheInterface $cache): void + { + $this->initializeCatalogue($locale); + $fallbackContent = $this->getFallbackContent($this->catalogues[$locale]); + + $content = \sprintf(<<getAllMessages($this->catalogues[$locale]), true), + $fallbackContent + ); + + $cache->write($content, $this->catalogues[$locale]->getResources()); + } + + private function getFallbackContent(MessageCatalogue $catalogue): string + { + $fallbackContent = ''; + $current = ''; + $replacementPattern = '/[^a-z0-9_]/i'; + $fallbackCatalogue = $catalogue->getFallbackCatalogue(); + while ($fallbackCatalogue) { + $fallback = $fallbackCatalogue->getLocale(); + $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); + $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); + + $fallbackContent .= \sprintf(<<<'EOF' +$catalogue%s = new MessageCatalogue('%s', %s); +$catalogue%s->addFallbackCatalogue($catalogue%s); + +EOF + , + $fallbackSuffix, + $fallback, + var_export($this->getAllMessages($fallbackCatalogue), true), + $currentSuffix, + $fallbackSuffix + ); + $current = $fallbackCatalogue->getLocale(); + $fallbackCatalogue = $fallbackCatalogue->getFallbackCatalogue(); + } + + return $fallbackContent; + } + + private function getCatalogueCachePath(string $locale): string + { + return $this->cacheDir.'/catalogue.'.$locale.'.'.strtr(substr(base64_encode(hash('xxh128', serialize($this->cacheVary), true)), 0, 7), '/', '_').'.php'; + } + + /** + * @internal + */ + protected function doLoadCatalogue(string $locale): void + { + $this->catalogues[$locale] = new MessageCatalogue($locale); + + if (isset($this->resources[$locale])) { + foreach ($this->resources[$locale] as $resource) { + if (!isset($this->loaders[$resource[0]])) { + if (\is_string($resource[1])) { + throw new RuntimeException(\sprintf('No loader is registered for the "%s" format when loading the "%s" resource.', $resource[0], $resource[1])); + } + + throw new RuntimeException(\sprintf('No loader is registered for the "%s" format.', $resource[0])); + } + $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); + } + } + } + + private function loadFallbackCatalogues(string $locale): void + { + $current = $this->catalogues[$locale]; + + foreach ($this->computeFallbackLocales($locale) as $fallback) { + if (!isset($this->catalogues[$fallback])) { + $this->initializeCatalogue($fallback); + } + + $fallbackCatalogue = new MessageCatalogue($fallback, $this->getAllMessages($this->catalogues[$fallback])); + foreach ($this->catalogues[$fallback]->getResources() as $resource) { + $fallbackCatalogue->addResource($resource); + } + $current->addFallbackCatalogue($fallbackCatalogue); + $current = $fallbackCatalogue; + } + } + + protected function computeFallbackLocales(string $locale): array + { + $this->parentLocales ??= json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true); + + $originLocale = $locale; + $locales = []; + + while ($locale) { + $parent = $this->parentLocales[$locale] ?? null; + + if ($parent) { + $locale = 'root' !== $parent ? $parent : null; + } elseif (\function_exists('locale_parse')) { + $localeSubTags = locale_parse($locale); + $locale = null; + if (1 < \count($localeSubTags)) { + array_pop($localeSubTags); + $locale = locale_compose($localeSubTags) ?: null; + } + } elseif ($i = strrpos($locale, '_') ?: strrpos($locale, '-')) { + $locale = substr($locale, 0, $i); + } else { + $locale = null; + } + + if (null !== $locale) { + $locales[] = $locale; + } + } + + foreach ($this->fallbackLocales as $fallback) { + if ($fallback === $originLocale) { + continue; + } + + $locales[] = $fallback; + } + + return array_unique($locales); + } + + /** + * Asserts that the locale is valid, throws an Exception if not. + * + * @throws InvalidArgumentException If the locale contains invalid characters + */ + protected function assertValidLocale(string $locale): void + { + if (!preg_match('/^[a-z0-9@_\\.\\-]*$/i', $locale)) { + throw new InvalidArgumentException(\sprintf('Invalid "%s" locale.', $locale)); + } + } + + /** + * Provides the ConfigCache factory implementation, falling back to a + * default implementation if necessary. + */ + private function getConfigCacheFactory(): ConfigCacheFactoryInterface + { + $this->configCacheFactory ??= new ConfigCacheFactory($this->debug); + + return $this->configCacheFactory; + } + + private function getAllMessages(MessageCatalogueInterface $catalogue): array + { + $allMessages = []; + + foreach ($catalogue->all() as $domain => $messages) { + if ($intlMessages = $catalogue->all($domain.MessageCatalogue::INTL_DOMAIN_SUFFIX)) { + $allMessages[$domain.MessageCatalogue::INTL_DOMAIN_SUFFIX] = $intlMessages; + $messages = array_diff_key($messages, $intlMessages); + } + if ($messages) { + $allMessages[$domain] = $messages; + } + } + + return $allMessages; + } +} diff --git a/plugins/vendor/symfony/translation/TranslatorBag.php b/plugins/vendor/symfony/translation/TranslatorBag.php new file mode 100644 index 00000000..3b47aece --- /dev/null +++ b/plugins/vendor/symfony/translation/TranslatorBag.php @@ -0,0 +1,102 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Translation\Catalogue\AbstractOperation; +use Symfony\Component\Translation\Catalogue\TargetOperation; + +final class TranslatorBag implements TranslatorBagInterface +{ + /** @var MessageCatalogue[] */ + private array $catalogues = []; + + public function addCatalogue(MessageCatalogue $catalogue): void + { + if (null !== $existingCatalogue = $this->getCatalogue($catalogue->getLocale())) { + $catalogue->addCatalogue($existingCatalogue); + } + + $this->catalogues[$catalogue->getLocale()] = $catalogue; + } + + public function addBag(TranslatorBagInterface $bag): void + { + foreach ($bag->getCatalogues() as $catalogue) { + $this->addCatalogue($catalogue); + } + } + + public function getCatalogue(?string $locale = null): MessageCatalogueInterface + { + if (null === $locale || !isset($this->catalogues[$locale])) { + $this->catalogues[$locale] = new MessageCatalogue($locale); + } + + return $this->catalogues[$locale]; + } + + public function getCatalogues(): array + { + return array_values($this->catalogues); + } + + public function diff(TranslatorBagInterface $diffBag): self + { + $diff = new self(); + + foreach ($this->catalogues as $locale => $catalogue) { + if (null === $diffCatalogue = $diffBag->getCatalogue($locale)) { + $diff->addCatalogue($catalogue); + + continue; + } + + $operation = new TargetOperation($diffCatalogue, $catalogue); + $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::NEW_BATCH); + $newCatalogue = new MessageCatalogue($locale); + + foreach ($catalogue->getDomains() as $domain) { + $newCatalogue->add($operation->getNewMessages($domain), $domain); + } + + $diff->addCatalogue($newCatalogue); + } + + return $diff; + } + + public function intersect(TranslatorBagInterface $intersectBag): self + { + $diff = new self(); + + foreach ($this->catalogues as $locale => $catalogue) { + if (null === $intersectCatalogue = $intersectBag->getCatalogue($locale)) { + continue; + } + + $operation = new TargetOperation($catalogue, $intersectCatalogue); + $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::OBSOLETE_BATCH); + $obsoleteCatalogue = new MessageCatalogue($locale); + + foreach ($operation->getDomains() as $domain) { + $obsoleteCatalogue->add( + array_diff($operation->getMessages($domain), $operation->getNewMessages($domain)), + $domain + ); + } + + $diff->addCatalogue($obsoleteCatalogue); + } + + return $diff; + } +} diff --git a/plugins/vendor/symfony/translation/TranslatorBagInterface.php b/plugins/vendor/symfony/translation/TranslatorBagInterface.php new file mode 100644 index 00000000..365d1f13 --- /dev/null +++ b/plugins/vendor/symfony/translation/TranslatorBagInterface.php @@ -0,0 +1,36 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; + +/** + * @author Abdellatif Ait boudad + */ +interface TranslatorBagInterface +{ + /** + * Gets the catalogue by locale. + * + * @param string|null $locale The locale or null to use the default + * + * @throws InvalidArgumentException If the locale contains invalid characters + */ + public function getCatalogue(?string $locale = null): MessageCatalogueInterface; + + /** + * Returns all catalogues of the instance. + * + * @return MessageCatalogueInterface[] + */ + public function getCatalogues(): array; +} diff --git a/plugins/vendor/symfony/translation/Util/ArrayConverter.php b/plugins/vendor/symfony/translation/Util/ArrayConverter.php new file mode 100644 index 00000000..2fc666d4 --- /dev/null +++ b/plugins/vendor/symfony/translation/Util/ArrayConverter.php @@ -0,0 +1,142 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Util; + +/** + * ArrayConverter generates tree like structure from a message catalogue. + * e.g. this + * 'foo.bar1' => 'test1', + * 'foo.bar2' => 'test2' + * converts to follows: + * foo: + * bar1: test1 + * bar2: test2. + * + * @author Gennady Telegin + */ +class ArrayConverter +{ + /** + * Converts linear messages array to tree-like array. + * For example: ['foo.bar' => 'value'] will be converted to ['foo' => ['bar' => 'value']]. + * + * @param array $messages Linear messages array + */ + public static function expandToTree(array $messages): array + { + $tree = []; + + foreach ($messages as $id => $value) { + $referenceToElement = &self::getElementByPath($tree, self::getKeyParts($id)); + + $referenceToElement = $value; + + unset($referenceToElement); + } + + return $tree; + } + + private static function &getElementByPath(array &$tree, array $parts): mixed + { + $elem = &$tree; + $parentOfElem = null; + + foreach ($parts as $i => $part) { + if (isset($elem[$part]) && \is_string($elem[$part])) { + /* Process next case: + * 'foo': 'test1', + * 'foo.bar': 'test2' + * + * $tree['foo'] was string before we found array {bar: test2}. + * Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2'; + */ + $elem = &$elem[implode('.', \array_slice($parts, $i))]; + break; + } + + $parentOfElem = &$elem; + $elem = &$elem[$part]; + } + + if ($elem && \is_array($elem) && $parentOfElem) { + /* Process next case: + * 'foo.bar': 'test1' + * 'foo': 'test2' + * + * $tree['foo'] was array = {bar: 'test1'} before we found string constant `foo`. + * Cancel treating $tree['foo'] as array and cancel back it expansion, + * e.g. make it $tree['foo.bar'] = 'test1' again. + */ + self::cancelExpand($parentOfElem, $part, $elem); + } + + return $elem; + } + + private static function cancelExpand(array &$tree, string $prefix, array $node): void + { + $prefix .= '.'; + + foreach ($node as $id => $value) { + if (\is_string($value)) { + $tree[$prefix.$id] = $value; + } else { + self::cancelExpand($tree, $prefix.$id, $value); + } + } + } + + /** + * @return string[] + */ + private static function getKeyParts(string $key): array + { + $parts = explode('.', $key); + $partsCount = \count($parts); + + $result = []; + $buffer = ''; + + foreach ($parts as $index => $part) { + if (0 === $index && '' === $part) { + $buffer = '.'; + + continue; + } + + if ($index === $partsCount - 1 && '' === $part) { + $buffer .= '.'; + $result[] = $buffer; + + continue; + } + + if (isset($parts[$index + 1]) && '' === $parts[$index + 1]) { + $buffer .= $part; + + continue; + } + + if ($buffer) { + $result[] = $buffer.$part; + $buffer = ''; + + continue; + } + + $result[] = $part; + } + + return $result; + } +} diff --git a/plugins/vendor/symfony/translation/Util/XliffUtils.php b/plugins/vendor/symfony/translation/Util/XliffUtils.php new file mode 100644 index 00000000..e76e1228 --- /dev/null +++ b/plugins/vendor/symfony/translation/Util/XliffUtils.php @@ -0,0 +1,191 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Util; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\InvalidResourceException; + +/** + * Provides some utility methods for XLIFF translation files, such as validating + * their contents according to the XSD schema. + * + * @author Fabien Potencier + */ +class XliffUtils +{ + /** + * Gets xliff file version based on the root "version" attribute. + * + * Defaults to 1.2 for backwards compatibility. + * + * @throws InvalidArgumentException + */ + public static function getVersionNumber(\DOMDocument $dom): string + { + /** @var \DOMNode $xliff */ + foreach ($dom->getElementsByTagName('xliff') as $xliff) { + $version = $xliff->attributes->getNamedItem('version'); + if ($version) { + return $version->nodeValue; + } + + $namespace = $xliff->attributes->getNamedItem('xmlns'); + if ($namespace) { + if (0 !== substr_compare('urn:oasis:names:tc:xliff:document:', $namespace->nodeValue, 0, 34)) { + throw new InvalidArgumentException(\sprintf('Not a valid XLIFF namespace "%s".', $namespace)); + } + + return substr($namespace, 34); + } + } + + // Falls back to v1.2 + return '1.2'; + } + + /** + * Validates and parses the given file into a DOMDocument. + * + * @throws InvalidResourceException + */ + public static function validateSchema(\DOMDocument $dom): array + { + $xliffVersion = static::getVersionNumber($dom); + $internalErrors = libxml_use_internal_errors(true); + if ($shouldEnable = self::shouldEnableEntityLoader()) { + $disableEntities = libxml_disable_entity_loader(false); + } + try { + $isValid = @$dom->schemaValidateSource(self::getSchema($xliffVersion)); + if (!$isValid) { + return self::getXmlErrors($internalErrors); + } + } finally { + if ($shouldEnable) { + libxml_disable_entity_loader($disableEntities); + } + } + + $dom->normalizeDocument(); + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return []; + } + + private static function shouldEnableEntityLoader(): bool + { + static $dom, $schema; + if (null === $dom) { + $dom = new \DOMDocument(); + $dom->loadXML(''); + + $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); + register_shutdown_function(static function () use ($tmpfile) { + @unlink($tmpfile); + }); + $schema = ' + + +'; + file_put_contents($tmpfile, ' + + + +'); + } + + return !@$dom->schemaValidateSource($schema); + } + + public static function getErrorsAsString(array $xmlErrors): string + { + $errorsAsString = ''; + + foreach ($xmlErrors as $error) { + $errorsAsString .= \sprintf("[%s %s] %s (in %s - line %d, column %d)\n", + \LIBXML_ERR_WARNING === $error['level'] ? 'WARNING' : 'ERROR', + $error['code'], + $error['message'], + $error['file'], + $error['line'], + $error['column'] + ); + } + + return $errorsAsString; + } + + private static function getSchema(string $xliffVersion): string + { + if ('1.2' === $xliffVersion) { + $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-1.2-transitional.xsd'); + $xmlUri = 'http://www.w3.org/2001/xml.xsd'; + } elseif ('2.0' === $xliffVersion) { + $schemaSource = file_get_contents(__DIR__.'/../Resources/schemas/xliff-core-2.0.xsd'); + $xmlUri = 'informativeCopiesOf3rdPartySchemas/w3c/xml.xsd'; + } else { + throw new InvalidArgumentException(\sprintf('No support implemented for loading XLIFF version "%s".', $xliffVersion)); + } + + return self::fixXmlLocation($schemaSource, $xmlUri); + } + + /** + * Internally changes the URI of a dependent xsd to be loaded locally. + */ + private static function fixXmlLocation(string $schemaSource, string $xmlUri): string + { + $newPath = str_replace('\\', '/', __DIR__).'/../Resources/schemas/xml.xsd'; + $parts = explode('/', $newPath); + $locationstart = 'file:///'; + if (0 === stripos($newPath, 'phar://')) { + $tmpfile = tempnam(sys_get_temp_dir(), 'symfony'); + if ($tmpfile) { + copy($newPath, $tmpfile); + $parts = explode('/', str_replace('\\', '/', $tmpfile)); + } else { + array_shift($parts); + $locationstart = 'phar:///'; + } + } + + $drive = '\\' === \DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; + $newPath = $locationstart.$drive.implode('/', array_map('rawurlencode', $parts)); + + return str_replace($xmlUri, $newPath, $schemaSource); + } + + /** + * Returns the XML errors of the internal XML parser. + */ + private static function getXmlErrors(bool $internalErrors): array + { + $errors = []; + foreach (libxml_get_errors() as $error) { + $errors[] = [ + 'level' => \LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', + 'code' => $error->code, + 'message' => trim($error->message), + 'file' => $error->file ?: 'n/a', + 'line' => $error->line, + 'column' => $error->column, + ]; + } + + libxml_clear_errors(); + libxml_use_internal_errors($internalErrors); + + return $errors; + } +} diff --git a/plugins/vendor/symfony/translation/Writer/TranslationWriter.php b/plugins/vendor/symfony/translation/Writer/TranslationWriter.php new file mode 100644 index 00000000..be3f6bf3 --- /dev/null +++ b/plugins/vendor/symfony/translation/Writer/TranslationWriter.php @@ -0,0 +1,71 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Writer; + +use Symfony\Component\Translation\Dumper\DumperInterface; +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\Exception\RuntimeException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * TranslationWriter writes translation messages. + * + * @author Michel Salib + */ +class TranslationWriter implements TranslationWriterInterface +{ + /** + * @var array + */ + private array $dumpers = []; + + /** + * Adds a dumper to the writer. + */ + public function addDumper(string $format, DumperInterface $dumper): void + { + $this->dumpers[$format] = $dumper; + } + + /** + * Obtains the list of supported formats. + */ + public function getFormats(): array + { + return array_keys($this->dumpers); + } + + /** + * Writes translation from the catalogue according to the selected format. + * + * @param string $format The format to use to dump the messages + * @param array $options Options that are passed to the dumper + * + * @throws InvalidArgumentException + */ + public function write(MessageCatalogue $catalogue, string $format, array $options = []): void + { + if (!isset($this->dumpers[$format])) { + throw new InvalidArgumentException(\sprintf('There is no dumper associated with format "%s".', $format)); + } + + // get the right dumper + $dumper = $this->dumpers[$format]; + + if (isset($options['path']) && !is_dir($options['path']) && !@mkdir($options['path'], 0777, true) && !is_dir($options['path'])) { + throw new RuntimeException(\sprintf('Translation Writer was not able to create directory "%s".', $options['path'])); + } + + // save + $dumper->dump($catalogue, $options); + } +} diff --git a/plugins/vendor/symfony/translation/Writer/TranslationWriterInterface.php b/plugins/vendor/symfony/translation/Writer/TranslationWriterInterface.php new file mode 100644 index 00000000..b3062827 --- /dev/null +++ b/plugins/vendor/symfony/translation/Writer/TranslationWriterInterface.php @@ -0,0 +1,33 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Translation\Writer; + +use Symfony\Component\Translation\Exception\InvalidArgumentException; +use Symfony\Component\Translation\MessageCatalogue; + +/** + * TranslationWriter writes translation messages. + * + * @author Michel Salib + */ +interface TranslationWriterInterface +{ + /** + * Writes translation from the catalogue according to the selected format. + * + * @param string $format The format to use to dump the messages + * @param array $options Options that are passed to the dumper + * + * @throws InvalidArgumentException + */ + public function write(MessageCatalogue $catalogue, string $format, array $options = []): void; +} diff --git a/plugins/vendor/symfony/translation/composer.json b/plugins/vendor/symfony/translation/composer.json new file mode 100644 index 00000000..ce9a7bf4 --- /dev/null +++ b/plugins/vendor/symfony/translation/composer.json @@ -0,0 +1,61 @@ +{ + "name": "symfony/translation", + "type": "library", + "description": "Provides tools to internationalize your application", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=8.2", + "symfony/polyfill-mbstring": "~1.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "require-dev": { + "nikic/php-parser": "^5.0", + "symfony/config": "^6.4|^7.0", + "symfony/console": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/http-client-contracts": "^2.5|^3.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/polyfill-intl-icu": "^1.21", + "symfony/routing": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/yaml": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "psr/log": "^1|^2|^3" + }, + "conflict": { + "nikic/php-parser": "<5.0", + "symfony/config": "<6.4", + "symfony/dependency-injection": "<6.4", + "symfony/http-client-contracts": "<2.5", + "symfony/http-kernel": "<6.4", + "symfony/service-contracts": "<2.5", + "symfony/twig-bundle": "<6.4", + "symfony/yaml": "<6.4", + "symfony/console": "<6.4" + }, + "provide": { + "symfony/translation-implementation": "2.3|3.0" + }, + "autoload": { + "files": [ "Resources/functions.php" ], + "psr-4": { "Symfony\\Component\\Translation\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev" +} diff --git a/plugins/vendor/voku/portable-ascii/.deepsource.toml b/plugins/vendor/voku/portable-ascii/.deepsource.toml new file mode 100644 index 00000000..3f8f43ce --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/.deepsource.toml @@ -0,0 +1,4 @@ +version = 1 + +[[analyzers]] +name = "php" \ No newline at end of file diff --git a/plugins/vendor/voku/portable-ascii/CHANGELOG.md b/plugins/vendor/voku/portable-ascii/CHANGELOG.md new file mode 100644 index 00000000..52f4912e --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/CHANGELOG.md @@ -0,0 +1,210 @@ +# Changelog + +### 2.0.3 (2024-11-21) + +- use modern phpdocs e.g. list or conditional-return annotations + +### 2.0.2 (2024-11-21) + +- small fix for PHP 8.4 (thanks to @gilbertoalbino) + +### 2.0.1 (2022-03-08) + +- "To people of Russia": There is a war in Ukraine right now. The forces of the Russian Federation are attacking civilians. +- optimize some phpdocs + +### 2.0.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.1 (2022-01-24) + +- revert: prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- revert: fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- revert: fix "Persian" char-mapping (thanks to @frost-cyber) + +### 1.6.0 (2022-01-24) + +- prefer "Russian - Passport (2013), ICAO" instead of "Russian - GOST 7.79-2000(B)" +- fix "Ukrainian" char-mapping (thanks to @Andr1yk0) +- fix "Persian" char-mapping (thanks to @frost-cyber) +- fix "ASCII::normalize_whitespace()" -> "CARRIAGE RETURN" is more like "
" and no "\n" +- add "ASCII::to_ascii_remap()" -> this method will return broken characters and is only for special cases + +### 1.5.6 (2020-11-12) + +- "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed v2 + +### 1.5.5 (2020-11-12) + +- fix "Greeklish" char-mapping (thanks @sebdesign) +- "ASCII::normalize_whitespace()" -> can now also remove "control characters" if needed + +### 1.5.4 (2020-11-08) + +- add some missing replacements in U+23xx page (thanks @marcoffee) +- fix "Russian" char-mapping (thanks @ilyahoilik) +- running test with PHP 8.0 rc3 + +### 1.5.3 (2020-07-23) + +- fix "Georgian" char-mapping (thanks @waska14) + +### 1.5.2 (2020-06-16) + +- add "Bengali" (bn) language support (thanks @eliyas5044) +- fix "Portuguese" char-mapping +- reduce the file size (removed extra comments from "avian2/unidecode") + +### 1.5.1 (2020-05-26) + +- fix merge ASCII transliterations from "avian2/unidecode" (python) + -> https://github.com/avian2/unidecode/ + +### 1.5.0 (2020-05-24) + +- merge ASCII transliterations from "avian2/unidecode" (python) + -> https://github.com/avian2/unidecode/ + +### 1.4.11 (2020-05-23) + +- "composer.json" -> remove "autoload-dev" stuff from "autoload" +- "voku/php-readme-helper" -> auto-generate the API documentation in the README + +### 1.4.10 (2020-03-13) + +- ASCII::to_ascii() -> fix extra symbol handling in the regex +- ASCII::to_ascii() -> fix for languages with multi-length-special-char (e.g. Greek -> 'ει' => 'i') + +### 1.4.9 (2020-03-06) + +- ASCII::to_slugify() -> fix php warning from empty "separator" + +### 1.4.8 (2020-02-06) + +- small optimization for "ASCII::to_ascii()" performance + +### 1.4.7 (2020-01-27) + +- fix possible wrong type from "getDataIfExists()" -> e.g. a bug reported where "/data/" was modified +- inline variables +- do not use "=== true" for "bool"-types + +### 1.4.6 (2019-12-23) + +- optimize "ASCII::to_ascii()" performance +- add "armenian" chars +- add "ASCII:getAllLanguages()" + +### 1.4.5 (2019-12-19) + +- use "@psalm-pure" v2 + +### 1.4.4 (2019-12-19) + +- use "@psalm-pure" + +### 1.4.3 (2019-12-19) + +- use "@psalm-immutable" + +### 1.4.2 (2019-12-13) + +- optimize the performance v2 +- more fixes for non-ascii regex + +### 1.4.1 (2019-12-13) + +- fix regex for non-ascii + +### 1.4.0 (2019-12-13) + +- optimize the performance, via single char replacements + +### 1.3.6 (2019-12-13) + +- "ascii_extras" -> convert the static content into ascii + -> e.g.: instead of replacing "+" with "più" we use "piu" (Italian), because we want to use ascii anyway + +### 1.3.5 (2019-11-11) + +- fix "ASCII::remove_invisible_characters()" -> do not remove invisible encoded url strings by default + +### 1.3.4 (2019-10-14) + +- fix static cache for "ASCII::charsArrayWithOneLanguage" + +### 1.3.3 (2019-10-14) + +- fix "Turkish" mapping -> 'ä' -> 'a' + +### 1.3.2 (2019-10-14) + +- fix language parameter usage with e.g. "de_DE" +- re-add missing "extra"-mapping chars + +### 1.3.1 (2019-10-13) + +- fix "ASCII::to_slugify" -> remove unicode chars +- add more test for ascii chars in the mapping +- fix non ascii chars in the mapping + +### 1.3.0 (2019-10-12) + +- add transliteration "fr" (was supported before, but with chars from other languages) +- add transliteration "ru" - Passport (2013), ICAO +- add transliteration "ru" - GOST 7.79-2000(B) +- add transliteration "el" - greeklish +- add transliteration "zh" +- add transliteration "nl" +- add transliteration "it" +- add transliteration "mk" +- add transliteration "pt" +- add constants -> ASCII::*LANGUAGE_CODES +- add more special latin chars / (currency) symbols +- add simple tests for all supported languages +- optimize "Russian" to ASCII (via "translit.ru") +- optimize performance of string replacement +- optimize performance of array merging +- optimize phpdoc comments +- "ASCII::to_transliterate" -> use "transliterator_create" + static cache +- "ASCII::to_ascii" -> fix "remove unsupported chars" +- "ASCII::to_ascii" -> add some more special chars +- run/fix static analyse via "pslam" + "phpstan" +- auto fix code style via "php-cs-fixer" +- fix transliteration for "german" +- fix transliteration for "persian" (thanks @mardep) +- fix transliteration for "polish" (thanks @dariusz.drobisz) +- fix transliteration for "bulgarian" (thanks @mkosturkov) +- fix transliteration for "croatian" (thanks @ludifonovac) +- fix transliteration for "serbian" (thanks @ludifonovac) +- fix transliteration for "swedish" (thanks @nicholasruunu) +- fix transliteration for "france" (thanks @sharptsa) +- fix transliteration for "serbian" (thanks @nikolaposa) +- fix transliteration for "czech" (thanks @slepic) + +### 1.2.3 (2019-09-10) + +- fix language depending ASCII chars (the order matters) + +### 1.2.2 (2019-09-10) + +- fix bulgarian ASCII chars | thanks @bgphp + +### 1.2.1 (2019-09-07) + +- "charsArray()" -> add access to "ASCII::$ASCII_MAPS*"" + +### 1.2.0 (2019-09-07) + +- "to_slugify()" -> use the extra ascii array + +### 1.1.0 (2019-09-07) + +- add + split extra ascii replacements + +### 1.0.0 (2019-09-05) + +- initial commit \ No newline at end of file diff --git a/plugins/vendor/voku/portable-ascii/LICENSE.txt b/plugins/vendor/voku/portable-ascii/LICENSE.txt new file mode 100644 index 00000000..b6ba47ea --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (C) 2019 Lars Moelleken + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/plugins/vendor/voku/portable-ascii/README.md b/plugins/vendor/voku/portable-ascii/README.md new file mode 100644 index 00000000..3ce36d60 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/README.md @@ -0,0 +1,451 @@ +[//]: # (AUTO-GENERATED BY "PHP README Helper": base file -> docs/base.md) +[![SWUbanner](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner2-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md) + +[![Build Status](https://github.com/voku/portable-ascii/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/voku/portable-ascii/actions) +[![Build status](https://ci.appveyor.com/api/projects/status/gnejjnk7qplr7f5t/branch/master?svg=true)](https://ci.appveyor.com/project/voku/portable-ascii/branch/master) +[![codecov.io](https://codecov.io/github/voku/portable-ascii/coverage.svg?branch=master)](https://codecov.io/github/voku/portable-ascii?branch=master) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/997c9bb10d1c4791967bdf2e42013e8e)](https://www.codacy.com/app/voku/portable-ascii) +[![Latest Stable Version](https://poser.pugx.org/voku/portable-ascii/v/stable)](https://packagist.org/packages/voku/portable-ascii) +[![Total Downloads](https://poser.pugx.org/voku/portable-ascii/downloads)](https://packagist.org/packages/voku/portable-ascii) +[![License](https://poser.pugx.org/voku/portable-ascii/license)](https://packagist.org/packages/voku/portable-ascii) +[![Donate to this project using Paypal](https://img.shields.io/badge/paypal-donate-yellow.svg)](https://www.paypal.me/moelleken) +[![Donate to this project using Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/voku) + +# 🔡 Portable ASCII + +## Description + +It is written in PHP (PHP 7+) and can work without "mbstring", "iconv" or any other extra encoding php-extension on your server. + +The benefit of Portable ASCII is that it is easy to use, easy to bundle. + +The project based on ... ++ Sean M. Burke's work (https://metacpan.org/pod/Text::Unidecode) ++ Tomaz Solc's work (https://pypi.org/project/Unidecode/) ++ Portable UTF-8 work (https://github.com/voku/portable-utf8) ++ Daniel St. Jules's work (https://github.com/danielstjules/Stringy) ++ Johnny Broadway's work (https://github.com/jbroadway/urlify) ++ and many cherry-picks from "github"-gists and "Stack Overflow"-snippets ... + +## Index + +* [Alternative](#alternative) +* [Install](#install-portable-ascii-via-composer-require) +* [Why Portable ASCII?](#why-portable-ascii) +* [Requirements and Recommendations](#requirements-and-recommendations) +* [Usage](#usage) +* [Class methods](#class-methods) +* [Unit Test](#unit-test) +* [License and Copyright](#license-and-copyright) + +## Alternative + +If you like a more Object Oriented Way to edit strings, then you can take a look at [voku/Stringy](https://github.com/voku/Stringy), it's a fork of "danielstjules/Stringy" but it used the "Portable ASCII"-Class and some extra methods. + +```php +// Portable ASCII +use voku\helper\ASCII; +ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii' + +// voku/Stringy +use Stringy\Stringy as S; +$stringy = S::create('déjà σσς iıii'); +$stringy->toTransliterate(); // 'deja sss iiii' +``` + +## Install "Portable ASCII" via "composer require" +```shell +composer require voku/portable-ascii +``` + +## Why Portable ASCII?[]() +I need ASCII char handling in different classes and before I added this functions into "Portable UTF-8", +but this repo is more modular and portable, because it has no dependencies. + +## Requirements and Recommendations + +* No extensions are required to run this library. Portable ASCII only needs PCRE library that is available by default since PHP 4.2.0 and cannot be disabled since PHP 5.3.0. "\u" modifier support in PCRE for ASCII handling is not a must. +* PHP 7.0 is the minimum requirement +* PHP 8.0 is also supported + +## Usage + +Example: ASCII::to_ascii() +```php + echo ASCII::to_ascii('�Düsseldorf�', 'de'); + + // will output + // Duesseldorf + + echo ASCII::to_ascii('�Düsseldorf�', 'en'); + + // will output + // Dusseldorf +``` + +# Portable ASCII | API + +The API from the "ASCII"-Class is written as small static methods. + + +## Class methods + +

charsArray +charsArrayWithMultiLanguageValues +charsArrayWithOneLanguage +charsArrayWithSingleLanguageValues +
clean +getAllLanguages +is_ascii +normalize_msword +
normalize_whitespace +remove_invisible_characters +to_ascii +to_ascii_remap +
to_filename +to_slugify +to_transliterate +
+ +#### charsArray(bool $replace_extra_symbols): array + +Returns an replacement array for ASCII methods. + +EXAMPLE: +$array = ASCII::charsArray(); +var_dump($array['ru']['б']); // 'b' + + +**Parameters:** +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` + +**Return:** +- `array` + +-------- + +#### charsArrayWithMultiLanguageValues(bool $replace_extra_symbols): array + +Returns an replacement array for ASCII methods with a mix of multiple languages. + +EXAMPLE: +$array = ASCII::charsArrayWithMultiLanguageValues(); +var_dump($array['b']); // ['β', 'б', 'ဗ', 'ბ', 'ب'] + + +**Parameters:** +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` + +**Return:** +- `array

An array of replacements.

` + +-------- + +#### charsArrayWithOneLanguage(string $language, bool $replace_extra_symbols, bool $asOrigReplaceArray): array + +Returns an replacement array for ASCII methods with one language. + +For example, German will map 'ä' to 'ae', while other languages +will simply return e.g. 'a'. + +EXAMPLE: +$array = ASCII::charsArrayWithOneLanguage('ru'); +$tmpKey = \array_search('yo', $array['replace']); +echo $array['orig'][$tmpKey]; // 'ё' + + +**Parameters:** +- `ASCII::* $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. +(default is 'en') | ASCII::*_LANGUAGE_CODE

` +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` +- `bool $asOrigReplaceArray [optional]

TRUE === return {orig: string[], replace: string[]} +array

` + +**Return:** +- `array

An array of replacements.

` + +-------- + +#### charsArrayWithSingleLanguageValues(bool $replace_extra_symbols, bool $asOrigReplaceArray): array + +Returns an replacement array for ASCII methods with multiple languages. + +EXAMPLE: +$array = ASCII::charsArrayWithSingleLanguageValues(); +$tmpKey = \array_search('hnaik', $array['replace']); +echo $array['orig'][$tmpKey]; // '၌' + + +**Parameters:** +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

` +- `bool $asOrigReplaceArray [optional]

TRUE === return {orig: string[], replace: string[]} +array

` + +**Return:** +- `array

An array of replacements.

` + +-------- + +#### clean(string $str, bool $normalize_whitespace, bool $keep_non_breaking_space, bool $normalize_msword, bool $remove_invisible_characters): string + +Accepts a string and removes all non-UTF-8 characters from it + extras if needed. + +**Parameters:** +- `string $str

The string to be sanitized.

` +- `bool $normalize_whitespace [optional]

Set to true, if you need to normalize the +whitespace.

` +- `bool $keep_non_breaking_space [optional]

Set to true, to keep non-breaking-spaces, in +combination with +$normalize_whitespace

` +- `bool $normalize_msword [optional]

Set to true, if you need to normalize MS Word chars +e.g.: "…" +=> "..."

` +- `bool $remove_invisible_characters [optional]

Set to false, if you not want to remove invisible +characters e.g.: "\0"

` + +**Return:** +- `string

A clean UTF-8 string.

` + +-------- + +#### getAllLanguages(): string[] + +Get all languages from the constants "ASCII::.*LANGUAGE_CODE". + +**Parameters:** +__nothing__ + +**Return:** +- `string[]` + +-------- + +#### is_ascii(string $str): bool + +Checks if a string is 7 bit ASCII. + +EXAMPLE: +ASCII::is_ascii('白'); // false + + +**Parameters:** +- `string $str

The string to check.

` + +**Return:** +- `bool

+true if it is ASCII
+false otherwise +

` + +-------- + +#### normalize_msword(string $str): string + +Returns a string with smart quotes, ellipsis characters, and dashes from +Windows-1252 (commonly used in Word documents) replaced by their ASCII +equivalents. + +EXAMPLE: +ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."' + + +**Parameters:** +- `string $str

The string to be normalized.

` + +**Return:** +- `string

A string with normalized characters for commonly used chars in Word documents.

` + +-------- + +#### normalize_whitespace(string $str, bool $keepNonBreakingSpace, bool $keepBidiUnicodeControls, bool $normalize_control_characters): string + +Normalize the whitespace. + +EXAMPLE: +ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", true); // "abc-\xc2\xa0-öäü- -" + + +**Parameters:** +- `string $str

The string to be normalized.

` +- `bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

` +- `bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) +bidirectional text chars.

` +- `bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

` + +**Return:** +- `string

A string with normalized whitespace.

` + +-------- + +#### remove_invisible_characters(string $str, bool $url_encoded, string $replacement, bool $keep_basic_control_characters): string + +Remove invisible characters from a string. + +e.g.: This prevents sandwiching null characters between ascii characters, like Java\0script. + +copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Common.php + +**Parameters:** +- `string $str` +- `bool $url_encoded` +- `string $replacement` +- `bool $keep_basic_control_characters` + +**Return:** +- `string` + +-------- + +#### to_ascii(string $str, string $language, bool $remove_unsupported_chars, bool $replace_extra_symbols, bool $use_transliterate, bool|null $replace_single_chars_only): string + +Returns an ASCII version of the string. A set of non-ASCII characters are +replaced with their closest ASCII counterparts, and the rest are removed +by default. The language or locale of the source string can be supplied +for language-specific transliteration in any of the following formats: +en, en_GB, or en-GB. For example, passing "de" results in "äöü" mapping +to "aeoeue" rather than "aou" as in other languages. + +EXAMPLE: +ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf + + +**Parameters:** +- `string $str

The input string.

` +- `ASCII::* $language [optional]

Language of the source string. +(default is 'en') | ASCII::*_LANGUAGE_CODE

` +- `bool $remove_unsupported_chars [optional]

Whether or not to remove the +unsupported characters.

` +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound +".

` +- `bool $use_transliterate [optional]

Use ASCII::to_transliterate() for unknown chars.

` +- `bool|null $replace_single_chars_only [optional]

Single char replacement is better for the +performance, but some languages need to replace more then one char +at the same time. | NULL === auto-setting, depended on the +language

` + +**Return:** +- `string

A string that contains only ASCII characters.

` + +-------- + +#### to_ascii_remap(string $str1, string $str2): string[] + +WARNING: This method will return broken characters and is only for special cases. + +Convert two UTF-8 encoded string to a single-byte strings suitable for +functions that need the same string length after the conversion. + +The function simply uses (and updates) a tailored dynamic encoding +(in/out map parameter) where non-ascii characters are remapped to +the range [128-255] in order of appearance. + +**Parameters:** +- `string $str1` +- `string $str2` + +**Return:** +- `string[]` + +-------- + +#### to_filename(string $str, bool $use_transliterate, string $fallback_char): string + +Convert given string to safe filename (and keep string case). + +EXAMPLE: +ASCII::to_filename('שדגשדג.png', true)); // 'shdgshdg.png' + + +**Parameters:** +- `string $str` +- `bool $use_transliterate

ASCII::to_transliterate() is used by default - unsafe characters are +simply replaced with hyphen otherwise.

` +- `string $fallback_char` + +**Return:** +- `string

A string that contains only safe characters for a filename.

` + +-------- + +#### to_slugify(string $str, string $separator, string $language, string[] $replacements, bool $replace_extra_symbols, bool $use_str_to_lower, bool $use_transliterate): string + +Converts the string into an URL slug. This includes replacing non-ASCII +characters with their closest ASCII equivalents, removing remaining +non-ASCII and non-alphanumeric characters, and replacing whitespace with +$separator. The separator defaults to a single dash, and the string +is also converted to lowercase. The language of the source string can +also be supplied for language-specific transliteration. + +**Parameters:** +- `string $str` +- `string $separator [optional]

The string used to replace whitespace.

` +- `ASCII::* $language [optional]

Language of the source string. +(default is 'en') | ASCII::*_LANGUAGE_CODE

` +- `array $replacements [optional]

A map of replaceable strings.

` +- `bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " +pound ".

` +- `bool $use_str_to_lower [optional]

Use "string to lower" for the input.

` +- `bool $use_transliterate [optional]

Use ASCII::to_transliterate() for unknown +chars.

` + +**Return:** +- `string

A string that has been converted to an URL slug.

` + +-------- + +#### to_transliterate(string $str, string|null $unknown, bool $strict): string + +Returns an ASCII version of the string. A set of non-ASCII characters are +replaced with their closest ASCII counterparts, and the rest are removed +unless instructed otherwise. + +EXAMPLE: +ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii' + + +**Parameters:** +- `string $str

The input string.

` +- `string|null $unknown [optional]

Character use if character unknown. (default is '?') +But you can also use NULL to keep the unknown chars.

` +- `bool $strict [optional]

Use "transliterator_transliterate()" from PHP-Intl` + +**Return:** +- `string

A String that contains only ASCII characters.

` + +-------- + + + +## Unit Test + +1) [Composer](https://getcomposer.org) is a prerequisite for running the tests. + +``` +composer install +``` + +2) The tests can be executed by running this command from the root directory: + +```bash +./vendor/bin/phpunit +``` + +### Support + +For support and donations please visit [Github](https://github.com/voku/portable-ascii/) | [Issues](https://github.com/voku/portable-ascii/issues) | [PayPal](https://paypal.me/moelleken) | [Patreon](https://www.patreon.com/voku). + +For status updates and release announcements please visit [Releases](https://github.com/voku/portable-ascii/releases) | [Twitter](https://twitter.com/suckup_de) | [Patreon](https://www.patreon.com/voku/posts). + +For professional support please contact [me](https://about.me/voku). + +### Thanks + +- Thanks to [GitHub](https://github.com) (Microsoft) for hosting the code and a good infrastructure including Issues-Managment, etc. +- Thanks to [IntelliJ](https://www.jetbrains.com) as they make the best IDEs for PHP and they gave me an open source license for PhpStorm! +- Thanks to [Travis CI](https://travis-ci.com/) for being the most awesome, easiest continous integration tool out there! +- Thanks to [StyleCI](https://styleci.io/) for the simple but powerful code style check. +- Thanks to [PHPStan](https://github.com/phpstan/phpstan) && [Psalm](https://github.com/vimeo/psalm) for really great Static analysis tools and for discover bugs in the code! + +### License and Copyright + +Released under the MIT License - see `LICENSE.txt` for details. diff --git a/plugins/vendor/voku/portable-ascii/composer.json b/plugins/vendor/voku/portable-ascii/composer.json new file mode 100644 index 00000000..b3a22fa8 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/composer.json @@ -0,0 +1,37 @@ +{ + "name": "voku/portable-ascii", + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "type": "library", + "keywords": [ + "clean", + "php", + "ascii" + ], + "homepage": "https://github.com/voku/portable-ascii", + "license": "MIT", + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "https://www.moelleken.org/" + } + ], + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "autoload-dev": { + "psr-4": { + "voku\\tests\\": "tests/" + } + } +} diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/ASCII.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/ASCII.php new file mode 100644 index 00000000..406407e1 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/ASCII.php @@ -0,0 +1,1424 @@ +>|null + */ + private static $ASCII_MAPS; + + /** + * @var array>|null + */ + private static $ASCII_MAPS_AND_EXTRAS; + + /** + * @var array>|null + */ + private static $ASCII_EXTRAS; + + /** + * @var array|null + */ + private static $ORD; + + /** + * @var array|null + */ + private static $LANGUAGE_MAX_KEY; + + /** + * url: https://en.wikipedia.org/wiki/Wikipedia:ASCII#ASCII_printable_characters + * + * @var string + */ + private static $REGEX_ASCII = "[^\x09\x10\x13\x0A\x0D\x20-\x7E]"; + + /** + * bidirectional text chars + * + * url: https://www.w3.org/International/questions/qa-bidi-unicode-controls + * + * @var array + */ + private static $BIDI_UNI_CODE_CONTROLS_TABLE = [ + // LEFT-TO-RIGHT EMBEDDING (use -> dir = "ltr") + 8234 => "\xE2\x80\xAA", + // RIGHT-TO-LEFT EMBEDDING (use -> dir = "rtl") + 8235 => "\xE2\x80\xAB", + // POP DIRECTIONAL FORMATTING // (use -> ) + 8236 => "\xE2\x80\xAC", + // LEFT-TO-RIGHT OVERRIDE // (use -> ) + 8237 => "\xE2\x80\xAD", + // RIGHT-TO-LEFT OVERRIDE // (use -> ) + 8238 => "\xE2\x80\xAE", + // LEFT-TO-RIGHT ISOLATE // (use -> dir = "ltr") + 8294 => "\xE2\x81\xA6", + // RIGHT-TO-LEFT ISOLATE // (use -> dir = "rtl") + 8295 => "\xE2\x81\xA7", + // FIRST STRONG ISOLATE // (use -> dir = "auto") + 8296 => "\xE2\x81\xA8", + // POP DIRECTIONAL ISOLATE + 8297 => "\xE2\x81\xA9", + ]; + + /** + * Get all languages from the constants "ASCII::.*LANGUAGE_CODE". + * + * @return array + *

An associative array where the key is the language code in lowercase + * and the value is the corresponding language string.

+ */ + public static function getAllLanguages(): array + { + // init + static $LANGUAGES = []; + + if ($LANGUAGES !== []) { + return $LANGUAGES; + } + + foreach ((new \ReflectionClass(__CLASS__))->getConstants() as $constant => $lang) { + if (\strpos($constant, 'EXTRA') !== false) { + $LANGUAGES[\strtolower($constant)] = $lang; + } else { + $LANGUAGES[\strtolower(\str_replace('_LANGUAGE_CODE', '', $constant))] = $lang; + } + } + + return $LANGUAGES; + } + + /** + * Returns an replacement array for ASCII methods. + * + * EXAMPLE: + * $array = ASCII::charsArray(); + * var_dump($array['ru']['б']); // 'b' + * + * + * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

+ * + * @psalm-pure + * + * @return array> + *

An array where the key is the language code, and the value is + * an associative array mapping original characters to their replacements.

+ */ + public static function charsArray(bool $replace_extra_symbols = false): array + { + if ($replace_extra_symbols) { + self::prepareAsciiAndExtrasMaps(); + + return self::$ASCII_MAPS_AND_EXTRAS ?? []; + } + + self::prepareAsciiMaps(); + + return self::$ASCII_MAPS ?? []; + } + + /** + * Returns an replacement array for ASCII methods with a mix of multiple languages. + * + * EXAMPLE: + * $array = ASCII::charsArrayWithMultiLanguageValues(); + * var_dump($array['b']); // ['β', 'б', 'ဗ', 'ბ', 'ب'] + * + * + * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

+ * + * @psalm-pure + * + * @return array> + *

An array of replacements.

+ */ + public static function charsArrayWithMultiLanguageValues(bool $replace_extra_symbols = false): array + { + static $CHARS_ARRAY = []; + $cacheKey = '' . $replace_extra_symbols; + + if (isset($CHARS_ARRAY[$cacheKey])) { + return $CHARS_ARRAY[$cacheKey]; + } + + // init + $return = []; + $language_all_chars = self::charsArrayWithSingleLanguageValues( + $replace_extra_symbols, + false + ); + + /* @noinspection AlterInForeachInspection | ok here */ + foreach ($language_all_chars as $key => &$value) { + $return[$value][] = $key; + } + + $CHARS_ARRAY[$cacheKey] = $return; + + return $return; + } + + /** + * Returns an replacement array for ASCII methods with one language. + * + * For example, German will map 'ä' to 'ae', while other languages + * will simply return e.g. 'a'. + * + * EXAMPLE: + * $array = ASCII::charsArrayWithOneLanguage('ru'); + * $tmpKey = \array_search('yo', $array['replace']); + * echo $array['orig'][$tmpKey]; // 'ё' + * + * + * @param string $language [optional]

Language of the source string e.g.: en, de_at, or de-ch. + * (default is 'en') | ASCII::*_LANGUAGE_CODE

+ * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

+ * @param bool $asOrigReplaceArray [optional]

TRUE === return {orig: list, replace: list} + * array

+ * + * @psalm-pure + * + * @return ($asOrigReplaceArray is true ? array{orig: list, replace: list} : array) + * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language + */ + public static function charsArrayWithOneLanguage( + string $language = self::ENGLISH_LANGUAGE_CODE, + bool $replace_extra_symbols = false, + bool $asOrigReplaceArray = true + ): array { + $language = self::get_language($language); + + // init + static $CHARS_ARRAY = []; + $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; + + // check static cache + if (isset($CHARS_ARRAY[$cacheKey][$language])) { + return $CHARS_ARRAY[$cacheKey][$language]; + } + + if ($replace_extra_symbols) { + self::prepareAsciiAndExtrasMaps(); + + if (isset(self::$ASCII_MAPS_AND_EXTRAS[$language])) { + $tmpArray = self::$ASCII_MAPS_AND_EXTRAS[$language]; + + if ($asOrigReplaceArray) { + $CHARS_ARRAY[$cacheKey][$language] = [ + 'orig' => \array_keys($tmpArray), + 'replace' => \array_values($tmpArray), + ]; + } else { + $CHARS_ARRAY[$cacheKey][$language] = $tmpArray; + } + } else { + if ($asOrigReplaceArray) { + $CHARS_ARRAY[$cacheKey][$language] = [ + 'orig' => [], + 'replace' => [], + ]; + } else { + $CHARS_ARRAY[$cacheKey][$language] = []; + } + } + } else { + self::prepareAsciiMaps(); + + if (isset(self::$ASCII_MAPS[$language])) { + $tmpArray = self::$ASCII_MAPS[$language]; + + if ($asOrigReplaceArray) { + $CHARS_ARRAY[$cacheKey][$language] = [ + 'orig' => \array_keys($tmpArray), + 'replace' => \array_values($tmpArray), + ]; + } else { + $CHARS_ARRAY[$cacheKey][$language] = $tmpArray; + } + } else { + if ($asOrigReplaceArray) { + $CHARS_ARRAY[$cacheKey][$language] = [ + 'orig' => [], + 'replace' => [], + ]; + } else { + $CHARS_ARRAY[$cacheKey][$language] = []; + } + } + } + + return $CHARS_ARRAY[$cacheKey][$language] ?? ['orig' => [], 'replace' => []]; + } + + /** + * Returns an replacement array for ASCII methods with multiple languages. + * + * EXAMPLE: + * $array = ASCII::charsArrayWithSingleLanguageValues(); + * $tmpKey = \array_search('hnaik', $array['replace']); + * echo $array['orig'][$tmpKey]; // '၌' + * + * + * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound ".

+ * @param bool $asOrigReplaceArray [optional]

TRUE === return {orig: list, replace: list} + * array

+ * + * @psalm-pure + * + * @return ($asOrigReplaceArray is true ? array{orig: list, replace: list} : array) + */ + public static function charsArrayWithSingleLanguageValues( + bool $replace_extra_symbols = false, + bool $asOrigReplaceArray = true + ): array { + // init + static $CHARS_ARRAY = []; + $cacheKey = '' . $replace_extra_symbols . '-' . $asOrigReplaceArray; + + if (isset($CHARS_ARRAY[$cacheKey])) { + return $CHARS_ARRAY[$cacheKey]; + } + + if ($replace_extra_symbols) { + self::prepareAsciiAndExtrasMaps(); + + /* @noinspection AlterInForeachInspection | ok here */ + foreach (self::$ASCII_MAPS_AND_EXTRAS ?? [] as &$map) { + $CHARS_ARRAY[$cacheKey][] = $map; + } + } else { + self::prepareAsciiMaps(); + + /* @noinspection AlterInForeachInspection | ok here */ + foreach (self::$ASCII_MAPS ?? [] as &$map) { + $CHARS_ARRAY[$cacheKey][] = $map; + } + } + + $CHARS_ARRAY[$cacheKey] = \array_merge([], ...$CHARS_ARRAY[$cacheKey]); + + if ($asOrigReplaceArray) { + $CHARS_ARRAY[$cacheKey] = [ + 'orig' => \array_keys($CHARS_ARRAY[$cacheKey]), + 'replace' => \array_values($CHARS_ARRAY[$cacheKey]), + ]; + } + + return $CHARS_ARRAY[$cacheKey]; + } + + /** + * Accepts a string and removes all non-UTF-8 characters from it + extras if needed. + * + * @param string $str

The string to be sanitized.

+ * @param bool $normalize_whitespace [optional]

Set to true, if you need to normalize the + * whitespace.

+ * @param bool $normalize_msword [optional]

Set to true, if you need to normalize MS Word chars + * e.g.: "…" + * => "..."

+ * @param bool $keep_non_breaking_space [optional]

Set to true, to keep non-breaking-spaces, in + * combination with + * $normalize_whitespace

+ * @param bool $remove_invisible_characters [optional]

Set to false, if you not want to remove invisible + * characters e.g.: "\0"

+ * + * @psalm-pure + * + * @return string + *

A clean UTF-8 string.

+ */ + public static function clean( + string $str, + bool $normalize_whitespace = true, + bool $keep_non_breaking_space = false, + bool $normalize_msword = true, + bool $remove_invisible_characters = true + ): string { + // http://stackoverflow.com/questions/1401317/remove-non-utf8-characters-from-string + // caused connection reset problem on larger strings + + $regex = '/ + ( + (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx + | [\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx + | [\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2 + | [\xF0-\xF7][\x80-\xBF]{3} # quadruple-byte sequence 11110xxx 10xxxxxx * 3 + ){1,100} # ...one or more times + ) + | ( [\x80-\xBF] ) # invalid byte in range 10000000 - 10111111 + | ( [\xC0-\xFF] ) # invalid byte in range 11000000 - 11111111 + /x'; + $str = (string) \preg_replace($regex, '$1', $str); + + if ($normalize_whitespace) { + $str = self::normalize_whitespace($str, $keep_non_breaking_space); + } + + if ($normalize_msword) { + $str = self::normalize_msword($str); + } + + if ($remove_invisible_characters) { + $str = self::remove_invisible_characters($str); + } + + return $str; + } + + /** + * Checks if a string is 7 bit ASCII. + * + * EXAMPLE: + * ASCII::is_ascii('白'); // false + * + * + * @param string $str

The string to check.

+ * + * @psalm-pure + * + * @return bool + *

+ * true if it is ASCII
+ * false otherwise + *

+ */ + public static function is_ascii(string $str): bool + { + if ($str === '') { + return true; + } + + return !\preg_match('/' . self::$REGEX_ASCII . '/', $str); + } + + /** + * Returns a string with smart quotes, ellipsis characters, and dashes from + * Windows-1252 (commonly used in Word documents) replaced by their ASCII + * equivalents. + * + * EXAMPLE: + * ASCII::normalize_msword('„Abcdef…”'); // '"Abcdef..."' + * + * + * @param string $str

The string to be normalized.

+ * + * @psalm-pure + * + * @return string + *

A string with normalized characters for commonly used chars in Word documents.

+ */ + public static function normalize_msword(string $str): string + { + if ($str === '') { + return ''; + } + + static $MSWORD_CACHE = ['orig' => [], 'replace' => []]; + + if (empty($MSWORD_CACHE['orig'])) { + self::prepareAsciiMaps(); + + $map = self::$ASCII_MAPS[self::EXTRA_MSWORD_CHARS_LANGUAGE_CODE] ?? []; + + $MSWORD_CACHE = [ + 'orig' => \array_keys($map), + 'replace' => \array_values($map), + ]; + } + + return \str_replace($MSWORD_CACHE['orig'], $MSWORD_CACHE['replace'], $str); + } + + /** + * Normalize the whitespace. + * + * EXAMPLE: + * ASCII::normalize_whitespace("abc-\xc2\xa0-öäü-\xe2\x80\xaf-\xE2\x80\xAC", true); // "abc-\xc2\xa0-öäü- -" + * + * + * @param string $str

The string to be normalized.

+ * @param bool $keepNonBreakingSpace [optional]

Set to true, to keep non-breaking-spaces.

+ * @param bool $keepBidiUnicodeControls [optional]

Set to true, to keep non-printable (for the web) + * bidirectional text chars.

+ * @param bool $normalize_control_characters [optional]

Set to true, to convert e.g. LINE-, PARAGRAPH-SEPARATOR with "\n" and LINE TABULATION with "\t".

+ * + * @psalm-pure + * + * @return string + *

A string with normalized whitespace.

+ */ + public static function normalize_whitespace( + string $str, + bool $keepNonBreakingSpace = false, + bool $keepBidiUnicodeControls = false, + bool $normalize_control_characters = false + ): string { + if ($str === '') { + return ''; + } + + static $WHITESPACE_CACHE = []; + $cacheKey = (int) $keepNonBreakingSpace; + + if ($normalize_control_characters) { + $str = \str_replace( + [ + "\x0d\x0c", // 'END OF LINE' + "\xe2\x80\xa8", // 'LINE SEPARATOR' + "\xe2\x80\xa9", // 'PARAGRAPH SEPARATOR' + "\x0c", // 'FORM FEED' // "\f" + "\x0b", // 'VERTICAL TAB' // "\v" + ], + [ + "\n", + "\n", + "\n", + "\n", + "\t", + ], + $str + ); + } + + if (!isset($WHITESPACE_CACHE[$cacheKey])) { + self::prepareAsciiMaps(); + + $WHITESPACE_CACHE[$cacheKey] = self::$ASCII_MAPS[self::EXTRA_WHITESPACE_CHARS_LANGUAGE_CODE] ?? []; + + if ($keepNonBreakingSpace) { + unset($WHITESPACE_CACHE[$cacheKey]["\xc2\xa0"]); + } + + $WHITESPACE_CACHE[$cacheKey] = array_keys($WHITESPACE_CACHE[$cacheKey]); + } + + if (!$keepBidiUnicodeControls) { + static $BIDI_UNICODE_CONTROLS_CACHE = null; + + if ($BIDI_UNICODE_CONTROLS_CACHE === null) { + $BIDI_UNICODE_CONTROLS_CACHE = self::$BIDI_UNI_CODE_CONTROLS_TABLE; + } + + $str = \str_replace($BIDI_UNICODE_CONTROLS_CACHE, '', $str); + } + + return \str_replace($WHITESPACE_CACHE[$cacheKey], ' ', $str); + } + + /** + * Remove invisible characters from a string. + * + * This prevents malicious code injection through null bytes or other control characters. + * + * copy&past from https://github.com/bcit-ci/CodeIgniter/blob/develop/system/core/Common.php + * + * @param string $str + * @param bool $url_encoded + * @param string $replacement + * @param bool $keep_basic_control_characters + * + * @psalm-pure + * + * @return string + */ + public static function remove_invisible_characters( + string $str, + bool $url_encoded = false, + string $replacement = '', + bool $keep_basic_control_characters = true + ): string { + // init + $non_displayables = []; + + // every control character except: + // - newline (dec 10), + // - carriage return (dec 13), + // - horizontal tab (dec 09) + if ($url_encoded) { + $non_displayables[] = '/%0[0-8bcefBCEF]/'; // url encoded 00-08, 11, 12, 14, 15 + $non_displayables[] = '/%1[0-9a-fA-F]/'; // url encoded 16-31 + } + + if ($keep_basic_control_characters) { + $non_displayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127 + } else { + $str = self::normalize_whitespace($str, false, false, true); + $non_displayables[] = '/[^\P{C}\s]/u'; + } + + do { + $str = (string) \preg_replace($non_displayables, $replacement, $str, -1, $count); + } while ($count !== 0); + + return $str; + } + + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert two UTF-8 encoded strings to a single-byte strings suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * @return array{0: string, 1: string} + */ + public static function to_ascii_remap(string $str1, string $str2): array + { + $charMap = []; + $str1 = self::to_ascii_remap_intern($str1, $charMap); + $str2 = self::to_ascii_remap_intern($str2, $charMap); + + return [$str1, $str2]; + } + + /** + * Returns an ASCII version of the string. A set of non-ASCII characters are + * replaced with their closest ASCII counterparts, and the rest are removed + * by default. The language or locale of the source string can be supplied + * for language-specific transliteration in any of the following formats: + * en, en_GB, or en-GB. For example, passing "de" results in "äöü" mapping + * to "aeoeue" rather than "aou" as in other languages. + * + * EXAMPLE: + * ASCII::to_ascii('�Düsseldorf�', 'en'); // Dusseldorf + * + * + * @param string $str

The input string.

+ * @param string $language [optional]

Language of the source string. + * (default is 'en') | ASCII::*_LANGUAGE_CODE

+ * @param bool $remove_unsupported_chars [optional]

Whether to remove the + * unsupported characters.

+ * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " pound + * ".

+ * @param bool $use_transliterate [optional]

Use ASCII::to_transliterate() for unknown chars.

+ * @param bool $replace_single_chars_only [optional]

Single char replacement is better for the + * performance, but some languages need to replace more than one char + * at the same time. If FALSE === auto-setting, depended on the + * language

+ * + * @psalm-pure + * + * @return string + *

A string that contains only ASCII characters.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language + */ + public static function to_ascii( + string $str, + string $language = self::ENGLISH_LANGUAGE_CODE, + bool $remove_unsupported_chars = true, + bool $replace_extra_symbols = false, + bool $use_transliterate = false, + bool $replace_single_chars_only = false + ): string { + if ($str === '') { + return ''; + } + + /** @phpstan-var ASCII::*_LANGUAGE_CODE $language - hack for phpstan */ + $language = self::get_language($language); + + static $EXTRA_SYMBOLS_CACHE = null; + + static $REPLACE_HELPER_CACHE = []; + $cacheKey = $language . '-' . $replace_extra_symbols; + + if (!isset($REPLACE_HELPER_CACHE[$cacheKey])) { + $langAll = self::charsArrayWithSingleLanguageValues($replace_extra_symbols, false); + + $langSpecific = self::charsArrayWithOneLanguage($language, $replace_extra_symbols, false); + + if ($langSpecific === []) { + $REPLACE_HELPER_CACHE[$cacheKey] = $langAll; + } else { + $REPLACE_HELPER_CACHE[$cacheKey] = \array_merge([], $langAll, $langSpecific); + } + } + + if ( + $replace_extra_symbols + && + $EXTRA_SYMBOLS_CACHE === null + ) { + $EXTRA_SYMBOLS_CACHE = []; + foreach (self::$ASCII_EXTRAS ?? [] as $extrasDataTmp) { + foreach ($extrasDataTmp as $extrasDataKeyTmp => $extrasDataValueTmp) { + $EXTRA_SYMBOLS_CACHE[$extrasDataKeyTmp] = $extrasDataKeyTmp; + } + } + $EXTRA_SYMBOLS_CACHE = \implode('', $EXTRA_SYMBOLS_CACHE); + } + + $charDone = []; + if (\preg_match_all('/' . self::$REGEX_ASCII . ($replace_extra_symbols ? '|[' . $EXTRA_SYMBOLS_CACHE . ']' : '') . '/u', $str, $matches)) { + if (!$replace_single_chars_only) { + if (self::$LANGUAGE_MAX_KEY === null) { + self::$LANGUAGE_MAX_KEY = self::getData('ascii_language_max_key'); + } + + $maxKeyLength = self::$LANGUAGE_MAX_KEY[$language] ?? 0; + + if ($maxKeyLength >= 5) { + foreach ($matches[0] as $keyTmp => $char) { + if (isset($matches[0][$keyTmp + 4])) { + $fiveChars = $matches[0][$keyTmp + 0] . $matches[0][$keyTmp + 1] . $matches[0][$keyTmp + 2] . $matches[0][$keyTmp + 3] . $matches[0][$keyTmp + 4]; + } else { + $fiveChars = null; + } + if ( + $fiveChars + && + !isset($charDone[$fiveChars]) + && + isset($REPLACE_HELPER_CACHE[$cacheKey][$fiveChars]) + && + \strpos($str, $fiveChars) !== false + ) { + // DEBUG + //\var_dump($str, $fiveChars, $REPLACE_HELPER_CACHE[$cacheKey][$fiveChars]); + + $charDone[$fiveChars] = true; + $str = \str_replace($fiveChars, $REPLACE_HELPER_CACHE[$cacheKey][$fiveChars], $str); + + // DEBUG + //\var_dump($str, "\n"); + } + } + } + + if ($maxKeyLength >= 4) { + foreach ($matches[0] as $keyTmp => $char) { + if (isset($matches[0][$keyTmp + 3])) { + $fourChars = $matches[0][$keyTmp + 0] . $matches[0][$keyTmp + 1] . $matches[0][$keyTmp + 2] . $matches[0][$keyTmp + 3]; + } else { + $fourChars = null; + } + if ( + $fourChars + && + !isset($charDone[$fourChars]) + && + isset($REPLACE_HELPER_CACHE[$cacheKey][$fourChars]) + && + \strpos($str, $fourChars) !== false + ) { + // DEBUG + //\var_dump($str, $fourChars, $REPLACE_HELPER_CACHE[$cacheKey][$fourChars]); + + $charDone[$fourChars] = true; + $str = \str_replace($fourChars, $REPLACE_HELPER_CACHE[$cacheKey][$fourChars], $str); + + // DEBUG + //\var_dump($str, "\n"); + } + } + } + + foreach ($matches[0] as $keyTmp => $char) { + if (isset($matches[0][$keyTmp + 2])) { + $threeChars = $matches[0][$keyTmp + 0] . $matches[0][$keyTmp + 1] . $matches[0][$keyTmp + 2]; + } else { + $threeChars = null; + } + if ( + $threeChars + && + !isset($charDone[$threeChars]) + && + isset($REPLACE_HELPER_CACHE[$cacheKey][$threeChars]) + && + \strpos($str, $threeChars) !== false + ) { + // DEBUG + //\var_dump($str, $threeChars, $REPLACE_HELPER_CACHE[$cacheKey][$threeChars]); + + $charDone[$threeChars] = true; + $str = \str_replace($threeChars, $REPLACE_HELPER_CACHE[$cacheKey][$threeChars], $str); + + // DEBUG + //\var_dump($str, "\n"); + } + } + + foreach ($matches[0] as $keyTmp => $char) { + if (isset($matches[0][$keyTmp + 1])) { + $twoChars = $matches[0][$keyTmp + 0] . $matches[0][$keyTmp + 1]; + } else { + $twoChars = null; + } + if ( + $twoChars + && + !isset($charDone[$twoChars]) + && + isset($REPLACE_HELPER_CACHE[$cacheKey][$twoChars]) + && + \strpos($str, $twoChars) !== false + ) { + // DEBUG + //\var_dump($str, $twoChars, $REPLACE_HELPER_CACHE[$cacheKey][$twoChars]); + + $charDone[$twoChars] = true; + $str = \str_replace($twoChars, $REPLACE_HELPER_CACHE[$cacheKey][$twoChars], $str); + + // DEBUG + //\var_dump($str, "\n"); + } + } + } + + foreach ($matches[0] as $char) { + if ( + !isset($charDone[$char]) + && + isset($REPLACE_HELPER_CACHE[$cacheKey][$char]) + && + \strpos($str, $char) !== false + ) { + // DEBUG + //\var_dump($str, $char, $REPLACE_HELPER_CACHE[$cacheKey][$char]); + + $charDone[$char] = true; + $str = \str_replace($char, $REPLACE_HELPER_CACHE[$cacheKey][$char], $str); + + // DEBUG + //\var_dump($str, "\n"); + } + } + } + + if (!isset(self::$ASCII_MAPS[$language])) { + $use_transliterate = true; + } + + if ($use_transliterate) { + $str = self::to_transliterate($str, null, false); + } + + if ($remove_unsupported_chars) { + $str = (string) \str_replace(["\n\r", "\n", "\r", "\t"], ' ', $str); + $str = (string) \preg_replace('/' . self::$REGEX_ASCII . '/', '', $str); + } + + return $str; + } + + /** + * Convert given string to safe filename (and keep string case). + * + * EXAMPLE: + * ASCII::to_filename('שדגשדג.png', true)); // 'shdgshdg.png' + * + * + * @param string $str

The string input.

+ * @param bool $use_transliterate

ASCII::to_transliterate() is used by default - unsafe characters are + * simply replaced with hyphen otherwise.

+ * @param string $fallback_char

The fallback character. - "-" is the default

+ * + * @psalm-pure + * + * @return string + *

A string that contains only safe characters for a filename.

+ */ + public static function to_filename( + string $str, + bool $use_transliterate = true, + string $fallback_char = '-' + ): string { + if ($use_transliterate) { + $str = self::to_transliterate($str, $fallback_char); + } + + $fallback_char_escaped = \preg_quote($fallback_char, '/'); + + $str = (string) \preg_replace( + [ + '/[^' . $fallback_char_escaped . '.\\-a-zA-Z\d\\s]/', // 1) remove un-needed chars + '/\s+/u', // 2) convert spaces to $fallback_char + '/[' . $fallback_char_escaped . ']+/u', // 3) remove double $fallback_char's + ], + [ + '', + $fallback_char, + $fallback_char, + ], + $str + ); + + return \trim($str, $fallback_char); + } + + /** + * Converts a string into a URL-friendly slug. + * + * - This includes replacing non-ASCII characters with their closest ASCII equivalents, removing remaining + * non-ASCII and non-alphanumeric characters, and replacing whitespace with $separator. + * - The separator defaults to a single dash, and the string is also converted to lowercase. + * - The language of the source string can also be supplied for language-specific transliteration. + * + * @param string $str

The string input.

+ * @param string $separator [optional]

The string used to replace whitespace.

+ * @param string $language [optional]

Language of the source string. + * (default is 'en') | ASCII::*_LANGUAGE_CODE

+ * @param array $replacements [optional]

A map of replaceable strings.

+ * @param bool $replace_extra_symbols [optional]

Add some more replacements e.g. "£" with " + * pound ".

+ * @param bool $use_str_to_lower [optional]

Use "string to lower" for the input.

+ * @param bool $use_transliterate [optional]

Use ASCII::to_transliterate() for unknown + * chars.

+ * @psalm-pure + * + * @return string + *

The URL-friendly slug.

+ * + * @phpstan-param ASCII::*_LANGUAGE_CODE $language + */ + public static function to_slugify( + string $str, + string $separator = '-', + string $language = self::ENGLISH_LANGUAGE_CODE, + array $replacements = [], + bool $replace_extra_symbols = false, + bool $use_str_to_lower = true, + bool $use_transliterate = false + ): string { + if ($str === '') { + return ''; + } + + foreach ($replacements as $from => $to) { + $str = \str_replace($from, $to, $str); + } + + $str = self::to_ascii( + $str, + $language, + false, + $replace_extra_symbols, + $use_transliterate + ); + + $str = \str_replace('@', $separator, $str); + + $str = (string) \preg_replace( + '/[^a-zA-Z\\d\\s\\-_' . \preg_quote($separator, '/') . ']/', + '', + $str + ); + + if ($use_str_to_lower) { + $str = \strtolower($str); + } + + $str = (string) \preg_replace('/^[\'\\s]+|[\'\\s]+$/', '', $str); + $str = (string) \preg_replace('/\\B([A-Z])/', '-\1', $str); + $str = (string) \preg_replace('/[\\-_\\s]+/', $separator, $str); + + $l = \strlen($separator); + if ($l && \strpos($str, $separator) === 0) { + $str = (string) \substr($str, $l); + } + + if (\substr($str, -$l) === $separator) { + $str = (string) \substr($str, 0, \strlen($str) - $l); + } + + return $str; + } + + /** + * Returns an ASCII version of the string. A set of non-ASCII characters are + * replaced with their closest ASCII counterparts, and the rest are removed + * unless instructed otherwise. + * + * EXAMPLE: + * ASCII::to_transliterate('déjà σσς iıii'); // 'deja sss iiii' + * + * + * @param string $str

The input string.

+ * @param string|null $unknown [optional]

Character use if character unknown. (default is '?') + * But you can also use NULL to keep the unknown chars.

+ * @param bool $strict [optional]

Use "transliterator_transliterate()" from PHP-Intl + * + * @psalm-pure + * + * @return string + *

A String that contains only ASCII characters.

+ */ + public static function to_transliterate( + string $str, + $unknown = '?', + bool $strict = false + ): string { + static $UTF8_TO_TRANSLIT = null; + + static $TRANSLITERATOR = null; + + static $SUPPORT_INTL = null; + + if ($str === '') { + return ''; + } + + if ($SUPPORT_INTL === null) { + $SUPPORT_INTL = \extension_loaded('intl'); + } + + // check if we only have ASCII, first (better performance) + $str_tmp = $str; + if (self::is_ascii($str)) { + return $str; + } + + $str = self::clean($str); + + // check again if we only have ASCII, now ... + if ( + $str_tmp !== $str + && + self::is_ascii($str) + ) { + return $str; + } + + if ( + $strict + && + $SUPPORT_INTL === true + ) { + if (!isset($TRANSLITERATOR)) { + // INFO: see "*-Latin" rules via "transliterator_list_ids()" + $TRANSLITERATOR = \transliterator_create('NFKC; [:Nonspacing Mark:] Remove; NFKC; Any-Latin; Latin-ASCII;'); + } + + // INFO: https://unicode.org/cldr/utility/character.jsp + $str_tmp = \transliterator_transliterate($TRANSLITERATOR, $str); + + if ($str_tmp !== false) { + // check again if we only have ASCII, now ... + if ( + $str_tmp !== $str + && + self::is_ascii($str_tmp) + ) { + return $str_tmp; + } + + $str = $str_tmp; + } + } + + if (self::$ORD === null) { + self::$ORD = self::getData('ascii_ord'); + } + + \preg_match_all('/.|[^\x00]$/us', $str, $array_tmp); + $chars = $array_tmp[0]; + $ord = null; + $str_tmp = ''; + foreach ($chars as &$c) { + $ordC0 = self::$ORD[$c[0]]; + + if ($ordC0 >= 0 && $ordC0 <= 127) { + $str_tmp .= $c; + + continue; + } + + $ordC1 = self::$ORD[$c[1]]; + + // ASCII - next please + if ($ordC0 >= 192 && $ordC0 <= 223) { + $ord = ($ordC0 - 192) * 64 + ($ordC1 - 128); + } + + if ($ordC0 >= 224) { + $ordC2 = self::$ORD[$c[2]]; + + if ($ordC0 <= 239) { + $ord = ($ordC0 - 224) * 4096 + ($ordC1 - 128) * 64 + ($ordC2 - 128); + } + + if ($ordC0 >= 240) { + $ordC3 = self::$ORD[$c[3]]; + + if ($ordC0 <= 247) { + $ord = ($ordC0 - 240) * 262144 + ($ordC1 - 128) * 4096 + ($ordC2 - 128) * 64 + ($ordC3 - 128); + } + + // We only process valid UTF-8 chars (<= 4 byte), so we don't need this code here ... + /* + if ($ordC0 >= 248) { + $ordC4 = self::$ORD[$c[4]]; + + if ($ordC0 <= 251) { + $ord = ($ordC0 - 248) * 16777216 + ($ordC1 - 128) * 262144 + ($ordC2 - 128) * 4096 + ($ordC3 - 128) * 64 + ($ordC4 - 128); + } + + if ($ordC0 >= 252) { + $ordC5 = self::$ORD[$c[5]]; + + if ($ordC0 <= 253) { + $ord = ($ordC0 - 252) * 1073741824 + ($ordC1 - 128) * 16777216 + ($ordC2 - 128) * 262144 + ($ordC3 - 128) * 4096 + ($ordC4 - 128) * 64 + ($ordC5 - 128); + } + } + } + */ + } + } + + if ( + $ordC0 === 254 + || + $ordC0 === 255 + || + $ord === null + ) { + $str_tmp .= $unknown ?? $c; + + continue; + } + + $bank = $ord >> 8; + if (!isset($UTF8_TO_TRANSLIT[$bank])) { + $UTF8_TO_TRANSLIT[$bank] = self::getDataIfExists(\sprintf('x%03x', $bank)); + } + + $new_char = $ord & 255; + + if (isset($UTF8_TO_TRANSLIT[$bank][$new_char])) { + // keep for debugging + /* + echo "file: " . sprintf('x%02x', $bank) . "\n"; + echo "char: " . $c . "\n"; + echo "ord: " . $ord . "\n"; + echo "new_char: " . $new_char . "\n"; + echo "new_char: " . mb_chr($new_char) . "\n"; + echo "ascii: " . $UTF8_TO_TRANSLIT[$bank][$new_char] . "\n"; + echo "bank:" . $bank . "\n\n"; + */ + + $new_char = $UTF8_TO_TRANSLIT[$bank][$new_char]; + + /* @noinspection PhpStatementHasEmptyBodyInspection */ + if ($unknown === null && $new_char === '') { + // nothing + } elseif ( + $new_char === '[?]' + || + $new_char === '[?] ' + ) { + $c = $unknown ?? $c; + } else { + $c = $new_char; + } + } else { + // keep for debugging missing chars + /* + echo "file: " . sprintf('x%02x', $bank) . "\n"; + echo "char: " . $c . "\n"; + echo "ord: " . $ord . "\n"; + echo "new_char: " . $new_char . "\n"; + echo "new_char: " . mb_chr($new_char) . "\n"; + echo "bank:" . $bank . "\n\n"; + */ + + $c = $unknown ?? $c; + } + + $str_tmp .= $c; + } + + return $str_tmp; + } + + /** + * WARNING: This method will return broken characters and is only for special cases. + * + * Convert a UTF-8 encoded string to a single-byte string suitable for + * functions that need the same string length after the conversion. + * + * The function simply uses (and updates) a tailored dynamic encoding + * (in/out map parameter) where non-ascii characters are remapped to + * the range [128-255] in order of appearance. + * + * Thus, it supports up to 128 different multibyte code points max over + * the whole set of strings sharing this encoding. + * + * Source: https://github.com/KEINOS/mb_levenshtein + * + * @param string $str

UTF-8 string to be converted to extended ASCII.

+ * @param array $map

Internal-Map of code points to ASCII characters.

+ * + * @return string + *

Mapped broken string.

+ * + * @phpstan-param array $map + */ + private static function to_ascii_remap_intern(string $str, array &$map): string + { + // find all utf-8 characters + $matches = []; + if (!\preg_match_all('/[\xC0-\xF7][\x80-\xBF]+/', $str, $matches)) { + return $str; // plain ascii string + } + + // update the encoding map with the characters not already met + $mapCount = \count($map); + foreach ($matches[0] as $mbc) { + if (!isset($map[$mbc])) { + $map[$mbc] = \chr(128 + $mapCount); + ++$mapCount; + } + } + + // finally, remap non-ascii characters + return \strtr($str, $map); + } + + /** + * Get the language from a string. + * + * e.g.: de_at -> de_at + * de_DE -> de + * DE_DE -> de + * de-de -> de + * + * @return string + */ + private static function get_language(string $language) + { + if ($language === '') { + return ''; + } + + if ( + \strpos($language, '_') === false + && + \strpos($language, '-') === false + ) { + return \strtolower($language); + } + + $language = \str_replace('-', '_', \strtolower($language)); + + $regex = '/(?[a-z]+)_\g{first}/'; + + return (string) \preg_replace($regex, '$1', $language); + } + + /** + * Get data from "/data/*.php". + * + * @return array + */ + private static function getData(string $file) + { + return include __DIR__ . '/data/' . $file . '.php'; + } + + /** + * Get data from "/data/*.php". + * + * @return array + */ + private static function getDataIfExists(string $file): array + { + $file = __DIR__ . '/data/' . $file . '.php'; + if (\is_file($file)) { + return include $file; + } + + return []; + } + + /** + * @return void + */ + private static function prepareAsciiAndExtrasMaps() + { + if (self::$ASCII_MAPS_AND_EXTRAS === null) { + self::prepareAsciiMaps(); + self::prepareAsciiExtras(); + + self::$ASCII_MAPS_AND_EXTRAS = \array_merge_recursive( + self::$ASCII_MAPS ?? [], + self::$ASCII_EXTRAS ?? [] + ); + } + } + + /** + * @return void + */ + private static function prepareAsciiMaps() + { + if (self::$ASCII_MAPS === null) { + self::$ASCII_MAPS = self::getData('ascii_by_languages'); + } + } + + /** + * @return void + */ + private static function prepareAsciiExtras() + { + if (self::$ASCII_EXTRAS === null) { + self::$ASCII_EXTRAS = self::getData('ascii_extras_by_languages'); + } + } +} diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php new file mode 100644 index 00000000..68c3f9d2 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_by_languages.php @@ -0,0 +1,2950 @@ + [ + 'Á' => 'A', + 'á' => 'a', + 'Ä' => 'A', + 'ä' => 'a', + 'À' => 'A', + 'à' => 'a', + 'Â' => 'A', + 'â' => 'a', + 'É' => 'E', + 'é' => 'e', + 'Ë' => 'E', + 'ë' => 'e', + 'È' => 'E', + 'è' => 'e', + 'Ê' => 'E', + 'ê' => 'e', + 'Í' => 'I', + 'í' => 'i', + 'Ï' => 'I', + 'ï' => 'i', + 'Ì' => 'I', + 'ì' => 'i', + 'Î' => 'I', + 'î' => 'i', + 'Ó' => 'O', + 'ó' => 'o', + 'Ö' => 'O', + 'ö' => 'o', + 'Ò' => 'O', + 'ò' => 'o', + 'Ô' => 'O', + 'ô' => 'o', + 'Ú' => 'U', + 'ú' => 'u', + 'Ü' => 'U', + 'ü' => 'u', + 'Ù' => 'U', + 'ù' => 'u', + 'Û' => 'U', + 'û' => 'u', + 'Ý' => 'Y', + 'ý' => 'y', + 'Ÿ' => 'Y', + ], + // Italian + 'it' => [ + 'à' => 'a', + 'À' => 'A', + 'é' => 'e', + 'É' => 'E', + 'è' => 'e', + 'È' => 'E', + 'ì' => 'i', + 'Ì' => 'I', + 'Ò' => 'O', + 'ò' => 'o', + 'ù' => 'u', + 'Ù' => 'U', + ], + // Macedonian + 'mk' => [ + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Ѓ' => 'Gj', + 'Е' => 'E', + 'Ж' => 'Zh', + 'З' => 'Z', + 'Ѕ' => 'Dz', + 'И' => 'I', + 'Ј' => 'J', + 'К' => 'K', + 'Л' => 'L', + 'Љ' => 'Lj', + 'М' => 'M', + 'Н' => 'N', + 'Њ' => 'Nj', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'Ќ' => 'Kj', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'Ch', + 'Џ' => 'Dj', + 'Ш' => 'Sh', + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'ѓ' => 'gj', + 'е' => 'e', + 'ж' => 'zh', + 'з' => 'z', + 'ѕ' => 'dz', + 'и' => 'i', + 'ј' => 'j', + 'к' => 'k', + 'л' => 'l', + 'љ' => 'lj', + 'м' => 'm', + 'н' => 'n', + 'њ' => 'nj', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'ќ' => 'kj', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'ch', + 'џ' => 'dj', + 'ш' => 'sh', + ], + // Portuguese (Brazil) + 'pt' => [ + 'æ' => 'ae', + 'ǽ' => 'ae', + 'À' => 'A', + 'Á' => 'A', + 'Â' => 'A', + 'Ã' => 'A', + 'Å' => 'AA', + 'Ǻ' => 'A', + 'Ă' => 'A', + 'Ǎ' => 'A', + 'Æ' => 'AE', + 'Ǽ' => 'AE', + 'à' => 'a', + 'á' => 'a', + 'â' => 'a', + 'ã' => 'a', + 'å' => 'aa', + 'ǻ' => 'a', + 'ă' => 'a', + 'ǎ' => 'a', + 'ª' => 'a', + 'Ĉ' => 'C', + 'Ċ' => 'C', + 'Ç' => 'C', + 'ç' => 'c', + 'ĉ' => 'c', + 'ċ' => 'c', + 'Ð' => 'Dj', + 'Đ' => 'D', + 'ð' => 'dj', + 'đ' => 'd', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ĕ' => 'E', + 'Ė' => 'E', + 'è' => 'e', + 'é' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ĕ' => 'e', + 'ė' => 'e', + 'ƒ' => 'f', + 'Ĝ' => 'G', + 'Ġ' => 'G', + 'ĝ' => 'g', + 'ġ' => 'g', + 'Ĥ' => 'H', + 'Ħ' => 'H', + 'ĥ' => 'h', + 'ħ' => 'h', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ĩ' => 'I', + 'Ĭ' => 'I', + 'Ǐ' => 'I', + 'Į' => 'I', + 'IJ' => 'IJ', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ĩ' => 'i', + 'ĭ' => 'i', + 'ǐ' => 'i', + 'į' => 'i', + 'ij' => 'ij', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'Ĺ' => 'L', + 'Ľ' => 'L', + 'Ŀ' => 'L', + 'ĺ' => 'l', + 'ľ' => 'l', + 'ŀ' => 'l', + 'Ñ' => 'N', + 'ñ' => 'n', + 'ʼn' => 'n', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ō' => 'O', + 'Ŏ' => 'O', + 'Ǒ' => 'O', + 'Ő' => 'O', + 'Ơ' => 'O', + 'Ø' => 'OE', + 'Ǿ' => 'O', + 'Œ' => 'OE', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ō' => 'o', + 'ŏ' => 'o', + 'ǒ' => 'o', + 'ő' => 'o', + 'ơ' => 'o', + 'ø' => 'oe', + 'ǿ' => 'o', + 'º' => 'o', + 'œ' => 'oe', + 'Ŕ' => 'R', + 'Ŗ' => 'R', + 'ŕ' => 'r', + 'ŗ' => 'r', + 'Ŝ' => 'S', + 'Ș' => 'S', + 'ŝ' => 's', + 'ș' => 's', + 'ſ' => 's', + 'Ţ' => 'T', + 'Ț' => 'T', + 'Ŧ' => 'T', + 'Þ' => 'TH', + 'ţ' => 't', + 'ț' => 't', + 'ŧ' => 't', + 'þ' => 'th', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ü' => 'U', + 'Ũ' => 'U', + 'Ŭ' => 'U', + 'Ű' => 'U', + 'Ų' => 'U', + 'Ư' => 'U', + 'Ǔ' => 'U', + 'Ǖ' => 'U', + 'Ǘ' => 'U', + 'Ǚ' => 'U', + 'Ǜ' => 'U', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ü' => 'u', + 'ũ' => 'u', + 'ŭ' => 'u', + 'ű' => 'u', + 'ų' => 'u', + 'ư' => 'u', + 'ǔ' => 'u', + 'ǖ' => 'u', + 'ǘ' => 'u', + 'ǚ' => 'u', + 'ǜ' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ý' => 'Y', + 'Ÿ' => 'Y', + 'Ŷ' => 'Y', + 'ý' => 'y', + 'ÿ' => 'y', + 'ŷ' => 'y', + ], + // Greek(lish) (Elláda) + 'el__greeklish' => [ + 'ΑΥ' => 'AU', + 'ΑΎ' => 'AU', + 'Αυ' => 'Au', + 'Αύ' => 'Au', + 'ΕΊ' => 'EI', + 'ΕΙ' => 'EI', + 'Ει' => 'EI', + 'ΕΥ' => 'EU', + 'ΕΎ' => 'EU', + 'Εί' => 'Ei', + 'Ευ' => 'Eu', + 'Εύ' => 'Eu', + 'ΟΙ' => 'OI', + 'ΟΊ' => 'OI', + 'ΟΥ' => 'OU', + 'ΟΎ' => 'OU', + 'Οι' => 'Oi', + 'Οί' => 'Oi', + 'Ου' => 'Ou', + 'Ού' => 'Ou', + 'ΥΙ' => 'YI', + 'ΎΙ' => 'YI', + 'Υι' => 'Yi', + 'Ύι' => 'Yi', + 'ΥΊ' => 'Yi', + 'Υί' => 'Yi', + 'αυ' => 'au', + 'αύ' => 'au', + 'εί' => 'ei', + 'ει' => 'ei', + 'ευ' => 'eu', + 'εύ' => 'eu', + 'οι' => 'oi', + 'οί' => 'oi', + 'ου' => 'ou', + 'ού' => 'ou', + 'υι' => 'yi', + 'ύι' => 'yi', + 'υί' => 'yi', + 'Α' => 'A', + 'Ά' => 'A', + 'Β' => 'B', + 'Δ' => 'D', + 'Ε' => 'E', + 'Έ' => 'E', + 'Φ' => 'F', + 'Γ' => 'G', + 'Η' => 'H', + 'Ή' => 'H', + 'Ι' => 'I', + 'Ί' => 'I', + 'Ϊ' => 'I', + 'Κ' => 'K', + 'Ξ' => 'Ks', + 'Λ' => 'L', + 'Μ' => 'M', + 'Ν' => 'N', + 'Π' => 'N', + 'Ο' => 'O', + 'Ό' => 'O', + 'Ψ' => 'Ps', + 'Ρ' => 'R', + 'Σ' => 'S', + 'Τ' => 'T', + 'Θ' => 'Th', + 'Ω' => 'W', + 'Ώ' => 'W', + 'Χ' => 'X', + 'ϒ' => 'Y', + 'Υ' => 'Y', + 'Ύ' => 'Y', + 'Ϋ' => 'Y', + 'Ζ' => 'Z', + 'α' => 'a', + 'ά' => 'a', + 'β' => 'b', + 'δ' => 'd', + 'ε' => 'e', + 'έ' => 'e', + 'φ' => 'f', + 'γ' => 'g', + 'η' => 'h', + 'ή' => 'h', + 'ι' => 'i', + 'ί' => 'i', + 'ϊ' => 'i', + 'ΐ' => 'i', + 'κ' => 'k', + 'ξ' => 'ks', + 'λ' => 'l', + 'μ' => 'm', + 'ν' => 'n', + 'ο' => 'o', + 'ό' => 'o', + 'π' => 'p', + 'ψ' => 'ps', + 'ρ' => 'r', + 'σ' => 's', + 'ς' => 's', + 'τ' => 't', + 'ϑ' => 'th', + 'θ' => 'th', + 'ϐ' => 'v', + 'ω' => 'w', + 'ώ' => 'w', + 'χ' => 'x', + 'υ' => 'y', + 'ύ' => 'y', + 'ΰ' => 'y', + 'ϋ' => 'y', + 'ζ' => 'z', + ], + // Greek (Elláda) + 'el' => [ + 'ΑΥ' => 'AU', + 'Αυ' => 'Au', + 'ΟΥ' => 'U', + 'Ου' => 'u', + 'ΕΥ' => 'EF', + 'Ευ' => 'Ef', + 'ΕΙ' => 'I', + 'Ει' => 'I', + 'ΟΙ' => 'I', + 'Οι' => 'I', + 'ΥΙ' => 'I', + 'Υι' => 'I', + 'ΑΎ' => 'AU', + 'Αύ' => 'Au', + 'ΟΎ' => 'OU', + 'Ού' => 'Ou', + 'ΕΎ' => 'EU', + 'Εύ' => 'Eu', + 'ΕΊ' => 'I', + 'Εί' => 'I', + 'ΟΊ' => 'I', + 'Οί' => 'I', + 'ΎΙ' => 'I', + 'Ύι' => 'I', + 'ΥΊ' => 'I', + 'Υί' => 'I', + 'αυ' => 'au', + 'ου' => 'u', + 'ευ' => 'ef', + 'ει' => 'i', + 'οι' => 'i', + 'υι' => 'i', + 'αύ' => 'au', + 'ού' => 'ou', + 'εύ' => 'eu', + 'εί' => 'i', + 'οί' => 'i', + 'ύι' => 'i', + 'υί' => 'i', + 'α' => 'a', + 'β' => 'v', + 'γ' => 'gh', + 'δ' => 'd', + 'ε' => 'e', + 'ζ' => 'z', + 'η' => 'i', + 'θ' => 'th', + 'ι' => 'i', + 'κ' => 'k', + 'λ' => 'l', + 'μ' => 'm', + 'ν' => 'n', + 'ξ' => 'ks', + 'ο' => 'o', + 'π' => 'p', + 'ρ' => 'r', + 'σ' => 's', + 'τ' => 't', + 'υ' => 'i', + 'φ' => 'f', + 'χ' => 'kh', + 'ψ' => 'ps', + 'ω' => 'o', + 'ά' => 'a', + 'έ' => 'e', + 'ί' => 'i', + 'ό' => 'o', + 'ϒ' => 'Y', + 'ύ' => 'y', + 'ή' => 'i', + 'ώ' => 'w', + 'ς' => 's', + 'ϊ' => 'i', + 'ΰ' => 'y', + 'ϋ' => 'y', + 'ΐ' => 'i', + 'Α' => 'A', + 'Β' => 'B', + 'Γ' => 'G', + 'Δ' => 'D', + 'Ε' => 'E', + 'Ζ' => 'Z', + 'Η' => 'H', + 'Θ' => 'Th', + 'Ι' => 'I', + 'Κ' => 'K', + 'Λ' => 'L', + 'Μ' => 'M', + 'Ν' => 'N', + 'Ξ' => 'Ks', + 'Ο' => 'O', + 'Π' => 'P', + 'Ρ' => 'R', + 'Σ' => 'S', + 'Τ' => 'T', + 'Υ' => 'Y', + 'Φ' => 'F', + 'Χ' => 'X', + 'Ψ' => 'Ps', + 'Ω' => 'O', + 'Ά' => 'A', + 'Έ' => 'E', + 'Ί' => 'I', + 'Ό' => 'O', + 'Ύ' => 'Y', + 'Ή' => 'I', + 'Ώ' => 'W', + 'Ϊ' => 'I', + 'Ϋ' => 'Y', + 'ϐ' => 'v', + 'ϑ' => 'th', + ], + // Hindi + 'hi' => [ + 'अ' => 'a', + 'आ' => 'aa', + 'ए' => 'e', + 'ई' => 'ii', + 'ऍ' => 'ei', + 'ऎ' => 'ae', + 'ऐ' => 'ai', + 'इ' => 'i', + 'ओ' => 'o', + 'ऑ' => 'oi', + 'ऒ' => 'oii', + 'ऊ' => 'uu', + 'औ' => 'ou', + 'उ' => 'u', + 'ब' => 'B', + 'भ' => 'Bha', + 'च' => 'Ca', + 'छ' => 'Chha', + 'ड' => 'Da', + 'ढ' => 'Dha', + 'फ' => 'Fa', + 'फ़' => 'Fi', + 'ग' => 'Ga', + 'घ' => 'Gha', + 'ग़' => 'Ghi', + 'ह' => 'Ha', + 'ज' => 'Ja', + 'झ' => 'Jha', + 'क' => 'Ka', + 'ख' => 'Kha', + 'ख़' => 'Khi', + 'ल' => 'L', + 'ळ' => 'Li', + 'ऌ' => 'Li', + 'ऴ' => 'Lii', + 'ॡ' => 'Lii', + 'म' => 'Ma', + 'न' => 'Na', + 'ङ' => 'Na', + 'ञ' => 'Nia', + 'ण' => 'Nae', + 'ऩ' => 'Ni', + 'ॐ' => 'oms', + 'प' => 'Pa', + 'क़' => 'Qi', + 'र' => 'Ra', + 'ऋ' => 'Ri', + 'ॠ' => 'Ri', + 'ऱ' => 'Ri', + 'स' => 'Sa', + 'श' => 'Sha', + 'ष' => 'Shha', + 'ट' => 'Ta', + 'त' => 'Ta', + 'ठ' => 'Tha', + 'द' => 'Tha', + 'थ' => 'Tha', + 'ध' => 'Thha', + 'ड़' => 'ugDha', + 'ढ़' => 'ugDhha', + 'व' => 'Va', + 'य' => 'Ya', + 'य़' => 'Yi', + 'ज़' => 'Za', + ], + // Armenian + 'hy' => [ + 'Ա' => 'A', + 'Բ' => 'B', + 'Գ' => 'G', + 'Դ' => 'D', + 'Ե' => 'E', + 'Զ' => 'Z', + 'Է' => 'E', + 'Ը' => 'Y', + 'Թ' => 'Th', + 'Ժ' => 'Zh', + 'Ի' => 'I', + 'Լ' => 'L', + 'Խ' => 'Kh', + 'Ծ' => 'Ts', + 'Կ' => 'K', + 'Հ' => 'H', + 'Ձ' => 'Dz', + 'Ղ' => 'Gh', + 'Ճ' => 'Tch', + 'Մ' => 'M', + 'Յ' => 'Y', + 'Ն' => 'N', + 'Շ' => 'Sh', + 'Ո' => 'Vo', + 'Չ' => 'Ch', + 'Պ' => 'P', + 'Ջ' => 'J', + 'Ռ' => 'R', + 'Ս' => 'S', + 'Վ' => 'V', + 'Տ' => 'T', + 'Ր' => 'R', + 'Ց' => 'C', + 'Ւ' => 'u', + 'Փ' => 'Ph', + 'Ք' => 'Q', + 'և' => 'ev', + 'Օ' => 'O', + 'Ֆ' => 'F', + 'ա' => 'a', + 'բ' => 'b', + 'գ' => 'g', + 'դ' => 'd', + 'ե' => 'e', + 'զ' => 'z', + 'է' => 'e', + 'ը' => 'y', + 'թ' => 'th', + 'ժ' => 'zh', + 'ի' => 'i', + 'լ' => 'l', + 'խ' => 'kh', + 'ծ' => 'ts', + 'կ' => 'k', + 'հ' => 'h', + 'ձ' => 'dz', + 'ղ' => 'gh', + 'ճ' => 'tch', + 'մ' => 'm', + 'յ' => 'y', + 'ն' => 'n', + 'շ' => 'sh', + 'ո' => 'vo', + 'չ' => 'ch', + 'պ' => 'p', + 'ջ' => 'j', + 'ռ' => 'r', + 'ս' => 's', + 'վ' => 'v', + 'տ' => 't', + 'ր' => 'r', + 'ց' => 'c', + 'ւ' => 'u', + 'փ' => 'ph', + 'ք' => 'q', + 'օ' => 'o', + 'ֆ' => 'f', + ], + // Swedish + 'sv' => [ + 'Ä' => 'A', + 'ä' => 'a', + 'Å' => 'A', + 'å' => 'a', + 'Ö' => 'O', + 'ö' => 'o', + ], + // Turkmen + 'tk' => [ + 'Ç' => 'C', + 'Ä' => 'A', + 'Ž' => 'Z', + 'Ň' => 'N', + 'Ö' => 'O', + 'Ş' => 'S', + 'Ü' => 'U', + 'Ý' => 'Y', + 'ç' => 'c', + 'ä' => 'a', + 'ž' => 'z', + 'ň' => 'n', + 'ö' => 'o', + 'ş' => 's', + 'ü' => 'u', + 'ý' => 'y', + ], + // Turkish + 'tr' => [ + 'ň' => 'n', + 'Ň' => 'N', + 'ş' => 's', + 'Ş' => 'S', + 'ı' => 'i', + 'İ' => 'I', + 'ç' => 'c', + 'Ç' => 'C', + 'ä' => 'a', + 'Ä' => 'A', + 'ü' => 'u', + 'Ü' => 'U', + 'ö' => 'o', + 'Ö' => 'O', + 'ğ' => 'g', + 'Ğ' => 'G', + 'ý' => 'y', + 'Ý' => 'Y', + 'ž' => 'z', + 'Ž' => 'Z', + ], + // Bulgarian + 'bg' => [ + 'ьо' => 'yo', + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Е' => 'E', + 'Ж' => 'Zh', + 'З' => 'Z', + 'И' => 'I', + 'Й' => 'Y', + 'К' => 'K', + 'Л' => 'L', + 'М' => 'M', + 'Н' => 'N', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'Ch', + 'Ш' => 'Sh', + 'Щ' => 'Sht', + 'Ъ' => 'A', + 'Ь' => '', + 'Ю' => 'Yu', + 'Я' => 'Ya', + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'е' => 'e', + 'ж' => 'zh', + 'з' => 'z', + 'и' => 'i', + 'й' => 'y', + 'к' => 'k', + 'л' => 'l', + 'м' => 'm', + 'н' => 'n', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'ch', + 'ш' => 'sh', + 'щ' => 'sht', + 'ъ' => 'a', + 'ь' => '', + 'ю' => 'yu', + 'я' => 'ya', + ], + // Hungarian + 'hu' => [ + 'Á' => 'A', + 'Ē' => 'E', + 'É' => 'E', + 'Í' => 'I', + 'Ó' => 'O', + 'Ö' => 'O', + 'Ő' => 'O', + 'Ú' => 'U', + 'Ü' => 'U', + 'Ű' => 'U', + 'á' => 'a', + 'ē' => 'e', + 'é' => 'e', + 'í' => 'i', + 'ó' => 'o', + 'ö' => 'o', + 'ő' => 'o', + 'ú' => 'u', + 'ü' => 'u', + 'ű' => 'u', + ], + // Myanmar (Burmese) + 'my' => [ + 'န်ုပ်' => 'nub', + 'ောင်' => 'aung', + 'ိုက်' => 'aik', + 'ိုဒ်' => 'ok', + 'ိုင်' => 'aing', + 'ိုလ်' => 'ol', + 'ေါင်' => 'aung', + 'သြော' => 'aw', + 'ောက်' => 'auk', + 'ိတ်' => 'eik', + 'ုတ်' => 'ok', + 'ုန်' => 'on', + 'ေတ်' => 'it', + 'ုဒ်' => 'ait', + 'ာန်' => 'an', + 'ိန်' => 'ein', + 'ွတ်' => 'ut', + 'ေါ်' => 'aw', + 'ွန်' => 'un', + 'ိပ်' => 'eik', + 'ုပ်' => 'ok', + 'ွပ်' => 'ut', + 'ိမ်' => 'ein', + 'ုမ်' => 'on', + 'ော်' => 'aw', + 'ွမ်' => 'un', + 'က်' => 'et', + 'ေါ' => 'aw', + 'ော' => 'aw', + 'ျွ' => 'ywa', + 'ြွ' => 'yw', + 'ို' => 'o', + 'ုံ' => 'on', + 'တ်' => 'at', + 'င်' => 'in', + 'ည်' => 'i', + 'ဒ်' => 'd', + 'န်' => 'an', + 'ပ်' => 'at', + 'မ်' => 'an', + 'စျ' => 'za', + 'ယ်' => 'e', + 'ဉ်' => 'in', + 'စ်' => 'it', + 'ိံ' => 'ein', + 'ဲ' => 'e', + 'း' => '', + 'ာ' => 'a', + 'ါ' => 'a', + 'ေ' => 'e', + 'ံ' => 'an', + 'ိ' => 'i', + 'ီ' => 'i', + 'ု' => 'u', + 'ူ' => 'u', + '်' => 'at', + '္' => '', + '့' => '', + 'က' => 'k', + '၉' => '9', + 'တ' => 't', + 'ရ' => 'ya', + 'ယ' => 'y', + 'မ' => 'm', + 'ဘ' => 'ba', + 'ဗ' => 'b', + 'ဖ' => 'pa', + 'ပ' => 'p', + 'န' => 'n', + 'ဓ' => 'da', + 'ဒ' => 'd', + 'ထ' => 'ta', + 'ဏ' => 'na', + 'ဝ' => 'w', + 'ဎ' => 'da', + 'ဍ' => 'd', + 'ဌ' => 'ta', + 'ဋ' => 't', + 'ည' => 'ny', + 'ဇ' => 'z', + 'ဆ' => 'sa', + 'စ' => 's', + 'င' => 'ng', + 'ဃ' => 'ga', + 'ဂ' => 'g', + 'လ' => 'l', + 'သ' => 'th', + '၈' => '8', + 'ဩ' => 'aw', + 'ခ' => 'kh', + '၆' => '6', + '၅' => '5', + '၄' => '4', + '၃' => '3', + '၂' => '2', + '၁' => '1', + '၀' => '0', + '၌' => 'hnaik', + '၍' => 'ywae', + 'ဪ' => 'aw', + 'ဦ' => '-u', + 'ဟ' => 'h', + 'ဉ' => 'u', + 'ဤ' => '-i', + 'ဣ' => 'i', + '၏' => '-e', + 'ဧ' => 'e', + 'ှ' => 'h', + 'ွ' => 'w', + 'ျ' => 'ya', + 'ြ' => 'y', + 'အ' => 'a', + 'ဠ' => 'la', + '၇' => '7', + ], + // Croatian (Hrvatska) + 'hr' => [ + 'DŽ' => 'DZ', + 'Dž' => 'Dz', + 'dž' => 'dz', + 'DZ' => 'DZ', + 'Dz' => 'Dz', + 'dz' => 'dz', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'LJ' => 'LJ', + 'Lj' => 'Lj', + 'lj' => 'lj', + 'NJ' => 'NJ', + 'Nj' => 'Nj', + 'nj' => 'nj', + 'ž' => 'z', + 'Ž' => 'Z', + 'đ' => 'dj', + 'Đ' => 'Dj', + 'č' => 'c', + 'Č' => 'C', + 'ć' => 'c', + 'Ć' => 'C', + 'š' => 's', + 'Š' => 'S', + ], + // Finnish + 'fi' => [ + 'Ä' => 'A', + 'Ö' => 'O', + 'ä' => 'a', + 'ö' => 'o', + ], + // Georgian (Kartvelian) + 'ka' => [ + 'ა' => 'a', + 'ბ' => 'b', + 'გ' => 'g', + 'დ' => 'd', + 'ე' => 'e', + 'ვ' => 'v', + 'ზ' => 'z', + 'თ' => 't', + 'ი' => 'i', + 'კ' => 'k', + 'ლ' => 'l', + 'მ' => 'm', + 'ნ' => 'n', + 'ო' => 'o', + 'პ' => 'p', + 'ჟ' => 'zh', + 'რ' => 'r', + 'ს' => 's', + 'ტ' => 't', + 'უ' => 'u', + 'ფ' => 'f', + 'ქ' => 'q', + 'ღ' => 'gh', + 'ყ' => 'y', + 'შ' => 'sh', + 'ჩ' => 'ch', + 'ც' => 'ts', + 'ძ' => 'dz', + 'წ' => 'ts', + 'ჭ' => 'ch', + 'ხ' => 'kh', + 'ჯ' => 'j', + 'ჰ' => 'h', + ], + // Russian + 'ru' => [ + 'А' => 'A', + 'а' => 'a', + 'Б' => 'B', + 'б' => 'b', + 'В' => 'V', + 'в' => 'v', + 'Г' => 'G', + 'г' => 'g', + 'Д' => 'D', + 'д' => 'd', + 'Е' => 'E', + 'е' => 'e', + 'Ё' => 'Yo', + 'ё' => 'yo', + 'Ж' => 'Zh', + 'ж' => 'zh', + 'З' => 'Z', + 'з' => 'z', + 'И' => 'I', + 'и' => 'i', + 'Й' => 'Y', + 'й' => 'y', + 'К' => 'K', + 'к' => 'k', + 'Л' => 'L', + 'л' => 'l', + 'М' => 'M', + 'м' => 'm', + 'Н' => 'N', + 'н' => 'n', + 'О' => 'O', + 'о' => 'o', + 'П' => 'P', + 'п' => 'p', + 'Р' => 'R', + 'р' => 'r', + 'С' => 'S', + 'с' => 's', + 'Т' => 'T', + 'т' => 't', + 'У' => 'U', + 'у' => 'u', + 'Ф' => 'F', + 'ф' => 'f', + 'Х' => 'H', + 'х' => 'h', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'ш' => 'sh', + 'Ш' => 'Sh', + 'Щ' => 'Sch', + 'щ' => 'sch', + 'Ъ' => '', + 'ъ' => '', + 'Ы' => 'Y', + 'ы' => 'y', + 'Ь' => '', + 'ь' => '', + 'Э' => 'E', + 'э' => 'e', + 'Ю' => 'Yu', + 'ю' => 'yu', + 'Я' => 'Ya', + 'я' => 'ya', + ], + // Russian - GOST 7.79-2000(B) + // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 + 'ru__gost_2000_b' => [ + 'А' => 'A', + 'а' => 'a', + 'Б' => 'B', + 'б' => 'b', + 'В' => 'V', + 'в' => 'v', + 'Г' => 'G', + 'г' => 'g', + 'Д' => 'D', + 'д' => 'd', + 'Е' => 'E', + 'е' => 'e', + 'Ё' => 'Yo', + 'ё' => 'yo', + 'Ж' => 'Zh', + 'ж' => 'zh', + 'З' => 'Z', + 'з' => 'z', + 'И' => 'i', + 'и' => 'i', + 'Й' => 'i', + 'й' => 'i', + 'К' => 'K', + 'к' => 'k', + 'Л' => 'L', + 'л' => 'l', + 'М' => 'M', + 'м' => 'm', + 'Н' => 'N', + 'н' => 'n', + 'О' => 'O', + 'о' => 'o', + 'П' => 'P', + 'п' => 'p', + 'Р' => 'R', + 'р' => 'r', + 'С' => 'S', + 'с' => 's', + 'Т' => 'T', + 'т' => 't', + 'У' => 'U', + 'у' => 'u', + 'Ф' => 'F', + 'ф' => 'f', + 'Х' => 'X', + 'х' => 'x', + 'Ц' => 'Cz', + 'ц' => 'cz', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'ш' => 'sh', + 'Ш' => 'Sh', + 'Щ' => 'Shh', + 'щ' => 'shh', + 'Ъ' => '', + 'ъ' => '', + 'Ы' => 'Y\'', + 'ы' => 'y\'', + 'Ь' => '', + 'ь' => '', + 'Э' => 'E\'', + 'э' => 'e\'', + 'Ю' => 'Yu', + 'ю' => 'yu', + 'Я' => 'Ya', + 'я' => 'ya', + 'І' => 'I', + 'і' => 'i', + 'Ѳ' => 'Fh', + 'ѳ' => 'fh', + 'Ѣ' => 'Ye', + 'ѣ' => 'ye', + 'Ѵ' => 'Yh', + 'ѵ' => 'yh', + 'Є' => '', + 'є' => '', + 'Ѥ' => '', + 'ѥ' => '', + 'Ѕ' => 'Js', + 'ѕ' => 'js', + 'Ꙋ' => '', + 'ꙋ' => '', + 'Ѡ' => '', + 'ѡ' => '', + 'Ѿ' => '', + 'ѿ' => '', + 'Ѫ' => '', + 'ѫ' => '', + 'Ѧ' => '', + 'ѧ' => '', + 'Ѭ' => '', + 'ѭ' => '', + 'Ѩ' => '', + 'ѩ' => '', + 'Ѯ' => '', + 'ѯ' => '', + 'Ѱ' => '', + 'ѱ' => '', + ], + // Russian - Passport (2013), ICAO + // -> https://en.m.wikipedia.org/wiki/Romanization_of_Russian#content-collapsible-block-1 + 'ru__passport_2013' => [ + 'А' => 'A', + 'а' => 'a', + 'Б' => 'B', + 'б' => 'b', + 'В' => 'V', + 'в' => 'v', + 'Г' => 'G', + 'г' => 'g', + 'Д' => 'D', + 'д' => 'd', + 'Е' => 'E', + 'е' => 'e', + 'Ё' => 'E', + 'ё' => 'e', + 'Ж' => 'Zh', + 'ж' => 'zh', + 'З' => 'Z', + 'з' => 'z', + 'И' => 'i', + 'и' => 'i', + 'Й' => 'i', + 'й' => 'i', + 'К' => 'K', + 'к' => 'k', + 'Л' => 'L', + 'л' => 'l', + 'М' => 'M', + 'м' => 'm', + 'Н' => 'N', + 'н' => 'n', + 'О' => 'O', + 'о' => 'o', + 'П' => 'P', + 'п' => 'p', + 'Р' => 'R', + 'р' => 'r', + 'С' => 'S', + 'с' => 's', + 'Т' => 'T', + 'т' => 't', + 'У' => 'U', + 'у' => 'u', + 'Ф' => 'F', + 'ф' => 'f', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'ш' => 'sh', + 'Ш' => 'Sh', + 'Щ' => 'Shch', + 'щ' => 'shch', + 'Ъ' => 'Ie', + 'ъ' => 'ie', + 'Ы' => 'Y', + 'ы' => 'y', + 'Ь' => '', + 'ь' => '', + 'Э' => 'E', + 'э' => 'e', + 'Ю' => 'Iu', + 'ю' => 'iu', + 'Я' => 'Ia', + 'я' => 'ia', + 'І' => '', + 'і' => '', + 'Ѳ' => '', + 'ѳ' => '', + 'Ѣ' => '', + 'ѣ' => '', + 'Ѵ' => '', + 'ѵ' => '', + 'Є' => '', + 'є' => '', + 'Ѥ' => '', + 'ѥ' => '', + 'Ѕ' => '', + 'ѕ' => '', + 'Ꙋ' => '', + 'ꙋ' => '', + 'Ѡ' => '', + 'ѡ' => '', + 'Ѿ' => '', + 'ѿ' => '', + 'Ѫ' => '', + 'ѫ' => '', + 'Ѧ' => '', + 'ѧ' => '', + 'Ѭ' => '', + 'ѭ' => '', + 'Ѩ' => '', + 'ѩ' => '', + 'Ѯ' => '', + 'ѯ' => '', + 'Ѱ' => '', + 'ѱ' => '', + ], + // Ukrainian + // -> https://zakon.rada.gov.ua/laws/show/55-2010-%D0%BF?lang=en + 'uk' => [ + 'Г' => 'H', + 'г' => 'h', + 'Ґ' => 'G', + 'ґ' => 'g', + 'Є' => 'Ye', + 'є' => 'ye', + 'И' => 'Y', + 'и' => 'y', + 'І' => 'I', + 'і' => 'i', + 'Ї' => 'Yi', + 'ї' => 'yi', + 'Й' => 'Y', + 'й' => 'y', + 'Х' => 'Kh', + 'х' => 'kh', + 'Ц' => 'Ts', + 'ц' => 'ts', + 'Ч' => 'Ch', + 'ч' => 'ch', + 'Ш' => 'Sh', + 'ш' => 'sh', + 'Щ' => 'Shch', + 'щ' => 'shch', + ], + // Kazakh + 'kk' => [ + 'Ә' => 'A', + 'Ғ' => 'G', + 'Қ' => 'Q', + 'Ң' => 'N', + 'Ө' => 'O', + 'Ұ' => 'U', + 'Ү' => 'U', + 'Һ' => 'H', + 'ә' => 'a', + 'ғ' => 'g', + 'қ' => 'q', + 'ң' => 'n', + 'ө' => 'o', + 'ұ' => 'u', + 'ү' => 'u', + 'һ' => 'h', + ], + // Czech + 'cs' => [ + 'á' => 'a', + 'Á' => 'A', + 'č' => 'c', + 'Č' => 'C', + 'ď' => 'd', + 'Ď' => 'D', + 'é' => 'e', + 'É' => 'E', + 'ě' => 'e', + 'Ě' => 'E', + 'í' => 'i', + 'Í' => 'I', + 'ň' => 'n', + 'Ň' => 'N', + 'ó' => 'o', + 'Ó' => 'O', + 'ř' => 'r', + 'Ř' => 'R', + 'š' => 's', + 'Š' => 'S', + 'ť' => 't', + 'Ť' => 'T', + 'ú' => 'u', + 'Ú' => 'U', + 'ů' => 'u', + 'Ů' => 'U', + 'ý' => 'y', + 'Ý' => 'Y', + 'ž' => 'z', + 'Ž' => 'Z', + ], + // Danish + 'da' => [ + 'Æ' => 'Ae', + 'æ' => 'ae', + 'Ø' => 'Oe', + 'ø' => 'oe', + 'Å' => 'Aa', + 'å' => 'aa', + 'É' => 'E', + 'é' => 'e', + ], + // Polish + 'pl' => [ + 'ą' => 'a', + 'ć' => 'c', + 'ę' => 'e', + 'ł' => 'l', + 'ń' => 'n', + 'ó' => 'o', + 'ś' => 's', + 'ź' => 'z', + 'ż' => 'z', + 'Ą' => 'A', + 'Ć' => 'C', + 'Ę' => 'E', + 'Ł' => 'L', + 'Ń' => 'N', + 'Ó' => 'O', + 'Ś' => 'S', + 'Ź' => 'Z', + 'Ż' => 'Z', + ], + // Romanian + 'ro' => [ + 'ă' => 'a', + 'â' => 'a', + 'Ă' => 'A', + 'Â' => 'A', + 'î' => 'i', + 'Î' => 'I', + 'ș' => 's', + 'ş' => 's', + 'Ş' => 'S', + 'Ș' => 'S', + 'ț' => 't', + 'ţ' => 't', + 'Ţ' => 'T', + 'Ț' => 'T', + ], + // Esperanto + 'eo' => [ + 'ĉ' => 'cx', + 'ĝ' => 'gx', + 'ĥ' => 'hx', + 'ĵ' => 'jx', + 'ŝ' => 'sx', + 'ŭ' => 'ux', + 'Ĉ' => 'CX', + 'Ĝ' => 'GX', + 'Ĥ' => 'HX', + 'Ĵ' => 'JX', + 'Ŝ' => 'SX', + 'Ŭ' => 'UX', + ], + // Estonian + 'et' => [ + 'Š' => 'S', + 'Ž' => 'Z', + 'Õ' => 'O', + 'Ä' => 'A', + 'Ö' => 'O', + 'Ü' => 'U', + 'š' => 's', + 'ž' => 'z', + 'õ' => 'o', + 'ä' => 'a', + 'ö' => 'o', + 'ü' => 'u', + ], + // Latvian + 'lv' => [ + 'ā' => 'a', + 'č' => 'c', + 'ē' => 'e', + 'ģ' => 'g', + 'ī' => 'i', + 'ķ' => 'k', + 'ļ' => 'l', + 'ņ' => 'n', + 'š' => 's', + 'ū' => 'u', + 'ž' => 'z', + 'Ā' => 'A', + 'Č' => 'C', + 'Ē' => 'E', + 'Ģ' => 'G', + 'Ī' => 'i', + 'Ķ' => 'k', + 'Ļ' => 'L', + 'Ņ' => 'N', + 'Š' => 'S', + 'Ū' => 'u', + 'Ž' => 'Z', + ], + // Lithuanian + 'lt' => [ + 'ą' => 'a', + 'č' => 'c', + 'ę' => 'e', + 'ė' => 'e', + 'į' => 'i', + 'š' => 's', + 'ų' => 'u', + 'ū' => 'u', + 'ž' => 'z', + 'Ą' => 'A', + 'Č' => 'C', + 'Ę' => 'E', + 'Ė' => 'E', + 'Į' => 'I', + 'Š' => 'S', + 'Ų' => 'U', + 'Ū' => 'U', + 'Ž' => 'Z', + ], + // Norwegian + 'no' => [ + 'Æ' => 'AE', + 'æ' => 'ae', + 'Ø' => 'OE', + 'ø' => 'oe', + 'Å' => 'AA', + 'å' => 'aa', + ], + // Vietnamese + 'vi' => [ + 'Á' => 'A', + 'À' => 'A', + 'Ả' => 'A', + 'Ã' => 'A', + 'Ạ' => 'A', + 'Ă' => 'A', + 'Ắ' => 'A', + 'Ằ' => 'A', + 'Ẳ' => 'A', + 'Ẵ' => 'A', + 'Ặ' => 'A', + 'Â' => 'A', + 'Ấ' => 'A', + 'Ầ' => 'A', + 'Ẩ' => 'A', + 'Ẫ' => 'A', + 'Ậ' => 'A', + 'á' => 'a', + 'à' => 'a', + 'ả' => 'a', + 'ã' => 'a', + 'ạ' => 'a', + 'ă' => 'a', + 'ắ' => 'a', + 'ằ' => 'a', + 'ẳ' => 'a', + 'ẵ' => 'a', + 'ặ' => 'a', + 'â' => 'a', + 'ấ' => 'a', + 'ầ' => 'a', + 'ẩ' => 'a', + 'ẫ' => 'a', + 'ậ' => 'a', + 'É' => 'E', + 'È' => 'E', + 'Ẻ' => 'E', + 'Ẽ' => 'E', + 'Ẹ' => 'E', + 'Ê' => 'E', + 'Ế' => 'E', + 'Ề' => 'E', + 'Ể' => 'E', + 'Ễ' => 'E', + 'Ệ' => 'E', + 'é' => 'e', + 'è' => 'e', + 'ẻ' => 'e', + 'ẽ' => 'e', + 'ẹ' => 'e', + 'ê' => 'e', + 'ế' => 'e', + 'ề' => 'e', + 'ể' => 'e', + 'ễ' => 'e', + 'ệ' => 'e', + 'Í' => 'I', + 'Ì' => 'I', + 'Ỉ' => 'I', + 'Ĩ' => 'I', + 'Ị' => 'I', + 'í' => 'i', + 'ì' => 'i', + 'ỉ' => 'i', + 'ĩ' => 'i', + 'ị' => 'i', + 'Ó' => 'O', + 'Ò' => 'O', + 'Ỏ' => 'O', + 'Õ' => 'O', + 'Ọ' => 'O', + 'Ô' => 'O', + 'Ố' => 'O', + 'Ồ' => 'O', + 'Ổ' => 'O', + 'Ỗ' => 'O', + 'Ộ' => 'O', + 'Ơ' => 'O', + 'Ớ' => 'O', + 'Ờ' => 'O', + 'Ở' => 'O', + 'Ỡ' => 'O', + 'Ợ' => 'O', + 'ó' => 'o', + 'ò' => 'o', + 'ỏ' => 'o', + 'õ' => 'o', + 'ọ' => 'o', + 'ô' => 'o', + 'ố' => 'o', + 'ồ' => 'o', + 'ổ' => 'o', + 'ỗ' => 'o', + 'ộ' => 'o', + 'ơ' => 'o', + 'ớ' => 'o', + 'ờ' => 'o', + 'ở' => 'o', + 'ỡ' => 'o', + 'ợ' => 'o', + 'Ú' => 'U', + 'Ù' => 'U', + 'Ủ' => 'U', + 'Ũ' => 'U', + 'Ụ' => 'U', + 'Ư' => 'U', + 'Ứ' => 'U', + 'Ừ' => 'U', + 'Ử' => 'U', + 'Ữ' => 'U', + 'Ự' => 'U', + 'ú' => 'u', + 'ù' => 'u', + 'ủ' => 'u', + 'ũ' => 'u', + 'ụ' => 'u', + 'ư' => 'u', + 'ứ' => 'u', + 'ừ' => 'u', + 'ử' => 'u', + 'ữ' => 'u', + 'ự' => 'u', + 'Ý' => 'Y', + 'Ỳ' => 'Y', + 'Ỷ' => 'Y', + 'Ỹ' => 'Y', + 'Ỵ' => 'Y', + 'ý' => 'y', + 'ỳ' => 'y', + 'ỷ' => 'y', + 'ỹ' => 'y', + 'ỵ' => 'y', + 'Đ' => 'D', + 'đ' => 'd', + ], + // Persian (Farsi) + 'fa' => [ + 'ا' => 'a', + 'ب' => 'b', + 'پ' => 'p', + 'ت' => 't', + 'ث' => 's', + 'ج' => 'j', + 'چ' => 'ch', + 'ح' => 'h', + 'خ' => 'kh', + 'د' => 'd', + 'ذ' => 'z', + 'ر' => 'r', + 'ز' => 'z', + 'س' => 's', + 'ش' => 'sh', + 'ص' => 's', + 'ض' => 'z', + 'ط' => 't', + 'ظ' => 'z', + 'ع' => 'a', + 'غ' => 'gh', + 'ف' => 'f', + 'ق' => 'gh', + 'ک' => 'k', + 'گ' => 'g', + 'ل' => 'l', + 'ژ' => 'zh', + 'ك' => 'k', + 'م' => 'm', + 'ن' => 'n', + 'ه' => 'h', + 'و' => 'o', + 'ی' => 'y', + 'آ' => 'a', + '٠' => '0', + '١' => '1', + '٢' => '2', + '٣' => '3', + '٤' => '4', + '٥' => '5', + '٦' => '6', + '٧' => '7', + '٨' => '8', + '٩' => '9', + ], + // Arabic + 'ar' => [ + 'أ' => 'a', + 'ب' => 'b', + 'ت' => 't', + 'ث' => 'th', + 'ج' => 'g', + 'ح' => 'h', + 'خ' => 'kh', + 'د' => 'd', + 'ذ' => 'th', + 'ر' => 'r', + 'ز' => 'z', + 'س' => 's', + 'ش' => 'sh', + 'ص' => 's', + 'ض' => 'd', + 'ط' => 't', + 'ظ' => 'th', + 'ع' => 'aa', + 'غ' => 'gh', + 'ف' => 'f', + 'ق' => 'k', + 'ك' => 'k', + 'ل' => 'l', + 'م' => 'm', + 'ن' => 'n', + 'ه' => 'h', + 'و' => 'o', + 'ي' => 'y', + 'ا' => 'a', + 'إ' => 'a', + 'آ' => 'a', + 'ؤ' => 'o', + 'ئ' => 'y', + 'ء' => 'aa', + '٠' => '0', + '١' => '1', + '٢' => '2', + '٣' => '3', + '٤' => '4', + '٥' => '5', + '٦' => '6', + '٧' => '7', + '٨' => '8', + '٩' => '9', + ], + // Serbian + 'sr' => [ + 'đ' => 'dj', + 'ž' => 'z', + 'ć' => 'c', + 'č' => 'c', + 'š' => 's', + 'Đ' => 'Dj', + 'Ž' => 'Z', + 'Ć' => 'C', + 'Č' => 'C', + 'Š' => 'S', + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'ђ' => 'dj', + 'е' => 'e', + 'ж' => 'z', + 'з' => 'z', + 'и' => 'i', + 'ј' => 'j', + 'к' => 'k', + 'л' => 'l', + 'љ' => 'lj', + 'м' => 'm', + 'н' => 'n', + 'њ' => 'nj', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'ћ' => 'c', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'c', + 'џ' => 'dz', + 'ш' => 's', + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Ђ' => 'Dj', + 'Е' => 'E', + 'Ж' => 'Z', + 'З' => 'Z', + 'И' => 'I', + 'Ј' => 'j', + 'К' => 'K', + 'Л' => 'L', + 'Љ' => 'Lj', + 'М' => 'M', + 'Н' => 'N', + 'Њ' => 'Nj', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'Ћ' => 'C', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'C', + 'Џ' => 'Dz', + 'Ш' => 'S', + ], + // Serbian - Cyrillic + 'sr__cyr' => [ + 'а' => 'a', + 'б' => 'b', + 'в' => 'v', + 'г' => 'g', + 'д' => 'd', + 'ђ' => 'dj', + 'е' => 'e', + 'ж' => 'z', + 'з' => 'z', + 'и' => 'i', + 'ј' => 'j', + 'к' => 'k', + 'л' => 'l', + 'љ' => 'lj', + 'м' => 'm', + 'н' => 'n', + 'њ' => 'nj', + 'о' => 'o', + 'п' => 'p', + 'р' => 'r', + 'с' => 's', + 'т' => 't', + 'ћ' => 'c', + 'у' => 'u', + 'ф' => 'f', + 'х' => 'h', + 'ц' => 'c', + 'ч' => 'c', + 'џ' => 'dz', + 'ш' => 's', + 'А' => 'A', + 'Б' => 'B', + 'В' => 'V', + 'Г' => 'G', + 'Д' => 'D', + 'Ђ' => 'Dj', + 'Е' => 'E', + 'Ж' => 'Z', + 'З' => 'Z', + 'И' => 'I', + 'Ј' => 'j', + 'К' => 'K', + 'Л' => 'L', + 'Љ' => 'Lj', + 'М' => 'M', + 'Н' => 'N', + 'Њ' => 'Nj', + 'О' => 'O', + 'П' => 'P', + 'Р' => 'R', + 'С' => 'S', + 'Т' => 'T', + 'Ћ' => 'C', + 'У' => 'U', + 'Ф' => 'F', + 'Х' => 'H', + 'Ц' => 'C', + 'Ч' => 'C', + 'Џ' => 'Dz', + 'Ш' => 'S', + ], + // Serbian - Latin + 'sr__lat' => [ + 'đ' => 'dj', + 'ž' => 'z', + 'ć' => 'c', + 'č' => 'c', + 'š' => 's', + 'Đ' => 'Dj', + 'Ž' => 'Z', + 'Ć' => 'C', + 'Č' => 'C', + 'Š' => 'S', + ], + // Azerbaijani + 'az' => [ + 'ç' => 'c', + 'ə' => 'e', + 'ğ' => 'g', + 'ı' => 'i', + 'ö' => 'o', + 'ş' => 's', + 'ü' => 'u', + 'Ç' => 'C', + 'Ə' => 'E', + 'Ğ' => 'G', + 'İ' => 'I', + 'Ö' => 'O', + 'Ş' => 'S', + 'Ü' => 'U', + ], + // Slovak + 'sk' => [ + 'á' => 'a', + 'ä' => 'a', + 'č' => 'c', + 'ď' => 'd', + 'é' => 'e', + 'í' => 'i', + 'ľ' => 'l', + 'ĺ' => 'l', + 'ň' => 'n', + 'ó' => 'o', + 'ô' => 'o', + 'ŕ' => 'r', + 'š' => 's', + 'ť' => 't', + 'ú' => 'u', + 'ý' => 'y', + 'ž' => 'z', + 'Á' => 'A', + 'Ä' => 'A', + 'Č' => 'C', + 'Ď' => 'D', + 'É' => 'E', + 'Í' => 'I', + 'Ľ' => 'L', + 'Ĺ' => 'L', + 'Ň' => 'N', + 'Ó' => 'O', + 'Ô' => 'O', + 'Ŕ' => 'R', + 'Š' => 'S', + 'Ť' => 'T', + 'Ú' => 'U', + 'Ý' => 'Y', + 'Ž' => 'Z', + ], + // French + 'fr' => [ + 'Æ' => 'AE', + 'æ' => 'ae', + 'Œ' => 'OE', + 'œ' => 'oe', + 'â' => 'a', + 'Â' => 'A', + 'à' => 'a', + 'À' => 'A', + 'ä' => 'a', + 'Ä' => 'A', + 'ç' => 'c', + 'Ç' => 'C', + 'é' => 'e', + 'É' => 'E', + 'ê' => 'e', + 'Ê' => 'E', + 'ë' => 'e', + 'Ë' => 'E', + 'è' => 'e', + 'È' => 'E', + 'ï' => 'i', + 'î' => 'i', + 'Ï' => 'I', + 'Î' => 'I', + 'ÿ' => 'y', + 'Ÿ' => 'Y', + 'ô' => 'o', + 'Ô' => 'O', + 'ö' => 'o', + 'Ö' => 'O', + 'û' => 'u', + 'Û' => 'U', + 'ù' => 'u', + 'Ù' => 'U', + 'ü' => 'u', + 'Ü' => 'U', + ], + // Austrian (French) + 'fr_at' => [ + 'ß' => 'sz', + 'ẞ' => 'SZ', + 'Æ' => 'AE', + 'æ' => 'ae', + 'Œ' => 'OE', + 'œ' => 'oe', + 'â' => 'a', + 'Â' => 'A', + 'à' => 'a', + 'À' => 'A', + 'ä' => 'a', + 'Ä' => 'A', + 'ç' => 'c', + 'Ç' => 'C', + 'é' => 'e', + 'É' => 'E', + 'ê' => 'e', + 'Ê' => 'E', + 'ë' => 'e', + 'Ë' => 'E', + 'è' => 'e', + 'È' => 'E', + 'ï' => 'i', + 'î' => 'i', + 'Ï' => 'I', + 'Î' => 'I', + 'ÿ' => 'y', + 'Ÿ' => 'Y', + 'ô' => 'o', + 'Ô' => 'O', + 'ö' => 'o', + 'Ö' => 'O', + 'û' => 'u', + 'Û' => 'U', + 'ù' => 'u', + 'Ù' => 'U', + 'ü' => 'u', + 'Ü' => 'U', + ], + // Switzerland (French) + 'fr_ch' => [ + 'ß' => 'ss', + 'ẞ' => 'SS', + 'Æ' => 'AE', + 'æ' => 'ae', + 'Œ' => 'OE', + 'œ' => 'oe', + 'â' => 'a', + 'Â' => 'A', + 'à' => 'a', + 'À' => 'A', + 'ä' => 'a', + 'Ä' => 'A', + 'ç' => 'c', + 'Ç' => 'C', + 'é' => 'e', + 'É' => 'E', + 'ê' => 'e', + 'Ê' => 'E', + 'ë' => 'e', + 'Ë' => 'E', + 'è' => 'e', + 'È' => 'E', + 'ï' => 'i', + 'î' => 'i', + 'Ï' => 'I', + 'Î' => 'I', + 'ÿ' => 'y', + 'Ÿ' => 'Y', + 'ô' => 'o', + 'Ô' => 'O', + 'ö' => 'o', + 'Ö' => 'O', + 'û' => 'u', + 'Û' => 'U', + 'ù' => 'u', + 'Ù' => 'U', + 'ü' => 'u', + 'Ü' => 'U', + ], + // German + 'de' => [ + 'Ä' => 'Ae', + 'Ö' => 'Oe', + 'Ü' => 'Ue', + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + 'ß' => 'ss', + 'ẞ' => 'SS', + ], + // Austrian (German) + 'de_at' => [ + 'Ä' => 'Ae', + 'Ö' => 'Oe', + 'Ü' => 'Ue', + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + 'ß' => 'sz', + 'ẞ' => 'SZ', + ], + // Switzerland (German) + 'de_ch' => [ + 'Ä' => 'Ae', + 'Ö' => 'Oe', + 'Ü' => 'Ue', + 'ä' => 'ae', + 'ö' => 'oe', + 'ü' => 'ue', + 'ß' => 'ss', + 'ẞ' => 'SS', + ], + // Bengali (Bangla) + 'bn' => [ + 'ভ্ল' => 'vl', + 'পশ' => 'psh', + 'ব্ধ' => 'bdh', + 'ব্জ' => 'bj', + 'ব্দ' => 'bd', + 'ব্ব' => 'bb', + 'ব্ল' => 'bl', + 'ভ' => 'v', + 'ব' => 'b', + 'চ্ঞ' => 'cNG', + 'চ্ছ' => 'cch', + 'চ্চ' => 'cc', + 'ছ' => 'ch', + 'চ' => 'c', + 'ধ্ন' => 'dhn', + 'ধ্ম' => 'dhm', + 'দ্ঘ' => 'dgh', + 'দ্ধ' => 'ddh', + 'দ্ভ' => 'dv', + 'দ্ম' => 'dm', + 'ড্ড' => 'DD', + 'ঢ' => 'Dh', + 'ধ' => 'dh', + 'দ্গ' => 'dg', + 'দ্দ' => 'dd', + 'ড' => 'D', + 'দ' => 'd', + '।' => '.', + 'ঘ্ন' => 'Ghn', + 'গ্ধ' => 'Gdh', + 'গ্ণ' => 'GN', + 'গ্ন' => 'Gn', + 'গ্ম' => 'Gm', + 'গ্ল' => 'Gl', + 'জ্ঞ' => 'jNG', + 'ঘ' => 'Gh', + 'গ' => 'g', + 'হ্ণ' => 'hN', + 'হ্ন' => 'hn', + 'হ্ম' => 'hm', + 'হ্ল' => 'hl', + 'হ' => 'h', + 'জ্ঝ' => 'jjh', + 'ঝ' => 'jh', + 'জ্জ' => 'jj', + 'জ' => 'j', + 'ক্ষ্ণ' => 'kxN', + 'ক্ষ্ম' => 'kxm', + 'ক্ষ' => 'ksh', + 'কশ' => 'ksh', + 'ক্ক' => 'kk', + 'ক্ট' => 'kT', + 'ক্ত' => 'kt', + 'ক্ল' => 'kl', + 'ক্স' => 'ks', + 'খ' => 'kh', + 'ক' => 'k', + 'ল্ভ' => 'lv', + 'ল্ধ' => 'ldh', + 'লখ' => 'lkh', + 'লঘ' => 'lgh', + 'লফ' => 'lph', + 'ল্ক' => 'lk', + 'ল্গ' => 'lg', + 'ল্ট' => 'lT', + 'ল্ড' => 'lD', + 'ল্প' => 'lp', + 'ল্ম' => 'lm', + 'ল্ল' => 'll', + 'ল্ব' => 'lb', + 'ল' => 'l', + 'ম্থ' => 'mth', + 'ম্ফ' => 'mf', + 'ম্ভ' => 'mv', + 'মপ্ল' => 'mpl', + 'ম্ন' => 'mn', + 'ম্প' => 'mp', + 'ম্ম' => 'mm', + 'ম্ল' => 'ml', + 'ম্ব' => 'mb', + 'ম' => 'm', + '০' => '0', + '১' => '1', + '২' => '2', + '৩' => '3', + '৪' => '4', + '৫' => '5', + '৬' => '6', + '৭' => '7', + '৮' => '8', + '৯' => '9', + 'ঙ্ক্ষ' => 'Ngkx', + 'ঞ্ছ' => 'nch', + 'ঙ্ঘ' => 'ngh', + 'ঙ্খ' => 'nkh', + 'ঞ্ঝ' => 'njh', + 'ঙ্গৌ' => 'ngOU', + 'ঙ্গৈ' => 'ngOI', + 'ঞ্চ' => 'nc', + 'ঙ্ক' => 'nk', + 'ঙ্ষ' => 'Ngx', + 'ঙ্গ' => 'ngo', + 'ঙ্ম' => 'Ngm', + 'ঞ্জ' => 'nj', + 'ন্ধ' => 'ndh', + 'ন্ঠ' => 'nTh', + 'ণ্ঠ' => 'NTh', + 'ন্থ' => 'nth', + 'ঙ্গা' => 'nga', + 'ঙ্গি' => 'ngi', + 'ঙ্গী' => 'ngI', + 'ঙ্গু' => 'ngu', + 'ঙ্গূ' => 'ngU', + 'ঙ্গে' => 'nge', + 'ঙ্গো' => 'ngO', + 'ণ্ঢ' => 'NDh', + 'নশ' => 'nsh', + 'ঙর' => 'Ngr', + 'ঞর' => 'NGr', + 'ংর' => 'ngr', + 'ঙ' => 'Ng', + 'ঞ' => 'NG', + 'ং' => 'ng', + 'ন্ন' => 'nn', + 'ণ্ণ' => 'NN', + 'ণ্ন' => 'Nn', + 'ন্ম' => 'nm', + 'ণ্ম' => 'Nm', + 'ন্দ' => 'nd', + 'ন্ট' => 'nT', + 'ণ্ট' => 'NT', + 'ন্ড' => 'nD', + 'ণ্ড' => 'ND', + 'ন্ত' => 'nt', + 'ন্স' => 'ns', + 'ন' => 'n', + 'ণ' => 'N', + 'ৈ' => 'OI', + 'ৌ' => 'OU', + 'ো' => 'O', + 'ঐ' => 'OI', + 'ঔ' => 'OU', + 'অ' => 'o', + 'ও' => 'oo', + 'ফ্ল' => 'fl', + 'প্ট' => 'pT', + 'প্ত' => 'pt', + 'প্ন' => 'pn', + 'প্প' => 'pp', + 'প্ল' => 'pl', + 'প্স' => 'ps', + 'ফ' => 'f', + 'প' => 'p', + 'ৃ' => 'rri', + 'ঋ' => 'rri', + 'রর‍্য' => 'rry', + '্র্য' => 'ry', + '্রর' => 'rr', + 'ড়্গ' => 'Rg', + 'ঢ়' => 'Rh', + 'ড়' => 'R', + 'র' => 'r', + '্র' => 'r', + 'শ্ছ' => 'Sch', + 'ষ্ঠ' => 'ShTh', + 'ষ্ফ' => 'Shf', + 'স্ক্ল' => 'skl', + 'স্খ' => 'skh', + 'স্থ' => 'sth', + 'স্ফ' => 'sf', + 'শ্চ' => 'Sc', + 'শ্ত' => 'St', + 'শ্ন' => 'Sn', + 'শ্ম' => 'Sm', + 'শ্ল' => 'Sl', + 'ষ্ক' => 'Shk', + 'ষ্ট' => 'ShT', + 'ষ্ণ' => 'ShN', + 'ষ্প' => 'Shp', + 'ষ্ম' => 'Shm', + 'স্প্ল' => 'spl', + 'স্ক' => 'sk', + 'স্ট' => 'sT', + 'স্ত' => 'st', + 'স্ন' => 'sn', + 'স্প' => 'sp', + 'স্ম' => 'sm', + 'স্ল' => 'sl', + 'শ' => 'S', + 'ষ' => 'Sh', + 'স' => 's', + 'ু' => 'u', + 'উ' => 'u', + 'অ্য' => 'oZ', + 'ত্থ' => 'tth', + 'ৎ' => 'tt', + 'ট্ট' => 'TT', + 'ট্ম' => 'Tm', + 'ঠ' => 'Th', + 'ত্ন' => 'tn', + 'ত্ম' => 'tm', + 'থ' => 'th', + 'ত্ত' => 'tt', + 'ট' => 'T', + 'ত' => 't', + 'অ্যা' => 'AZ', + 'া' => 'a', + 'আ' => 'a', + 'য়া' => 'ya', + 'য়' => 'y', + 'ি' => 'i', + 'ই' => 'i', + 'ী' => 'ee', + 'ঈ' => 'ee', + 'ূ' => 'uu', + 'ঊ' => 'uu', + 'ে' => 'e', + 'এ' => 'e', + 'য' => 'z', + '্য' => 'Z', + 'ইয়' => 'y', + 'ওয়' => 'w', + '্ব' => 'w', + 'এক্স' => 'x', + 'ঃ' => ':', + 'ঁ' => 'nn', + '্‌' => '', + ], + // English + 'en' => [ + ], + // Latin (+ Cyrillic ?) chars + // + // -> Mix of languages, but we need to keep this here, so that different languages can handle there own behavior. + 'latin' => [ + '˚' => '0', + '¹' => '1', + '²' => '2', + '³' => '3', + '⁴' => '4', + '⁵' => '5', + '⁶' => '6', + '⁷' => '7', + '⁸' => '8', + '⁹' => '9', + '₀' => '0', + '₁' => '1', + '₂' => '2', + '₃' => '3', + '₄' => '4', + '₅' => '5', + '₆' => '6', + '₇' => '7', + '₈' => '8', + '₉' => '9', + '௦' => '0', + '௧' => '1', + '௨' => '2', + '௩' => '3', + '௪' => '4', + '௫' => '5', + '௬' => '6', + '௭' => '7', + '௮' => '8', + '௯' => '9', + '௰' => '10', + '௱' => '100', + '௲' => '1000', + 'Ꜳ' => 'AA', + 'ꜳ' => 'aa', + 'Æ' => 'AE', + 'æ' => 'ae', + 'Ǽ' => 'AE', + 'ǽ' => 'ae', + 'Ꜵ' => 'AO', + 'ꜵ' => 'ao', + 'Ꜷ' => 'AU', + 'ꜷ' => 'au', + 'Ꜹ' => 'AV', + 'ꜹ' => 'av', + 'Ꜻ' => 'av', + 'ꜻ' => 'av', + 'Ꜽ' => 'AY', + 'ꜽ' => 'ay', + 'ȸ' => 'db', + 'ʣ' => 'dz', + 'ʥ' => 'dz', + 'ʤ' => 'dezh', + '🙰' => 'et', + 'ff' => 'ff', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'fi' => 'fi', + 'fl' => 'fl', + 'ʩ' => 'feng', + 'IJ' => 'IJ', + 'ij' => 'ij', + 'ʪ' => 'ls', + 'ʫ' => 'lz', + 'ɮ' => 'lezh', + 'ȹ' => 'qp', + 'ʨ' => 'tc', + 'ʦ' => 'ts', + 'ʧ' => 'tesh', + 'Œ' => 'OE', + 'œ' => 'oe', + 'Ꝏ' => 'OO', + 'ꝏ' => 'oo', + 'ẞ' => 'SS', + 'ß' => 'ss', + 'st' => 'st', + 'ſt' => 'st', + 'Ꜩ' => 'TZ', + 'ꜩ' => 'tz', + 'ᵫ' => 'ue', + 'Aι' => 'Ai', + 'αι' => 'ai', + 'Ει' => 'Ei', + 'ει' => 'ei', + 'Οι' => 'Oi', + 'οι' => 'oi', + 'Ου' => 'Oy', + 'ου' => 'oy', + 'Υι' => 'Yi', + 'υι' => 'yi', + 'ἀ' => 'a', + 'ἁ' => 'a', + 'ἂ' => 'a', + 'ἃ' => 'a', + 'ἄ' => 'a', + 'ἅ' => 'a', + 'ἆ' => 'a', + 'ἇ' => 'a', + 'Ἀ' => 'A', + 'Ἁ' => 'A', + 'Ἂ' => 'A', + 'Ἃ' => 'A', + 'Ἄ' => 'A', + 'Ἅ' => 'A', + 'Ἆ' => 'A', + 'Ἇ' => 'A', + 'ᾰ' => 'a', + 'ᾱ' => 'a', + 'ᾲ' => 'a', + 'ᾳ' => 'a', + 'ᾴ' => 'a', + 'ᾶ' => 'a', + 'ᾷ' => 'a', + 'Ᾰ' => 'A', + 'Ᾱ' => 'A', + 'Ὰ' => 'A', + 'Ά' => 'A', + 'ᾼ' => 'A', + 'Ä' => 'A', + 'ä' => 'a', + 'À' => 'A', + 'à' => 'a', + 'Á' => 'A', + 'á' => 'a', + 'Â' => 'A', + 'â' => 'a', + 'Ã' => 'A', + 'ã' => 'a', + 'A̧' => 'A', + 'a̧' => 'a', + 'Ą' => 'A', + 'ą' => 'a', + 'Ⱥ' => 'A', + 'ⱥ' => 'a', + 'Å' => 'A', + 'å' => 'a', + 'Ǻ' => 'A', + 'ǻ' => 'a', + 'Ă' => 'A', + 'ă' => 'a', + 'Ǎ' => 'A', + 'ǎ' => 'a', + 'Ȧ' => 'A', + 'ȧ' => 'a', + 'Ạ' => 'A', + 'ạ' => 'a', + 'Ā' => 'A', + 'ā' => 'a', + 'ª' => 'a', + 'Ɓ' => 'B', + 'Ѣ' => 'E', + 'ѣ' => 'e', + 'Ç' => 'C', + 'ç' => 'c', + 'Ĉ' => 'C', + 'ĉ' => 'c', + 'C̈' => 'C', + 'c̈' => 'c', + 'C̨' => 'C', + 'c̨' => 'c', + 'Ȼ' => 'C', + 'ȼ' => 'c', + 'Č' => 'C', + 'č' => 'c', + 'Ć' => 'C', + 'ć' => 'c', + 'C̀' => 'C', + 'c̀' => 'c', + 'Ċ' => 'C', + 'ċ' => 'c', + 'C̣' => 'C', + 'c̣' => 'c', + 'C̄' => 'C', + 'c̄' => 'c', + 'C̃' => 'C', + 'c̃' => 'c', + 'Ð' => 'D', + 'Đ' => 'D', + 'ð' => 'd', + 'đ' => 'd', + 'È' => 'E', + 'É' => 'E', + 'Ê' => 'E', + 'Ë' => 'E', + 'Ĕ' => 'E', + 'Ė' => 'E', + 'Ȩ' => 'E', + 'ȩ' => 'e', + 'Ę' => 'E', + 'ę' => 'e', + 'Ɇ' => 'E', + 'ɇ' => 'e', + 'Ě' => 'E', + 'ě' => 'e', + 'Ẹ' => 'E', + 'ẹ' => 'e', + 'Ē' => 'E', + 'ē' => 'e', + 'Ẽ' => 'E', + 'ẽ' => 'e', + 'è' => 'e', + 'é' => 'e', + 'ê' => 'e', + 'ë' => 'e', + 'ĕ' => 'e', + 'ė' => 'e', + 'ƒ' => 'f', + 'Ѳ' => 'F', + 'ѳ' => 'f', + 'Ĝ' => 'G', + 'Ġ' => 'G', + 'ĝ' => 'g', + 'ġ' => 'g', + 'Ĥ' => 'H', + 'Ħ' => 'H', + 'ĥ' => 'h', + 'ħ' => 'h', + 'Ì' => 'I', + 'Í' => 'I', + 'Î' => 'I', + 'Ï' => 'I', + 'Ĩ' => 'I', + 'Ĭ' => 'I', + 'Ǐ' => 'I', + 'Į' => 'I', + 'ì' => 'i', + 'í' => 'i', + 'î' => 'i', + 'ï' => 'i', + 'ĩ' => 'i', + 'ĭ' => 'i', + 'ǐ' => 'i', + 'į' => 'i', + 'І' => 'I', + 'і' => 'i', + 'I̧' => 'I', + 'i̧' => 'i', + 'Ɨ' => 'I', + 'ɨ' => 'i', + 'İ' => 'I', + 'i' => 'i', + 'Ị' => 'I', + 'ị' => 'i', + 'Ī' => 'I', + 'ī' => 'i', + 'Ĵ' => 'J', + 'ĵ' => 'j', + 'J́́' => 'J', + 'j́' => 'j', + 'J̀̀' => 'J', + 'j̀' => 'j', + 'J̈' => 'J', + 'j̈' => 'j', + 'J̧' => 'J', + 'j̧' => 'j', + 'J̨' => 'J', + 'j̨' => 'j', + 'Ɉ' => 'J', + 'ɉ' => 'j', + 'J̌' => 'J', + 'ǰ' => 'j', + 'J̇' => 'J', + 'j' => 'j', + 'J̣' => 'J', + 'j̣' => 'j', + 'J̄' => 'J', + 'j̄' => 'j', + 'J̃' => 'J', + 'j̃' => 'j', + 'Й' => 'i', + 'й' => 'i', + 'ĸ' => 'k', + 'Ĺ' => 'L', + 'Ľ' => 'L', + 'Ŀ' => 'L', + 'ĺ' => 'l', + 'ľ' => 'l', + 'ŀ' => 'l', + 'L̀' => 'L', + 'l̀' => 'l', + 'L̂' => 'L', + 'l̂' => 'l', + 'L̈' => 'L', + 'l̈' => 'l', + 'Ļ' => 'L', + 'ļ' => 'l', + 'L̨' => 'L', + 'l̨' => 'l', + 'Ł' => 'L', + 'ł' => 'l', + 'Ƚ' => 'L', + 'ƚ' => 'l', + 'L̇' => 'L', + 'l̇' => 'l', + 'Ḷ' => 'L', + 'ḷ' => 'l', + 'L̄' => 'L', + 'l̄' => 'l', + 'L̃' => 'L', + 'l̃' => 'l', + 'Ñ' => 'N', + 'ñ' => 'n', + 'Ŋ' => 'N', + 'ŋ' => 'n', + 'ʼn' => 'n', + 'Ń' => 'N', + 'ń' => 'n', + 'Ǹ' => 'N', + 'ǹ' => 'n', + 'N̂' => 'N', + 'n̂' => 'n', + 'N̈' => 'N', + 'n̈' => 'n', + 'Ņ' => 'N', + 'ņ' => 'n', + 'N̨' => 'N', + 'n̨' => 'n', + 'Ꞥ' => 'N', + 'ꞥ' => 'n', + 'Ň' => 'N', + 'ň' => 'n', + 'Ṅ' => 'N', + 'ṅ' => 'n', + 'Ṇ' => 'N', + 'ṇ' => 'n', + 'N̄' => 'N', + 'n̄' => 'n', + 'Ö' => 'O', + 'Ò' => 'O', + 'Ó' => 'O', + 'Ô' => 'O', + 'Õ' => 'O', + 'Ō' => 'O', + 'Ŏ' => 'O', + 'Ǒ' => 'O', + 'Ő' => 'O', + 'Ơ' => 'O', + 'Ø' => 'O', + 'Ǿ' => 'O', + 'ö' => 'o', + 'ò' => 'o', + 'ó' => 'o', + 'ô' => 'o', + 'õ' => 'o', + 'ō' => 'o', + 'ŏ' => 'o', + 'ǒ' => 'o', + 'ő' => 'o', + 'ơ' => 'o', + 'ø' => 'o', + 'ǿ' => 'o', + 'º' => 'o', + 'O̧' => 'O', + 'o̧' => 'o', + 'Ǫ' => 'O', + 'ǫ' => 'o', + 'Ɵ' => 'O', + 'ɵ' => 'o', + 'Ȯ' => 'O', + 'ȯ' => 'o', + 'Ọ' => 'O', + 'ọ' => 'o', + 'Ŕ' => 'R', + 'Ŗ' => 'R', + 'ŕ' => 'r', + 'ŗ' => 'r', + 'Ŝ' => 'S', + 'Ș' => 'S', + 'ș' => 's', + 'Ś' => 'S', + 'ś' => 's', + 'S̀' => 'S', + 's̀' => 's', + 'Ŝ̀' => 'S', + 'ŝ' => 's', + 'S̈' => 'S', + 's̈' => 's', + 'Ş' => 'S', + 'ş' => 's', + 'S̨' => 'S', + 's̨' => 's', + 'Ꞩ' => 'S', + 'ꞩ' => 's', + 'Š' => 'S', + 'š' => 's', + 'Ṡ' => 'S', + 'ṡ' => 's', + 'Ṣ' => 'S', + 'ṣ' => 's', + 'S̄' => 'S', + 's̄' => 's', + 'S̃' => 'S', + 's̃' => 's', + 'ſ' => 's', + 'Ţ' => 'T', + 'Ț' => 'T', + 'Ŧ' => 'T', + 'Þ' => 'TH', + 'ţ' => 't', + 'ț' => 't', + 'ŧ' => 't', + 'þ' => 'th', + 'T́' => 'T', + 't́' => 't', + 'T̀' => 'T', + 't̀' => 't', + 'T̂' => 'T', + 't̂' => 't', + 'T̈' => 'T', + 'ẗ' => 't', + 'T̨' => 'T', + 't̨' => 't', + 'Ⱦ' => 'T', + 'ⱦ' => 't', + 'Ť' => 'T', + 'ť' => 't', + 'Ṫ' => 'T', + 'ṫ' => 't', + 'Ṭ' => 'T', + 'ṭ' => 't', + 'T̄' => 'T', + 't̄' => 't', + 'T̃' => 'T', + 't̃' => 't', + 'Ü' => 'U', + 'Ù' => 'U', + 'Ú' => 'U', + 'Û' => 'U', + 'Ũ' => 'U', + 'Ŭ' => 'U', + 'Ű' => 'U', + 'Ų' => 'U', + 'Ư' => 'U', + 'Ǔ' => 'U', + 'Ǖ' => 'U', + 'Ǘ' => 'U', + 'Ǚ' => 'U', + 'Ǜ' => 'U', + 'ü' => 'u', + 'ù' => 'u', + 'ú' => 'u', + 'û' => 'u', + 'ũ' => 'u', + 'ŭ' => 'u', + 'ű' => 'u', + 'ų' => 'u', + 'ư' => 'u', + 'ǔ' => 'u', + 'ǖ' => 'u', + 'ǘ' => 'u', + 'ǚ' => 'u', + 'ǜ' => 'u', + 'U̧' => 'U', + 'u̧' => 'u', + 'Ʉ' => 'U', + 'ʉ' => 'u', + 'U̇' => 'U', + 'u̇' => 'u', + 'Ụ' => 'U', + 'ụ' => 'u', + 'Ū' => 'U', + 'ū' => 'u', + 'Ʊ' => 'U', + 'ʊ' => 'u', + 'Ŵ' => 'W', + 'ŵ' => 'w', + 'Ẁ' => 'W', + 'ẁ' => 'w', + 'Ẃ' => 'W', + 'ẃ' => 'w', + 'Ẅ' => 'W', + 'ẅ' => 'w', + 'Ѵ' => 'I', + 'ѵ' => 'i', + 'Ꙗ' => 'Ja', + 'ꙗ' => 'ja', + 'Є' => 'Je', + 'є' => 'je', + 'Ѥ' => 'Je', + 'ѥ' => 'je', + 'Ѕ' => 'Dz', + 'ѕ' => 'dz', + 'Ꙋ' => 'U', + 'ꙋ' => 'u', + 'Ѡ' => 'O', + 'ѡ' => 'o', + 'Ѿ' => 'Ot', + 'ѿ' => 'ot', + 'Ѫ' => 'U', + 'ѫ' => 'u', + 'Ѧ' => 'Ja', + 'ѧ' => 'ja', + 'Ѭ' => 'Ju', + 'ѭ' => 'ju', + 'Ѩ' => 'Ja', + 'ѩ' => 'Ja', + 'Ѯ' => 'Ks', + 'ѯ' => 'ks', + 'Ѱ' => 'Ps', + 'ѱ' => 'ps', + 'Х' => 'X', + 'х' => 'x', + 'Ý' => 'Y', + 'Ÿ' => 'Y', + 'Ŷ' => 'Y', + 'ý' => 'y', + 'ÿ' => 'y', + 'ŷ' => 'y', + 'Ỳ' => 'Y', + 'ỳ' => 'y', + 'Y̧' => 'Y', + 'y̧' => 'y', + 'Y̨' => 'Y', + 'y̨' => 'y', + 'Ɏ' => 'Y', + 'ɏ' => 'y', + 'Y̌' => 'Y', + 'y̌' => 'y', + 'Ẏ' => 'Y', + 'ẏ' => 'y', + 'Ỵ' => 'Y', + 'ỵ' => 'y', + 'Ȳ' => 'Y', + 'ȳ' => 'y', + 'Ỹ' => 'Y', + 'ỹ' => 'y', + 'Щ' => 'Shh', + 'щ' => 'shh', + 'Ź' => 'Z', + 'ź' => 'z', + 'Z̀' => 'Z', + 'z̀' => 'z', + 'Ẑ' => 'Z', + 'ẑ' => 'z', + 'Z̈' => 'Z', + 'z̈' => 'z', + 'Z̧' => 'Z', + 'z̧' => 'z', + 'Z̨' => 'Z', + 'z̨' => 'z', + 'Ƶ' => 'Z', + 'ƶ' => 'z', + 'Ž' => 'Z', + 'ž' => 'z', + 'Ż' => 'Z', + 'ż' => 'z', + 'Ẓ' => 'Z', + 'ẓ' => 'z', + 'Z̄' => 'Z', + 'z̄' => 'z', + 'Z̃' => 'Z', + 'z̃' => 'z', + ], + // whitespace chars + ' ' => [ + "\xc2\xa0" => ' ', // 'NO-BREAK SPACE' + "\xe1\x9a\x80" => ' ', // 'OGHAM SPACE MARK' + "\xe2\x80\x80" => ' ', // 'EN QUAD' + "\xe2\x80\x81" => ' ', // 'EM QUAD' + "\xe2\x80\x82" => ' ', // 'EN SPACE' + "\xe2\x80\x83" => ' ', // 'EM SPACE' + "\xe2\x80\x84" => ' ', // 'THREE-PER-EM SPACE' + "\xe2\x80\x85" => ' ', // 'FOUR-PER-EM SPACE' + "\xe2\x80\x86" => ' ', // 'SIX-PER-EM SPACE' + "\xe2\x80\x87" => ' ', // 'FIGURE SPACE' + "\xe2\x80\x88" => ' ', // 'PUNCTUATION SPACE' + "\xe2\x80\x89" => ' ', // 'THIN SPACE' + "\xe2\x80\x8a" => ' ', // 'HAIR SPACE' + "\xe2\x80\xa8" => ' ', // 'LINE SEPARATOR' + "\xe2\x80\xa9" => ' ', // 'PARAGRAPH SEPARATOR' + "\xe2\x80\x8b" => ' ', // 'ZERO WIDTH SPACE' + "\xe2\x80\xaf" => ' ', // 'NARROW NO-BREAK SPACE' + "\xe2\x81\x9f" => ' ', // 'MEDIUM MATHEMATICAL SPACE' + "\xe3\x80\x80" => ' ', // 'IDEOGRAPHIC SPACE' + "\xef\xbe\xa0" => ' ', // 'HALFWIDTH HANGUL FILLER' + ], + // commonly used in Word documents + 'msword' => [ + "\xc2\xab" => '<<', // « (U+00AB) in UTF-8 + "\xc2\xbb" => '>>', // » (U+00BB) in UTF-8 + "\xe2\x80\x98" => "'", // ‘ (U+2018) in UTF-8 + "\xe2\x80\x99" => "'", // ’ (U+2019) in UTF-8 + "\xe2\x80\x9a" => "'", // ‚ (U+201A) in UTF-8 + "\xe2\x80\x9b" => "'", // ‛ (U+201B) in UTF-8 + "\xe2\x80\x9c" => '"', // “ (U+201C) in UTF-8 + "\xe2\x80\x9d" => '"', // ” (U+201D) in UTF-8 + "\xe2\x80\x9e" => '"', // „ (U+201E) in UTF-8 + "\xe2\x80\x9f" => '"', // ‟ (U+201F) in UTF-8 + "\xe2\x80\xb9" => "'", // ‹ (U+2039) in UTF-8 + "\xe2\x80\xba" => "'", // › (U+203A) in UTF-8 + "\xe2\x80\x93" => '-', // – (U+2013) in UTF-8 + "\xe2\x80\x94" => '-', // — (U+2014) in UTF-8 + "\xe2\x80\xa6" => '...', // … (U+2026) in UTF-8 + ], + // Currency + // + // url => https://en.wikipedia.org/wiki/Currency_symbol + 'currency_short' => [ + '€' => 'EUR', + '$' => '$', + '₢' => 'Cr', + '₣' => 'Fr.', + '£' => 'PS', + '₤' => 'L.', + 'ℳ' => 'M', + '₥' => 'mil', + '₦' => 'N', + '₧' => 'Pts', + '₨' => 'Rs', + 'රු' => 'LKR', + 'ரூ' => 'LKR', + '௹' => 'Rs', + 'रू' => 'NPR', + '₹' => 'Rs', + '૱' => 'Rs', + '₩' => 'W', + '₪' => 'NS', + '₸' => 'KZT', + '₫' => 'D', + '֏' => 'AMD', + '₭' => 'K', + '₺' => 'TL', + '₼' => 'AZN', + '₮' => 'T', + '₯' => 'Dr', + '₲' => 'PYG', + '₾' => 'GEL', + '₳' => 'ARA', + '₴' => 'UAH', + '₽' => 'RUB', + '₵' => 'GHS', + '₡' => 'CL', + '¢' => 'c', + '¥' => 'YEN', + '円' => 'JPY', + '৳' => 'BDT', + '元' => 'CNY', + '﷼' => 'SAR', + '៛' => 'KR', + '₠' => 'ECU', + '¤' => '$?', + '฿' => 'THB', + '؋' => 'AFN', + ], +]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php new file mode 100644 index 00000000..afe31ae2 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_extras_by_languages.php @@ -0,0 +1,759 @@ + [ + '=' => ' gelijk ', + '%' => ' procent ', + '∑' => ' som ', + '∆' => ' delta ', + '∞' => ' oneindig ', + '♥' => ' love ', + '&' => ' en ', + '+' => ' plus ', + ], + // Italian + 'it' => [ + '=' => ' uguale ', + '%' => ' percent ', + '∑' => ' somma ', + '∆' => ' delta ', + '∞' => ' infinito ', + '♥' => ' amore ', + '&' => ' e ', + '+' => ' piu ', + ], + // Macedonian + 'mk' => [ + '=' => ' ednakva ', + '%' => ' procenti ', + '∑' => ' zbir ', + '∆' => ' delta ', + '∞' => ' beskonecnost ', + '♥' => ' loveubov ', + '&' => ' i ', + '+' => ' plus ', + ], + // Portuguese (Brazil) + 'pt' => [ + '=' => ' igual ', + '%' => ' por cento ', + '∑' => ' soma ', + '∆' => ' delta ', + '∞' => ' infinito ', + '♥' => ' amor ', + '&' => ' e ', + '+' => ' mais ', + ], + // Greek(lish) (Elláda) + 'el__greeklish' => [ + '=' => ' isos ', + '%' => ' tois ekato ', + '∑' => ' athroisma ', + '∆' => ' delta ', + '∞' => ' apeiro ', + '♥' => ' agape ', + '&' => ' kai ', + '+' => ' syn ', + ], + // Greek (Elláda) + 'el' => [ + '=' => ' isos ', + '%' => ' tois ekato ', + '∑' => ' athroisma ', + '∆' => ' delta ', + '∞' => ' apeiro ', + '♥' => ' agape ', + '&' => ' kai ', + '+' => ' syn ', + ], + // Hindi + 'hi' => [ + '=' => ' samana ', + '%' => ' paratisata ', + '∑' => ' yoga ', + '∆' => ' dalata ', + '∞' => ' anata ', + '♥' => ' payara ', + '&' => ' aura ', + '+' => ' palasa ', + ], + // Armenian + 'hy' => [ + '=' => ' havasar ', + '%' => ' tvokvos ', + '∑' => ' gvoumar ', + '∆' => ' delta ', + '∞' => ' ansahmanvouthyvoun ', + '♥' => ' ser ', + '&' => ' ev ', + '+' => ' gvoumarats ', + ], + // Swedish + 'sv' => [ + '=' => ' lika ', + '%' => ' procent ', + '∑' => ' summa ', + '∆' => ' delta ', + '∞' => ' oandlighet ', + '♥' => ' alskar ', + '&' => ' och ', + '+' => ' plus ', + ], + // Turkmen + 'tk' => [ + '=' => ' den ', + '%' => ' yuzde ', + '∑' => ' jem ', + '∆' => ' delta ', + '∞' => ' mudimilik ', + '♥' => ' soygi ', + '&' => ' we ', + '+' => ' yzy ', + ], + // Turkish + 'tr' => [ + '=' => ' esit ', + '%' => ' yuzde ', + '∑' => ' Toplam ', + '∆' => ' delta ', + '∞' => ' sonsuzluk ', + '♥' => ' ask ', + '&' => ' ve ', + '+' => ' arti ', + ], + // Bulgarian + 'bg' => [ + '=' => ' raven ', + '%' => ' na sto ', + '∑' => ' suma ', + '∆' => ' delta ', + '∞' => ' bezkrajnost ', + '♥' => ' obicam ', + '&' => ' i ', + '+' => ' plus ', + ], + // Hungarian + 'hu' => [ + '=' => ' Egyenlo ', + '%' => ' Szazalek ', + '∑' => ' osszeg ', + '∆' => ' delta ', + '∞' => ' vegtelenitett ', + '♥' => ' love ', + '&' => ' Es ', + '+' => ' Plusz ', + ], + // Myanmar (Burmese) + 'my' => [ + '=' => ' ttn:ttnnym? ', + '%' => ' raakhngnn:k ', + '∑' => ' ld ', + '∆' => ' m?cwk?n:pe? ', + '∞' => ' ach:m ', + '♥' => ' mettttaa ', + '&' => ' n ', + '+' => ' ape?ng: ', + ], + // Croatian (Hrvatska) + 'hr' => [ + '=' => ' Jednaki ', + '%' => ' Posto ', + '∑' => ' zbroj ', + '∆' => ' Delta ', + '∞' => ' beskonacno ', + '♥' => ' ljubav ', + '&' => ' I ', + '+' => ' Plus ', + ], + // Finnish + 'fi' => [ + '=' => ' Sama ', + '%' => ' Prosenttia ', + '∑' => ' sum ', + '∆' => ' delta ', + '∞' => ' aareton ', + '♥' => ' rakkautta ', + '&' => ' Ja ', + '+' => ' Plus ', + ], + // Georgian (Kartvelian) + 'ka' => [ + '=' => ' tanasts\'ori ', + '%' => ' p\'rotsent\'i ', + '∑' => ' tankha ', + '∆' => ' delt\'a ', + '∞' => ' usasrulo ', + '♥' => ' siq\'varuli ', + '&' => ' da ', + '+' => ' p\'lus ', + ], + // Russian + 'ru' => [ + '=' => ' ravnyj ', + '%' => ' procent ', + '∑' => ' summa ', + '∆' => ' del\'ta ', + '∞' => ' beskonecnost\' ', + '♥' => ' lublu ', + '&' => ' i ', + '+' => ' plus ', + ], + // Russian - GOST 7.79-2000(B) + 'ru__gost_2000_b' => [ + '=' => ' ravnyj ', + '%' => ' procent ', + '∑' => ' summa ', + '∆' => ' del\'ta ', + '∞' => ' beskonecnost\' ', + '♥' => ' lublu ', + '&' => ' i ', + '+' => ' plus ', + ], + // Russian - Passport (2013), ICAO + 'ru__passport_2013' => [ + '=' => ' ravnyj ', + '%' => ' procent ', + '∑' => ' summa ', + '∆' => ' del\'ta ', + '∞' => ' beskonecnost\' ', + '♥' => ' lublu ', + '&' => ' i ', + '+' => ' plus ', + ], + // Ukrainian + 'uk' => [ + '=' => ' rivnij ', + '%' => ' vidsotkiv ', + '∑' => ' suma ', + '∆' => ' del\'ta ', + '∞' => ' neskincennist\' ', + '♥' => ' lubov ', + '&' => ' i ', + '+' => ' plus ', + ], + // Kazakh + 'kk' => [ + '=' => ' ten\' ', + '%' => ' Pajyzdar ', + '∑' => ' zalpy ', + '∆' => ' ajyrmasylyk, ', + '∞' => ' seksiz ', + '♥' => ' mahabbat ', + '&' => ' z@ne ', + '+' => ' plus ', + ], + // Czech + 'cs' => [ + '=' => ' rovnat se ', + '%' => ' procento ', + '∑' => ' soucet ', + '∆' => ' delta ', + '∞' => ' nekonecno ', + '♥' => ' laska ', + '&' => ' a ', + '+' => ' plus ', + ], + // Danish + 'da' => [ + '=' => ' Lige ', + '%' => ' Prozent ', + '∑' => ' sum ', + '∆' => ' delta ', + '∞' => ' uendelig ', + '♥' => ' kaerlighed ', + '&' => ' Og ', + '+' => ' Plus ', + ], + // Polish + 'pl' => [ + '=' => ' rowny ', + '%' => ' procent ', + '∑' => ' suma ', + '∆' => ' delta ', + '∞' => ' nieskonczonosc ', + '♥' => ' milosc ', + '&' => ' i ', + '+' => ' plus ', + ], + // Romanian + 'ro' => [ + '=' => ' egal ', + '%' => ' la suta ', + '∑' => ' suma ', + '∆' => ' delta ', + '∞' => ' infinit ', + '♥' => ' dragoste ', + '&' => ' si ', + '+' => ' la care se adauga ', + ], + // Esperanto + 'eo' => [ + '=' => ' Egalaj ', + '%' => ' Procento ', + '∑' => ' sumo ', + '∆' => ' delto ', + '∞' => ' senfina ', + '♥' => ' amo ', + '&' => ' Kaj ', + '+' => ' Pli ', + ], + // Estonian + 'et' => [ + '=' => ' Vordsed ', + '%' => ' Protsenti ', + '∑' => ' summa ', + '∆' => ' o ', + '∞' => ' loputut ', + '♥' => ' armastus ', + '&' => ' Ja ', + '+' => ' Pluss ', + ], + // Latvian + 'lv' => [ + '=' => ' vienads ', + '%' => ' procents ', + '∑' => ' summa ', + '∆' => ' delta ', + '∞' => ' bezgaliba ', + '♥' => ' milestiba ', + '&' => ' un ', + '+' => ' pluss ', + ], + // Lithuanian + 'lt' => [ + '=' => ' lygus ', + '%' => ' procentu ', + '∑' => ' suma ', + '∆' => ' delta ', + '∞' => ' begalybe ', + '♥' => ' meile ', + '&' => ' ir ', + '+' => ' plius ', + ], + // Norwegian + 'no' => [ + '=' => ' Lik ', + '%' => ' Prosent ', + '∑' => ' sum ', + '∆' => ' delta ', + '∞' => ' uendelig ', + '♥' => ' kjaerlighet ', + '&' => ' Og ', + '+' => ' Pluss ', + ], + // Vietnamese + 'vi' => [ + '=' => ' cong bang ', + '%' => ' phan tram ', + '∑' => ' tong so ', + '∆' => ' dong bang ', + '∞' => ' vo cuc ', + '♥' => ' Yeu ', + '&' => ' va ', + '+' => ' them ', + ], + // Arabic + 'ar' => [ + '=' => ' mtsawy ', + '%' => ' nsbh mywyh ', + '∑' => ' mjmw\' ', + '∆' => ' dlta ', + '∞' => ' ma la nhayt ', + '♥' => ' hb ', + '&' => ' w ', + '+' => ' zayd ', + ], + // Persian (Farsi) + 'fa' => [ + '=' => ' brabr ', + '%' => ' dr sd ', + '∑' => ' mjmw\' ', + '∆' => ' dlta ', + '∞' => ' by nhayt ', + '♥' => ' \'shq ', + '&' => ' w ', + '+' => ' bh \'lawh ', + ], + // Serbian + 'sr' => [ + '=' => ' jednak ', + '%' => ' procenat ', + '∑' => ' zbir ', + '∆' => ' delta ', + '∞' => ' beskraj ', + '♥' => ' lubav ', + '&' => ' i ', + '+' => ' vise ', + ], + // Serbian - Cyrillic + 'sr__cyr' => [ + '=' => ' jednak ', + '%' => ' procenat ', + '∑' => ' zbir ', + '∆' => ' delta ', + '∞' => ' beskraj ', + '♥' => ' lubav ', + '&' => ' i ', + '+' => ' vise ', + ], + // Serbian - Latin + 'sr__lat' => [ + '=' => ' jednak ', + '%' => ' procenat ', + '∑' => ' zbir ', + '∆' => ' delta ', + '∞' => ' beskraj ', + '♥' => ' lubav ', + '&' => ' i ', + '+' => ' vise ', + ], + // Azerbaijani + 'az' => [ + '=' => ' b@rab@r ', + '%' => ' faiz ', + '∑' => ' m@bl@g ', + '∆' => ' delta ', + '∞' => ' sonsuzluq ', + '♥' => ' sevgi ', + '&' => ' v@ ', + '+' => ' plus ', + ], + // Slovak + 'sk' => [ + '=' => ' rovny ', + '%' => ' percento ', + '∑' => ' sucet ', + '∆' => ' delta ', + '∞' => ' infinity ', + '♥' => ' milovat ', + '&' => ' a ', + '+' => ' viac ', + ], + // French + 'fr' => [ + '=' => ' Egal ', + '%' => ' Pourcentage ', + '∑' => ' somme ', + '∆' => ' delta ', + '∞' => ' infini ', + '♥' => ' amour ', + '&' => ' Et ', + '+' => ' Plus ', + ], + // Austrian (French) + 'fr_at' => [ + '=' => ' Egal ', + '%' => ' Pourcentage ', + '∑' => ' somme ', + '∆' => ' delta ', + '∞' => ' infini ', + '♥' => ' amour ', + '&' => ' Et ', + '+' => ' Plus ', + ], + // Switzerland (French) + 'fr_ch' => [ + '=' => ' Egal ', + '%' => ' Pourcentage ', + '∑' => ' somme ', + '∆' => ' delta ', + '∞' => ' infini ', + '♥' => ' amour ', + '&' => ' Et ', + '+' => ' Plus ', + ], + // German + 'de' => [ + '=' => ' gleich ', + '%' => ' Prozent ', + '∑' => ' gesamt ', + '∆' => ' Unterschied ', + '∞' => ' undendlich ', + '♥' => ' liebe ', + '&' => ' und ', + '+' => ' plus ', + ], + // Austrian (German) + 'de_at' => [ + '=' => ' gleich ', + '%' => ' Prozent ', + '∑' => ' gesamt ', + '∆' => ' Unterschied ', + '∞' => ' undendlich ', + '♥' => ' liebe ', + '&' => ' und ', + '+' => ' plus ', + ], + // Switzerland (German) + 'de_ch' => [ + '=' => ' gleich ', + '%' => ' Prozent ', + '∑' => ' gesamt ', + '∆' => ' Unterschied ', + '∞' => ' undendlich ', + '♥' => ' liebe ', + '&' => ' und ', + '+' => ' plus ', + ], + // Bengali (Bangla) + 'bn' => [ + '=' => ' Saman ', + '%' => ' Satakora ', + '∑' => ' Samasti ', + '∆' => ' Badhip ', + '∞' => ' Ananta ', + '♥' => ' Valobasa ', + '&' => ' Abong ', + '+' => ' Songzojon ', + ], + // English + 'en' => [ + '=' => ' equal ', + '%' => ' percent ', + '∑' => ' sum ', + '∆' => ' delta ', + '∞' => ' infinity ', + '♥' => ' love ', + '&' => ' and ', + '+' => ' plus ', + ], + // Currency + // + // url: https://en.wikipedia.org/wiki/Currency_symbol + 'currency' => [ + '€' => ' Euro ', + '$' => ' Dollar ', + '₢' => ' cruzeiro ', + '₣' => ' French franc ', + '£' => ' pound ', + '₤' => ' lira ', // Italian + '₶' => ' livre tournois ', + 'ℳ' => ' mark ', + '₥' => ' mill ', + '₦' => ' naira ', + '₧' => ' peseta ', + '₨' => ' rupee ', + 'රු' => ' rupee ', // Sri Lankan + 'ரூ' => ' rupee ', // Sri Lankan + '௹' => ' rupee ', // Tamil + 'रू' => ' rupee ', // Nepalese + '₹' => ' rupee ', // Indian + '૱' => ' rupee ', // Gujarat + '₩' => ' won ', + '₪' => ' new shequel ', + '₸' => ' tenge ', + '₫' => ' dong ', + '֏' => ' dram ', + '₭' => ' kip ', + '₺' => ' lira ', // Turkish + '₼' => ' manat ', + '₮' => ' tugrik ', + '₯' => ' drachma ', + '₰' => ' pfennig ', + '₷' => ' spesmilo ', + '₱' => ' peso ', // Philippine + '﷼‎' => ' riyal ', + '₲' => ' guarani ', + '₾' => ' lari ', + '₳' => ' austral ', + '₴' => ' hryvnia ', + '₽' => ' ruble ', + '₵' => ' cedi ', + '₡' => ' colon ', + '¢' => ' cent ', + '¥' => ' yen ', + '円' => ' yen ', + '৳' => ' taka ', + '元' => ' yuan ', + '﷼' => ' riyal ', + '៛' => ' riel ', + '₠' => ' European Currency ', + '¤' => ' currency ', + '฿' => ' baht ', + '؋' => ' afghani ', + ], + // Temperature + // + // url: https://en.wikipedia.org/wiki/Conversion_of_units_of_temperature + 'temperature' => [ + '°De' => ' Delisle ', + '°Re' => ' Reaumur ', // Réaumur + '°Ro' => ' Romer ', // Rømer + '°R' => ' Rankine ', + '°C' => ' Celsius ', + '°F' => ' Fahrenheit ', + '°N' => ' Newton ', + ], + 'latin_symbols' => [ + '=' => '=', + '%' => '%', + '∑' => '∑', + '∆' => '∆', + '∞' => '∞', + '♥' => '♥', + '&' => '&', + '+' => '+', + // --- + '©' => ' (c) ', + '®' => ' (r) ', + '@' => ' (at) ', + '№' => ' No. ', + '℞' => ' Rx ', + '[' => '[', + '\' => '\\', + ']' => ']', + '^' => '^', + '_' => '_', + '`' => '`', + '‐' => '-', + '‑' => '-', + '‒' => '-', + '–' => '-', + '−' => '-', + '—' => '-', + '―' => '-', + '﹘' => '-', + '│' => '|', + '∖' => '\\', + '∕' => '/', + '⁄' => '/', + '←' => '<-', + '→' => '->', + '↑' => '|', + '↓' => '|', + '⁅' => '[', + '⁆' => ']', + '⁎' => '*', + '、' => ',', + '。' => '.', + '〈' => '<', + '〉' => '>', + '《' => '<<', + '》' => '>>', + '〔' => '[', + '〕' => ']', + '〘' => '[', + '〙' => ']', + '〚' => '[', + '〛' => ']', + '﹝' => '[', + '﹞' => ']', + '︹' => '[', + '︺' => ']', + '﹇' => '[', + '﹈' => ']', + '︐' => ',', + '︑' => ',', + '︒' => '.', + '︓' => ':', + '︔' => ';', + '︕' => '!', + '︖' => '?', + '︙' => '...', + '︰' => '..', + '︵' => '(', + '︶' => ')', + '﹙' => '(', + '﹚' => ')', + '︷' => '{', + '︸' => '}', + '﹛' => '{', + '﹜' => '}', + '︽' => '<<', + '︾' => '>>', + '︿' => '<', + '﹀' => '>', + '×' => '*', + '÷' => '/', + '≪' => '<<', + '≫' => '>>', + '⦅' => '((', + '⦆' => '))', + '〇' => '0', + '′' => '\'', + '〝' => '"', + '〞' => '"', + '«' => '<<', + '»' => '>>', + '‘' => "'", + '’' => "'", + '‚' => ',', + '‛' => "'", + '“' => '"', + '”' => '"', + '„' => '"', + '‟' => '"', + '‹' => '<', + '›' => '>', + '․' => '.', + '‥' => '..', + '…' => '...', + '″' => '"', + '‴' => '\'\'\'', + '‶' => '``', + '‷' => '```', + '‼' => '!!', + '⁇' => '??', + '⁈' => '?!', + '⁉' => '!?', + '⁗' => '````', + '⩴' => '::=', + '⩵' => '==', + '⩶' => '===', + '﹔' => ';', + '﹕' => ':', + '﹖' => '?', + '﹗' => '!', + '﹍' => '_', + '﹎' => '_', + '﹏' => '_', + '﹐' => ',', + '﹑' => ',', + '﹒' => '.', + '﹟' => '#', + '﹠' => '&', + '﹡' => '*', + '﹢' => '+', + '﹣' => '-', + '﹤' => '<', + '﹥' => '>', + '﹦' => '=', + '﹨' => '\\', + '﹩' => '$', + '﹪' => '%', + '﹫' => '@', + '!' => '!', + '"' => '"', + '#' => '#', + '$' => '$', + '%' => '%', + '&' => '&', + ''' => '\'', + '(' => '(', + ')' => ')', + '*' => '*', + '+' => '+', + ',' => ',', + '-' => '-', + '.' => '.', + '/' => '/', + ':' => ':', + ';' => ';', + '<' => '<', + '=' => '=', + '>' => '>', + '?' => '?', + '@' => '@', + '{' => '{', + '|' => '|', + '}' => '}', + '~' => '~', + '⦅' => '((', + '⦆' => '))', + '¬' => '!', + ' ̄' => '-', + '¦' => '|', + '■' => '#', + ], +]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php new file mode 100644 index 00000000..da81ae23 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_language_max_key.php @@ -0,0 +1,65 @@ + 0, + 'tk' => 1, + 'th' => 0, + 'ps' => 0, + 'or' => 0, + 'mn' => 0, + 'ko' => 0, + 'ky' => 0, + 'hy' => 1, + 'bn' => 5, + 'be' => 0, + 'am' => 0, + 'ja' => 0, + 'zh' => 0, + 'nl' => 1, + 'it' => 1, + 'mk' => 1, + 'pt' => 1, + 'el__greeklish' => 2, + 'el' => 2, + 'hi' => 2, + 'sv' => 1, + 'tr' => 1, + 'bg' => 2, + 'hu' => 1, + 'my' => 5, + 'hr' => 2, + 'fi' => 1, + 'ka' => 1, + 'ru' => 1, + 'ru__gost_2000_b' => 1, + 'ru__passport_2013' => 1, + 'uk' => 1, + 'kk' => 1, + 'cs' => 1, + 'da' => 1, + 'pl' => 1, + 'ro' => 1, + 'eo' => 1, + 'et' => 1, + 'lv' => 1, + 'lt' => 1, + 'no' => 1, + 'vi' => 1, + 'ar' => 1, + 'fa' => 1, + 'sr' => 1, + 'sr__cyr' => 1, + 'sr__lat' => 1, + 'az' => 1, + 'sk' => 1, + 'fr' => 1, + 'fr_at' => 1, + 'fr_ch' => 1, + 'de' => 1, + 'de_at' => 1, + 'de_ch' => 1, + 'en' => 0, + 'latin' => 3, + ' ' => 1, + 'msword' => 1, +]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_ord.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_ord.php new file mode 100644 index 00000000..142318c3 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/ascii_ord.php @@ -0,0 +1 @@ + 0, "\x00" => 0, "\x01" => 1, "\x02" => 2, "\x03" => 3, "\x04" => 4, "\x05" => 5, "\x06" => 6, "\x07" => 7, "\x08" => 8, "\x09" => 9, "\x0A" => 10, "\x0B" => 11, "\x0C" => 12, "\x0D" => 13, "\x0E" => 14, "\x0F" => 15, "\x10" => 16, "\x11" => 17, "\x12" => 18, "\x13" => 19, "\x14" => 20, "\x15" => 21, "\x16" => 22, "\x17" => 23, "\x18" => 24, "\x19" => 25, "\x1A" => 26, "\x1B" => 27, "\x1C" => 28, "\x1D" => 29, "\x1E" => 30, "\x1F" => 31, "\x20" => 32, "\x21" => 33, "\x22" => 34, "\x23" => 35, "\x24" => 36, "\x25" => 37, "\x26" => 38, "\x27" => 39, "\x28" => 40, "\x29" => 41, "\x2A" => 42, "\x2B" => 43, "\x2C" => 44, "\x2D" => 45, "\x2E" => 46, "\x2F" => 47, "\x30" => 48, "\x31" => 49, "\x32" => 50, "\x33" => 51, "\x34" => 52, "\x35" => 53, "\x36" => 54, "\x37" => 55, "\x38" => 56, "\x39" => 57, "\x3A" => 58, "\x3B" => 59, "\x3C" => 60, "\x3D" => 61, "\x3E" => 62, "\x3F" => 63, "\x40" => 64, "\x41" => 65, "\x42" => 66, "\x43" => 67, "\x44" => 68, "\x45" => 69, "\x46" => 70, "\x47" => 71, "\x48" => 72, "\x49" => 73, "\x4A" => 74, "\x4B" => 75, "\x4C" => 76, "\x4D" => 77, "\x4E" => 78, "\x4F" => 79, "\x50" => 80, "\x51" => 81, "\x52" => 82, "\x53" => 83, "\x54" => 84, "\x55" => 85, "\x56" => 86, "\x57" => 87, "\x58" => 88, "\x59" => 89, "\x5A" => 90, "\x5B" => 91, "\x5C" => 92, "\x5D" => 93, "\x5E" => 94, "\x5F" => 95, "\x60" => 96, "\x61" => 97, "\x62" => 98, "\x63" => 99, "\x64" => 100, "\x65" => 101, "\x66" => 102, "\x67" => 103, "\x68" => 104, "\x69" => 105, "\x6A" => 106, "\x6B" => 107, "\x6C" => 108, "\x6D" => 109, "\x6E" => 110, "\x6F" => 111, "\x70" => 112, "\x71" => 113, "\x72" => 114, "\x73" => 115, "\x74" => 116, "\x75" => 117, "\x76" => 118, "\x77" => 119, "\x78" => 120, "\x79" => 121, "\x7A" => 122, "\x7B" => 123, "\x7C" => 124, "\x7D" => 125, "\x7E" => 126, "\x7F" => 127, "\x80" => 128, "\x81" => 129, "\x82" => 130, "\x83" => 131, "\x84" => 132, "\x85" => 133, "\x86" => 134, "\x87" => 135, "\x88" => 136, "\x89" => 137, "\x8A" => 138, "\x8B" => 139, "\x8C" => 140, "\x8D" => 141, "\x8E" => 142, "\x8F" => 143, "\x90" => 144, "\x91" => 145, "\x92" => 146, "\x93" => 147, "\x94" => 148, "\x95" => 149, "\x96" => 150, "\x97" => 151, "\x98" => 152, "\x99" => 153, "\x9A" => 154, "\x9B" => 155, "\x9C" => 156, "\x9D" => 157, "\x9E" => 158, "\x9F" => 159, "\xA0" => 160, "\xA1" => 161, "\xA2" => 162, "\xA3" => 163, "\xA4" => 164, "\xA5" => 165, "\xA6" => 166, "\xA7" => 167, "\xA8" => 168, "\xA9" => 169, "\xAA" => 170, "\xAB" => 171, "\xAC" => 172, "\xAD" => 173, "\xAE" => 174, "\xAF" => 175, "\xB0" => 176, "\xB1" => 177, "\xB2" => 178, "\xB3" => 179, "\xB4" => 180, "\xB5" => 181, "\xB6" => 182, "\xB7" => 183, "\xB8" => 184, "\xB9" => 185, "\xBA" => 186, "\xBB" => 187, "\xBC" => 188, "\xBD" => 189, "\xBE" => 190, "\xBF" => 191, "\xC0" => 192, "\xC1" => 193, "\xC2" => 194, "\xC3" => 195, "\xC4" => 196, "\xC5" => 197, "\xC6" => 198, "\xC7" => 199, "\xC8" => 200, "\xC9" => 201, "\xCA" => 202, "\xCB" => 203, "\xCC" => 204, "\xCD" => 205, "\xCE" => 206, "\xCF" => 207, "\xD0" => 208, "\xD1" => 209, "\xD2" => 210, "\xD3" => 211, "\xD4" => 212, "\xD5" => 213, "\xD6" => 214, "\xD7" => 215, "\xD8" => 216, "\xD9" => 217, "\xDA" => 218, "\xDB" => 219, "\xDC" => 220, "\xDD" => 221, "\xDE" => 222, "\xDF" => 223, "\xE0" => 224, "\xE1" => 225, "\xE2" => 226, "\xE3" => 227, "\xE4" => 228, "\xE5" => 229, "\xE6" => 230, "\xE7" => 231, "\xE8" => 232, "\xE9" => 233, "\xEA" => 234, "\xEB" => 235, "\xEC" => 236, "\xED" => 237, "\xEE" => 238, "\xEF" => 239, "\xF0" => 240, "\xF1" => 241, "\xF2" => 242, "\xF3" => 243, "\xF4" => 244, "\xF5" => 245, "\xF6" => 246, "\xF7" => 247, "\xF8" => 248, "\xF9" => 249, "\xFA" => 250, "\xFB" => 251, "\xFC" => 252, "\xFD" => 253, "\xFE" => 254, "\xFF" => 255]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x000.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x000.php new file mode 100644 index 00000000..6c9d81f9 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x000.php @@ -0,0 +1,16 @@ +', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '', 'EUR', // "\xc2\x80" => "\xe2\x82\xac" => EURO SIGN + '', ',', 'f', ',,', // "\xc2\x84" => "\xe2\x80\x9e" => DOUBLE LOW-9 QUOTATION MARK + '...', // "\xc2\x85" => "\xe2\x80\xa6" => HORIZONTAL ELLIPSIS + '+', '++', // "\xc2\x87" => "\xe2\x80\xa1" => DOUBLE DAGGER + '^', '%0', // "\xc2\x89" => "\xe2\x80\xb0" => PER MILLE SIGN + 'S', '<', 'OE', // "\xc2\x8c" => "\xc5\x92" => LATIN CAPITAL LIGATURE OE + '', 'Z', '', '', '\'', // "\xc2\x91" => "\xe2\x80\x98" => LEFT SINGLE QUOTATION MARK + '\'', // "\xc2\x92" => "\xe2\x80\x99" => RIGHT SINGLE QUOTATION MARK + '"', '"', '*', '-', '--', // "\xc2\x97" => "\xe2\x80\x94" => EM DASH + '~', 'tm', 's', '>', 'oe', '', 'z', 'Y', ' ', '!', 'C/', 'PS', '$?', 'Y=', '|', 'SS', '"', '(c)', 'a', '<<', '!', '', '(r)', '-', 'deg', '+-', '2', '3', '\'', 'u', 'P', '*', ',', '1', 'o', '>>', '1/4', '1/2', '3/4', '?', 'A', 'A', 'A', 'A', // Not "AE" - used in languages other than German + 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', // Not "OE" - used in languages other than German + 'O', 'x', 'O', 'U', 'U', 'U', // Not "UE" - used in languages other than German + 'U', 'Y', 'Th', 'ss', 'a', 'a', 'a', 'a', // Not "ae" - used in languages other than German + 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'd', 'n', 'o', 'o', 'o', 'o', // Not "oe" - used in languages other than German + 'o', '/', 'o', 'u', 'u', 'u', // Not "ue" - used in languages other than German + 'u', 'y', 'th', 'y', ]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x001.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x001.php new file mode 100644 index 00000000..87fb12fb --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x001.php @@ -0,0 +1 @@ +', '^', 'V', '^', 'V', '\'', '-', '/', '\\', ',', '_', '\\', '/', ':', '.', '`', '\'', '^', 'V', '+', '-', 'V', '.', '@', ',', '~', '"', 'R', 'X', 'G', 'l', 's', 'x', '?', '', '', '', '', '', '', '', 'V', '=', '"', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x003.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x003.php new file mode 100644 index 00000000..3d02b86e --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x003.php @@ -0,0 +1 @@ +', '[?]', '[?]', '[?]', 'f', 'v', 'u', 'yr', 'y', 'w', 'th', 'th', 'a', 'o', 'ac', 'ae', 'o', 'o', 'o', 'oe', 'on', 'r', 'k', 'c', 'k', 'g', 'ng', 'g', 'g', 'w', 'h', 'h', 'h', 'h', 'n', 'n', 'n', 'i', 'e', 'j', 'g', 'ae', 'a', 'eo', 'p', 'z', 's', 's', 's', 'c', 'z', 't', 't', 'd', 'b', 'b', 'p', 'p', 'e', 'm', 'm', 'm', 'l', 'l', 'ng', 'ng', 'd', 'o', 'ear', 'ior', 'qu', 'qu', 'qu', 's', 'yr', 'yr', 'yr', 'q', 'x', '.', ':', '+', '17', '18', '19', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x017.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x017.php new file mode 100644 index 00000000..8f2a7cac --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x017.php @@ -0,0 +1 @@ +', '.', '..', '...', '.', "\n", + "\n\n", + '', '', '', '', '', ' ', '%0', '%00', '\'', '\'\'', '\'\'\'', '`', '``', '```', '^', '<', '>', '*', '!!', '!?', '-', '_', '-', '^', '***', '--', '/', '-[', ']-', '??', '?!', '!?', '7', 'PP', '(]', '[)', '*', '[?]', '[?]', '[?]', '%', '~', '[?]', '[?]', '[?]', "''''", // 0x57 + '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ' ', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '', '', '0', 'i', '', '', '4', '5', '6', '7', '8', '9', '+', '-', '=', '(', ')', 'n', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '=', '(', ')', '[?]', 'a', 'e', 'o', 'x', '[?]', 'h', 'k', 'l', 'm', 'n', 'p', 's', 't', '[?]', '[?]', '[?]', 'ECU', 'CL', 'Cr', 'Fr.', 'L.', 'mil', 'N', 'Pts', 'Rs', 'W', 'NS', 'D', 'EUR', 'K', 'T', 'Dr', 'Pf', 'P', 'G', 'A', 'UAH', 'C|', 'L', 'Sm', 'T', 'Rs', 'L', 'M', 'm', 'R', 'l', 'BTC', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '[?]', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x021.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x021.php new file mode 100644 index 00000000..1643d67d --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x021.php @@ -0,0 +1 @@ +=', '<=', '>=', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x023.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x023.php new file mode 100644 index 00000000..b8f4ca0d --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x023.php @@ -0,0 +1 @@ + ', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x024.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x024.php new file mode 100644 index 00000000..26abcc69 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x024.php @@ -0,0 +1 @@ +', '>', '>', '>', '>', '>', 'V', 'V', 'V', 'V', '<', '<', '<', '<', '<', '<', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '#', '#', '#', '#', '#', '^', '^', '^', 'O', '#', '#', '#', '#', 'O', 'O', 'O', 'O', '/', '\\\\', '\\\\', '#', '#', '#', '#', '/']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x026.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x026.php new file mode 100644 index 00000000..0c97de3f --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x026.php @@ -0,0 +1 @@ + ', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x028.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x028.php new file mode 100644 index 00000000..9585d914 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x028.php @@ -0,0 +1 @@ +', 'n', 't', 'q', ',', '*', '5', '<', '-', 'u', '8', 'v', '.', '%', '[', '$', '+', 'x', '!', '&', ';', ':', '4', '\\', '0', 'z', '7', '(', '_', '?', 'w', ']', '#', 'y', ')', '=', '[d7]', '[d17]', '[d27]', '[d127]', '[d37]', '[d137]', '[d237]', '[d1237]', '[d47]', '[d147]', '[d247]', '[d1247]', '[d347]', '[d1347]', '[d2347]', '[d12347]', '[d57]', '[d157]', '[d257]', '[d1257]', '[d357]', '[d1357]', '[d2357]', '[d12357]', '[d457]', '[d1457]', '[d2457]', '[d12457]', '[d3457]', '[d13457]', '[d23457]', '[d123457]', '[d67]', '[d167]', '[d267]', '[d1267]', '[d367]', '[d1367]', '[d2367]', '[d12367]', '[d467]', '[d1467]', '[d2467]', '[d12467]', '[d3467]', '[d13467]', '[d23467]', '[d123467]', '[d567]', '[d1567]', '[d2567]', '[d12567]', '[d3567]', '[d13567]', '[d23567]', '[d123567]', '[d4567]', '[d14567]', '[d24567]', '[d124567]', '[d34567]', '[d134567]', '[d234567]', '[d1234567]', '[d8]', '[d18]', '[d28]', '[d128]', '[d38]', '[d138]', '[d238]', '[d1238]', '[d48]', '[d148]', '[d248]', '[d1248]', '[d348]', '[d1348]', '[d2348]', '[d12348]', '[d58]', '[d158]', '[d258]', '[d1258]', '[d358]', '[d1358]', '[d2358]', '[d12358]', '[d458]', '[d1458]', '[d2458]', '[d12458]', '[d3458]', '[d13458]', '[d23458]', '[d123458]', '[d68]', '[d168]', '[d268]', '[d1268]', '[d368]', '[d1368]', '[d2368]', '[d12368]', '[d468]', '[d1468]', '[d2468]', '[d12468]', '[d3468]', '[d13468]', '[d23468]', '[d123468]', '[d568]', '[d1568]', '[d2568]', '[d12568]', '[d3568]', '[d13568]', '[d23568]', '[d123568]', '[d4568]', '[d14568]', '[d24568]', '[d124568]', '[d34568]', '[d134568]', '[d234568]', '[d1234568]', '[d78]', '[d178]', '[d278]', '[d1278]', '[d378]', '[d1378]', '[d2378]', '[d12378]', '[d478]', '[d1478]', '[d2478]', '[d12478]', '[d3478]', '[d13478]', '[d23478]', '[d123478]', '[d578]', '[d1578]', '[d2578]', '[d12578]', '[d3578]', '[d13578]', '[d23578]', '[d123578]', '[d4578]', '[d14578]', '[d24578]', '[d124578]', '[d34578]', '[d134578]', '[d234578]', '[d1234578]', '[d678]', '[d1678]', '[d2678]', '[d12678]', '[d3678]', '[d13678]', '[d23678]', '[d123678]', '[d4678]', '[d14678]', '[d24678]', '[d124678]', '[d34678]', '[d134678]', '[d234678]', '[d1234678]', '[d5678]', '[d15678]', '[d25678]', '[d125678]', '[d35678]', '[d135678]', '[d235678]', '[d1235678]', '[d45678]', '[d145678]', '[d245678]', '[d1245678]', '[d345678]', '[d1345678]', '[d2345678]', '[d12345678]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x029.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x029.php new file mode 100644 index 00000000..5162de38 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x029.php @@ -0,0 +1 @@ +', '%', '[?]', '[?]', '>', '=', '[?]', '/', '-', '~', '\\', '/', '~', '~', '|-', '-|', '[?]', '[?]', '[?]', '[?]', '<=', '=>', '((', '))', '[?]', '[?]', '::', '[?]', '?', '\'', 'o', '.', ',', '.', ',', ';', '[?]', '[?]', '[?]', '[?]', '----', '------', 'x', '|', '[?]', '[?]', '=', ',', '"', '`--', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?]', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?] ', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x02f.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x02f.php new file mode 100644 index 00000000..5147b574 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x02f.php @@ -0,0 +1 @@ + ', '<<', '>> ', '[', '] ', '{', '} ', '[(', ')] ', '@', 'X ', '[', '] ', '[[', ']] ', '((', ')) ', '[[', ']] ', '~ ', '``', '\'\'', ',,', '@', '1', '2', '3', '4', '5', '6', '7', '8', '9', '', '', '', '', '', '', '~', '+', '+', '+', '+', '', '@', ' // ', '+10+', '+20+', '+30+', '[?]', '[?]', '[?]', '', '', '[?]', 'a', 'a', 'i', 'i', 'u', 'u', 'e', 'e', 'o', 'o', 'ka', 'ga', 'ki', 'gi', 'ku', 'gu', 'ke', 'ge', 'ko', 'go', 'sa', 'za', 'shi', // 0x57 + 'zi', 'su', 'zu', 'se', 'ze', 'so', 'zo', 'ta', 'da', 'chi', // 0x61 + 'di', 'tsu', // 0x63 + 'tsu', // 0x64 + 'du', 'te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'ba', 'pa', 'hi', 'bi', 'pi', 'hu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'ya', 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa', 'wi', 'we', 'wo', 'n', 'vu', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '"', '"', '[?]', '[?]', 'a', 'a', 'i', 'i', 'u', 'u', 'e', 'e', 'o', 'o', 'ka', 'ga', 'ki', 'gi', 'ku', 'gu', 'ke', 'ge', 'ko', 'go', 'sa', 'za', 'shi', // 0xb7 + 'zi', 'su', 'zu', 'se', 'ze', 'so', 'zo', 'ta', 'da', 'chi', // 0xc1 + 'di', 'tsu', // 0xc3 + 'tsu', // 0xc4 + 'du', 'te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'ba', 'pa', 'hi', 'bi', 'pi', 'hu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'ya', 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa', 'wi', 'we', 'wo', 'n', 'vu', 'ka', 'ke', 'va', 'vi', 've', 'vo', '', '', '"', '"', ]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x031.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x031.php new file mode 100644 index 00000000..72c0260c --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x031.php @@ -0,0 +1 @@ +>', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '(g)', '(n)', '(d)', '(r)', '(m)', '(b)', '(s)', '()', '(j)', '(c)', '(k)', '(t)', '(p)', '(h)', '(ga)', '(na)', '(da)', '(ra)', '(ma)', '(ba)', '(sa)', '(a)', '(ja)', '(ca)', '(ka)', '(ta)', '(pa)', '(ha)', '[?]', '[?]', '[?]', 'KIS ', '(1) ', '(2) ', '(3) ', '(4) ', '(5) ', '(6) ', '(7) ', '(8) ', '(9) ', '(10) ', '(Yue) ', '(Huo) ', '(Shui) ', '(Mu) ', '(Jin) ', '(Tu) ', '(Ri) ', '(Zhu) ', '(You) ', '(She) ', '(Ming) ', '(Te) ', '(Cai) ', '(Zhu) ', '(Lao) ', '(Mi) ', '(Nan) ', '(Nu) ', '(Shi) ', '(You) ', '(Yin) ', '(Zhu) ', '(Xiang) ', '(Xiu) ', '(Xie) ', '(Zheng) ', '(Shang) ', '(Zhong) ', '(Xia) ', '(Zuo) ', '(You) ', '(Yi) ', '(Zong) ', '(Xue) ', '(Jian) ', '(Qi) ', '(Zi) ', '(Xie) ', '(Ye) ', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '1M', '2M', '3M', '4M', '5M', '6M', '7M', '8M', '9M', '10M', '11M', '12M', 'Hg', 'erg', 'eV', 'LTD', 'a', 'i', 'u', 'u', 'o', 'ka', 'ki', 'ku', 'ke', 'ko', 'sa', 'si', 'su', 'se', 'so', 'ta', 'ti', 'tu', 'te', 'to', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'hi', 'hu', 'he', 'ho', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'yu', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wi', 'we', 'wo']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x033.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x033.php new file mode 100644 index 00000000..8505337e --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x033.php @@ -0,0 +1 @@ +> ', '<', '> ', '[', '] ', '{', '}', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '', '', '', ',', ',', '.', '', ';', ':', '?', '!', '-', '(', ')', '{', '}', '{', '}', '#', '&', '*', '+', '-', '<', '>', '=', '', '\\', '$', '%', '@', '[?]', '[?]', '[?]', '[?]', '', '', '', '[?]', '', '[?]', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '[?]', '[?]', '']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x0ff.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x0ff.php new file mode 100644 index 00000000..b3a15398 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x0ff.php @@ -0,0 +1 @@ +', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', '[?]', '[?]', '.', '[', ']', ',', '*', 'wo', 'a', 'i', 'u', 'e', 'o', 'ya', 'yu', 'yo', 'tu', '+', 'a', 'i', 'u', 'e', 'o', 'ka', 'ki', 'ku', 'ke', 'ko', 'sa', 'si', 'su', 'se', 'so', 'ta', 'ti', 'tu', 'te', 'to', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'hi', 'hu', 'he', 'ho', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'yu', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'n', ':', ';', '', 'g', 'gg', 'gs', 'n', 'nj', 'nh', 'd', 'dd', 'r', 'lg', 'lm', 'lb', 'ls', 'lt', 'lp', 'rh', 'm', 'b', 'bb', 'bs', 's', 'ss', '', 'j', 'jj', 'c', 'k', 't', 'p', 'h', '[?]', '[?]', '[?]', 'a', 'ae', 'ya', 'yae', 'eo', 'e', '[?]', '[?]', 'yeo', 'ye', 'o', 'wa', 'wae', 'oe', '[?]', '[?]', 'yo', 'u', 'weo', 'we', 'wi', 'yu', '[?]', '[?]', 'eu', 'yi', 'i', '[?]', '[?]', '[?]', '/C', 'PS', '!', '-', '|', 'Y=', 'W=', '[?]', '|', '-', '|', '-', '|', '#', 'O', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '{', '|', '}', '', '', '', '']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d4.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d4.php new file mode 100644 index 00000000..ad8d3b25 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d4.php @@ -0,0 +1 @@ + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 52 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 78 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 104 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 130 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 156 => 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 181 => 'Z', 182 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 208 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 234 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d5.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d5.php new file mode 100644 index 00000000..a2a9b908 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d5.php @@ -0,0 +1,4 @@ + 'w', 'x', 'y', 'z', 4 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 30 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 56 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 82 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 108 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 134 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 160 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 186 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 212 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 238 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', ]; diff --git a/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d6.php b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d6.php new file mode 100644 index 00000000..315ef5e4 --- /dev/null +++ b/plugins/vendor/voku/portable-ascii/src/voku/helper/data/x1d6.php @@ -0,0 +1 @@ + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 80 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 112 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 230 => 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ]; diff --git a/plugins/vendor/webklex/php-imap/.github/FUNDING.yml b/plugins/vendor/webklex/php-imap/.github/FUNDING.yml new file mode 100644 index 00000000..c49bc6e3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/FUNDING.yml @@ -0,0 +1,2 @@ +ko_fi: webklex +custom: ['https://www.buymeacoffee.com/webklex'] diff --git a/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/bug_report.md b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..a0571c33 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**Used config** +Please provide the used config, if you are not using the package default config. + +**Code to Reproduce** +The troubling code section which produces the reported bug. +```php +echo "Bug"; +``` + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop / Server (please complete the following information):** +- OS: [e.g. Debian 10] +- PHP: [e.g. 5.5.9] +- Version [e.g. v2.3.1] +- Provider [e.g. Gmail, Outlook, Dovecot] + +**Additional context** +Add any other context about the problem here. diff --git a/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/feature_request.md b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..066b2d92 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,17 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/general-help-request.md b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/general-help-request.md new file mode 100644 index 00000000..49809d14 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/ISSUE_TEMPLATE/general-help-request.md @@ -0,0 +1,12 @@ +--- +name: General help request +about: Feel free to ask about any project related stuff + +--- + +Please be aware that these issues will be closed if inactive for more then 14 days. + +Also make sure to use https://github.com/Webklex/php-imap/issues/new?template=bug_report.md if you want to report a bug +or https://github.com/Webklex/php-imap/issues/new?template=feature_request.md if you want to suggest a feature. + +Still here? Well clean this out and go ahead :) diff --git a/plugins/vendor/webklex/php-imap/.github/docker/Dockerfile b/plugins/vendor/webklex/php-imap/.github/docker/Dockerfile new file mode 100644 index 00000000..ff0f11e6 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/docker/Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:latest +LABEL maintainer="Webklex " + +RUN apt-get update +RUN apt-get upgrade -y +RUN apt-get install -y sudo dovecot-imapd + +ENV LIVE_MAILBOX=true +ENV LIVE_MAILBOX_HOST=mail.example.local +ENV LIVE_MAILBOX_PORT=993 +ENV LIVE_MAILBOX_ENCRYPTION=ssl +ENV LIVE_MAILBOX_VALIDATE_CERT=true +ENV LIVE_MAILBOX_USERNAME=root@example.local +ENV LIVE_MAILBOX_PASSWORD=foobar +ENV LIVE_MAILBOX_QUOTA_SUPPORT=true + +EXPOSE 993 + +ADD dovecot_setup.sh /root/dovecot_setup.sh +RUN chmod +x /root/dovecot_setup.sh + +CMD ["/bin/bash", "-c", "/root/dovecot_setup.sh && tail -f /dev/null"] + diff --git a/plugins/vendor/webklex/php-imap/.github/docker/dovecot_setup.sh b/plugins/vendor/webklex/php-imap/.github/docker/dovecot_setup.sh new file mode 100644 index 00000000..25a51928 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/docker/dovecot_setup.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +set -ex + +sudo apt-get -q update +sudo apt-get -q -y install dovecot-imapd + +{ + echo "127.0.0.1 $LIVE_MAILBOX_HOST" +} | sudo tee -a /etc/hosts + +SSL_CERT="/etc/ssl/certs/dovecot.crt" +SSL_KEY="/etc/ssl/private/dovecot.key" + +sudo openssl req -new -x509 -days 3 -nodes \ + -out "$SSL_CERT" \ + -keyout "$SSL_KEY" \ + -subj "/C=EU/ST=Europe/L=Home/O=Webklex/OU=Webklex DEV/CN=""$LIVE_MAILBOX_HOST" + +sudo chown root:dovecot "$SSL_CERT" "$SSL_KEY" +sudo chmod 0440 "$SSL_CERT" +sudo chmod 0400 "$SSL_KEY" + +DOVECOT_CONF="/etc/dovecot/local.conf" +MAIL_CONF="/etc/dovecot/conf.d/10-mail.conf" +IMAP_CONF="/etc/dovecot/conf.d/20-imap.conf" +QUOTA_CONF="/etc/dovecot/conf.d/90-quota.conf" +sudo touch "$DOVECOT_CONF" "$MAIL_CONF" "$IMAP_CONF" "$QUOTA_CONF" +sudo chown root:dovecot "$DOVECOT_CONF" "$MAIL_CONF" "$IMAP_CONF" "$QUOTA_CONF" +sudo chmod 0640 "$DOVECOT_CONF" "$MAIL_CONF" "$IMAP_CONF" "$QUOTA_CONF" + +{ + echo "ssl = required" + echo "disable_plaintext_auth = yes" + echo "ssl_cert = <""$SSL_CERT" + echo "ssl_key = <""$SSL_KEY" + echo "ssl_protocols = !SSLv2 !SSLv3" + echo "ssl_cipher_list = AES128+EECDH:AES128+EDH" +} | sudo tee -a "$DOVECOT_CONF" + +{ + echo "mail_plugins = \$mail_plugins quota" +} | sudo tee -a "$MAIL_CONF" + +{ + echo "protocol imap {" + echo " mail_plugins = \$mail_plugins imap_quota" + echo "}" +} | sudo tee -a "$IMAP_CONF" + +{ + echo "plugin {" + echo " quota = maildir:User quota" + echo " quota_rule = *:storage=1G" + echo "}" +} | sudo tee -a "$QUOTA_CONF" + +sudo useradd --create-home --shell /bin/false "$LIVE_MAILBOX_USERNAME" +echo "$LIVE_MAILBOX_USERNAME"":""$LIVE_MAILBOX_PASSWORD" | sudo chpasswd + +sudo service dovecot restart + +sudo doveadm auth test -x service=imap "$LIVE_MAILBOX_USERNAME" "$LIVE_MAILBOX_PASSWORD" \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/.github/workflows/tests.yaml b/plugins/vendor/webklex/php-imap/.github/workflows/tests.yaml new file mode 100644 index 00000000..682cbd51 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.github/workflows/tests.yaml @@ -0,0 +1,50 @@ +name: Tests + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * *' + +permissions: + contents: read + +jobs: + phpunit: + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php: ['8.0', 8.1, 8.2, 8.3, 8.4] + + name: PHP ${{ matrix.php }} + + env: + LIVE_MAILBOX: true + LIVE_MAILBOX_DEBUG: true + LIVE_MAILBOX_HOST: mail.example.local + LIVE_MAILBOX_PORT: 993 + LIVE_MAILBOX_USERNAME: root@example.local + LIVE_MAILBOX_ENCRYPTION: ssl + LIVE_MAILBOX_PASSWORD: foobar + LIVE_MAILBOX_QUOTA_SUPPORT: true + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: openssl, json, mbstring, iconv, fileinfo, libxml, zip + coverage: none + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-interaction --no-progress + + - run: "sh .github/docker/dovecot_setup.sh" + + - name: Execute tests + run: vendor/bin/phpunit \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/.gitignore b/plugins/vendor/webklex/php-imap/.gitignore new file mode 100644 index 00000000..d1816ad9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/.gitignore @@ -0,0 +1,7 @@ +vendor +composer.lock +.idea +/build/ +test.php +.phpunit.result.cache +phpunit.xml \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/CHANGELOG.md b/plugins/vendor/webklex/php-imap/CHANGELOG.md new file mode 100755 index 00000000..97935023 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/CHANGELOG.md @@ -0,0 +1,964 @@ +# Changelog + +All notable changes to `webklex/php-imap` will be documented in this file. + +Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## [UNRELEASED] +### Fixed +- NaN + +### Added +- NaN + +### Breaking changes +- NaN + +## [6.2.0] - 2025-04-25 +### Fixed +- When using the chunk function, some messages do not have an element with index 0 #552 #553 (thanks @zeddmaster) +- Get folders list in hierarchical order #560 #561 (thanks @rskrzypczak) +- Fix remaining implicit marking of parameters as nullable (PHP 8.4) #566 (thanks @steffenweber) +- Fix case sensitivity of folder attribute parsing (\NoSelect, \NoInferiors) #469 #571 (thanks @smajti1) +- Fix error on getUid(null) with 0 results (#499) #573 (thanks @pierement) +- Fix Date parsing on non-standard format from Aqua Mail #574 #575 (thanks @lm-cmxkonzepte) + +### Added +- SSL stream context options added #238 #546 (thanks @llemoine) +- Support copy/move Message with utf7 folder path #559 (thanks @loc4l) +- Public `Query::search()` method #565 (Thanks @madbob) + +## [6.1.0] - 2025-01-19 +### Fixed +- Filename sanitization is now optional (enabled via default) +- Address parsing improved and extended to include more cases +- Boundary parsing fixed and improved to support more formats #544 +- Decode partially encoded address names #511 +- Enforce RFC822 parsing if enabled #462 + +### Added +- Security configuration options added +- Spoofing detection added #40 +- RFC4315 MOVE fallback added #123 (thanks @freescout-help-desk) +- Content fetching RFC standard support added #510 (thanks @ybizeul) +- Support unescaped dates inside the search conditions #542 +- `Client::clone()` looses account configuration #521 (thanks @netpok) + +## [6.0.0] - 2025-01-17 +### Fixed +- Fixed date issue if timezone is UT and a 2 digit year #429 (thanks @ferrisbuellers) +- Make the space optional after a comma separator #437 (thanks @marc0adam) +- Fix bug when multipart message getHTMLBody() method returns null #455 (thanks @michalkortas) +- Fix: Improve return type hints and return docblocks for query classes #470 (thanks @olliescase) +- Fix - Query - Chunked - Resolved infinite loop when start chunk > 1 #477 (thanks @NeekTheNook) +- Attachment with symbols in filename #436 (thanks @nuernbergerA) +- Ignore possible untagged lines after IDLE and DONE commands #445 (thanks @gazben) +- Fix Empty Child Folder Error #474 (thanks @bierpub) +- Filename sanitization improved #501 (thanks @neolip) +- `Client::getFolderPath()` return null if folder is not set #506 (thanks @arnolem) +- Fix implicit marking of parameters as nullable, deprecated in PHP 8.4 #518 (thanks @campbell-m) + +### Added +- IMAP STATUS command support added `Folder::status()` #424 (thanks @InterLinked1) +- Add attributes and special flags #428 (thanks @sazanof) +- Better connection check for IMAP #449 (thanks @thin-k-design) +- Config handling moved into a new class `Config::class` to allow class serialization (sponsored by elb-BIT GmbH) +- Support for Carbon 3 added #483 +- Custom decoder support added +- Decoding filename with non-standard encoding #535 (thanks @grnsv) + +### Breaking changes +- The decoder config has been moved from `options.decoder` to `decoding` and contains now the `decoder` class to used as well as their decoding fallbacks +- `Folder::getStatus()` no longer returns the results of `EXAMINE` but `STATUS` instead. If you want to use `EXAMINE` you can use the `Folder::examine()` method instead. +- `ClientManager::class` has now longer access to all configs. Config handling has been moved to its own class `Config::class`. If you want to access the config you can use the retriever method `::getConfig()` instead. Example: `$client->getConfig()` or `$message->getConfig()`, etc. +- `ClientManager::get` isn't available anymore. Use the regular config accessor instead. Example: `$cm->getConfig()->get($key)` +- `M̀essage::getConfig()` now returns the client configuration instead of the fetching options configuration. Please use `$message->getOptions()` instead. +- `Attachment::getConfig()` now returns the client configuration instead of the fetching options configuration. Please use `$attachment->getOptions()` instead. +- `Header::getConfig()` now returns the client configuration instead of the fetching options configuration. Please use `$header->getOptions()` instead. +- `M̀essage::setConfig` now expects the client configuration instead of the fetching options configuration. Please use `$message->setOptions` instead. +- `Attachment::setConfig` now expects the client configuration instead of the fetching options configuration. Please use `$attachment->setOptions` instead. +- `Header::setConfig` now expects the client configuration instead of the fetching options configuration. Please use `$header->setOptions` instead. +- All protocol constructors now require a `Config::class` instance +- The `Client::class` constructor now require a `Config::class` instance +- The `Part::class` constructor now require a `Config::class` instance +- The `Header::class` constructor now require a `Config::class` instance +- The `Message::fromFile` method now requires a `Config::class` instance +- The `Message::fromString` method now requires a `Config::class` instance +- The `Message::boot` method now requires a `Config::class` instance +- The `Message::decode` method has been removed. Use `Message::getDecoder()->decode($str)` instead. +- The `Message::getEncoding` method has been removed. Use `Message::getDecoder()->getEncoding($str)` instead. +- The `Message::convertEncoding` method has been removed. Use `Message::getDecoder()->convertEncoding()` instead. +- The `Header::decode` method has been removed. Use `Header::getDecoder()->decode($str)` instead. + +## [5.5.0] - 2023-06-28 +### Fixed +- Error token length mismatch in `ImapProtocol::readResponse` #400 +- Attachment name parsing fixed #410 #421 (thanks @nuernbergerA) +- Additional Attachment name fallback added to prevent missing attachments +- Attachment id is now static (based on the raw part content) instead of random +- Always parse the attachment description if it is available + +### Added +- Attachment content hash added + + +## [5.4.0] - 2023-06-24 +### Fixed +- Legacy protocol support fixed (object to array conversion) #411 +- Header value decoding improved #410 +- Protocol exception handling improved (bad response message added) #408 +- Prevent fetching singular rfc partials from running indefinitely #407 +- Subject with colon ";" is truncated #401 +- Catching and handling iconv decoding exception #397 + +### Added +- Additional timestamp formats added #198 #392 (thanks @esk-ap) + + +## [5.3.0] - Security patch - 2023-06-20 +### Fixed +- Potential RCE through path traversal fixed #414 (special thanks @angelej) + +### Security Impact and Mitigation +Impacted are all versions below v5.3.0. +If possible, update to >= v5.3.0 as soon as possible. Impacted was the `Attachment::save` +method which could be used to write files to the local filesystem. The path was not +properly sanitized and could be used to write files to arbitrary locations. + +However, the `Attachment::save` method is not used by default and has to be called +manually. If you are using this method without providing a sanitized path, you are +affected by this vulnerability. +If you are not using this method or are providing a sanitized path, you are not affected +by this vulnerability and no immediate action is required. + +If you have any questions, please feel welcome to join this issue: https://github.com/Webklex/php-imap/issues/416 +#### Timeline +- 17.06.23 21:30: Vulnerability reported +- 18.06.23 19:14: Vulnerability confirmed +- 19.06.23 18:41: Vulnerability fixed via PR #414 +- 20.06.23 13:45: Security patch released +- 21.06.23 20:48: CVE-2023-35169 got assigned +- 21.06.23 20:58: Advisory released https://github.com/Webklex/php-imap/security/advisories/GHSA-47p7-xfcc-4pv9 + + +## [5.2.0] - 2023-04-11 +### Fixed +- Use all available methods to detect the attachment extension instead of just one +- Allow the `LIST` command response to be empty #393 +- Initialize folder children attributes on class initialization + +### Added +- Soft fail option added to all folder fetching methods. If soft fail is enabled, the method will return an empty collection instead of throwing an exception if the folder doesn't exist + + +## [5.1.0] - 2023-03-16 +### Fixed +- IMAP Quota root command fixed +- Prevent line-breaks in folder path caused by special chars +- Partial fix for #362 (allow overview response to be empty) +- `Message::setConfig()` config parameter type set to array +- Reset the protocol uid cache if the session gets expunged +- Set the "seen" flag only if the flag isn't set and the fetch option isn't `IMAP::FT_PEEK` +- `Message::is()` date comparison fixed +- `Message::$client` could not be set to null +- `in_reply_to` and `references` parsing fixed +- Prevent message body parser from injecting empty lines +- Don't parse regular inline message parts without name or filename as attachment +- `Message::hasTextBody()` and `Message::hasHtmlBody()` should return `false` if the body is empty +- Imap-Protocol "empty response" detection extended to catch an empty response caused by a broken resource stream +- `iconv_mime_decode()` is now used with `ICONV_MIME_DECODE_CONTINUE_ON_ERROR` to prevent the decoding from failing +- Date decoding rules extended to support more date formats +- Unset the currently active folder if it gets deleted (prevent infinite loop) +- Attachment name and filename parsing fixed and improved to support more formats +- Check if the next uid is available (after copying or moving a message) before fetching it #381 +- Default pagination `$total` attribute value set to 0 #385 (thanks @hhniao) +- Use attachment ID as fallback filename for saving an attachment +- Address decoding error detection added #388 + +### Added +- Extended UTF-7 support added (RFC2060) #383 +- `Protocol::sizes()` support added (fetch the message byte size via RFC822.SIZE). Accessible through `Message::getSize()` #379 (thanks @didi1357) +- `Message::hasFlag()` method added to check if a message has a specific flag +- `Message::getConfig()` method added to get the current message configuration +- `Folder::select()` method added to select a folder +- `Message::getAvailableFlags()` method added to get all available flags +- Live mailbox and fixture tests added +- `Attribute::map()` method added to map all attribute values +- `Header::has()` method added to check if a header attribute / value exist +- All part attributes are now accessible via linked attribute +- Restore a message from string `Message::fromString()` + + +## [5.0.1] - 2023-03-01 +### Fixed +- More unique ID generation to prevent multiple attachments with same ID #363 (thanks @Guite) +- Not all attachments are pushed to the collection #372 (thanks @AdrianKuriata) +- Partial fix for #362 (allow search response to be empty) +- Unsafe usage of switch case. #354 #366 (thanks @shuergab) +- Fix use of ST_MSGN as sequence method #356 (thanks @gioid) +- Prevent infinite loop in ImapProtocol #316 (thanks @thin-k-design) + + +## [5.0.0] - 2023-01-18 +### Fixed +- The message uid and message number will only be fetched if accessed and wasn't previously set #326 #285 (thanks @szymekjanaczek) +- Fix undefined attachment name when headers use "filename*=" format #301 (thanks @JulienChavee) +- Fixed `ImapProtocol::logout` always throws 'not connected' Exception after upgraded to 4.1.2 #351 +- Protocol interface and methods unified +- Strict attribute and return types introduced where ever possible +- Parallel messages during idle #338 +- Idle timeout / stale resource stream issue fixed +- Syntax updated to support php 8 features +- Get the attachment file extension from the filename if no mimetype detection library is available +- Prevent the structure parsing from parsing an empty part +- Convert all header keys to their lower case representation +- Restructure the decode function #355 (thanks @istid) + +### Added +- Unit tests added #347 #242 (thanks @sergiy-petrov, @boekkooi-lengoo) +- `Client::clone()` method added to clone a client instance +- Save an entire message (including its headers) `Message::save()` +- Restore a message from a local or remote file `Message::fromFile()` +- Protocol resource stream accessor added `Protocol::getStream()` +- Protocol resource stream meta data accessor added `Protocol::meta()` +- ImapProtocol resource stream reset method added `ImapProtocol::reset()` +- Protocol `Response::class` introduced to handle and unify all protocol requests +- Static mask config accessor added `ClientManager::getMask()` added +- An `Attribute::class` instance can be treated as array +- Get the current client account configuration via `Client::getConfig()` +- Delete a folder via `Client::deleteFolder()` + +### Breaking changes +- PHP ^8.0.2 required +- `nesbot/carbon` version bumped to ^2.62.1 +- `phpunit/phpunit` version bumped to ^9.5.10 +- `Header::get()` always returns an `Attribute::class` instance +- `Attribute::class` accessor methods renamed to shorten their names and improve the readability +- All protocol methods that used to return `array|bool` will now always return a `Response::class` instance. +- `ResponseException::class` gets thrown if a response is empty or contains errors +- Message client is optional and can be null (e.g. if used in combination with `Message::fromFile()`) +- The message text or html body is now "" if its empty and not `null` + + +## [4.1.2] - 2022-12-14 +### Fixed +- Attachment ID can return an empty value #318 +- Additional message date format added #345 (thanks @amorebietakoUdala) + + +## [4.1.1] - 2022-11-16 +### Fixed +- Fix for extension recognition #325 (thanks @pwoszczyk) +- Missing null check added #327 (thanks @spanjeta) +- Leading white-space in response causes an infinite loop #321 (thanks @thin-k-design) +- Fix error when creating folders with special chars #319 (thanks @thin-k-design) +- `Client::getFoldersWithStatus()` recursive loading fixed #312 (thanks @szymekjanaczek) +- Fix Folder name encoding error in `Folder::appendMessage()` #306 #307 (thanks @rskrzypczak) + + +## [4.1.0] - 2022-10-18 +### Fixed +- Fix assumedNextTaggedLine bug #288 (thanks @Blear) +- Fix empty response error for blank lines #274 (thanks @bierpub) +- Fix empty body #233 (thanks @latypoff) +- Fix imap_reopen folder argument #234 (thanks @latypoff) + +### Added +- Added possibility of loading a Folder status #298 (thanks @szymekjanaczek) + + +## [4.0.2] - 2022-08-26 +### Fixed +- RFC 822 3.1.1. long header fields regular expression fixed #268 #269 (thanks @hbraehne) + + +## [4.0.1] - 2022-08-25 +### Fixed +- Type casting added to several ImapProtocol return values #261 +- Remove IMAP::OP_READONLY flag from imap_reopen if POP3 or NNTP protocol is selected #135 (thanks @xianzhe18) +- Several statements optimized and redundant checks removed +- Check if the Protocol supports the fetch method if extensions are present +- Detect `NONEXISTENT` errors while selecting or examining a folder #266 +- Missing type cast added to `PaginatedCollection::paginate` #267 (thanks @rogerb87) +- Fix multiline header unfolding #250 (thanks @sulgie-eitea) +- Fix problem with illegal offset error #226 (thanks @szymekjanaczek) +- Typos fixed + +### Affected Classes +- [Query::class](src/Query/Query.php) +- [ImapProtocol::class](src/Connection/Protocols/ImapProtocol.php) +- [LegacyProtocol::class](src/Connection/Protocols/LegacyProtocol.php) +- [PaginatedCollection::class](src/Support/PaginatedCollection.php) + + +## [4.0.0] - 2022-08-19 +### Fixed +- PHP dependency updated to support php v8.0 #212 #214 (thanks @freescout-helpdesk) +- Method return and argument types added +- Imap `DONE` method refactored +- UID cache loop fixed +- `HasEvent::getEvent` return value set to mixed to allow multiple event types +- Protocol line reader changed to `fread` (stream_context timeout issue fixed) +- Issue setting the client timeout fixed +- IMAP Connection debugging improved +- `Folder::idle()` method reworked and several issues fixed #170 #229 #237 #249 #258 +- Datetime conversion rules extended #189 #173 + +### Affected Classes +- [Client::class](src/Client.php) +- [Folder::class](src/Folder.php) +- [ImapProtocol::class](src/Connection/Protocols/ImapProtocol.php) +- [HasEvents::class](src/Traits/HasEvents.php) + +### Breaking changes +- No longer supports php >=5.5.9 but instead requires at least php v7.0.0. +- `HasEvent::getEvent` returns a mixed result. Either an `Event` or a class string representing the event class. +- The error message, if the connection fails to read the next line, is now `empty response` instead of `failed to read - connection closed?`. +- The `$auto_reconnect` used with `Folder::indle()` is deprecated and doesn't serve any purpose anymore. + + +## [3.2.0] - 2022-03-07 +### Fixed +- Fix attribute serialization #179 (thanks @netpok) +- Use real tls instead of starttls #180 (thanks @netpok) +- Allow to fully overwrite default config arrays #194 (thanks @laurent-rizer) +- Query::chunked does not loop over the last chunk #196 (thanks @laurent-rizer) +- Fix isAttachment that did not properly take in consideration dispositions options #195 (thanks @laurent-rizer) +- Extend date parsing error message #173 +- Fixed 'Where' method replaces the content with uppercase #148 +- Don't surround numeric search values with quotes +- Context added to `InvalidWhereQueryCriteriaException` +- Redundant `stream_set_timeout()` removed + +### Added +- UID Cache added #204 (thanks @HelloSebastian) +- Query::class extended with `getByUidLower`, `getByUidLowerOrEqual` , `getByUidGreaterOrEqual` , `getByUidGreater` to fetch certain ranges of uids #201 (thanks @HelloSebastian) +- Check if IDLE is supported if `Folder::idle()` is called #199 (thanks @HelloSebastian) +- Fallback date support added. The config option `options.fallback_date` is used as fallback date is it is set. Otherwise, an exception will be thrown #198 +- UID filter support added +- Make boundary regex configurable #169 #150 #126 #121 #111 #152 #108 (thanks @EthraZa) +- IMAP ID support added #174 +- Enable debug mode via config +- Custom UID alternative support added +- Fetch additional extensions using `Folder::query(["FEATURE_NAME"])` +- Optionally move a message during "deletion" instead of just "flagging" it #106 (thanks @EthraZa) +- `WhereQuery::where()` accepts now a wide range of criteria / values. #104 + +### Affected Classes +- [Part::class](src/Part.php) +- [Query::class](src/Query/Query.php) +- [Client::class](src/Client.php) +- [Header::class](src/Header.php) +- [Protocol::class](src/Connection/Protocols/Protocol.php) +- [ClientManager::class](src/ClientManager.php) + +### Breaking changes +- If you are using the legacy protocol to search, the results no longer return false if the search criteria could not be interpreted but instead return an empty array. This will ensure it is compatible to the rest of this library and no longer result in a potential type confusion. +- `Folder::idle` will throw an `Webklex\PHPIMAP\Exceptions\NotSupportedCapabilityException` exception if IMAP isn't supported by the mail server +- All protocol methods which had a `boolean` `$uid` option no longer support a boolean value. Use `IMAP::ST_UID` or `IMAP::NIL` instead. If you want to use an alternative to `UID` just use the string instead. +- Default config option `options.sequence` changed from `IMAP::ST_MSGN` to `IMAP::ST_UID`. +- `Folder::query()` no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features. + + +## [3.1.0-alpha] - 2022-02-03 +### Fixed +- Fix attribute serialization #179 (thanks @netpok) +- Use real tls instead of starttls #180 (thanks @netpok) +- Allow to fully overwrite default config arrays #194 (thanks @laurent-rizer) +- Query::chunked does not loop over the last chunk #196 (thanks @laurent-rizer) +- Fix isAttachment that did not properly take in consideration dispositions options #195 (thanks @laurent-rizer) + +### Affected Classes +- [Header::class](src/Header.php) +- [Protocol::class](src/Connection/Protocols/Protocol.php) +- [Query::class](src/Query/Query.php) +- [Part::class](src/Part.php) +- [ClientManager::class](src/ClientManager.php) + +## [3.0.0-alpha] - 2021-11-04 +### Fixed +- Extend date parsing error message #173 +- Fixed 'Where' method replaces the content with uppercase #148 +- Don't surround numeric search values with quotes +- Context added to `InvalidWhereQueryCriteriaException` +- Redundant `stream_set_timeout()` removed + +### Added +- Make boundary regex configurable #169 #150 #126 #121 #111 #152 #108 (thanks @EthraZa) +- IMAP ID support added #174 +- Enable debug mode via config +- Custom UID alternative support added +- Fetch additional extensions using `Folder::query(["FEATURE_NAME"])` +- Optionally move a message during "deletion" instead of just "flagging" it #106 (thanks @EthraZa) +- `WhereQuery::where()` accepts now a wide range of criteria / values. #104 + +### Affected Classes +- [Header::class](src/Header.php) +- [Protocol::class](src/Connection/Protocols/Protocol.php) +- [Query::class](src/Query/Query.php) +- [WhereQuery::class](src/Query/WhereQuery.php) +- [Message::class](src/Message.php) + +### Breaking changes +- All protocol methods which had a `boolean` `$uid` option no longer support a boolean. Use `IMAP::ST_UID` or `IMAP::NIL` instead. If you want to use an alternative to `UID` just use the string instead. +- Default config option `options.sequence` changed from `IMAP::ST_MSGN` to `IMAP::ST_UID`. +- `Folder::query()` no longer accepts a charset string. It has been replaced by an extension array, which provides the ability to automatically fetch additional features. + +## [2.7.2] - 2021-09-27 +### Fixed +- Fixed problem with skipping last line of the response. #166 (thanks @szymekjanaczek) + +## [2.7.1] - 2021-09-08 +### Added +- Added `UID` as available search criteria #161 (thanks @szymekjanaczek) + +## [2.7.0] - 2021-09-04 +### Fixed +- Fixes handling of long header lines which are seperated by `\r\n\t` (thanks @Oliver-Holz) +- Fixes to line parsing with multiple addresses (thanks @Oliver-Holz) + +### Added +- Expose message folder path #154 (thanks @Magiczne) +- Adds mailparse_rfc822_parse_addresses integration (thanks @Oliver-Holz) +- Added moveManyMessages method (thanks @Magiczne) +- Added copyManyMessages method (thanks @Magiczne) + +### Affected Classes +- [Header::class](src/Header.php) +- [Message::class](src/Message.php) + +## [2.6.0] - 2021-08-20 +### Fixed +- POP3 fixes #151 (thanks @Korko) + +### Added +- Added imap 4 handling. #146 (thanks @szymekjanaczek) +- Added laravel's conditionable methods. #147 (thanks @szymekjanaczek) + +### Affected Classes +- [Query::class](src/Query/Query.php) +- [Client::class](src/Client.php) + +## [2.5.1] - 2021-06-19 +### Fixed +- Fix setting default mask from config #133 (thanks @shacky) +- Chunked fetch fails in case of less available mails than page size #114 +- Protocol::createStream() exception information fixed #137 +- Legacy methods (headers, content, flags) fixed #125 +- Legacy connection cycle fixed #124 (thanks @zssarkany) + +### Added +- Disable rfc822 header parsing via config option #115 + +## [2.5.0] - 2021-02-01 +### Fixed +- Attachment saving filename fixed +- Unnecessary parameter removed from `Client::getTimeout()` +- Missing encryption variable added - could have caused problems with unencrypted communications +- Prefer attachment filename attribute over name attribute #82 +- Missing connection settings added to `Folder:idle()` auto mode #89 +- Message move / copy expect a folder path #79 +- `Client::getFolder()` updated to circumvent special edge cases #79 +- Missing connection status checks added to various methods +- Unused default attribute `message_no` removed from `Message::class` + +### Added +- Dynamic Attribute access support added (e.g `$message->from[0]`) +- Message not found exception added #93 +- Chunked fetching support added `Query::chunked()`. Just in case you can't fetch all messages at once +- "Soft fail" support added +- Count method added to `Attribute:class` +- Convert an Attribute instance into a Carbon date object #95 + +### Affected Classes +- [Attachment::class](src/Attachment.php) +- [Attribute::class](src/Attribute.php) +- [Query::class](src/Query/Query.php) +- [Message::class](src/Message.php) +- [Client::class](src/Client.php) +- [Folder::class](src/Folder.php) + +### Breaking changes +- A new exception can occur if a message can't be fetched (`\Webklex\PHPIMAP\Exceptions\MessageNotFoundException::class`) +- `Message::move()` and `Message::copy()` no longer accept folder names as folder path +- A `Message::class` instance might no longer have a `message_no` attribute + +## [2.4.4] - 2021-01-22 +### Fixed +- Boundary detection simplified #90 +- Prevent potential body overwriting #90 +- CSV files are no longer regarded as plain body +- Boundary detection overhauled to support "related" and "alternative" multipart messages #90 #91 + +### Affected Classes +- [Structure::class](src/Structure.php) +- [Message::class](src/Message.php) +- [Header::class](src/Header.php) +- [Part::class](src/Part.php) + +## [2.4.3] - 2021-01-21 +### Fixed +- Attachment detection updated #82 #90 +- Timeout handling improved +- Additional utf-8 checks added to prevent decoding of unencoded values #76 + +### Added +- Auto reconnect option added to `Folder::idle()` #89 + +### Affected Classes +- [Folder::class](src/Folder.php) +- [Part::class](src/Part.php) +- [Client::class](src/Client.php) +- [Header::class](src/Header.php) + +## [2.4.2] - 2021-01-09 +### Fixed +- Attachment::save() return error 'A facade root has not been set' #87 +- Unused dependencies removed +- Fix PHP 8 error that changes null back in to an empty string. #88 (thanks @mennovanhout) +- Fix regex to be case insensitive #88 (thanks @mennovanhout) + +### Affected Classes +- [Attachment::class](src/Attachment.php) +- [Address::class](src/Address.php) +- [Attribute::class](src/Attribute.php) +- [Structure::class](src/Structure.php) + +## [2.4.1] - 2021-01-06 +### Fixed +- Debug line position fixed +- Handle incomplete address to string conversion #83 +- Configured message key gets overwritten by the first fetched message #84 + +### Affected Classes +- [Address::class](src/Address.php) +- [Query::class](src/Query/Query.php) + +## [2.4.0] - 2021-01-03 +### Fixed +- Get partial overview when `IMAP::ST_UID` is set #74 +- Unnecessary "'" removed from address names +- Folder referral typo fixed +- Legacy protocol fixed +- Treat message collection keys always as strings + +### Added +- Configurable supported default flags added +- Message attribute class added to unify value handling +- Address class added and integrated +- Alias `Message::attachments()` for `Message::getAttachments()` added +- Alias `Message::addFlag()` for `Message::setFlag()` added +- Alias `Message::removeFlag()` for `Message::unsetFlag()` added +- Alias `Message::flags()` for `Message::getFlags()` added +- New Exception `MessageFlagException::class` added +- New method `Message::setSequenceId($id)` added +- Optional Header attributizion option added + +### Affected Classes +- [Folder::class](src/Folder.php) +- [Header::class](src/Header.php) +- [Message::class](src/Message.php) +- [Address::class](src/Address.php) +- [Query::class](src/Query/Query.php) +- [Attribute::class](src/Attribute.php) + +### Breaking changes +- Stringified message headers are now separated by ", " instead of " ". +- All message header values such as subject, message_id, from, to, etc now consists of an `Àttribute::class` instance (should behave the same way as before, but might cause some problem in certain edge cases) +- The formal address object "from", "to", etc now consists of an `Address::class` instance (should behave the same way as before, but might cause some problem in certain edge cases) +- When fetching or manipulating message flags a `MessageFlagException::class` exception can be thrown if a runtime error occurs +- Learn more about the new `Attribute` class here: [www.php-imap.com/api/attribute](https://www.php-imap.com/api/attribute) +- Learn more about the new `Address` class here: [www.php-imap.com/api/address](https://www.php-imap.com/api/address) +- Folder attribute "referal" is now called "referral" + +## [2.3.1] - 2020-12-30 +### Fixed +- Missing RFC attributes added +- Set the message sequence when idling +- Missing UID commands added #64 + +### Added +- Get a message by its message number +- Get a message by its uid #72 #66 #63 + +### Affected Classes +- [Message::class](src/Message.php) +- [Folder::class](src/Folder.php) +- [Query::class](src/Query/Query.php) + +## [2.3.0] - 2020-12-21 +### Fixed +- Cert validation issue fixed +- Allow boundaries ending with a space or semicolon (thanks [@smartilabs](https://github.com/smartilabs)) +- Ignore IMAP DONE command response #57 +- Default `options.fetch` set to `IMAP::FT_PEEK` +- Address parsing fixed #60 +- Alternative rfc822 header parsing fixed #60 +- Parse more than one Received: header #61 +- Fetch folder overview fixed +- `Message::getTextBody()` fallback value fixed + +### Added +- Proxy support added +- Flexible disposition support added #58 +- New `options.message_key` option `uid` added +- Protocol UID support added +- Flexible sequence type support added + +### Affected Classes +- [Structure::class](src/Structure.php) +- [Query::class](src/Query/Query.php) +- [Client::class](src/Client.php) +- [Header::class](src/Header.php) +- [Folder::class](src/Folder.php) +- [Part::class](src/Part.php) + +### Breaking changes +- Depending on your configuration, your certificates actually get checked. Which can cause an aborted connection if the certificate can not be validated. +- Messages don't get flagged as read unless you are using your own custom config. +- All `Header::class` attribute keys are now in a snake_format and no longer minus-separated. +- `Message::getTextBody()` no longer returns false if no text body is present. `null` is returned instead. + +## [2.2.5] - 2020-12-11 +### Fixed +- Missing array decoder method added #51 (thanks [@lutchin](https://github.com/lutchin)) +- Additional checks added to prevent message from getting marked as seen #33 +- Boundary parsing improved #39 #36 (thanks [@AntonioDiPassio-AppSys](https://github.com/AntonioDiPassio-AppSys)) +- Idle operation updated #44 + +### Added +- Force a folder to be opened + +### Affected Classes +- [Header::class](src/Header.php) +- [Folder::class](src/Folder.php) +- [Query::class](src/Query/Query.php) +- [Message::class](src/Message.php) +- [Structure::class](src/Structure.php) + +## [2.2.4] - 2020-12-08 +### Fixed +- Search performance increased by fetching all headers, bodies and flags at once #42 +- Legacy protocol support updated +- Fix Query pagination. (#52 [@mikemiller891](https://github.com/mikemiller891)) + +### Added +- Missing message setter methods added +- `Folder::overview()` method added to fetch all headers of all messages in the current folder + +### Affected Classes +- [Message::class](src/Message.php) +- [Folder::class](src/Folder.php) +- [Query::class](src/Query/Query.php) +- [PaginatedCollection::class](src/Support/PaginatedCollection.php) + +## [2.2.3] - 2020-11-02 +### Fixed +- Text/Html body fetched as attachment if subtype is null #34 +- Potential header overwriting through header extensions #35 +- Prevent empty attachments #37 + +### Added +- Set fetch order during query #41 [@Max13](https://github.com/Max13) + +### Affected Classes +- [Message::class](src/Message.php) +- [Part::class](src/Part.php) +- [Header::class](src/Header.php) +- [Query::class](src/Query/Query.php) + + +## [2.2.2] - 2020-10-20 +### Fixed +- IMAP::FT_PEEK removing "Seen" flag issue fixed #33 + +### Affected Classes +- [Message::class](src/Message.php) + +## [2.2.1] - 2020-10-19 +### Fixed +- Header decoding problem fixed #31 + +### Added +- Search for messages by message-Id +- Search for messages by In-Reply-To +- Message threading added `Message::thread()` +- Default folder locations added + +### Affected Classes +- [Query::class](src/Query/Query.php) +- [Message::class](src/Message.php) +- [Header::class](src/Header.php) + + +## [2.2.0] - 2020-10-16 +### Fixed +- Prevent text bodies from being fetched as attachment #27 +- Missing variable check added to prevent exception while parsing an address [webklex/laravel-imap #356](https://github.com/Webklex/laravel-imap/issues/356) +- Missing variable check added to prevent exception while parsing a part subtype #27 +- Missing variable check added to prevent exception while parsing a part content-type [webklex/laravel-imap #356](https://github.com/Webklex/laravel-imap/issues/356) +- Mixed message header attribute `in_reply_to` "unified" to be always an array #26 +- Potential message moving / copying problem fixed #29 +- Move messages by using `Protocol::moveMessage()` instead of `Protocol::copyMessage()` and `Message::delete()` #29 + +### Added +- `Protocol::moveMessage()` method added #29 + +### Affected Classes +- [Message::class](src/Message.php) +- [Header::class](src/Header.php) +- [Part::class](src/Part.php) + +### Breaking changes +- Text bodies might no longer get fetched as attachment +- `Message::$in_reply_to` type changed from mixed to array + +## [2.1.13] - 2020-10-13 +### Fixed +- Boundary detection problem fixed (#28 [@DasTobbel](https://github.com/DasTobbel)) +- Content-Type detection problem fixed (#28 [@DasTobbel](https://github.com/DasTobbel)) + +### Affected Classes +- [Structure::class](src/Structure.php) + +## [2.1.12] - 2020-10-13 +### Fixed +- If content disposition is multiline, implode the array to a simple string (#25 [@DasTobbel](https://github.com/DasTobbel)) + +### Affected Classes +- [Part::class](src/Part.php) + +## [2.1.11] - 2020-10-13 +### Fixed +- Potential problematic prefixed white-spaces removed from header attributes + +### Added +- Expended `Client::getFolder($name, $deleimiter = null)` to accept either a folder name or path ([@DasTobbel](https://github.com/DasTobbel)) +- Special MS-Exchange header decoding support added + +### Affected Classes +- [Client::class](src/Client.php) +- [Header::class](src/Header.php) + +## [2.1.10] - 2020-10-09 +### Added +- `ClientManager::make()` method added to support undefined accounts + +### Affected Classes +- [ClientManager::class](src/ClientManager.php) + +## [2.1.9] - 2020-10-08 +### Fixed +- Fix inline attachments and embedded images (#22 [@dwalczyk](https://github.com/dwalczyk)) + +### Added +- Alternative attachment names support added (#20 [@oneFoldSoftware](https://github.com/oneFoldSoftware)) +- Fetch message content without leaving a "Seen" flag behind + +### Affected Classes +- [Attachment::class](src/Attachment.php) +- [Message::class](src/Message.php) +- [Part::class](src/Part.php) +- [Query::class](src/Query/Query.php) + +## [2.1.8] - 2020-10-08 +### Fixed +- Possible error during address decoding fixed (#16 [@Slauta](https://github.com/Slauta)) +- Flag event dispatching fixed #15 + +### Added +- Support multiple boundaries (#17, #19 [@dwalczyk](https://github.com/dwalczyk)) + +### Affected Classes +- [Structure::class](src/Structure.php) + +## [2.1.7] - 2020-10-03 +### Fixed +- Fixed `Query::paginate()` (#13 #14 by [@Max13](https://github.com/Max13)) + +### Affected Classes +- [Query::class](src/Query/Query.php) + +## [2.1.6] - 2020-10-02 +### Fixed +- `Message::getAttributes()` hasn't returned all parameters + +### Affected Classes +- [Message::class](src/Message.php) + +### Added +- Part number added to attachment +- `Client::getFolderByPath()` added (#12 by [@Max13](https://github.com/Max13)) +- `Client::getFolderByName()` added (#12 by [@Max13](https://github.com/Max13)) +- Throws exceptions if the authentication fails (#11 by [@Max13](https://github.com/Max13)) + +### Affected Classes +- [Client::class](src/Client.php) + +## [2.1.5] - 2020-09-30 +### Fixed +- Wrong message content property reference fixed (#10) + +## [2.1.4] - 2020-09-30 +### Fixed +- Fix header extension values +- Part header detection method changed (#10) + +### Affected Classes +- [Header::class](src/Header.php) +- [Part::class](src/Part.php) + +## [2.1.3] - 2020-09-29 +### Fixed +- Possible decoding problem fixed +- `Str::class` dependency removed from `Header::class` + +### Affected Classes +- [Header::class](src/Header.php) + +## [2.1.2] - 2020-09-28 +### Fixed +- Dependency problem in `Attachement::getExtension()` fixed (#9) + +### Affected Classes +- [Attachment::class](src/Attachment.php) + +## [2.1.1] - 2020-09-23 +### Fixed +- Missing default config parameter added + +### Added +- Default account config fallback added + +### Affected Classes +- [Client::class](src/Client.php) + +## [2.1.0] - 2020-09-22 +### Fixed +- Quota handling fixed + +### Added +- Event system and callbacks added + +### Affected Classes +- [Client::class](src/Client.php) +- [Folder::class](src/Folder.php) +- [Message::class](src/Message.php) + +## [2.0.1] - 2020-09-20 +### Fixed +- Carbon dependency fixed + +## [2.0.0] - 2020-09-20 +### Fixed +- Missing pagination item records fixed + +### Added +- php-imap module replaced by direct socket communication +- Legacy support added +- IDLE support added +- oAuth support added +- Charset detection method updated +- Decoding fallback charsets added + +### Affected Classes +- All + +## [1.4.5] - 2019-01-23 +### Fixed +- .csv attachement is not processed +- mail part structure property comparison changed to lowercase +- Replace helper functions for Laravel 6.0 #4 (@koenhoeijmakers) +- Date handling in Folder::appendMessage() fixed +- Carbon Exception Parse Data +- Convert sender name from non-utf8 to uf8 (@hwilok) +- Convert encoding of personal data struct + +### Added +- Path prefix option added to Client::getFolder() method +- Attachment size handling added +- Find messages by custom search criteria + +### Affected Classes +- [Query::class](src/Query/WhereQuery.php) +- [Mask::class](src/Support/Masks/Mask.php) +- [Attachment::class](src/Attachment.php) +- [Client::class](src/Client.php) +- [Folder::class](src/Folder.php) +- [Message::class](src/Message.php) + +## [1.4.2.1] - 2019-07-03 +### Fixed +- Error in Attachment::__construct #3 +- Examples added + +## [1.4.2] - 2019-07-02 +### Fixed +- Pagination count total bug #213 +- Changed internal message move and copy methods #210 +- Query::since() query returning empty response #215 +- Carbon Exception Parse Data #45 +- Reading a blank body (text / html) but only from this sender #203 +- Problem with Message::moveToFolder() and multiple moves #31 +- Problem with encoding conversion #203 +- Message null value attribute problem fixed +- Client connection path handling changed to be handled inside the calling method #31 +- iconv(): error suppressor for //IGNORE added #184 +- Typo Folder attribute fullName changed to full_name +- Query scope error fixed #153 +- Replace embedded image with URL #151 +- Fix sender name in non-latin emails sent from Gmail (#155) +- Fix broken non-latin characters in body in ASCII (us-ascii) charset #156 +- Message::getMessageId() returns wrong value #197 +- Message date validation extended #45 #192 +- Removed "-i" from "iso-8859-8-i" in Message::parseBody #146 + +### Added +- Message::getFolder() method +- Create a fast count method for queries #216 +- STARTTLS encryption alias added +- Mailbox fetching exception added #201 +- Message::moveToFolder() fetches new Message::class afterwards #31 +- Message structure accessor added #182 +- Shadow Imap const class added #188 +- Connectable "NOT" queries added +- Additional where methods added +- Message attribute handling changed +- Attachment attribute handling changed +- Message flag handling updated +- Message::getHTMLBody($callback) extended +- Masks added (take look at the examples for more information on masks) +- More examples added +- Query::paginate() method added +- Imap client timeout can be modified and read #186 +- Decoder config options added #175 +- Message search criteria "NOT" added #181 +- Invalid message date exception added +- Blade examples + +### Breaking changes +- Message::moveToFolder() returns either a Message::class instance or null and not a boolean +- Folder::fullName is now Folder::full_name +- Attachment::image_src might no longer work as expected - use Attachment::getImageSrc() instead + +### Affected Classes +- [Folder::class](src/Folder.php) +- [Client::class](src/Client.php) +- [Message::class](src/Message.php) +- [Attachment::class](src/Attachment.php) +- [Query::class](src/Query/Query.php) +- [WhereQuery::class](src/Query/WhereQuery.php) + +## 0.0.3 - 2018-12-02 +### Fixed +- Folder delimiter check added #137 +- Config setting not getting loaded +- Date parsing updated + +### Affected Classes +- [Folder::class](src/IMAP/Client.php) +- [Folder::class](src/IMAP/Message.php) + +## 0.0.1 - 2018-08-13 +### Added +- new php-imap package (fork from [webklex/laravel-imap](https://github.com/Webklex/laravel-imap)) diff --git a/plugins/vendor/webklex/php-imap/CODE_OF_CONDUCT.md b/plugins/vendor/webklex/php-imap/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..2ed07c83 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at github@webklex.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/plugins/vendor/webklex/php-imap/LICENSE b/plugins/vendor/webklex/php-imap/LICENSE new file mode 100644 index 00000000..6c13191e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Webklex + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/plugins/vendor/webklex/php-imap/LICENSE.md b/plugins/vendor/webklex/php-imap/LICENSE.md new file mode 100644 index 00000000..feae5f32 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/LICENSE.md @@ -0,0 +1,21 @@ +# The MIT License (MIT) + +Copyright (c) 2016 Malte Goldenbaum + +> Permission is hereby granted, free of charge, to any person obtaining a copy +> of this software and associated documentation files (the "Software"), to deal +> in the Software without restriction, including without limitation the rights +> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +> copies of the Software, and to permit persons to whom the Software is +> furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +> all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +> THE SOFTWARE. diff --git a/plugins/vendor/webklex/php-imap/README.md b/plugins/vendor/webklex/php-imap/README.md new file mode 100755 index 00000000..da47d048 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/README.md @@ -0,0 +1,245 @@ + +# IMAP Library for PHP + +[![Latest release on Packagist][ico-release]][link-packagist] +[![Latest prerelease on Packagist][ico-prerelease]][link-packagist] +[![Software License][ico-license]][link-license] +[![Total Downloads][ico-downloads]][link-downloads] +[![Hits][ico-hits]][link-hits] +[![Discord][ico-discord]][link-discord] +[![Snyk][ico-snyk]][link-snyk] + + +## Description +PHP-IMAP is a wrapper for common IMAP communication without the need to have the php-imap module installed / enabled. +The protocol is completely integrated and therefore supports IMAP IDLE operation and the "new" oAuth authentication +process as well. +You can enable the `php-imap` module in order to handle edge cases, improve message decoding quality and is required if +you want to use legacy protocols such as pop3. + +Official documentation: [php-imap.com](https://www.php-imap.com/) + +Laravel wrapper: [webklex/laravel-imap](https://github.com/Webklex/laravel-imap) + +Discord: [discord.gg/rd4cN9h6][link-discord] + +## Table of Contents +- [Documentations](#documentations) +- [Compatibility](#compatibility) +- [Basic usage example](#basic-usage-example) +- [Sponsors](#sponsors) +- [Testing](#testing) +- [Known issues](#known-issues) +- [Support](#support) +- [Features & pull requests](#features--pull-requests) +- [Alternatives & Different Flavors](#alternatives--different-flavors) +- [Security](#security) +- [Credits](#credits) +- [License](#license) + + +## Documentations +- Legacy (< v2.0.0): [legacy documentation](https://github.com/Webklex/php-imap/tree/1.4.5) +- Core documentation: [php-imap.com](https://www.php-imap.com/) + + +## Compatibility +| Version | PHP 5.6 | PHP 7 | PHP 8 | +|:--------|:-------:|:-----:|:-----:| +| v6.x | / | / | X | +| v5.x | / | / | X | +| v4.x | / | X | X | +| v3.x | / | X | / | +| v2.x | X | X | / | +| v1.x | X | / | / | + +## Basic usage example +This is a basic example, which will echo out all Mails within all imap folders +and will move every message into INBOX.read. Please be aware that this should not be +tested in real life and is only meant to give an impression on how things work. + +```php +use Webklex\PHPIMAP\ClientManager; + +require_once "vendor/autoload.php"; + +$cm = new ClientManager('path/to/config/imap.php'); + +/** @var \Webklex\PHPIMAP\Client $client */ +$client = $cm->account('account_identifier'); + +//Connect to the IMAP Server +$client->connect(); + +//Get all Mailboxes +/** @var \Webklex\PHPIMAP\Support\FolderCollection $folders */ +$folders = $client->getFolders(); + +//Loop through every Mailbox +/** @var \Webklex\PHPIMAP\Folder $folder */ +foreach($folders as $folder){ + + //Get all Messages of the current Mailbox $folder + /** @var \Webklex\PHPIMAP\Support\MessageCollection $messages */ + $messages = $folder->messages()->all()->get(); + + /** @var \Webklex\PHPIMAP\Message $message */ + foreach($messages as $message){ + echo $message->getSubject().'
'; + echo 'Attachments: '.$message->getAttachments()->count().'
'; + echo $message->getHTMLBody(); + + //Move the current Message to 'INBOX.read' + if($message->move('INBOX.read') == true){ + echo 'Message has been moved'; + }else{ + echo 'Message could not be moved'; + } + } +} +``` + +## Sponsors +[![elb-BIT][ico-sponsor-elb-bit]][link-sponsor-elb-bit] +[![Feline][ico-sponsor-feline]][link-sponsor-feline] + + +## Testing +To run the tests, please execute the following command: +```bash +composer test +``` + +### Quick-Test / Static Test +To disable all test which require a live mailbox, please copy the `phpunit.xml.dist` to `phpunit.xml` and adjust the configuration: +```xml + + + +``` + +### Full-Test / Live Mailbox Test +To run all tests, you need to provide a valid imap configuration. + +To provide a valid imap configuration, please copy the `phpunit.xml.dist` to `phpunit.xml` and adjust the configuration: +```xml + + + + + + + + + + + +``` + +The test account should **not** contain any important data, as it will be deleted during the test. +Furthermore, the test account should be able to create new folders, move messages and should **not** be used by any other +application during the test. + +It's recommended to use a dedicated test account for this purpose. You can use the provided `Dockerfile` to create an imap server used for testing purposes. + +Build the docker image: +```bash +cd .github/docker + +docker build -t php-imap-server . +``` +Run the docker image: +```bash +docker run --name imap-server -p 993:993 --rm -d php-imap-server +``` +Stop the docker image: +```bash +docker stop imap-server +``` + + +### Known issues +| Error | Solution | +|:---------------------------------------------------------------------------|:----------------------------------------------------------------------------------------| +| Kerberos error: No credentials cache file found (try running kinit) (...) | Uncomment "DISABLE_AUTHENTICATOR" inside your config and use the `legacy-imap` protocol | + + +## Support +If you encounter any problems or if you find a bug, please don't hesitate to create a new [issue](https://github.com/Webklex/php-imap/issues). +However, please be aware that it might take some time to get an answer. +Off-topic, rude or abusive issues will be deleted without any notice. + +If you need **commercial** support, feel free to send me a mail at github@webklex.com. + + +##### A little notice +If you write source code in your issue, please consider to format it correctly. This makes it so much nicer to read +and people are more likely to comment and help :) + +```php + +echo 'your php code...'; + +``` + +will turn into: +```php +echo 'your php code...'; +``` + + +## Features & pull requests +Everyone can contribute to this project. Every pull request will be considered, but it can also happen to be declined. +To prevent unnecessary work, please consider to create a [feature issue](https://github.com/Webklex/php-imap/issues/new?template=feature_request.md) +first, if you're planning to do bigger changes. Of course, you can also create a new [feature issue](https://github.com/Webklex/php-imap/issues/new?template=feature_request.md) +if you're just wishing a feature ;) + + +## Alternatives & Different Flavors +This library and especially the code flavor It's written in, is certainly not for everyone. If you are looking for a +different approach, you might want to check out the following libraries: +- [ddeboer/imap](https://github.com/ddeboer/imap) +- [barbushin/php-imap](https://github.com/barbushin/php-imap) +- [stevebauman/php-imap](https://github.com/stevebauman/php-imap) + + +## Change log +Please see [CHANGELOG][link-changelog] for more information what has changed recently. + + +## Security +If you discover any security related issues, please email github@webklex.com instead of using the issue tracker. + + +## Credits +- [Webklex][link-author] +- [All Contributors][link-contributors] + + +## License +The MIT License (MIT). Please see [License File][link-license] for more information. + + +[ico-release]: https://img.shields.io/packagist/v/Webklex/php-imap.svg?style=flat-square&label=version +[ico-prerelease]: https://img.shields.io/github/v/release/webklex/php-imap?include_prereleases&style=flat-square&label=pre-release +[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square +[ico-downloads]: https://img.shields.io/packagist/dt/Webklex/php-imap.svg?style=flat-square +[ico-hits]: https://hits.webklex.com/svg/webklex/php-imap +[ico-snyk]: https://snyk-widget.herokuapp.com/badge/composer/webklex/php-imap/badge.svg +[ico-discord]: https://img.shields.io/static/v1?label=discord&message=open&color=5865f2&style=flat-square + +[link-packagist]: https://packagist.org/packages/Webklex/php-imap +[link-downloads]: https://packagist.org/packages/Webklex/php-imap +[link-author]: https://github.com/webklex +[link-contributors]: https://github.com/Webklex/php-imap/graphs/contributors +[link-license]: https://github.com/Webklex/php-imap/blob/master/LICENSE +[link-changelog]: https://github.com/Webklex/php-imap/blob/master/CHANGELOG.md +[link-hits]: https://hits.webklex.com +[link-snyk]: https://snyk.io/vuln/composer:webklex%2Fphp-imap +[link-discord]: https://discord.gg/vUHrbfbDr9 + + +[ico-sponsor-feline]: https://cdn.feline.dk/public/feline.png +[link-sponsor-feline]: https://www.feline.dk +[ico-sponsor-elb-bit]: https://www.elb-bit.de/user/themes/deliver/images/logo_small.png +[link-sponsor-elb-bit]: https://www.elb-bit.de?ref=webklex/php-imap \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/_config.yml b/plugins/vendor/webklex/php-imap/_config.yml new file mode 100644 index 00000000..c4192631 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/composer.json b/plugins/vendor/webklex/php-imap/composer.json new file mode 100644 index 00000000..334275fa --- /dev/null +++ b/plugins/vendor/webklex/php-imap/composer.json @@ -0,0 +1,61 @@ +{ + "name": "webklex/php-imap", + "type": "library", + "description": "PHP IMAP client", + "keywords": [ + "webklex", + "imap", + "pop3", + "php-imap", + "mail" + ], + "homepage": "https://github.com/webklex/php-imap", + "license": "MIT", + "authors": [ + { + "name": "Malte Goldenbaum", + "email": "github@webklex.com", + "role": "Developer" + } + ], + "require": { + "php": "^8.0.2", + "ext-openssl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-iconv": "*", + "ext-libxml": "*", + "ext-zip": "*", + "ext-fileinfo": "*", + "nesbot/carbon": "^2.62.1|^3.2.4", + "symfony/http-foundation": ">=2.8.0", + "illuminate/pagination": ">=5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5.10" + }, + "suggest": { + "symfony/mime": "Recomended for better extension support", + "symfony/var-dumper": "Usefull tool for debugging" + }, + "autoload": { + "psr-4": { + "Webklex\\PHPIMAP\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, + "scripts": { + "test": "phpunit" + }, + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/plugins/vendor/webklex/php-imap/examples/custom_attachment_mask.php b/plugins/vendor/webklex/php-imap/examples/custom_attachment_mask.php new file mode 100644 index 00000000..eb4973e3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/examples/custom_attachment_mask.php @@ -0,0 +1,57 @@ +id, $this->getMessage()->getUid(), $this->name]); + } + + /** + * Custom attachment saving method + * @return bool + */ + public function custom_save(): bool { + $path = "foo".DIRECTORY_SEPARATOR."bar".DIRECTORY_SEPARATOR; + $filename = $this->token(); + + return file_put_contents($path.$filename, $this->getContent()) !== false; + } + +} + +$cm = new \Webklex\PHPIMAP\ClientManager('path/to/config/imap.php'); + +/** @var \Webklex\PHPIMAP\Client $client */ +$client = $cm->account('default'); +$client->connect(); +$client->setDefaultAttachmentMask(CustomAttachmentMask::class); + +/** @var \Webklex\PHPIMAP\Folder $folder */ +$folder = $client->getFolder('INBOX'); + +/** @var \Webklex\PHPIMAP\Message $message */ +$message = $folder->query()->limit(1)->get()->first(); + +/** @var \Webklex\PHPIMAP\Attachment $attachment */ +$attachment = $message->getAttachments()->first(); + +/** @var CustomAttachmentMask $masked_attachment */ +$masked_attachment = $attachment->mask(); + +echo 'Token for uid ['.$masked_attachment->getMessage()->getUid().']: '.$masked_attachment->token(); + +$masked_attachment->custom_save(); \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/examples/custom_message_mask.php b/plugins/vendor/webklex/php-imap/examples/custom_message_mask.php new file mode 100644 index 00000000..0463c65b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/examples/custom_message_mask.php @@ -0,0 +1,51 @@ +message_id, $this->uid, $this->message_no]); + } + + /** + * Get number of message attachments + * @return integer + */ + public function getAttachmentCount(): int { + return $this->getAttachments()->count(); + } + +} + +$cm = new \Webklex\PHPIMAP\ClientManager('path/to/config/imap.php'); + +/** @var \Webklex\PHPIMAP\Client $client */ +$client = $cm->account('default'); +$client->connect(); + +/** @var \Webklex\PHPIMAP\Folder $folder */ +$folder = $client->getFolder('INBOX'); + +/** @var \Webklex\PHPIMAP\Message $message */ +$message = $folder->query()->limit(1)->get()->first(); + +/** @var CustomMessageMask $masked_message */ +$masked_message = $message->mask(CustomMessageMask::class); + +echo 'Token for uid [' . $masked_message->uid . ']: ' . $masked_message->token() . ' @atms:' . $masked_message->getAttachmentCount(); + +$masked_message->setFlag('seen'); + diff --git a/plugins/vendor/webklex/php-imap/examples/folder_structure.blade.php b/plugins/vendor/webklex/php-imap/examples/folder_structure.blade.php new file mode 100644 index 00000000..a80dfb6c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/examples/folder_structure.blade.php @@ -0,0 +1,42 @@ + + + + + + + + + + count() > 0): ?> + + + + + + + + + + + + +
FolderUnread messages
name; ?>search()->unseen()->setFetchBody(false)->count(); ?>
No folders found
+ +links(); ?> \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/examples/message_table.blade.php b/plugins/vendor/webklex/php-imap/examples/message_table.blade.php new file mode 100644 index 00000000..c3bd7af8 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/examples/message_table.blade.php @@ -0,0 +1,46 @@ + + + + + + + + + + + + count() > 0): ?> + + + + + + + + + + + + + + +
UIDSubjectFromAttachments
getUid(); ?>getSubject(); ?>getFrom()[0]->mail; ?>getAttachments()->count() > 0 ? 'yes' : 'no'; ?>
No messages found
+ +links(); ?> \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/phpunit.xml.dist b/plugins/vendor/webklex/php-imap/phpunit.xml.dist new file mode 100644 index 00000000..02d56a89 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/phpunit.xml.dist @@ -0,0 +1,35 @@ + + + + + src/ + + + + + + + + + + tests + tests/fixtures + tests/issues + tests/live + + + + + + + + + + + + + + + + + diff --git a/plugins/vendor/webklex/php-imap/src/Address.php b/plugins/vendor/webklex/php-imap/src/Address.php new file mode 100644 index 00000000..87c6479e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Address.php @@ -0,0 +1,108 @@ +personal = $object->personal ?? ''; } + if (property_exists($object, "mailbox")){ $this->mailbox = $object->mailbox ?? ''; } + if (property_exists($object, "host")){ $this->host = $object->host ?? ''; } + if (property_exists($object, "mail")){ $this->mail = $object->mail ?? ''; } + if (property_exists($object, "full")){ $this->full = $object->full ?? ''; } + $this->boot(); + } + + /** + * Boot the address + */ + private function boot(): void { + if($this->mail === "" && $this->mailbox !== "" && $this->host !== ""){ + $this->mail = $this->mailbox . "@" . $this->host; + }elseif($this->mail === "" && $this->mailbox !== ""){ + $this->mail = $this->mailbox; + } + + if($this->full === "" && $this->mail !== "" && $this->personal !== ""){ + $this->full = $this->personal . " <" . $this->mail . ">"; + }elseif($this->full === "" && $this->mail !== ""){ + $this->full = $this->mail; + } + } + + + /** + * Return the stringified address + * + * @return string + */ + public function __toString() { + return $this->full ?: ""; + } + + /** + * Return the serialized address + * + * @return array + */ + public function __serialize(){ + return [ + "personal" => $this->personal, + "mailbox" => $this->mailbox, + "host" => $this->host, + "mail" => $this->mail, + "full" => $this->full, + ]; + } + + /** + * Convert instance to array + * + * @return array + */ + public function toArray(): array { + return $this->__serialize(); + } + + /** + * Return the stringified attribute + * + * @return string + */ + public function toString(): string { + return $this->__toString(); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Attachment.php b/plugins/vendor/webklex/php-imap/src/Attachment.php new file mode 100755 index 00000000..e2ce8128 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Attachment.php @@ -0,0 +1,515 @@ + null, + 'hash' => null, + 'type' => null, + 'part_number' => 0, + 'content_type' => null, + 'id' => null, + 'name' => null, + 'filename' => null, + 'description' => null, + 'disposition' => null, + 'img_src' => null, + 'size' => null, + ]; + + /** + * Default mask + * + * @var string $mask + */ + protected string $mask = AttachmentMask::class; + + /** + * Attachment constructor. + * @param Message $message + * @param Part $part + * @throws DecoderNotFoundException + */ + public function __construct(Message $message, Part $part) { + $this->message = $message; + $this->config = $this->message->getConfig(); + $this->options = $this->config->get('options'); + $this->decoder = $this->config->getDecoder("attachment"); + + $this->part = $part; + $this->part_number = $part->part_number; + + if ($this->message->getClient()) { + $default_mask = $this->message->getClient()?->getDefaultAttachmentMask(); + if ($default_mask != null) { + $this->mask = $default_mask; + } + } else { + $default_mask = $this->config->getMask("attachment"); + if ($default_mask != "") { + $this->mask = $default_mask; + } + } + + $this->findType(); + $this->fetch(); + } + + /** + * Call dynamic attribute setter and getter methods + * @param string $method + * @param array $arguments + * + * @return mixed + * @throws MethodNotFoundException + */ + public function __call(string $method, array $arguments) { + if (strtolower(substr($method, 0, 3)) === 'get') { + $name = Str::snake(substr($method, 3)); + + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + return null; + } elseif (strtolower(substr($method, 0, 3)) === 'set') { + $name = Str::snake(substr($method, 3)); + + $this->attributes[$name] = array_pop($arguments); + + return $this->attributes[$name]; + } + + throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported'); + } + + /** + * Magic setter + * @param $name + * @param $value + * + * @return mixed + */ + public function __set($name, $value) { + $this->attributes[$name] = $value; + + return $this->attributes[$name]; + } + + /** + * magic getter + * @param $name + * + * @return mixed|null + */ + public function __get($name) { + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + return null; + } + + /** + * Determine the structure type + */ + protected function findType(): void { + $this->type = match ($this->part->type) { + IMAP::ATTACHMENT_TYPE_MESSAGE => 'message', + IMAP::ATTACHMENT_TYPE_APPLICATION => 'application', + IMAP::ATTACHMENT_TYPE_AUDIO => 'audio', + IMAP::ATTACHMENT_TYPE_IMAGE => 'image', + IMAP::ATTACHMENT_TYPE_VIDEO => 'video', + IMAP::ATTACHMENT_TYPE_MODEL => 'model', + IMAP::ATTACHMENT_TYPE_TEXT => 'text', + IMAP::ATTACHMENT_TYPE_MULTIPART => 'multipart', + default => 'other', + }; + } + + /** + * Fetch the given attachment + */ + protected function fetch(): void { + $content = $this->part->content; + + $this->content_type = $this->part->content_type; + $this->content = $this->decoder->decode($content, $this->part->encoding); + + // Create a hash of the raw part - this can be used to identify the attachment in the message context. However, + // it is not guaranteed to be unique and collisions are possible. + // Some additional online resources: + // - https://en.wikipedia.org/wiki/Hash_collision + // - https://www.php.net/manual/en/function.hash.php + // - https://php.watch/articles/php-hash-benchmark + // Benchmark speeds: + // -xxh3 ~15.19(GB/s) (requires php-xxhash extension or >= php8.1) + // -crc32c ~14.12(GB/s) + // -sha256 ~0.25(GB/s) + // xxh3 would be nice to use, because of its extra speed and 32 instead of 8 bytes, but it is not compatible with + // php < 8.1. crc32c is the next fastest and is compatible with php >= 5.1. sha256 is the slowest, but is compatible + // with php >= 5.1 and is the most likely to be unique. crc32c is the best compromise between speed and uniqueness. + // Unique enough for our purposes, but not so slow that it could be a bottleneck. + $this->hash = hash("crc32c", $this->part->getHeader()->raw."\r\n\r\n".$this->part->content); + + if (($id = $this->part->id) !== null) { + $this->id = str_replace(['<', '>'], '', $id); + }else { + $this->id = $this->hash; + } + + $this->size = $this->part->bytes; + $this->disposition = $this->part->disposition; + + if (($filename = $this->part->filename) !== null) { + $this->filename = $this->decodeName($filename); + } + + if (($description = $this->part->description) !== null) { + $this->description = $this->part->getHeader()->getDecoder()->decode($description); + } + + if (($name = $this->part->name) !== null) { + $this->name = $this->decodeName($name); + } + + if (IMAP::ATTACHMENT_TYPE_MESSAGE == $this->part->type) { + if ($this->part->ifdescription) { + if (!$this->name) { + $this->name = $this->part->description; + } + } else if (!$this->name) { + $this->name = $this->part->subtype; + } + } + $this->attributes = array_merge($this->part->getHeader()->getAttributes(), $this->attributes); + + if (!$this->filename) { + $this->filename = $this->hash; + } + + if (!$this->name && $this->filename != "") { + $this->name = $this->filename; + } + } + + /** + * Save the attachment content to your filesystem + * @param string $path + * @param string|null $filename + * + * @return boolean + */ + public function save(string $path, ?string $filename = null): bool { + $filename = $filename ? $this->decodeName($filename) : $this->filename; + + return file_put_contents($path . DIRECTORY_SEPARATOR . $filename, $this->getContent()) !== false; + } + + /** + * Decode a given name + * @param string|null $name + * + * @return string + */ + public function decodeName(?string $name): string { + if ($name !== null) { + if (str_contains($name, "''")) { + $parts = explode("''", $name); + if (EncodingAliases::has($parts[0])) { + $encoding = $parts[0]; + $name = implode("''", array_slice($parts, 1)); + } + } + + $decoder = $this->decoder->getOptions()['message']; + if (preg_match('/=\?([^?]+)\?(Q|B)\?(.+)\?=/i', $name, $matches)) { + $name = $this->part->getHeader()->getDecoder()->decode($name); + } elseif ($decoder === 'utf-8' && extension_loaded('imap')) { + $name = \imap_utf8($name); + } + + // check if $name is url encoded + if (preg_match('/%[0-9A-F]{2}/i', $name)) { + $name = urldecode($name); + } + + if (isset($encoding)) { + $name = EncodingAliases::convert($name, $encoding); + } + + if($this->config->get('security.sanitize_filenames', true)) { + $name = $this->sanitizeName($name); + } + + return $name; + } + return ""; + } + + /** + * Get the attachment mime type + * + * @return string|null + */ + public function getMimeType(): ?string { + return (new \finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE); + } + + /** + * Try to guess the attachment file extension + * + * @return string|null + */ + public function getExtension(): ?string { + $extension = null; + $guesser = "\Symfony\Component\Mime\MimeTypes"; + if (class_exists($guesser) !== false) { + /** @var Symfony\Component\Mime\MimeTypes $guesser */ + $extensions = $guesser::getDefault()->getExtensions($this->getMimeType()); + $extension = $extensions[0] ?? null; + } + if ($extension === null) { + $deprecated_guesser = "\Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser"; + if (class_exists($deprecated_guesser) !== false) { + /** @var \Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser $deprecated_guesser */ + $extension = $deprecated_guesser::getInstance()->guess($this->getMimeType()); + } + } + if ($extension === null) { + $parts = explode(".", $this->filename); + $extension = count($parts) > 1 ? end($parts) : null; + } + if ($extension === null) { + $parts = explode(".", $this->name); + $extension = count($parts) > 1 ? end($parts) : null; + } + return $extension; + } + + /** + * Get all attributes + * + * @return array + */ + public function getAttributes(): array { + return $this->attributes; + } + + /** + * @return Message + */ + public function getMessage(): Message { + return $this->message; + } + + /** + * Set the default mask + * @param $mask + * + * @return $this + */ + public function setMask($mask): Attachment { + if (class_exists($mask)) { + $this->mask = $mask; + } + + return $this; + } + + /** + * Get the used default mask + * + * @return string + */ + public function getMask(): string { + return $this->mask; + } + + /** + * Get the attachment options + * @return array + */ + public function getOptions(): array { + return $this->options; + } + + /** + * Set the attachment options + * @param array $options + * + * @return $this + */ + public function setOptions(array $options): Attachment { + $this->options = $options; + return $this; + } + + /** + * Get the used config + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } + + /** + * Set the used config + * @param Config $config + * + * @return $this + */ + public function setConfig(Config $config): Attachment { + $this->config = $config; + return $this; + } + + /** + * Get a masked instance by providing a mask name + * @param string|null $mask + * + * @return mixed + * @throws MaskNotFoundException + */ + public function mask(?string $mask = null): mixed { + $mask = $mask !== null ? $mask : $this->mask; + if (class_exists($mask)) { + return new $mask($this); + } + + throw new MaskNotFoundException("Unknown mask provided: " . $mask); + } + + /** + * Get the decoder instance + * + * @return DecoderInterface + */ + public function getDecoder(): DecoderInterface { + return $this->decoder; + } + + /** + * Set the decoder instance + * @param DecoderInterface $decoder + * + * @return $this + */ + public function setDecoder(DecoderInterface $decoder): static { + $this->decoder = $decoder; + return $this; + } + + /** + * Sanitize a given name to prevent common attacks + * !!IMPORTANT!! Do not rely on this method alone - this is just the bare minimum. Additional measures should be taken + * to ensure that the file is safe to use. + * @param string $name + * + * @return string + */ + private function sanitizeName(string $name): string { + $replaces = [ + '/\\\\/' => '', + '/[\/\0:]+/' => '', + '/\.+/' => '.', + ]; + $name_starts_with_dots = str_starts_with($name, '..'); + $name = preg_replace(array_keys($replaces), array_values($replaces), $name); + if($name_starts_with_dots) { + return substr($name, 1); + } + return $name; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Attribute.php b/plugins/vendor/webklex/php-imap/src/Attribute.php new file mode 100644 index 00000000..c50cab75 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Attribute.php @@ -0,0 +1,325 @@ +setName($name); + $this->add($value); + } + + /** + * Handle class invocation calls + * + * @return array|string + */ + public function __invoke(): array|string { + if ($this->count() > 1) { + return $this->toArray(); + } + return $this->toString(); + } + + /** + * Return the serialized address + * + * @return array + */ + public function __serialize(){ + return $this->values; + } + + /** + * Return the stringified attribute + * + * @return string + */ + public function __toString() { + return implode(", ", $this->values); + } + + /** + * Return the stringified attribute + * + * @return string + */ + public function toString(): string { + return $this->__toString(); + } + + /** + * Convert instance to array + * + * @return array + */ + public function toArray(): array { + return $this->__serialize(); + } + + /** + * Convert first value to a date object + * + * @return Carbon + */ + public function toDate(): Carbon { + $date = $this->first(); + if ($date instanceof Carbon) return $date; + + return Carbon::parse($date); + } + + /** + * Determine if a value exists at a given key. + * + * @param int|string $key + * @return bool + */ + public function has(mixed $key = 0): bool { + return array_key_exists($key, $this->values); + } + + /** + * Determine if a value exists at a given key. + * + * @param int|string $key + * @return bool + */ + public function exist(mixed $key = 0): bool { + return $this->has($key); + } + + /** + * Check if the attribute contains the given value + * @param mixed $value + * + * @return bool + */ + public function contains(mixed $value): bool { + return in_array($value, $this->values, true); + } + + /** + * Get a value by a given key. + * + * @param int|string $key + * @return mixed + */ + public function get(int|string $key = 0): mixed { + return $this->values[$key] ?? null; + } + + /** + * Set the value by a given key. + * + * @param mixed $key + * @param mixed $value + * @return Attribute + */ + public function set(mixed $value, mixed $key = 0): Attribute { + if (is_null($key)) { + $this->values[] = $value; + } else { + $this->values[$key] = $value; + } + return $this; + } + + /** + * Unset a value by a given key. + * + * @param int|string $key + * @return Attribute + */ + public function remove(int|string $key = 0): Attribute { + if (isset($this->values[$key])) { + unset($this->values[$key]); + } + return $this; + } + + /** + * Add one or more values to the attribute + * @param array|mixed $value + * @param boolean $strict + * + * @return Attribute + */ + public function add(mixed $value, bool $strict = false): Attribute { + if (is_array($value)) { + return $this->merge($value, $strict); + }elseif ($value !== null) { + $this->attach($value, $strict); + } + + return $this; + } + + /** + * Merge a given array of values with the current values array + * @param array $values + * @param boolean $strict + * + * @return Attribute + */ + public function merge(array $values, bool $strict = false): Attribute { + foreach ($values as $value) { + $this->attach($value, $strict); + } + + return $this; + } + + /** + * Attach a given value to the current value array + * @param $value + * @param bool $strict + * @return Attribute + */ + public function attach($value, bool $strict = false): Attribute { + if ($strict === true) { + if ($this->contains($value) === false) { + $this->values[] = $value; + } + }else{ + $this->values[] = $value; + } + return $this; + } + + /** + * Set the attribute name + * @param $name + * + * @return Attribute + */ + public function setName($name): Attribute { + $this->name = $name; + + return $this; + } + + /** + * Get the attribute name + * + * @return string + */ + public function getName(): string { + return $this->name; + } + + /** + * Get all values + * + * @return array + */ + public function all(): array { + reset($this->values); + return $this->values; + } + + /** + * Get the first value if possible + * + * @return mixed|null + */ + public function first(): mixed { + return reset($this->values); + } + + /** + * Get the last value if possible + * + * @return mixed|null + */ + public function last(): mixed { + return end($this->values); + } + + /** + * Get the number of values + * + * @return int + */ + public function count(): int { + return count($this->values); + } + + /** + * @see ArrayAccess::offsetExists + * @param mixed $offset + * @return bool + */ + public function offsetExists(mixed $offset): bool { + return $this->has($offset); + } + + /** + * @see ArrayAccess::offsetGet + * @param mixed $offset + * @return mixed + */ + public function offsetGet(mixed $offset): mixed { + return $this->get($offset); + } + + /** + * @see ArrayAccess::offsetSet + * @param mixed $offset + * @param mixed $value + * @return void + */ + public function offsetSet(mixed $offset, mixed $value): void { + $this->set($value, $offset); + } + + /** + * @see ArrayAccess::offsetUnset + * @param mixed $offset + * @return void + */ + public function offsetUnset(mixed $offset): void { + $this->remove($offset); + } + + /** + * @param callable $callback + * @return array + */ + public function map(callable $callback): array { + return array_map($callback, $this->values); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Client.php b/plugins/vendor/webklex/php-imap/src/Client.php new file mode 100755 index 00000000..5eb26ff2 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Client.php @@ -0,0 +1,969 @@ + null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ]; + + + /** + * SSL stream context options + * + * @see https://www.php.net/manual/en/context.ssl.php for possible options + * + * @var array + */ + protected array $ssl_options = []; + + /** + * Connection timeout + * @var int $timeout + */ + public int $timeout; + + /** + * Account username + * + * @var string + */ + public string $username; + + /** + * Account password. + * + * @var string + */ + public string $password; + + /** + * Additional data fetched from the server. + * + * @var array + */ + public array $extensions; + + /** + * Account rfc. + * + * @var string + */ + public string $rfc; + + /** + * Account authentication method. + * + * @var ?string + */ + public ?string $authentication; + + /** + * Active folder path. + * + * @var ?string + */ + protected ?string $active_folder = null; + + /** + * Default message mask + * + * @var string $default_message_mask + */ + protected string $default_message_mask = MessageMask::class; + + /** + * Default attachment mask + * + * @var string $default_attachment_mask + */ + protected string $default_attachment_mask = AttachmentMask::class; + + /** + * Used default account values + * + * @var array $default_account_config + */ + protected array $default_account_config = [ + 'host' => 'localhost', + 'port' => 993, + 'protocol' => 'imap', + 'encryption' => 'ssl', + 'validate_cert' => true, + 'username' => '', + 'password' => '', + 'rfc' => 'RFC822', + 'authentication' => null, + "extensions" => [], + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + 'ssl_options' => [], + "timeout" => 30, + ]; + + /** + * Client constructor. + * @param Config $config + * + * @throws MaskNotFoundException + */ + public function __construct(Config $config) { + $this->setConfig($config); + $this->setMaskFromConfig(); + $this->setEventsFromConfig(); + } + + /** + * Client destructor + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function __destruct() { + $this->disconnect(); + } + + /** + * Clone the current Client instance + * + * @return Client + * @throws MaskNotFoundException + */ + public function clone(): Client { + $client = new self($this->config); + $client->events = $this->events; + $client->timeout = $this->timeout; + $client->active_folder = $this->active_folder; + $client->default_account_config = $this->default_account_config; + $config = $this->getAccountConfig(); + foreach($config as $key => $value) { + $client->setAccountConfig($key, $config); + } + $client->default_message_mask = $this->default_message_mask; + $client->default_attachment_mask = $this->default_message_mask; + return $client; + } + + /** + * Set the Client configuration + * @param Config $config + * + * @return self + */ + public function setConfig(Config $config): Client { + $this->config = $config; + $default_account = $this->config->get('default'); + $default_config = $this->config->get("accounts.$default_account"); + + foreach ($this->default_account_config as $key => $value) { + $this->setAccountConfig($key, $default_config); + } + + return $this; + } + + /** + * Get the current config + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } + + /** + * Set a specific account config + * @param string $key + * @param array $default_config + */ + private function setAccountConfig(string $key, array $default_config): void { + $value = $this->default_account_config[$key]; + if(isset($default_config[$key])) { + $value = $default_config[$key]; + } + $this->$key = $value; + } + + /** + * Get the current account config + * + * @return array + */ + public function getAccountConfig(): array { + $config = []; + foreach($this->default_account_config as $key => $value) { + if(property_exists($this, $key)) { + $config[$key] = $this->$key; + } + } + return $config; + } + + /** + * Look for a possible events in any available config + */ + protected function setEventsFromConfig(): void { + $this->events = $this->config->get("events"); + if(isset($config['events'])){ + foreach($config['events'] as $section => $events) { + $this->events[$section] = array_merge($this->events[$section], $events); + } + } + } + + /** + * Look for a possible mask in any available config + * + * @throws MaskNotFoundException + */ + protected function setMaskFromConfig(): void { + $masks = $this->config->get("masks"); + + if(isset($masks)){ + if(isset($masks['message'])) { + if(class_exists($masks['message'])) { + $this->default_message_mask = $masks['message']; + }else{ + throw new MaskNotFoundException("Unknown mask provided: ".$masks['message']); + } + }else{ + $default_mask = $this->config->getMask("message"); + if($default_mask != ""){ + $this->default_message_mask = $default_mask; + }else{ + throw new MaskNotFoundException("Unknown message mask provided"); + } + } + if(isset($masks['attachment'])) { + if(class_exists($masks['attachment'])) { + $this->default_attachment_mask = $masks['attachment']; + }else{ + throw new MaskNotFoundException("Unknown mask provided: ". $masks['attachment']); + } + }else{ + $default_mask = $this->config->getMask("attachment"); + if($default_mask != ""){ + $this->default_attachment_mask = $default_mask; + }else{ + throw new MaskNotFoundException("Unknown attachment mask provided"); + } + } + }else{ + $default_mask = $this->config->getMask("message"); + if($default_mask != ""){ + $this->default_message_mask = $default_mask; + }else{ + throw new MaskNotFoundException("Unknown message mask provided"); + } + + $default_mask = $this->config->getMask("attachment"); + if($default_mask != ""){ + $this->default_attachment_mask = $default_mask; + }else{ + throw new MaskNotFoundException("Unknown attachment mask provided"); + } + } + } + + /** + * Get the current imap resource + * + * @return ProtocolInterface + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getConnection(): ProtocolInterface { + $this->checkConnection(); + return $this->connection; + } + + /** + * Determine if connection was established. + * + * @return bool + */ + public function isConnected(): bool { + return $this->connection && $this->connection->connected(); + } + + /** + * Determine if connection was established and connect if not. + * Returns true if the connection was closed and has been reopened. + * + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function checkConnection(): bool { + try { + if (!$this->isConnected()) { + $this->connect(); + return true; + } + } catch (\Throwable) { + $this->connect(); + } + return false; + } + + /** + * Force the connection to reconnect + * + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function reconnect(): void { + if ($this->isConnected()) { + $this->disconnect(); + } + $this->connect(); + } + + /** + * Connect to server. + * + * @return $this + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function connect(): Client { + $this->disconnect(); + $protocol = strtolower($this->protocol); + + if (in_array($protocol, ['imap', 'imap4', 'imap4rev1'])) { + $this->connection = new ImapProtocol($this->config, $this->validate_cert, $this->encryption); + $this->connection->setConnectionTimeout($this->timeout); + $this->connection->setProxy($this->proxy); + $this->connection->setSslOptions($this->ssl_options); + }else{ + if (extension_loaded('imap') === false) { + throw new ConnectionFailedException("connection setup failed", 0, new ProtocolNotSupportedException($protocol." is an unsupported protocol")); + } + $this->connection = new LegacyProtocol($this->config, $this->validate_cert, $this->encryption); + if (str_starts_with($protocol, "legacy-")) { + $protocol = substr($protocol, 7); + } + $this->connection->setProtocol($protocol); + } + + if ($this->config->get('options.debug')) { + $this->connection->enableDebug(); + } + + if (!$this->config->get('options.uid_cache')) { + $this->connection->disableUidCache(); + } + + try { + $this->connection->connect($this->host, $this->port); + } catch (ErrorException|RuntimeException $e) { + throw new ConnectionFailedException("connection setup failed", 0, $e); + } + $this->authenticate(); + + return $this; + } + + /** + * Authenticate the current session + * + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + protected function authenticate(): void { + if ($this->authentication == "oauth") { + if (!$this->connection->authenticate($this->username, $this->password)->validatedData()) { + throw new AuthFailedException(); + } + } elseif (!$this->connection->login($this->username, $this->password)->validatedData()) { + throw new AuthFailedException(); + } + } + + /** + * Disconnect from server. + * + * @return $this + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function disconnect(): Client { + if ($this->isConnected()) { + $this->connection->logout(); + } + $this->active_folder = null; + + return $this; + } + + /** + * Get a folder instance by a folder name + * @param string $folder_name + * @param string|null $delimiter + * @param bool $utf7 + * @return Folder|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function getFolder(string $folder_name, ?string $delimiter = null, bool $utf7 = false): ?Folder { + // Set delimiter to false to force selection via getFolderByName (maybe useful for uncommon folder names) + $delimiter = is_null($delimiter) ? $this->config->get('options.delimiter', "/") : $delimiter; + + if (str_contains($folder_name, (string)$delimiter)) { + return $this->getFolderByPath($folder_name, $utf7); + } + + return $this->getFolderByName($folder_name); + } + + /** + * Get a folder instance by a folder name + * @param $folder_name + * @param bool $soft_fail If true, it will return null instead of throwing an exception + * + * @return Folder|null + * @throws FolderFetchingException + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getFolderByName($folder_name, bool $soft_fail = false): ?Folder { + return $this->getFolders(false, null, $soft_fail)->where("name", $folder_name)->first(); + } + + /** + * Get a folder instance by a folder path + * @param $folder_path + * @param bool $utf7 + * @param bool $soft_fail If true, it will return null instead of throwing an exception + * + * @return Folder|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function getFolderByPath($folder_path, bool $utf7 = false, bool $soft_fail = false): ?Folder { + if (!$utf7) $folder_path = EncodingAliases::convert($folder_path, "utf-8", "utf7-imap"); + return $this->getFolders(false, null, $soft_fail)->where("path", $folder_path)->first(); + } + + /** + * Get folders list. + * If hierarchical order is set to true, it will make a tree of folders, otherwise it will return flat array. + * + * @param boolean $hierarchical + * @param string|null $parent_folder + * @param bool $soft_fail If true, it will return an empty collection instead of throwing an exception + * + * @return FolderCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function getFolders(bool $hierarchical = true, ?string $parent_folder = null, bool $soft_fail = false): FolderCollection { + $this->checkConnection(); + $folders = FolderCollection::make([]); + + $pattern = $parent_folder.($hierarchical ? '%' : '*'); + $items = $this->connection->folders('', $pattern)->validatedData(); + + if(!empty($items)){ + foreach ($items as $folder_name => $item) { + $folder = new Folder($this, $folder_name, $item["delimiter"], $item["flags"]); + + if ($hierarchical && $folder->hasChildren()) { + $pattern = $folder->path.$folder->delimiter.'%'; + + $children = $this->getFolders(true, $pattern, true); + $folder->setChildren($children); + } + + $folders->push($folder); + } + + return $folders; + }else if (!$soft_fail){ + throw new FolderFetchingException("failed to fetch any folders"); + } + + return $folders; + } + + /** + * Get folders list. + * If hierarchical order is set to true, it will make a tree of folders, otherwise it will return flat array. + * + * @param boolean $hierarchical + * @param string|null $parent_folder + * @param bool $soft_fail If true, it will return an empty collection instead of throwing an exception + * + * @return FolderCollection + * @throws FolderFetchingException + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getFoldersWithStatus(bool $hierarchical = true, ?string $parent_folder = null, bool $soft_fail = false): FolderCollection { + $this->checkConnection(); + $folders = FolderCollection::make([]); + + $pattern = $parent_folder.($hierarchical ? '%' : '*'); + $items = $this->connection->folders('', $pattern)->validatedData(); + + if(!empty($items)){ + foreach ($items as $folder_name => $item) { + $folder = new Folder($this, $folder_name, $item["delimiter"], $item["flags"]); + + if ($hierarchical && $folder->hasChildren()) { + $pattern = $folder->path.$folder->delimiter.'%'; + + $children = $this->getFoldersWithStatus(true, $pattern, true); + $folder->setChildren($children); + } + + $folder->loadStatus(); + $folders->push($folder); + } + + return $folders; + }else if (!$soft_fail){ + throw new FolderFetchingException("failed to fetch any folders"); + } + + return $folders; + } + + /** + * Open a given folder. + * @param string $folder_path + * @param boolean $force_select + * + * @return array + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function openFolder(string $folder_path, bool $force_select = false): array { + if ($this->active_folder == $folder_path && $this->isConnected() && $force_select === false) { + return []; + } + $this->checkConnection(); + $this->active_folder = $folder_path; + return $this->connection->selectFolder($folder_path)->validatedData(); + } + + /** + * Set active folder + * @param string|null $folder_path + * + * @return void + */ + public function setActiveFolder(?string $folder_path = null): void { + $this->active_folder = $folder_path; + } + + /** + * Get active folder + * + * @return string|null + */ + public function getActiveFolder(): ?string { + return $this->active_folder; + } + + /** + * Create a new Folder + * @param string $folder_path + * @param boolean $expunge + * @param bool $utf7 + * @return Folder + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function createFolder(string $folder_path, bool $expunge = true, bool $utf7 = false): Folder { + $this->checkConnection(); + + if (!$utf7) $folder_path = EncodingAliases::convert($folder_path, "utf-8", "UTF7-IMAP"); + + $status = $this->connection->createFolder($folder_path)->validatedData(); + + if($expunge) $this->expunge(); + + $folder = $this->getFolderByPath($folder_path, true); + if($status && $folder) { + $this->dispatch("folder", "new", $folder); + } + + return $folder; + } + + /** + * Delete a given folder + * @param string $folder_path + * @param boolean $expunge + * + * @return array + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function deleteFolder(string $folder_path, bool $expunge = true): array { + $this->checkConnection(); + + $folder = $this->getFolderByPath($folder_path); + if ($this->active_folder == $folder->path){ + $this->active_folder = null; + } + $status = $this->getConnection()->deleteFolder($folder->path)->validatedData(); + if ($expunge) $this->expunge(); + + $this->dispatch("folder", "deleted", $folder); + + return $status; + } + + /** + * Check a given folder + * @param string $folder_path + * + * @return array + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function checkFolder(string $folder_path): array { + $this->checkConnection(); + return $this->connection->examineFolder($folder_path)->validatedData(); + } + + /** + * Get the current active folder + * + * @return null|string + */ + public function getFolderPath(): ?string { + return $this->active_folder; + } + + /** + * Exchange identification information + * Ref.: https://datatracker.ietf.org/doc/html/rfc2971 + * + * @param array|null $ids + * @return array + * + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function Id(?array $ids = null): array { + $this->checkConnection(); + return $this->connection->ID($ids)->validatedData(); + } + + /** + * Retrieve the quota level settings, and usage statics per mailbox + * + * @return array + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getQuota(): array { + $this->checkConnection(); + return $this->connection->getQuota($this->username)->validatedData(); + } + + /** + * Retrieve the quota settings per user + * @param string $quota_root + * + * @return array + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getQuotaRoot(string $quota_root = 'INBOX'): array { + $this->checkConnection(); + return $this->connection->getQuotaRoot($quota_root)->validatedData(); + } + + /** + * Delete all messages marked for deletion + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function expunge(): array { + $this->checkConnection(); + return $this->connection->expunge()->validatedData(); + } + + /** + * Set the connection timeout + * @param integer $timeout + * + * @return ProtocolInterface + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function setTimeout(int $timeout): ProtocolInterface { + $this->timeout = $timeout; + if ($this->isConnected()) { + $this->connection->setConnectionTimeout($timeout); + $this->reconnect(); + } + return $this->connection; + } + + /** + * Get the connection timeout + * + * @return int + * @throws ConnectionFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getTimeout(): int { + $this->checkConnection(); + return $this->connection->getConnectionTimeout(); + } + + /** + * Get the default message mask + * + * @return string + */ + public function getDefaultMessageMask(): string { + return $this->default_message_mask; + } + + /** + * Get the default events for a given section + * @param $section + * + * @return array + */ + public function getDefaultEvents($section): array { + if (isset($this->events[$section])) { + return is_array($this->events[$section]) ? $this->events[$section] : []; + } + return []; + } + + /** + * Set the default message mask + * @param string $mask + * + * @return $this + * @throws MaskNotFoundException + */ + public function setDefaultMessageMask(string $mask): Client { + if(class_exists($mask)) { + $this->default_message_mask = $mask; + + return $this; + } + + throw new MaskNotFoundException("Unknown mask provided: ".$mask); + } + + /** + * Get the default attachment mask + * + * @return string + */ + public function getDefaultAttachmentMask(): string { + return $this->default_attachment_mask; + } + + /** + * Set the default attachment mask + * @param string $mask + * + * @return $this + * @throws MaskNotFoundException + */ + public function setDefaultAttachmentMask(string $mask): Client { + if(class_exists($mask)) { + $this->default_attachment_mask = $mask; + + return $this; + } + + throw new MaskNotFoundException("Unknown mask provided: ".$mask); + } +} diff --git a/plugins/vendor/webklex/php-imap/src/ClientManager.php b/plugins/vendor/webklex/php-imap/src/ClientManager.php new file mode 100644 index 00000000..6f66886b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/ClientManager.php @@ -0,0 +1,131 @@ +setConfig($config); + } + + /** + * Dynamically pass calls to the default account. + * @param string $method + * @param array $parameters + * + * @return mixed + * @throws Exceptions\MaskNotFoundException + */ + public function __call(string $method, array $parameters) { + $callable = [$this->account(), $method]; + + return call_user_func_array($callable, $parameters); + } + + /** + * Safely create a new client instance which is not listed in accounts + * @param array $config + * + * @return Client + * @throws Exceptions\MaskNotFoundException + */ + public function make(array $config): Client { + $name = $this->config->getDefaultAccount(); + $clientConfig = $this->config->all(); + $clientConfig["accounts"] = [$name => $config]; + return new Client(Config::make($clientConfig)); + } + + /** + * Resolve a account instance. + * @param string|null $name + * + * @return Client + * @throws Exceptions\MaskNotFoundException + */ + public function account(?string $name = null): Client { + $name = $name ?: $this->config->getDefaultAccount(); + + // If the connection has not been resolved we will resolve it now as all + // the connections are resolved when they are actually needed, so we do + // not make any unnecessary connection to the various queue end-points. + if (!isset($this->accounts[$name])) { + $this->accounts[$name] = $this->resolve($name); + } + + return $this->accounts[$name]; + } + + /** + * Resolve an account. + * @param string $name + * + * @return Client + * @throws Exceptions\MaskNotFoundException + */ + protected function resolve(string $name): Client { + $config = $this->config->getClientConfig($name); + + return new Client($config); + } + + + /** + * Merge the vendor settings with the local config + * + * The default account identifier will be used as default for any missing account parameters. + * If however the default account is missing a parameter the package default account parameter will be used. + * This can be disabled by setting imap.default in your config file to 'false' + * + * @param array|string|Config $config + * + * @return $this + */ + public function setConfig(array|string|Config $config): ClientManager { + if (!$config instanceof Config) { + $config = Config::make($config); + } + $this->config = $config; + + return $this; + } + + /** + * Get the config instance + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Config.php b/plugins/vendor/webklex/php-imap/src/Config.php new file mode 100644 index 00000000..f2f1a174 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Config.php @@ -0,0 +1,295 @@ +config = $config; + } + + /** + * Get a dotted config parameter + * @param string $key + * @param null $default + * + * @return mixed|null + */ + public function get(string $key, $default = null): mixed { + $parts = explode('.', $key); + $value = null; + foreach ($parts as $part) { + if ($value === null) { + if (isset($this->config[$part])) { + $value = $this->config[$part]; + } else { + break; + } + } else { + if (isset($value[$part])) { + $value = $value[$part]; + } else { + break; + } + } + } + + return $value === null ? $default : $value; + } + + /** + * Set a dotted config parameter + * @param string $key + * @param string|array|mixed$value + * + * @return void + */ + public function set(string $key, mixed $value): void { + $parts = explode('.', $key); + $config = &$this->config; + + foreach ($parts as $part) { + if (!isset($config[$part])) { + $config[$part] = []; + } + $config = &$config[$part]; + } + + if(is_array($config) && is_array($value)){ + $config = array_merge($config, $value); + }else{ + $config = $value; + } + } + + /** + * Get the decoder for a given name + * @param $name string Decoder name + * + * @return DecoderInterface + * @throws DecoderNotFoundException + */ + public function getDecoder(string $name): DecoderInterface { + $default_decoders = $this->get('decoding.decoder', [ + 'header' => \Webklex\PHPIMAP\Decoder\HeaderDecoder::class, + 'message' => \Webklex\PHPIMAP\Decoder\MessageDecoder::class, + 'attachment' => \Webklex\PHPIMAP\Decoder\AttachmentDecoder::class + ]); + $options = $this->get('decoding.options', [ + 'header' => 'utf-8', + 'message' => 'utf-8', + 'attachment' => 'utf-8', + ]); + if (isset($default_decoders[$name])) { + if (class_exists($default_decoders[$name])) { + return new $default_decoders[$name]($options); + } + } + throw new DecoderNotFoundException(); + } + + /** + * Get the mask for a given section + * @param string $section section name such as "message" or "attachment" + * + * @return string|null + */ + public function getMask(string $section): ?string { + $default_masks = $this->get('masks', []); + if (isset($default_masks[$section])) { + if (class_exists($default_masks[$section])) { + return $default_masks[$section]; + } + } + return null; + } + + /** + * Get the account configuration. + * @param string|null $name + * + * @return self + */ + public function getClientConfig(?string $name): self { + $config = $this->all(); + $defaultName = $this->getDefaultAccount(); + $defaultAccount = $this->get('accounts.'.$defaultName, []); + + if ($name === null || $name === 'null' || $name === "") { + $account = $defaultAccount; + $name = $defaultName; + }else{ + $account = $this->get('accounts.'.$name, $defaultAccount); + } + + $config["default"] = $name; + $config["accounts"] = [ + $name => $account + ]; + + return new self($config); + } + + /** + * Get the name of the default account. + * + * @return string + */ + public function getDefaultAccount(): string { + return $this->get('default', 'default'); + } + + /** + * Set the name of the default account. + * @param string $name + * + * @return void + */ + public function setDefaultAccount(string $name): void { + $this->set('default', $name); + } + + /** + * Create a new instance of the Config class + * @param array|string $config + * @return Config + */ + public static function make(array|string $config = []): Config { + if (is_array($config) === false) { + $config = require $config; + } + + $config_key = 'imap'; + $path = __DIR__ . '/config/' . $config_key . '.php'; + + $vendor_config = require $path; + $config = self::array_merge_recursive_distinct($vendor_config, $config); + + if (isset($config['default'])) { + if (isset($config['accounts']) && $config['default']) { + + $default_config = $vendor_config['accounts']['default']; + if (isset($config['accounts'][$config['default']])) { + $default_config = array_merge($default_config, $config['accounts'][$config['default']]); + } + + if (is_array($config['accounts'])) { + foreach ($config['accounts'] as $account_key => $account) { + $config['accounts'][$account_key] = array_merge($default_config, $account); + } + } + } + } + + return new self($config); + } + + /** + * Marge arrays recursively and distinct + * + * Merges any number of arrays / parameters recursively, replacing + * entries with string keys with values from latter arrays. + * If the entry or the next value to be assigned is an array, then it + * automatically treats both arguments as an array. + * Numeric entries are appended, not replaced, but only if they are + * unique + * + * @return array + * + * @link http://www.php.net/manual/en/function.array-merge-recursive.php#96201 + * @author Mark Roduner + */ + private static function array_merge_recursive_distinct(): array { + $arrays = func_get_args(); + $base = array_shift($arrays); + + // From https://stackoverflow.com/a/173479 + $isAssoc = function(array $arr) { + if (array() === $arr) return false; + return array_keys($arr) !== range(0, count($arr) - 1); + }; + + if (!is_array($base)) $base = empty($base) ? array() : array($base); + + foreach ($arrays as $append) { + if (!is_array($append)) $append = array($append); + + foreach ($append as $key => $value) { + + if (!array_key_exists($key, $base) and !is_numeric($key)) { + $base[$key] = $value; + continue; + } + + if ((is_array($value) && $isAssoc($value)) || (is_array($base[$key]) && $isAssoc($base[$key]))) { + // If the arrays are not associates we don't want to array_merge_recursive_distinct + // else merging $baseConfig['dispositions'] = ['attachment', 'inline'] with $customConfig['dispositions'] = ['attachment'] + // results in $resultConfig['dispositions'] = ['attachment', 'inline'] + $base[$key] = self::array_merge_recursive_distinct($base[$key], $value); + } else if (is_numeric($key)) { + if (!in_array($value, $base)) $base[] = $value; + } else { + $base[$key] = $value; + } + + } + + } + + return $base; + } + + /** + * Get all configuration values + * @return array + */ + public function all(): array { + return $this->config; + } + + /** + * Check if a configuration value exists + * @param string $key + * @return bool + */ + public function has(string $key): bool { + return $this->get($key) !== null; + } + + /** + * Remove all configuration values + * @return $this + */ + public function clear(): static { + $this->config = []; + return $this; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php new file mode 100644 index 00000000..ed1dac6e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php @@ -0,0 +1,1485 @@ +config = $config; + $this->setCertValidation($cert_validation); + $this->encryption = $encryption; + } + + /** + * Handle the class destruction / tear down + */ + public function __destruct() { + $this->logout(); + } + + /** + * Open connection to IMAP server + * @param string $host hostname or IP address of IMAP server + * @param int|null $port of IMAP server, default is 143 and 993 for ssl + * + * @throws ConnectionFailedException + */ + public function connect(string $host, ?int $port = null): bool { + $transport = 'tcp'; + $encryption = ''; + + if ($this->encryption) { + $encryption = strtolower($this->encryption); + if (in_array($encryption, ['ssl', 'tls'])) { + $transport = $encryption; + $port = $port === null ? 993 : $port; + } + } + $port = $port === null ? 143 : $port; + try { + $response = new Response(0, $this->debug); + $this->stream = $this->createStream($transport, $host, $port, $this->connection_timeout); + if (!$this->stream || !$this->assumedNextLine($response, '* OK')) { + throw new ConnectionFailedException('connection refused'); + } + if ($encryption == 'starttls') { + $this->enableStartTls(); + } + } catch (Exception $e) { + throw new ConnectionFailedException('connection failed', 0, $e); + } + return true; + } + + /** + * Check if the current session is connected + * + * @return bool + * @throws ImapBadRequestException + */ + public function connected(): bool { + if ((bool)$this->stream) { + try { + $this->requestAndResponse('NOOP'); + return true; + } catch (ImapServerErrorException|RuntimeException) { + return false; + } + } + return false; + } + + /** + * Enable tls on the current connection + * + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + protected function enableStartTls(): void { + $response = $this->requestAndResponse('STARTTLS'); + $result = $response->successful() && stream_socket_enable_crypto($this->stream, true, $this->getCryptoMethod()); + if (!$result) { + throw new ConnectionFailedException('failed to enable TLS'); + } + } + + /** + * Get the next line from stream + * + * @return string next line + * @throws RuntimeException + */ + public function nextLine(Response $response): string { + $line = ""; + while (($next_char = fread($this->stream, 1)) !== false && !in_array($next_char, ["", "\n"])) { + $line .= $next_char; + } + if ($line === "" && ($next_char === false || $next_char === "")) { + throw new RuntimeException('empty response'); + } + $line .= "\n"; + $response->addResponse($line); + if ($this->debug) echo "<< " . $line; + return $line; + } + + /** + * Get the next line and check if it starts with a given string + * @param Response $response + * @param string $start + * + * @return bool + * @throws RuntimeException + */ + protected function assumedNextLine(Response $response, string $start): bool { + return str_starts_with($this->nextLine($response), $start); + } + + /** + * Get the next line and check if it starts with a given string + * The server can send untagged status updates starting with '*' if we are not looking for a status update, + * the untagged lines will be ignored. + * + * @param Response $response + * @param string $start + * + * @return bool + * @throws RuntimeException + */ + protected function assumedNextLineIgnoreUntagged(Response $response, string $start): bool { + do { + $line = $this->nextLine($response); + } while (!(str_starts_with($start, '*')) && $this->isUntaggedLine($line)); + + return str_starts_with($line, $start); + } + + /** + * Get the next line and split the tag + * @param string|null $tag reference tag + * + * @return string next line + * @throws RuntimeException + */ + protected function nextTaggedLine(Response $response, ?string &$tag): string { + $line = $this->nextLine($response); + if (str_contains($line, ' ')) { + list($tag, $line) = explode(' ', $line, 2); + } + + return $line ?? ''; + } + + /** + * Get the next line and split the tag + * The server can send untagged status updates starting with '*', the untagged lines will be ignored. + * + * @param string|null $tag reference tag + * + * @return string next line + * @throws RuntimeException + */ + protected function nextTaggedLineIgnoreUntagged(Response $response, &$tag): string { + do { + $line = $this->nextLine($response); + } while ($this->isUntaggedLine($line)); + + list($tag, $line) = explode(' ', $line, 2); + + return $line; + } + + /** + * Get the next line and check if it contains a given string and split the tag + * @param Response $response + * @param string $start + * @param $tag + * + * @return bool + * @throws RuntimeException + */ + protected function assumedNextTaggedLine(Response $response, string $start, &$tag): bool { + return str_contains($this->nextTaggedLine($response, $tag), $start); + } + + /** + * Get the next line and check if it contains a given string and split the tag + * @param string $start + * @param $tag + * + * @return bool + * @throws RuntimeException + */ + protected function assumedNextTaggedLineIgnoreUntagged(Response $response, string $start, &$tag): bool { + $line = $this->nextTaggedLineIgnoreUntagged($response, $tag); + return strpos($line, $start) !== false; + } + + /** + * RFC3501 - 2.2.2 + * Data transmitted by the server to the client and status responses + * that do not indicate command completion are prefixed with the token + * "*", and are called untagged responses. + * + * @param string $line + * @return bool + */ + protected function isUntaggedLine(string $line) : bool { + return str_starts_with($line, '* '); + } + + /** + * Split a given line in values. A value is literal of any form or a list + * @param Response $response + * @param string $line + * + * @return array + * @throws RuntimeException + */ + protected function decodeLine(Response $response, string $line): array { + $tokens = []; + $stack = []; + + // replace any trailing including spaces with a single space + $line = rtrim($line) . ' '; + while (($pos = strpos($line, ' ')) !== false) { + $token = substr($line, 0, $pos); + if (!strlen($token)) { + $line = substr($line, $pos + 1); + continue; + } + while ($token[0] == '(') { + $stack[] = $tokens; + $tokens = []; + $token = substr($token, 1); + } + if ($token[0] == '"') { + if (preg_match('%^\(*\"((.|\\\|\")*?)\"( |$)%', $line, $matches)) { + $tokens[] = $matches[1]; + $line = substr($line, strlen($matches[0])); + continue; + } + } + if ($token[0] == '{') { + $endPos = strpos($token, '}'); + $chars = substr($token, 1, $endPos - 1); + if (is_numeric($chars)) { + $token = ''; + while (strlen($token) < $chars) { + $token .= $this->nextLine($response); + } + $line = ''; + if (strlen($token) > $chars) { + $line = substr($token, $chars); + $token = substr($token, 0, $chars); + } else { + $line .= $this->nextLine($response); + } + $tokens[] = $token; + $line = trim($line) . ' '; + continue; + } + } + if ($stack && $token[strlen($token) - 1] == ')') { + // closing braces are not separated by spaces, so we need to count them + $braces = strlen($token); + $token = rtrim($token, ')'); + // only count braces if more than one + $braces -= strlen($token) + 1; + // only add if token had more than just closing braces + if (rtrim($token) != '') { + $tokens[] = rtrim($token); + } + $token = $tokens; + $tokens = array_pop($stack); + // special handling if more than one closing brace + while ($braces-- > 0) { + $tokens[] = $token; + $token = $tokens; + $tokens = array_pop($stack); + } + } + $tokens[] = $token; + $line = substr($line, $pos + 1); + } + + // maybe the server forgot to send some closing braces + while ($stack) { + $child = $tokens; + $tokens = array_pop($stack); + $tokens[] = $child; + } + + return $tokens; + } + + /** + * Read abd decode a response "line" + * @param Response $response + * @param array|string $tokens to decode + * @param string $wantedTag targeted tag + * @param bool $dontParse if true only the unparsed line is returned in $tokens + * + * @return bool + * @throws RuntimeException + */ + public function readLine(Response $response, array|string &$tokens = [], string $wantedTag = '*', bool $dontParse = false): bool { + $line = $this->nextTaggedLine($response, $tag); // get next tag + if (!$dontParse) { + $tokens = $this->decodeLine($response, $line); + } else { + $tokens = $line; + } + + // if tag is wanted tag we might be at the end of a multiline response + return $tag == $wantedTag; + } + + /** + * Read all lines of response until given tag is found + * @param Response $response + * @param string $tag request tag + * @param bool $dontParse if true every line is returned unparsed instead of the decoded tokens + * + * @return array + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function readResponse(Response $response, string $tag, bool $dontParse = false): array { + $lines = []; + $tokens = ""; // define $tokens variable before first use + do { + $readAll = $this->readLine($response, $tokens, $tag, $dontParse); + $lines[] = $tokens; + } while (!$readAll); + + $original = $tokens; + if ($dontParse) { + // First two chars are still needed for the response code + $tokens = [trim(substr($tokens, 0, 3))]; + } + + $original = is_array($original) ? $original : [$original]; + + + // last line has response code + if ($tokens[0] == 'OK') { + return $lines ?: [true]; + } elseif ($tokens[0] == 'NO' || $tokens[0] == 'BAD' || $tokens[0] == 'BYE') { + throw new ImapServerErrorException($this->stringifyArray($original)); + } + + throw new ImapBadRequestException($this->stringifyArray($original)); + } + + /** + * Convert an array to a string + * @param array $arr array to stringify + * + * @return string stringified array + */ + private function stringifyArray(array $arr): string { + $string = ""; + foreach ($arr as $value) { + if (is_array($value)) { + $string .= "(" . $this->stringifyArray($value) . ")"; + } else { + $string .= $value . " "; + } + } + return $string; + } + + /** + * Send a new request + * @param string $command + * @param array $tokens additional parameters to command, use escapeString() to prepare + * @param string|null $tag provide a tag otherwise an autogenerated is returned + * + * @return Response + * @throws RuntimeException + */ + public function sendRequest(string $command, array $tokens = [], ?string &$tag = null): Response { + if (!$tag) { + $this->noun++; + $tag = 'TAG' . $this->noun; + } + + $line = $tag . ' ' . $command; + + $response = new Response($this->noun, $this->debug); + + foreach ($tokens as $token) { + if (is_array($token)) { + $this->write($response, $line . ' ' . $token[0]); + if (!$this->assumedNextLine($response, '+ ')) { + throw new RuntimeException('failed to send literal string'); + } + $line = $token[1]; + } else { + $line .= ' ' . $token; + } + } + $this->write($response, $line); + + return $response; + } + + /** + * Write data to the current stream + * @param Response $response + * @param string $data + * + * @return void + * @throws RuntimeException + */ + public function write(Response $response, string $data): void { + $command = $data . "\r\n"; + if ($this->debug) echo ">> " . $command . "\n"; + + $response->addCommand($command); + + if (fwrite($this->stream, $command) === false) { + throw new RuntimeException('failed to write - connection closed?'); + } + } + + /** + * Send a request and get response at once + * + * @param string $command + * @param array $tokens parameters as in sendRequest() + * @param bool $dontParse if true unparsed lines are returned instead of tokens + * + * @return Response response as in readResponse() + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function requestAndResponse(string $command, array $tokens = [], bool $dontParse = false): Response { + $response = $this->sendRequest($command, $tokens, $tag); + $response->setResult($this->readResponse($response, $tag, $dontParse)); + + return $response; + } + + /** + * Escape one or more literals i.e. for sendRequest + * @param array|string $string the literal/-s + * + * @return string|array escape literals, literals with newline ar returned + * as array('{size}', 'string'); + */ + public function escapeString(array|string $string): array|string { + if (func_num_args() < 2) { + if (str_contains($string, "\n")) { + return ['{' . strlen($string) . '}', $string]; + } else { + return '"' . str_replace(['\\', '"'], ['\\\\', '\\"'], $string) . '"'; + } + } + $result = []; + foreach (func_get_args() as $string) { + $result[] = $this->escapeString($string); + } + return $result; + } + + /** + * Escape a list with literals or lists + * @param array $list list with literals or lists as PHP array + * + * @return string escaped list for imap + */ + public function escapeList(array $list): string { + $result = []; + foreach ($list as $v) { + if (!is_array($v)) { + $result[] = $v; + continue; + } + $result[] = $this->escapeList($v); + } + return '(' . implode(' ', $result) . ')'; + } + + /** + * Login to a new session. + * + * @param string $user username + * @param string $password password + * + * @return Response + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + */ + public function login(string $user, string $password): Response { + try { + $command = 'LOGIN'; + $params = $this->escapeString($user, $password); + + return $this->requestAndResponse($command, $params, true); + } catch (RuntimeException $e) { + throw new AuthFailedException("failed to authenticate", 0, $e); + } + } + + /** + * Authenticate your current IMAP session. + * @param string $user username + * @param string $token access token + * + * @return Response + * @throws AuthFailedException + */ + public function authenticate(string $user, string $token): Response { + try { + $authenticateParams = ['XOAUTH2', base64_encode("user=$user\1auth=Bearer $token\1\1")]; + $response = $this->sendRequest('AUTHENTICATE', $authenticateParams); + + while (true) { + $tokens = ""; + $is_plus = $this->readLine($response, $tokens, '+', true); + if ($is_plus) { + // try to log the challenge somewhere where it can be found + error_log("got an extra server challenge: $tokens"); + // respond with an empty response. + $response->stack($this->sendRequest('')); + } else { + if (preg_match('/^NO /i', $tokens) || + preg_match('/^BAD /i', $tokens)) { + error_log("got failure response: $tokens"); + return $response->addError("got failure response: $tokens"); + } else if (preg_match("/^OK /i", $tokens)) { + return $response->setResult(is_array($tokens) ? $tokens : [$tokens]); + } + } + } + } catch (RuntimeException $e) { + throw new AuthFailedException("failed to authenticate", 0, $e); + } + } + + /** + * Logout of imap server + * + * @return Response + */ + public function logout(): Response { + if (!$this->stream) { + $this->reset(); + return new Response(0, $this->debug); + } elseif ($this->meta()["timed_out"]) { + $this->reset(); + return new Response(0, $this->debug); + } + + $result = null; + try { + $result = $this->requestAndResponse('LOGOUT', [], true); + fclose($this->stream); + } catch (Throwable) { + } + + $this->reset(); + + return $result ?? new Response(0, $this->debug); + } + + /** + * Reset the current stream and uid cache + * + * @return void + */ + public function reset(): void { + $this->stream = null; + $this->uid_cache = []; + } + + /** + * Get an array of available capabilities + * + * @return Response list of capabilities + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getCapabilities(): Response { + $response = $this->requestAndResponse('CAPABILITY'); + + if (!$response->getResponse()) return $response; + + return $response->setResult($response->validatedData()[0]); + } + + /** + * Examine and select have the same response. + * @param string $command can be 'EXAMINE' or 'SELECT' + * @param string $folder target folder + * + * @return Response + * @throws RuntimeException + */ + public function examineOrSelect(string $command = 'EXAMINE', string $folder = 'INBOX'): Response { + $response = $this->sendRequest($command, [$this->escapeString($folder)], $tag); + + $result = []; + $tokens = []; // define $tokens variable before first use + while (!$this->readLine($response, $tokens, $tag)) { + if ($tokens[0] == 'FLAGS') { + array_shift($tokens); + $result['flags'] = $tokens; + continue; + } + switch ($tokens[1]) { + case 'EXISTS': + case 'RECENT': + $result[strtolower($tokens[1])] = (int)$tokens[0]; + break; + case '[UIDVALIDITY': + $result['uidvalidity'] = (int)$tokens[2]; + break; + case '[UIDNEXT': + $result['uidnext'] = (int)$tokens[2]; + break; + case '[UNSEEN': + $result['unseen'] = (int)$tokens[2]; + break; + case '[NONEXISTENT]': + throw new RuntimeException("folder doesn't exist"); + default: + // ignore + break; + } + } + + $response->setResult($result); + + if ($tokens[0] != 'OK') { + $response->addError("request failed"); + } + return $response; + } + + /** + * Change the current folder + * @param string $folder change to this folder + * + * @return Response see examineOrSelect() + * @throws RuntimeException + */ + public function selectFolder(string $folder = 'INBOX'): Response { + $this->uid_cache = []; + + return $this->examineOrSelect('SELECT', $folder); + } + + /** + * Examine a given folder + * @param string $folder examine this folder + * + * @return Response see examineOrSelect() + * @throws RuntimeException + */ + public function examineFolder(string $folder = 'INBOX'): Response { + return $this->examineOrSelect('EXAMINE', $folder); + } + + /** + * Get the status of a given folder + * + * @param string $folder + * @param string[] $arguments + * @return Response list of STATUS items + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function folderStatus(string $folder = 'INBOX', $arguments = ['MESSAGES', 'UNSEEN', 'RECENT', 'UIDNEXT', 'UIDVALIDITY']): Response { + $response = $this->requestAndResponse('STATUS', [$this->escapeString($folder), $this->escapeList($arguments)]); + $data = $response->validatedData(); + + if (!isset($data[0]) || !isset($data[0][2])) { + throw new RuntimeException("folder status could not be fetched"); + } + + $result = []; + $key = null; + foreach ($data[0][2] as $value) { + if ($key === null) { + $key = $value; + } else { + $result[strtolower($key)] = (int)$value; + $key = null; + } + } + + $response->setResult($result); + + return $response; + } + + /** + * Fetch one or more items of one or more messages + * @param array|string $items items to fetch [RFC822.HEADER, FLAGS, RFC822.TEXT, etc] + * @param array|int $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response if only one item of one message is fetched it's returned as string + * if items of one message are fetched it's returned as (name => value) + * if one item of messages are fetched it's returned as (msgno => value) + * if items of messages are fetched it's returned as (msgno => (name => value)) + * @throws RuntimeException + */ + public function fetch(array|string $items, array|int $from, mixed $to = null, int|string $uid = IMAP::ST_UID): Response { + if (is_array($from) && count($from) > 1) { + $set = implode(',', $from); + } elseif (is_array($from) && count($from) === 1) { + $from = array_values($from); + $set = $from[0] . ':' . $from[0]; + } elseif ($to === null) { + $set = $from . ':' . $from; + } elseif ($to == INF) { + $set = $from . ':*'; + } else { + $set = $from . ':' . (int)$to; + } + + $items = (array)$items; + $itemList = $this->escapeList($items); + + $response = $this->sendRequest($this->buildUIDCommand("FETCH", $uid), [$set, $itemList], $tag); + $result = []; + $tokens = []; // define $tokens variable before first use + while (!$this->readLine($response, $tokens, $tag)) { + // ignore other responses + if ($tokens[1] != 'FETCH') { + continue; + } + + $uidKey = 0; + $data = []; + + // find array key of UID value; try the last elements, or search for it + if ($uid === IMAP::ST_UID) { + $count = count($tokens[2]); + if ($tokens[2][$count - 2] == 'UID') { + $uidKey = $count - 1; + } else if ($tokens[2][0] == 'UID') { + $uidKey = 1; + } else { + $found = array_search('UID', $tokens[2]); + if ($found === false || $found === -1) { + continue; + } + + $uidKey = $found + 1; + } + } + + // ignore other messages + if ($to === null && !is_array($from) && ($uid === IMAP::ST_UID ? $tokens[2][$uidKey] != $from : $tokens[0] != $from)) { + continue; + } + + // if we only want one item we return that one directly + if (count($items) == 1) { + if ($tokens[2][0] == $items[0]) { + $data = $tokens[2][1]; + } elseif ($uid === IMAP::ST_UID && $tokens[2][2] == $items[0]) { + $data = $tokens[2][3]; + } else { + $expectedResponse = 0; + // maybe the server send another field we didn't wanted + $count = count($tokens[2]); + // we start with 2, because 0 was already checked + for ($i = 2; $i < $count; $i += 2) { + if ($tokens[2][$i] != $items[0]) { + continue; + } + $data = $tokens[2][$i + 1]; + $expectedResponse = 1; + break; + } + if (!$expectedResponse) { + continue; + } + } + } else { + while (key($tokens[2]) !== null) { + $data[current($tokens[2])] = next($tokens[2]); + next($tokens[2]); + } + } + + // if we want only one message we can ignore everything else and just return + if ($to === null && !is_array($from) && ($uid === IMAP::ST_UID ? $tokens[2][$uidKey] == $from : $tokens[0] == $from)) { + // we still need to read all lines + if (!$this->readLine($response, $tokens, $tag)) + return $response->setResult($data); + } + if ($uid === IMAP::ST_UID) { + $result[$tokens[2][$uidKey]] = $data; + } else { + $result[$tokens[0]] = $data; + } + } + + if ($to === null && !is_array($from)) { + throw new RuntimeException('the single id was not found in response'); + } + + return $response->setResult($result); + } + + /** + * Fetch message body (without headers) + * @param int|array $uids + * @param string $rfc + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + */ + public function content(int|array $uids, string $rfc = "RFC822", int|string $uid = IMAP::ST_UID): Response { + $rfc = $rfc ?? "RFC822"; + $item = $rfc === "BODY" ? "BODY[TEXT]" : "$rfc.TEXT"; + return $this->fetch([$item], is_array($uids) ? $uids : [$uids], null, $uid); + } + + /** + * Fetch message headers + * @param int|array $uids + * @param string $rfc + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + */ + public function headers(int|array $uids, string $rfc = "RFC822", int|string $uid = IMAP::ST_UID): Response { + return $this->fetch(["$rfc.HEADER"], is_array($uids) ? $uids : [$uids], null, $uid); + } + + /** + * Fetch message flags + * @param int|array $uids + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + */ + public function flags(int|array $uids, int|string $uid = IMAP::ST_UID): Response { + return $this->fetch(["FLAGS"], is_array($uids) ? $uids : [$uids], null, $uid); + } + + /** + * Fetch message sizes + * @param int|array $uids + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + */ + public function sizes(int|array $uids, int|string $uid = IMAP::ST_UID): Response { + return $this->fetch(["RFC822.SIZE"], is_array($uids) ? $uids : [$uids], null, $uid); + } + + /** + * Get uid for a given id + * @param int|null $id message number + * + * @return Response message number for given message or all messages as array + * @throws MessageNotFoundException + */ + public function getUid(?int $id = null): Response { + if (!$this->enable_uid_cache || empty($this->uid_cache) || count($this->uid_cache) <= 0) { + try { + $this->setUidCache((array)$this->fetch('UID', 1, INF)->data()); // set cache for this folder + } catch (RuntimeException) { + } + } + $uids = $this->uid_cache; + + if ($id == null) { + return Response::empty($this->debug)->setResult($uids)->setCanBeEmpty(true); + } + + foreach ($uids as $k => $v) { + if ($k == $id) { + return Response::empty($this->debug)->setResult($v); + } + } + + // clear uid cache and run method again + if ($this->enable_uid_cache && $this->uid_cache) { + $this->setUidCache(null); + return $this->getUid($id); + } + + throw new MessageNotFoundException('unique id not found'); + } + + /** + * Get a message number for a uid + * @param string $id uid + * + * @return Response message number + * @throws MessageNotFoundException + */ + public function getMessageNumber(string $id): Response { + foreach ($this->getUid()->data() as $k => $v) { + if ($v == $id) { + return Response::empty($this->debug)->setResult((int)$k); + } + } + + throw new MessageNotFoundException('message number not found: ' . $id); + } + + /** + * Get a list of available folders + * + * @param string $reference mailbox reference for list + * @param string $folder mailbox name match with wildcards + * + * @return Response folders that matched $folder as array(name => array('delimiter' => .., 'flags' => ..)) + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function folders(string $reference = '', string $folder = '*'): Response { + $response = $this->requestAndResponse('LIST', $this->escapeString($reference, $folder))->setCanBeEmpty(true); + $list = $response->data(); + + $result = []; + if ($list[0] !== true) { + foreach ($list as $item) { + if (count($item) != 4 || $item[0] != 'LIST') { + continue; + } + $item[3] = str_replace("\\\\", "\\", str_replace("\\\"", "\"", $item[3])); + $result[$item[3]] = ['delimiter' => $item[2], 'flags' => $item[1]]; + } + } + + return $response->setResult($result); + } + + /** + * Manage flags + * + * @param array|string $flags flags to set, add or remove - see $mode + * @param int $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given + * @param bool $silent if false the return values are the new flags for the wanted messages + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * @param string|null $item command used to store a flag + * + * @return Response new flags if $silent is false, else true or false depending on success + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function store( + array|string $flags, int $from, ?int $to = null, ?string $mode = null, bool $silent = true, int|string $uid = IMAP::ST_UID, ?string $item = null + ): Response { + $flags = $this->escapeList(is_array($flags) ? $flags : [$flags]); + $set = $this->buildSet($from, $to); + + $command = $this->buildUIDCommand("STORE", $uid); + $item = ($mode == '-' ? "-" : "+") . ($item === null ? "FLAGS" : $item) . ($silent ? '.SILENT' : ""); + + $response = $this->requestAndResponse($command, [$set, $item, $flags], $silent); + + if ($silent) { + return $response; + } + + $result = []; + foreach ($response as $token) { + if ($token[1] != 'FETCH' || $token[2][0] != 'FLAGS') { + continue; + } + $result[$token[0]] = $token[2][1]; + } + + + return $response->setResult($result); + } + + /** + * Append a new message to given folder + * + * @param string $folder name of target folder + * @param string $message full message content + * @param array|null $flags flags for new message + * @param string|null $date date for new message + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function appendMessage(string $folder, string $message, ?array $flags = null, ?string $date = null): Response { + $tokens = []; + $tokens[] = $this->escapeString($folder); + if ($flags !== null) { + $tokens[] = $this->escapeList($flags); + } + if ($date !== null) { + $tokens[] = $this->escapeString($date); + } + $tokens[] = $this->escapeString($message); + + return $this->requestAndResponse('APPEND', $tokens, true); + } + + /** + * Copy a message set from current folder to another folder + * + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function copyMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response { + $set = $this->buildSet($from, $to); + $command = $this->buildUIDCommand("COPY", $uid); + + return $this->requestAndResponse($command, [$set, $this->escapeString($folder)], true); + } + + /** + * Copy multiple messages to the target folder + * + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response Tokens if operation successful, false if an error occurred + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function copyManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response { + $command = $this->buildUIDCommand("COPY", $uid); + + $set = implode(',', $messages); + $tokens = [$set, $this->escapeString($folder)]; + + return $this->requestAndResponse($command, $tokens, true); + } + + /** + * Move a message set from current folder to another folder + * + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function moveMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response { + $set = $this->buildSet($from, $to); + $command = $this->buildUIDCommand("MOVE", $uid); + + $result = $this->requestAndResponse($command, [$set, $this->escapeString($folder)], true); + // RFC4315 fallback to COPY, STORE and EXPUNGE. + // Required for cases where MOVE isn't supported by the server. So we copy the message to the target folder, + // mark the original message as deleted and expunge the mailbox. + // See the following links for more information: + // - https://github.com/freescout-help-desk/freescout/issues/4313 + // - https://github.com/Webklex/php-imap/issues/123 + if (!$result->boolean()) { + $result = $this->copyMessage($folder, $from, $to, $uid); + if (!$result->boolean()) { + return $result; + } + $result = $this->store(['\Deleted'], $from, $to, null, true, $uid); + if (!$result->boolean()) { + return $result; + } + return $this->expunge(); + } + return $result; + } + + /** + * Move multiple messages to the target folder + * + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function moveManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response { + $command = $this->buildUIDCommand("MOVE", $uid); + $set = implode(',', $messages); + $tokens = [$set, $this->escapeString($folder)]; + + $result = $this->requestAndResponse($command, $tokens, true); + // RFC4315 fallback to COPY, STORE and EXPUNGE. + // Required for cases where MOVE isn't supported by the server. So we copy the message to the target folder, + // mark the original message as deleted and expunge the mailbox. + // See the following links for more information: + // - https://github.com/freescout-help-desk/freescout/issues/4313 + // - https://github.com/Webklex/php-imap/issues/123 + if (!$result->boolean()) { + $result = $this->copyManyMessages($messages, $folder, $uid); + if (!$result->boolean()) { + return $result; + } + foreach ($messages as $message) { + $result = $this->store(['\Deleted'], $message, $message, null, true, $uid); + if (!$result->boolean()) { + return $result; + } + } + return $this->expunge(); + } + return $result; + } + + /** + * Exchange identification information + * Ref.: https://datatracker.ietf.org/doc/html/rfc2971 + * + * @param array|null $ids + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function ID($ids = null): Response { + $token = "NIL"; + if (is_array($ids) && !empty($ids)) { + $token = "("; + foreach ($ids as $id) { + $token .= '"' . $id . '" '; + } + $token = rtrim($token) . ")"; + } + + return $this->requestAndResponse("ID", [$token], true); + } + + /** + * Create a new folder (and parent folders if needed) + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function createFolder(string $folder): Response { + return $this->requestAndResponse('CREATE', [$this->escapeString($folder)], true); + } + + /** + * Rename an existing folder + * + * @param string $old old name + * @param string $new new name + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function renameFolder(string $old, string $new): Response { + return $this->requestAndResponse('RENAME', $this->escapeString($old, $new), true); + } + + /** + * Delete a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function deleteFolder(string $folder): Response { + return $this->requestAndResponse('DELETE', [$this->escapeString($folder)], true); + } + + /** + * Subscribe to a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function subscribeFolder(string $folder): Response { + return $this->requestAndResponse('SUBSCRIBE', [$this->escapeString($folder)], true); + } + + /** + * Unsubscribe from a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function unsubscribeFolder(string $folder): Response { + return $this->requestAndResponse('UNSUBSCRIBE', [$this->escapeString($folder)], true); + } + + /** + * Apply session saved changes to the server + * + * @return Response + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function expunge(): Response { + $this->uid_cache = []; + return $this->requestAndResponse('EXPUNGE'); + } + + /** + * Send noop command + * + * @return Response + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function noop(): Response { + return $this->requestAndResponse('NOOP'); + } + + /** + * Retrieve the quota level settings, and usage statics per mailbox + * + * @param $username + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * + * @Doc https://www.rfc-editor.org/rfc/rfc2087.txt + */ + public function getQuota($username): Response { + $command = "GETQUOTA"; + $params = ['"#user/' . $username . '"']; + + return $this->requestAndResponse($command, $params); + } + + /** + * Retrieve the quota settings per user + * + * @param string $quota_root + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * + * @Doc https://www.rfc-editor.org/rfc/rfc2087.txt + */ + public function getQuotaRoot(string $quota_root = 'INBOX'): Response { + $command = "GETQUOTAROOT"; + $params = [$quota_root]; + + return $this->requestAndResponse($command, $params); + } + + /** + * Send idle command + * + * @throws RuntimeException + */ + public function idle(): void { + $response = $this->sendRequest("IDLE"); + if (!$this->assumedNextLineIgnoreUntagged($response, '+ ')) { + throw new RuntimeException('idle failed'); + } + } + + /** + * Send done command + * @throws RuntimeException + */ + public function done(): bool { + $response = new Response($this->noun, $this->debug); + $this->write($response, "DONE"); + if (!$this->assumedNextTaggedLineIgnoreUntagged($response, 'OK', $tags)) { + throw new RuntimeException('done failed'); + } + return true; + } + + /** + * Search for matching messages + * + * @param array $params + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response message ids + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function search(array $params, int|string $uid = IMAP::ST_UID): Response { + $command = $this->buildUIDCommand("SEARCH", $uid); + $response = $this->requestAndResponse($command, $params)->setCanBeEmpty(true); + + foreach ($response->data() as $ids) { + if ($ids[0] === 'SEARCH') { + array_shift($ids); + return $response->setResult($ids); + } + } + + return $response; + } + + /** + * Get a message overview + * @param string $sequence + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + * @throws MessageNotFoundException + * @throws InvalidMessageDateException + */ + public function overview(string $sequence, int|string $uid = IMAP::ST_UID): Response { + $result = []; + list($from, $to) = explode(":", $sequence); + + $response = $this->getUid(); + $ids = []; + foreach ($response->data() as $msgn => $v) { + $id = $uid === IMAP::ST_UID ? $v : $msgn; + if (($to >= $id && $from <= $id) || ($to === "*" && $from <= $id)) { + $ids[] = $id; + } + } + if (!empty($ids)) { + $headers = $this->headers($ids, "RFC822", $uid); + $response->stack($headers); + foreach ($headers->data() as $id => $raw_header) { + $result[$id] = (new Header($raw_header, $this->config))->getAttributes(); + } + } + return $response->setResult($result)->setCanBeEmpty(true); + } + + /** + * Enable the debug mode + * + * @return void + */ + public function enableDebug(): void { + $this->debug = true; + } + + /** + * Disable the debug mode + * + * @return void + */ + public function disableDebug(): void { + $this->debug = false; + } + + /** + * Build a valid UID number set + * @param $from + * @param null $to + * + * @return int|string + */ + public function buildSet($from, $to = null): int|string { + $set = (int)$from; + if ($to !== null) { + $set .= ':' . ($to == INF ? '*' : (int)$to); + } + return $set; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Connection/Protocols/LegacyProtocol.php b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/LegacyProtocol.php new file mode 100644 index 00000000..81b52f77 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/LegacyProtocol.php @@ -0,0 +1,825 @@ +config = $config; + $this->setCertValidation($cert_validation); + $this->encryption = $encryption; + } + + /** + * Public destructor + */ + public function __destruct() { + $this->logout(); + } + + /** + * Save the information for a nw connection + * @param string $host + * @param int|null $port + */ + public function connect(string $host, ?int $port = null): void { + if ($this->encryption) { + $encryption = strtolower($this->encryption); + if ($encryption == "ssl") { + $port = $port === null ? 993 : $port; + } + } + $port = $port === null ? 143 : $port; + $this->host = $host; + $this->port = $port; + } + + /** + * Login to a new session. + * @param string $user username + * @param string $password password + * + * @return Response + */ + public function login(string $user, string $password): Response { + return $this->response()->wrap(function($response) use ($user, $password) { + /** @var Response $response */ + try { + $this->stream = \imap_open( + $this->getAddress(), + $user, + $password, + 0, + $attempts = 3, + $this->config->get('options.open') + ); + $response->addCommand("imap_open"); + } catch (\ErrorException $e) { + $errors = \imap_errors(); + $message = $e->getMessage() . '. ' . implode("; ", (is_array($errors) ? $errors : array())); + throw new AuthFailedException($message); + } + + if (!$this->stream) { + $errors = \imap_errors(); + $message = implode("; ", (is_array($errors) ? $errors : array())); + throw new AuthFailedException($message); + } + + $errors = \imap_errors(); + $response->addCommand("imap_errors"); + if (is_array($errors)) { + $status = $this->examineFolder(); + $response->stack($status); + if ($status->data()['exists'] !== 0) { + $message = implode("; ", $errors); + throw new RuntimeException($message); + } + } + + if ($this->stream !== false) { + return ["TAG" . $response->Noun() . " OK [] Logged in\r\n"]; + } + + $response->addError("failed to login"); + return []; + }); + } + + /** + * Authenticate your current session. + * @param string $user username + * @param string $token access token + * + * @return Response + */ + public function authenticate(string $user, string $token): Response { + return $this->login($user, $token); + } + + /** + * Get full address of mailbox. + * + * @return string + */ + protected function getAddress(): string { + $address = "{" . $this->host . ":" . $this->port . "/" . $this->protocol; + if (!$this->cert_validation) { + $address .= '/novalidate-cert'; + } + if (in_array($this->encryption, ['tls', 'notls', 'ssl'])) { + $address .= '/' . $this->encryption; + } elseif ($this->encryption === "starttls") { + $address .= '/tls'; + } + + $address .= '}'; + + return $address; + } + + /** + * Logout of the current session + * + * @return Response + */ + public function logout(): Response { + return $this->response()->wrap(function($response) { + /** @var Response $response */ + if ($this->stream) { + $this->uid_cache = []; + $response->addCommand("imap_close"); + if (\imap_close($this->stream, IMAP::CL_EXPUNGE)) { + $this->stream = false; + return [ + 0 => "BYE Logging out\r\n", + 1 => "TAG" . $response->Noun() . " OK Logout completed (0.001 + 0.000 secs).\r\n", + ]; + } + $this->stream = false; + } + return []; + }); + } + + /** + * Get an array of available capabilities + * + * @throws MethodNotSupportedException + */ + public function getCapabilities(): Response { + throw new MethodNotSupportedException(); + } + + /** + * Change the current folder + * @param string $folder change to this folder + * + * @return Response see examineOrselect() + * @throws RuntimeException + */ + public function selectFolder(string $folder = 'INBOX'): Response { + $flags = IMAP::OP_READONLY; + if (in_array($this->protocol, ["pop3", "nntp"])) { + $flags = IMAP::NIL; + } + if ($this->stream === false) { + throw new RuntimeException("failed to reopen stream."); + } + + return $this->response("imap_reopen")->wrap(function($response) use ($folder, $flags) { + /** @var Response $response */ + \imap_reopen($this->stream, $this->getAddress() . $folder, $flags, 3); + $this->uid_cache = []; + + $status = $this->examineFolder($folder); + $response->stack($status); + + return $status->data(); + }); + } + + /** + * Examine a given folder + * @param string $folder examine this folder + * + * @return Response + * @throws RuntimeException + */ + public function examineFolder(string $folder = 'INBOX'): Response { + if (str_starts_with($folder, ".")) { + throw new RuntimeException("Segmentation fault prevented. Folders starts with an illegal char '.'."); + } + return $this->response("imap_status")->wrap(function($response) use ($folder) { + /** @var Response $response */ + $status = \imap_status($this->stream, $this->getAddress() . $folder, IMAP::SA_ALL); + + return $status ? [ + "flags" => [], + "exists" => $status->messages, + "recent" => $status->recent, + "unseen" => $status->unseen, + "uidnext" => $status->uidnext, + ] : []; + }); + } + + /** + * Get the status of a given folder + * + * @return Response list of STATUS items + * @throws MethodNotSupportedException + */ + public function folderStatus(string $folder = 'INBOX', $arguments = ['MESSAGES', 'UNSEEN', 'RECENT', 'UIDNEXT', 'UIDVALIDITY']): Response { + throw new MethodNotSupportedException(); + } + + /** + * Fetch message content + * @param int|array $uids + * @param string $rfc + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function content(int|array $uids, string $rfc = "RFC822", int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($uids, $uid) { + /** @var Response $response */ + + $result = []; + $uids = is_array($uids) ? $uids : [$uids]; + foreach ($uids as $id) { + $response->addCommand("imap_fetchbody"); + $result[$id] = \imap_fetchbody($this->stream, $id, "", $uid === IMAP::ST_UID ? IMAP::ST_UID : IMAP::NIL); + } + + return $result; + }); + } + + /** + * Fetch message headers + * @param int|array $uids + * @param string $rfc + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function headers(int|array $uids, string $rfc = "RFC822", int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($uids, $uid) { + /** @var Response $response */ + + $result = []; + $uids = is_array($uids) ? $uids : [$uids]; + foreach ($uids as $id) { + $response->addCommand("imap_fetchheader"); + $result[$id] = \imap_fetchheader($this->stream, $id, $uid ? IMAP::ST_UID : IMAP::NIL); + } + + return $result; + }); + } + + /** + * Fetch message flags + * @param int|array $uids + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function flags(int|array $uids, int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($uids, $uid) { + /** @var Response $response */ + + $result = []; + $uids = is_array($uids) ? $uids : [$uids]; + foreach ($uids as $id) { + $response->addCommand("imap_fetch_overview"); + $raw_flags = \imap_fetch_overview($this->stream, $id, $uid ? IMAP::ST_UID : IMAP::NIL); + $flags = []; + if (is_array($raw_flags) && isset($raw_flags[0])) { + $raw_flags = (array)$raw_flags[0]; + foreach ($raw_flags as $flag => $value) { + if ($value === 1 && in_array($flag, ["size", "uid", "msgno", "update"]) === false) { + $flags[] = "\\" . ucfirst($flag); + } + } + } + $result[$id] = $flags; + } + + return $result; + }); + } + + /** + * Fetch message sizes + * @param int|array $uids + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function sizes(int|array $uids, int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($uids, $uid) { + /** @var Response $response */ + $result = []; + $uids = is_array($uids) ? $uids : [$uids]; + $uid_text = implode("','", $uids); + $response->addCommand("imap_fetch_overview"); + if ($uid == IMAP::ST_UID) { + $raw_overview = \imap_fetch_overview($this->stream, $uid_text, IMAP::FT_UID); + } else { + $raw_overview = \imap_fetch_overview($this->stream, $uid_text); + } + if ($raw_overview !== false) { + foreach ($raw_overview as $overview_element) { + $overview_element = (array)$overview_element; + $result[$overview_element[$uid == IMAP::ST_UID ? 'uid' : 'msgno']] = $overview_element['size']; + } + } + return $result; + }); + } + + /** + * Get uid for a given id + * @param int|null $id message number + * + * @return Response message number for given message or all messages as array + */ + public function getUid(?int $id = null): Response { + return $this->response()->wrap(function($response) use ($id) { + /** @var Response $response */ + if ($id === null) { + if ($this->enable_uid_cache && $this->uid_cache) { + return $this->uid_cache; + } + + $overview = $this->overview("1:*"); + $response->stack($overview); + $uids = []; + foreach ($overview->data() as $set) { + $uids[$set->msgno] = $set->uid; + } + + $this->setUidCache($uids); + return $uids; + } + + $response->addCommand("imap_uid"); + $uid = \imap_uid($this->stream, $id); + if ($uid) { + return $uid; + } + + return []; + }); + } + + /** + * Get the message number of a given uid + * @param string $id uid + * + * @return Response message number + */ + public function getMessageNumber(string $id): Response { + return $this->response("imap_msgno")->wrap(function($response) use ($id) { + /** @var Response $response */ + return \imap_msgno($this->stream, $id); + }); + } + + /** + * Get a message overview + * @param string $sequence uid sequence + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function overview(string $sequence, int|string $uid = IMAP::ST_UID): Response { + return $this->response("imap_fetch_overview")->wrap(function($response) use ($sequence, $uid) { + /** @var Response $response */ + return \imap_fetch_overview($this->stream, $sequence, $uid ? IMAP::ST_UID : IMAP::NIL) ?: []; + }); + } + + /** + * Get a list of available folders + * @param string $reference mailbox reference for list + * @param string $folder mailbox name match with wildcards + * + * @return Response folders that matched $folder as array(name => array('delimiter' => .., 'flags' => ..)) + */ + public function folders(string $reference = '', string $folder = '*'): Response { + return $this->response("imap_getmailboxes")->wrap(function($response) use ($reference, $folder) { + /** @var Response $response */ + $result = []; + + $items = \imap_getmailboxes($this->stream, $this->getAddress(), $reference . $folder); + if (is_array($items)) { + foreach ($items as $item) { + $name = $this->decodeFolderName($item->name); + $result[$name] = ['delimiter' => $item->delimiter, 'flags' => []]; + } + } else { + throw new RuntimeException(\imap_last_error()); + } + + return $result; + }); + } + + /** + * Manage flags + * @param array|string $flags flags to set, add or remove - see $mode + * @param int $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given + * @param bool $silent if false the return values are the new flags for the wanted messages + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * @param string|null $item unused attribute + * + * @return Response new flags if $silent is false, else true or false depending on success + */ + public function store(array|string $flags, int $from, ?int $to = null, ?string $mode = null, bool $silent = true, int|string $uid = IMAP::ST_UID, ?string $item = null): Response { + $flag = trim(is_array($flags) ? implode(" ", $flags) : $flags); + + return $this->response()->wrap(function($response) use ($mode, $from, $flag, $uid, $silent) { + /** @var Response $response */ + + if ($mode == "+") { + $response->addCommand("imap_setflag_full"); + $status = \imap_setflag_full($this->stream, $from, $flag, $uid ? IMAP::ST_UID : IMAP::NIL); + } else { + $response->addCommand("imap_clearflag_full"); + $status = \imap_clearflag_full($this->stream, $from, $flag, $uid ? IMAP::ST_UID : IMAP::NIL); + } + + if ($silent === true) { + if ($status) { + return [ + "TAG" . $response->Noun() . " OK Store completed (0.001 + 0.000 secs).\r\n" + ]; + } + return []; + } + + return $this->flags($from); + }); + } + + /** + * Append a new message to given folder + * @param string $folder name of target folder + * @param string $message full message content + * @param array|null $flags flags for new message + * @param mixed $date date for new message + * + * @return Response + */ + public function appendMessage(string $folder, string $message, ?array $flags = null, mixed $date = null): Response { + return $this->response("imap_append")->wrap(function($response) use ($folder, $message, $flags, $date) { + /** @var Response $response */ + if ($date != null) { + if ($date instanceof \Carbon\Carbon) { + $date = $date->format('d-M-Y H:i:s O'); + } + if (\imap_append($this->stream, $this->getAddress() . $folder, $message, $flags, $date)) { + return [ + "OK Append completed (0.001 + 0.000 secs).\r\n" + ]; + } + } else if (\imap_append($this->stream, $this->getAddress() . $folder, $message, $flags)) { + return [ + "OK Append completed (0.001 + 0.000 secs).\r\n" + ]; + } + return []; + }); + } + + /** + * Copy message set from current folder to other folder + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response + */ + public function copyMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response { + return $this->response("imap_mail_copy")->wrap(function($response) use ($from, $folder, $uid) { + /** @var Response $response */ + + if (\imap_mail_copy($this->stream, $from, $this->getAddress() . $folder, $uid ? IMAP::ST_UID : IMAP::NIL)) { + return [ + "TAG" . $response->Noun() . " OK Copy completed (0.001 + 0.000 secs).\r\n" + ]; + } + throw new ImapBadRequestException("Invalid ID $from"); + }); + } + + /** + * Copy multiple messages to the target folder + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response Tokens if operation successful, false if an error occurred + */ + public function copyManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($messages, $folder, $uid) { + /** @var Response $response */ + foreach ($messages as $msg) { + $copy_response = $this->copyMessage($folder, $msg, null, $uid); + $response->stack($copy_response); + if (empty($copy_response->data())) { + return [ + "TAG" . $response->Noun() . " BAD Copy failed (0.001 + 0.000 secs).\r\n", + "Invalid ID $msg\r\n" + ]; + } + } + return [ + "TAG" . $response->Noun() . " OK Copy completed (0.001 + 0.000 secs).\r\n" + ]; + }); + } + + /** + * Move a message set from current folder to another folder + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response success + */ + public function moveMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response { + return $this->response("imap_mail_move")->wrap(function($response) use ($from, $folder, $uid) { + if (\imap_mail_move($this->stream, $from, $this->getAddress() . $folder, $uid ? IMAP::ST_UID : IMAP::NIL)) { + return [ + "TAG" . $response->Noun() . " OK Move completed (0.001 + 0.000 secs).\r\n" + ]; + } + throw new ImapBadRequestException("Invalid ID $from"); + }); + } + + /** + * Move multiple messages to the target folder + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response Tokens if operation successful, false if an error occurred + * @throws ImapBadRequestException + */ + public function moveManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response { + return $this->response()->wrap(function($response) use ($messages, $folder, $uid) { + foreach ($messages as $msg) { + $move_response = $this->moveMessage($folder, $msg, null, $uid); + $response = $response->include($response); + if (empty($move_response->data())) { + return [ + "TAG" . $response->Noun() . " BAD Move failed (0.001 + 0.000 secs).\r\n", + "Invalid ID $msg\r\n" + ]; + } + } + return [ + "TAG" . $response->Noun() . " OK Move completed (0.001 + 0.000 secs).\r\n" + ]; + }); + } + + /** + * Exchange identification information + * Ref.: https://datatracker.ietf.org/doc/html/rfc2971 + * + * @param null $ids + * @return Response + * + * @throws MethodNotSupportedException + */ + public function ID($ids = null): Response { + throw new MethodNotSupportedException(); + } + + /** + * Create a new folder (and parent folders if needed) + * @param string $folder folder name + * + * @return Response + */ + public function createFolder(string $folder): Response { + return $this->response("imap_createmailbox")->wrap(function($response) use ($folder) { + return \imap_createmailbox($this->stream, $this->getAddress() . $folder) ? [ + 0 => "TAG" . $response->Noun() . " OK Create completed (0.004 + 0.000 + 0.003 secs).\r\n", + ] : []; + }); + } + + /** + * Rename an existing folder + * @param string $old old name + * @param string $new new name + * + * @return Response + */ + public function renameFolder(string $old, string $new): Response { + return $this->response("imap_renamemailbox")->wrap(function($response) use ($old, $new) { + return \imap_renamemailbox($this->stream, $this->getAddress() . $old, $this->getAddress() . $new) ? [ + 0 => "TAG" . $response->Noun() . " OK Move completed (0.004 + 0.000 + 0.003 secs).\r\n", + ] : []; + }); + } + + /** + * Delete a folder + * @param string $folder folder name + * + * @return Response + */ + public function deleteFolder(string $folder): Response { + return $this->response("imap_deletemailbox")->wrap(function($response) use ($folder) { + return \imap_deletemailbox($this->stream, $this->getAddress() . $folder) ? [ + 0 => "OK Delete completed (0.004 + 0.000 + 0.003 secs).\r\n", + ] : []; + }); + } + + /** + * Subscribe to a folder + * @param string $folder folder name + * + * @throws MethodNotSupportedException + */ + public function subscribeFolder(string $folder): Response { + throw new MethodNotSupportedException(); + } + + /** + * Unsubscribe from a folder + * @param string $folder folder name + * + * @throws MethodNotSupportedException + */ + public function unsubscribeFolder(string $folder): Response { + throw new MethodNotSupportedException(); + } + + /** + * Apply session saved changes to the server + * + * @return Response + */ + public function expunge(): Response { + return $this->response("imap_expunge")->wrap(function($response) { + return \imap_expunge($this->stream) ? [ + 0 => "TAG" . $response->Noun() . " OK Expunge completed (0.001 + 0.000 secs).\r\n", + ] : []; + }); + } + + /** + * Send noop command + * + * @throws MethodNotSupportedException + */ + public function noop(): Response { + throw new MethodNotSupportedException(); + } + + /** + * Send idle command + * + * @throws MethodNotSupportedException + */ + public function idle() { + throw new MethodNotSupportedException(); + } + + /** + * Send done command + * + * @throws MethodNotSupportedException + */ + public function done() { + throw new MethodNotSupportedException(); + } + + /** + * Search for matching messages + * @param array $params + * @param int|string $uid set to IMAP::ST_UID if you pass message unique identifiers instead of numbers. + * + * @return Response message ids + */ + public function search(array $params, int|string $uid = IMAP::ST_UID): Response { + return $this->response("imap_search")->wrap(function($response) use ($params, $uid) { + $response->setCanBeEmpty(true); + $result = \imap_search($this->stream, $params[0], $uid ? IMAP::ST_UID : IMAP::NIL); + return $result ?: []; + }); + } + + /** + * Enable the debug mode + */ + public function enableDebug() { + $this->debug = true; + } + + /** + * Disable the debug mode + */ + public function disableDebug() { + $this->debug = false; + } + + /** + * Decode name. + * It converts UTF7-IMAP encoding to UTF-8. + * + * @param $name + * + * @return array|false|string|string[]|null + */ + protected function decodeFolderName($name): array|bool|string|null { + preg_match('#\{(.*)}(.*)#', $name, $preg); + return mb_convert_encoding($preg[2], "UTF-8", "UTF7-IMAP"); + } + + /** + * @return string + */ + public function getProtocol(): string { + return $this->protocol; + } + + /** + * Retrieve the quota level settings, and usage statics per mailbox + * @param $username + * + * @return Response + */ + public function getQuota($username): Response { + return $this->response("imap_get_quota")->wrap(function($response) use ($username) { + $result = \imap_get_quota($this->stream, 'user.' . $username); + return $result ?: []; + }); + } + + /** + * Retrieve the quota settings per user + * @param string $quota_root + * + * @return Response + */ + public function getQuotaRoot(string $quota_root = 'INBOX'): Response { + return $this->response("imap_get_quotaroot")->wrap(function($response) use ($quota_root) { + $result = \imap_get_quotaroot($this->stream, $this->getAddress() . $quota_root); + return $result ?: []; + }); + } + + /** + * @param string $protocol + * @return LegacyProtocol + */ + public function setProtocol(string $protocol): LegacyProtocol { + if (($pos = strpos($protocol, "legacy")) > 0) { + $protocol = substr($protocol, 0, ($pos + 2) * -1); + } + $this->protocol = $protocol; + return $this; + } + + /** + * Create a new Response instance + * @param string|null $command + * + * @return Response + */ + protected function response(?string $command = ""): Response { + return Response::make(0, $command == "" ? [] : [$command], [], $this->debug); + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Protocol.php b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Protocol.php new file mode 100644 index 00000000..a1404b4b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Protocol.php @@ -0,0 +1,417 @@ + null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ]; + + /** + * SSL stream context options + * + * @see https://www.php.net/manual/en/context.ssl.php for possible options + * + * @var array + */ + protected array $ssl_options = []; + + /** + * Cache for uid of active folder. + * + * @var array + */ + protected array $uid_cache = []; + + /** + * Get an available cryptographic method + * + * @return int + */ + public function getCryptoMethod(): int { + // Allow the best TLS version(s) we can + $cryptoMethod = STREAM_CRYPTO_METHOD_TLS_CLIENT; + + // PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT + // so add them back in manually if we can + if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + }elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT')) { + $cryptoMethod = STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; + } + + return $cryptoMethod; + } + + /** + * Enable SSL certificate validation + * + * @return Protocol + */ + public function enableCertValidation(): Protocol { + $this->cert_validation = true; + return $this; + } + + /** + * Disable SSL certificate validation + * @return Protocol + */ + public function disableCertValidation(): Protocol { + $this->cert_validation = false; + return $this; + } + + /** + * Set SSL certificate validation + * @var int $cert_validation + * + * @return Protocol + */ + public function setCertValidation(int $cert_validation): Protocol { + $this->cert_validation = $cert_validation; + return $this; + } + + /** + * Should we validate SSL certificate? + * + * @return bool + */ + public function getCertValidation(): bool { + return $this->cert_validation; + } + + /** + * Set connection proxy settings + * @var array $options + * + * @return Protocol + */ + public function setProxy(array $options): Protocol { + foreach ($this->proxy as $key => $val) { + if (isset($options[$key])) { + $this->proxy[$key] = $options[$key]; + } + } + + return $this; + } + + /** + * Get the current proxy settings + * + * @return array + */ + public function getProxy(): array { + return $this->proxy; + } + + /** + * Set SSL context options settings + * @var array $options + * + * @return Protocol + */ + public function setSslOptions(array $options): Protocol + { + $this->ssl_options = $options; + + return $this; + } + + /** + * Get the current SSL context options settings + * + * @return array + */ + public function getSslOptions(): array { + return $this->ssl_options; + } + + /** + * Prepare socket options + * @return array + *@var string $transport + * + */ + private function defaultSocketOptions(string $transport): array { + $options = []; + if ($this->encryption) { + $options["ssl"] = [ + 'verify_peer_name' => $this->getCertValidation(), + 'verify_peer' => $this->getCertValidation(), + ]; + + if (count($this->ssl_options)) { + /* Get the ssl context options from the config, but prioritize the 'validate_cert' config over the ssl context options */ + $options["ssl"] = array_replace($this->ssl_options, $options["ssl"]); + } + } + + if ($this->proxy["socket"] != null) { + $options[$transport]["proxy"] = $this->proxy["socket"]; + $options[$transport]["request_fulluri"] = $this->proxy["request_fulluri"]; + + if ($this->proxy["username"] != null) { + $auth = base64_encode($this->proxy["username"].':'.$this->proxy["password"]); + + $options[$transport]["header"] = [ + "Proxy-Authorization: Basic $auth" + ]; + } + } + + return $options; + } + + /** + * Create a new resource stream + * @param $transport + * @param string $host hostname or IP address of IMAP server + * @param int $port of IMAP server, default is 143 (993 for ssl) + * @param int $timeout timeout in seconds for initiating session + * + * @return resource The socket created. + * @throws ConnectionFailedException + */ + public function createStream($transport, string $host, int $port, int $timeout) { + $socket = "$transport://$host:$port"; + $stream = stream_socket_client($socket, $errno, $errstr, $timeout, + STREAM_CLIENT_CONNECT, + stream_context_create($this->defaultSocketOptions($transport)) + ); + + if (!$stream) { + throw new ConnectionFailedException($errstr, $errno); + } + + if (false === stream_set_timeout($stream, $timeout)) { + throw new ConnectionFailedException('Failed to set stream timeout'); + } + + return $stream; + } + + /** + * Get the current connection timeout + * + * @return int + */ + public function getConnectionTimeout(): int { + return $this->connection_timeout; + } + + /** + * Set the connection timeout + * @param int $connection_timeout + * + * @return Protocol + */ + public function setConnectionTimeout(int $connection_timeout): Protocol { + $this->connection_timeout = $connection_timeout; + return $this; + } + + /** + * Get the UID key string + * @param int|string $uid + * + * @return string + */ + public function getUIDKey(int|string $uid): string { + if ($uid == IMAP::ST_UID || $uid == IMAP::FT_UID) { + return "UID"; + } + if (strlen($uid) > 0 && !is_numeric($uid)) { + return (string)$uid; + } + + return ""; + } + + /** + * Build a UID / MSGN command + * @param string $command + * @param int|string $uid + * + * @return string + */ + public function buildUIDCommand(string $command, int|string $uid): string { + return trim($this->getUIDKey($uid)." ".$command); + } + + /** + * Set the uid cache of current active folder + * + * @param array|null $uids + */ + public function setUidCache(?array $uids): void { + if (is_null($uids)) { + $this->uid_cache = []; + return; + } + + $messageNumber = 1; + + $uid_cache = []; + foreach ($uids as $uid) { + $uid_cache[$messageNumber++] = (int)$uid; + } + + $this->uid_cache = $uid_cache; + } + + /** + * Enable the uid cache + * + * @return void + */ + public function enableUidCache(): void { + $this->enable_uid_cache = true; + } + + /** + * Disable the uid cache + * + * @return void + */ + public function disableUidCache(): void { + $this->enable_uid_cache = false; + } + + /** + * Set the encryption method + * @param string $encryption + * + * @return void + */ + public function setEncryption(string $encryption): void { + $this->encryption = $encryption; + } + + /** + * Get the encryption method + * @return string + */ + public function getEncryption(): string { + return $this->encryption; + } + + /** + * Check if the current session is connected + * + * @return bool + */ + public function connected(): bool { + return (bool)$this->stream; + } + + /** + * Retrieves header/metadata from the resource stream + * + * @return array + */ + public function meta(): array { + if (!$this->stream) { + return [ + "crypto" => [ + "protocol" => "", + "cipher_name" => "", + "cipher_bits" => 0, + "cipher_version" => "", + ], + "timed_out" => true, + "blocked" => true, + "eof" => true, + "stream_type" => "tcp_socket/unknown", + "mode" => "c", + "unread_bytes" => 0, + "seekable" => false, + ]; + } + return stream_get_meta_data($this->stream); + } + + /** + * Get the resource stream + * + * @return mixed + */ + public function getStream(): mixed { + return $this->stream; + } + + /** + * Set the Config instance + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ProtocolInterface.php b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ProtocolInterface.php new file mode 100644 index 00000000..eb6d7c9d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/ProtocolInterface.php @@ -0,0 +1,458 @@ + array('delim' => .., 'flags' => ..)) + * @throws RuntimeException + */ + public function folders(string $reference = '', string $folder = '*'): Response; + + /** + * Set message flags + * @param array|string $flags flags to set, add or remove + * @param int $from message for items or start message if $to !== null + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given + * @param bool $silent if false the return values are the new flags for the wanted messages + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * @param string|null $item command used to store a flag + * + * @return Response containing the new flags if $silent is false, else true or false depending on success + * @throws RuntimeException + */ + public function store(array|string $flags, int $from, ?int $to = null, ?string $mode = null, bool $silent = true, int|string $uid = IMAP::ST_UID, ?string $item = null): Response; + + /** + * Append a new message to given folder + * @param string $folder name of target folder + * @param string $message full message content + * @param array|null $flags flags for new message + * @param string|null $date date for new message + * + * @return Response + * @throws RuntimeException + */ + public function appendMessage(string $folder, string $message, ?array $flags = null, ?string $date = null): Response; + + /** + * Copy message set from current folder to other folder + * + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + */ + public function copyMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response; + + /** + * Copy multiple messages to the target folder + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response Tokens if operation successful, false if an error occurred + * @throws RuntimeException + */ + public function copyManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response; + + /** + * Move a message set from current folder to another folder + * @param string $folder destination folder + * @param $from + * @param int|null $to if null only one message ($from) is fetched, else it's the + * last message, INF means last message available + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + */ + public function moveMessage(string $folder, $from, ?int $to = null, int|string $uid = IMAP::ST_UID): Response; + + /** + * Move multiple messages to the target folder + * + * @param array $messages List of message identifiers + * @param string $folder Destination folder + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response Tokens if operation successful, false if an error occurred + * @throws RuntimeException + */ + public function moveManyMessages(array $messages, string $folder, int|string $uid = IMAP::ST_UID): Response; + + /** + * Exchange identification information + * Ref.: https://datatracker.ietf.org/doc/html/rfc2971 + * + * @param null $ids + * @return Response + * + * @throws RuntimeException + */ + public function ID($ids = null): Response; + + /** + * Create a new folder + * + * @param string $folder folder name + * @return Response + * @throws RuntimeException + */ + public function createFolder(string $folder): Response; + + /** + * Rename an existing folder + * + * @param string $old old name + * @param string $new new name + * @return Response + * @throws RuntimeException + */ + public function renameFolder(string $old, string $new): Response; + + /** + * Delete a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function deleteFolder(string $folder): Response; + + /** + * Subscribe to a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function subscribeFolder(string $folder): Response; + + /** + * Unsubscribe from a folder + * + * @param string $folder folder name + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function unsubscribeFolder(string $folder): Response; + + /** + * Send idle command + * + * @throws RuntimeException + */ + public function idle(); + + /** + * Send done command + * @throws RuntimeException + */ + public function done(); + + /** + * Apply session saved changes to the server + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function expunge(): Response; + + /** + * Retrieve the quota level settings, and usage statics per mailbox + * @param $username + * + * @return Response + * @throws RuntimeException + */ + public function getQuota($username): Response; + + /** + * Retrieve the quota settings per user + * + * @param string $quota_root + * + * @return Response + * @throws ConnectionFailedException + */ + public function getQuotaRoot(string $quota_root = 'INBOX'): Response; + + /** + * Send noop command + * + * @return Response + * + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function noop(): Response; + + /** + * Do a search request + * + * @param array $params + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response containing the message ids + * @throws RuntimeException + */ + public function search(array $params, int|string $uid = IMAP::ST_UID): Response; + + /** + * Get a message overview + * @param string $sequence uid sequence + * @param int|string $uid set to IMAP::ST_UID or any string representing the UID - set to IMAP::ST_MSGN to use + * message numbers instead. + * + * @return Response + * @throws RuntimeException + * @throws MessageNotFoundException + * @throws InvalidMessageDateException + */ + public function overview(string $sequence, int|string $uid = IMAP::ST_UID): Response; + + /** + * Enable the debug mode + */ + public function enableDebug(); + + /** + * Disable the debug mode + */ + public function disableDebug(); + + /** + * Enable uid caching + */ + public function enableUidCache(); + + /** + * Disable uid caching + */ + public function disableUidCache(); + + /** + * Set the uid cache of current active folder + * + * @param array|null $uids + */ + public function setUidCache(?array $uids); +} diff --git a/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Response.php b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Response.php new file mode 100644 index 00000000..9a30d56d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Connection/Protocols/Response.php @@ -0,0 +1,417 @@ +debug = $debug; + $this->noun = $noun > 0 ? $noun : (int)str_replace(".", "", (string)microtime(true)); + } + + /** + * Make a new response instance + * @param int $noun + * @param array $commands + * @param array $responses + * @param bool $debug + * + * @return Response + */ + public static function make(int $noun, array $commands = [], array $responses = [], bool $debug = false): Response { + return (new self($noun, $debug))->setCommands($commands)->setResponse($responses); + } + + /** + * Create a new empty response + * @param bool $debug + * + * @return Response + */ + public static function empty(bool $debug = false): Response { + return (new self(0, $debug)); + } + + /** + * Stack another response + * @param Response $response + * + * @return void + */ + public function stack(Response $response): void { + $this->response_stack[] = $response; + } + + /** + * Get the associated response stack + * + * @return array + */ + public function getStack(): array { + return $this->response_stack; + } + + /** + * Get all assigned commands + * + * @return array + */ + public function getCommands(): array { + return $this->commands; + } + + /** + * Add a new command + * @param string $command + * + * @return Response + */ + public function addCommand(string $command): Response { + $this->commands[] = $command; + return $this; + } + + /** + * Set and overwrite all commands + * @param array $commands + * + * @return Response + */ + public function setCommands(array $commands): Response { + $this->commands = $commands; + return $this; + } + + /** + * Get all set errors + * + * @return array + */ + public function getErrors(): array { + $errors = $this->errors; + foreach($this->getStack() as $response) { + $errors = array_merge($errors, $response->getErrors()); + } + return $errors; + } + + /** + * Set and overwrite all existing errors + * @param array $errors + * + * @return Response + */ + public function setErrors(array $errors): Response { + $this->errors = $errors; + return $this; + } + + /** + * Set the response + * @param string $error + * + * @return Response + */ + public function addError(string $error): Response { + $this->errors[] = $error; + return $this; + } + + /** + * Set the response + * @param array $response + * + * @return Response + */ + public function addResponse(mixed $response): Response { + $this->response[] = $response; + return $this; + } + + /** + * Set the response + * @param array $response + * + * @return Response + */ + public function setResponse(array $response): Response { + $this->response = $response; + return $this; + } + + /** + * Get the assigned response + * + * @return array + */ + public function getResponse(): array { + return $this->response; + } + + /** + * Set the result data + * @param mixed $result + * + * @return Response + */ + public function setResult(mixed $result): Response { + $this->result = $result; + return $this; + } + + /** + * Wrap a result bearing action + * @param callable $callback + * + * @return Response + */ + public function wrap(callable $callback): Response { + $this->result = call_user_func($callback, $this); + return $this; + } + + /** + * Get the response data + * + * @return mixed + */ + public function data(): mixed { + if ($this->result !== null) { + return $this->result; + } + return $this->getResponse(); + } + + /** + * Get the response data as array + * + * @return array + */ + public function array(): array { + $data = $this->data(); + if(is_array($data)){ + return $data; + } + return [$data]; + } + + /** + * Get the response data as string + * + * @return string + */ + public function string(): string { + $data = $this->data(); + if(is_array($data)){ + return implode(" ", $data); + } + return (string)$data; + } + + /** + * Get the response data as integer + * + * @return int + */ + public function integer(): int { + $data = $this->data(); + if(is_array($data) && isset($data[0])){ + return (int)$data[0]; + } + return (int)$data; + } + + /** + * Get the response data as boolean + * + * @return bool + */ + public function boolean(): bool { + return (bool)$this->data(); + } + + /** + * Validate and retrieve the response data + * + * @throws ResponseException + */ + public function validatedData(): mixed { + return $this->validate()->data(); + } + + /** + * Validate the response date + * + * @throws ResponseException + */ + public function validate(): Response { + if ($this->failed()) { + throw ResponseException::make($this, $this->debug); + } + return $this; + } + + /** + * Check if the Response can be considered successful + * + * @return bool + */ + public function successful(): bool { + foreach(array_merge($this->getResponse(), $this->array()) as $data) { + if (!$this->verify_data($data)) { + return false; + } + } + foreach($this->getStack() as $response) { + if (!$response->successful()) { + return false; + } + } + return ($this->boolean() || $this->canBeEmpty()) && !$this->getErrors(); + } + + + /** + * Check if the Response can be considered failed + * @param mixed $data + * + * @return bool + */ + public function verify_data(mixed $data): bool { + if (is_array($data)) { + foreach ($data as $line) { + if (is_array($line)) { + if(!$this->verify_data($line)){ + return false; + } + }else{ + if (!$this->verify_line((string)$line)) { + return false; + } + } + } + }else{ + if (!$this->verify_line((string)$data)) { + return false; + } + } + return true; + } + + /** + * Verify a single line + * @param string $line + * + * @return bool + */ + public function verify_line(string $line): bool { + return !str_starts_with($line, "TAG".$this->noun." BAD ") && !str_starts_with($line, "TAG".$this->noun." NO "); + } + + /** + * Check if the Response can be considered failed + * + * @return bool + */ + public function failed(): bool { + return !$this->successful(); + } + + /** + * Get the Response noun + * + * @return int + */ + public function Noun(): int { + return $this->noun; + } + + /** + * Set the Response to be allowed to be empty + * @param bool $can_be_empty + * + * @return $this + */ + public function setCanBeEmpty(bool $can_be_empty): Response { + $this->can_be_empty = $can_be_empty; + return $this; + } + + /** + * Check if the Response can be empty + * + * @return bool + */ + public function canBeEmpty(): bool { + return $this->can_be_empty; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Decoder/AttachmentDecoder.php b/plugins/vendor/webklex/php-imap/src/Decoder/AttachmentDecoder.php new file mode 100644 index 00000000..22780353 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Decoder/AttachmentDecoder.php @@ -0,0 +1,25 @@ +options = array_merge([ + 'header' => 'utf-8', + 'message' => 'utf-8', + 'attachment' => 'utf-8', + ], $this->options); + } + + /** + * Decode a given value + * @param array|string|null $value + * @param string|null $encoding + * @return mixed + */ + public function decode(array|string|null $value, ?string $encoding = null): mixed { + return $value; + } + + /** + * Convert the encoding + * @param string $str The string to convert + * @param string $from The source encoding + * @param string $to The target encoding + * + * @return mixed|string + */ + public function convertEncoding(string $str, string $from = "ISO-8859-2", string $to = "UTF-8"): mixed { + $from = EncodingAliases::get($from, $this->fallback_encoding); + $to = EncodingAliases::get($to, $this->fallback_encoding); + + if ($from === $to) { + return $str; + } + + return EncodingAliases::convert($str, $from, $to); + } + + /** + * Decode MIME header elements + * @link https://php.net/manual/en/function.imap-mime-header-decode.php + * @param string $text The MIME text + * + * @return array Returns an array of objects. Each *object has two properties, charset and text. + */ + public function mimeHeaderDecode(string $text): array { + if (extension_loaded('imap')) { + $result = \imap_mime_header_decode($text); + return is_array($result) ? $result : []; + } + $charset = $this->getEncoding($text); + return [(object)[ + "charset" => $charset, + "text" => $this->convertEncoding($text, $charset) + ]]; + } + + /** + * Test if a given value is utf-8 encoded + * @param $value + * + * @return bool + */ + public static function isUTF8($value): bool { + return str_starts_with(strtolower($value), '=?utf-8?'); + } + + /** + * Check if a given pair of strings has been decoded + * @param $encoded + * @param $decoded + * + * @return bool + */ + public static function notDecoded($encoded, $decoded): bool { + return str_starts_with($decoded, '=?') + && strlen($decoded) - 2 === strpos($decoded, '?=') + && str_contains($encoded, $decoded); + } + + /** + * Set the configuration used for decoding + * @param array $config + * + * @return Decoder + */ + public function setOptions(array $config): static { + $this->options = $config; + return $this; + } + + /** + * Get the configuration used for decoding + * + * @return array + */ + public function getOptions(): array { + return $this->options; + } + + /** + * Get the fallback encoding + * + * @return string + */ + public function getFallbackEncoding(): string { + return $this->fallback_encoding; + } + + /** + * Set the fallback encoding + * + * @param string $fallback_encoding + * @return Decoder + */ + public function setFallbackEncoding(string $fallback_encoding): static { + $this->fallback_encoding = $fallback_encoding; + return $this; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Decoder/DecoderInterface.php b/plugins/vendor/webklex/php-imap/src/Decoder/DecoderInterface.php new file mode 100644 index 00000000..e4874602 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Decoder/DecoderInterface.php @@ -0,0 +1,52 @@ +decodeHeaderArray($value); + } + $original_value = $value; + $decoder = $this->options['header']; + + if ($value !== null) { + if ($decoder === 'utf-8') { + $decoded_values = $this->mimeHeaderDecode($value); + $tempValue = ""; + foreach ($decoded_values as $decoded_value) { + $tempValue .= $this->convertEncoding($decoded_value->text, $decoded_value->charset); + } + if ($tempValue) { + $value = $tempValue; + } else if (extension_loaded('imap')) { + $value = \imap_utf8($value); + } else if (function_exists('iconv_mime_decode')) { + $value = iconv_mime_decode($value, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, "UTF-8"); + } else { + $value = mb_decode_mimeheader($value); + } + } elseif ($decoder === 'iconv') { + $value = iconv_mime_decode($value, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, "UTF-8"); + } else if (self::isUTF8($value)) { + $value = mb_decode_mimeheader($value); + } + + if (self::notDecoded($original_value, $value)) { + $value = $this->convertEncoding($original_value, $this->getEncoding($original_value)); + } + } + + return $value; + } + + /** + * Get the encoding of a given abject + * @param object|string $structure + * + * @return string + */ + public function getEncoding(object|string $structure): string { + if (property_exists($structure, 'parameters')) { + foreach ($structure->parameters as $parameter) { + if (strtolower($parameter->attribute) == "charset") { + return EncodingAliases::get($parameter->value == "default" ? EncodingAliases::detectEncoding($parameter->value) : $parameter->value, $this->fallback_encoding); + } + } + } elseif (property_exists($structure, 'charset')) { + return EncodingAliases::get($structure->charset == "default" ? EncodingAliases::detectEncoding($structure->charset) : $structure->charset, $this->fallback_encoding); + } elseif (is_string($structure) === true) { + $result = mb_detect_encoding($structure); + return $result === false ? $this->fallback_encoding : $result; + } + + return $this->fallback_encoding; + } + + + /** + * Decode a given array + * @param array $values + * + * @return array + */ + private function decodeHeaderArray(array $values): array { + foreach ($values as $key => $value) { + $values[$key] = $this->decode($value); + } + return $values; + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Decoder/MessageDecoder.php b/plugins/vendor/webklex/php-imap/src/Decoder/MessageDecoder.php new file mode 100644 index 00000000..4a2cff2f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Decoder/MessageDecoder.php @@ -0,0 +1,119 @@ +decode($item); + }, $value); + } + + switch ($encoding) { + case IMAP::MESSAGE_ENC_BINARY: + if (extension_loaded('imap')) { + return base64_decode(\imap_binary($value)); + } + return base64_decode($value); + case IMAP::MESSAGE_ENC_BASE64: + return base64_decode($value); + case IMAP::MESSAGE_ENC_QUOTED_PRINTABLE: + return quoted_printable_decode($value); + case IMAP::MESSAGE_ENC_8BIT: + case IMAP::MESSAGE_ENC_7BIT: + case IMAP::MESSAGE_ENC_OTHER: + default: + return $value; + } + } + + /** + * Get the encoding of a given abject + * @param object|string $structure + * + * @return string + */ + public function getEncoding(object|string $structure): string { + if (property_exists($structure, 'parameters')) { + foreach ($structure->parameters as $parameter) { + if (strtolower($parameter->attribute) == "charset") { + return EncodingAliases::get($parameter->value, "ISO-8859-2"); + } + } + } elseif (property_exists($structure, 'charset')) { + return EncodingAliases::get($structure->charset, "ISO-8859-2"); + } elseif (is_string($structure) === true) { + return EncodingAliases::detectEncoding($structure); + } + + return $this->fallback_encoding; + } + + + /** + * Convert the encoding + * @param $str + * @param string $from + * @param string $to + * + * @return mixed|string + */ + public function convertEncoding($str, string $from = "ISO-8859-2", string $to = "UTF-8"): mixed { + $from = EncodingAliases::get($from); + $to = EncodingAliases::get($to); + + if ($from === $to) { + return $str; + } + + // We don't need to do convertEncoding() if charset is ASCII (us-ascii): + // ASCII is a subset of UTF-8, so all ASCII files are already UTF-8 encoded + // https://stackoverflow.com/a/11303410 + // + // us-ascii is the same as ASCII: + // ASCII is the traditional name for the encoding system; the Internet Assigned Numbers Authority (IANA) + // prefers the updated name US-ASCII, which clarifies that this system was developed in the US and + // based on the typographical symbols predominantly in use there. + // https://en.wikipedia.org/wiki/ASCII + // + // convertEncoding() function basically means convertToUtf8(), so when we convert ASCII string into UTF-8 it gets broken. + if (strtolower($from ?? '') == 'us-ascii' && $to == 'UTF-8') { + return $str; + } + + if (function_exists('iconv') && !EncodingAliases::isUtf7($from) && !EncodingAliases::isUtf7($to)) { + try { + return iconv($from, $to.'//IGNORE', $str); + } catch (Exception) { + return @iconv($from, $to, $str); + } + } else { + if (!$from) { + return mb_convert_encoding($str, $to); + } + return mb_convert_encoding($str, $to, $from); + } + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/EncodingAliases.php b/plugins/vendor/webklex/php-imap/src/EncodingAliases.php new file mode 100644 index 00000000..8a3dc0fb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/EncodingAliases.php @@ -0,0 +1,591 @@ + "us-ascii", + "us-ascii" => "us-ascii", + "ansi_x3.4-1968" => "us-ascii", + "646" => "us-ascii", + "iso-8859-1" => "ISO-8859-1", + "iso-8859-2" => "ISO-8859-2", + "iso-8859-3" => "ISO-8859-3", + "iso-8859-4" => "ISO-8859-4", + "iso-8859-5" => "ISO-8859-5", + "iso-8859-6" => "ISO-8859-6", + "iso-8859-6-i" => "ISO-8859-6-I", + "iso-8859-6-e" => "ISO-8859-6-E", + "iso-8859-7" => "ISO-8859-7", + "iso-8859-8" => "ISO-8859-8", + "iso-8859-8-i" => "ISO-8859-8-I", + "iso-8859-8-e" => "ISO-8859-8-E", + "iso-8859-9" => "ISO-8859-9", + "iso-8859-10" => "ISO-8859-10", + "iso-8859-11" => "ISO-8859-11", + "iso-8859-13" => "ISO-8859-13", + "iso-8859-14" => "ISO-8859-14", + "iso-8859-15" => "ISO-8859-15", + "iso-8859-16" => "ISO-8859-16", + "iso-ir-111" => "ISO-IR-111", + "iso-2022-cn" => "ISO-2022-CN", + "iso-2022-cn-ext" => "ISO-2022-CN", + "iso-2022-kr" => "ISO-2022-KR", + "iso-2022-jp" => "ISO-2022-JP", + "utf-16be" => "UTF-16BE", + "utf-16le" => "UTF-16LE", + "utf-16" => "UTF-16", + "windows-1250" => "windows-1250", + "windows-1251" => "windows-1251", + "windows-1252" => "windows-1252", + "windows-1253" => "windows-1253", + "windows-1254" => "windows-1254", + "windows-1255" => "windows-1255", + "windows-1256" => "windows-1256", + "windows-1257" => "windows-1257", + "windows-1258" => "windows-1258", + "ibm866" => "IBM866", + "ibm850" => "IBM850", + "ibm852" => "IBM852", + "ibm855" => "IBM855", + "ibm857" => "IBM857", + "ibm862" => "IBM862", + "ibm864" => "IBM864", + "utf-8" => "UTF-8", + "utf-7" => "UTF-7", + "utf-7-imap" => "UTF7-IMAP", + "utf7-imap" => "UTF7-IMAP", + "shift_jis" => "Shift_JIS", + "big5" => "Big5", + "euc-jp" => "EUC-JP", + "euc-kr" => "EUC-KR", + "gb2312" => "GB2312", + "gb18030" => "gb18030", + "viscii" => "VISCII", + "koi8-r" => "KOI8-R", + "koi8_r" => "KOI8-R", + "cskoi8r" => "KOI8-R", + "koi" => "KOI8-R", + "koi8" => "KOI8-R", + "koi8-u" => "KOI8-U", + "tis-620" => "TIS-620", + "t.61-8bit" => "T.61-8bit", + "hz-gb-2312" => "HZ-GB-2312", + "big5-hkscs" => "Big5-HKSCS", + "gbk" => "gbk", + "cns11643" => "x-euc-tw", + // + // Aliases for ISO-8859-1 + // + "latin1" => "ISO-8859-1", + "iso_8859-1" => "ISO-8859-1", + "iso8859-1" => "ISO-8859-1", + "iso8859-2" => "ISO-8859-2", + "iso8859-3" => "ISO-8859-3", + "iso8859-4" => "ISO-8859-4", + "iso8859-5" => "ISO-8859-5", + "iso8859-6" => "ISO-8859-6", + "iso8859-7" => "ISO-8859-7", + "iso8859-8" => "ISO-8859-8", + "iso8859-9" => "ISO-8859-9", + "iso8859-10" => "ISO-8859-10", + "iso8859-11" => "ISO-8859-11", + "iso8859-13" => "ISO-8859-13", + "iso8859-14" => "ISO-8859-14", + "iso8859-15" => "ISO-8859-15", + "iso_8859-1:1987" => "ISO-8859-1", + "iso-ir-100" => "ISO-8859-1", + "l1" => "ISO-8859-1", + "ibm819" => "ISO-8859-1", + "cp819" => "ISO-8859-1", + "csisolatin1" => "ISO-8859-1", + // + // Aliases for ISO-8859-2 + // + "latin2" => "ISO-8859-2", + "iso_8859-2" => "ISO-8859-2", + "iso_8859-2:1987" => "ISO-8859-2", + "iso-ir-101" => "ISO-8859-2", + "l2" => "ISO-8859-2", + "csisolatin2" => "ISO-8859-2", + // + // Aliases for ISO-8859-3 + // + "latin3" => "ISO-8859-3", + "iso_8859-3" => "ISO-8859-3", + "iso_8859-3:1988" => "ISO-8859-3", + "iso-ir-109" => "ISO-8859-3", + "l3" => "ISO-8859-3", + "csisolatin3" => "ISO-8859-3", + // + // Aliases for ISO-8859-4 + // + "latin4" => "ISO-8859-4", + "iso_8859-4" => "ISO-8859-4", + "iso_8859-4:1988" => "ISO-8859-4", + "iso-ir-110" => "ISO-8859-4", + "l4" => "ISO-8859-4", + "csisolatin4" => "ISO-8859-4", + // + // Aliases for ISO-8859-5 + // + "cyrillic" => "ISO-8859-5", + "iso_8859-5" => "ISO-8859-5", + "iso_8859-5:1988" => "ISO-8859-5", + "iso-ir-144" => "ISO-8859-5", + "csisolatincyrillic" => "ISO-8859-5", + // + // Aliases for ISO-8859-6 + // + "arabic" => "ISO-8859-6", + "iso_8859-6" => "ISO-8859-6", + "iso_8859-6:1987" => "ISO-8859-6", + "iso-ir-127" => "ISO-8859-6", + "ecma-114" => "ISO-8859-6", + "asmo-708" => "ISO-8859-6", + "csisolatinarabic" => "ISO-8859-6", + // + // Aliases for ISO-8859-6-I + // + "csiso88596i" => "ISO-8859-6-I", + // + // Aliases for ISO-8859-6-E", + // + "csiso88596e" => "ISO-8859-6-E", + // + // Aliases for ISO-8859-7", + // + "greek" => "ISO-8859-7", + "greek8" => "ISO-8859-7", + "sun_eu_greek" => "ISO-8859-7", + "iso_8859-7" => "ISO-8859-7", + "iso_8859-7:1987" => "ISO-8859-7", + "iso-ir-126" => "ISO-8859-7", + "elot_928" => "ISO-8859-7", + "ecma-118" => "ISO-8859-7", + "csisolatingreek" => "ISO-8859-7", + // + // Aliases for ISO-8859-8", + // + "hebrew" => "ISO-8859-8", + "iso_8859-8" => "ISO-8859-8", + "visual" => "ISO-8859-8", + "iso_8859-8:1988" => "ISO-8859-8", + "iso-ir-138" => "ISO-8859-8", + "csisolatinhebrew" => "ISO-8859-8", + // + // Aliases for ISO-8859-8-I", + // + "csiso88598i" => "ISO-8859-8-I", + "iso-8859-8i" => "ISO-8859-8-I", + "logical" => "ISO-8859-8-I", + // + // Aliases for ISO-8859-8-E", + // + "csiso88598e" => "ISO-8859-8-E", + // + // Aliases for ISO-8859-9", + // + "latin5" => "ISO-8859-9", + "iso_8859-9" => "ISO-8859-9", + "iso_8859-9:1989" => "ISO-8859-9", + "iso-ir-148" => "ISO-8859-9", + "l5" => "ISO-8859-9", + "csisolatin5" => "ISO-8859-9", + // + // Aliases for UTF-8", + // + "unicode-1-1-utf-8" => "UTF-8", + // nl_langinfo(CODESET) in HP/UX returns 'utf8' under UTF-8 locales", + "utf8" => "UTF-8", + // + // Aliases for Shift_JIS", + // + "x-sjis" => "Shift_JIS", + "shift-jis" => "Shift_JIS", + "ms_kanji" => "Shift_JIS", + "csshiftjis" => "Shift_JIS", + "windows-31j" => "Shift_JIS", + "cp932" => "Shift_JIS", + "sjis" => "Shift_JIS", + // + // Aliases for EUC_JP", + // + "cseucpkdfmtjapanese" => "EUC-JP", + "x-euc-jp" => "EUC-JP", + // + // Aliases for ISO-2022-JP", + // + "csiso2022jp" => "ISO-2022-JP", + // The following are really not aliases ISO-2022-JP, but sharing the same decoder", + "iso-2022-jp-2" => "ISO-2022-JP", + "csiso2022jp2" => "ISO-2022-JP", + // + // Aliases for Big5", + // + "csbig5" => "Big5", + "cn-big5" => "Big5", + // x-x-big5 is not really a alias for Big5, add it only for MS FrontPage", + "x-x-big5" => "Big5", + // Sun Solaris", + "zh_tw-big5" => "Big5", + // + // Aliases for EUC-KR", + // + "cseuckr" => "EUC-KR", + "ks_c_5601-1987" => "EUC-KR", + "iso-ir-149" => "EUC-KR", + "ks_c_5601-1989" => "EUC-KR", + "ksc_5601" => "EUC-KR", + "ksc5601" => "EUC-KR", + "korean" => "EUC-KR", + "csksc56011987" => "EUC-KR", + "5601" => "EUC-KR", + "windows-949" => "EUC-KR", + // + // Aliases for GB2312", + // + // The following are really not aliases GB2312, add them only for MS FrontPage", + "gb_2312-80" => "GB2312", + "iso-ir-58" => "GB2312", + "chinese" => "GB2312", + "csiso58gb231280" => "GB2312", + "csgb2312" => "GB2312", + "zh_cn.euc" => "GB2312", + // Sun Solaris", + "gb_2312" => "GB2312", + // + // Aliases for windows-125x ", + // + "x-cp1250" => "windows-1250", + "x-cp1251" => "windows-1251", + "x-cp1252" => "windows-1252", + "x-cp1253" => "windows-1253", + "x-cp1254" => "windows-1254", + "x-cp1255" => "windows-1255", + "x-cp1256" => "windows-1256", + "x-cp1257" => "windows-1257", + "x-cp1258" => "windows-1258", + // + // Aliases for windows-874 ", + // + "windows-874" => "windows-874", + "ibm874" => "windows-874", + "dos-874" => "windows-874", + // + // Aliases for macintosh", + // + "macintosh" => "macintosh", + "x-mac-roman" => "macintosh", + "mac" => "macintosh", + "csmacintosh" => "macintosh", + // + // Aliases for IBM866", + // + "cp866" => "IBM866", + "cp-866" => "IBM866", + "866" => "IBM866", + "csibm866" => "IBM866", + // + // Aliases for IBM850", + // + "cp850" => "IBM850", + "850" => "IBM850", + "csibm850" => "IBM850", + // + // Aliases for IBM852", + // + "cp852" => "IBM852", + "852" => "IBM852", + "csibm852" => "IBM852", + // + // Aliases for IBM855", + // + "cp855" => "IBM855", + "855" => "IBM855", + "csibm855" => "IBM855", + // + // Aliases for IBM857", + // + "cp857" => "IBM857", + "857" => "IBM857", + "csibm857" => "IBM857", + // + // Aliases for IBM862", + // + "cp862" => "IBM862", + "862" => "IBM862", + "csibm862" => "IBM862", + // + // Aliases for IBM864", + // + "cp864" => "IBM864", + "864" => "IBM864", + "csibm864" => "IBM864", + "ibm-864" => "IBM864", + // + // Aliases for T.61-8bit", + // + "t.61" => "T.61-8bit", + "iso-ir-103" => "T.61-8bit", + "csiso103t618bit" => "T.61-8bit", + // + // Aliases for UTF-7", + // + "x-unicode-2-0-utf-7" => "UTF-7", + "unicode-2-0-utf-7" => "UTF-7", + "unicode-1-1-utf-7" => "UTF-7", + "csunicode11utf7" => "UTF-7", + // + // Aliases for ISO-10646-UCS-2", + // + "csunicode" => "UTF-16BE", + "csunicode11" => "UTF-16BE", + "iso-10646-ucs-basic" => "UTF-16BE", + "csunicodeascii" => "UTF-16BE", + "iso-10646-unicode-latin1" => "UTF-16BE", + "csunicodelatin1" => "UTF-16BE", + "iso-10646" => "UTF-16BE", + "iso-10646-j-1" => "UTF-16BE", + // + // Aliases for ISO-8859-10", + // + "latin6" => "ISO-8859-10", + "iso-ir-157" => "ISO-8859-10", + "l6" => "ISO-8859-10", + // Currently .properties cannot handle : in key", + //iso_8859-10:1992" => "ISO-8859-10", + "csisolatin6" => "ISO-8859-10", + // + // Aliases for ISO-8859-15", + // + "iso_8859-15" => "ISO-8859-15", + "csisolatin9" => "ISO-8859-15", + "l9" => "ISO-8859-15", + // + // Aliases for ISO-IR-111", + // + "ecma-cyrillic" => "ISO-IR-111", + "csiso111ecmacyrillic" => "ISO-IR-111", + // + // Aliases for ISO-2022-KR", + // + "csiso2022kr" => "ISO-2022-KR", + // + // Aliases for VISCII", + // + "csviscii" => "VISCII", + // + // Aliases for x-euc-tw", + // + "zh_tw-euc" => "x-euc-tw", + // + // Following names appears in unix nl_langinfo(CODESET)", + // They can be compiled as platform specific if necessary", + // DONT put things here if it does not look generic enough (like hp15CN)", + // + "iso88591" => "ISO-8859-1", + "iso88592" => "ISO-8859-2", + "iso88593" => "ISO-8859-3", + "iso88594" => "ISO-8859-4", + "iso88595" => "ISO-8859-5", + "iso88596" => "ISO-8859-6", + "iso88597" => "ISO-8859-7", + "iso88598" => "ISO-8859-8", + "iso88599" => "ISO-8859-9", + "iso885910" => "ISO-8859-10", + "iso885911" => "ISO-8859-11", + "iso885912" => "ISO-8859-12", + "iso885913" => "ISO-8859-13", + "iso885914" => "ISO-8859-14", + "iso885915" => "ISO-8859-15", + "cp1250" => "windows-1250", + "cp1251" => "windows-1251", + "cp1252" => "windows-1252", + "cp1253" => "windows-1253", + "cp1254" => "windows-1254", + "cp1255" => "windows-1255", + "cp1256" => "windows-1256", + "cp1257" => "windows-1257", + "cp1258" => "windows-1258", + "x-gbk" => "gbk", + "windows-936" => "gbk", + "ansi-1251" => "windows-1251", + ]; + + /** + * Returns proper encoding mapping, if exists. If it doesn't, return unchanged $encoding + * @param string|null $encoding + * @param string|null $fallback + * + * @return string + */ + public static function get(?string $encoding, ?string $fallback = null): string { + if (isset(self::$aliases[strtolower($encoding ?? '')])) { + return self::$aliases[strtolower($encoding ?? '')]; + } + return $fallback ?: $encoding; + } + + + /** + * Convert the encoding of a string + * @param $str + * @param string $from + * @param string $to + * + * @return mixed + */ + public static function convert($str, string $from = "ISO-8859-2", string $to = "UTF-8"): mixed { + $from = self::get($from, self::detectEncoding($str)); + $to = self::get($to, self::detectEncoding($str)); + + if ($from === $to) { + return $str; + } + + // We don't need to do convertEncoding() if charset is ASCII (us-ascii): + // ASCII is a subset of UTF-8, so all ASCII files are already UTF-8 encoded + // https://stackoverflow.com/a/11303410 + // + // us-ascii is the same as ASCII: + // ASCII is the traditional name for the encoding system; the Internet Assigned Numbers Authority (IANA) + // prefers the updated name US-ASCII, which clarifies that this system was developed in the US and + // based on the typographical symbols predominantly in use there. + // https://en.wikipedia.org/wiki/ASCII + // + // convertEncoding() function basically means convertToUtf8(), so when we convert ASCII string into UTF-8 it gets broken. + if (strtolower($from) == 'us-ascii' && $to == 'UTF-8') { + return $str; + } + + try { + if (function_exists('iconv') && !self::isUtf7($from) && !self::isUtf7($to)) { + return iconv($from, $to, $str); + } + if (!$from) { + return mb_convert_encoding($str, $to); + } + return mb_convert_encoding($str, $to, $from); + } catch (\Exception $e) { + if (str_contains($from, '-')) { + $from = str_replace('-', '', $from); + return self::convert($str, $from, $to); + } + return $str; + } + } + + /** + * Attempts to detect the encoding of a string + * @param string $string + * + * @return string + */ + public static function detectEncoding(string $string): string { + $encoding = mb_detect_encoding($string, array_filter(self::getEncodings(), function($value){ + return !in_array($value, [ + 'ISO-8859-6-I', 'ISO-8859-6-E', 'ISO-8859-8-I', 'ISO-8859-8-E', + 'ISO-8859-11', 'ISO-8859-13', 'ISO-8859-14', 'ISO-8859-15', 'ISO-8859-16', 'ISO-IR-111',"ISO-2022-CN", + "windows-1250", "windows-1253", "windows-1255", "windows-1256", "windows-1257", "windows-1258", + "IBM852", "IBM855", "IBM857", "IBM866", "IBM864", "IBM862", "KOI8-R", "KOI8-U", + "TIS-620", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", + "VISCII", "T.61-8bit", "Big5-HKSCS", "windows-874", "macintosh", "ISO-8859-12", "ISO-8859-7", + "IMAP-UTF-7" + ]); + }), true); + if ($encoding === false) { + $encoding = 'UTF-8'; + } + return $encoding; + } + + /** + * Returns all available encodings + * + * @return array + */ + public static function getEncodings(): array { + $encodings = []; + foreach (self::$aliases as $encoding) { + if (!in_array($encoding, $encodings)) { + $encodings[] = $encoding; + } + } + return $encodings; + } + + /** + * Returns true if the encoding is UTF-7 like + * @param string $encoding + * + * @return bool + */ + public static function isUtf7(string $encoding): bool { + return str_contains(str_replace("-", "", strtolower($encoding)), "utf7"); + } + + /** + * Check if an encoding is supported + * @param string $encoding + * + * @return bool + */ + public static function has(string $encoding): bool { + return isset(self::$aliases[strtolower($encoding)]); + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/Event.php b/plugins/vendor/webklex/php-imap/src/Events/Event.php new file mode 100644 index 00000000..f9e3e8f6 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/Event.php @@ -0,0 +1,28 @@ +message = $arguments[0]; + $this->flag = $arguments[1]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/FolderDeletedEvent.php b/plugins/vendor/webklex/php-imap/src/Events/FolderDeletedEvent.php new file mode 100644 index 00000000..89b5083f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/FolderDeletedEvent.php @@ -0,0 +1,22 @@ +old_folder = $folders[0]; + $this->new_folder = $folders[1]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/FolderNewEvent.php b/plugins/vendor/webklex/php-imap/src/Events/FolderNewEvent.php new file mode 100644 index 00000000..0c576cad --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/FolderNewEvent.php @@ -0,0 +1,36 @@ +folder = $folders[0]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/MessageCopiedEvent.php b/plugins/vendor/webklex/php-imap/src/Events/MessageCopiedEvent.php new file mode 100644 index 00000000..a6a3a447 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/MessageCopiedEvent.php @@ -0,0 +1,22 @@ +old_message = $messages[0]; + $this->new_message = $messages[1]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/MessageNewEvent.php b/plugins/vendor/webklex/php-imap/src/Events/MessageNewEvent.php new file mode 100644 index 00000000..38892c49 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/MessageNewEvent.php @@ -0,0 +1,36 @@ +message = $messages[0]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Events/MessageRestoredEvent.php b/plugins/vendor/webklex/php-imap/src/Events/MessageRestoredEvent.php new file mode 100644 index 00000000..25b6520a --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Events/MessageRestoredEvent.php @@ -0,0 +1,22 @@ +getErrors() as $error) { + $message .= "\t- $error\n"; + } + + if(!$response->data()) { + $message .= "\t- Empty response\n"; + } + + if ($debug) { + $message .= self::debug_message($response); + } + + foreach($response->getStack() as $_response) { + $exception = self::make($_response, $debug, $exception); + } + + return new self($message."Error occurred", 0, $exception); + } + + /** + * Generate a debug message containing all commands send and responses received + * @param Response $response + * + * @return string + */ + protected static function debug_message(Response $response): string { + $commands = $response->getCommands(); + $message = "Commands send:\n"; + if ($commands) { + foreach($commands as $command) { + $message .= "\t".str_replace("\r\n", "\\r\\n", $command)."\n"; + } + }else{ + $message .= "\tNo command send!\n"; + } + + $responses = $response->getResponse(); + $message .= "Responses received:\n"; + if ($responses) { + foreach($responses as $_response) { + if (is_array($_response)) { + foreach($_response as $value) { + $message .= "\t".str_replace("\r\n", "\\r\\n", "$value")."\n"; + } + }else{ + $message .= "\t".str_replace("\r\n", "\\r\\n", "$_response")."\n"; + } + } + }else{ + $message .= "\tNo responses received!\n"; + } + + return $message; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Exceptions/RuntimeException.php b/plugins/vendor/webklex/php-imap/src/Exceptions/RuntimeException.php new file mode 100644 index 00000000..926be1d1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Exceptions/RuntimeException.php @@ -0,0 +1,24 @@ +client = $client; + + $this->events["message"] = $client->getDefaultEvents("message"); + $this->events["folder"] = $client->getDefaultEvents("folder"); + + $this->setDelimiter($delimiter); + $this->path = $folder_name; + $this->full_name = $this->decodeName($folder_name); + $this->name = $this->getSimpleName($this->delimiter, $this->full_name); + $this->children = new FolderCollection(); + $this->has_children = false; + + $this->parseAttributes($attributes); + } + + /** + * Get a new search query instance + * @param string[] $extensions + * + * @return WhereQuery + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ResponseException + */ + public function query(array $extensions = []): WhereQuery { + $this->getClient()->checkConnection(); + $this->getClient()->openFolder($this->path); + $extensions = count($extensions) > 0 ? $extensions : $this->getClient()->extensions; + + return new WhereQuery($this->getClient(), $extensions); + } + + /** + * Get a new search query instance + * @param string[] $extensions + * + * @return WhereQuery + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ResponseException + */ + public function search(array $extensions = []): WhereQuery { + return $this->query($extensions); + } + + /** + * Get a new search query instance + * @param string[] $extensions + * + * @return WhereQuery + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ResponseException + */ + public function messages(array $extensions = []): WhereQuery { + return $this->query($extensions); + } + + /** + * Determine if folder has children. + * + * @return bool + */ + public function hasChildren(): bool { + return $this->has_children; + } + + /** + * Set children. + * @param FolderCollection $children + * + * @return Folder + */ + public function setChildren(FolderCollection $children): Folder { + $this->children = $children; + + return $this; + } + + /** + * Get children. + * + * @return FolderCollection + */ + public function getChildren(): FolderCollection { + return $this->children; + } + + /** + * Decode name. + * It converts UTF7-IMAP encoding to UTF-8. + * @param $name + * + * @return string|array|bool|string[]|null + */ + protected function decodeName($name): string|array|bool|null { + $parts = []; + foreach (explode($this->delimiter, $name) as $item) { + $parts[] = EncodingAliases::convert($item, "UTF7-IMAP"); + } + + return implode($this->delimiter, $parts); + } + + /** + * Get simple name (without parent folders). + * @param $delimiter + * @param $full_name + * + * @return string|bool + */ + protected function getSimpleName($delimiter, $full_name): string|bool { + $arr = explode($delimiter, $full_name); + return end($arr); + } + + /** + * Parse attributes and set it to object properties. + * @param $attributes + */ + protected function parseAttributes($attributes): void { + $this->no_inferiors = in_array('\NoInferiors', $attributes, true) || \in_array('\Noinferiors', $attributes, true); + $this->no_select = in_array('\NoSelect', $attributes, true) || \in_array('\Noselect', $attributes, true); + $this->marked = in_array('\Marked', $attributes); + $this->referral = in_array('\Referral', $attributes); + $this->has_children = in_array('\HasChildren', $attributes); + } + + /** + * Move or rename the current folder + * @param string $new_name + * @param boolean $expunge + * + * @return array + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function move(string $new_name, bool $expunge = true): array { + $this->client->checkConnection(); + $status = $this->client->getConnection()->renameFolder($this->full_name, $new_name)->validatedData(); + if ($expunge) $this->client->expunge(); + + $folder = $this->client->getFolder($new_name); + $this->dispatch("folder", "moved", $this, $folder); + + return $status; + } + + /** + * Get a message overview + * @param string|null $sequence uid sequence + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws InvalidMessageDateException + * @throws MessageNotFoundException + * @throws ResponseException + */ + public function overview(?string $sequence = null): array { + $this->client->openFolder($this->path); + $sequence = $sequence === null ? "1:*" : $sequence; + $uid = $this->client->getConfig()->get('options.sequence', IMAP::ST_MSGN); + $response = $this->client->getConnection()->overview($sequence, $uid); + return $response->validatedData(); + } + + /** + * Append a string message to the current mailbox + * @param string $message + * @param array|null $options + * @param string|Carbon|null $internal_date + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function appendMessage(string $message, ?array $options = null, Carbon|string|null $internal_date = null): array { + /** + * Check if $internal_date is parsed. If it is null it should not be set. Otherwise, the message can't be stored. + * If this parameter is set, it will set the INTERNALDATE on the appended message. The parameter should be a + * date string that conforms to the rfc2060 specifications for a date_time value or be a Carbon object. + */ + + if ($internal_date instanceof Carbon) { + $internal_date = $internal_date->format('d-M-Y H:i:s O'); + } + + return $this->client->getConnection()->appendMessage($this->path, $message, $options, $internal_date)->validatedData(); + } + + /** + * Rename the current folder + * @param string $new_name + * @param boolean $expunge + * + * @return array + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws RuntimeException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws AuthFailedException + * @throws ResponseException + */ + public function rename(string $new_name, bool $expunge = true): array { + return $this->move($new_name, $expunge); + } + + /** + * Delete the current folder + * @param boolean $expunge + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws EventNotFoundException + * @throws AuthFailedException + * @throws ResponseException + */ + public function delete(bool $expunge = true): array { + $status = $this->client->getConnection()->deleteFolder($this->path)->validatedData(); + if ($this->client->getActiveFolder() == $this->path){ + $this->client->setActiveFolder(); + } + + if ($expunge) $this->client->expunge(); + + $this->dispatch("folder", "deleted", $this); + + return $status; + } + + /** + * Subscribe the current folder + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function subscribe(): array { + $this->client->openFolder($this->path); + return $this->client->getConnection()->subscribeFolder($this->path)->validatedData(); + } + + /** + * Unsubscribe the current folder + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function unsubscribe(): array { + $this->client->openFolder($this->path); + return $this->client->getConnection()->unsubscribeFolder($this->path)->validatedData(); + } + + /** + * Idle the current connection + * @param callable $callback function(Message $message) gets called if a new message is received + * @param integer $timeout max 1740 seconds - recommended by rfc2177 §3. Should not be lower than the servers "* OK Still here" message interval + * + * @throws ConnectionFailedException + * @throws RuntimeException + * @throws AuthFailedException + * @throws NotSupportedCapabilityException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + public function idle(callable $callback, int $timeout = 300): void { + $this->client->setTimeout($timeout); + + if (!in_array("IDLE", $this->client->getConnection()->getCapabilities()->validatedData())) { + throw new Exceptions\NotSupportedCapabilityException("IMAP server does not support IDLE"); + } + + $idle_client = $this->client->clone(); + $idle_client->connect(); + $idle_client->openFolder($this->path, true); + $idle_client->getConnection()->idle(); + + $last_action = Carbon::now()->addSeconds($timeout); + + $sequence = $this->client->getConfig()->get('options.sequence', IMAP::ST_MSGN); + + while (true) { + try { + // This polymorphic call is fine - Protocol::idle() will throw an exception beforehand + $line = $idle_client->getConnection()->nextLine(Response::empty()); + } catch (Exceptions\RuntimeException $e) { + if(strpos($e->getMessage(), "empty response") >= 0 && $idle_client->getConnection()->connected()) { + continue; + } + if(!str_contains($e->getMessage(), "connection closed")) { + throw $e; + } + } + + if (($pos = strpos($line, "EXISTS")) !== false) { + $msgn = (int)substr($line, 2, $pos - 2); + + // Check if the stream is still alive or should be considered stale + if (!$this->client->isConnected() || $last_action->isBefore(Carbon::now())) { + // Reset the connection before interacting with it. Otherwise, the resource might be stale which + // would result in a stuck interaction. If you know of a way of detecting a stale resource, please + // feel free to improve this logic. I tried a lot but nothing seem to work reliably... + // Things that didn't work: + // - Closing the resource with fclose() + // - Verifying the resource with stream_get_meta_data() + // - Bool validating the resource stream (e.g.: (bool)$stream) + // - Sending a NOOP command + // - Sending a null package + // - Reading a null package + // - Catching the fs warning + + // This polymorphic call is fine - Protocol::idle() will throw an exception beforehand + $this->client->getConnection()->reset(); + // Establish a new connection + $this->client->connect(); + } + $last_action = Carbon::now()->addSeconds($timeout); + + // Always reopen the folder - otherwise the new message number isn't known to the current remote session + $this->client->openFolder($this->path, true); + + $message = $this->query()->getMessageByMsgn($msgn); + $message->setSequence($sequence); + $callback($message); + + $this->dispatch("message", "new", $message); + } + } + } + + /** + * Get folder status information from the EXAMINE command + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function status(): array { + return $this->client->getConnection()->folderStatus($this->path)->validatedData(); + } + + /** + * Get folder status information from the EXAMINE command + * + * @return array + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + * + * @deprecated Use Folder::status() instead + */ + public function getStatus(): array { + return $this->status(); + } + + /** + * Load folder status information from the EXAMINE command + * @return Folder + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function loadStatus(): Folder { + $this->status = $this->examine(); + return $this; + } + + /** + * Examine the current folder + * + * @return array + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws AuthFailedException + * @throws ResponseException + */ + public function examine(): array { + return $this->client->getConnection()->examineFolder($this->path)->validatedData(); + } + + /** + * Select the current folder + * + * @return array + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + public function select(): array { + return $this->client->getConnection()->selectFolder($this->path)->validatedData(); + } + + /** + * Get the current Client instance + * + * @return Client + */ + public function getClient(): Client { + return $this->client; + } + + /** + * Set the delimiter + * @param $delimiter + */ + public function setDelimiter($delimiter): void { + if (in_array($delimiter, [null, '', ' ', false]) === true) { + $delimiter = $this->client->getConfig()->get('options.delimiter', '/'); + } + + $this->delimiter = $delimiter; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Header.php b/plugins/vendor/webklex/php-imap/src/Header.php new file mode 100644 index 00000000..d18e98a1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Header.php @@ -0,0 +1,871 @@ +decoder = $config->getDecoder("header"); + $this->raw = $raw_header; + $this->config = $config; + $this->options = $this->config->get('options'); + $this->parse(); + } + + /** + * Call dynamic attribute setter and getter methods + * @param string $method + * @param array $arguments + * + * @return Attribute|mixed + * @throws MethodNotFoundException + */ + public function __call(string $method, array $arguments) { + if (strtolower(substr($method, 0, 3)) === 'get') { + $name = preg_replace('/(.)(?=[A-Z])/u', '$1_', substr(strtolower($method), 3)); + + if (in_array($name, array_keys($this->attributes))) { + return $this->attributes[$name]; + } + + } + + throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported'); + } + + /** + * Magic getter + * @param $name + * + * @return Attribute|null + */ + public function __get($name) { + return $this->get($name); + } + + /** + * Get a specific header attribute + * @param $name + * + * @return Attribute + */ + public function get($name): Attribute { + $name = str_replace(["-", " "], "_", strtolower($name)); + if (isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + return new Attribute($name); + } + + /** + * Check if a specific attribute exists + * @param string $name + * + * @return bool + */ + public function has(string $name): bool { + $name = str_replace(["-", " "], "_", strtolower($name)); + return isset($this->attributes[$name]); + } + + /** + * Set a specific attribute + * @param string $name + * @param array|mixed $value + * @param boolean $strict + * + * @return Attribute|array + */ + public function set(string $name, mixed $value, bool $strict = false): Attribute|array { + if (isset($this->attributes[$name]) && $strict === false) { + $this->attributes[$name]->add($value, true); + } else { + $this->attributes[$name] = new Attribute($name, $value); + } + + return $this->attributes[$name]; + } + + /** + * Perform a regex match all on the raw header and return the first result + * @param $pattern + * + * @return mixed|null + */ + public function find($pattern): mixed { + if (preg_match_all($pattern, $this->raw, $matches)) { + if (isset($matches[1])) { + if (count($matches[1]) > 0) { + return $matches[1][0]; + } + } + } + return null; + } + + /** + * Try to find a boundary if possible + * + * @return string|null + */ + public function getBoundary(): ?string { + $regex = $this->options["boundary"] ?? "/boundary=(.*?(?=;)|(.*))/i"; + $boundary = $this->find($regex); + + if ($boundary === null) { + return null; + } + + return $this->clearBoundaryString($boundary); + } + + /** + * Remove all unwanted chars from a given boundary + * @param string $str + * + * @return string + */ + private function clearBoundaryString(string $str): string { + return str_replace(['"', '\r', '\n', "\n", "\r", ";", "\s"], "", $str); + } + + /** + * Parse the raw headers + * + * @throws InvalidMessageDateException + * @throws SpoofingAttemptDetectedException + */ + protected function parse(): void { + $header = $this->rfc822_parse_headers($this->raw); + + $this->extractAddresses($header); + + if (property_exists($header, 'subject')) { + $this->set("subject", $this->decoder->decode($header->subject)); + } + if (property_exists($header, 'references')) { + $this->set("references", array_map(function($item) { + return str_replace(['<', '>'], '', $item); + }, explode(" ", $header->references))); + } + if (property_exists($header, 'message_id')) { + $this->set("message_id", str_replace(['<', '>'], '', $header->message_id)); + } + if (property_exists($header, 'in_reply_to')) { + $this->set("in_reply_to", str_replace(['<', '>'], '', $header->in_reply_to)); + } + + $this->parseDate($header); + foreach ($header as $key => $value) { + $key = trim(rtrim(strtolower($key))); + if (!isset($this->attributes[$key])) { + $this->set($key, $value); + } + } + + $this->extractHeaderExtensions(); + $this->findPriority(); + + if($this->config->get('security.detect_spoofing', true)) { + // Detect spoofing + $this->detectSpoofing(); + } + } + + /** + * Parse mail headers from a string + * @link https://php.net/manual/en/function.imap-rfc822-parse-headers.php + * @param $raw_headers + * + * @return object + */ + public function rfc822_parse_headers($raw_headers): object { + $headers = []; + $imap_headers = []; + if (extension_loaded('imap') && $this->options["rfc822"]) { + $raw_imap_headers = (array)\imap_rfc822_parse_headers($raw_headers); + foreach ($raw_imap_headers as $key => $values) { + $key = strtolower(str_replace("-", "_", $key)); + $imap_headers[$key] = $values; + } + } + $lines = explode("\r\n", preg_replace("/\r\n\s/", ' ', $raw_headers)); + $prev_header = null; + foreach ($lines as $line) { + if (str_starts_with($line, "\n")) { + $line = substr($line, 1); + } + + if (str_starts_with($line, "\t")) { + $line = substr($line, 1); + $line = trim(rtrim($line)); + if ($prev_header !== null) { + $headers[$prev_header][] = $line; + } + } elseif (str_starts_with($line, " ")) { + $line = substr($line, 1); + $line = trim(rtrim($line)); + if ($prev_header !== null) { + if (!isset($headers[$prev_header])) { + $headers[$prev_header] = ""; + } + if (is_array($headers[$prev_header])) { + $headers[$prev_header][] = $line; + } else { + $headers[$prev_header] .= $line; + } + } + } else { + if (($pos = strpos($line, ":")) > 0) { + $key = trim(rtrim(strtolower(substr($line, 0, $pos)))); + $key = strtolower(str_replace("-", "_", $key)); + + $value = trim(rtrim(substr($line, $pos + 1))); + if (isset($headers[$key])) { + $headers[$key][] = $value; + } else { + $headers[$key] = [$value]; + } + $prev_header = $key; + } + } + } + + foreach ($headers as $key => $values) { + if (isset($imap_headers[$key])) { + continue; + } + $value = null; + switch ((string)$key) { + case 'from': + case 'to': + case 'cc': + case 'bcc': + case 'reply_to': + case 'sender': + $value = $this->decodeAddresses($values); + $headers[$key . "address"] = implode(", ", $values); + break; + case 'subject': + $value = implode(" ", $values); + break; + default: + if (is_array($values)) { + foreach ($values as $k => $v) { + if ($v == "") { + unset($values[$k]); + } + } + $available_values = count($values); + if ($available_values === 1) { + $value = array_pop($values); + } elseif ($available_values === 2) { + $value = implode(" ", $values); + } elseif ($available_values > 2) { + $value = array_values($values); + } else { + $value = ""; + } + } + break; + } + $headers[$key] = $value; + } + + return (object)array_merge($headers, $imap_headers); + } + + /** + * Try to extract the priority from a given raw header string + */ + private function findPriority(): void { + $priority = $this->get("x_priority"); + + $priority = match ((int)"$priority") { + IMAP::MESSAGE_PRIORITY_HIGHEST => IMAP::MESSAGE_PRIORITY_HIGHEST, + IMAP::MESSAGE_PRIORITY_HIGH => IMAP::MESSAGE_PRIORITY_HIGH, + IMAP::MESSAGE_PRIORITY_NORMAL => IMAP::MESSAGE_PRIORITY_NORMAL, + IMAP::MESSAGE_PRIORITY_LOW => IMAP::MESSAGE_PRIORITY_LOW, + IMAP::MESSAGE_PRIORITY_LOWEST => IMAP::MESSAGE_PRIORITY_LOWEST, + default => IMAP::MESSAGE_PRIORITY_UNKNOWN, + }; + + $this->set("priority", $priority); + } + + /** + * Extract a given part as address array from a given header + * @param $values + * + * @return array + */ + private function decodeAddresses($values): array { + $addresses = []; + + if (extension_loaded('mailparse') && $this->options["rfc822"]) { + foreach ($values as $address) { + foreach (\mailparse_rfc822_parse_addresses($address) as $parsed_address) { + if (isset($parsed_address['address'])) { + $mail_address = explode('@', $parsed_address['address']); + if (count($mail_address) == 2) { + $addresses[] = (object)[ + "personal" => $parsed_address['display'] ?? '', + "mailbox" => $mail_address[0], + "host" => $mail_address[1], + ]; + } + } + } + } + + return $addresses; + } + + foreach ($values as $address) { + foreach (preg_split('/, ?(?=(?:[^"]*"[^"]*")*[^"]*$)/', $address) as $split_address) { + $split_address = trim(rtrim($split_address)); + + if (strpos($split_address, ",") == strlen($split_address) - 1) { + $split_address = substr($split_address, 0, -1); + } + if (preg_match( + '/^(?:(?P.+)\s)?(?(name)<|[^\s]+?)(?(name)>|>?)$/', + $split_address, + $matches + )) { + $name = trim(rtrim($matches["name"])); + $email = trim(rtrim($matches["email"])); + list($mailbox, $host) = array_pad(explode("@", $email), 2, null); + $addresses[] = (object)[ + "personal" => $name, + "mailbox" => $mailbox, + "host" => $host, + ]; + }elseif (preg_match( + '/^((?P.+)<)(?P[^<]+?)>$/', + $split_address, + $matches + )) { + $name = trim(rtrim($matches["name"])); + if(str_starts_with($name, "\"") && str_ends_with($name, "\"")) { + $name = substr($name, 1, -1); + }elseif(str_starts_with($name, "'") && str_ends_with($name, "'")) { + $name = substr($name, 1, -1); + } + $email = trim(rtrim($matches["email"])); + list($mailbox, $host) = array_pad(explode("@", $email), 2, null); + $addresses[] = (object)[ + "personal" => $name, + "mailbox" => $mailbox, + "host" => $host, + ]; + } + } + } + + return $addresses; + } + + /** + * Extract a given part as address array from a given header + * @param object $header + */ + private function extractAddresses(object $header): void { + foreach (['from', 'to', 'cc', 'bcc', 'reply_to', 'sender', 'return_path', 'envelope_from', 'envelope_to', 'delivered_to'] as $key) { + if (property_exists($header, $key)) { + $this->set($key, $this->parseAddresses($header->$key)); + } + } + } + + /** + * Parse Addresses + * @param $list + * + * @return array + */ + private function parseAddresses($list): array { + $addresses = []; + + if (is_array($list) === false) { + if(is_string($list)) { + if (preg_match( + '/^(?:(?P.+)\s)?(?(name)<|[^\s]+?)(?(name)>|>?)$/', + $list, + $matches + )) { + $name = trim(rtrim($matches["name"])); + $email = trim(rtrim($matches["email"])); + list($mailbox, $host) = array_pad(explode("@", $email), 2, null); + if($mailbox === ">") { // Fix trailing ">" in malformed mailboxes + $mailbox = ""; + } + if($name === "" && $mailbox === "" && $host === "") { + return $addresses; + } + $list = [ + (object)[ + "personal" => $name, + "mailbox" => $mailbox, + "host" => $host, + ] + ]; + }elseif (preg_match( + '/^((?P.+)<)(?P[^<]+?)>$/', + $list, + $matches + )) { + $name = trim(rtrim($matches["name"])); + $email = trim(rtrim($matches["email"])); + if(str_starts_with($name, "\"") && str_ends_with($name, "\"")) { + $name = substr($name, 1, -1); + }elseif(str_starts_with($name, "'") && str_ends_with($name, "'")) { + $name = substr($name, 1, -1); + } + list($mailbox, $host) = array_pad(explode("@", $email), 2, null); + if($mailbox === ">") { // Fix trailing ">" in malformed mailboxes + $mailbox = ""; + } + if($name === "" && $mailbox === "" && $host === "") { + return $addresses; + } + $list = [ + (object)[ + "personal" => $name, + "mailbox" => $mailbox, + "host" => $host, + ] + ]; + }else{ + return $addresses; + } + }else{ + return $addresses; + } + } + + foreach ($list as $item) { + $address = (object)$item; + + if (!property_exists($address, 'mailbox')) { + $address->mailbox = false; + } + if (!property_exists($address, 'host')) { + $address->host = false; + } + if (!property_exists($address, 'personal')) { + $address->personal = false; + } else { + $personal_slices = explode(" ", $address->personal); + $address->personal = ""; + foreach ($personal_slices as $slice) { + $personalParts = $this->decoder->mimeHeaderDecode($slice); + + $personal = ''; + foreach ($personalParts as $p) { + $personal .= $this->decoder->convertEncoding($p->text, $this->decoder->getEncoding($p)); + } + + if (str_starts_with($personal, "'")) { + $personal = str_replace("'", "", $personal); + } + $personal = $this->decoder->decode($personal); + $address->personal .= $personal . " "; + } + $address->personal = trim(rtrim($address->personal)); + } + + if ($address->host == ".SYNTAX-ERROR.") { + $address->host = ""; + }elseif ($address->host == "UNKNOWN") { + $address->host = ""; + } + if ($address->mailbox == "UNEXPECTED_DATA_AFTER_ADDRESS") { + $address->mailbox = ""; + }elseif ($address->mailbox == "MISSING_MAILBOX_TERMINATOR") { + $address->mailbox = ""; + } + + $addresses[] = new Address($address); + } + + return $addresses; + } + + /** + * Search and extract potential header extensions + */ + private function extractHeaderExtensions(): void { + foreach ($this->attributes as $key => $value) { + if (is_array($value)) { + $value = implode(", ", $value); + } else { + $value = (string)$value; + } + // Only parse strings and don't parse any attributes like the user-agent + if (!in_array($key, ["user-agent", "subject", "received"])) { + if (str_contains($value, ";") && str_contains($value, "=")) { + $_attributes = $this->read_attribute($value); + foreach($_attributes as $_key => $_value) { + if($_value === "") { + $this->set($key, $_key); + } + if (!isset($this->attributes[$_key])) { + $this->set($_key, $_value); + } + } + } + } + } + } + + /** + * Read a given attribute string + * - this isn't pretty, but it works - feel free to improve :) + * @param string $raw_attribute + * @return array + */ + private function read_attribute(string $raw_attribute): array { + $attributes = []; + $key = ''; + $value = ''; + $inside_word = false; + $inside_key = true; + $escaped = false; + foreach (str_split($raw_attribute) as $char) { + if($escaped) { + $escaped = false; + continue; + } + if($inside_word) { + if($char === '\\') { + $escaped = true; + }elseif($char === "\"" && $value !== "") { + $inside_word = false; + }else{ + $value .= $char; + } + }else{ + if($inside_key) { + if($char === '"') { + $inside_word = true; + }elseif($char === ';'){ + $attributes[$key] = $value; + $key = ''; + $value = ''; + $inside_key = true; + }elseif($char === '=') { + $inside_key = false; + }else{ + $key .= $char; + } + }else{ + if($char === '"' && $value === "") { + $inside_word = true; + }elseif($char === ';'){ + $attributes[$key] = $value; + $key = ''; + $value = ''; + $inside_key = true; + }else{ + $value .= $char; + } + } + } + } + $attributes[$key] = $value; + $result = []; + + foreach($attributes as $key => $value) { + if (($pos = strpos($key, "*")) !== false) { + $key = substr($key, 0, $pos); + } + $key = trim(rtrim(strtolower($key))); + + if(!isset($result[$key])) { + $result[$key] = ""; + } + $value = trim(rtrim(str_replace(["\r", "\n"], "", $value))); + if(str_starts_with($value, "\"") && str_ends_with($value, "\"")) { + $value = substr($value, 1, -1); + } + $result[$key] .= $value; + } + return $result; + } + + /** + * Exception handling for invalid dates + * + * Known bad and "invalid" formats: + * ^ Datetime ^ Problem ^ Cause + * | Mon, 20 Nov 2017 20:31:31 +0800 (GMT+8:00) | Double timezone specification | A Windows feature + * | Thu, 8 Nov 2018 08:54:58 -0200 (-02) | + * | | and invalid timezone (max 6 char) | + * | 04 Jan 2018 10:12:47 UT | Missing letter "C" | Unknown + * | Thu, 31 May 2018 18:15:00 +0800 (added by) | Non-standard details added by the | Unknown + * | | mail server | + * | Sat, 31 Aug 2013 20:08:23 +0580 | Invalid timezone | PHPMailer bug https://sourceforge.net/p/phpmailer/mailman/message/6132703/ + * | Mi., 23 Apr. 2025 09:48:37 +0200 (MESZ) | Non-standard localized format | Aqua Mail S/MIME implementation + * + * Please report any new invalid timestamps to [#45](https://github.com/Webklex/php-imap/issues) + * + * @param object $header + * + * @throws InvalidMessageDateException + */ + private function parseDate(object $header): void { + + if (property_exists($header, 'date')) { + $date = $header->date; + + if (preg_match('/\+0580/', $date)) { + $date = str_replace('+0580', '+0530', $date); + } + + $date = trim(rtrim($date)); + try { + if (str_contains($date, ' ')) { + $date = str_replace(' ', ' ', $date); + } + if (str_contains($date, ' UT ')) { + $date = str_replace(' UT ', ' UTC ', $date); + } + $parsed_date = Carbon::parse($date); + } catch (\Exception $e) { + switch (true) { + case preg_match('/([0-9]{4}\.[0-9]{1,2}\.[0-9]{1,2}\-[0-9]{1,2}\.[0-9]{1,2}.[0-9]{1,2})+$/i', $date) > 0: + $date = Carbon::createFromFormat("Y.m.d-H.i.s", $date); + break; + case preg_match('/([0-9]{2} [A-Z]{3} [0-9]{4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [+-][0-9]{1,4} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2} [+-][0-9]{1,4})+$/i', $date) > 0: + $parts = explode(' ', $date); + array_splice($parts, -2); + $date = implode(' ', $parts); + break; + case preg_match('/([A-Z]{2,4}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4})+$/i', $date) > 0: + $array = explode(',', $date); + array_shift($array); + $date = Carbon::createFromFormat("d M Y H:i:s O", trim(implode(',', $array))); + break; + case preg_match('/([0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ UT)+$/i', $date) > 0: + case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ ([0-9]{2}|[0-9]{4})\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ UT)+$/i', $date) > 0: + $date .= 'C'; + break; + case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}[\,]\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4})+$/i', $date) > 0: + $date = str_replace(',', '', $date); + break; + // match case for: Di., 15 Feb. 2022 06:52:44 +0100 (MEZ)/Di., 15 Feb. 2022 06:52:44 +0100 (MEZ) and Mi., 23 Apr. 2025 09:48:37 +0200 (MESZ) + case preg_match('/([A-Z]{2,3}\.\,\ [0-9]{1,2}\ [A-Z]{2,3}\.\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4}\ \([A-Z]{3,4}\))(\/([A-Z]{2,3}\.\,\ [0-9]{1,2}\ [A-Z]{2,3}\.\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4}\ \([A-Z]{3,4}\))+)?$/i', $date) > 0: + $dates = explode('/', $date); + $date = array_shift($dates); + $array = explode(',', $date); + array_shift($array); + $date = trim(implode(',', $array)); + $array = explode(' ', $date); + array_pop($array); + $date = trim(implode(' ', $array)); + $date = Carbon::createFromFormat("d M. Y H:i:s O", $date); + break; + // match case for: fr., 25 nov. 2022 06:27:14 +0100/fr., 25 nov. 2022 06:27:14 +0100 + case preg_match('/([A-Z]{2,3}\.\,\ [0-9]{1,2}\ [A-Z]{2,3}\.\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4})\/([A-Z]{2,3}\.\,\ [0-9]{1,2}\ [A-Z]{2,3}\.\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4})+$/i', $date) > 0: + $dates = explode('/', $date); + $date = array_shift($dates); + $array = explode(',', $date); + array_shift($array); + $date = trim(implode(',', $array)); + $date = Carbon::createFromFormat("d M. Y H:i:s O", $date); + break; + case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ \+[0-9]{2,4}\ \(\+[0-9]{1,2}\))+$/i', $date) > 0: + case preg_match('/([A-Z]{2,3}[\,|\ \,]\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}.*)+$/i', $date) > 0: + case preg_match('/([A-Z]{2,3}\,\ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4}\ \(.*)\)+$/i', $date) > 0: + case preg_match('/([A-Z]{2,3}\, \ [0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{4}\ [0-9]{1,2}\:[0-9]{1,2}\:[0-9]{1,2}\ [\-|\+][0-9]{4}\ \(.*)\)+$/i', $date) > 0: + case preg_match('/([0-9]{1,2}\ [A-Z]{2,3}\ [0-9]{2,4}\ [0-9]{2}\:[0-9]{2}\:[0-9]{2}\ [A-Z]{2}\ \-[0-9]{2}\:[0-9]{2}\ \([A-Z]{2,3}\ \-[0-9]{2}:[0-9]{2}\))+$/i', $date) > 0: + $array = explode('(', $date); + $array = array_reverse($array); + $date = trim(array_pop($array)); + break; + } + try { + $parsed_date = Carbon::parse($date); + } catch (\Exception $_e) { + if (!isset($this->options["fallback_date"])) { + throw new InvalidMessageDateException("Invalid message date. ID:" . $this->get("message_id") . " Date:" . $header->date . "/" . $date, 1100, $e); + } else { + $parsed_date = Carbon::parse($this->options["fallback_date"]); + } + } + } + + $this->set("date", $parsed_date); + } + } + + /** + * Get all available attributes + * + * @return array + */ + public function getAttributes(): array { + return $this->attributes; + } + + /** + * Set all header attributes + * @param array $attributes + * + * @return Header + */ + public function setAttributes(array $attributes): Header { + $this->attributes = $attributes; + return $this; + } + + /** + * Set the configuration used for parsing a raw header + * @param array $config + * + * @return Header + */ + public function setOptions(array $config): Header { + $this->options = $config; + return $this; + } + + /** + * Get the configuration used for parsing a raw header + * + * @return array + */ + public function getOptions(): array { + return $this->options; + } + + /** + * Set the configuration used for parsing a raw header + * @param Config $config + * + * @return Header + */ + public function setConfig(Config $config): Header { + $this->config = $config; + return $this; + } + + /** + * Get the configuration used for parsing a raw header + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } + + /** + * Get the decoder instance + * + * @return DecoderInterface + */ + public function getDecoder(): DecoderInterface { + return $this->decoder; + } + + /** + * Set the decoder instance + * @param DecoderInterface $decoder + * + * @return $this + */ + public function setDecoder(DecoderInterface $decoder): static { + $this->decoder = $decoder; + return $this; + } + + /** + * Detect spoofing by checking the from, reply_to, return_path, sender and envelope_from headers + * @throws SpoofingAttemptDetectedException + */ + private function detectSpoofing(): void { + $header_keys = ["from", "reply_to", "return_path", "sender", "envelope_from"]; + $potential_senders = []; + foreach($header_keys as $key) { + $header = $this->get($key); + foreach ($header->toArray() as $address) { + $potential_senders[] = $address->mailbox . "@" . $address->host; + } + } + if(count($potential_senders) > 1) { + $this->set("spoofed", true); + if($this->config->get('security.detect_spoofing_exception', false)) { + throw new SpoofingAttemptDetectedException("Potential spoofing detected. Message ID: " . $this->get("message_id") . " Senders: " . implode(", ", $potential_senders)); + } + } + } + +} diff --git a/plugins/vendor/webklex/php-imap/src/IMAP.php b/plugins/vendor/webklex/php-imap/src/IMAP.php new file mode 100644 index 00000000..41ae8248 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/IMAP.php @@ -0,0 +1,375 @@ +imap_close + * @link http://php.net/manual/en/imap.constants.php + */ + const CL_EXPUNGE = 32768; + + /** + * The parameter is a UID + * @link http://php.net/manual/en/imap.constants.php + */ + const FT_UID = 1; + + /** + * Do not set the \Seen flag if not already set + * @link http://php.net/manual/en/imap.constants.php + */ + const FT_PEEK = 2; + const FT_NOT = 4; + + /** + * The return string is in internal format, will not canonicalize to CRLF. + * @link http://php.net/manual/en/imap.constants.php + */ + const FT_INTERNAL = 8; + const FT_PREFETCHTEXT = 32; + + /** + * The sequence argument contains UIDs instead of sequence numbers + * @link http://php.net/manual/en/imap.constants.php + */ + const ST_UID = 1; + const ST_SILENT = 2; + const ST_MSGN = 3; + const ST_SET = 4; + + /** + * the sequence numbers contain UIDS + * @link http://php.net/manual/en/imap.constants.php + */ + const CP_UID = 1; + + /** + * Delete the messages from the current mailbox after copying + * with imap_mail_copy + * @link http://php.net/manual/en/imap.constants.php + */ + const CP_MOVE = 2; + + /** + * Return UIDs instead of sequence numbers + * @link http://php.net/manual/en/imap.constants.php + */ + const SE_UID = 1; + const SE_FREE = 2; + + /** + * Don't prefetch searched messages + * @link http://php.net/manual/en/imap.constants.php + */ + const SE_NOPREFETCH = 4; + const SO_FREE = 8; + const SO_NOSERVER = 16; + const SA_MESSAGES = 1; + const SA_RECENT = 2; + const SA_UNSEEN = 4; + const SA_UIDNEXT = 8; + const SA_UIDVALIDITY = 16; + const SA_ALL = 31; + + /** + * This mailbox has no "children" (there are no + * mailboxes below this one). + * @link http://php.net/manual/en/imap.constants.php + */ + const LATT_NOINFERIORS = 1; + + /** + * This is only a container, not a mailbox - you + * cannot open it. + * @link http://php.net/manual/en/imap.constants.php + */ + const LATT_NOSELECT = 2; + + /** + * This mailbox is marked. Only used by UW-IMAPD. + * @link http://php.net/manual/en/imap.constants.php + */ + const LATT_MARKED = 4; + + /** + * This mailbox is not marked. Only used by + * UW-IMAPD. + * @link http://php.net/manual/en/imap.constants.php + */ + const LATT_UNMARKED = 8; + const LATT_REFERRAL = 16; + const LATT_HASCHILDREN = 32; + const LATT_HASNOCHILDREN = 64; + + /** + * Sort criteria for imap_sort: + * message Date + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTDATE = 0; + + /** + * Sort criteria for imap_sort: + * arrival date + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTARRIVAL = 1; + + /** + * Sort criteria for imap_sort: + * mailbox in first From address + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTFROM = 2; + + /** + * Sort criteria for imap_sort: + * message subject + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTSUBJECT = 3; + + /** + * Sort criteria for imap_sort: + * mailbox in first To address + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTTO = 4; + + /** + * Sort criteria for imap_sort: + * mailbox in first cc address + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTCC = 5; + + /** + * Sort criteria for imap_sort: + * size of message in octets + * @link http://php.net/manual/en/imap.constants.php + */ + const SORTSIZE = 6; + const TYPETEXT = 0; + const TYPEMULTIPART = 1; + const TYPEMESSAGE = 2; + const TYPEAPPLICATION = 3; + const TYPEAUDIO = 4; + const TYPEIMAGE = 5; + const TYPEVIDEO = 6; + const TYPEMODEL = 7; + const TYPEOTHER = 8; + const ENC7BIT = 0; + const ENC8BIT = 1; + const ENCBINARY = 2; + const ENCBASE64 = 3; + const ENCQUOTEDPRINTABLE = 4; + const ENCOTHER = 5; + + /** + * Garbage collector, clear message cache elements. + * @link http://php.net/manual/en/imap.constants.php + */ + const IMAP_GC_ELT = 1; + + /** + * Garbage collector, clear envelopes and bodies. + * @link http://php.net/manual/en/imap.constants.php + */ + const IMAP_GC_ENV = 2; + + /** + * Garbage collector, clear texts. + * @link http://php.net/manual/en/imap.constants.php + */ + const IMAP_GC_TEXTS = 4; + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Message.php b/plugins/vendor/webklex/php-imap/src/Message.php new file mode 100755 index 00000000..9d15a7b8 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Message.php @@ -0,0 +1,1674 @@ +boot($client->getConfig()); + + $default_mask = $client->getDefaultMessageMask(); + if ($default_mask != null) { + $this->mask = $default_mask; + } + $this->events["message"] = $client->getDefaultEvents("message"); + $this->events["flag"] = $client->getDefaultEvents("flag"); + + $this->folder_path = $client->getFolderPath(); + + $this->setSequence($sequence); + $this->setFetchOption($fetch_options); + $this->setFetchBodyOption($fetch_body); + $this->setFetchFlagsOption($fetch_flags); + + $this->client = $client; + $this->client->openFolder($this->folder_path); + + $this->setSequenceId($uid, $msglist); + + if ($this->fetch_options == IMAP::FT_PEEK) { + $this->parseFlags(); + } + + $this->parseHeader(); + + if ($this->getFetchBodyOption() === true) { + $this->parseBody(); + } + + if ($this->getFetchFlagsOption() === true && $this->fetch_options !== IMAP::FT_PEEK) { + $this->parseFlags(); + } + } + + /** + * Create a new instance without fetching the message header and providing them raw instead + * @param int $uid + * @param int|null $msglist + * @param Client $client + * @param string $raw_header + * @param string $raw_body + * @param array $raw_flags + * @param null $fetch_options + * @param null $sequence + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws ReflectionException + * @throws RuntimeException + * @throws ResponseException + */ + public static function make(int $uid, ?int $msglist, Client $client, string $raw_header, string $raw_body, array $raw_flags, $fetch_options = null, $sequence = null): Message { + $reflection = new ReflectionClass(self::class); + /** @var Message $instance */ + $instance = $reflection->newInstanceWithoutConstructor(); + $instance->boot($client->getConfig()); + + $default_mask = $client->getDefaultMessageMask(); + if ($default_mask != null) { + $instance->setMask($default_mask); + } + $instance->setEvents([ + "message" => $client->getDefaultEvents("message"), + "flag" => $client->getDefaultEvents("flag"), + ]); + $instance->setFolderPath($client->getFolderPath()); + $instance->setSequence($sequence); + $instance->setFetchOption($fetch_options); + + $instance->setClient($client); + $instance->setSequenceId($uid, $msglist); + + $instance->parseRawHeader($raw_header); + $instance->parseRawFlags($raw_flags); + $instance->parseRawBody($raw_body); + $instance->peek(); + + return $instance; + } + + /** + * Create a new message instance by reading and loading a file or remote location + * @param string $filename + * @param ?Config $config + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + */ + public static function fromFile(string $filename, ?Config $config = null): Message { + $blob = file_get_contents($filename); + if ($blob === false) { + throw new RuntimeException("Unable to read file"); + } + return self::fromString($blob, $config); + } + + /** + * Create a new message instance by reading and loading a string + * @param string $blob + * @param ?Config $config + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + */ + public static function fromString(string $blob, ?Config $config = null): Message { + $reflection = new ReflectionClass(self::class); + /** @var Message $instance */ + $instance = $reflection->newInstanceWithoutConstructor(); + $instance->boot($config); + + $default_mask = $instance->getConfig()->getMask("message"); + if($default_mask != ""){ + $instance->setMask($default_mask); + }else{ + throw new MaskNotFoundException("Unknown message mask provided"); + } + + if(!str_contains($blob, "\r\n")){ + $blob = str_replace("\n", "\r\n", $blob); + } + $raw_header = substr($blob, 0, strpos($blob, "\r\n\r\n")); + $raw_body = substr($blob, strlen($raw_header)+4); + + $instance->parseRawHeader($raw_header); + $instance->parseRawBody($raw_body); + + $instance->setUid(0); + + return $instance; + } + + /** + * Boot a new instance + * @param ?Config $config + * @throws DecoderNotFoundException + */ + public function boot(?Config $config = null): void { + $this->attributes = []; + $this->client = null; + $this->config = $config ?? Config::make(); + $this->decoder = $this->config->getDecoder("message"); + + $this->options = $this->config->get('options'); + $this->available_flags = $this->config->get('flags'); + + $this->attachments = AttachmentCollection::make(); + $this->flags = FlagCollection::make(); + } + + /** + * Call dynamic attribute setter and getter methods + * @param string $method + * @param array $arguments + * + * @return mixed + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws MethodNotFoundException + * @throws MessageSizeFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function __call(string $method, array $arguments) { + if (strtolower(substr($method, 0, 3)) === 'get') { + $name = Str::snake(substr($method, 3)); + return $this->get($name); + } elseif (strtolower(substr($method, 0, 3)) === 'set') { + $name = Str::snake(substr($method, 3)); + + if (in_array($name, array_keys($this->attributes))) { + return $this->__set($name, array_pop($arguments)); + } + + } + + throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported'); + } + + /** + * Magic setter + * @param $name + * @param $value + * + * @return mixed + */ + public function __set($name, $value) { + $this->attributes[$name] = $value; + + return $this->attributes[$name]; + } + + /** + * Magic getter + * @param $name + * + * @return Attribute|mixed|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws MessageSizeFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function __get($name) { + return $this->get($name); + } + + /** + * Get an available message or message header attribute + * @param $name + * + * @return Attribute|mixed|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + * @throws MessageSizeFetchingException + */ + public function get($name): mixed { + if (isset($this->attributes[$name]) && $this->attributes[$name] !== null) { + return $this->attributes[$name]; + } + + switch ($name){ + case "uid": + $this->attributes[$name] = $this->client->getConnection()->getUid($this->msgn)->validate()->integer(); + return $this->attributes[$name]; + case "msgn": + $this->attributes[$name] = $this->client->getConnection()->getMessageNumber($this->uid)->validate()->integer(); + return $this->attributes[$name]; + case "size": + if (!isset($this->attributes[$name])) { + $this->fetchSize(); + } + return $this->attributes[$name]; + } + + return $this->header->get($name); + } + + /** + * Check if the Message has a text body + * + * @return bool + */ + public function hasTextBody(): bool { + return isset($this->bodies['text']) && $this->bodies['text'] !== ""; + } + + /** + * Get the Message text body + * + * @return string + */ + public function getTextBody(): string { + if (!isset($this->bodies['text'])) { + return ""; + } + + return $this->bodies['text']; + } + + /** + * Check if the Message has a html body + * + * @return bool + */ + public function hasHTMLBody(): bool { + return isset($this->bodies['html']) && $this->bodies['html'] !== ""; + } + + /** + * Get the Message html body + * + * @return string + */ + public function getHTMLBody(): string { + if (!isset($this->bodies['html'])) { + return ""; + } + + return $this->bodies['html']; + } + + /** + * Parse all defined headers + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws InvalidMessageDateException + * @throws MessageHeaderFetchingException + * @throws ResponseException + */ + private function parseHeader(): void { + $sequence_id = $this->getSequenceId(); + $headers = $this->client->getConnection()->headers([$sequence_id], "RFC822", $this->sequence)->setCanBeEmpty(true)->validatedData(); + if (!isset($headers[$sequence_id])) { + throw new MessageHeaderFetchingException("no headers found", 0); + } + + $this->parseRawHeader($headers[$sequence_id]); + } + + /** + * @param string $raw_header + * + * @throws InvalidMessageDateException + */ + public function parseRawHeader(string $raw_header): void { + $this->header = new Header($raw_header, $this->getConfig()); + } + + /** + * Parse additional raw flags + * @param array $raw_flags + */ + public function parseRawFlags(array $raw_flags): void { + $this->flags = FlagCollection::make(); + + foreach ($raw_flags as $flag) { + if (str_starts_with($flag, "\\")) { + $flag = substr($flag, 1); + } + $flag_key = strtolower($flag); + if ($this->available_flags === null || in_array($flag_key, $this->available_flags)) { + $this->flags->put($flag_key, $flag); + } + } + } + + /** + * Parse additional flags + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + private function parseFlags(): void { + $this->client->openFolder($this->folder_path); + $this->flags = FlagCollection::make(); + + $sequence_id = $this->getSequenceId(); + try { + $flags = $this->client->getConnection()->flags([$sequence_id], $this->sequence)->setCanBeEmpty(true)->validatedData(); + } catch (Exceptions\RuntimeException $e) { + throw new MessageFlagException("flag could not be fetched", 0, $e); + } + + if (isset($flags[$sequence_id])) { + $this->parseRawFlags($flags[$sequence_id]); + } + } + + /** + * Parse the Message body + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function parseBody(): Message { + $this->client->openFolder($this->folder_path); + + $sequence_id = $this->getSequenceId(); + try { + $contents = $this->client->getConnection()->content([$sequence_id], $this->client->rfc, $this->sequence)->validatedData(); + } catch (Exceptions\RuntimeException $e) { + throw new MessageContentFetchingException("failed to fetch content", 0, $e); + } + if (!isset($contents[$sequence_id])) { + throw new MessageContentFetchingException("no content found", 0); + } + $content = $contents[$sequence_id]; + + $body = $this->parseRawBody($content); + $this->peek(); + + return $body; + } + + /** + * Fetches the size for this message. + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageSizeFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + private function fetchSize(): void { + $sequence_id = $this->getSequenceId(); + $sizes = $this->client->getConnection()->sizes([$sequence_id], $this->sequence)->validatedData(); + if (!isset($sizes[$sequence_id])) { + throw new MessageSizeFetchingException("sizes did not set an array entry for the supplied sequence_id", 0); + } + $this->attributes["size"] = $sizes[$sequence_id]; + } + + /** + * Handle auto "Seen" flag handling + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function peek(): void { + if ($this->fetch_options == IMAP::FT_PEEK) { + if ($this->getFlags()->get("seen") == null) { + $this->unsetFlag("Seen"); + } + } elseif ($this->getFlags()->get("seen") == null) { + $this->setFlag("Seen"); + } + } + + /** + * Parse a given message body + * @param string $raw_body + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function parseRawBody(string $raw_body): Message { + $this->structure = new Structure($raw_body, $this->header); + $this->fetchStructure($this->structure); + + return $this; + } + + /** + * Fetch the Message structure + * @param Structure $structure + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + private function fetchStructure(Structure $structure): void { + $this->client?->openFolder($this->folder_path); + + foreach ($structure->parts as $part) { + $this->fetchPart($part); + } + } + + /** + * Fetch a given part + * @param Part $part + */ + private function fetchPart(Part $part): void { + if ($part->isAttachment()) { + $this->fetchAttachment($part); + } else { + $encoding = $this->decoder->getEncoding($part); + + $content = $this->decoder->decode($part->content, $part->encoding); + + // We don't need to do convertEncoding() if charset is ASCII (us-ascii): + // ASCII is a subset of UTF-8, so all ASCII files are already UTF-8 encoded + // https://stackoverflow.com/a/11303410 + // + // us-ascii is the same as ASCII: + // ASCII is the traditional name for the encoding system; the Internet Assigned Numbers Authority (IANA) + // prefers the updated name US-ASCII, which clarifies that this system was developed in the US and + // based on the typographical symbols predominantly in use there. + // https://en.wikipedia.org/wiki/ASCII + // + // convertEncoding() function basically means convertToUtf8(), so when we convert ASCII string into UTF-8 it gets broken. + if ($encoding != 'us-ascii') { + $content = $this->decoder->convertEncoding($content, $encoding); + } + + $this->addBody($part->subtype ?? '', $content); + } + } + + /** + * Add a body to the message + * @param string $subtype + * @param string $content + * + * @return void + */ + protected function addBody(string $subtype, string $content): void { + $subtype = strtolower($subtype); + $subtype = $subtype == "plain" || $subtype == "" ? "text" : $subtype; + + if (isset($this->bodies[$subtype]) && $this->bodies[$subtype] !== null && $this->bodies[$subtype] !== "") { + if ($content !== "") { + $this->bodies[$subtype] .= "\n".$content; + } + } else { + $this->bodies[$subtype] = $content; + } + } + + /** + * Fetch the Message attachment + * @param Part $part + */ + protected function fetchAttachment(Part $part): void { + $oAttachment = new Attachment($this, $part); + + if ($oAttachment->getSize() > 0) { + if ($oAttachment->getId() !== null && $this->attachments->offsetExists($oAttachment->getId())) { + $this->attachments->put($oAttachment->getId(), $oAttachment); + } else { + $this->attachments->push($oAttachment); + } + } + } + + /** + * Fail proof setter for $fetch_option + * @param $option + * + * @return Message + */ + public function setFetchOption($option): Message { + if (is_long($option) === true) { + $this->fetch_options = $option; + } elseif (is_null($option) === true) { + $config = $this->config->get('options.fetch', IMAP::FT_UID); + $this->fetch_options = is_long($config) ? $config : 1; + } + + return $this; + } + + /** + * Set the sequence type + * @param int|null $sequence + * + * @return Message + */ + public function setSequence(?int $sequence): Message { + if (is_long($sequence)) { + $this->sequence = $sequence; + } elseif (is_null($sequence)) { + $config = $this->config->get('options.sequence', IMAP::ST_MSGN); + $this->sequence = is_long($config) ? $config : IMAP::ST_MSGN; + } + + return $this; + } + + /** + * Fail proof setter for $fetch_body + * @param $option + * + * @return Message + */ + public function setFetchBodyOption($option): Message { + if (is_bool($option)) { + $this->fetch_body = $option; + } elseif (is_null($option)) { + $config = $this->config->get('options.fetch_body', true); + $this->fetch_body = is_bool($config) ? $config : true; + } + + return $this; + } + + /** + * Fail proof setter for $fetch_flags + * @param $option + * + * @return Message + */ + public function setFetchFlagsOption($option): Message { + if (is_bool($option)) { + $this->fetch_flags = $option; + } elseif (is_null($option)) { + $config = $this->config->get('options.fetch_flags', true); + $this->fetch_flags = is_bool($config) ? $config : true; + } + + return $this; + } + + /** + * Get the messages folder + * + * @return ?Folder + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getFolder(): ?Folder { + return $this->client->getFolderByPath($this->folder_path); + } + + /** + * Create a message thread based on the current message + * @param Folder|null $sent_folder + * @param MessageCollection|null $thread + * @param Folder|null $folder + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function thread(?Folder $sent_folder = null, ?MessageCollection &$thread = null, ?Folder $folder = null): MessageCollection { + $thread = $thread ?: MessageCollection::make(); + $folder = $folder ?: $this->getFolder(); + $sent_folder = $sent_folder ?: $this->client->getFolderByPath($this->config->get("options.common_folders.sent", "INBOX/Sent")); + + /** @var Message $message */ + foreach ($thread as $message) { + if ($message->message_id->first() == $this->message_id->first()) { + return $thread; + } + } + $thread->push($this); + + $this->fetchThreadByInReplyTo($thread, $this->message_id, $folder, $folder, $sent_folder); + $this->fetchThreadByInReplyTo($thread, $this->message_id, $sent_folder, $folder, $sent_folder); + + foreach ($this->in_reply_to->all() as $in_reply_to) { + $this->fetchThreadByMessageId($thread, $in_reply_to, $folder, $folder, $sent_folder); + $this->fetchThreadByMessageId($thread, $in_reply_to, $sent_folder, $folder, $sent_folder); + } + + return $thread; + } + + /** + * Fetch a partial thread by message id + * @param MessageCollection $thread + * @param string $in_reply_to + * @param Folder $primary_folder + * @param Folder $secondary_folder + * @param Folder $sent_folder + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + protected function fetchThreadByInReplyTo(MessageCollection &$thread, string $in_reply_to, Folder $primary_folder, Folder $secondary_folder, Folder $sent_folder): void { + $primary_folder->query()->inReplyTo($in_reply_to) + ->setFetchBody($this->getFetchBodyOption()) + ->leaveUnread()->get()->each(function($message) use (&$thread, $secondary_folder, $sent_folder) { + /** @var Message $message */ + $message->thread($sent_folder, $thread, $secondary_folder); + }); + } + + /** + * Fetch a partial thread by message id + * @param MessageCollection $thread + * @param string $message_id + * @param Folder $primary_folder + * @param Folder $secondary_folder + * @param Folder $sent_folder + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + protected function fetchThreadByMessageId(MessageCollection &$thread, string $message_id, Folder $primary_folder, Folder $secondary_folder, Folder $sent_folder): void { + $primary_folder->query()->messageId($message_id) + ->setFetchBody($this->getFetchBodyOption()) + ->leaveUnread()->get()->each(function($message) use (&$thread, $secondary_folder, $sent_folder) { + /** @var Message $message */ + $message->thread($sent_folder, $thread, $secondary_folder); + }); + } + + /** + * Copy the current Messages to a mailbox + * @param string $folder_path + * @param boolean $expunge + * @param bool $utf7 + * + * @return null|Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function copy(string $folder_path, bool $expunge = false, bool $utf7 = false): ?Message { + $this->client->openFolder($folder_path); + $status = $this->client->getConnection()->examineFolder($folder_path)->validatedData(); + + if (isset($status["uidnext"])) { + $next_uid = $status["uidnext"]; + if ((int)$next_uid <= 0) { + return null; + } + + /** @var Folder $folder */ + $folder = $this->client->getFolderByPath($folder_path, $utf7); + + $this->client->openFolder($this->folder_path); + if ($this->client->getConnection()->copyMessage($folder->path, $this->getSequenceId(), null, $this->sequence)->validatedData()) { + return $this->fetchNewMail($folder, $next_uid, "copied", $expunge); + } + } + + return null; + } + + /** + * Move the current Messages to a mailbox + * @param string $folder_path + * @param boolean $expunge + * @param bool $utf7 + * + * @return Message|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function move(string $folder_path, bool $expunge = false, bool $utf7 = false): ?Message { + $this->client->openFolder($folder_path); + $status = $this->client->getConnection()->examineFolder($folder_path)->validatedData(); + + if (isset($status["uidnext"])) { + $next_uid = $status["uidnext"]; + if ((int)$next_uid <= 0) { + return null; + } + + /** @var Folder $folder */ + $folder = $this->client->getFolderByPath($folder_path, $utf7); + + $this->client->openFolder($this->folder_path); + if ($this->client->getConnection()->moveMessage($folder->path, $this->getSequenceId(), null, $this->sequence)->validatedData()) { + return $this->fetchNewMail($folder, $next_uid, "moved", $expunge); + } + } + + return null; + } + + /** + * Fetch a new message and fire a given event + * @param Folder $folder + * @param int $next_uid + * @param string $event + * @param boolean $expunge + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + protected function fetchNewMail(Folder $folder, int $next_uid, string $event, bool $expunge): Message { + if ($expunge) $this->client->expunge(); + + $this->client->openFolder($folder->path); + + if ($this->sequence === IMAP::ST_UID) { + $sequence_id = $next_uid; + } else { + $sequence_id = $this->client->getConnection()->getMessageNumber($next_uid)->validatedData(); + } + + $message = $folder->query()->getMessage($sequence_id, null, $this->sequence); + $this->dispatch("message", $event, $this, $message); + + return $message; + } + + /** + * Delete the current Message + * @param bool $expunge + * @param string|null $trash_path + * @param boolean $force_move + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function delete(bool $expunge = true, ?string $trash_path = null, bool $force_move = false): bool { + $status = $this->setFlag("Deleted"); + if ($force_move) { + $trash_path = $trash_path === null ? $this->config["common_folders"]["trash"] : $trash_path; + $this->move($trash_path); + } + if ($expunge) $this->client->expunge(); + + $this->dispatch("message", "deleted", $this); + + return $status; + } + + /** + * Restore a deleted Message + * @param boolean $expunge + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function restore(bool $expunge = true): bool { + $status = $this->unsetFlag("Deleted"); + if ($expunge) $this->client->expunge(); + + $this->dispatch("message", "restored", $this); + + return $status; + } + + /** + * Set a given flag + * @param array|string $flag + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function setFlag(array|string $flag): bool { + $this->client->openFolder($this->folder_path); + $flag = "\\" . trim(is_array($flag) ? implode(" \\", $flag) : $flag); + $sequence_id = $this->getSequenceId(); + try { + $status = $this->client->getConnection()->store([$flag], $sequence_id, $sequence_id, "+", true, $this->sequence)->validatedData(); + } catch (Exceptions\RuntimeException $e) { + throw new MessageFlagException("flag could not be set", 0, $e); + } + $this->parseFlags(); + + $this->dispatch("flag", "new", $this, $flag); + + return (bool)$status; + } + + /** + * Unset a given flag + * @param array|string $flag + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function unsetFlag(array|string $flag): bool { + $this->client->openFolder($this->folder_path); + + $flag = "\\" . trim(is_array($flag) ? implode(" \\", $flag) : $flag); + $sequence_id = $this->getSequenceId(); + try { + $status = $this->client->getConnection()->store([$flag], $sequence_id, $sequence_id, "-", true, $this->sequence)->validatedData(); + } catch (Exceptions\RuntimeException $e) { + throw new MessageFlagException("flag could not be removed", 0, $e); + } + $this->parseFlags(); + + $this->dispatch("flag", "deleted", $this, $flag); + + return (bool)$status; + } + + /** + * Set a given flag + * @param array|string $flag + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function addFlag(array|string $flag): bool { + return $this->setFlag($flag); + } + + /** + * Unset a given flag + * @param array|string $flag + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageFlagException + * @throws RuntimeException + * @throws ResponseException + */ + public function removeFlag(array|string $flag): bool { + return $this->unsetFlag($flag); + } + + /** + * Get all message attachments. + * + * @return AttachmentCollection + */ + public function getAttachments(): AttachmentCollection { + return $this->attachments; + } + + /** + * Get all message attachments. + * + * @return AttachmentCollection + */ + public function attachments(): AttachmentCollection { + return $this->getAttachments(); + } + + /** + * Checks if there are any attachments present + * + * @return boolean + */ + public function hasAttachments(): bool { + return $this->attachments->isEmpty() === false; + } + + /** + * Get the raw body + * + * @return string + */ + public function getRawBody(): string { + if ($this->raw_body === "") { + $this->raw_body = $this->structure->raw; + } + + return $this->raw_body; + } + + /** + * Get the message header + * + * @return ?Header + */ + public function getHeader(): ?Header { + return $this->header; + } + + /** + * Get the current client + * + * @return ?Client + */ + public function getClient(): ?Client { + return $this->client; + } + + /** + * Get the used fetch option + * + * @return ?integer + */ + public function getFetchOptions(): ?int { + return $this->fetch_options; + } + + /** + * Get the used fetch body option + * + * @return boolean + */ + public function getFetchBodyOption(): bool { + return $this->fetch_body; + } + + /** + * Get the used fetch flags option + * + * @return boolean + */ + public function getFetchFlagsOption(): bool { + return $this->fetch_flags; + } + + /** + * Get all available bodies + * + * @return array + */ + public function getBodies(): array { + return $this->bodies; + } + + /** + * Get all set flags + * + * @return FlagCollection + */ + public function getFlags(): FlagCollection { + return $this->flags; + } + + /** + * Get all set flags + * + * @return FlagCollection + */ + public function flags(): FlagCollection { + return $this->getFlags(); + } + + /** + * Check if a flag is set + * + * @param string $flag + * @return boolean + */ + public function hasFlag(string $flag): bool { + $flag = str_replace("\\", "", strtolower($flag)); + return $this->getFlags()->has($flag); + } + + /** + * Get the fetched structure + * + * @return Structure|null + */ + public function getStructure(): ?Structure { + return $this->structure; + } + + /** + * Check if a message matches another by comparing basic attributes + * + * @param null|Message $message + * @return boolean + */ + public function is(?Message $message = null): bool { + if (is_null($message)) { + return false; + } + + return $this->uid == $message->uid + && $this->message_id->first() == $message->message_id->first() + && $this->subject->first() == $message->subject->first() + && $this->date->toDate()->eq($message->date->toDate()); + } + + /** + * Get all message attributes + * + * @return array + */ + public function getAttributes(): array { + return array_merge($this->attributes, $this->header->getAttributes()); + } + + /** + * Set the message mask + * @param $mask + * + * @return Message + */ + public function setMask($mask): Message { + if (class_exists($mask)) { + $this->mask = $mask; + } + + return $this; + } + + /** + * Get the used message mask + * + * @return string + */ + public function getMask(): string { + return $this->mask; + } + + /** + * Get a masked instance by providing a mask name + * @param mixed|null $mask + * + * @return mixed + * @throws MaskNotFoundException + */ + public function mask(mixed $mask = null): mixed { + $mask = $mask !== null ? $mask : $this->mask; + if (class_exists($mask)) { + return new $mask($this); + } + + throw new MaskNotFoundException("Unknown mask provided: " . $mask); + } + + /** + * Get the message path aka folder path + * + * @return string + */ + public function getFolderPath(): string { + return $this->folder_path; + } + + /** + * Set the message path aka folder path + * @param $folder_path + * + * @return Message + */ + public function setFolderPath($folder_path): Message { + $this->folder_path = $folder_path; + + return $this; + } + + /** + * Set the config + * @param Config $config + * + * @return Message + */ + public function setConfig(Config $config): Message { + $this->config = $config; + + return $this; + } + + /** + * Get the config + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } + + /** + * Set the options + * @param array $options + * + * @return Message + */ + public function setOptions(array $options): Message { + $this->options = $options; + + return $this; + } + + /** + * Get the options + * + * @return array + */ + public function getOptions(): array { + return $this->options; + } + + /** + * Set the available flags + * @param $available_flags + * + * @return Message + */ + public function setAvailableFlags($available_flags): Message { + $this->available_flags = $available_flags; + + return $this; + } + + /** + * Get the available flags + * + * @return array + */ + public function getAvailableFlags(): array { + return $this->available_flags; + } + + /** + * Set the attachment collection + * @param $attachments + * + * @return Message + */ + public function setAttachments($attachments): Message { + $this->attachments = $attachments; + + return $this; + } + + /** + * Set the flag collection + * @param $flags + * + * @return Message + */ + public function setFlags($flags): Message { + $this->flags = $flags; + + return $this; + } + + /** + * Set the client + * @param $client + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function setClient($client): Message { + $this->client = $client; + $this->client?->openFolder($this->folder_path); + + return $this; + } + + /** + * Set the message number + * @param int $uid + * + * @return Message + */ + public function setUid(int $uid): Message { + $this->uid = $uid; + $this->msgn = null; + $this->msglist = null; + + return $this; + } + + /** + * Set the message number + * @param int $msgn + * @param int|null $msglist + * + * @return Message + */ + public function setMsgn(int $msgn, ?int $msglist = null): Message { + $this->msgn = $msgn; + $this->msglist = $msglist; + $this->uid = null; + + return $this; + } + + /** + * Get the current sequence type + * + * @return int + */ + public function getSequence(): int { + return $this->sequence; + } + + /** + * Get the current sequence id (either a UID or a message number!) + * + * @return int + */ + public function getSequenceId(): int { + return $this->sequence === IMAP::ST_UID ? $this->uid : $this->msgn; + } + + /** + * Set the sequence id + * @param $uid + * @param int|null $msglist + */ + public function setSequenceId($uid, ?int $msglist = null): void { + if ($this->getSequence() === IMAP::ST_UID) { + $this->setUid($uid); + $this->setMsglist($msglist); + } else { + $this->setMsgn($uid, $msglist); + } + } + + /** + * Get the decoder instance + * + * @return DecoderInterface + */ + public function getDecoder(): DecoderInterface { + return $this->decoder; + } + + /** + * Set the decoder instance + * @param DecoderInterface $decoder + * + * @return $this + */ + public function setDecoder(DecoderInterface $decoder): static { + $this->decoder = $decoder; + return $this; + } + + /** + * Safe the entire message in a file + * @param $filename + * + * @return bool|int + */ + public function save($filename): bool|int { + return file_put_contents($filename, $this->header->raw."\r\n\r\n".$this->structure->raw); + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Part.php b/plugins/vendor/webklex/php-imap/src/Part.php new file mode 100644 index 00000000..3c55bdfb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Part.php @@ -0,0 +1,324 @@ +raw = $raw_part; + $this->config = $config; + $this->header = $header; + $this->part_number = $part_number; + $this->parse(); + } + + /** + * Parse the raw parts + * + * @throws InvalidMessageDateException + */ + protected function parse(): void { + if ($this->header === null) { + $body = $this->findHeaders(); + }else{ + $body = $this->raw; + } + + $this->parseDisposition(); + $this->parseDescription(); + $this->parseEncoding(); + + $this->charset = $this->header->get("charset")->first(); + $this->name = $this->header->get("name"); + $this->filename = $this->header->get("filename"); + + if($this->header->get("id")->exist()) { + $this->id = $this->header->get("id"); + } else if($this->header->get("x_attachment_id")->exist()){ + $this->id = $this->header->get("x_attachment_id"); + } else if($this->header->get("content_id")->exist()){ + $this->id = strtr($this->header->get("content_id"), [ + '<' => '', + '>' => '' + ]); + } + + $content_types = $this->header->get("content_type")->all(); + if(!empty($content_types)){ + $this->subtype = $this->parseSubtype($content_types); + $content_type = $content_types[0]; + $parts = explode(';', $content_type); + $this->content_type = trim($parts[0]); + } + + $this->content = trim(rtrim($body)); + $this->bytes = strlen($this->content); + } + + /** + * Find all available headers and return the leftover body segment + * + * @return string + * @throws InvalidMessageDateException + */ + private function findHeaders(): string { + $body = $this->raw; + while (($pos = strpos($body, "\r\n")) > 0) { + $body = substr($body, $pos + 2); + } + $headers = substr($this->raw, 0, strlen($body) * -1); + $body = substr($body, 0, -2); + + $this->header = new Header($headers, $this->config); + + return $body; + } + + /** + * Try to parse the subtype if any is present + * @param $content_type + * + * @return ?string + */ + private function parseSubtype($content_type): ?string { + if (is_array($content_type)) { + foreach ($content_type as $part){ + if ((strpos($part, "/")) !== false){ + return $this->parseSubtype($part); + } + } + return null; + } + if (($pos = strpos($content_type, "/")) !== false){ + return substr(explode(";", $content_type)[0], $pos + 1); + } + return null; + } + + /** + * Try to parse the disposition if any is present + */ + private function parseDisposition(): void { + $content_disposition = $this->header->get("content_disposition")->first(); + if($content_disposition) { + $this->ifdisposition = true; + $this->disposition = (is_array($content_disposition)) ? implode(' ', $content_disposition) : explode(";", $content_disposition)[0]; + } + } + + /** + * Try to parse the description if any is present + */ + private function parseDescription(): void { + $content_description = $this->header->get("content_description")->first(); + if($content_description) { + $this->ifdescription = true; + $this->description = $content_description; + } + } + + /** + * Try to parse the encoding if any is present + */ + private function parseEncoding(): void { + $encoding = $this->header->get("content_transfer_encoding")->first(); + if($encoding) { + $this->encoding = match (strtolower($encoding)) { + "quoted-printable" => IMAP::MESSAGE_ENC_QUOTED_PRINTABLE, + "base64" => IMAP::MESSAGE_ENC_BASE64, + "7bit" => IMAP::MESSAGE_ENC_7BIT, + "8bit" => IMAP::MESSAGE_ENC_8BIT, + "binary" => IMAP::MESSAGE_ENC_BINARY, + default => IMAP::MESSAGE_ENC_OTHER, + }; + } + } + + /** + * Check if the current part represents an attachment + * + * @return bool + */ + public function isAttachment(): bool { + $valid_disposition = in_array(strtolower($this->disposition ?? ''), $this->config->get('options.dispositions')); + + if ($this->type == IMAP::MESSAGE_TYPE_TEXT && ($this->ifdisposition == 0 || empty($this->disposition) || !$valid_disposition)) { + if (($this->subtype == null || in_array((strtolower($this->subtype)), ["plain", "html"])) && $this->filename == null && $this->name == null) { + return false; + } + } + + if ($this->disposition === "inline" && $this->filename == null && $this->name == null && !$this->header->has("content_id")) { + return false; + } + return true; + } + + /** + * Get the part header + * + * @return Header|null + */ + public function getHeader(): ?Header { + return $this->header; + } + + /** + * Get the Config instance + * + * @return Config + */ + public function getConfig(): Config { + return $this->config; + } + +} diff --git a/plugins/vendor/webklex/php-imap/src/Query/Query.php b/plugins/vendor/webklex/php-imap/src/Query/Query.php new file mode 100644 index 00000000..bed64a95 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Query/Query.php @@ -0,0 +1,1103 @@ +setClient($client); + $config = $this->client->getConfig(); + + $this->sequence = $config->get('options.sequence', IMAP::ST_MSGN); + if ($config->get('options.fetch') === IMAP::FT_PEEK) $this->leaveUnread(); + + if ($config->get('options.fetch_order') === 'desc') { + $this->fetch_order = 'desc'; + } else { + $this->fetch_order = 'asc'; + } + + $this->date_format = $config->get('date_format', 'd M y'); + $this->soft_fail = $config->get('options.soft_fail', false); + + $this->setExtensions($extensions); + $this->query = new Collection(); + $this->boot(); + } + + /** + * Instance boot method for additional functionality + */ + protected function boot(): void { + } + + /** + * Parse a given value + * @param mixed $value + * + * @return string + */ + protected function parse_value(mixed $value): string { + if ($value instanceof Carbon) { + $value = $value->format($this->date_format); + } + + return (string)$value; + } + + /** + * Check if a given date is a valid carbon object and if not try to convert it + * @param mixed $date + * + * @return Carbon + * @throws MessageSearchValidationException + */ + protected function parse_date(mixed $date): Carbon { + if ($date instanceof Carbon) return $date; + + try { + $date = Carbon::parse($date); + } catch (Exception) { + throw new MessageSearchValidationException(); + } + + return $date; + } + + /** + * Get the raw IMAP search query + * + * @return string + */ + public function generate_query(): string { + $query = ''; + $this->query->each(function($statement) use (&$query) { + if (count($statement) == 1) { + $query .= $statement[0]; + } else { + if ($statement[1] === null) { + $query .= $statement[0]; + } else { + if (is_numeric($statement[1]) || ( + ($statement[0] === 'SINCE' || $statement[0] === 'BEFORE') && + $this->client->getConfig()->get('options.unescaped_search_dates', false) + )) { + $query .= $statement[0] . ' ' . $statement[1]; + } else { + $query .= $statement[0] . ' "' . $statement[1] . '"'; + } + } + } + $query .= ' '; + + }); + + $this->raw_query = trim($query); + + return $this->raw_query; + } + + /** + * Perform an imap search request + * + * @return Collection + * @throws GetMessagesFailedException + * @throws AuthFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + public function search(): Collection { + $this->generate_query(); + + try { + $available_messages = $this->client->getConnection()->search([$this->getRawQuery()], $this->sequence)->validatedData(); + return new Collection($available_messages); + } catch (RuntimeException|ConnectionFailedException $e) { + throw new GetMessagesFailedException("failed to fetch messages", 0, $e); + } + } + + /** + * Count all available messages matching the current search criteria + * + * @return int + * @throws AuthFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + public function count(): int { + return $this->search()->count(); + } + + /** + * Fetch a given id collection + * @param Collection $available_messages + * + * @return array + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + protected function fetch(Collection $available_messages): array { + if ($this->fetch_order === 'desc') { + $available_messages = $available_messages->reverse(); + } + + $uids = $available_messages->forPage($this->page, $this->limit)->toArray(); + $extensions = $this->getExtensions(); + if (empty($extensions) === false && method_exists($this->client->getConnection(), "fetch")) { + // this polymorphic call is fine - the method exists at this point + $extensions = $this->client->getConnection()->fetch($extensions, $uids, null, $this->sequence)->validatedData(); + } + $flags = $this->client->getConnection()->flags($uids, $this->sequence)->validatedData(); + $headers = $this->client->getConnection()->headers($uids, "RFC822", $this->sequence)->validatedData(); + + $contents = []; + if ($this->getFetchBody()) { + $contents = $this->client->getConnection()->content($uids, $this->client->rfc, $this->sequence)->validatedData(); + } + + return [ + "uids" => $uids, + "flags" => $flags, + "headers" => $headers, + "contents" => $contents, + "extensions" => $extensions, + ]; + } + + /** + * Make a new message from given raw components + * @param integer $uid + * @param integer $msglist + * @param string $header + * @param string $content + * @param array $flags + * + * @return Message|null + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ReflectionException + * @throws ResponseException + */ + protected function make(int $uid, int $msglist, string $header, string $content, array $flags): ?Message { + try { + return Message::make($uid, $msglist, $this->getClient(), $header, $content, $flags, $this->getFetchOptions(), $this->sequence); + } catch (RuntimeException|MessageFlagException|InvalidMessageDateException|MessageContentFetchingException $e) { + $this->setError($uid, $e); + } + + $this->handleException($uid); + + return null; + } + + /** + * Get the message key for a given message + * @param string $message_key + * @param integer $msglist + * @param Message $message + * + * @return string + */ + protected function getMessageKey(string $message_key, int $msglist, Message $message): string { + $key = match ($message_key) { + 'number' => $message->getMessageNo(), + 'list' => $msglist, + 'uid' => $message->getUid(), + default => $message->getMessageId(), + }; + return (string)$key; + } + + /** + * Curates a given collection aof messages + * @param Collection $available_messages + * + * @return MessageCollection + * @throws GetMessagesFailedException + */ + public function curate_messages(Collection $available_messages): MessageCollection { + try { + if ($available_messages->count() > 0) { + return $this->populate($available_messages); + } + return MessageCollection::make(); + } catch (Exception $e) { + throw new GetMessagesFailedException($e->getMessage(), 0, $e); + } + } + + /** + * Populate a given id collection and receive a fully fetched message collection + * @param Collection $available_messages + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ReflectionException + * @throws RuntimeException + * @throws ResponseException + */ + protected function populate(Collection $available_messages): MessageCollection { + $messages = MessageCollection::make(); + $config = $this->client->getConfig(); + + $messages->total($available_messages->count()); + + $message_key = $config->get('options.message_key'); + + $raw_messages = $this->fetch($available_messages); + + $msglist = 0; + foreach ($raw_messages["headers"] as $uid => $header) { + $content = $raw_messages["contents"][$uid] ?? ""; + $flag = $raw_messages["flags"][$uid] ?? []; + $extensions = $raw_messages["extensions"][$uid] ?? []; + + $message = $this->make($uid, $msglist, $header, $content, $flag); + foreach ($extensions as $key => $extension) { + $message->getHeader()->set($key, $extension); + } + if ($message !== null) { + $key = $this->getMessageKey($message_key, $msglist, $message); + $messages->put("$key", $message); + } + $msglist++; + } + + return $messages; + } + + /** + * Fetch the current query and return all found messages + * + * @return MessageCollection + * @throws AuthFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + public function get(): MessageCollection { + return $this->curate_messages($this->search()); + } + + /** + * Fetch the current query as chunked requests + * @param callable $callback + * @param int $chunk_size + * @param int $start_chunk + * + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ReflectionException + * @throws RuntimeException + * @throws ResponseException + */ + public function chunked(callable $callback, int $chunk_size = 10, int $start_chunk = 1): void { + $start_chunk = max($start_chunk,1); + $chunk_size = max($chunk_size,1); + $skipped_messages_count = $chunk_size * ($start_chunk-1); + + $available_messages = $this->search(); + $available_messages_count = max($available_messages->count() - $skipped_messages_count,0); + + if ($available_messages_count > 0) { + $old_limit = $this->limit; + $old_page = $this->page; + + $this->limit = $chunk_size; + $this->page = $start_chunk; + $handled_messages_count = 0; + do { + $messages = $this->populate($available_messages); + $handled_messages_count += $messages->count(); + $callback($messages, $this->page); + $this->page++; + } while ($handled_messages_count < $available_messages_count); + $this->limit = $old_limit; + $this->page = $old_page; + } + } + + /** + * Paginate the current query + * @param int $per_page Results you which to receive per page + * @param null $page The current page you are on (e.g. 0, 1, 2, ...) use `null` to enable auto mode + * @param string $page_name The page name / uri parameter used for the generated links and the auto mode + * + * @return LengthAwarePaginator + * @throws AuthFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + */ + public function paginate(int $per_page = 5, $page = null, string $page_name = 'imap_page'): LengthAwarePaginator { + if ($page === null && isset($_GET[$page_name]) && $_GET[$page_name] > 0) { + $this->page = intval($_GET[$page_name]); + } elseif ($page > 0) { + $this->page = (int)$page; + } + + $this->limit = $per_page; + + return $this->get()->paginate($per_page, $this->page, $page_name, true); + } + + /** + * Get a new Message instance + * @param int $uid + * @param null $msglist + * @param null $sequence + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function getMessage(int $uid, $msglist = null, $sequence = null): Message { + return new Message($uid, $msglist, $this->getClient(), $this->getFetchOptions(), $this->getFetchBody(), $this->getFetchFlags(), $sequence ?: $this->sequence); + } + + /** + * Get a message by its message number + * @param $msgn + * @param null $msglist + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function getMessageByMsgn($msgn, $msglist = null): Message { + return $this->getMessage($msgn, $msglist, IMAP::ST_MSGN); + } + + /** + * Get a message by its uid + * @param $uid + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws RuntimeException + * @throws ResponseException + */ + public function getMessageByUid($uid): Message { + return $this->getMessage($uid, null, IMAP::ST_UID); + } + + /** + * Filter all available uids by a given closure and get a curated list of messages + * @param callable $closure + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function filter(callable $closure): MessageCollection { + $connection = $this->getClient()->getConnection(); + + $uids = $connection->getUid()->validatedData(); + $available_messages = new Collection(); + if (is_array($uids)) { + foreach ($uids as $id) { + if ($closure($id)) { + $available_messages->push($id); + } + } + } + + return $this->curate_messages($available_messages); + } + + /** + * Get all messages with an uid greater or equal to a given UID + * @param int $uid + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function getByUidGreaterOrEqual(int $uid): MessageCollection { + return $this->filter(function($id) use ($uid) { + return $id >= $uid; + }); + } + + /** + * Get all messages with an uid greater than a given UID + * @param int $uid + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function getByUidGreater(int $uid): MessageCollection { + return $this->filter(function($id) use ($uid) { + return $id > $uid; + }); + } + + /** + * Get all messages with an uid lower than a given UID + * @param int $uid + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function getByUidLower(int $uid): MessageCollection { + return $this->filter(function($id) use ($uid) { + return $id < $uid; + }); + } + + /** + * Get all messages with an uid lower or equal to a given UID + * @param int $uid + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function getByUidLowerOrEqual(int $uid): MessageCollection { + return $this->filter(function($id) use ($uid) { + return $id <= $uid; + }); + } + + /** + * Get all messages with an uid greater than a given UID + * @param int $uid + * + * @return MessageCollection + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws GetMessagesFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws RuntimeException + * @throws ResponseException + */ + public function getByUidLowerThan(int $uid): MessageCollection { + return $this->filter(function($id) use ($uid) { + return $id < $uid; + }); + } + + /** + * Don't mark messages as read when fetching + * + * @return $this + */ + public function leaveUnread(): static { + $this->setFetchOptions(IMAP::FT_PEEK); + + return $this; + } + + /** + * Mark all messages as read when fetching + * + * @return $this + */ + public function markAsRead(): static { + $this->setFetchOptions(IMAP::FT_UID); + + return $this; + } + + /** + * Set the sequence type + * @param int $sequence + * + * @return $this + */ + public function setSequence(int $sequence): static { + $this->sequence = $sequence; + + return $this; + } + + /** + * Get the sequence type + * + * @return int|string + */ + public function getSequence(): int|string { + return $this->sequence; + } + + /** + * @return Client + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + * @throws ResponseException + */ + public function getClient(): Client { + $this->client->checkConnection(); + return $this->client; + } + + /** + * Set the limit and page for the current query + * @param int $limit + * @param int $page + * + * @return $this + */ + public function limit(int $limit, int $page = 1): static { + if ($page >= 1) $this->page = $page; + $this->limit = $limit; + + return $this; + } + + /** + * Get the current query collection + * + * @return Collection + */ + public function getQuery(): Collection { + return $this->query; + } + + /** + * Set all query parameters + * @param array $query + * + * @return $this + */ + public function setQuery(array $query): static { + $this->query = new Collection($query); + return $this; + } + + /** + * Get the raw query + * + * @return string + */ + public function getRawQuery(): string { + return $this->raw_query; + } + + /** + * Set the raw query + * @param string $raw_query + * + * @return $this + */ + public function setRawQuery(string $raw_query): static { + $this->raw_query = $raw_query; + return $this; + } + + /** + * Get all applied extensions + * + * @return string[] + */ + public function getExtensions(): array { + return $this->extensions; + } + + /** + * Set all extensions that should be used + * @param string[] $extensions + * + * @return $this + */ + public function setExtensions(array $extensions): static { + $this->extensions = $extensions; + if (count($this->extensions) > 0) { + if (in_array("UID", $this->extensions) === false) { + $this->extensions[] = "UID"; + } + } + return $this; + } + + /** + * Set the client instance + * @param Client $client + * + * @return $this + */ + public function setClient(Client $client): static { + $this->client = $client; + return $this; + } + + /** + * Get the set fetch limit + * + * @return ?int + */ + public function getLimit(): ?int { + return $this->limit; + } + + /** + * Set the fetch limit + * @param int $limit + * + * @return $this + */ + public function setLimit(int $limit): static { + $this->limit = $limit <= 0 ? null : $limit; + return $this; + } + + /** + * Get the set page + * + * @return int + */ + public function getPage(): int { + return $this->page; + } + + /** + * Set the page + * @param int $page + * + * @return $this + */ + public function setPage(int $page): static { + $this->page = $page; + return $this; + } + + /** + * Set the fetch option flag + * @param int $fetch_options + * + * @return $this + */ + public function setFetchOptions(int $fetch_options): static { + $this->fetch_options = $fetch_options; + return $this; + } + + /** + * Set the fetch option flag + * @param int $fetch_options + * + * @return $this + */ + public function fetchOptions(int $fetch_options): static { + return $this->setFetchOptions($fetch_options); + } + + /** + * Get the fetch option flag + * + * @return ?int + */ + public function getFetchOptions(): ?int { + return $this->fetch_options; + } + + /** + * Get the fetch body flag + * + * @return boolean + */ + public function getFetchBody(): bool { + return $this->fetch_body; + } + + /** + * Set the fetch body flag + * @param boolean $fetch_body + * + * @return $this + */ + public function setFetchBody(bool $fetch_body): static { + $this->fetch_body = $fetch_body; + return $this; + } + + /** + * Set the fetch body flag + * @param boolean $fetch_body + * + * @return $this + */ + public function fetchBody(bool $fetch_body): static { + return $this->setFetchBody($fetch_body); + } + + /** + * Get the fetch body flag + * + * @return bool + */ + public function getFetchFlags(): bool { + return $this->fetch_flags; + } + + /** + * Set the fetch flag + * @param bool $fetch_flags + * + * @return $this + */ + public function setFetchFlags(bool $fetch_flags): static { + $this->fetch_flags = $fetch_flags; + return $this; + } + + /** + * Set the fetch order + * @param string $fetch_order + * + * @return $this + */ + public function setFetchOrder(string $fetch_order): static { + $fetch_order = strtolower($fetch_order); + + if (in_array($fetch_order, ['asc', 'desc'])) { + $this->fetch_order = $fetch_order; + } + + return $this; + } + + /** + * Set the fetch order + * @param string $fetch_order + * + * @return $this + */ + public function fetchOrder(string $fetch_order): static { + return $this->setFetchOrder($fetch_order); + } + + /** + * Get the fetch order + * + * @return string + */ + public function getFetchOrder(): string { + return $this->fetch_order; + } + + /** + * Set the fetch order to ascending + * + * @return $this + */ + public function setFetchOrderAsc(): static { + return $this->setFetchOrder('asc'); + } + + /** + * Set the fetch order to ascending + * + * @return $this + */ + public function fetchOrderAsc(): static { + return $this->setFetchOrderAsc(); + } + + /** + * Set the fetch order to descending + * + * @return $this + */ + public function setFetchOrderDesc(): static { + return $this->setFetchOrder('desc'); + } + + /** + * Set the fetch order to descending + * + * @return $this + */ + public function fetchOrderDesc(): static { + return $this->setFetchOrderDesc(); + } + + /** + * Set soft fail mode + * @var boolean $state + * + * @return $this + */ + public function softFail(bool $state = true): static { + return $this->setSoftFail($state); + } + + /** + * Set soft fail mode + * + * @var boolean $state + * @return $this + */ + public function setSoftFail(bool $state = true): static { + $this->soft_fail = $state; + + return $this; + } + + /** + * Get soft fail mode + * + * @return boolean + */ + public function getSoftFail(): bool { + return $this->soft_fail; + } + + /** + * Handle the exception for a given uid + * @param integer $uid + * + * @throws GetMessagesFailedException + */ + protected function handleException(int $uid): void { + if ($this->soft_fail === false && $this->hasError($uid)) { + $error = $this->getError($uid); + throw new GetMessagesFailedException($error->getMessage(), 0, $error); + } + } + + /** + * Add a new error to the error holder + * @param integer $uid + * @param Exception $error + */ + protected function setError(int $uid, Exception $error): void { + $this->errors[$uid] = $error; + } + + /** + * Check if there are any errors / exceptions present + * @var ?integer $uid + * + * @return boolean + */ + public function hasErrors(?int $uid = null): bool { + if ($uid !== null) { + return $this->hasError($uid); + } + return count($this->errors) > 0; + } + + /** + * Check if there is an error / exception present + * @var integer $uid + * + * @return boolean + */ + public function hasError(int $uid): bool { + return isset($this->errors[$uid]); + } + + /** + * Get all available errors / exceptions + * + * @return array + */ + public function errors(): array { + return $this->getErrors(); + } + + /** + * Get all available errors / exceptions + * + * @return array + */ + public function getErrors(): array { + return $this->errors; + } + + /** + * Get a specific error / exception + * @var integer $uid + * + * @return Exception|null + */ + public function error(int $uid): ?Exception { + return $this->getError($uid); + } + + /** + * Get a specific error / exception + * @var integer $uid + * + * @return ?Exception + */ + public function getError(int $uid): ?Exception { + if ($this->hasError($uid)) { + return $this->errors[$uid]; + } + return null; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Query/WhereQuery.php b/plugins/vendor/webklex/php-imap/src/Query/WhereQuery.php new file mode 100755 index 00000000..5636cf35 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Query/WhereQuery.php @@ -0,0 +1,555 @@ +whereNot(); + $name = substr($name, 3); + } + + if (!str_contains(strtolower($name), "where")) { + $method = 'where' . ucfirst($name); + } else { + $method = lcfirst($name); + } + + if (method_exists($this, $method) === true) { + return call_user_func_array([$that, $method], $arguments); + } + + throw new MethodNotFoundException("Method " . self::class . '::' . $method . '() is not supported'); + } + + /** + * Validate a given criteria + * @param $criteria + * + * @return string + * @throws InvalidWhereQueryCriteriaException + */ + protected function validate_criteria($criteria): string { + $command = strtoupper($criteria); + if (str_starts_with($command, "CUSTOM ")) { + return substr($criteria, 7); + } + if (in_array($command, $this->available_criteria) === false) { + throw new InvalidWhereQueryCriteriaException("Invalid imap search criteria: $command"); + } + + return $criteria; + } + + /** + * Register search parameters + * @param mixed $criteria + * @param mixed $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + * + * Examples: + * $query->from("someone@email.tld")->seen(); + * $query->whereFrom("someone@email.tld")->whereSeen(); + * $query->where([["FROM" => "someone@email.tld"], ["SEEN"]]); + * $query->where(["FROM" => "someone@email.tld"])->where(["SEEN"]); + * $query->where(["FROM" => "someone@email.tld", "SEEN"]); + * $query->where("FROM", "someone@email.tld")->where("SEEN"); + */ + public function where(mixed $criteria, mixed $value = null): static { + if (is_array($criteria)) { + foreach ($criteria as $key => $value) { + if (is_numeric($key)) { + $this->where($value); + }else{ + $this->where($key, $value); + } + } + } else { + $this->push_search_criteria($criteria, $value); + } + + return $this; + } + + /** + * Push a given search criteria and value pair to the search query + * @param $criteria string + * @param $value mixed + * + * @throws InvalidWhereQueryCriteriaException + */ + protected function push_search_criteria(string $criteria, mixed $value): void { + $criteria = $this->validate_criteria($criteria); + $value = $this->parse_value($value); + + if ($value === '') { + $this->query->push([$criteria]); + } else { + $this->query->push([$criteria, $value]); + } + } + + /** + * @param Closure|null $closure + * + * @return $this + */ + public function orWhere(?Closure $closure = null): static { + $this->query->push(['OR']); + if ($closure !== null) $closure($this); + + return $this; + } + + /** + * @param Closure|null $closure + * + * @return $this + */ + public function andWhere(?Closure $closure = null): static { + $this->query->push(['AND']); + if ($closure !== null) $closure($this); + + return $this; + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereAll(): static { + return $this->where('ALL'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereAnswered(): static { + return $this->where('ANSWERED'); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereBcc(string $value): static { + return $this->where('BCC', $value); + } + + /** + * @param mixed $value + * @return $this + * @throws InvalidWhereQueryCriteriaException + * @throws MessageSearchValidationException + */ + public function whereBefore(mixed $value): static { + $date = $this->parse_date($value); + return $this->where('BEFORE', $date); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereBody(string $value): static { + return $this->where('BODY', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereCc(string $value): static { + return $this->where('CC', $value); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereDeleted(): static { + return $this->where('DELETED'); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereFlagged(string $value): static { + return $this->where('FLAGGED', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereFrom(string $value): static { + return $this->where('FROM', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereKeyword(string $value): static { + return $this->where('KEYWORD', $value); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereNew(): static { + return $this->where('NEW'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereNot(): static { + return $this->where('NOT'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereOld(): static { + return $this->where('OLD'); + } + + /** + * @param mixed $value + * + * @return $this + * @throws MessageSearchValidationException + * @throws InvalidWhereQueryCriteriaException + */ + public function whereOn(mixed $value): static { + $date = $this->parse_date($value); + return $this->where('ON', $date); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereRecent(): static { + return $this->where('RECENT'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereSeen(): static { + return $this->where('SEEN'); + } + + /** + * @param mixed $value + * + * @return $this + * @throws MessageSearchValidationException + * @throws InvalidWhereQueryCriteriaException + */ + public function whereSince(mixed $value): static { + $date = $this->parse_date($value); + return $this->where('SINCE', $date); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereSubject(string $value): static { + return $this->where('SUBJECT', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereText(string $value): static { + return $this->where('TEXT', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereTo(string $value): static { + return $this->where('TO', $value); + } + + /** + * @param string $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUnkeyword(string $value): static { + return $this->where('UNKEYWORD', $value); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUnanswered(): static { + return $this->where('UNANSWERED'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUndeleted(): static { + return $this->where('UNDELETED'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUnflagged(): static { + return $this->where('UNFLAGGED'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUnseen(): static { + return $this->where('UNSEEN'); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereNoXSpam(): static { + return $this->where("CUSTOM X-Spam-Flag NO"); + } + + /** + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereIsXSpam(): static { + return $this->where("CUSTOM X-Spam-Flag YES"); + } + + /** + * Search for a specific header value + * @param $header + * @param $value + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereHeader($header, $value): static { + return $this->where("CUSTOM HEADER $header $value"); + } + + /** + * Search for a specific message id + * @param $messageId + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereMessageId($messageId): static { + return $this->whereHeader("Message-ID", $messageId); + } + + /** + * Search for a specific message id + * @param $messageId + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereInReplyTo($messageId): static { + return $this->whereHeader("In-Reply-To", $messageId); + } + + /** + * @param $country_code + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereLanguage($country_code): static { + return $this->where("Content-Language $country_code"); + } + + /** + * Get message be it UID. + * + * @param int|string $uid + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUid(int|string $uid): static { + return $this->where('UID', $uid); + } + + /** + * Get messages by their UIDs. + * + * @param array $uids + * + * @return $this + * @throws InvalidWhereQueryCriteriaException + */ + public function whereUidIn(array $uids): static { + $uids = implode(',', $uids); + return $this->where('UID', $uids); + } + + /** + * Apply the callback if the given "value" is truthy. + * copied from @url https://github.com/laravel/framework/blob/8.x/src/Illuminate/Support/Traits/Conditionable.php + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|null + */ + public function when(mixed $value, callable $callback, ?callable $default = null): mixed { + if ($value) { + return $callback($this, $value) ?: $this; + } elseif ($default) { + return $default($this, $value) ?: $this; + } + + return $this; + } + + /** + * Apply the callback if the given "value" is falsy. + * copied from @url https://github.com/laravel/framework/blob/8.x/src/Illuminate/Support/Traits/Conditionable.php + * + * @param mixed $value + * @param callable $callback + * @param callable|null $default + * @return $this|mixed + */ + public function unless(mixed $value, callable $callback, ?callable $default = null): mixed { + if (!$value) { + return $callback($this, $value) ?: $this; + } elseif ($default) { + return $default($this, $value) ?: $this; + } + + return $this; + } + + /** + * Get all available search criteria + * + * @return array|string[] + */ + public function getAvailableCriteria(): array { + return $this->available_criteria; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Structure.php b/plugins/vendor/webklex/php-imap/src/Structure.php new file mode 100644 index 00000000..11f4cd66 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Structure.php @@ -0,0 +1,172 @@ +raw = $raw_structure; + $this->header = $header; + $this->options = $header->getConfig()->get('options'); + $this->parse(); + } + + /** + * Parse the given raw structure + * + * @throws MessageContentFetchingException + * @throws InvalidMessageDateException + */ + protected function parse(): void { + $this->findContentType(); + $this->parts = $this->find_parts(); + } + + /** + * Determine the message content type + */ + public function findContentType(): void { + $content_type = $this->header->get("content_type")->first(); + if($content_type && stripos($content_type, 'multipart') === 0) { + $this->type = IMAP::MESSAGE_TYPE_MULTIPART; + }else{ + $this->type = IMAP::MESSAGE_TYPE_TEXT; + } + } + + /** + * Find all available headers and return the leftover body segment + * @var string $context + * @var integer $part_number + * + * @return Part[] + * @throws InvalidMessageDateException + */ + private function parsePart(string $context, int $part_number = 0): array { + $body = $context; + while (($pos = strpos($body, "\r\n")) > 0) { + $body = substr($body, $pos + 2); + } + $headers = substr($context, 0, strlen($body) * -1); + $body = substr($body, 0, -2); + + $config = $this->header->getConfig(); + $headers = new Header($headers, $config); + if (($boundary = $headers->getBoundary()) !== null) { + $parts = $this->detectParts($boundary, $body, $part_number); + + if(count($parts) > 1) { + return $parts; + } + } + + return [new Part($body, $this->header->getConfig(), $headers, $part_number)]; + } + + /** + * @param string $boundary + * @param string $context + * @param int $part_number + * + * @return array + * @throws InvalidMessageDateException + */ + private function detectParts(string $boundary, string $context, int $part_number = 0): array { + $base_parts = explode( "--".$boundary, $context); + if(count($base_parts) == 0) { + $base_parts = explode($boundary, $context); + } + $final_parts = []; + foreach($base_parts as $ctx) { + $ctx = substr($ctx, 2); + if ($ctx !== "--" && $ctx != "" && $ctx != "\r\n") { + $parts = $this->parsePart($ctx, $part_number); + foreach ($parts as $part) { + $final_parts[] = $part; + $part_number = $part->part_number; + } + $part_number++; + } + } + return $final_parts; + } + + /** + * Find all available parts + * + * @return array + * @throws MessageContentFetchingException + * @throws InvalidMessageDateException + */ + public function find_parts(): array { + if($this->type === IMAP::MESSAGE_TYPE_MULTIPART) { + if (($boundary = $this->header->getBoundary()) === null) { + throw new MessageContentFetchingException("no content found", 0); + } + + return $this->detectParts($boundary, $this->raw); + } + + return [new Part($this->raw, $this->header->getConfig(), $this->header)]; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Support/AttachmentCollection.php b/plugins/vendor/webklex/php-imap/src/Support/AttachmentCollection.php new file mode 100644 index 00000000..9d2af20d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/AttachmentCollection.php @@ -0,0 +1,26 @@ + + */ +class AttachmentCollection extends PaginatedCollection { + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/FlagCollection.php b/plugins/vendor/webklex/php-imap/src/Support/FlagCollection.php new file mode 100644 index 00000000..b8bf352c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/FlagCollection.php @@ -0,0 +1,25 @@ + + */ +class FlagCollection extends PaginatedCollection { + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/FolderCollection.php b/plugins/vendor/webklex/php-imap/src/Support/FolderCollection.php new file mode 100644 index 00000000..212ddb0a --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/FolderCollection.php @@ -0,0 +1,26 @@ + + */ +class FolderCollection extends PaginatedCollection { + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/Masks/AttachmentMask.php b/plugins/vendor/webklex/php-imap/src/Support/Masks/AttachmentMask.php new file mode 100644 index 00000000..2559c5b9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/Masks/AttachmentMask.php @@ -0,0 +1,45 @@ +parent->content); + } + + /** + * Get a base64 image src string + * + * @return string|null + */ + public function getImageSrc(): ?string { + return 'data:'.$this->parent->content_type.';base64,'.$this->getContentBase64Encoded(); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/Masks/Mask.php b/plugins/vendor/webklex/php-imap/src/Support/Masks/Mask.php new file mode 100755 index 00000000..2101f574 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/Masks/Mask.php @@ -0,0 +1,137 @@ +parent = $parent; + + if(method_exists($this->parent, 'getAttributes')){ + $this->attributes = array_merge($this->attributes, $this->parent->getAttributes()); + } + + $this->boot(); + } + + /** + * Boot method made to be used by any custom mask + */ + protected function boot(): void {} + + /** + * Call dynamic attribute setter and getter methods and inherit the parent calls + * @param string $method + * @param array $arguments + * + * @return mixed + * @throws MethodNotFoundException + */ + public function __call(string $method, array $arguments) { + if(strtolower(substr($method, 0, 3)) === 'get') { + $name = Str::snake(substr($method, 3)); + + if(isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + }elseif (strtolower(substr($method, 0, 3)) === 'set') { + $name = Str::snake(substr($method, 3)); + + if(isset($this->attributes[$name])) { + $this->attributes[$name] = array_pop($arguments); + + return $this->attributes[$name]; + } + + } + + if(method_exists($this->parent, $method) === true){ + return call_user_func_array([$this->parent, $method], $arguments); + } + + throw new MethodNotFoundException("Method ".self::class.'::'.$method.'() is not supported'); + } + + /** + * Magic setter + * @param $name + * @param $value + * + * @return mixed + */ + public function __set($name, $value) { + $this->attributes[$name] = $value; + + return $this->attributes[$name]; + } + + /** + * Magic getter + * @param $name + * + * @return mixed|null + */ + public function __get($name) { + if(isset($this->attributes[$name])) { + return $this->attributes[$name]; + } + + return null; + } + + /** + * Get the parent instance + * + * @return mixed + */ + public function getParent(): mixed { + return $this->parent; + } + + /** + * Get all available attributes + * + * @return array + */ + public function getAttributes(): array { + return $this->attributes; + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/Masks/MessageMask.php b/plugins/vendor/webklex/php-imap/src/Support/Masks/MessageMask.php new file mode 100644 index 00000000..aa3623f9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/Masks/MessageMask.php @@ -0,0 +1,87 @@ +parent->getBodies(); + if (!isset($bodies['html'])) { + return null; + } + + if(is_object($bodies['html']) && property_exists($bodies['html'], 'content')) { + return $bodies['html']->content; + } + return $bodies['html']; + } + + /** + * Get the Message html body filtered by an optional callback + * @param callable|null $callback + * + * @return string|null + */ + public function getCustomHTMLBody(?callable $callback = null): ?string { + $body = $this->getHtmlBody(); + if($body === null) return null; + + if ($callback !== null) { + $aAttachment = $this->parent->getAttachments(); + $aAttachment->each(function($oAttachment) use(&$body, $callback) { + /** @var Attachment $oAttachment */ + if(is_callable($callback)) { + $body = $callback($body, $oAttachment); + }elseif(is_string($callback)) { + call_user_func($callback, [$body, $oAttachment]); + } + }); + } + + return $body; + } + + /** + * Get the Message html body with embedded base64 images + * the resulting $body. + * + * @return string|null + */ + public function getHTMLBodyWithEmbeddedBase64Images(): ?string { + return $this->getCustomHTMLBody(function($body, $oAttachment){ + /** @var Attachment $oAttachment */ + if ($oAttachment->id) { + $body = str_replace('cid:'.$oAttachment->id, 'data:'.$oAttachment->getContentType().';base64, '.base64_encode($oAttachment->getContent()), $body); + } + + return $body; + }); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/Support/MessageCollection.php b/plugins/vendor/webklex/php-imap/src/Support/MessageCollection.php new file mode 100644 index 00000000..1ca97a70 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/MessageCollection.php @@ -0,0 +1,26 @@ + + */ +class MessageCollection extends PaginatedCollection { + +} diff --git a/plugins/vendor/webklex/php-imap/src/Support/PaginatedCollection.php b/plugins/vendor/webklex/php-imap/src/Support/PaginatedCollection.php new file mode 100644 index 00000000..3b3470e9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Support/PaginatedCollection.php @@ -0,0 +1,82 @@ +total ?: $this->count(); + + $results = !$prepaginated && $total ? $this->forPage($page, $per_page)->toArray() : $this->all(); + + return $this->paginator($results, $total, $per_page, $page, [ + 'path' => Paginator::resolveCurrentPath(), + 'pageName' => $page_name, + ]); + } + + /** + * Create a new length-aware paginator instance. + * @param array $items + * @param int $total + * @param int $per_page + * @param int|null $current_page + * @param array $options + * + * @return LengthAwarePaginator + */ + protected function paginator(array $items, int $total, int $per_page, ?int $current_page, array $options): LengthAwarePaginator { + return new LengthAwarePaginator($items, $total, $per_page, $current_page, $options); + } + + /** + * Get and set the total amount + * @param null $total + * + * @return int|null + */ + public function total($total = null): ?int { + if($total === null) { + return $this->total; + } + + return $this->total = $total; + } +} diff --git a/plugins/vendor/webklex/php-imap/src/Traits/HasEvents.php b/plugins/vendor/webklex/php-imap/src/Traits/HasEvents.php new file mode 100644 index 00000000..6dc382b7 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/Traits/HasEvents.php @@ -0,0 +1,86 @@ +events[$section])) { + $this->events[$section][$event] = $class; + } + } + + /** + * Set all events + * @param array $events + */ + public function setEvents(array $events): void { + $this->events = $events; + } + + /** + * Get a specific event callback + * @param string $section + * @param string $event + * + * @return Event|string + * @throws EventNotFoundException + */ + public function getEvent(string $section, string $event): Event|string { + if (isset($this->events[$section])) { + return $this->events[$section][$event]; + } + throw new EventNotFoundException(); + } + + /** + * Get all events + * + * @return array + */ + public function getEvents(): array { + return $this->events; + } + + /** + * Dispatch a specific event. + * @throws EventNotFoundException + */ + public function dispatch(string $section, string $event, mixed ...$args): void { + $event = $this->getEvent($section, $event); + $event::dispatch(...$args); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/src/config/imap.php b/plugins/vendor/webklex/php-imap/src/config/imap.php new file mode 100644 index 00000000..abf8e6e6 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/src/config/imap.php @@ -0,0 +1,274 @@ + 'd-M-Y', + + /* + |-------------------------------------------------------------------------- + | Default account + |-------------------------------------------------------------------------- + | + | The default account identifier. It will be used as default for any missing account parameters. + | If however the default account is missing a parameter the package default will be used. + | Set to 'false' [boolean] to disable this functionality. + | + */ + 'default' => 'default', + + /* + |-------------------------------------------------------------------------- + | Security options + |-------------------------------------------------------------------------- + | + | You can enable or disable certain security features here by setting them to true or false to enable or disable + | them. + | -detect_spoofing: + | Detect spoofing attempts by checking the message sender against the message headers. + | Default TRUE + | -detect_spoofing_exception: + | Throw an exception if a spoofing attempt is detected. + | Default FALSE + | -sanitize_filenames: + | Sanitize attachment filenames by removing any unwanted and potentially dangerous characters. This is not a + | 100% secure solution, but it should help to prevent some common attacks. Please sanitize the filenames + | again if you need a more secure solution. + | Default TRUE + | + */ + 'security' => [ + "detect_spoofing" => true, + "detect_spoofing_exception" => false, + "sanitize_filenames" => true, + ], + + /* + |-------------------------------------------------------------------------- + | Available accounts + |-------------------------------------------------------------------------- + | + | Please list all IMAP accounts which you are planning to use within the + | array below. + | + */ + 'accounts' => [ + + 'default' => [// account identifier + 'host' => 'localhost', + 'port' => 993, + 'protocol' => 'imap', //might also use imap, [pop3 or nntp (untested)] + 'encryption' => 'ssl', // Supported: false, 'ssl', 'tls' + 'validate_cert' => true, + 'username' => 'root@example.com', + 'password' => '', + 'authentication' => null, + 'rfc' => 'RFC822', // If you are using iCloud, you might want to set this to 'BODY' + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + "timeout" => 30, + "extensions" => [] + ], + + /* + 'gmail' => [ // account identifier + 'host' => 'imap.gmail.com', + 'port' => 993, + 'encryption' => 'ssl', + 'validate_cert' => true, + 'username' => 'example@gmail.com', + 'password' => 'PASSWORD', + 'authentication' => 'oauth', + ], + + 'another' => [ // account identifier + 'host' => '', + 'port' => 993, + 'encryption' => false, + 'validate_cert' => true, + 'username' => '', + 'password' => '', + 'authentication' => null, + ] + */ + ], + + /* + |-------------------------------------------------------------------------- + | Available IMAP options + |-------------------------------------------------------------------------- + | + | Available php imap config parameters are listed below + | -Delimiter (optional): + | This option is only used when calling $oClient-> + | You can use any supported char such as ".", "/", (...) + | -Fetch option: + | IMAP::FT_UID - Message marked as read by fetching the body message + | IMAP::FT_PEEK - Fetch the message without setting the "seen" flag + | -Fetch sequence id: + | IMAP::ST_UID - Fetch message components using the message uid + | IMAP::ST_MSGN - Fetch message components using the message number + | -Body download option + | Default TRUE + | -Flag download option + | Default TRUE + | -Soft fail + | Default FALSE - Set to TRUE if you want to ignore certain exception while fetching bulk messages + | -RFC822 + | Default TRUE - Set to FALSE to prevent the usage of \imap_rfc822_parse_headers(). + | See https://github.com/Webklex/php-imap/issues/115 for more information. + | -Debug enable to trace communication traffic + | -UID cache enable the UID cache + | -Fallback date is used if the given message date could not be parsed + | -Boundary regex used to detect message boundaries. If you are having problems with empty messages, missing + | attachments or anything like this. Be advised that it likes to break which causes new problems.. + | -Message key identifier option + | You can choose between the following: + | 'id' - Use the MessageID as array key (default, might cause hickups with yahoo mail) + | 'number' - Use the message number as array key (isn't always unique and can cause some interesting behavior) + | 'list' - Use the message list number as array key (incrementing integer (does not always start at 0 or 1) + | 'uid' - Use the message uid as array key (isn't always unique and can cause some interesting behavior) + | -Fetch order + | 'asc' - Order all messages ascending (probably results in oldest first) + | 'desc' - Order all messages descending (probably results in newest first) + | -Disposition types potentially considered an attachment + | Default ['attachment', 'inline'] + | -Common folders + | Default folder locations and paths assumed if none is provided + | -Open IMAP options: + | DISABLE_AUTHENTICATOR - Disable authentication properties. + | Use 'GSSAPI' if you encounter the following + | error: "Kerberos error: No credentials cache + | file found (try running kinit) (...)" + | or ['GSSAPI','PLAIN'] if you are using outlook mail + | + */ + 'options' => [ + 'delimiter' => '/', + 'fetch' => \Webklex\PHPIMAP\IMAP::FT_PEEK, + 'sequence' => \Webklex\PHPIMAP\IMAP::ST_UID, + 'fetch_body' => true, + 'fetch_flags' => true, + 'soft_fail' => false, + 'rfc822' => true, + 'debug' => false, + 'unescaped_search_dates' => false, + 'uid_cache' => true, + // 'fallback_date' => "01.01.1970 00:00:00", + 'boundary' => '/boundary=(.*?(?=;)|(.*))/i', + 'message_key' => 'list', + 'fetch_order' => 'asc', + 'dispositions' => ['attachment', 'inline'], + 'common_folders' => [ + "root" => "INBOX", + "junk" => "INBOX/Junk", + "draft" => "INBOX/Drafts", + "sent" => "INBOX/Sent", + "trash" => "INBOX/Trash", + ], + 'open' => [ + // 'DISABLE_AUTHENTICATOR' => 'GSSAPI' + ] + ], + + /** + * |-------------------------------------------------------------------------- + * | Available decoding options + * |-------------------------------------------------------------------------- + * | + * | Available php imap config parameters are listed below + * | -options: Decoder options (currently only the message subject and attachment name decoder can be set) + * | 'utf-8' - Uses imap_utf8($string) to decode a string + * | 'mimeheader' - Uses mb_decode_mimeheader($string) to decode a string + * | -decoder: Decoder to be used. Can be replaced by custom decoders if needed. + * | 'header' - HeaderDecoder + * | 'message' - MessageDecoder + * | 'attachment' - AttachmentDecoder + */ + 'decoding' => [ + 'options' => [ + 'header' => 'utf-8', // mimeheader + 'message' => 'utf-8', // mimeheader + 'attachment' => 'utf-8' // mimeheader + ], + 'decoder' => [ + 'header' => \Webklex\PHPIMAP\Decoder\HeaderDecoder::class, + 'message' => \Webklex\PHPIMAP\Decoder\MessageDecoder::class, + 'attachment' => \Webklex\PHPIMAP\Decoder\AttachmentDecoder::class + ] + ], + + /* + |-------------------------------------------------------------------------- + | Available flags + |-------------------------------------------------------------------------- + | + | List all available / supported flags. Set to null to accept all given flags. + */ + 'flags' => ['recent', 'flagged', 'answered', 'deleted', 'seen', 'draft'], + + /* + |-------------------------------------------------------------------------- + | Available events + |-------------------------------------------------------------------------- + | + */ + 'events' => [ + "message" => [ + 'new' => \Webklex\PHPIMAP\Events\MessageNewEvent::class, + 'moved' => \Webklex\PHPIMAP\Events\MessageMovedEvent::class, + 'copied' => \Webklex\PHPIMAP\Events\MessageCopiedEvent::class, + 'deleted' => \Webklex\PHPIMAP\Events\MessageDeletedEvent::class, + 'restored' => \Webklex\PHPIMAP\Events\MessageRestoredEvent::class, + ], + "folder" => [ + 'new' => \Webklex\PHPIMAP\Events\FolderNewEvent::class, + 'moved' => \Webklex\PHPIMAP\Events\FolderMovedEvent::class, + 'deleted' => \Webklex\PHPIMAP\Events\FolderDeletedEvent::class, + ], + "flag" => [ + 'new' => \Webklex\PHPIMAP\Events\FlagNewEvent::class, + 'deleted' => \Webklex\PHPIMAP\Events\FlagDeletedEvent::class, + ], + ], + + /* + |-------------------------------------------------------------------------- + | Available masking options + |-------------------------------------------------------------------------- + | + | By using your own custom masks you can implement your own methods for + | a better and faster access and less code to write. + | + | Checkout the two examples custom_attachment_mask and custom_message_mask + | for a quick start. + | + | The provided masks below are used as the default masks. + */ + 'masks' => [ + 'message' => \Webklex\PHPIMAP\Support\Masks\MessageMask::class, + 'attachment' => \Webklex\PHPIMAP\Support\Masks\AttachmentMask::class + ] +]; diff --git a/plugins/vendor/webklex/php-imap/tests/AddressTest.php b/plugins/vendor/webklex/php-imap/tests/AddressTest.php new file mode 100644 index 00000000..442462fb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/AddressTest.php @@ -0,0 +1,72 @@ + "Username", + "mailbox" => "info", + "host" => "domain.tld", + "mail" => "info@domain.tld", + "full" => "Username ", + ]; + + /** + * Address test + * + * @return void + */ + public function testAddress(): void { + $address = new Address((object)$this->data); + + self::assertSame("Username", $address->personal); + self::assertSame("info", $address->mailbox); + self::assertSame("domain.tld", $address->host); + self::assertSame("info@domain.tld", $address->mail); + self::assertSame("Username ", $address->full); + } + + /** + * Test Address to string conversion + * + * @return void + */ + public function testAddressToStringConversion(): void { + $address = new Address((object)$this->data); + + self::assertSame("Username ", (string)$address); + } + + /** + * Test Address serialization + * + * @return void + */ + public function testAddressSerialization(): void { + $address = new Address((object)$this->data); + + foreach($address as $key => $value) { + self::assertSame($this->data[$key], $value); + } + + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/AttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/AttachmentTest.php new file mode 100644 index 00000000..c9ba2f17 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/AttachmentTest.php @@ -0,0 +1,37 @@ +getFixture("attachment_encoded_filename.eml"); + $this->attachment = $message->getAttachments()->first(); + } + /** + * @dataProvider decodeNameDataProvider + */ + public function testDecodeName(string $input, string $output): void + { + $name = $this->attachment->decodeName($input); + $this->assertEquals($output, $name); + } + + public function decodeNameDataProvider(): array + { + return [ + ['../../../../../../../../../../../var/www/shell.php', 'varwwwshell.php'], + ['test..xml', 'test.xml'], + [chr(0), ''], + ['C:\\file.txt', 'Cfile.txt'], + ]; + } +} diff --git a/plugins/vendor/webklex/php-imap/tests/AttributeTest.php b/plugins/vendor/webklex/php-imap/tests/AttributeTest.php new file mode 100644 index 00000000..8374894f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/AttributeTest.php @@ -0,0 +1,75 @@ +toString()); + self::assertSame("foo", $attribute->getName()); + self::assertSame("foos", $attribute->setName("foos")->getName()); + } + + /** + * Date Attribute test + * + * @return void + */ + public function testDateAttribute(): void { + $attribute = new Attribute("foo", "2022-12-26 08:07:14 GMT-0800"); + + self::assertInstanceOf(Carbon::class, $attribute->toDate()); + self::assertSame("2022-12-26 08:07:14 GMT-0800", $attribute->toDate()->format("Y-m-d H:i:s T")); + } + + /** + * Array Attribute test + * + * @return void + */ + public function testArrayAttribute(): void { + $attribute = new Attribute("foo", ["bar"]); + + self::assertSame("bar", $attribute->toString()); + + $attribute->add("bars"); + self::assertSame(true, $attribute->has(1)); + self::assertSame("bars", $attribute->get(1)); + self::assertSame(true, $attribute->contains("bars")); + self::assertSame("foo, bars", $attribute->set("foo", 0)->toString()); + + $attribute->remove(0); + self::assertSame("bars", $attribute->toString()); + + self::assertSame("bars, foos", $attribute->merge(["foos", "bars"], true)->toString()); + self::assertSame("bars, foos, foos, donk", $attribute->merge(["foos", "donk"], false)->toString()); + + self::assertSame(4, $attribute->count()); + + self::assertSame("donk", $attribute->last()); + self::assertSame("bars", $attribute->first()); + + self::assertSame(["bars", "foos", "foos", "donk"], array_values($attribute->all())); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/ClientManagerTest.php b/plugins/vendor/webklex/php-imap/tests/ClientManagerTest.php new file mode 100644 index 00000000..e7910cf1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/ClientManagerTest.php @@ -0,0 +1,94 @@ +cm = new ClientManager(); + } + + /** + * Test if the config can be accessed + * + * @return void + */ + public function testConfigAccessorAccount(): void { + $config = $this->cm->getConfig(); + self::assertInstanceOf(Config::class, $config); + self::assertSame("default", $config->get("default")); + self::assertSame("d-M-Y", $config->get("date_format")); + self::assertSame(IMAP::FT_PEEK, $config->get("options.fetch")); + self::assertSame([], $config->get("options.open")); + } + + /** + * Test creating a client instance + * + * @throws MaskNotFoundException + */ + public function testMakeClient(): void { + self::assertInstanceOf(Client::class, $this->cm->make([])); + } + + /** + * Test accessing accounts + * + * @throws MaskNotFoundException + */ + public function testAccountAccessor(): void { + self::assertSame("default", $this->cm->getConfig()->getDefaultAccount()); + self::assertNotEmpty($this->cm->account("default")); + + $this->cm->getConfig()->setDefaultAccount("foo"); + self::assertSame("foo", $this->cm->getConfig()->getDefaultAccount()); + $this->cm->getConfig()->setDefaultAccount("default"); + } + + /** + * Test setting a config + * + * @throws MaskNotFoundException + */ + public function testSetConfig(): void { + $config = [ + "default" => "foo", + "options" => [ + "fetch" => IMAP::ST_MSGN, + "open" => "foo" + ] + ]; + $cm = new ClientManager($config); + + self::assertSame("foo", $cm->getConfig()->getDefaultAccount()); + self::assertInstanceOf(Client::class, $cm->account("foo")); + self::assertSame(IMAP::ST_MSGN, $cm->getConfig()->get("options.fetch")); + self::assertSame(false, is_array($cm->getConfig()->get("options.open"))); + + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/ClientTest.php b/plugins/vendor/webklex/php-imap/tests/ClientTest.php new file mode 100644 index 00000000..73a01be7 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/ClientTest.php @@ -0,0 +1,348 @@ + [ + "default" => [ + 'protocol' => 'imap', + 'encryption' => 'ssl', + 'username' => 'foo@domain.tld', + 'password' => 'bar', + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + ]] + ]); + $this->client = new Client($config); + } + + /** + * Client test + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws RuntimeException + */ + public function testClient(): void { + $this->createNewProtocolMockup(); + + self::assertInstanceOf(ImapProtocol::class, $this->client->getConnection()); + self::assertSame(true, $this->client->isConnected()); + self::assertSame(false, $this->client->checkConnection()); + self::assertSame(30, $this->client->getTimeout()); + self::assertSame(MessageMask::class, $this->client->getDefaultMessageMask()); + self::assertSame(AttachmentMask::class, $this->client->getDefaultAttachmentMask()); + self::assertArrayHasKey("new", $this->client->getDefaultEvents("message")); + } + + /** + * @throws MaskNotFoundException + */ + public function testClientClone(): void { + $config = Config::make([ + "accounts" => [ + "default" => [ + 'host' => 'example.com', + 'port' => 993, + 'protocol' => 'imap', //might also use imap, [pop3 or nntp (untested)] + 'encryption' => 'ssl', // Supported: false, 'ssl', 'tls' + 'validate_cert' => true, + 'username' => 'root@example.com', + 'password' => 'foo', + 'authentication' => null, + 'rfc' => 'RFC822', // If you are using iCloud, you might want to set this to 'BODY' + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + "timeout" => 30, + "extensions" => [] + ]] + ]); + $client = new Client($config); + $clone = $client->clone(); + self::assertInstanceOf(Client::class, $clone); + self::assertSame($client->getConfig(), $clone->getConfig()); + self::assertSame($client->getAccountConfig(), $clone->getAccountConfig()); + self::assertSame($client->host, $clone->host); + } + + public function testClientLogout(): void { + $this->createNewProtocolMockup(); + + $this->protocol->expects($this->any())->method('logout')->willReturn(Response::empty()->setResponse([ + 0 => "BYE Logging out\r\n", + 1 => "OK Logout completed (0.001 + 0.000 secs).\r\n", + ])); + self::assertInstanceOf(Client::class, $this->client->disconnect()); + + } + + public function testClientExpunge(): void { + $this->createNewProtocolMockup(); + $this->protocol->expects($this->any())->method('expunge')->willReturn(Response::empty()->setResponse([ + 0 => "OK", + 1 => "Expunge", + 2 => "completed", + 3 => [ + 0 => "0.001", + 1 => "+", + 2 => "0.000", + 3 => "secs).", + ], + ])); + self::assertNotEmpty($this->client->expunge()); + + } + + public function testClientFolders(): void { + $this->createNewProtocolMockup(); + $this->protocol->expects($this->any())->method('expunge')->willReturn(Response::empty()->setResponse([ + 0 => "OK", + 1 => "Expunge", + 2 => "completed", + 3 => [ + 0 => "0.001", + 1 => "+", + 2 => "0.000", + 3 => "secs).", + ], + ])); + + $this->protocol->expects($this->any())->method('selectFolder')->willReturn(Response::empty()->setResponse([ + "flags" => [ + 0 => [ + 0 => "\Answered", + 1 => "\Flagged", + 2 => "\Deleted", + 3 => "\Seen", + 4 => "\Draft", + 5 => "NonJunk", + 6 => "unknown-1", + ], + ], + "exists" => 139, + "recent" => 0, + "unseen" => 94, + "uidvalidity" => 1488899637, + "uidnext" => 278, + ])); + self::assertNotEmpty($this->client->openFolder("INBOX")); + self::assertSame("INBOX", $this->client->getFolderPath()); + + $this->protocol->expects($this->any())->method('examineFolder')->willReturn(Response::empty()->setResponse([ + "flags" => [ + 0 => [ + 0 => "\Answered", + 1 => "\Flagged", + 2 => "\Deleted", + 3 => "\Seen", + 4 => "\Draft", + 5 => "NonJunk", + 6 => "unknown-1", + ], + ], + "exists" => 139, + "recent" => 0, + "unseen" => 94, + "uidvalidity" => 1488899637, + "uidnext" => 278, + ])); + self::assertNotEmpty($this->client->checkFolder("INBOX")); + + $this->protocol->expects($this->any())->method('folders')->with($this->identicalTo(""), $this->identicalTo("*"))->willReturn(Response::empty()->setResponse([ + "INBOX" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasChildren", + ], + ], + "INBOX.new" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.9AL56dEMTTgUKOAz" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.U9PsHCvXxAffYvie" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.Trash" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + 1 => "\Trash", + ], + ], + "INBOX.processing" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.Sent" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + 1 => "\Sent", + ], + ], + "INBOX.OzDWCXKV3t241koc" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.5F3bIVTtBcJEqIVe" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.8J3rll6eOBWnTxIU" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + "INBOX.Junk" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + 1 => "\Junk", + ], + ], + "INBOX.Drafts" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + 1 => "\Drafts", + ], + ], + "INBOX.test" => [ + "delimiter" => ".", + "flags" => [ + 0 => "\HasNoChildren", + ], + ], + ])); + + $this->protocol->expects($this->any())->method('createFolder')->willReturn(Response::empty()->setResponse([ + 0 => "OK Create completed (0.004 + 0.000 + 0.003 secs).\r\n", + ])); + self::assertNotEmpty($this->client->createFolder("INBOX.new")); + + $this->protocol->expects($this->any())->method('deleteFolder')->willReturn(Response::empty()->setResponse([ + 0 => "OK Delete completed (0.007 + 0.000 + 0.006 secs).\r\n", + ])); + self::assertNotEmpty($this->client->deleteFolder("INBOX.new")); + + self::assertInstanceOf(Folder::class, $this->client->getFolderByPath("INBOX.new")); + self::assertInstanceOf(Folder::class, $this->client->getFolderByName("new")); + self::assertInstanceOf(Folder::class, $this->client->getFolder("INBOX.new", ".")); + self::assertInstanceOf(Folder::class, $this->client->getFolder("new")); + } + + public function testClientId(): void { + $this->createNewProtocolMockup(); + $this->protocol->expects($this->any())->method('ID')->willReturn(Response::empty()->setResponse([ + 0 => "ID (\"name\" \"Dovecot\")\r\n", + 1 => "OK ID completed (0.001 + 0.000 secs).\r\n" + + ])); + self::assertSame("ID (\"name\" \"Dovecot\")\r\n", $this->client->Id()[0]); + + } + + public function testClientConfig(): void { + $config = $this->client->getConfig()->get("accounts.".$this->client->getConfig()->getDefaultAccount()); + self::assertSame("foo@domain.tld", $config["username"]); + self::assertSame("bar", $config["password"]); + self::assertSame("localhost", $config["host"]); + self::assertSame(true, $config["validate_cert"]); + self::assertSame(993, $config["port"]); + + $this->client->getConfig()->set("accounts.".$this->client->getConfig()->getDefaultAccount(), [ + "host" => "domain.tld", + 'password' => 'bar', + ]); + $config = $this->client->getConfig()->get("accounts.".$this->client->getConfig()->getDefaultAccount()); + + self::assertSame("bar", $config["password"]); + self::assertSame("domain.tld", $config["host"]); + self::assertSame(true, $config["validate_cert"]); + } + + protected function createNewProtocolMockup() { + $this->protocol = $this->createMock(ImapProtocol::class); + + $this->protocol->expects($this->any())->method('connected')->willReturn(true); + $this->protocol->expects($this->any())->method('getConnectionTimeout')->willReturn(30); + + $this->protocol + ->expects($this->any()) + ->method('createStream') + //->will($this->onConsecutiveCalls(true)); + ->willReturn(true); + + $this->client->connection = $this->protocol; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/HeaderTest.php b/plugins/vendor/webklex/php-imap/tests/HeaderTest.php new file mode 100644 index 00000000..0ec60c6c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/HeaderTest.php @@ -0,0 +1,204 @@ +config = Config::make(); + } + + /** + * Test parsing email headers + * + * @throws InvalidMessageDateException + */ + public function testHeaderParsing(): void { + $email = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "1366671050@github.com.eml"])); + if (!str_contains($email, "\r\n")) { + $email = str_replace("\n", "\r\n", $email); + } + + $raw_header = substr($email, 0, strpos($email, "\r\n\r\n")); + + $header = new Header($raw_header, $this->config); + $subject = $header->get("subject"); + $returnPath = $header->get("return_path"); + /** @var Carbon $date */ + $date = $header->get("date")->first(); + /** @var Address $from */ + $from = $header->get("from")->first(); + /** @var Address $to */ + $to = $header->get("to")->first(); + + self::assertSame($raw_header, $header->raw); + self::assertSame([ + 0 => 'from mx.domain.tld by localhost with LMTP id SABVMNfGqWP+PAAA0J78UA (envelope-from ) for ; Mon, 26 Dec 2022 17:07:51 +0100', + 1 => 'from localhost (localhost [127.0.0.1]) by mx.domain.tld (Postfix) with ESMTP id C3828140227 for ; Mon, 26 Dec 2022 17:07:51 +0100 (CET)', + 2 => 'from mx.domain.tld ([127.0.0.1]) by localhost (mx.domain.tld [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JcIS9RuNBTNx for ; Mon, 26 Dec 2022 17:07:21 +0100 (CET)', + 3 => 'from smtp.github.com (out-26.smtp.github.com [192.30.252.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.domain.tld (Postfix) with ESMTPS id 6410B13FEB2 for ; Mon, 26 Dec 2022 17:07:21 +0100 (CET)', + 4 => 'from github-lowworker-891b8d2.va3-iad.github.net (github-lowworker-891b8d2.va3-iad.github.net [10.48.109.104]) by smtp.github.com (Postfix) with ESMTP id 176985E0200 for ; Mon, 26 Dec 2022 08:07:14 -0800 (PST)', + ], $header->get("received")->toArray()); + self::assertInstanceOf(Attribute::class, $subject); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", $subject->toString()); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", (string)$header->subject); + self::assertSame("noreply@github.com", $returnPath->toString()); + self::assertSame("return_path", $returnPath->getName()); + self::assertSame("-4.299", (string)$header->get("X-Spam-Score")); + self::assertSame("Webklex/php-imap/issues/349/1365266070@github.com", (string)$header->get("Message-ID")); + self::assertSame(5, $header->get("received")->count()); + self::assertSame(IMAP::MESSAGE_PRIORITY_UNKNOWN, (int)$header->get("priority")()); + + self::assertSame("Username", $from->personal); + self::assertSame("notifications", $from->mailbox); + self::assertSame("github.com", $from->host); + self::assertSame("notifications@github.com", $from->mail); + self::assertSame("Username ", $from->full); + + self::assertSame("Webklex/php-imap", $to->personal); + self::assertSame("php-imap", $to->mailbox); + self::assertSame("noreply.github.com", $to->host); + self::assertSame("php-imap@noreply.github.com", $to->mail); + self::assertSame("Webklex/php-imap ", $to->full); + + self::assertInstanceOf(Carbon::class, $date); + self::assertSame("2022-12-26 08:07:14 GMT-0800", $date->format("Y-m-d H:i:s T")); + + self::assertSame(51, count($header->getAttributes())); + } + + public function testRfc822ParseHeaders() { + $mock = $this->getMockBuilder(Header::class) + ->disableOriginalConstructor() + ->onlyMethods([]) + ->getMock(); + + $config = new \ReflectionProperty($mock, 'options'); + $config->setAccessible(true); + $config->setValue($mock, $this->config->get("options")); + + $mockHeader = "Content-Type: text/csv; charset=WINDOWS-1252; name*0=\"TH_Is_a_F ile name example 20221013.c\"; name*1=sv\r\nContent-Transfer-Encoding: quoted-printable\r\nContent-Disposition: attachment; filename*0=\"TH_Is_a_F ile name example 20221013.c\"; filename*1=\"sv\"\r\n"; + + $expected = new \stdClass(); + $expected->content_type = 'text/csv; charset=WINDOWS-1252; name*0="TH_Is_a_F ile name example 20221013.c"; name*1=sv'; + $expected->content_transfer_encoding = 'quoted-printable'; + $expected->content_disposition = 'attachment; filename*0="TH_Is_a_F ile name example 20221013.c"; filename*1="sv"'; + + $this->assertEquals($expected, $mock->rfc822_parse_headers($mockHeader)); + } + + public function testExtractHeaderExtensions() { + $mock = $this->getMockBuilder(Header::class) + ->disableOriginalConstructor() + ->onlyMethods([]) + ->getMock(); + + $method = new \ReflectionMethod($mock, 'extractHeaderExtensions'); + $method->setAccessible(true); + + $mockAttributes = [ + 'content_type' => new Attribute('content_type', 'text/csv; charset=WINDOWS-1252; name*0="TH_Is_a_F ile name example 20221013.c"; name*1=sv'), + 'content_transfer_encoding' => new Attribute('content_transfer_encoding', 'quoted-printable'), + 'content_disposition' => new Attribute('content_disposition', 'attachment; filename*0="TH_Is_a_F ile name example 20221013.c"; filename*1="sv"; attribute_test=attribute_test_value'), + ]; + + $attributes = new \ReflectionProperty($mock, 'attributes'); + $attributes->setAccessible(true); + $attributes->setValue($mock, $mockAttributes); + + $method->invoke($mock); + + $this->assertArrayHasKey('filename', $mock->getAttributes()); + $this->assertArrayNotHasKey('filename*0', $mock->getAttributes()); + $this->assertEquals('TH_Is_a_F ile name example 20221013.csv', $mock->get('filename')); + + $this->assertArrayHasKey('name', $mock->getAttributes()); + $this->assertArrayNotHasKey('name*0', $mock->getAttributes()); + $this->assertEquals('TH_Is_a_F ile name example 20221013.csv', $mock->get('name')); + + $this->assertArrayHasKey('content_type', $mock->getAttributes()); + $this->assertEquals('text/csv', $mock->get('content_type')->last()); + + $this->assertArrayHasKey('charset', $mock->getAttributes()); + $this->assertEquals('WINDOWS-1252', $mock->get('charset')->last()); + + $this->assertArrayHasKey('content_transfer_encoding', $mock->getAttributes()); + $this->assertEquals('quoted-printable', $mock->get('content_transfer_encoding')); + + $this->assertArrayHasKey('content_disposition', $mock->getAttributes()); + $this->assertEquals('attachment', $mock->get('content_disposition')->last()); + $this->assertEquals('quoted-printable', $mock->get('content_transfer_encoding')); + + $this->assertArrayHasKey('attribute_test', $mock->getAttributes()); + $this->assertEquals('attribute_test_value', $mock->get('attribute_test')); + } + + public function testExtractHeaderExtensions2() { + $mock = $this->getMockBuilder(Header::class) + ->disableOriginalConstructor() + ->onlyMethods([]) + ->getMock(); + + $method = new \ReflectionMethod($mock, 'extractHeaderExtensions'); + $method->setAccessible(true); + + $mockAttributes = [ + 'content_type' => new Attribute('content_type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name="=?utf-8?Q?=D0=A2=D0=B8=D0=BF=D0=BE=D0=B2=D0=BE=D0=B9_?= =?utf-8?Q?=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82_=D0=BF?= =?utf-8?Q?=D0=BE=D1=82=D1=80=D0=B5=D0=B1=D0=BB=D0=B5=D0=BD?= =?utf-8?Q?=D0=B8=D1=8F_=D1=8D=D0=BB=D0=B5=D0=BA=D1=82?= =?utf-8?Q?=D1=80=D0=BE=D1=8D=D0=BD=D0=B5=D1=80=D0=B3=D0=B8=D0=B8_=D0=B2_?= =?utf-8?Q?=D0=9A=D0=9F_=D0=97=D0=B2=D0=B5=D0=B7=D0=B4?= =?utf-8?Q?=D0=BD=D1=8B=D0=B9=2Exlsx?="'), + 'content_transfer_encoding' => new Attribute('content_transfer_encoding', 'base64'), + 'content_disposition' => new Attribute('content_disposition', 'attachment; name*0*=utf-8\'\'%D0%A2%D0%B8%D0%BF%D0%BE%D0%B2%D0%BE%D0%B9%20; name*1*=%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%20%D0%BF; name*2*=%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%BB%D0%B5%D0%BD; name*3*=%D0%B8%D1%8F%20%D1%8D%D0%BB%D0%B5%D0%BA%D1%82; name*4*=%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8; name*5*=%D0%B8%20%D0%B2%20%D0%9A%D0%9F%20%D0%97%D0%B2%D0%B5%D0%B7%D0%B4; name*6*=%D0%BD%D1%8B%D0%B9.xlsx; filename*0*=utf-8\'\'%D0%A2%D0%B8%D0%BF%D0%BE%D0%B2%D0%BE%D0%B9%20; filename*1*=%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%20%D0%BF; filename*2*=%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%BB%D0%B5%D0%BD; filename*3*=%D0%B8%D1%8F%20%D1%8D%D0%BB%D0%B5%D0%BA%D1%82; filename*4*=%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8; filename*5*=%D0%B8%20%D0%B2%20%D0%9A%D0%9F%20%D0%97; filename*6*=%D0%B2%D0%B5%D0%B7%D0%B4%D0%BD%D1%8B%D0%B9.xlsx; attribute_test=attribute_test_value'), + ]; + + $attributes = new \ReflectionProperty($mock, 'attributes'); + $attributes->setAccessible(true); + $attributes->setValue($mock, $mockAttributes); + + $method->invoke($mock); + + $this->assertArrayHasKey('filename', $mock->getAttributes()); + $this->assertArrayNotHasKey('filename*0', $mock->getAttributes()); + $this->assertEquals('utf-8\'\'%D0%A2%D0%B8%D0%BF%D0%BE%D0%B2%D0%BE%D0%B9%20%D1%80%D0%B0%D1%81%D1%87%D0%B5%D1%82%20%D0%BF%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F%20%D1%8D%D0%BB%D0%B5%D0%BA%D1%82%D1%80%D0%BE%D1%8D%D0%BD%D0%B5%D1%80%D0%B3%D0%B8%D0%B8%20%D0%B2%20%D0%9A%D0%9F%20%D0%97%D0%B2%D0%B5%D0%B7%D0%B4%D0%BD%D1%8B%D0%B9.xlsx', $mock->get('filename')); + + $this->assertArrayHasKey('name', $mock->getAttributes()); + $this->assertArrayNotHasKey('name*0', $mock->getAttributes()); + $this->assertEquals('=?utf-8?Q?=D0=A2=D0=B8=D0=BF=D0=BE=D0=B2=D0=BE=D0=B9_?= =?utf-8?Q?=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82_=D0=BF?= =?utf-8?Q?=D0=BE=D1=82=D1=80=D0=B5=D0=B1=D0=BB=D0=B5=D0=BD?= =?utf-8?Q?=D0=B8=D1=8F_=D1=8D=D0=BB=D0=B5=D0=BA=D1=82?= =?utf-8?Q?=D1=80=D0=BE=D1=8D=D0=BD=D0=B5=D1=80=D0=B3=D0=B8=D0=B8_=D0=B2_?= =?utf-8?Q?=D0=9A=D0=9F_=D0=97=D0=B2=D0=B5=D0=B7=D0=B4?= =?utf-8?Q?=D0=BD=D1=8B=D0=B9=2Exlsx?=', $mock->get('name')); + + $this->assertArrayHasKey('content_type', $mock->getAttributes()); + $this->assertEquals('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', $mock->get('content_type')->last()); + + $this->assertArrayHasKey('content_transfer_encoding', $mock->getAttributes()); + $this->assertEquals('base64', $mock->get('content_transfer_encoding')); + + $this->assertArrayHasKey('content_disposition', $mock->getAttributes()); + $this->assertEquals('attachment', $mock->get('content_disposition')->last()); + + $this->assertArrayHasKey('attribute_test', $mock->getAttributes()); + $this->assertEquals('attribute_test_value', $mock->get('attribute_test')); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/ImapProtocolTest.php b/plugins/vendor/webklex/php-imap/tests/ImapProtocolTest.php new file mode 100644 index 00000000..30f3a200 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/ImapProtocolTest.php @@ -0,0 +1,64 @@ +config = Config::make(); + } + + + /** + * ImapProtocol test + * + * @return void + */ + public function testImapProtocol(): void { + + $protocol = new ImapProtocol($this->config, false); + self::assertSame(false, $protocol->getCertValidation()); + self::assertSame("", $protocol->getEncryption()); + + $protocol->setCertValidation(true); + $protocol->setEncryption("ssl"); + + self::assertSame(true, $protocol->getCertValidation()); + self::assertSame("ssl", $protocol->getEncryption()); + + $protocol->setSslOptions([ + 'verify_peer' => true, + 'cafile' => '/dummy/path/for/testing', + 'peer_fingerprint' => ['md5' => 40], + ]); + + self::assertSame([ + 'verify_peer' => true, + 'cafile' => '/dummy/path/for/testing', + 'peer_fingerprint' => ['md5' => 40], + ], $protocol->getSslOptions()); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/MessageTest.php b/plugins/vendor/webklex/php-imap/tests/MessageTest.php new file mode 100644 index 00000000..0ce55cd0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/MessageTest.php @@ -0,0 +1,302 @@ + [ + "default" => [ + 'protocol' => 'imap', + 'encryption' => 'ssl', + 'username' => 'foo@domain.tld', + 'password' => 'bar', + 'proxy' => [ + 'socket' => null, + 'request_fulluri' => false, + 'username' => null, + 'password' => null, + ], + ]] + ]); + $this->client = new Client($config); + } + + /** + * Message test + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageNotFoundException + * @throws MessageSizeFetchingException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + */ + public function testMessage(): void { + $this->createNewProtocolMockup(); + + $email = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "1366671050@github.com.eml"])); + if(!str_contains($email, "\r\n")){ + $email = str_replace("\n", "\r\n", $email); + } + + $raw_header = substr($email, 0, strpos($email, "\r\n\r\n")); + $raw_body = substr($email, strlen($raw_header)+8); + + $this->protocol->expects($this->any())->method('getUid')->willReturn(Response::empty()->setResult(22)); + $this->protocol->expects($this->any())->method('getMessageNumber')->willReturn(Response::empty()->setResult(21)); + $this->protocol->expects($this->any())->method('flags')->willReturn(Response::empty()->setResult([22 => [0 => "\\Seen"]])); + + self::assertNotEmpty($this->client->openFolder("INBOX")); + + $message = Message::make(22, null, $this->client, $raw_header, $raw_body, [0 => "\\Seen"], IMAP::ST_UID); + + self::assertInstanceOf(Client::class, $message->getClient()); + self::assertSame(22, $message->uid); + self::assertSame(21, $message->msgn); + self::assertContains("Seen", $message->flags()->toArray()); + + $subject = $message->get("subject"); + $returnPath = $message->get("Return-Path"); + + self::assertInstanceOf(Attribute::class, $subject); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", $subject->toString()); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", (string)$message->subject); + self::assertSame("noreply@github.com", $returnPath->toString()); + self::assertSame("return_path", $returnPath->getName()); + self::assertSame("-4.299", (string)$message->get("X-Spam-Score")); + self::assertSame("Webklex/php-imap/issues/349/1365266070@github.com", (string)$message->get("Message-ID")); + self::assertSame(5, $message->get("received")->count()); + self::assertSame(IMAP::MESSAGE_PRIORITY_UNKNOWN, (int)$message->get("priority")()); + } + + /** + * Test getMessageNumber + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetMessageNumber(): void { + $this->createNewProtocolMockup(); + $this->protocol->expects($this->any())->method('getMessageNumber')->willReturn(Response::empty()->setResult("")); + + self::assertNotEmpty($this->client->openFolder("INBOX")); + + try { + $this->client->getConnection()->getMessageNumber(21)->validatedData(); + $this->fail("Message number should not exist"); + } catch (ResponseException $e) { + self::assertTrue(true); + } + + } + + /** + * Test loadMessageFromFile + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageNotFoundException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + * @throws MessageSizeFetchingException + */ + public function testLoadMessageFromFile(): void { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "1366671050@github.com.eml"]); + $message = Message::fromFile($filename); + + $subject = $message->get("subject"); + $returnPath = $message->get("Return-Path"); + + self::assertInstanceOf(Attribute::class, $subject); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", $subject->toString()); + self::assertSame("Re: [Webklex/php-imap] Read all folders? (Issue #349)", (string)$message->subject); + self::assertSame("noreply@github.com", $returnPath->toString()); + self::assertSame("return_path", $returnPath->getName()); + self::assertSame("-4.299", (string)$message->get("X-Spam-Score")); + self::assertSame("Webklex/php-imap/issues/349/1365266070@github.com", (string)$message->get("Message-ID")); + self::assertSame(5, $message->get("received")->count()); + self::assertSame(IMAP::MESSAGE_PRIORITY_UNKNOWN, (int)$message->get("priority")()); + + self::assertNull($message->getClient()); + self::assertSame(0, $message->uid); + + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "example_attachment.eml"]); + $message = Message::fromFile($filename); + + $subject = $message->get("subject"); + $returnPath = $message->get("Return-Path"); + + self::assertInstanceOf(Attribute::class, $subject); + self::assertSame("ogqMVHhz7swLaq2PfSWsZj0k99w8wtMbrb4RuHdNg53i76B7icIIM0zIWpwGFtnk", $subject->toString()); + self::assertSame("ogqMVHhz7swLaq2PfSWsZj0k99w8wtMbrb4RuHdNg53i76B7icIIM0zIWpwGFtnk", (string)$message->subject); + self::assertSame("someone@domain.tld", $returnPath->toString()); + self::assertSame("return_path", $returnPath->getName()); + self::assertSame("1.103", (string)$message->get("X-Spam-Score")); + self::assertSame("d3a5e91963cb805cee975687d5acb1c6@swift.generated", (string)$message->get("Message-ID")); + self::assertSame(4, $message->get("received")->count()); + self::assertSame(IMAP::MESSAGE_PRIORITY_HIGHEST, (int)$message->get("priority")()); + + self::assertNull($message->getClient()); + self::assertSame(0, $message->uid); + self::assertSame(1, $message->getAttachments()->count()); + + /** @var Attachment $attachment */ + $attachment = $message->getAttachments()->first(); + self::assertSame("attachment", $attachment->disposition); + self::assertSame("znk551MP3TP3WPp9Kl1gnLErrWEgkJFAtvaKqkTgrk3dKI8dX38YT8BaVxRcOERN", $attachment->content); + self::assertSame("application/octet-stream", $attachment->content_type); + self::assertSame("6mfFxiU5Yhv9WYJx.txt", $attachment->name); + self::assertSame(2, $attachment->part_number); + self::assertSame("text", $attachment->type); + self::assertNotEmpty($attachment->id); + self::assertSame(90, $attachment->size); + self::assertSame("txt", $attachment->getExtension()); + self::assertInstanceOf(Message::class, $attachment->getMessage()); + self::assertSame("text/plain", $attachment->getMimeType()); + } + + /** + * Test issue #348 + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + */ + public function testIssue348() { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "issue-348.eml"]); + $message = Message::fromFile($filename); + + self::assertSame(1, $message->getAttachments()->count()); + + /** @var Attachment $attachment */ + $attachment = $message->getAttachments()->first(); + + self::assertSame("attachment", $attachment->disposition); + self::assertSame("application/pdf", $attachment->content_type); + self::assertSame("Kelvinsong—Font_test_page_bold.pdf", $attachment->name); + self::assertSame(1, $attachment->part_number); + self::assertSame("text", $attachment->type); + self::assertNotEmpty($attachment->id); + self::assertSame(92384, $attachment->size); + self::assertSame("pdf", $attachment->getExtension()); + self::assertInstanceOf(Message::class, $attachment->getMessage()); + self::assertSame("application/pdf", $attachment->getMimeType()); + } + + /** + * Create a new protocol mockup + * + * @return void + */ + protected function createNewProtocolMockup(): void { + $this->protocol = $this->createMock(ImapProtocol::class); + + $this->protocol->expects($this->any())->method('createStream')->willReturn(true); + $this->protocol->expects($this->any())->method('connected')->willReturn(true); + $this->protocol->expects($this->any())->method('getConnectionTimeout')->willReturn(30); + $this->protocol->expects($this->any())->method('logout')->willReturn(Response::empty()->setResponse([ + 0 => "BYE Logging out\r\n", + 1 => "OK Logout completed (0.001 + 0.000 secs).\r\n", + ])); + $this->protocol->expects($this->any())->method('selectFolder')->willReturn(Response::empty()->setResponse([ + "flags" => [ + 0 => [ + 0 => "\Answered", + 1 => "\Flagged", + 2 => "\Deleted", + 3 => "\Seen", + 4 => "\Draft", + 5 => "NonJunk", + 6 => "unknown-1", + ], + ], + "exists" => 139, + "recent" => 0, + "unseen" => 94, + "uidvalidity" => 1488899637, + "uidnext" => 278, + ])); + + $this->client->connection = $this->protocol; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/PartTest.php b/plugins/vendor/webklex/php-imap/tests/PartTest.php new file mode 100644 index 00000000..8543c46b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/PartTest.php @@ -0,0 +1,107 @@ +config = Config::make(); + } + + /** + * Test parsing a text Part + * @throws InvalidMessageDateException + */ + public function testTextPart(): void { + $raw_headers = "Content-Type: text/plain;\r\n charset=UTF-8\r\nContent-Transfer-Encoding: 7bit\r\n"; + $raw_body = "\r\nAny updates?"; + + $headers = new Header($raw_headers, $this->config); + $part = new Part($raw_body, $this->config, $headers, 0); + + self::assertSame("UTF-8", $part->charset); + self::assertSame("text/plain", $part->content_type); + self::assertSame(12, $part->bytes); + self::assertSame(0, $part->part_number); + self::assertSame(false, $part->ifdisposition); + self::assertSame(false, $part->isAttachment()); + self::assertSame("Any updates?", $part->content); + self::assertSame(IMAP::MESSAGE_TYPE_TEXT, $part->type); + self::assertSame(IMAP::MESSAGE_ENC_7BIT, $part->encoding); + } + + /** + * Test parsing a html Part + * @throws InvalidMessageDateException + */ + public function testHTMLPart(): void { + $raw_headers = "Content-Type: text/html;\r\n charset=UTF-8\r\nContent-Transfer-Encoding: 7bit\r\n"; + $raw_body = "\r\n

\r\n

Any updates?

"; + + $headers = new Header($raw_headers, $this->config); + $part = new Part($raw_body, $this->config, $headers, 0); + + self::assertSame("UTF-8", $part->charset); + self::assertSame("text/html", $part->content_type); + self::assertSame(39, $part->bytes); + self::assertSame(0, $part->part_number); + self::assertSame(false, $part->ifdisposition); + self::assertSame(false, $part->isAttachment()); + self::assertSame("

\r\n

Any updates?

", $part->content); + self::assertSame(IMAP::MESSAGE_TYPE_TEXT, $part->type); + self::assertSame(IMAP::MESSAGE_ENC_7BIT, $part->encoding); + } + + /** + * Test parsing a html Part + * @throws InvalidMessageDateException + */ + public function testBase64Part(): void { + $raw_headers = "Content-Type: application/octet-stream; name=6mfFxiU5Yhv9WYJx.txt\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment; filename=6mfFxiU5Yhv9WYJx.txt\r\n"; + $raw_body = "em5rNTUxTVAzVFAzV1BwOUtsMWduTEVycldFZ2tKRkF0dmFLcWtUZ3JrM2RLSThkWDM4WVQ4QmFW\r\neFJjT0VSTg=="; + + $headers = new Header($raw_headers, $this->config); + $part = new Part($raw_body, $this->config, $headers, 0); + + self::assertSame("", $part->charset); + self::assertSame("application/octet-stream", $part->content_type); + self::assertSame(90, $part->bytes); + self::assertSame(0, $part->part_number); + self::assertSame("znk551MP3TP3WPp9Kl1gnLErrWEgkJFAtvaKqkTgrk3dKI8dX38YT8BaVxRcOERN", base64_decode($part->content)); + self::assertSame(true, $part->ifdisposition); + self::assertSame("attachment", $part->disposition); + self::assertSame("6mfFxiU5Yhv9WYJx.txt", $part->name); + self::assertSame("6mfFxiU5Yhv9WYJx.txt", $part->filename); + self::assertSame(true, $part->isAttachment()); + self::assertSame(IMAP::MESSAGE_TYPE_TEXT, $part->type); + self::assertSame(IMAP::MESSAGE_ENC_BASE64, $part->encoding); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/StructureTest.php b/plugins/vendor/webklex/php-imap/tests/StructureTest.php new file mode 100644 index 00000000..22d71bbf --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/StructureTest.php @@ -0,0 +1,68 @@ +config = Config::make(); + } + + /** + * Test parsing email headers + * + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + */ + public function testStructureParsing(): void { + $email = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "messages", "1366671050@github.com.eml"])); + if(!str_contains($email, "\r\n")){ + $email = str_replace("\n", "\r\n", $email); + } + + $raw_header = substr($email, 0, strpos($email, "\r\n\r\n")); + $raw_body = substr($email, strlen($raw_header)+8); + + $header = new Header($raw_header, $this->config); + $structure = new Structure($raw_body, $header); + + self::assertSame(2, count($structure->parts)); + + $textPart = $structure->parts[0]; + + self::assertSame("UTF-8", $textPart->charset); + self::assertSame("text/plain", $textPart->content_type); + self::assertSame(278, $textPart->bytes); + + $htmlPart = $structure->parts[1]; + + self::assertSame("UTF-8", $htmlPart->charset); + self::assertSame("text/html", $htmlPart->content_type); + self::assertSame(1478, $htmlPart->bytes); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentEncodedFilenameTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentEncodedFilenameTest.php new file mode 100644 index 00000000..b5da3597 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentEncodedFilenameTest.php @@ -0,0 +1,52 @@ +getFixture("attachment_encoded_filename.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("multipart/mixed", $message->content_type->last()); + self::assertFalse($message->hasTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("Prostřeno_2014_poslední volné termíny.xls", $attachment->filename); + self::assertEquals("Prostřeno_2014_poslední volné termíny.xls", $attachment->name); + self::assertEquals('xls', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/vnd.ms-excel", $attachment->content_type); + self::assertEquals("a0ef7cfbc05b73dbcb298fe0bc224b41900cdaf60f9904e3fea5ba6c7670013c", hash("sha256", $attachment->content)); + self::assertEquals(146, $attachment->size); + self::assertEquals(0, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentLongFilenameTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentLongFilenameTest.php new file mode 100644 index 00000000..5a3e00ed --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentLongFilenameTest.php @@ -0,0 +1,79 @@ +getFixture("attachment_long_filename.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("multipart/mixed", $message->content_type->last()); + self::assertFalse($message->hasTextBody()); + self::assertFalse($message->hasHTMLBody()); + + $attachments = $message->attachments(); + self::assertCount(3, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("Buchungsbestätigung- Rechnung-Geschäftsbedingungen-Nr.B123-45 - XXXX xxxxxxxxxxxxxxxxx XxxX, Lüdxxxxxxxx - VM Klaus XXXXXX - xxxxxxxx.pdf", $attachment->name); + self::assertEquals("Buchungsbestätigung- Rechnung-Geschäftsbedingungen-Nr.B123-45 - XXXXX xxxxxxxxxxxxxxxxx XxxX, Lüxxxxxxxxxx - VM Klaus XXXXXX - xxxxxxxx.pdf", $attachment->filename); + self::assertEquals('text', $attachment->type); + self::assertEquals('pdf', $attachment->getExtension()); + self::assertEquals("text/plain", $attachment->content_type); + self::assertEquals("ca51ce1fb15acc6d69b8a5700256172fcc507e02073e6f19592e341bd6508ab8", hash("sha256", $attachment->content)); + self::assertEquals(4, $attachment->size); + self::assertEquals(0, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('01_A€àäąбيد@Z-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz.txt', $attachment->name); + self::assertEquals("cebd34e48eaa06311da3d3130d5a9b465b096dc1094a6548f8c94c24ca52f34e", hash("sha256", $attachment->filename)); + self::assertEquals('text', $attachment->type); + self::assertEquals('txt', $attachment->getExtension()); + self::assertEquals("text/plain", $attachment->content_type); + self::assertEquals("ca51ce1fb15acc6d69b8a5700256172fcc507e02073e6f19592e341bd6508ab8", hash("sha256", $attachment->content)); + self::assertEquals(4, $attachment->size); + self::assertEquals(1, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[2]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('02_A€àäąбيد@Z-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz.txt', $attachment->name); + self::assertEquals('02_A€àäąбيد@Z-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstuvz.txt', $attachment->filename); + self::assertEquals('text', $attachment->type); + self::assertEquals("text/plain", $attachment->content_type); + self::assertEquals('txt', $attachment->getExtension()); + self::assertEquals("ca51ce1fb15acc6d69b8a5700256172fcc507e02073e6f19592e341bd6508ab8", hash("sha256", $attachment->content)); + self::assertEquals(4, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentNoDispositionTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentNoDispositionTest.php new file mode 100644 index 00000000..aa1ef946 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/AttachmentNoDispositionTest.php @@ -0,0 +1,55 @@ +getFixture("attachment_no_disposition.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("multipart/mixed", $message->content_type->last()); + self::assertFalse($message->hasTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('26ed3dd2', $attachment->filename); + self::assertEquals('26ed3dd2', $attachment->id); + self::assertEquals("Prostřeno_2014_poslední volné termíny.xls", $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('xls', $attachment->getExtension()); + self::assertEquals("application/vnd.ms-excel", $attachment->content_type); + self::assertEquals("a0ef7cfbc05b73dbcb298fe0bc224b41900cdaf60f9904e3fea5ba6c7670013c", hash("sha256", $attachment->content)); + self::assertEquals(146, $attachment->size); + self::assertEquals(0, $attachment->part_number); + self::assertNull($attachment->disposition); + self::assertNotEmpty($attachment->id); + self::assertEmpty($attachment->content_id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/BccTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/BccTest.php new file mode 100644 index 00000000..be8ef72e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/BccTest.php @@ -0,0 +1,49 @@ +getFixture("bcc.eml"); + + self::assertEquals("test", $message->subject); + self::assertSame([ + 'personal' => '', + 'mailbox' => 'return-path', + 'host' => 'here.com', + 'mail' => 'return-path@here.com', + 'full' => 'return-path@here.com', + ], $message->return_path->first()->toArray()); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("text/plain", $message->content_type); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from); + self::assertEquals("to@here.com", $message->to); + self::assertEquals("A_€@{è_Z ", $message->bcc); + self::assertEquals("sender@here.com", $message->sender); + self::assertEquals("reply-to@here.com", $message->reply_to); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/BooleanDecodedContentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/BooleanDecodedContentTest.php new file mode 100644 index 00000000..5d15fe57 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/BooleanDecodedContentTest.php @@ -0,0 +1,55 @@ +getFixture("boolean_decoded_content.eml"); + + self::assertEquals("Nuu", $message->subject); + self::assertEquals("Here is the problem mail\r\n \r\nBody text", $message->getTextBody()); + self::assertEquals("Here is the problem mail\r\n \r\nBody text", $message->getHTMLBody()); + + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from); + self::assertEquals("to@here.com", $message->to); + + $attachments = $message->getAttachments(); + self::assertCount(1, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("Example Domain.pdf", $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('pdf', $attachment->getExtension()); + self::assertEquals("application/pdf", $attachment->content_type); + self::assertEquals("1c449aaab4f509012fa5eaa180fd017eb7724ccacabdffc1c6066d3756dcde5c", hash("sha256", $attachment->content)); + self::assertEquals(53, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/DateTemplateTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/DateTemplateTest.php new file mode 100644 index 00000000..77dfd7bb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/DateTemplateTest.php @@ -0,0 +1,116 @@ + "2019-04-05 10:10:49", + "04 Jan 2018 10:12:47 UT" => "2018-01-04 10:12:47", + "22 Jun 18 03:56:36 PM -05:00 (GMT -05:00)" => "2018-06-22 20:56:36", + "Sat, 31 Aug 2013 20:08:23 +0580" => "2013-08-31 14:38:23", + "Fri, 1 Feb 2019 01:30:04 +0600 (+06)" => "2019-01-31 19:30:04", + "Mon, 4 Feb 2019 04:03:49 -0300 (-03)" => "2019-02-04 07:03:49", + "Sun, 6 Apr 2008 21:24:33 UT" => "2008-04-06 21:24:33", + "Wed, 11 Sep 2019 15:23:06 +0600 (+06)" => "2019-09-11 09:23:06", + "14 Sep 2019 00:10:08 UT +0200" => "2019-09-14 00:10:08", + "Tue, 08 Nov 2022 18:47:20 +0000 14:03:33 +0000" => "2022-11-08 18:47:20", + "Sat, 10, Dec 2022 09:35:19 +0100" => "2022-12-10 08:35:19", + "Thur, 16 Mar 2023 15:33:07 +0400" => "2023-03-16 11:33:07", + "fr., 25 nov. 2022 06:27:14 +0100/fr., 25 nov. 2022 06:27:14 +0100" => "2022-11-25 05:27:14", + "Di., 15 Feb. 2022 06:52:44 +0100 (MEZ)/Di., 15 Feb. 2022 06:52:44 +0100 (MEZ)" => "2022-02-15 05:52:44", + "Mi., 23 Apr. 2025 09:48:37 +0200 (MESZ)" => "2025-04-23 07:48:37", + ]; + + /** + * Test the fixture date-template.eml + * + * @return void + * @throws InvalidMessageDateException + * @throws ReflectionException + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + public function testFixture() : void { + try { + $message = $this->getFixture("date-template.eml"); + $this->fail("Expected InvalidMessageDateException"); + } catch (InvalidMessageDateException $e) { + self::assertTrue(true); + } + + self::$manager->setConfig([ + "options" => [ + "fallback_date" => "2021-01-01 00:00:00", + ], + ]); + $message = $this->getFixture("date-template.eml", self::$manager->getConfig()); + + self::assertEquals("test", $message->subject); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2021-01-01 00:00:00", $message->date->first()->timezone("UTC")->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", (string)$message->from); + self::assertEquals("to@here.com", $message->to); + + self::$manager->setConfig([ + "options" => [ + "fallback_date" => null, + ], + ]); + + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "date-template.eml"]); + $blob = file_get_contents($filename); + self::assertNotFalse($blob); + + foreach ($this->dates as $date => $expected) { + $message = Message::fromString(str_replace("%date_raw_header%", $date, $blob)); + self::assertEquals("test", $message->subject); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals($expected, $message->date->first()->timezone("UTC")->format("Y-m-d H:i:s"), "Date \"$date\" should be \"$expected\""); + self::assertEquals("from@there.com", (string)$message->from); + self::assertEquals("to@here.com", $message->to); + } + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/EmailAddressTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/EmailAddressTest.php new file mode 100644 index 00000000..0f87cf6a --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/EmailAddressTest.php @@ -0,0 +1,59 @@ +getFixture("email_address.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("123@example.com", $message->message_id); + self::assertEquals("Hi\r\nHow are you?", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertFalse($message->date->first()); + self::assertEquals("no_host", (string)$message->from); + self::assertEquals("", $message->to); + self::assertEquals("This one: is \"right\" , No-address", (string)$message->cc); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailTest.php new file mode 100644 index 00000000..024a8885 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailTest.php @@ -0,0 +1,63 @@ +getFixture("embedded_email.eml"); + + self::assertEquals("embedded message", $message->subject); + self::assertEquals([ + 'from webmail.my-office.cz (localhost [127.0.0.1]) by keira.cofis.cz ; Fri, 29 Jan 2016 14:25:40 +0100', + ], $message->received->toArray()); + self::assertEquals("7e5798da5747415e5b82fdce042ab2a6@cerstor.cz", $message->message_id); + self::assertEquals("demo@cerstor.cz", $message->return_path); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("Roundcube Webmail/1.0.0", $message->user_agent); + self::assertEquals("email that contains embedded message", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2016-01-29 13:25:40", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("demo@cerstor.cz", $message->from); + self::assertEquals("demo@cerstor.cz", $message->x_sender); + self::assertEquals("demo@cerstor.cz", $message->to); + + $attachments = $message->getAttachments(); + self::assertCount(1, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("demo.eml", $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('eml', $attachment->getExtension()); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("a1f965f10a9872e902a82dde039a237e863f522d238a1cb1968fe3396dbcac65", hash("sha256", $attachment->content)); + self::assertEquals(893, $attachment->size); + self::assertEquals(1, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionEmbeddedTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionEmbeddedTest.php new file mode 100644 index 00000000..387b0de0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionEmbeddedTest.php @@ -0,0 +1,74 @@ +getFixture("embedded_email_without_content_disposition-embedded.eml"); + + self::assertEquals("embedded_message_subject", $message->subject); + self::assertEquals([ + 'from webmail.my-office.cz (localhost [127.0.0.1]) by keira.cofis.cz ; Fri, 29 Jan 2016 14:25:40 +0100', + ], $message->received->toArray()); + self::assertEquals("AC39946EBF5C034B87BABD5343E96979012671D40E38@VM002.cerk.cc", $message->message_id); + self::assertEquals("pl-PL, nl-NL", $message->accept_language); + self::assertEquals("pl-PL", $message->content_language); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("some txt", $message->getTextBody()); + self::assertEquals("\r\n

some txt

\r\n", $message->getHTMLBody()); + + self::assertEquals("2019-04-05 10:10:49", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("demo@cerstor.cz", $message->from); + self::assertEquals("demo@cerstor.cz", $message->to); + + $attachments = $message->getAttachments(); + self::assertCount(2, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("file1.xlsx", $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('xlsx', $attachment->getExtension()); + self::assertEquals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $attachment->content_type); + self::assertEquals("87737d24c106b96e177f9564af6712e2c6d3e932c0632bfbab69c88b0bb934dc", hash("sha256", $attachment->content)); + self::assertEquals(40, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("file2.xlsx", $attachment->name); + self::assertEquals('xlsx', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $attachment->content_type); + self::assertEquals("87737d24c106b96e177f9564af6712e2c6d3e932c0632bfbab69c88b0bb934dc", hash("sha256", $attachment->content)); + self::assertEquals(40, $attachment->size); + self::assertEquals(3, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionTest.php new file mode 100644 index 00000000..2ec5a4fa --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/EmbeddedEmailWithoutContentDispositionTest.php @@ -0,0 +1,97 @@ +getFixture("embedded_email_without_content_disposition.eml"); + + self::assertEquals("Subject", $message->subject); + self::assertEquals([ + 'from webmail.my-office.cz (localhost [127.0.0.1]) by keira.cofis.cz ; Fri, 29 Jan 2016 14:25:40 +0100', + ], $message->received->toArray()); + self::assertEquals("AC39946EBF5C034B87BABD5343E96979012671D9F7E4@VM002.cerk.cc", $message->message_id); + self::assertEquals("pl-PL, nl-NL", $message->accept_language); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("TexT\r\n\r\n[cid:file.jpg]", $message->getTextBody()); + self::assertEquals("

TexT

", $message->getHTMLBody()); + + self::assertEquals("2019-04-05 11:48:50", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("demo@cerstor.cz", $message->from); + self::assertEquals("demo@cerstor.cz", $message->to); + + $attachments = $message->getAttachments(); + self::assertCount(4, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("file.jpg", $attachment->name); + self::assertEquals('jpg', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("image/jpeg", $attachment->content_type); + self::assertEquals("6b7fa434f92a8b80aab02d9bf1a12e49ffcae424e4013a1c4f68b67e3d2bbcd0", hash("sha256", $attachment->content)); + self::assertEquals(96, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('a1abc19a', $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('', $attachment->getExtension()); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("2476c8b91a93c6b2fe1bfff593cb55956c2fe8e7ca6de9ad2dc9d101efe7a867", hash("sha256", $attachment->content)); + self::assertEquals(2073, $attachment->size); + self::assertEquals(3, $attachment->part_number); + self::assertNull($attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[2]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("file3.xlsx", $attachment->name); + self::assertEquals('xlsx', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", $attachment->content_type); + self::assertEquals("87737d24c106b96e177f9564af6712e2c6d3e932c0632bfbab69c88b0bb934dc", hash("sha256", $attachment->content)); + self::assertEquals(40, $attachment->size); + self::assertEquals(4, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[3]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("file4.zip", $attachment->name); + self::assertEquals('zip', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/x-zip-compressed", $attachment->content_type); + self::assertEquals("87737d24c106b96e177f9564af6712e2c6d3e932c0632bfbab69c88b0bb934dc", hash("sha256", $attachment->content)); + self::assertEquals(40, $attachment->size); + self::assertEquals(5, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/ExampleBounceTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/ExampleBounceTest.php new file mode 100644 index 00000000..8153518d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/ExampleBounceTest.php @@ -0,0 +1,103 @@ +getFixture("example_bounce.eml"); + + self::assertEquals([ + 'personal' => '', + 'mailbox' => '', + 'host' => '', + 'mail' => '', + 'full' => '', + ], (array)$message->return_path->first()); + self::assertEquals([ + 0 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>); Thu, 02 Mar 2023 05:27:29 +0100', + 1 => 'from somewhere06.your-server.de ([1b21:2f8:e0a:50e4::2]) by somewhere.your-server.de with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) id 1pXaXR-0006xQ-BN for demo@foo.de; Thu, 02 Mar 2023 05:27:29 +0100', + 2 => 'from [192.168.0.10] (helo=sslproxy01.your-server.de) by somewhere06.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-000LYP-9R for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + 3 => 'from localhost ([127.0.0.1] helo=sslproxy01.your-server.de) by sslproxy01.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-0008gy-7x for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + 4 => 'from Debian-exim by sslproxy01.your-server.de with local (Exim 4.92) id 1pXaXO-0008gb-6g for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + ], $message->received->all()); + self::assertEquals("demo@foo.de", $message->envelope_to); + self::assertEquals("Thu, 02 Mar 2023 05:27:29 +0100", $message->delivery_date); + self::assertEquals([ + 0 => 'somewhere.your-server.de; iprev=pass (somewhere06.your-server.de) smtp.remote-ip=1b21:2f8:e0a:50e4::2; spf=none smtp.mailfrom=<>; dmarc=skipped', + 1 => 'somewhere.your-server.de' + ], $message->authentication_results->all()); + self::assertEquals([ + 0 => 'from somewhere.your-server.de by somewhere.your-server.de with LMTP id 3TP8LrElAGSOaAAAmBr1xw (envelope-from <>); Thu, 02 Mar 2023 05:27:29 +0100', + 1 => 'from somewhere06.your-server.de ([1b21:2f8:e0a:50e4::2]) by somewhere.your-server.de with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) id 1pXaXR-0006xQ-BN for demo@foo.de; Thu, 02 Mar 2023 05:27:29 +0100', + 2 => 'from [192.168.0.10] (helo=sslproxy01.your-server.de) by somewhere06.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-000LYP-9R for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + 3 => 'from localhost ([127.0.0.1] helo=sslproxy01.your-server.de) by sslproxy01.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) id 1pXaXO-0008gy-7x for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + 4 => 'from Debian-exim by sslproxy01.your-server.de with local (Exim 4.92) id 1pXaXO-0008gb-6g for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100', + ], $message->received->all()); + self::assertEquals("ding@ding.de", $message->x_failed_recipients); + self::assertEquals("auto-replied", $message->auto_submitted); + self::assertEquals("Mail Delivery System ", $message->from); + self::assertEquals("demo@foo.de", $message->to); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("Mail delivery failed", $message->subject); + self::assertEquals("E1pXaXO-0008gb-6g@sslproxy01.your-server.de", $message->message_id); + self::assertEquals("2023-03-02 04:27:26", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("Clear (ClamAV 0.103.8/26827/Wed Mar 1 09:28:49 2023)", $message->x_virus_scanned); + self::assertEquals("0.0 (/)", $message->x_spam_score); + self::assertEquals("bar-demo@foo.de", $message->delivered_to); + self::assertEquals("multipart/report", $message->content_type->last()); + self::assertEquals("5d4847c21c8891e73d62c8246f260a46496958041a499f33ecd47444fdaa591b", hash("sha256", $message->getTextBody())); + self::assertFalse($message->hasHTMLBody()); + + $attachments = $message->attachments(); + self::assertCount(2, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('c541a506', $attachment->filename); + self::assertEquals("c541a506", $attachment->name); + self::assertEquals('', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("message/delivery-status", $attachment->content_type); + self::assertEquals("85ac09d1d74b2d85853084dc22abcad205a6bfde62d6056e3a933ffe7e82e45c", hash("sha256", $attachment->content)); + self::assertEquals(267, $attachment->size); + self::assertEquals(1, $attachment->part_number); + self::assertNull($attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('da786518', $attachment->filename); + self::assertEquals("da786518", $attachment->name); + self::assertEquals('', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("7525331f5fab23ea77f595b995336aca7b8dad12db00ada14abebe7fe5b96e10", hash("sha256", $attachment->content)); + self::assertEquals(776, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertNull($attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/FixtureTestCase.php b/plugins/vendor/webklex/php-imap/tests/fixtures/FixtureTestCase.php new file mode 100644 index 00000000..cb64a9a6 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/FixtureTestCase.php @@ -0,0 +1,94 @@ + [ + "debug" => $_ENV["LIVE_MAILBOX_DEBUG"] ?? false, + ], + 'accounts' => [ + 'default' => [ + 'host' => getenv("LIVE_MAILBOX_HOST"), + 'port' => getenv("LIVE_MAILBOX_PORT"), + 'encryption' => getenv("LIVE_MAILBOX_ENCRYPTION"), + 'validate_cert' => getenv("LIVE_MAILBOX_VALIDATE_CERT"), + 'username' => getenv("LIVE_MAILBOX_USERNAME"), + 'password' => getenv("LIVE_MAILBOX_PASSWORD"), + 'protocol' => 'imap', //might also use imap, [pop3 or nntp (untested)] + ], + ], + ]); + return self::$manager; + } + + /** + * Get a fixture message + * @param string $template + * + * @return Message + * @throws ReflectionException + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + final public function getFixture(string $template, ?Config $config = null) : Message { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", $template]); + $message = Message::fromFile($filename, $config); + self::assertInstanceOf(Message::class, $message); + + return $message; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/FourNestedEmailsTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/FourNestedEmailsTest.php new file mode 100644 index 00000000..e6c37ccd --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/FourNestedEmailsTest.php @@ -0,0 +1,55 @@ +getFixture("four_nested_emails.eml"); + + self::assertEquals("3-third-subject", $message->subject); + self::assertEquals("3-third-content", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertFalse($message->date->first()); + self::assertEquals("test@example.com", $message->from->first()->mail); + self::assertEquals("test@example.com", $message->to->first()->mail); + + $attachments = $message->getAttachments(); + self::assertCount(1, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("2-second-email.eml", $attachment->name); + self::assertEquals('text', $attachment->type); + self::assertEquals('eml', $attachment->getExtension()); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("85012e6a26d064a0288ee62618b3192687385adb4a4e27e48a28f738a325ca46", hash("sha256", $attachment->content)); + self::assertEquals(1376, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/GbkCharsetTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/GbkCharsetTest.php new file mode 100644 index 00000000..7492d908 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/GbkCharsetTest.php @@ -0,0 +1,37 @@ +getFixture("gbk_charset.eml"); + + self::assertEquals("Nuu", $message->subject); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/HtmlOnlyTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/HtmlOnlyTest.php new file mode 100644 index 00000000..90ef44e3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/HtmlOnlyTest.php @@ -0,0 +1,37 @@ +getFixture("html_only.eml"); + + self::assertEquals("Nuu", $message->subject); + self::assertEquals("Hi", $message->getHTMLBody()); + self::assertFalse($message->hasTextBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/ImapMimeHeaderDecodeReturnsFalseTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/ImapMimeHeaderDecodeReturnsFalseTest.php new file mode 100644 index 00000000..7f90a4ec --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/ImapMimeHeaderDecodeReturnsFalseTest.php @@ -0,0 +1,37 @@ +getFixture("imap_mime_header_decode_returns_false.eml"); + + self::assertEquals("=?UTF-8?B?nnDusSNdG92w6Fuw61fMjAxOF8wMy0xMzMyNTMzMTkzLnBkZg==?=", $message->subject->first()); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/InlineAttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/InlineAttachmentTest.php new file mode 100644 index 00000000..edb380cd --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/InlineAttachmentTest.php @@ -0,0 +1,62 @@ +getFixture("inline_attachment.eml"); + + self::assertEquals("", $message->subject); + self::assertFalse($message->hasTextBody()); + self::assertEquals('', $message->getHTMLBody()); + + self::assertFalse($message->date->first()); + self::assertFalse($message->from->first()); + self::assertFalse($message->to->first()); + + + $attachments = $message->attachments(); + self::assertInstanceOf(AttachmentCollection::class, $attachments); + self::assertCount(1, $attachments); + + $attachment = $attachments[0]; + + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals('d2913999', $attachment->name); + self::assertEquals('d2913999', $attachment->filename); + self::assertEquals('ii_15f0aad691bb745f', $attachment->id); + self::assertEquals('text', $attachment->type); + self::assertEquals('', $attachment->getExtension()); + self::assertEquals("image/png", $attachment->content_type); + self::assertEquals("6568c9e9c35a7fa06f236e89f704d8c9b47183a24f2c978dba6c92e2747e3a13", hash("sha256", $attachment->content)); + self::assertEquals(1486, $attachment->size); + self::assertEquals(1, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertEquals("", $attachment->content_id); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/KsC56011987HeadersTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/KsC56011987HeadersTest.php new file mode 100644 index 00000000..944e9bfb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/KsC56011987HeadersTest.php @@ -0,0 +1,46 @@ +getFixture("ks_c_5601-1987_headers.eml"); + + self::assertEquals("RE: 회원님께 Ersi님이 메시지를 보냈습니다.", $message->subject); + self::assertEquals("=?ks_c_5601-1987?B?yLi/+LTUsrIgRXJzabTUwMwguN69w8H2uKYgurizwr3AtM+02S4=?=", $message->thread_topic); + self::assertEquals("1.0", $message->mime_version); + self::assertEquals("Content", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("to@here.com", $message->to->first()->mail); + + + $from = $message->from->first(); + self::assertEquals("김 현진", $from->personal); + self::assertEquals("from", $from->mailbox); + self::assertEquals("there.com", $from->host); + self::assertEquals("from@there.com", $from->mail); + self::assertEquals("김 현진 ", $from->full); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MailThatIsAttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MailThatIsAttachmentTest.php new file mode 100644 index 00000000..0f4164c9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MailThatIsAttachmentTest.php @@ -0,0 +1,63 @@ +getFixture("mail_that_is_attachment.eml"); + + self::assertEquals("Report domain: yyy.cz Submitter: google.com Report-ID: 2244696771454641389", $message->subject); + self::assertEquals("2244696771454641389@google.com", $message->message_id); + self::assertEquals("1.0", $message->mime_version); + self::assertFalse($message->hasTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2015-02-15 10:21:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("xxx@yyy.cz", $message->to->first()->mail); + self::assertEquals("xxx@yyy.cz", $message->sender->first()->mail); + + $from = $message->from->first(); + self::assertEquals("noreply-dmarc-support via xxx", $from->personal); + self::assertEquals("xxx", $from->mailbox); + self::assertEquals("yyy.cz", $from->host); + self::assertEquals("xxx@yyy.cz", $from->mail); + self::assertEquals("noreply-dmarc-support via xxx ", $from->full); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("google.com!yyy.cz!1423872000!1423958399.zip", $attachment->name); + self::assertEquals('zip', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/zip", $attachment->content_type); + self::assertEquals("c0d4f47b6fde124cea7460c3e509440d1a062705f550b0502b8ba0cbf621c97a", hash("sha256", $attachment->content)); + self::assertEquals(1062, $attachment->size); + self::assertEquals(0, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MissingDateTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MissingDateTest.php new file mode 100644 index 00000000..93595adc --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MissingDateTest.php @@ -0,0 +1,37 @@ +getFixture("missing_date.eml"); + + self::assertEquals("Nuu", $message->getSubject()); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertFalse($message->date->first()); + self::assertEquals("from@here.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MissingFromTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MissingFromTest.php new file mode 100644 index 00000000..5d57340c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MissingFromTest.php @@ -0,0 +1,37 @@ +getFixture("missing_from.eml"); + + self::assertEquals("Nuu", $message->getSubject()); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertFalse($message->from->first()); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MixedFilenameTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MixedFilenameTest.php new file mode 100644 index 00000000..b2be0e32 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MixedFilenameTest.php @@ -0,0 +1,61 @@ +getFixture("mixed_filename.eml"); + + self::assertEquals("Свежий прайс-лист", $message->subject); + self::assertFalse($message->hasTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2018-02-02 19:23:06", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + + $from = $message->from->first(); + self::assertEquals("Прайсы || ПартКом", $from->personal); + self::assertEquals("support", $from->mailbox); + self::assertEquals("part-kom.ru", $from->host); + self::assertEquals("support@part-kom.ru", $from->mail); + self::assertEquals("Прайсы || ПартКом ", $from->full); + + self::assertEquals("foo@bar.com", $message->to->first()); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("Price4VladDaKar.xlsx", $attachment->name); + self::assertEquals('xlsx', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/octet-stream", $attachment->content_type); + self::assertEquals("b832983842b0ad65db69e4c7096444c540a2393e2d43f70c2c9b8b9fceeedbb1", hash('sha256', $attachment->content)); + self::assertEquals(94, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MultipartWithoutBodyTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipartWithoutBodyTest.php new file mode 100644 index 00000000..01112bb7 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipartWithoutBodyTest.php @@ -0,0 +1,62 @@ +getFixture("multipart_without_body.eml"); + + self::assertEquals("This mail will not contain a body", $message->subject); + self::assertEquals("This mail will not contain a body", $message->getTextBody()); + self::assertEquals("d76dfb1ff3231e3efe1675c971ce73f722b906cc049d328db0d255f8d3f65568", hash("sha256", $message->getHTMLBody())); + self::assertEquals("2023-03-11 08:24:31", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("Foo Bülow Bar ", $message->from); + self::assertEquals("some one ", $message->to); + self::assertEquals([ + 0 => 'from AS8PR02MB6805.eurprd02.prod.outlook.com (2603:10a6:20b:252::8) by PA4PR02MB7071.eurprd02.prod.outlook.com with HTTPS; Sat, 11 Mar 2023 08:24:33 +0000', + 1 => 'from omef0ahNgeoJu.eurprd02.prod.outlook.com (2603:10a6:10:33c::12) by AS8PR02MB6805.eurprd02.prod.outlook.com (2603:10a6:20b:252::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Sat, 11 Mar 2023 08:24:31 +0000', + 2 => 'from omef0ahNgeoJu.eurprd02.prod.outlook.com ([fe80::38c0:9c40:7fc6:93a7]) by omef0ahNgeoJu.eurprd02.prod.outlook.com ([fe80::38c0:9c40:7fc6:93a7%7]) with mapi id 15.20.6178.019; Sat, 11 Mar 2023 08:24:31 +0000', + ], $message->received->all()); + self::assertEquals("This mail will not contain a body", $message->thread_topic); + self::assertEquals("AdlT8uVmpHPvImbCRM6E9LODIvAcQA==", $message->thread_index); + self::assertEquals("omef0ahNgeoJuEB51C568ED2227A2DAABB5BB9@omef0ahNgeoJu.eurprd02.prod.outlook.com", $message->message_id); + self::assertEquals("da-DK, en-US", $message->accept_language); + self::assertEquals("en-US", $message->content_language); + self::assertEquals("Internal", $message->x_ms_exchange_organization_authAs); + self::assertEquals("04", $message->x_ms_exchange_organization_authMechanism); + self::assertEquals("omef0ahNgeoJu.eurprd02.prod.outlook.com", $message->x_ms_exchange_organization_authSource); + self::assertEquals("", $message->x_ms_Has_Attach); + self::assertEquals("aa546a02-2b7a-4fb1-7fd4-08db220a09f1", $message->x_ms_exchange_organization_Network_Message_Id); + self::assertEquals("-1", $message->x_ms_exchange_organization_SCL); + self::assertEquals("", $message->x_ms_TNEF_Correlator); + self::assertEquals("0", $message->x_ms_exchange_organization_RecordReviewCfmType); + self::assertEquals("Email", $message->x_ms_publictraffictype); + self::assertEquals("ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097);", $message->X_Microsoft_Antispam_Mailbox_Delivery->first()); + self::assertEquals("0712b5fe22cf6e75fa220501c1a6715a61098983df9e69bad4000c07531c1295", hash("sha256", $message->X_Microsoft_Antispam_Message_Info)); + self::assertEquals("multipart/alternative", $message->Content_Type->last()); + self::assertEquals("1.0", $message->mime_version); + + self::assertCount(0, $message->getAttachments()); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleHtmlPartsAndAttachmentsTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleHtmlPartsAndAttachmentsTest.php new file mode 100644 index 00000000..48bc0172 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleHtmlPartsAndAttachmentsTest.php @@ -0,0 +1,76 @@ +getFixture("multiple_html_parts_and_attachments.eml"); + + self::assertEquals("multiple_html_parts_and_attachments", $message->subject); + self::assertEquals("This is the first html part\r\n\r\n\r\n\r\nThis is the second html part\r\n\r\n\r\n\r\nThis is the last html part\r\nhttps://www.there.com", $message->getTextBody()); + self::assertEquals("This is the first html part

\n

This is the second html part

\n

This is the last html part
https://www.there.com



\r\n
", $message->getHTMLBody()); + + self::assertEquals("2023-02-16 09:19:02", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + + $from = $message->from->first(); + self::assertEquals("FromName", $from->personal); + self::assertEquals("from", $from->mailbox); + self::assertEquals("there.com", $from->host); + self::assertEquals("from@there.com", $from->mail); + self::assertEquals("FromName ", $from->full); + + self::assertEquals("to@there.com", $message->to->first()); + + $attachments = $message->attachments(); + self::assertInstanceOf(AttachmentCollection::class, $attachments); + self::assertCount(2, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("attachment1.pdf", $attachment->name); + self::assertEquals('pdf', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/pdf", $attachment->content_type); + self::assertEquals("c162adf19e0f67e26ef0b7f791b33a60b2c23b175560a505dc7f9ec490206e49", hash("sha256", $attachment->content)); + self::assertEquals(4814, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("attachment2.pdf", $attachment->name); + self::assertEquals('pdf', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/pdf", $attachment->content_type); + self::assertEquals("a337b37e9d3edb172a249639919f0eee3d344db352046d15f8f9887e55855a25", hash("sha256", $attachment->content)); + self::assertEquals(5090, $attachment->size); + self::assertEquals(4, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleNestedAttachmentsTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleNestedAttachmentsTest.php new file mode 100644 index 00000000..a3cba097 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/MultipleNestedAttachmentsTest.php @@ -0,0 +1,69 @@ +getFixture("multiple_nested_attachments.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("------------------------------------------------------------------------", $message->getTextBody()); + self::assertEquals("\r\n \r\n\r\n \r\n \r\n \r\n


\r\n

\r\n
\r\n \r\n \r\n  \"\"\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n

\r\n

\r\n
\r\n
\r\n \r\n", $message->getHTMLBody()); + + self::assertEquals("2018-01-15 09:54:09", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertFalse($message->from->first()); + self::assertFalse($message->to->first()); + + $attachments = $message->attachments(); + self::assertInstanceOf(AttachmentCollection::class, $attachments); + self::assertCount(2, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("mleokdgdlgkkecep.png", $attachment->name); + self::assertEquals('png', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("image/png", $attachment->content_type); + self::assertEquals("e0e99b0bd6d5ea3ced99add53cc98b6f8eea6eae8ddd773fd06f3489289385fb", hash("sha256", $attachment->content)); + self::assertEquals(114, $attachment->size); + self::assertEquals(3, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("FF4D00-1.png", $attachment->name); + self::assertEquals('png', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("image/png", $attachment->content_type); + self::assertEquals("e0e99b0bd6d5ea3ced99add53cc98b6f8eea6eae8ddd773fd06f3489289385fb", hash("sha256", $attachment->content)); + self::assertEquals(114, $attachment->size); + self::assertEquals(4, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/NestesEmbeddedWithAttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/NestesEmbeddedWithAttachmentTest.php new file mode 100644 index 00000000..e1ff57ea --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/NestesEmbeddedWithAttachmentTest.php @@ -0,0 +1,69 @@ +getFixture("nestes_embedded_with_attachment.eml"); + + self::assertEquals("Nuu", $message->subject); + self::assertEquals("Dear Sarah", $message->getTextBody()); + self::assertEquals("\r\n\r\n
Dear Sarah,
\r\n", $message->getHTMLBody()); + + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + + $attachments = $message->attachments(); + self::assertInstanceOf(AttachmentCollection::class, $attachments); + self::assertCount(2, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("first.eml", $attachment->name); + self::assertEquals('eml', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("From: from@there.com\r\nTo: to@here.com\r\nSubject: FIRST\r\nDate: Sat, 28 Apr 2018 14:37:16 -0400\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed;\r\n boundary=\"----=_NextPart_000_222_000\"\r\n\r\nThis is a multi-part message in MIME format.\r\n\r\n------=_NextPart_000_222_000\r\nContent-Type: multipart/alternative;\r\n boundary=\"----=_NextPart_000_222_111\"\r\n\r\n\r\n------=_NextPart_000_222_111\r\nContent-Type: text/plain;\r\n charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nPlease respond directly to this email to update your RMA\r\n\r\n\r\n2018-04-17T11:04:03-04:00\r\n------=_NextPart_000_222_111\r\nContent-Type: text/html;\r\n charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\n\r\n
Please respond directly to this =\r\nemail to=20\r\nupdate your RMA
\r\n\r\n------=_NextPart_000_222_111--\r\n\r\n------=_NextPart_000_222_000\r\nContent-Type: image/png;\r\n name=\"chrome.png\"\r\nContent-Transfer-Encoding: base64\r\nContent-Disposition: attachment;\r\n filename=\"chrome.png\"\r\n\r\niVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAB+FBMVEUAAAA/mUPidDHiLi5Cn0Xk\r\nNTPmeUrkdUg/m0Q0pEfcpSbwaVdKskg+lUP4zA/iLi3msSHkOjVAmETdJSjtYFE/lkPnRj3sWUs8\r\nkkLeqCVIq0fxvhXqUkbVmSjwa1n1yBLepyX1xxP0xRXqUkboST9KukpHpUbuvRrzrhF/ljbwalju\r\nZFM4jELaoSdLtElJrUj1xxP6zwzfqSU4i0HYnydMtUlIqUfywxb60AxZqEXaoifgMCXptR9MtklH\r\npEY2iUHWnSjvvRr70QujkC+pUC/90glMuEnlOjVMt0j70QriLS1LtEnnRj3qUUXfIidOjsxAhcZF\r\no0bjNDH0xxNLr0dIrUdmntVTkMoyfL8jcLBRuErhJyrgKyb4zA/5zg3tYFBBmUTmQTnhMinruBzv\r\nvhnxwxZ/st+Ktt5zp9hqota2vtK6y9FemNBblc9HiMiTtMbFtsM6gcPV2r6dwroseLrMrbQrdLGd\r\nyKoobKbo3Zh+ynrgVllZulTsXE3rV0pIqUf42UVUo0JyjEHoS0HmsiHRGR/lmRz/1hjqnxjvpRWf\r\nwtOhusaz0LRGf7FEfbDVmqHXlJeW0pbXq5bec3fX0nTnzmuJuWvhoFFhm0FtrziBsjaAaDCYWC+u\r\nSi6jQS3FsSfLJiTirCOkuCG1KiG+wSC+GBvgyhTszQ64Z77KAAAARXRSTlMAIQRDLyUgCwsE6ebm\r\n5ubg2dLR0byXl4FDQzU1NDEuLSUgC+vr6urq6ubb29vb2tra2tG8vLu7u7uXl5eXgYGBgYGBLiUA\r\nLabIAAABsElEQVQoz12S9VPjQBxHt8VaOA6HE+AOzv1wd7pJk5I2adpCC7RUcHd3d3fXf5PvLkxh\r\neD++z+yb7GSRlwD/+Hj/APQCZWxM5M+goF+RMbHK594v+tPoiN1uHxkt+xzt9+R9wnRTZZQpXQ0T\r\n5uP1IQxToyOAZiQu5HEpjeA4SWIoksRxNiGC1tRZJ4LNxgHgnU5nJZBDvuDdl8lzQRBsQ+s9PZt7\r\ns7Pz8wsL39/DkIfZ4xlB2Gqsq62ta9oxVlVrNZpihFRpGO9fzQw1ms0NDWZz07iGkJmIFH8xxkc3\r\na/WWlubmFkv9AB2SEpDvKxbjidN2faseaNV3zoHXvv7wMODJdkOHAegweAfFPx4G67KluxzottCU\r\n9n8CUqXzcIQdXOytAHqXxomvykhEKN9EFutG22p//0rbNvHVxiJywa8yS2KDfV1dfbu31H8jF1RH\r\niTKtWYeHxUvq3bn0pyjCRaiRU6aDO+gb3aEfEeVNsDgm8zzLy9egPa7Qt8TSJdwhjplk06HH43ZN\r\nJ3s91KKCHQ5x4sw1fRGYDZ0n1L4FKb9/BP5JLYxToheoFCVxz57PPS8UhhEpLBVeAAAAAElFTkSu\r\nQmCC\r\n\r\n------=_NextPart_000_222_000--", $attachment->content); + self::assertEquals(2535, $attachment->size); + self::assertEquals(3, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("second.eml", $attachment->name); + self::assertEquals('eml', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("From: from@there.com\r\nTo: to@here.com\r\nSubject: SECOND\r\nDate: Sat, 28 Apr 2018 13:37:30 -0400\r\nMIME-Version: 1.0\r\nContent-Type: multipart/alternative;\r\n boundary=\"----=_NextPart_000_333_000\"\r\n\r\nThis is a multi-part message in MIME format.\r\n\r\n------=_NextPart_000_333_000\r\nContent-Type: text/plain;\r\n charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\nT whom it may concern:\r\n------=_NextPart_000_333_000\r\nContent-Type: text/html;\r\n charset=\"UTF-8\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n\r\n\r\n
T whom it may concern:
\r\n\r\n\r\n------=_NextPart_000_333_000--", $attachment->content); + self::assertEquals(631, $attachment->size); + self::assertEquals(4, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/NullContentCharsetTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/NullContentCharsetTest.php new file mode 100644 index 00000000..f8e6c63f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/NullContentCharsetTest.php @@ -0,0 +1,39 @@ +getFixture("null_content_charset.eml"); + + self::assertEquals("test", $message->getSubject()); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertEquals("1.0", $message->mime_version); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/PecTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/PecTest.php new file mode 100644 index 00000000..341ad185 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/PecTest.php @@ -0,0 +1,82 @@ +getFixture("pec.eml"); + + self::assertEquals("Certified", $message->subject); + self::assertEquals("Signed", $message->getTextBody()); + self::assertEquals("Signed", $message->getHTMLBody()); + + self::assertEquals("2017-10-02 10:13:43", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("test@example.com", $message->from->first()->mail); + self::assertEquals("test@example.com", $message->to->first()->mail); + + $attachments = $message->attachments(); + + self::assertInstanceOf(AttachmentCollection::class, $attachments); + self::assertCount(3, $attachments); + + $attachment = $attachments[0]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("data.xml", $attachment->name); + self::assertEquals('xml', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/xml", $attachment->content_type); + self::assertEquals("", $attachment->content); + self::assertEquals(8, $attachment->size); + self::assertEquals(3, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[1]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("postacert.eml", $attachment->name); + self::assertEquals('eml', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("message/rfc822", $attachment->content_type); + self::assertEquals("To: test@example.com\r\nFrom: test@example.com\r\nSubject: test-subject\r\nDate: Mon, 2 Oct 2017 12:13:50 +0200\r\nContent-Type: text/plain; charset=iso-8859-15; format=flowed\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntest-content", $attachment->content); + self::assertEquals(216, $attachment->size); + self::assertEquals(4, $attachment->part_number); + self::assertEquals("inline", $attachment->disposition); + self::assertNotEmpty($attachment->id); + + $attachment = $attachments[2]; + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("smime.p7s", $attachment->name); + self::assertEquals('p7s', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("application/x-pkcs7-signature", $attachment->content_type); + self::assertEquals("1", $attachment->content); + self::assertEquals(4, $attachment->size); + self::assertEquals(5, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/PlainOnlyTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/PlainOnlyTest.php new file mode 100644 index 00000000..b3a65bfe --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/PlainOnlyTest.php @@ -0,0 +1,37 @@ +getFixture("plain_only.eml"); + + self::assertEquals("Nuu", $message->getSubject()); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/PlainTextAttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/PlainTextAttachmentTest.php new file mode 100644 index 00000000..2e9993cc --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/PlainTextAttachmentTest.php @@ -0,0 +1,54 @@ +getFixture("plain_text_attachment.eml"); + + self::assertEquals("Plain text attachment", $message->subject); + self::assertEquals("Test", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2018-08-21 07:05:14", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("a.txt", $attachment->name); + self::assertEquals('txt', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertNull($attachment->content_type); + self::assertEquals("Hi!", $attachment->content); + self::assertEquals(4, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/ReferencesTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/ReferencesTest.php new file mode 100644 index 00000000..c86aa96f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/ReferencesTest.php @@ -0,0 +1,54 @@ +getFixture("references.eml"); + + self::assertEquals("", $message->subject); + self::assertEquals("Hi\r\nHow are you?", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertFalse($message->date->first()); + + self::assertEquals("b9e87bd5e661a645ed6e3b832828fcc5@example.com", $message->in_reply_to); + self::assertEquals("", $message->from->first()->personal); + self::assertEquals("", $message->from->first()->host); + self::assertEquals("no_host", $message->from->first()->mail); + self::assertFalse($message->to->first()); + + self::assertEquals([ + "231d9ac57aec7d8c1a0eacfeab8af6f3@example.com", + "08F04024-A5B3-4FDE-BF2C-6710DE97D8D9@example.com" + ], $message->getReferences()->all()); + + self::assertEquals([ + 'This one: is "right" ', + 'No-address' + ], $message->cc->map(function($address){ + /** @var \Webklex\PHPIMAP\Address $address */ + return $address->full; + })); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/SimpleMultipartTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/SimpleMultipartTest.php new file mode 100644 index 00000000..d2a2d885 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/SimpleMultipartTest.php @@ -0,0 +1,37 @@ +getFixture("simple_multipart.eml"); + + self::assertEquals("test", $message->getSubject()); + self::assertEquals("MyPlain", $message->getTextBody()); + self::assertEquals("MyHtml", $message->getHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/StructuredWithAttachmentTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/StructuredWithAttachmentTest.php new file mode 100644 index 00000000..3fc591c3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/StructuredWithAttachmentTest.php @@ -0,0 +1,55 @@ +getFixture("structured_with_attachment.eml"); + + self::assertEquals("Test", $message->getSubject()); + self::assertEquals("Test", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + + self::assertEquals("2017-09-29 08:55:23", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + + self::assertCount(1, $message->attachments()); + + $attachment = $message->attachments()->first(); + self::assertInstanceOf(Attachment::class, $attachment); + self::assertEquals("MyFile.txt", $attachment->name); + self::assertEquals('txt', $attachment->getExtension()); + self::assertEquals('text', $attachment->type); + self::assertEquals("text/plain", $attachment->content_type); + self::assertEquals("MyFileContent", $attachment->content); + self::assertEquals(20, $attachment->size); + self::assertEquals(2, $attachment->part_number); + self::assertEquals("attachment", $attachment->disposition); + self::assertNotEmpty($attachment->id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/UndefinedCharsetHeaderTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/UndefinedCharsetHeaderTest.php new file mode 100644 index 00000000..f7a51cb0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/UndefinedCharsetHeaderTest.php @@ -0,0 +1,64 @@ +getFixture("undefined_charset_header.eml"); + + self::assertEquals("", $message->get("x-real-to")); + self::assertEquals("1.0", $message->get("mime-version")); + self::assertEquals("Mon, 27 Feb 2017 13:21:44 +0930", $message->get("Resent-Date")); + self::assertEquals("", $message->get("Resent-From")); + self::assertEquals("BlaBla", $message->get("X-Stored-In")); + self::assertSame([ + 'personal' => '', + 'mailbox' => 'info', + 'host' => 'bla.bla', + 'mail' => 'info@bla.bla', + 'full' => 'info@bla.bla', + ], $message->get("Return-Path")->first()->toArray()); + self::assertEquals([ + 'from by bla.bla (CommuniGate Pro RULE 6.1.13) with RULE id 14057804; Mon, 27 Feb 2017 13:21:44 +0930', + ], $message->get("Received")->all()); + self::assertEquals(")", $message->getHTMLBody()); + self::assertFalse($message->hasTextBody()); + self::assertEquals("2017-02-27 03:51:29", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + + $from = $message->from->first(); + self::assertInstanceOf(Address::class, $from); + + self::assertEquals("myGov", $from->personal); + self::assertEquals("info", $from->mailbox); + self::assertEquals("bla.bla", $from->host); + self::assertEquals("info@bla.bla", $from->mail); + self::assertEquals("myGov ", $from->full); + + self::assertEquals("sales@bla.bla", $message->to->first()->mail); + self::assertEquals("Submit your tax refund | Australian Taxation Office.", $message->subject); + self::assertEquals("201702270351.BGF77614@bla.bla", $message->message_id); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsMinusTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsMinusTest.php new file mode 100644 index 00000000..f9ee7999 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsMinusTest.php @@ -0,0 +1,42 @@ +getFixture("undisclosed_recipients_minus.eml"); + + self::assertEquals("test", $message->subject); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from); + self::assertEquals([ + "undisclosed-recipients", + "" + ], $message->to->map(function ($item) { + return $item->mailbox; + })); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsSpaceTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsSpaceTest.php new file mode 100644 index 00000000..b86321eb --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsSpaceTest.php @@ -0,0 +1,42 @@ +getFixture("undisclosed_recipients_space.eml"); + + self::assertEquals("test", $message->subject); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from); + self::assertEquals([ + "Undisclosed recipients", + "" + ], $message->to->map(function ($item) { + return $item->mailbox; + })); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsTest.php new file mode 100644 index 00000000..f5f44164 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/UndisclosedRecipientsTest.php @@ -0,0 +1,42 @@ +getFixture("undisclosed_recipients.eml"); + + self::assertEquals("test", $message->subject); + self::assertEquals("Hi!", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from); + self::assertEquals([ + "Undisclosed Recipients", + "" + ], $message->to->map(function ($item) { + return $item->mailbox; + })); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/UnknownEncodingTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/UnknownEncodingTest.php new file mode 100644 index 00000000..3a570cbd --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/UnknownEncodingTest.php @@ -0,0 +1,37 @@ +getFixture("unknown_encoding.eml"); + + self::assertEquals("test", $message->getSubject()); + self::assertEquals("MyPlain", $message->getTextBody()); + self::assertEquals("MyHtml", $message->getHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetPlainOnlyTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetPlainOnlyTest.php new file mode 100644 index 00000000..497334d5 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetPlainOnlyTest.php @@ -0,0 +1,37 @@ +getFixture("without_charset_plain_only.eml"); + + self::assertEquals("Nuu", $message->getSubject()); + self::assertEquals("Hi", $message->getTextBody()); + self::assertFalse($message->hasHTMLBody()); + self::assertEquals("2017-09-13 11:05:45", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetSimpleMultipartTest.php b/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetSimpleMultipartTest.php new file mode 100644 index 00000000..2a9ea2a0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/fixtures/WithoutCharsetSimpleMultipartTest.php @@ -0,0 +1,37 @@ +getFixture("without_charset_simple_multipart.eml"); + + self::assertEquals("test", $message->getSubject()); + self::assertEquals("MyPlain", $message->getTextBody()); + self::assertEquals("MyHtml", $message->getHTMLBody()); + self::assertEquals("2017-09-27 10:48:51", $message->date->first()->setTimezone('UTC')->format("Y-m-d H:i:s")); + self::assertEquals("from@there.com", $message->from->first()->mail); + self::assertEquals("to@here.com", $message->to->first()->mail); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue275Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue275Test.php new file mode 100644 index 00000000..4049998d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue275Test.php @@ -0,0 +1,38 @@ +subject); + self::assertSame("Asdf testing123 this is a body", $message->getTextBody()); + } + + public function testIssueEmail2() { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "issue-275-2.eml"]); + $message = Message::fromFile($filename); + + $body = "Test\r\n\r\nMed venlig hilsen\r\nMartin Larsen\r\nFeline Holidays A/S\r\nTlf 78 77 04 12"; + + self::assertSame("Test 1017", (string)$message->subject); + self::assertSame($body, $message->getTextBody()); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue355Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue355Test.php new file mode 100644 index 00000000..0fa6d07e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue355Test.php @@ -0,0 +1,30 @@ +get("subject"); + + $this->assertEquals("Re: Uppdaterat ärende (447899), kostnader för hjälp med stadgeändring enligt ny lagstiftning", $subject->toString()); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue379Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue379Test.php new file mode 100644 index 00000000..99b67921 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue379Test.php @@ -0,0 +1,61 @@ +getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + $this->assertEquals(214, $message->getSize()); + + // Clean up + $this->assertTrue($message->delete(true)); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue382Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue382Test.php new file mode 100644 index 00000000..4e638827 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue382Test.php @@ -0,0 +1,33 @@ +from->first(); + + self::assertSame("Mail Delivery System", $from->personal); + self::assertSame("MAILER-DAEMON", $from->mailbox); + self::assertSame("mta-09.someserver.com", $from->host); + self::assertSame("MAILER-DAEMON@mta-09.someserver.com", $from->mail); + self::assertSame("Mail Delivery System ", $from->full); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue383Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue383Test.php new file mode 100644 index 00000000..30cb3a9b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue383Test.php @@ -0,0 +1,69 @@ +getClient(); + $client->connect(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'Entwürfe+']); + + $folder = $client->getFolder($folder_path); + $this->deleteFolder($folder); + + $folder = $client->createFolder($folder_path, false); + self::assertInstanceOf(Folder::class, $folder); + + $folder = $this->getFolder($folder_path); + self::assertInstanceOf(Folder::class, $folder); + + $this->assertEquals('Entwürfe+', $folder->name); + $this->assertEquals($folder_path, $folder->full_name); + + $folder_path = implode($delimiter, ['INBOX', 'Entw&APw-rfe+']); + $this->assertEquals($folder_path, $folder->path); + + // Clean up + if ($this->deleteFolder($folder) === false) { + $this->fail("Could not delete folder: " . $folder->path); + } + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue393Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue393Test.php new file mode 100644 index 00000000..017ff535 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue393Test.php @@ -0,0 +1,62 @@ +getClient(); + $client->connect(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $pattern = implode($delimiter, ['doesnt_exist', '%']); + + $folder = $client->getFolder('doesnt_exist'); + $this->deleteFolder($folder); + + $folders = $client->getFolders(true, $pattern, true); + self::assertCount(0, $folders); + + try { + $client->getFolders(true, $pattern, false); + $this->fail('Expected FolderFetchingException::class exception not thrown'); + } catch (FolderFetchingException $e) { + self::assertInstanceOf(FolderFetchingException::class, $e); + } + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue401Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue401Test.php new file mode 100644 index 00000000..e250a550 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue401Test.php @@ -0,0 +1,27 @@ +subject); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue407Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue407Test.php new file mode 100644 index 00000000..4adcbb39 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue407Test.php @@ -0,0 +1,57 @@ +getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + self::assertInstanceOf(Message::class, $message); + + $message->setFlag("Seen"); + + $flags = $this->getClient()->getConnection()->flags($message->uid, IMAP::ST_UID)->validatedData(); + + self::assertIsArray($flags); + self::assertSame(1, count($flags)); + self::assertSame("\\Seen", $flags[$message->uid][0]); + + $message->delete(); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue40Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue40Test.php new file mode 100644 index 00000000..7288484c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue40Test.php @@ -0,0 +1,74 @@ +getFixture("issue-40.eml"); + + self::assertSame("Zly from", (string)$message->subject); + self::assertSame([ + 'personal' => '', + 'mailbox' => 'faked_sender', + 'host' => 'sender_domain.pl', + 'mail' => 'faked_sender@sender_domain.pl', + 'full' => 'faked_sender@sender_domain.pl', + ], $message->from->first()->toArray()); + self::assertSame([ + 'personal' => '', + 'mailbox' => 'real_sender', + 'host' => 'sender_domain.pl', + 'mail' => 'real_sender@sender_domain.pl', + 'full' => ' ', + ], (array)$message->return_path->first()); + self::assertSame(true, $message->spoofed->first()); + + $config = $message->getConfig(); + self::assertSame(false, $config->get("security.detect_spoofing_exception")); + $config->set("security.detect_spoofing_exception", true); + self::assertSame(true, $config->get("security.detect_spoofing_exception")); + + $this->expectException(SpoofingAttemptDetectedException::class); + $this->getFixture("issue-40.eml", $config); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue410Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue410Test.php new file mode 100644 index 00000000..4f8b831d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue410Test.php @@ -0,0 +1,111 @@ +getFixture("issue-410.eml"); + + self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", (string)$message->subject); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + $attachment = $attachments->first(); + self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->filename); + self::assertSame("☆第132号 「ガーデン&エクステリア」専門店のためのQ&Aサロン 【月刊エクステリア・ワーク】", $attachment->name); + } + + /** + * @throws RuntimeException + * @throws MessageContentFetchingException + * @throws ResponseException + * @throws ImapBadRequestException + * @throws InvalidMessageDateException + * @throws ConnectionFailedException + * @throws \ReflectionException + * @throws ImapServerErrorException + * @throws AuthFailedException + * @throws MaskNotFoundException + */ + public function testIssueEmailB() { + $message = $this->getFixture("issue-410b.eml"); + + self::assertSame("386 - 400021804 - 19., Heiligenstädter Straße 80 - 0819306 - Anfrage Vergabevorschlag", (string)$message->subject); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + $attachment = $attachments->first(); + self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->description); + self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->filename); + self::assertSame("2021_Mängelliste_0819306.xlsx", $attachment->name); + } + + /** + * @throws RuntimeException + * @throws MessageContentFetchingException + * @throws ResponseException + * @throws ImapBadRequestException + * @throws ConnectionFailedException + * @throws InvalidMessageDateException + * @throws ImapServerErrorException + * @throws AuthFailedException + * @throws \ReflectionException + * @throws MaskNotFoundException + */ + public function testIssueEmailSymbols() { + $message = $this->getFixture("issue-410symbols.eml"); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + /** @var Attachment $attachment */ + $attachment = $attachments->first(); + self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->description); + self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->name); + self::assertSame("Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf", $attachment->filename); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue412Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue412Test.php new file mode 100644 index 00000000..bfaa883d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue412Test.php @@ -0,0 +1,31 @@ +subject); + self::assertSame("64254d63e92a36ee02c760676351e60a", md5($message->getTextBody())); + self::assertSame("2e4de288f6a1ed658548ed11fcdb1d79", md5($message->getHTMLBody())); + self::assertSame(0, $message->attachments()->count()); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue413Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue413Test.php new file mode 100644 index 00000000..2162d6b5 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue413Test.php @@ -0,0 +1,82 @@ +getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + /** @var Message $message */ + $_message = $this->appendMessageTemplate($folder, 'issue-413.eml'); + + $message = $folder->messages()->getMessageByMsgn($_message->msgn); + self::assertEquals($message->uid, $_message->uid); + + self::assertSame("Test Message", (string)$message->subject); + self::assertSame("This is just a test, so ignore it (if you can!)\r\n\r\nTony Marston", $message->getTextBody()); + + $message->delete(); + } + + /** + * Static parsing test + * + * @return void + * @throws \ReflectionException + * @throws \Webklex\PHPIMAP\Exceptions\AuthFailedException + * @throws \Webklex\PHPIMAP\Exceptions\ConnectionFailedException + * @throws \Webklex\PHPIMAP\Exceptions\ImapBadRequestException + * @throws \Webklex\PHPIMAP\Exceptions\ImapServerErrorException + * @throws \Webklex\PHPIMAP\Exceptions\InvalidMessageDateException + * @throws \Webklex\PHPIMAP\Exceptions\MaskNotFoundException + * @throws \Webklex\PHPIMAP\Exceptions\MessageContentFetchingException + * @throws \Webklex\PHPIMAP\Exceptions\ResponseException + * @throws \Webklex\PHPIMAP\Exceptions\RuntimeException + */ + public function testIssueEmail() { + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "issue-413.eml"]); + $message = Message::fromFile($filename); + + self::assertSame("Test Message", (string)$message->subject); + self::assertSame("This is just a test, so ignore it (if you can!)\r\n\r\nTony Marston", $message->getTextBody()); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue414Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue414Test.php new file mode 100644 index 00000000..36a1d300 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue414Test.php @@ -0,0 +1,43 @@ +subject); + + $attachments = $message->getAttachments(); + + self::assertSame(2, $attachments->count()); + + $attachment = $attachments->first(); + self::assertEmpty($attachment->description); + self::assertSame("exampleMyFile.txt", $attachment->filename); + self::assertSame("exampleMyFile.txt", $attachment->name); + self::assertSame("be62f7e6", $attachment->id); + + $attachment = $attachments->last(); + self::assertEmpty($attachment->description); + self::assertSame("phpfoo", $attachment->filename); + self::assertSame("phpfoo", $attachment->name); + self::assertSame("12e1d38b", $attachment->hash); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue420Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue420Test.php new file mode 100644 index 00000000..0cac9b6e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue420Test.php @@ -0,0 +1,31 @@ +get("subject"); + + // Ticket No: [��17] Mailbox Inbox - (17) Incoming failed messages + $this->assertEquals('Ticket No: [??17] Mailbox Inbox - (17) Incoming failed messages', utf8_decode($subject->toString())); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue462Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue462Test.php new file mode 100644 index 00000000..e7fc2126 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue462Test.php @@ -0,0 +1,48 @@ +set('options.rfc822', false); + $message = $this->getFixture("issue-462.eml", $config); + self::assertSame("Undeliverable: Some subject", (string)$message->subject); + self::assertSame("postmaster@ ", (string)$message->from->first()); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue469Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue469Test.php new file mode 100644 index 00000000..13bd841b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue469Test.php @@ -0,0 +1,42 @@ +createStub(Client::class); + $folder_name = '[Gmail]'; + $delimiter = '/'; + + $attributes = [ + '\NoInferiors', + '\NoSelect', + ]; + $folder = new Folder($client, $folder_name, $delimiter, $attributes); + + $attributes_lowercase = [ + '\Noinferiors', + '\Noselect', + ]; + $folder_lowercase = new Folder($client, $folder_name, $delimiter, $attributes_lowercase); + + self::assertSame( + $folder->no_inferiors, + $folder_lowercase->no_inferiors, + 'The parsed "\NoInferiors" attribute does not match the parsed "\Noinferiors" attribute' + ); + self::assertSame( + $folder->no_select, + $folder_lowercase->no_select, + 'The parsed "\NoSelect" attribute does not match the parsed "\Noselect" attribute' + ); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue511Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue511Test.php new file mode 100644 index 00000000..4782bace --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue511Test.php @@ -0,0 +1,50 @@ +getFixture("issue-511.eml"); + self::assertSame("RE: [EXTERNAL] Re: Lorem Ipsum /40 one", (string)$message->subject); + self::assertSame("COMPANYNAME | usługi ", (string)$message->from->first()); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/issues/Issue544Test.php b/plugins/vendor/webklex/php-imap/tests/issues/Issue544Test.php new file mode 100644 index 00000000..b8ee0e7e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/issues/Issue544Test.php @@ -0,0 +1,61 @@ +getFixture("issue-544.eml"); + + self::assertSame("Test bad boundary", (string)$message->subject); + + $attachments = $message->getAttachments(); + + self::assertSame(1, $attachments->count()); + + /** @var Attachment $attachment */ + $attachment = $attachments->first(); + self::assertSame("file.pdf", $attachment->name); + self::assertSame("file.pdf", $attachment->filename); + self::assertStringStartsWith("%PDF-1.4", $attachment->content); + self::assertStringEndsWith("%%EOF\n", $attachment->content); + self::assertSame(14938, $attachment->size); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/live/ClientTest.php b/plugins/vendor/webklex/php-imap/tests/live/ClientTest.php new file mode 100644 index 00000000..1d224d57 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/ClientTest.php @@ -0,0 +1,318 @@ +getClient()->connect()); + } + + /** + * Test if the connection is working + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testIsConnected(): void { + $client = $this->getClient()->connect(); + + self::assertTrue($client->isConnected()); + } + + /** + * Test if the connection state can be determined + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testDisconnect(): void { + $client = $this->getClient()->connect(); + + self::assertFalse($client->disconnect()->isConnected()); + } + + /** + * Test to get the default inbox folder + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws FolderFetchingException + */ + public function testGetFolder(): void { + $client = $this->getClient()->connect(); + + $folder = $client->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + } + + /** + * Test to get the default inbox folder by name + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFolderByName(): void { + $client = $this->getClient()->connect(); + + $folder = $client->getFolderByName('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + } + + /** + * Test to get the default inbox folder by path + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFolderByPath(): void { + $client = $this->getClient()->connect(); + + $folder = $client->getFolderByPath('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + } + + /** + * Test to get all folders + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFolders(): void { + $client = $this->getClient()->connect(); + + $folders = $client->getFolders(false); + self::assertTrue($folders->count() > 0); + } + + public function testGetFoldersWithStatus(): void { + $client = $this->getClient()->connect(); + + $folders = $client->getFoldersWithStatus(false); + self::assertTrue($folders->count() > 0); + } + + public function testOpenFolder(): void { + $client = $this->getClient()->connect(); + + $status = $client->openFolder("INBOX"); + self::assertTrue(isset($status["flags"]) && count($status["flags"]) > 0); + self::assertTrue(($status["uidnext"] ?? 0) > 0); + self::assertTrue(($status["uidvalidity"] ?? 0) > 0); + self::assertTrue(($status["recent"] ?? -1) >= 0); + self::assertTrue(($status["exists"] ?? -1) >= 0); + } + + public function testCreateFolder(): void { + $client = $this->getClient()->connect(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', $this->getSpecialChars()]); + + $folder = $client->getFolder($folder_path); + + $this->deleteFolder($folder); + + $folder = $client->createFolder($folder_path, false); + self::assertInstanceOf(Folder::class, $folder); + + $folder = $this->getFolder($folder_path); + self::assertInstanceOf(Folder::class, $folder); + + $this->assertEquals($this->getSpecialChars(), $folder->name); + $this->assertEquals($folder_path, $folder->full_name); + + $folder_path = implode($delimiter, ['INBOX', EncodingAliases::convert($this->getSpecialChars(), "utf-8", "utf7-imap")]); + $this->assertEquals($folder_path, $folder->path); + + // Clean up + if ($this->deleteFolder($folder) === false) { + $this->fail("Could not delete folder: " . $folder->path); + } + } + + public function testCheckFolder(): void { + $client = $this->getClient()->connect(); + + $status = $client->checkFolder("INBOX"); + self::assertTrue(isset($status["flags"]) && count($status["flags"]) > 0); + self::assertTrue(($status["uidnext"] ?? 0) > 0); + self::assertTrue(($status["uidvalidity"] ?? 0) > 0); + self::assertTrue(($status["recent"] ?? -1) >= 0); + self::assertTrue(($status["exists"] ?? -1) >= 0); + } + + public function testGetFolderPath(): void { + $client = $this->getClient()->connect(); + + self::assertIsArray($client->openFolder("INBOX")); + self::assertEquals("INBOX", $client->getFolderPath()); + } + + public function testId(): void { + $client = $this->getClient()->connect(); + + $info = $client->Id(); + self::assertIsArray($info); + $valid = false; + foreach ($info as $value) { + if (str_starts_with($value, "OK")) { + $valid = true; + break; + } + } + self::assertTrue($valid); + } + + public function testGetQuotaRoot(): void { + if (!getenv("LIVE_MAILBOX_QUOTA_SUPPORT")) { + $this->markTestSkipped("Quota support is not enabled"); + } + + $client = $this->getClient()->connect(); + + $quota = $client->getQuotaRoot("INBOX"); + self::assertIsArray($quota); + self::assertTrue(count($quota) > 1); + self::assertIsArray($quota[0]); + self::assertEquals("INBOX", $quota[0][1]); + self::assertIsArray($quota[1]); + self::assertIsArray($quota[1][2]); + self::assertTrue($quota[1][2][2] > 0); + } + + public function testSetTimeout(): void { + $client = $this->getClient()->connect(); + + self::assertInstanceOf(ProtocolInterface::class, $client->setTimeout(57)); + self::assertEquals(57, $client->getTimeout()); + } + + public function testExpunge(): void { + $client = $this->getClient()->connect(); + + $client->openFolder("INBOX"); + $status = $client->expunge(); + + self::assertIsArray($status); + self::assertIsArray($status[0]); + self::assertEquals("OK", $status[0][0]); + } + + public function testGetDefaultMessageMask(): void { + $client = $this->getClient(); + + self::assertEquals(MessageMask::class, $client->getDefaultMessageMask()); + } + + public function testGetDefaultEvents(): void { + $client = $this->getClient(); + + self::assertIsArray($client->getDefaultEvents("message")); + } + + public function testSetDefaultMessageMask(): void { + $client = $this->getClient(); + + self::assertInstanceOf(Client::class, $client->setDefaultMessageMask(AttachmentMask::class)); + self::assertEquals(AttachmentMask::class, $client->getDefaultMessageMask()); + + $client->setDefaultMessageMask(MessageMask::class); + } + + public function testGetDefaultAttachmentMask(): void { + $client = $this->getClient(); + + self::assertEquals(AttachmentMask::class, $client->getDefaultAttachmentMask()); + } + + public function testSetDefaultAttachmentMask(): void { + $client = $this->getClient(); + + self::assertInstanceOf(Client::class, $client->setDefaultAttachmentMask(MessageMask::class)); + self::assertEquals(MessageMask::class, $client->getDefaultAttachmentMask()); + + $client->setDefaultAttachmentMask(AttachmentMask::class); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/live/FolderTest.php b/plugins/vendor/webklex/php-imap/tests/live/FolderTest.php new file mode 100644 index 00000000..178329cf --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/FolderTest.php @@ -0,0 +1,447 @@ +getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + self::assertInstanceOf(WhereQuery::class, $folder->query()); + self::assertInstanceOf(WhereQuery::class, $folder->search()); + self::assertInstanceOf(WhereQuery::class, $folder->messages()); + } + + /** + * Test Folder::hasChildren() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws EventNotFoundException + */ + public function testHasChildren(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $child_path = implode($delimiter, ['INBOX', 'test']); + if ($folder->getClient()->getFolder($child_path) === null) { + $folder->getClient()->createFolder($child_path, false); + $folder = $this->getFolder('INBOX'); + } + + self::assertTrue($folder->hasChildren()); + } + + /** + * Test Folder::setChildren() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetChildren(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $child_path = implode($delimiter, ['INBOX', 'test']); + if ($folder->getClient()->getFolder($child_path) === null) { + $folder->getClient()->createFolder($child_path, false); + $folder = $this->getFolder('INBOX'); + } + self::assertTrue($folder->hasChildren()); + + $folder->setChildren(new FolderCollection()); + self::assertTrue($folder->getChildren()->isEmpty()); + } + + /** + * Test Folder::getChildren() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetChildren(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $child_path = implode($delimiter, ['INBOX', 'test']); + if ($folder->getClient()->getFolder($child_path) === null) { + $folder->getClient()->createFolder($child_path, false); + } + + $folder = $folder->getClient()->getFolders()->where('name', 'INBOX')->first(); + self::assertInstanceOf(Folder::class, $folder); + + self::assertTrue($folder->hasChildren()); + self::assertFalse($folder->getChildren()->isEmpty()); + } + + /** + * Test Folder::move() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testMove(): void { + $client = $this->getClient(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'test']); + + $folder = $client->getFolder($folder_path); + if ($folder === null) { + $folder = $client->createFolder($folder_path, false); + } + $new_folder_path = implode($delimiter, ['INBOX', 'other']); + $new_folder = $client->getFolder($new_folder_path); + $new_folder?->delete(false); + + $status = $folder->move($new_folder_path, false); + self::assertIsArray($status); + self::assertTrue(str_starts_with($status[0], 'OK')); + + $new_folder = $client->getFolder($new_folder_path); + self::assertEquals($new_folder_path, $new_folder->path); + self::assertEquals('other', $new_folder->name); + + if ($this->deleteFolder($new_folder) === false) { + $this->fail("Could not delete folder: " . $new_folder->path); + } + } + + /** + * Test Folder::delete() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testDelete(): void { + $client = $this->getClient(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'test']); + + $folder = $client->getFolder($folder_path); + if ($folder === null) { + $folder = $client->createFolder($folder_path, false); + } + self::assertInstanceOf(Folder::class, $folder); + + if ($this->deleteFolder($folder) === false) { + $this->fail("Could not delete folder: " . $folder->path); + } + } + + /** + * Test Folder::overview() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + */ + public function testOverview(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $folder->select(); + + // Test empty overview + $overview = $folder->overview(); + self::assertIsArray($overview); + self::assertCount(0, $overview); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + + $overview = $folder->overview(); + + self::assertIsArray($overview); + self::assertCount(1, $overview); + + self::assertEquals($message->from->first()->full, end($overview)["from"]->toString()); + + self::assertTrue($message->delete()); + } + + /** + * Test Folder::appendMessage() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testAppendMessage(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals("Example", $message->subject); + self::assertEquals("to@someone-else.com", $message->to); + self::assertEquals("from@someone.com", $message->from); + + // Clean up + $this->assertTrue($message->delete(true)); + } + + /** + * Test Folder::subscribe() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSubscribe(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $status = $folder->subscribe(); + self::assertIsArray($status); + self::assertTrue(str_starts_with($status[0], 'OK')); + + // Clean up + $folder->unsubscribe(); + } + + /** + * Test Folder::unsubscribe() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testUnsubscribe(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $folder->subscribe(); + + $status = $folder->subscribe(); + self::assertIsArray($status); + self::assertTrue(str_starts_with($status[0], 'OK')); + } + + /** + * Test Folder::status() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testStatus(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $status = $folder->status(); + self::assertEquals(0, $status['messages']); + self::assertEquals(0, $status['recent']); + self::assertEquals(0, $status['unseen']); + self::assertGreaterThan(0, $status['uidnext']); + self::assertGreaterThan(0, $status['uidvalidity']); + } + + /** + * Test Folder::examine() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testExamine(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $status = $folder->examine(); + self::assertTrue(isset($status["flags"]) && count($status["flags"]) > 0); + self::assertTrue(($status["uidnext"] ?? 0) > 0); + self::assertTrue(($status["uidvalidity"] ?? 0) > 0); + self::assertTrue(($status["recent"] ?? -1) >= 0); + self::assertTrue(($status["exists"] ?? -1) >= 0); + } + + /** + * Test Folder::getClient() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetClient(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + self::assertInstanceOf(Client::class, $folder->getClient()); + } + + /** + * Test Folder::setDelimiter() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetDelimiter(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $folder->setDelimiter("/"); + self::assertEquals("/", $folder->delimiter); + + $folder->setDelimiter("."); + self::assertEquals(".", $folder->delimiter); + + $default_delimiter = $this->getManager()->getConfig()->get("options.delimiter", "/"); + $folder->setDelimiter(null); + self::assertEquals($default_delimiter, $folder->delimiter); + } + +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/live/LegacyTest.php b/plugins/vendor/webklex/php-imap/tests/live/LegacyTest.php new file mode 100644 index 00000000..3e385eb0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/LegacyTest.php @@ -0,0 +1,475 @@ +markTestSkipped("This test requires a live mailbox. Please set the LIVE_MAILBOX environment variable to run this test."); + } + + parent::__construct($name, $data, $dataName); + $manager = new ClientManager([ + 'options' => [ + "debug" => $_ENV["LIVE_MAILBOX_DEBUG"] ?? false, + ], + 'accounts' => [ + 'legacy' => [ + 'host' => getenv("LIVE_MAILBOX_HOST"), + 'port' => getenv("LIVE_MAILBOX_PORT"), + 'encryption' => getenv("LIVE_MAILBOX_ENCRYPTION"), + 'validate_cert' => getenv("LIVE_MAILBOX_VALIDATE_CERT"), + 'username' => getenv("LIVE_MAILBOX_USERNAME"), + 'password' => getenv("LIVE_MAILBOX_PASSWORD"), + 'protocol' => 'legacy-imap', + ], + ], + ]); + self::$client = $manager->account('legacy'); + self::$client->connect(); + self::assertInstanceOf(Client::class, self::$client->connect()); + } + + /** + * @throws RuntimeException + * @throws MessageFlagException + * @throws MessageContentFetchingException + * @throws ResponseException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ConnectionFailedException + * @throws InvalidMessageDateException + * @throws AuthFailedException + * @throws MessageHeaderFetchingException + */ + public function testSizes(): void { + + $delimiter = self::$client->getConfig()->get("options.delimiter"); + $child_path = implode($delimiter, ['INBOX', 'test']); + if (self::$client->getFolder($child_path) === null) { + self::$client->createFolder($child_path, false); + } + $folder = $this->getFolder($child_path); + + self::assertInstanceOf(Folder::class, $folder); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals(214, $message->size); + self::assertEquals(214, self::$client->getConnection()->sizes($message->uid)->array()[$message->uid]); + } + + /** + * Try to create a new query instance + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testQuery(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + self::assertInstanceOf(WhereQuery::class, $folder->query()); + self::assertInstanceOf(WhereQuery::class, $folder->search()); + self::assertInstanceOf(WhereQuery::class, $folder->messages()); + } + + /** + * Get a folder + * @param string $folder_path + * + * @return Folder + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws FolderFetchingException + */ + final protected function getFolder(string $folder_path = "INDEX"): Folder { + $folder = self::$client->getFolderByPath($folder_path); + self::assertInstanceOf(Folder::class, $folder); + + return $folder; + } + + + /** + * Append a message to a folder + * @param Folder $folder + * @param string $message + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function appendMessage(Folder $folder, string $message): Message { + $status = $folder->select(); + if (!isset($status['uidnext'])) { + $this->fail("No UIDNEXT returned"); + } + + $response = $folder->appendMessage($message); + $valid_response = false; + foreach ($response as $line) { + if (str_starts_with($line, 'OK')) { + $valid_response = true; + break; + } + } + if (!$valid_response) { + $this->fail("Failed to append message: ".implode("\n", $response)); + } + + $message = $folder->messages()->getMessageByUid($status['uidnext']); + self::assertInstanceOf(Message::class, $message); + + return $message; + } + + /** + * Append a message template to a folder + * @param Folder $folder + * @param string $template + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function appendMessageTemplate(Folder $folder, string $template): Message { + $content = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", $template])); + return $this->appendMessage($folder, $content); + } + + /** + * Delete a folder if it is given + * @param Folder|null $folder + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function deleteFolder(?Folder $folder = null): bool { + $response = $folder?->delete(false); + if (is_array($response)) { + $valid_response = false; + foreach ($response as $line) { + if (str_starts_with($line, 'OK')) { + $valid_response = true; + break; + } + } + if (!$valid_response) { + $this->fail("Failed to delete mailbox: ".implode("\n", $response)); + } + return $valid_response; + } + return false; + } + + /** + * Try to create a new query instance with a where clause + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + * @throws GetMessagesFailedException + * @throws InvalidWhereQueryCriteriaException + * @throws MessageSearchValidationException + */ + public function testQueryWhere(): void { + $delimiter = self::$client->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'search']); + + $folder = self::$client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = self::$client->createFolder($folder_path, false); + + $messages = [ + $this->appendMessageTemplate($folder, '1366671050@github.com.eml'), + $this->appendMessageTemplate($folder, 'attachment_encoded_filename.eml'), + $this->appendMessageTemplate($folder, 'attachment_long_filename.eml'), + $this->appendMessageTemplate($folder, 'attachment_no_disposition.eml'), + $this->appendMessageTemplate($folder, 'bcc.eml'), + $this->appendMessageTemplate($folder, 'boolean_decoded_content.eml'), + $this->appendMessageTemplate($folder, 'email_address.eml'), + $this->appendMessageTemplate($folder, 'embedded_email.eml'), + $this->appendMessageTemplate($folder, 'embedded_email_without_content_disposition.eml'), + $this->appendMessageTemplate($folder, 'embedded_email_without_content_disposition-embedded.eml'), + $this->appendMessageTemplate($folder, 'example_attachment.eml'), + $this->appendMessageTemplate($folder, 'example_bounce.eml'), + $this->appendMessageTemplate($folder, 'four_nested_emails.eml'), + $this->appendMessageTemplate($folder, 'gbk_charset.eml'), + $this->appendMessageTemplate($folder, 'html_only.eml'), + $this->appendMessageTemplate($folder, 'imap_mime_header_decode_returns_false.eml'), + $this->appendMessageTemplate($folder, 'inline_attachment.eml'), + $this->appendMessageTemplate($folder, 'issue-275.eml'), + $this->appendMessageTemplate($folder, 'issue-275-2.eml'), + $this->appendMessageTemplate($folder, 'issue-348.eml'), + $this->appendMessageTemplate($folder, 'ks_c_5601-1987_headers.eml'), + $this->appendMessageTemplate($folder, 'mail_that_is_attachment.eml'), + $this->appendMessageTemplate($folder, 'missing_date.eml'), + $this->appendMessageTemplate($folder, 'missing_from.eml'), + $this->appendMessageTemplate($folder, 'mixed_filename.eml'), + $this->appendMessageTemplate($folder, 'multipart_without_body.eml'), + $this->appendMessageTemplate($folder, 'multiple_html_parts_and_attachments.eml'), + $this->appendMessageTemplate($folder, 'multiple_nested_attachments.eml'), + $this->appendMessageTemplate($folder, 'nestes_embedded_with_attachment.eml'), + $this->appendMessageTemplate($folder, 'null_content_charset.eml'), + $this->appendMessageTemplate($folder, 'pec.eml'), + $this->appendMessageTemplate($folder, 'plain.eml'), + $this->appendMessageTemplate($folder, 'plain_only.eml'), + $this->appendMessageTemplate($folder, 'plain_text_attachment.eml'), + $this->appendMessageTemplate($folder, 'references.eml'), + $this->appendMessageTemplate($folder, 'simple_multipart.eml'), + $this->appendMessageTemplate($folder, 'structured_with_attachment.eml'), + $this->appendMessageTemplate($folder, 'thread_my_topic.eml'), + $this->appendMessageTemplate($folder, 'thread_re_my_topic.eml'), + $this->appendMessageTemplate($folder, 'thread_unrelated.eml'), + $this->appendMessageTemplate($folder, 'undefined_charset_header.eml'), + $this->appendMessageTemplate($folder, 'undisclosed_recipients_minus.eml'), + $this->appendMessageTemplate($folder, 'undisclosed_recipients_space.eml'), + $this->appendMessageTemplate($folder, 'unknown_encoding.eml'), + $this->appendMessageTemplate($folder, 'without_charset_plain_only.eml'), + $this->appendMessageTemplate($folder, 'without_charset_simple_multipart.eml'), + ]; + + $folder->getClient()->expunge(); + + $query = $folder->query()->all(); + self::assertEquals(count($messages), $query->count()); + + $query = $folder->query()->whereSubject("test"); + self::assertEquals(11, $query->count()); + + $query = $folder->query()->whereOn(Carbon::now()); + self::assertEquals(count($messages), $query->count()); + + self::assertTrue($this->deleteFolder($folder)); + } + + /** + * Test query where criteria + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testQueryWhereCriteria(): void { + self::$client->reconnect(); + + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $this->assertWhereSearchCriteria($folder, 'SUBJECT', 'Test'); + $this->assertWhereSearchCriteria($folder, 'BODY', 'Test'); + $this->assertWhereSearchCriteria($folder, 'TEXT', 'Test'); + $this->assertWhereSearchCriteria($folder, 'KEYWORD', 'Test'); + $this->assertWhereSearchCriteria($folder, 'UNKEYWORD', 'Test'); + $this->assertWhereSearchCriteria($folder, 'FLAGGED', 'Seen'); + $this->assertWhereSearchCriteria($folder, 'UNFLAGGED', 'Seen'); + $this->assertHeaderSearchCriteria($folder, 'Message-ID', 'Seen'); + $this->assertHeaderSearchCriteria($folder, 'In-Reply-To', 'Seen'); + $this->assertWhereSearchCriteria($folder, 'BCC', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'CC', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'FROM', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'TO', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'UID', '1'); + $this->assertWhereSearchCriteria($folder, 'UID', '1,2'); + $this->assertWhereSearchCriteria($folder, 'ALL'); + $this->assertWhereSearchCriteria($folder, 'NEW'); + $this->assertWhereSearchCriteria($folder, 'OLD'); + $this->assertWhereSearchCriteria($folder, 'SEEN'); + $this->assertWhereSearchCriteria($folder, 'UNSEEN'); + $this->assertWhereSearchCriteria($folder, 'RECENT'); + $this->assertWhereSearchCriteria($folder, 'ANSWERED'); + $this->assertWhereSearchCriteria($folder, 'UNANSWERED'); + $this->assertWhereSearchCriteria($folder, 'DELETED'); + $this->assertWhereSearchCriteria($folder, 'UNDELETED'); + $this->assertHeaderSearchCriteria($folder, 'Content-Language','en_US'); + $this->assertWhereSearchCriteria($folder, 'CUSTOM X-Spam-Flag NO'); + $this->assertWhereSearchCriteria($folder, 'CUSTOM X-Spam-Flag YES'); + $this->assertWhereSearchCriteria($folder, 'NOT'); + $this->assertWhereSearchCriteria($folder, 'OR'); + $this->assertWhereSearchCriteria($folder, 'AND'); + $this->assertWhereSearchCriteria($folder, 'BEFORE', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'BEFORE', Carbon::now()->subDays(1), true); + $this->assertWhereSearchCriteria($folder, 'ON', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'ON', Carbon::now()->subDays(1), true); + $this->assertWhereSearchCriteria($folder, 'SINCE', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'SINCE', Carbon::now()->subDays(1), true); + } + + /** + * Assert where search criteria + * @param Folder $folder + * @param string $criteria + * @param string|Carbon|null $value + * @param bool $date + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws ResponseException + * @throws RuntimeException + */ + protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string|null $value = null, bool $date = false): void { + $query = $folder->query()->where($criteria, $value); + self::assertInstanceOf(WhereQuery::class, $query); + + $item = $query->getQuery()->first(); + $criteria = str_replace("CUSTOM ", "", $criteria); + $expected = $value === null ? [$criteria] : [$criteria, $value]; + if ($date === true && $value instanceof Carbon) { + $date_format = $folder->getClient()->getConfig()->get('date_format', 'd M y'); + $expected[1] = $value->format($date_format); + } + + self::assertIsArray($item); + self::assertIsString($item[0]); + if($value !== null) { + self::assertCount(2, $item); + self::assertIsString($item[1]); + }else{ + self::assertCount(1, $item); + } + self::assertSame($expected, $item); + } + + /** + * Assert header search criteria + * @param Folder $folder + * @param string $criteria + * @param mixed|null $value + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws ResponseException + * @throws RuntimeException + */ + protected function assertHeaderSearchCriteria(Folder $folder, string $criteria, mixed $value = null): void { + $query = $folder->query()->whereHeader($criteria, $value); + self::assertInstanceOf(WhereQuery::class, $query); + + $item = $query->getQuery()->first(); + + self::assertIsArray($item); + self::assertIsString($item[0]); + self::assertCount(1, $item); + self::assertSame(['HEADER '.$criteria.' '.$value], $item); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/live/LiveMailboxTestCase.php b/plugins/vendor/webklex/php-imap/tests/live/LiveMailboxTestCase.php new file mode 100644 index 00000000..d0f1b680 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/LiveMailboxTestCase.php @@ -0,0 +1,220 @@ +-@#[]_ß_б_π_€_✔_你_يد_Z_'; + + /** + * Client manager + * @var ClientManager $manager + */ + protected static ClientManager $manager; + + /** + * Get the client manager + * + * @return ClientManager + */ + final protected function getManager(): ClientManager { + if (!isset(self::$manager)) { + self::$manager = new ClientManager([ + 'options' => [ + "debug" => $_ENV["LIVE_MAILBOX_DEBUG"] ?? false, + ], + 'accounts' => [ + 'default' => [ + 'host' => getenv("LIVE_MAILBOX_HOST"), + 'port' => getenv("LIVE_MAILBOX_PORT"), + 'encryption' => getenv("LIVE_MAILBOX_ENCRYPTION"), + 'validate_cert' => getenv("LIVE_MAILBOX_VALIDATE_CERT"), + 'username' => getenv("LIVE_MAILBOX_USERNAME"), + 'password' => getenv("LIVE_MAILBOX_PASSWORD"), + 'protocol' => 'imap', //might also use imap, [pop3 or nntp (untested)] + ], + ], + ]); + } + return self::$manager; + } + + /** + * Get the client + * + * @return Client + * @throws MaskNotFoundException + */ + final protected function getClient(): Client { + if (!getenv("LIVE_MAILBOX") ?? false) { + $this->markTestSkipped("This test requires a live mailbox. Please set the LIVE_MAILBOX environment variable to run this test."); + } + return $this->getManager()->account('default'); + } + + /** + * Get special chars + * + * @return string + */ + final protected function getSpecialChars(): string { + return self::SPECIAL_CHARS; + } + + /** + * Get a folder + * @param string $folder_path + * + * @return Folder + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws FolderFetchingException + */ + final protected function getFolder(string $folder_path = "INDEX"): Folder { + $client = $this->getClient(); + self::assertInstanceOf(Client::class, $client->connect()); + + $folder = $client->getFolderByPath($folder_path); + self::assertInstanceOf(Folder::class, $folder); + + return $folder; + } + + /** + * Append a message to a folder + * @param Folder $folder + * @param string $message + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function appendMessage(Folder $folder, string $message): Message { + $status = $folder->select(); + if (!isset($status['uidnext'])) { + $this->fail("No UIDNEXT returned"); + } + + $response = $folder->appendMessage($message); + $valid_response = false; + foreach ($response as $line) { + if (str_starts_with($line, 'OK')) { + $valid_response = true; + break; + } + } + if (!$valid_response) { + $this->fail("Failed to append message: ".implode("\n", $response)); + } + + $message = $folder->messages()->getMessageByUid($status['uidnext']); + self::assertInstanceOf(Message::class, $message); + + return $message; + } + + /** + * Append a message template to a folder + * @param Folder $folder + * @param string $template + * + * @return Message + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function appendMessageTemplate(Folder $folder, string $template): Message { + $content = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", $template])); + return $this->appendMessage($folder, $content); + } + + /** + * Delete a folder if it is given + * @param Folder|null $folder + * + * @return bool + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws ResponseException + * @throws RuntimeException + */ + final protected function deleteFolder(?Folder $folder = null): bool { + $response = $folder?->delete(false); + if (is_array($response)) { + $valid_response = false; + foreach ($response as $line) { + if (str_starts_with($line, 'OK')) { + $valid_response = true; + break; + } + } + if (!$valid_response) { + $this->fail("Failed to delete mailbox: ".implode("\n", $response)); + } + return $valid_response; + } + return false; + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/live/MessageTest.php b/plugins/vendor/webklex/php-imap/tests/live/MessageTest.php new file mode 100644 index 00000000..841b125b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/MessageTest.php @@ -0,0 +1,2410 @@ +getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + self::assertInstanceOf(Message::class, $message); + + return $message; + } + + /** + * Test Message::convertEncoding() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + * @throws MessageNotFoundException + */ + public function testConvertEncoding(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("Entwürfe+", $message->getDecoder()->convertEncoding("Entw&APw-rfe+", "UTF7-IMAP", "UTF-8")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::thread() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws GetMessagesFailedException + */ + public function testThread(): void { + $client = $this->getClient(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'thread']); + + $folder = $client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = $client->createFolder($folder_path, false); + + $message1 = $this->appendMessageTemplate($folder, "thread_my_topic.eml"); + $message2 = $this->appendMessageTemplate($folder, "thread_re_my_topic.eml"); + $message3 = $this->appendMessageTemplate($folder, "thread_unrelated.eml"); + + $thread = $message1->thread($folder); + self::assertCount(2, $thread); + + $thread = $message2->thread($folder); + self::assertCount(2, $thread); + + $thread = $message3->thread($folder); + self::assertCount(1, $thread); + + // Cleanup + self::assertTrue($message1->delete()); + self::assertTrue($message2->delete()); + self::assertTrue($message3->delete()); + $client->expunge(); + + self::assertTrue($this->deleteFolder($folder)); + } + + /** + * Test Message::hasAttachments() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testHasAttachments(): void { + $message = $this->getDefaultMessage(); + self::assertFalse($message->hasAttachments()); + + $folder = $message->getFolder(); + self::assertInstanceOf(Folder::class, $folder); + self::assertTrue($message->delete()); + + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertInstanceOf(Message::class, $message); + self::assertTrue($message->hasAttachments()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFetchOptions() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFetchOptions(): void { + $message = $this->getDefaultMessage(); + self::assertEquals(IMAP::FT_PEEK, $message->getFetchOptions()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getMessageId() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetMessageId(): void { + $folder = $this->getFolder('INBOX'); + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals("d3a5e91963cb805cee975687d5acb1c6@swift.generated", $message->getMessageId()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getReplyTo() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetReplyTo(): void { + $folder = $this->getFolder('INBOX'); + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals("testreply_to ", $message->getReplyTo()); + self::assertEquals("someone@domain.tld", $message->getReplyTo()->first()->mail); + self::assertEquals("testreply_to", $message->getReplyTo()->first()->personal); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setSequence() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetSequence(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + + $message->setSequence(IMAP::ST_MSGN); + self::assertEquals($message->msgn, $message->getSequenceId()); + + $message->setSequence(null); + self::assertEquals($message->uid, $message->getSequenceId()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getEvent() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetEvent(): void { + $message = $this->getDefaultMessage(); + + $message->setEvent("message", "test", "test"); + self::assertEquals("test", $message->getEvent("message", "test")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::__construct() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function test__construct(): void { + $message = $this->getDefaultMessage(); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFlag() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFlag(): void { + $message = $this->getDefaultMessage(); + + self::assertTrue($message->setFlag("seen")); + self::assertTrue($message->getFlags()->has("seen")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getMsgn() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetMsgn(): void { + $client = $this->getClient(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'test']); + + $folder = $client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = $client->createFolder($folder_path, false); + + $message = $this->appendMessageTemplate($folder, "plain.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals(1, $message->getMsgn()); + + // Cleanup + self::assertTrue($message->delete()); + self::assertTrue($this->deleteFolder($folder)); + } + + /** + * Test Message::peek() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testPeek(): void { + $message = $this->getDefaultMessage(); + self::assertFalse($message->getFlags()->has("seen")); + self::assertEquals(IMAP::FT_PEEK, $message->getFetchOptions()); + $message->peek(); + self::assertFalse($message->getFlags()->has("seen")); + + $message->setFetchOption(IMAP::FT_UID); + self::assertEquals(IMAP::FT_UID, $message->getFetchOptions()); + $message->peek(); + self::assertTrue($message->getFlags()->has("seen")); + + // Cleanup + self::assertTrue($message->delete()); + + } + + /** + * Test Message::unsetFlag() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testUnsetFlag(): void { + $message = $this->getDefaultMessage(); + + self::assertFalse($message->getFlags()->has("seen")); + + self::assertTrue($message->setFlag("seen")); + self::assertTrue($message->getFlags()->has("seen")); + + self::assertTrue($message->unsetFlag("seen")); + self::assertFalse($message->getFlags()->has("seen")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setSequenceId() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetSequenceId(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + + $original_sequence = $message->getSequenceId(); + + $message->setSequenceId(1, IMAP::ST_MSGN); + self::assertEquals(1, $message->getSequenceId()); + + $message->setSequenceId(1); + self::assertEquals(1, $message->getSequenceId()); + + $message->setSequenceId($original_sequence); + + // Cleanup + self::assertTrue($message->delete()); + + } + + /** + * Test Message::getTo() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetTo(): void { + $message = $this->getDefaultMessage(); + $folder = $message->getFolder(); + self::assertInstanceOf(Folder::class, $folder); + + self::assertEquals("to@someone-else.com", $message->getTo()); + self::assertTrue($message->delete()); + + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertInstanceOf(Message::class, $message); + + self::assertEquals("testnameto ", $message->getTo()); + self::assertEquals("testnameto", $message->getTo()->first()->personal); + self::assertEquals("someone@domain.tld", $message->getTo()->first()->mail); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setUid() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetUid(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + + $original_sequence = $message->getSequenceId(); + + $message->setUid(789); + self::assertEquals(789, $message->uid); + + $message->setUid($original_sequence); + + // Cleanup + self::assertTrue($message->delete()); + + } + + /** + * Test Message::getUid() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetUid(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + + $original_sequence = $message->uid; + + $message->setUid(789); + self::assertEquals(789, $message->uid); + self::assertEquals(789, $message->getUid()); + + $message->setUid($original_sequence); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::hasTextBody() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testHasTextBody(): void { + $message = $this->getDefaultMessage(); + self::assertTrue($message->hasTextBody()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::__get() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function test__get(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + self::assertEquals("Example", $message->subject); + self::assertEquals("to@someone-else.com", $message->to); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getDate() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetDate(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(Carbon::class, $message->getDate()->toDate()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setMask() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetMask(): void { + $message = $this->getDefaultMessage(); + self::assertEquals(MessageMask::class, $message->getMask()); + + $message->setMask(AttachmentMask::class); + self::assertEquals(AttachmentMask::class, $message->getMask()); + + $message->setMask(MessageMask::class); + self::assertEquals(MessageMask::class, $message->getMask()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getSequenceId() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetSequenceId(): void { + $message = $this->getDefaultMessage(); + self::assertEquals($message->uid, $message->getSequenceId()); + + $original_sequence = $message->getSequenceId(); + + $message->setSequenceId(789, IMAP::ST_MSGN); + self::assertEquals(789, $message->getSequenceId()); + + $message->setSequenceId(789); + self::assertEquals(789, $message->getSequenceId()); + + $message->setSequenceId($original_sequence); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setConfig() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetConfig(): void { + $message = $this->getDefaultMessage(); + + $options = $message->getOptions(); + self::assertIsArray($options); + + $message->setOptions(["foo" => "bar"]); + self::assertArrayHasKey("foo", $message->getOptions()); + + $message->setOptions($options); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getEvents() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetEvents(): void { + $message = $this->getDefaultMessage(); + + $events = $message->getEvents(); + self::assertIsArray($events); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFetchOption() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFetchOption(): void { + $message = $this->getDefaultMessage(); + + $fetch_option = $message->fetch_options; + + $message->setFetchOption(IMAP::FT_UID); + self::assertEquals(IMAP::FT_UID, $message->fetch_options); + + $message->setFetchOption(IMAP::FT_PEEK); + self::assertEquals(IMAP::FT_PEEK, $message->fetch_options); + + $message->setFetchOption(IMAP::FT_UID | IMAP::FT_PEEK); + self::assertEquals(IMAP::FT_UID | IMAP::FT_PEEK, $message->fetch_options); + + $message->setFetchOption($fetch_option); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getMsglist() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetMsglist(): void { + $message = $this->getDefaultMessage(); + + self::assertEquals(0, (int)$message->getMsglist()->toString()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::decodeString() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testDecodeString(): void { + $message = $this->getDefaultMessage(); + + $string = '

Test

'; + self::assertEquals('

Test

', $message->getDecoder()->decode($string, IMAP::MESSAGE_ENC_QUOTED_PRINTABLE)); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::attachments() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testAttachments(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertTrue($message->hasAttachments()); + self::assertSameSize([1], $message->attachments()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getMask() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetMask(): void { + $message = $this->getDefaultMessage(); + self::assertEquals(MessageMask::class, $message->getMask()); + + $message->setMask(AttachmentMask::class); + self::assertEquals(AttachmentMask::class, $message->getMask()); + + $message->setMask(MessageMask::class); + self::assertEquals(MessageMask::class, $message->getMask()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::hasHTMLBody() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testHasHTMLBody(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "1366671050@github.com.eml"); + self::assertTrue($message->hasHTMLBody()); + + // Cleanup + self::assertTrue($message->delete()); + + $message = $this->getDefaultMessage(); + self::assertFalse($message->hasHTMLBody()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setEvents() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetEvents(): void { + $message = $this->getDefaultMessage(); + + $events = $message->getEvents(); + self::assertIsArray($events); + + $message->setEvents(["foo" => "bar"]); + self::assertArrayHasKey("foo", $message->getEvents()); + + $message->setEvents($events); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::__set() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function test__set(): void { + $message = $this->getDefaultMessage(); + + $message->foo = "bar"; + self::assertEquals("bar", $message->getFoo()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getHTMLBody() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetHTMLBody(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "1366671050@github.com.eml"); + self::assertTrue($message->hasHTMLBody()); + self::assertIsString($message->getHTMLBody()); + + // Cleanup + self::assertTrue($message->delete()); + + $message = $this->getDefaultMessage(); + self::assertFalse($message->hasHTMLBody()); + self::assertEmpty($message->getHTMLBody()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getSequence() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetSequence(): void { + $message = $this->getDefaultMessage(); + self::assertEquals(IMAP::ST_UID, $message->getSequence()); + + $original_sequence = $message->getSequence(); + + $message->setSequence(IMAP::ST_MSGN); + self::assertEquals(IMAP::ST_MSGN, $message->getSequence()); + + $message->setSequence($original_sequence); + self::assertEquals(IMAP::ST_UID, $message->getSequence()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::restore() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testRestore(): void { + $message = $this->getDefaultMessage(); + + $message->setFlag("deleted"); + self::assertTrue($message->hasFlag("deleted")); + + $message->restore(); + self::assertFalse($message->hasFlag("deleted")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getPriority() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetPriority(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertEquals(1, $message->getPriority()->first()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setAttachments() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetAttachments(): void { + $message = $this->getDefaultMessage(); + + $message->setAttachments(new AttachmentCollection(["foo" => "bar"])); + self::assertIsArray($message->attachments()->toArray()); + self::assertTrue($message->attachments()->has("foo")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFrom() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFrom(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("from@someone.com", $message->getFrom()->first()->mail); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setEvent() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetEvent(): void { + $message = $this->getDefaultMessage(); + + $message->setEvent("message", "bar", "foo"); + self::assertArrayHasKey("bar", $message->getEvents()["message"]); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getInReplyTo() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetInReplyTo(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("", $message->getInReplyTo()); + + // Cleanup + self::assertTrue($message->delete()); + + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "1366671050@github.com.eml"); + self::assertEquals("Webklex/php-imap/issues/349@github.com", $message->getInReplyTo()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::copy() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testCopy(): void { + $message = $this->getDefaultMessage(); + $client = $message->getClient(); + self::assertInstanceOf(Client::class, $client); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'test']); + + $folder = $client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = $client->createFolder($folder_path, false); + self::assertInstanceOf(Folder::class, $folder); + + $new_message = $message->copy($folder->path, true); + self::assertInstanceOf(Message::class, $new_message); + self::assertEquals($folder->path, $new_message->getFolder()->path); + + // Cleanup + self::assertTrue($message->delete()); + self::assertTrue($new_message->delete()); + + } + + /** + * Test Message::getBodies() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetBodies(): void { + $message = $this->getDefaultMessage(); + self::assertIsArray($message->getBodies()); + self::assertCount(1, $message->getBodies()); + + // Cleanup + self::assertTrue($message->delete()); + + } + + /** + * Test Message::getFlags() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFlags(): void { + $message = $this->getDefaultMessage(); + self::assertIsArray($message->getFlags()->all()); + + self::assertFalse($message->hasFlag("seen")); + + self::assertTrue($message->setFlag("seen")); + self::assertTrue($message->getFlags()->has("seen")); + self::assertTrue($message->hasFlag("seen")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::addFlag() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testAddFlag(): void { + $message = $this->getDefaultMessage(); + self::assertFalse($message->hasFlag("seen")); + + self::assertTrue($message->addFlag("seen")); + self::assertTrue($message->hasFlag("seen")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getSubject() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetSubject(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("Example", $message->getSubject()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getClient() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetClient(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(Client::class, $message->getClient()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFetchFlagsOption() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFetchFlagsOption(): void { + $message = $this->getDefaultMessage(); + + self::assertTrue($message->getFetchFlagsOption()); + $message->setFetchFlagsOption(false); + self::assertFalse($message->getFetchFlagsOption()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::mask() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testMask(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(MessageMask::class, $message->mask()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setMsglist() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetMsglist(): void { + $message = $this->getDefaultMessage(); + $message->setMsglist("foo"); + self::assertEquals("foo", $message->getMsglist()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::flags() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testFlags(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(FlagCollection::class, $message->flags()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getAttributes() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetAttributes(): void { + $message = $this->getDefaultMessage(); + self::assertIsArray($message->getAttributes()); + self::assertArrayHasKey("subject", $message->getAttributes()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getAttachments() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetAttachments(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(AttachmentCollection::class, $message->getAttachments()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getRawBody() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetRawBody(): void { + $message = $this->getDefaultMessage(); + self::assertIsString($message->getRawBody()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::is() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testIs(): void { + $message = $this->getDefaultMessage(); + self::assertTrue($message->is($message)); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFlags() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFlags(): void { + $message = $this->getDefaultMessage(); + $message->setFlags(new FlagCollection()); + self::assertFalse($message->hasFlag("recent")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::make() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws ResponseException + * @throws RuntimeException + * @throws ReflectionException + */ + public function testMake(): void { + $folder = $this->getFolder('INBOX'); + $folder->getClient()->openFolder($folder->path); + + $email = file_get_contents(implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "1366671050@github.com.eml"])); + if(!str_contains($email, "\r\n")){ + $email = str_replace("\n", "\r\n", $email); + } + + $raw_header = substr($email, 0, strpos($email, "\r\n\r\n")); + $raw_body = substr($email, strlen($raw_header)+8); + + $message = Message::make(0, null, $folder->getClient(), $raw_header, $raw_body, [0 => "\\Seen"], IMAP::ST_UID); + self::assertInstanceOf(Message::class, $message); + } + + /** + * Test Message::setAvailableFlags() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetAvailableFlags(): void { + $message = $this->getDefaultMessage(); + + $message->setAvailableFlags(["foo"]); + self::assertSameSize(["foo"], $message->getAvailableFlags()); + self::assertEquals("foo", $message->getAvailableFlags()[0]); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getSender() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetSender(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "example_attachment.eml"); + self::assertEquals("testsender ", $message->getSender()); + self::assertEquals("testsender", $message->getSender()->first()->personal); + self::assertEquals("someone@domain.tld", $message->getSender()->first()->mail); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::fromFile() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws ReflectionException + * @throws ResponseException + * @throws RuntimeException + */ + public function testFromFile(): void { + $this->getManager(); + $filename = implode(DIRECTORY_SEPARATOR, [__DIR__, "..", "messages", "1366671050@github.com.eml"]); + $message = Message::fromFile($filename); + self::assertInstanceOf(Message::class, $message); + } + + /** + * Test Message::getStructure() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetStructure(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(Structure::class, $message->getStructure()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::get() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + * @throws MessageSizeFetchingException + */ + public function testGet(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("Example", $message->get("subject")); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getSize() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetSize(): void { + $message = $this->getDefaultMessage(); + self::assertEquals(214, $message->getSize()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getHeader() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetHeader(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(Header::class, $message->getHeader()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getReferences() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetReferences(): void { + $folder = $this->getFolder('INBOX'); + + $message = $this->appendMessageTemplate($folder, "1366671050@github.com.eml"); + self::assertIsArray($message->getReferences()->all()); + self::assertEquals("Webklex/php-imap/issues/349@github.com", $message->getReferences()->first()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFolderPath() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFolderPath(): void { + $message = $this->getDefaultMessage(); + + $folder_path = $message->getFolderPath(); + + $message->setFolderPath("foo"); + self::assertEquals("foo", $message->getFolderPath()); + + $message->setFolderPath($folder_path); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getTextBody() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetTextBody(): void { + $message = $this->getDefaultMessage(); + self::assertIsString($message->getTextBody()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::move() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testMove(): void { + $message = $this->getDefaultMessage(); + $client = $message->getClient(); + self::assertInstanceOf(Client::class, $client); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'test']); + + $folder = $client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = $client->createFolder($folder_path, false); + self::assertInstanceOf(Folder::class, $folder); + + $message = $message->move($folder->path, true); + self::assertInstanceOf(Message::class, $message); + self::assertEquals($folder->path, $message->getFolder()->path); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFolderPath() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFolderPath(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("INBOX", $message->getFolderPath()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFolder() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFolder(): void { + $message = $this->getDefaultMessage(); + self::assertInstanceOf(Folder::class, $message->getFolder()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFetchBodyOption() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFetchBodyOption(): void { + $message = $this->getDefaultMessage(); + self::assertTrue($message->getFetchBodyOption()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setFetchBodyOption() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetFetchBodyOption(): void { + $message = $this->getDefaultMessage(); + + $message->setFetchBodyOption(false); + self::assertFalse($message->getFetchBodyOption()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::getFetchFlagsOption() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testGetFetchFlagsOption(): void { + $message = $this->getDefaultMessage(); + self::assertTrue($message->getFetchFlagsOption()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::__call() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function test__call(): void { + $message = $this->getDefaultMessage(); + self::assertEquals("Example", $message->getSubject()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setClient() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetClient(): void { + $message = $this->getDefaultMessage(); + $client = $message->getClient(); + self::assertInstanceOf(Client::class, $client); + + $message->setClient(null); + self::assertNull($message->getClient()); + + $message->setClient($client); + self::assertInstanceOf(Client::class, $message->getClient()); + + // Cleanup + self::assertTrue($message->delete()); + } + + /** + * Test Message::setMsgn() + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws MessageNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testSetMsgn(): void { + $message = $this->getDefaultMessage(); + + $uid = $message->getUid(); + $message->setMsgn(789); + self::assertEquals(789, $message->getMsgn()); + $message->setUid($uid); + + // Cleanup + self::assertTrue($message->delete()); + } +} diff --git a/plugins/vendor/webklex/php-imap/tests/live/QueryTest.php b/plugins/vendor/webklex/php-imap/tests/live/QueryTest.php new file mode 100644 index 00000000..194d804e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/live/QueryTest.php @@ -0,0 +1,283 @@ +getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + self::assertInstanceOf(WhereQuery::class, $folder->query()); + self::assertInstanceOf(WhereQuery::class, $folder->search()); + self::assertInstanceOf(WhereQuery::class, $folder->messages()); + } + + /** + * Try to create a new query instance with a where clause + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws EventNotFoundException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidMessageDateException + * @throws MaskNotFoundException + * @throws MessageContentFetchingException + * @throws MessageFlagException + * @throws MessageHeaderFetchingException + * @throws ResponseException + * @throws RuntimeException + * @throws GetMessagesFailedException + * @throws InvalidWhereQueryCriteriaException + * @throws MessageSearchValidationException + */ + public function testQueryWhere(): void { + $client = $this->getClient(); + + $delimiter = $this->getManager()->getConfig()->get("options.delimiter"); + $folder_path = implode($delimiter, ['INBOX', 'search']); + + $folder = $client->getFolder($folder_path); + if ($folder !== null) { + self::assertTrue($this->deleteFolder($folder)); + } + $folder = $client->createFolder($folder_path, false); + + $messages = [ + $this->appendMessageTemplate($folder, '1366671050@github.com.eml'), + $this->appendMessageTemplate($folder, 'attachment_encoded_filename.eml'), + $this->appendMessageTemplate($folder, 'attachment_long_filename.eml'), + $this->appendMessageTemplate($folder, 'attachment_no_disposition.eml'), + $this->appendMessageTemplate($folder, 'bcc.eml'), + $this->appendMessageTemplate($folder, 'boolean_decoded_content.eml'), + $this->appendMessageTemplate($folder, 'email_address.eml'), + $this->appendMessageTemplate($folder, 'embedded_email.eml'), + $this->appendMessageTemplate($folder, 'embedded_email_without_content_disposition.eml'), + $this->appendMessageTemplate($folder, 'embedded_email_without_content_disposition-embedded.eml'), + $this->appendMessageTemplate($folder, 'example_attachment.eml'), + $this->appendMessageTemplate($folder, 'example_bounce.eml'), + $this->appendMessageTemplate($folder, 'four_nested_emails.eml'), + $this->appendMessageTemplate($folder, 'gbk_charset.eml'), + $this->appendMessageTemplate($folder, 'html_only.eml'), + $this->appendMessageTemplate($folder, 'imap_mime_header_decode_returns_false.eml'), + $this->appendMessageTemplate($folder, 'inline_attachment.eml'), + $this->appendMessageTemplate($folder, 'issue-275.eml'), + $this->appendMessageTemplate($folder, 'issue-275-2.eml'), + $this->appendMessageTemplate($folder, 'issue-348.eml'), + $this->appendMessageTemplate($folder, 'ks_c_5601-1987_headers.eml'), + $this->appendMessageTemplate($folder, 'mail_that_is_attachment.eml'), + $this->appendMessageTemplate($folder, 'missing_date.eml'), + $this->appendMessageTemplate($folder, 'missing_from.eml'), + $this->appendMessageTemplate($folder, 'mixed_filename.eml'), + $this->appendMessageTemplate($folder, 'multipart_without_body.eml'), + $this->appendMessageTemplate($folder, 'multiple_html_parts_and_attachments.eml'), + $this->appendMessageTemplate($folder, 'multiple_nested_attachments.eml'), + $this->appendMessageTemplate($folder, 'nestes_embedded_with_attachment.eml'), + $this->appendMessageTemplate($folder, 'null_content_charset.eml'), + $this->appendMessageTemplate($folder, 'pec.eml'), + $this->appendMessageTemplate($folder, 'plain.eml'), + $this->appendMessageTemplate($folder, 'plain_only.eml'), + $this->appendMessageTemplate($folder, 'plain_text_attachment.eml'), + $this->appendMessageTemplate($folder, 'references.eml'), + $this->appendMessageTemplate($folder, 'simple_multipart.eml'), + $this->appendMessageTemplate($folder, 'structured_with_attachment.eml'), + $this->appendMessageTemplate($folder, 'thread_my_topic.eml'), + $this->appendMessageTemplate($folder, 'thread_re_my_topic.eml'), + $this->appendMessageTemplate($folder, 'thread_unrelated.eml'), + $this->appendMessageTemplate($folder, 'undefined_charset_header.eml'), + $this->appendMessageTemplate($folder, 'undisclosed_recipients_minus.eml'), + $this->appendMessageTemplate($folder, 'undisclosed_recipients_space.eml'), + $this->appendMessageTemplate($folder, 'unknown_encoding.eml'), + $this->appendMessageTemplate($folder, 'without_charset_plain_only.eml'), + $this->appendMessageTemplate($folder, 'without_charset_simple_multipart.eml'), + ]; + + $folder->getClient()->expunge(); + + $query = $folder->query()->all(); + self::assertEquals(count($messages), $query->count()); + + $query = $folder->query()->whereSubject("test"); + self::assertEquals(11, $query->count()); + + $query = $folder->query()->whereOn(Carbon::now()); + self::assertEquals(count($messages), $query->count()); + + self::assertTrue($this->deleteFolder($folder)); + } + + /** + * Test query where criteria + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws FolderFetchingException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws MaskNotFoundException + * @throws ResponseException + * @throws RuntimeException + */ + public function testQueryWhereCriteria(): void { + $folder = $this->getFolder('INBOX'); + self::assertInstanceOf(Folder::class, $folder); + + $this->assertWhereSearchCriteria($folder, 'SUBJECT', 'Test'); + $this->assertWhereSearchCriteria($folder, 'BODY', 'Test'); + $this->assertWhereSearchCriteria($folder, 'TEXT', 'Test'); + $this->assertWhereSearchCriteria($folder, 'KEYWORD', 'Test'); + $this->assertWhereSearchCriteria($folder, 'UNKEYWORD', 'Test'); + $this->assertWhereSearchCriteria($folder, 'FLAGGED', 'Seen'); + $this->assertWhereSearchCriteria($folder, 'UNFLAGGED', 'Seen'); + $this->assertHeaderSearchCriteria($folder, 'Message-ID', 'Seen'); + $this->assertHeaderSearchCriteria($folder, 'In-Reply-To', 'Seen'); + $this->assertWhereSearchCriteria($folder, 'BCC', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'CC', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'FROM', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'TO', 'test@example.com'); + $this->assertWhereSearchCriteria($folder, 'UID', '1'); + $this->assertWhereSearchCriteria($folder, 'UID', '1,2'); + $this->assertWhereSearchCriteria($folder, 'ALL'); + $this->assertWhereSearchCriteria($folder, 'NEW'); + $this->assertWhereSearchCriteria($folder, 'OLD'); + $this->assertWhereSearchCriteria($folder, 'SEEN'); + $this->assertWhereSearchCriteria($folder, 'UNSEEN'); + $this->assertWhereSearchCriteria($folder, 'RECENT'); + $this->assertWhereSearchCriteria($folder, 'ANSWERED'); + $this->assertWhereSearchCriteria($folder, 'UNANSWERED'); + $this->assertWhereSearchCriteria($folder, 'DELETED'); + $this->assertWhereSearchCriteria($folder, 'UNDELETED'); + $this->assertHeaderSearchCriteria($folder, 'Content-Language','en_US'); + $this->assertWhereSearchCriteria($folder, 'CUSTOM X-Spam-Flag NO'); + $this->assertWhereSearchCriteria($folder, 'CUSTOM X-Spam-Flag YES'); + $this->assertWhereSearchCriteria($folder, 'NOT'); + $this->assertWhereSearchCriteria($folder, 'OR'); + $this->assertWhereSearchCriteria($folder, 'AND'); + $this->assertWhereSearchCriteria($folder, 'BEFORE', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'BEFORE', Carbon::now()->subDays(1), true); + $this->assertWhereSearchCriteria($folder, 'ON', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'ON', Carbon::now()->subDays(1), true); + $this->assertWhereSearchCriteria($folder, 'SINCE', '01-Jan-2020', true); + $this->assertWhereSearchCriteria($folder, 'SINCE', Carbon::now()->subDays(1), true); + } + + /** + * Assert where search criteria + * @param Folder $folder + * @param string $criteria + * @param string|Carbon|null $value + * @param bool $date + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws ResponseException + * @throws RuntimeException + */ + protected function assertWhereSearchCriteria(Folder $folder, string $criteria, Carbon|string|null $value = null, bool $date = false): void { + $query = $folder->query()->where($criteria, $value); + self::assertInstanceOf(WhereQuery::class, $query); + + $item = $query->getQuery()->first(); + $criteria = str_replace("CUSTOM ", "", $criteria); + $expected = $value === null ? [$criteria] : [$criteria, $value]; + if ($date === true && $value instanceof Carbon) { + $date_format = $folder->getClient()->getConfig()->get('date_format', 'd M y'); + $expected[1] = $value->format($date_format); + } + + self::assertIsArray($item); + self::assertIsString($item[0]); + if($value !== null) { + self::assertCount(2, $item); + self::assertIsString($item[1]); + }else{ + self::assertCount(1, $item); + } + self::assertSame($expected, $item); + } + + /** + * Assert header search criteria + * @param Folder $folder + * @param string $criteria + * @param mixed|null $value + * + * @return void + * @throws AuthFailedException + * @throws ConnectionFailedException + * @throws ImapBadRequestException + * @throws ImapServerErrorException + * @throws InvalidWhereQueryCriteriaException + * @throws ResponseException + * @throws RuntimeException + */ + protected function assertHeaderSearchCriteria(Folder $folder, string $criteria, mixed $value = null): void { + $query = $folder->query()->whereHeader($criteria, $value); + self::assertInstanceOf(WhereQuery::class, $query); + + $item = $query->getQuery()->first(); + + self::assertIsArray($item); + self::assertIsString($item[0]); + self::assertCount(1, $item); + self::assertSame(['HEADER '.$criteria.' '.$value], $item); + } +} \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/1366671050@github.com.eml b/plugins/vendor/webklex/php-imap/tests/messages/1366671050@github.com.eml new file mode 100644 index 00000000..97cb7ad1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/1366671050@github.com.eml @@ -0,0 +1,108 @@ +Return-Path: +Delivered-To: someone@domain.tld +Received: from mx.domain.tld + by localhost with LMTP + id SABVMNfGqWP+PAAA0J78UA + (envelope-from ) + for ; Mon, 26 Dec 2022 17:07:51 +0100 +Received: from localhost (localhost [127.0.0.1]) + by mx.domain.tld (Postfix) with ESMTP id C3828140227 + for ; Mon, 26 Dec 2022 17:07:51 +0100 (CET) +X-Virus-Scanned: Debian amavisd-new at mx.domain.tld +X-Spam-Flag: NO +X-Spam-Score: -4.299 +X-Spam-Level: +X-Spam-Status: No, score=-4.299 required=6.31 tests=[BAYES_00=-1.9, + DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, + DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_IMAGE_ONLY_16=1.092, + HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, + RCVD_IN_MSPIKE_H2=-0.001, T_KAM_HTML_FONT_INVALID=0.01] + autolearn=ham autolearn_force=no +Received: from mx.domain.tld ([127.0.0.1]) + by localhost (mx.domain.tld [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id JcIS9RuNBTNx for ; + Mon, 26 Dec 2022 17:07:21 +0100 (CET) +Received: from smtp.github.com (out-26.smtp.github.com [192.30.252.209]) + (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) + (No client certificate requested) + by mx.domain.tld (Postfix) with ESMTPS id 6410B13FEB2 + for ; Mon, 26 Dec 2022 17:07:21 +0100 (CET) +Received: from github-lowworker-891b8d2.va3-iad.github.net (github-lowworker-891b8d2.va3-iad.github.net [10.48.109.104]) + by smtp.github.com (Postfix) with ESMTP id 176985E0200 + for ; Mon, 26 Dec 2022 08:07:14 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; + s=pf2014; t=1672070834; + bh=v91TPiLpM/cpUb4lgt2NMIUfM4HOIxCEWMR1+JTco+Q=; + h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:List-ID: + List-Archive:List-Post:List-Unsubscribe:From; + b=jW4Tac9IjWAPbEImyiYf1bzGLzY3ceohVbBg1V8BlpMTQ+o+yY3YB0eOe20hAsqZR + jrDjArx7rKQcslqBFL/b2B1C51rHuCBrz2cccLEERu9l/u0mTGCxTNtCRXHbCKbnR1 + VLWBeFLjATHth83kK6Kt7lkVuty+G3V1B6ZKPhCI= +Date: Mon, 26 Dec 2022 08:07:14 -0800 +From: Username +Reply-To: Webklex/php-imap +To: Webklex/php-imap +Cc: Subscribed +Message-ID: +In-Reply-To: +References: +Subject: Re: [Webklex/php-imap] Read all folders? (Issue #349) +Mime-Version: 1.0 +Content-Type: multipart/alternative; + boundary="--==_mimepart_63a9c6b293fe_65b5c71014155a"; + charset=UTF-8 +Content-Transfer-Encoding: 7bit +Precedence: list +X-GitHub-Sender: consigliere23 +X-GitHub-Recipient: Webklex +X-GitHub-Reason: subscribed +List-ID: Webklex/php-imap +List-Archive: https://github.com/Webklex/php-imap +List-Post: +List-Unsubscribe: , + +X-Auto-Response-Suppress: All +X-GitHub-Recipient-Address: someone@domain.tld + + +----==_mimepart_63a9c6b293fe_65b5c71014155a +Content-Type: text/plain; + charset=UTF-8 +Content-Transfer-Encoding: 7bit + +Any updates? + +-- +Reply to this email directly or view it on GitHub: +https://github.com/Webklex/php-imap/issues/349#issuecomment-1365266070 +You are receiving this because you are subscribed to this thread. + +Message ID: +----==_mimepart_63a9c6b293fe_65b5c71014155a +Content-Type: text/html; + charset=UTF-8 +Content-Transfer-Encoding: 7bit + +

+

Any updates?

+ +


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <Webklex/php-imap/issues/349/1365266070@github.com>

+ +----==_mimepart_63a9c6b293fe_65b5c71014155a-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/attachment_encoded_filename.eml b/plugins/vendor/webklex/php-imap/tests/messages/attachment_encoded_filename.eml new file mode 100644 index 00000000..231d0452 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/attachment_encoded_filename.eml @@ -0,0 +1,10 @@ +Content-Type: multipart/mixed; + boundary="BOUNDARY" + +--BOUNDARY +Content-Type: application/vnd.ms-excel; name="=?UTF-8?Q?Prost=C5=99eno=5F2014=5Fposledn=C3=AD_voln=C3=A9_term=C3=ADny.xls?="; charset="UTF-8" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="=?UTF-8?Q?Prost=C5=99eno=5F2014=5Fposledn=C3=AD_voln=C3=A9_term=C3=ADny.xls?=" + +0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAwgAAAAAA +AAAAEAAA/v///wAAAAD+////AAAAAMAAAADBAAAA//////////////////////////////// diff --git a/plugins/vendor/webklex/php-imap/tests/messages/attachment_long_filename.eml b/plugins/vendor/webklex/php-imap/tests/messages/attachment_long_filename.eml new file mode 100644 index 00000000..8630280f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/attachment_long_filename.eml @@ -0,0 +1,55 @@ +Content-Type: multipart/mixed; + boundary="BOUNDARY" + +--BOUNDARY +Content-Type: text/plain; + name*0*=utf-8''Buchungsbest%C3%A4tigung-%20Rechnung-Gesch%C3%A4ftsbedingung; + name*1*=en-Nr.B123-45%20-%20XXXX%20xxxxxxxxxxxxxxxxx%20XxxX%2C%20L%C3%BCd; + name*2*=xxxxxxxx%20-%20VM%20Klaus%20XXXXXX%20-%20xxxxxxxx.pdf +Content-Disposition: attachment; + filename*0*=utf-8''Buchungsbest%C3%A4tigung-%20Rechnung-Gesch%C3%A4ftsbedin; + filename*1*=gungen-Nr.B123-45%20-%20XXXXX%20xxxxxxxxxxxxxxxxx%20XxxX%2C; + filename*2*=%20L%C3%BCxxxxxxxxxx%20-%20VM%20Klaus%20XXXXXX%20-%20xxxxxxxx.p; + filename*3*=df +Content-Transfer-Encoding: base64 + +SGkh +--BOUNDARY +Content-Type: text/plain; charset=UTF-8; + name="=?UTF-8?B?MDFfQeKCrMOgw6TEhdCx2YrYr0BaLTAxMjM0NTY3ODktcXdlcnR5dWlv?= + =?UTF-8?Q?pasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzx?= + =?UTF-8?Q?cvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstu?= + =?UTF-8?Q?vz.txt?=" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename*0*=iso-8859-15''%30%31%5F%41%A4%E0%E4%3F%3F%3F%3F%40%5A%2D%30%31; + filename*1*=%32%33%34%35%36%37%38%39%2D%71%77%65%72%74%79%75%69%6F%70%61; + filename*2*=%73%64%66%67%68%6A%6B%6C%7A%78%63%76%62%6E%6D%6F%70%71%72%73; + filename*3*=%74%75%76%7A%2D%30%31%32%33%34%35%36%37%38%39%2D%71%77%65%72; + filename*4*=%74%79%75%69%6F%70%61%73%64%66%67%68%6A%6B%6C%7A%78%63%76%62; + filename*5*=%6E%6D%6F%70%71%72%73%74%75%76%7A%2D%30%31%32%33%34%35%36%37; + filename*6*=%38%39%2D%71%77%65%72%74%79%75%69%6F%70%61%73%64%66%67%68%6A; + filename*7*=%6B%6C%7A%78%63%76%62%6E%6D%6F%70%71%72%73%74%75%76%7A%2E%74; + filename*8*=%78%74 + +SGkh +--BOUNDARY +Content-Type: text/plain; charset=UTF-8; + name="=?UTF-8?B?MDJfQeKCrMOgw6TEhdCx2YrYr0BaLTAxMjM0NTY3ODktcXdlcnR5dWlv?= + =?UTF-8?Q?pasdfghjklzxcvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzx?= + =?UTF-8?Q?cvbnmopqrstuvz-0123456789-qwertyuiopasdfghjklzxcvbnmopqrstu?= + =?UTF-8?Q?vz.txt?=" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename*0*=UTF-8''%30%32%5F%41%E2%82%AC%C3%A0%C3%A4%C4%85%D0%B1%D9%8A%D8; + filename*1*=%AF%40%5A%2D%30%31%32%33%34%35%36%37%38%39%2D%71%77%65%72%74; + filename*2*=%79%75%69%6F%70%61%73%64%66%67%68%6A%6B%6C%7A%78%63%76%62%6E; + filename*3*=%6D%6F%70%71%72%73%74%75%76%7A%2D%30%31%32%33%34%35%36%37%38; + filename*4*=%39%2D%71%77%65%72%74%79%75%69%6F%70%61%73%64%66%67%68%6A%6B; + filename*5*=%6C%7A%78%63%76%62%6E%6D%6F%70%71%72%73%74%75%76%7A%2D%30%31; + filename*6*=%32%33%34%35%36%37%38%39%2D%71%77%65%72%74%79%75%69%6F%70%61; + filename*7*=%73%64%66%67%68%6A%6B%6C%7A%78%63%76%62%6E%6D%6F%70%71%72%73; + filename*8*=%74%75%76%7A%2E%74%78%74 + +SGkh +--BOUNDARY-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/attachment_no_disposition.eml b/plugins/vendor/webklex/php-imap/tests/messages/attachment_no_disposition.eml new file mode 100644 index 00000000..ce0ea3e9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/attachment_no_disposition.eml @@ -0,0 +1,9 @@ +Content-Type: multipart/mixed; + boundary="BOUNDARY" + +--BOUNDARY +Content-Type: application/vnd.ms-excel; name="=?UTF-8?Q?Prost=C5=99eno=5F2014=5Fposledn=C3=AD_voln=C3=A9_term=C3=ADny.xls?="; charset="UTF-8" +Content-Transfer-Encoding: base64 + +0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAACAAAAwgAAAAAA +AAAAEAAA/v///wAAAAD+////AAAAAMAAAADBAAAA//////////////////////////////// diff --git a/plugins/vendor/webklex/php-imap/tests/messages/bcc.eml b/plugins/vendor/webklex/php-imap/tests/messages/bcc.eml new file mode 100644 index 00000000..1a6f16a8 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/bcc.eml @@ -0,0 +1,12 @@ +Return-Path: +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +From: from@there.com +To: to@here.com +Bcc: =?UTF-8?B?QV/igqxAe8OoX1o=?= +Reply-To: reply-to@here.com +Sender: sender@here.com + +Hi! diff --git a/plugins/vendor/webklex/php-imap/tests/messages/boolean_decoded_content.eml b/plugins/vendor/webklex/php-imap/tests/messages/boolean_decoded_content.eml new file mode 100644 index 00000000..91818038 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/boolean_decoded_content.eml @@ -0,0 +1,31 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: multipart/mixed; boundary="=-vyqYb0SSRwuGFKv/Trdf" + +--=-vyqYb0SSRwuGFKv/Trdf +Content-Type: multipart/alternative; boundary="=-ewUvwipK68Y6itClYNpy" + +--=-ewUvwipK68Y6itClYNpy +Content-Type: text/plain; charset="us-ascii" + +Here is the problem mail + +Body text +--=-ewUvwipK68Y6itClYNpy +Content-Type: text/html; charset="us-ascii" + +Here is the problem mail + +Body text +--=-ewUvwipK68Y6itClYNpy-- + +--=-vyqYb0SSRwuGFKv/Trdf +Content-Type: application/pdf; name="Example Domain.pdf" +Content-Disposition: attachment; filename="Example Domain.pdf" +Content-Transfer-Encoding: base64 + +nnDusSNdG92w6Fuw61fMjAxOF8wMy0xMzMyNTMzMTkzLnBkZg==?= + +--=-vyqYb0SSRwuGFKv/Trdf-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/date-template.eml b/plugins/vendor/webklex/php-imap/tests/messages/date-template.eml new file mode 100644 index 00000000..9354fd10 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/date-template.eml @@ -0,0 +1,8 @@ +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: %date_raw_header% +From: from@there.com +To: to@here.com + +Hi! diff --git a/plugins/vendor/webklex/php-imap/tests/messages/email_address.eml b/plugins/vendor/webklex/php-imap/tests/messages/email_address.eml new file mode 100644 index 00000000..62b76d70 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/email_address.eml @@ -0,0 +1,9 @@ +Message-ID: <123@example.com> +From: no_host +Cc: "This one: is \"right\"" , No-address +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi +How are you? diff --git a/plugins/vendor/webklex/php-imap/tests/messages/embedded_email.eml b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email.eml new file mode 100644 index 00000000..293bc28e --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email.eml @@ -0,0 +1,63 @@ +Return-Path: demo@cerstor.cz +Received: from webmail.my-office.cz (localhost [127.0.0.1]) + by keira.cofis.cz + ; Fri, 29 Jan 2016 14:25:40 +0100 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="=_5d4b2de51e6aad0435b4bfbd7a23594a" +Date: Fri, 29 Jan 2016 14:25:40 +0100 +From: demo@cerstor.cz +To: demo@cerstor.cz +Subject: embedded message +Message-ID: <7e5798da5747415e5b82fdce042ab2a6@cerstor.cz> +X-Sender: demo@cerstor.cz +User-Agent: Roundcube Webmail/1.0.0 + +--=_5d4b2de51e6aad0435b4bfbd7a23594a +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; charset=US-ASCII; + format=flowed + +email that contains embedded message +--=_5d4b2de51e6aad0435b4bfbd7a23594a +Content-Transfer-Encoding: 8bit +Content-Type: message/rfc822; + name=demo.eml +Content-Disposition: attachment; + filename=demo.eml; + size=889 + +Return-Path: demo@cerstor.cz +Received: from webmail.my-office.cz (localhost [127.0.0.1]) + by keira.cofis.cz + ; Fri, 29 Jan 2016 14:22:13 +0100 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="=_995890bdbf8bd158f2cbae0e8d966000" +Date: Fri, 29 Jan 2016 14:22:13 +0100 +From: demo-from@cerstor.cz +To: demo-to@cerstor.cz +Subject: demo +Message-ID: <4cbaf57cb00891c53b32e1d63367740c@cerstor.cz> +X-Sender: demo@cerstor.cz +User-Agent: Roundcube Webmail/1.0.0 + +--=_995890bdbf8bd158f2cbae0e8d966000 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; charset=US-ASCII; + format=flowed + +demo text +--=_995890bdbf8bd158f2cbae0e8d966000 +Content-Transfer-Encoding: base64 +Content-Type: text/plain; + name=testfile.txt +Content-Disposition: attachment; + filename=testfile.txt; + size=29 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= +--=_995890bdbf8bd158f2cbae0e8d966000-- + + +--=_5d4b2de51e6aad0435b4bfbd7a23594a-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition-embedded.eml b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition-embedded.eml new file mode 100644 index 00000000..df5fa40b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition-embedded.eml @@ -0,0 +1,61 @@ +Received: from webmail.my-office.cz (localhost [127.0.0.1]) + by keira.cofis.cz + ; Fri, 29 Jan 2016 14:25:40 +0100 +From: demo@cerstor.cz +To: demo@cerstor.cz +Date: Fri, 5 Apr 2019 12:10:49 +0200 +Subject: embedded_message_subject +Message-ID: +Accept-Language: pl-PL, nl-NL +Content-Language: pl-PL +Content-Type: multipart/mixed; + boundary="_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_" +MIME-Version: 1.0 + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: multipart/alternative; + boundary="_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_" + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: text/plain; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + +some txt + + + + + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: text/html; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + + +

some txt

+ + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_-- + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="file1.xlsx" +Content-Description: file1.xlsx +Content-Disposition: attachment; filename="file1.xlsx"; size=29; + creation-date="Fri, 05 Apr 2019 10:06:01 GMT"; + modification-date="Fri, 05 Apr 2019 10:10:49 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="file2.xlsx" +Content-Description: file2 +Content-Disposition: attachment; filename="file2.xlsx"; size=29; + creation-date="Fri, 05 Apr 2019 10:10:19 GMT"; + modification-date="Wed, 03 Apr 2019 11:04:32 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition.eml b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition.eml new file mode 100644 index 00000000..c5c8cffe --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/embedded_email_without_content_disposition.eml @@ -0,0 +1,141 @@ +Return-Path: demo@cerstor.cz +Received: from webmail.my-office.cz (localhost [127.0.0.1]) + by keira.cofis.cz + ; Fri, 29 Jan 2016 14:25:40 +0100 +From: demo@cerstor.cz +To: demo@cerstor.cz +Date: Fri, 5 Apr 2019 13:48:50 +0200 +Subject: Subject +Message-ID: +Accept-Language: pl-PL, nl-NL +Content-Type: multipart/mixed; + boundary="_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_" +MIME-Version: 1.0 + +--_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: multipart/related; + boundary="_007_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_"; + type="multipart/alternative" + +--_007_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: multipart/alternative; + boundary="_000_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_" + +--_000_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: text/plain; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + +TexT + +[cid:file.jpg] + +--_000_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: text/html; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + +

TexT

= + +--_000_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_-- + +--_007_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: image/jpeg; name= + "file.jpg" +Content-Description: file.jpg +Content-Disposition: inline; filename= + "file.jpg"; + size=54558; creation-date="Fri, 05 Apr 2019 11:48:58 GMT"; + modification-date="Fri, 05 Apr 2019 11:48:58 GMT" +Content-ID: +Content-Transfer-Encoding: base64 + +iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg== + +--_007_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_-- + +--_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: message/rfc822 + +Received: from webmail.my-office.cz (localhost [127.0.0.1]) + by keira.cofis.cz + ; Fri, 29 Jan 2016 14:25:40 +0100 +From: demo@cerstor.cz +To: demo@cerstor.cz +Date: Fri, 5 Apr 2019 12:10:49 +0200 +Subject: embedded_message_subject +Message-ID: +Accept-Language: pl-PL, nl-NL +Content-Language: pl-PL +Content-Type: multipart/mixed; + boundary="_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_" +MIME-Version: 1.0 + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: multipart/alternative; + boundary="_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_" + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: text/plain; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + +some txt + + + + + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: text/html; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + + +

some txt

+ + +--_000_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_-- + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="file1.xlsx" +Content-Description: file1.xlsx +Content-Disposition: attachment; filename="file1.xlsx"; size=29; + creation-date="Fri, 05 Apr 2019 10:06:01 GMT"; + modification-date="Fri, 05 Apr 2019 10:10:49 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_ +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="file2.xlsx" +Content-Description: file2 +Content-Disposition: attachment; filename="file2.xlsx"; size=29; + creation-date="Fri, 05 Apr 2019 10:10:19 GMT"; + modification-date="Wed, 03 Apr 2019 11:04:32 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_005_AC39946EBF5C034B87BABD5343E96979012671D40E38VM002emonsn_-- + +--_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="file3.xlsx" +Content-Description: file3.xlsx +Content-Disposition: attachment; filename="file3.xlsx"; + size=90672; creation-date="Fri, 05 Apr 2019 11:46:30 GMT"; + modification-date="Thu, 28 Mar 2019 08:07:58 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_ +Content-Type: application/x-zip-compressed; name="file4.zip" +Content-Description: file4.zip +Content-Disposition: attachment; filename="file4.zip"; size=29; + creation-date="Fri, 05 Apr 2019 11:48:45 GMT"; + modification-date="Fri, 05 Apr 2019 11:35:24 GMT" +Content-Transfer-Encoding: base64 + +IHRoaXMgaXMgY29udGVudCBvZiB0ZXN0IGZpbGU= + +--_008_AC39946EBF5C034B87BABD5343E96979012671D9F7E4VM002emonsn_-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/example_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/example_attachment.eml new file mode 100644 index 00000000..3e929a34 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/example_attachment.eml @@ -0,0 +1,56 @@ +Return-Path: +Delivered-To: +Received: from mx.domain.tld + by localhost (Dovecot) with LMTP id T7mwLn3ddlvKWwAA0J78UA + for ; Fri, 17 Aug 2018 16:36:45 +0200 +Received: from localhost (localhost [127.0.0.1]) + by mx.domain.tld (Postfix) with ESMTP id B642913BA0BE2 + for ; Fri, 17 Aug 2018 16:36:45 +0200 (CEST) +X-Virus-Scanned: Debian amavisd-new at mx.domain.tld +X-Spam-Flag: NO +X-Spam-Score: 1.103 +X-Spam-Level: * +X-Spam-Status: No, score=1.103 required=6.31 tests=[ALL_TRUSTED=-1, + OBFU_TEXT_ATTACH=1, TRACKER_ID=1.102, TVD_SPACE_RATIO=0.001] + autolearn=no autolearn_force=no +Received: from mx.domain.tld ([127.0.0.1]) + by localhost (mx.domain.tld [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id L8E9vyX80d44 for ; + Fri, 17 Aug 2018 16:36:39 +0200 (CEST) +Received: from [127.0.0.1] (ip.dynamic.domain.tld [192.168.0.24]) + (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) + (No client certificate requested) + by mx.domain.tld (Postfix) with ESMTPSA id EF01E13BA0BD7 + for ; Fri, 17 Aug 2018 16:36:38 +0200 (CEST) +Sender: testsender +Message-ID: +Date: Fri, 17 Aug 2018 14:36:24 +0000 +Subject: ogqMVHhz7swLaq2PfSWsZj0k99w8wtMbrb4RuHdNg53i76B7icIIM0zIWpwGFtnk +From: testfrom +Reply-To: testreply_to +To: testnameto +Cc: testnamecc +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="_=_swift_v4_1534516584_32c032a3715d2dfd5cd84c26f84dba8d_=_" +X-Priority: 1 (Highest) + + + + +--_=_swift_v4_1534516584_32c032a3715d2dfd5cd84c26f84dba8d_=_ +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + +n1IaXFkbeqKyg4lYToaJ3u1Ond2EDrN3UWuiLFNjOLJEAabSYagYQaOHtV5QDlZE + +--_=_swift_v4_1534516584_32c032a3715d2dfd5cd84c26f84dba8d_=_ +Content-Type: application/octet-stream; name=6mfFxiU5Yhv9WYJx.txt +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename=6mfFxiU5Yhv9WYJx.txt + +em5rNTUxTVAzVFAzV1BwOUtsMWduTEVycldFZ2tKRkF0dmFLcWtUZ3JrM2RLSThkWDM4WVQ4QmFW +eFJjT0VSTg== + +--_=_swift_v4_1534516584_32c032a3715d2dfd5cd84c26f84dba8d_=_-- + diff --git a/plugins/vendor/webklex/php-imap/tests/messages/example_bounce.eml b/plugins/vendor/webklex/php-imap/tests/messages/example_bounce.eml new file mode 100644 index 00000000..a1f5683f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/example_bounce.eml @@ -0,0 +1,96 @@ +Return-Path: <> +Received: from somewhere.your-server.de + by somewhere.your-server.de with LMTP + id 3TP8LrElAGSOaAAAmBr1xw + (envelope-from <>); Thu, 02 Mar 2023 05:27:29 +0100 +Envelope-to: demo@foo.de +Delivery-date: Thu, 02 Mar 2023 05:27:29 +0100 +Authentication-Results: somewhere.your-server.de; + iprev=pass (somewhere06.your-server.de) smtp.remote-ip=1b21:2f8:e0a:50e4::2; + spf=none smtp.mailfrom=<>; + dmarc=skipped +Received: from somewhere06.your-server.de ([1b21:2f8:e0a:50e4::2]) + by somewhere.your-server.de with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 + (Exim 4.94.2) + id 1pXaXR-0006xQ-BN + for demo@foo.de; Thu, 02 Mar 2023 05:27:29 +0100 +Received: from [192.168.0.10] (helo=sslproxy01.your-server.de) + by somewhere06.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) + (Exim 4.92) + id 1pXaXO-000LYP-9R + for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100 +Received: from localhost ([127.0.0.1] helo=sslproxy01.your-server.de) + by sslproxy01.your-server.de with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) + (Exim 4.92) + id 1pXaXO-0008gy-7x + for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100 +Received: from Debian-exim by sslproxy01.your-server.de with local (Exim 4.92) + id 1pXaXO-0008gb-6g + for demo@foo.de; Thu, 02 Mar 2023 05:27:26 +0100 +X-Failed-Recipients: ding@ding.de +Auto-Submitted: auto-replied +From: Mail Delivery System +To: demo@foo.de +Content-Type: multipart/report; report-type=delivery-status; boundary=1677731246-eximdsn-678287796 +MIME-Version: 1.0 +Subject: Mail delivery failed +Message-Id: +Date: Thu, 02 Mar 2023 05:27:26 +0100 +X-Virus-Scanned: Clear (ClamAV 0.103.8/26827/Wed Mar 1 09:28:49 2023) +X-Spam-Score: 0.0 (/) +Delivered-To: bar-demo@foo.de + +--1677731246-eximdsn-678287796 +Content-type: text/plain; charset=us-ascii + +This message was created automatically by mail delivery software. + +A message sent by + + + +could not be delivered to one or more of its recipients. The following +address(es) failed: + + ding@ding.de + host 36.143.65.153 [36.143.65.153] + SMTP error from remote mail server after pipelined end of data: + 550-Verification failed for + 550-Unrouteable address + 550 Sender verify failed + +--1677731246-eximdsn-678287796 +Content-type: message/delivery-status + +Reporting-MTA: dns; sslproxy01.your-server.de + +Action: failed +Final-Recipient: rfc822;ding@ding.de +Status: 5.0.0 +Remote-MTA: dns; 36.143.65.153 +Diagnostic-Code: smtp; 550-Verification failed for + 550-Unrouteable address + 550 Sender verify failed + +--1677731246-eximdsn-678287796 +Content-type: message/rfc822 + +Return-path: +Received: from [31.18.107.47] (helo=127.0.0.1) + by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) + (Exim 4.92) + (envelope-from ) + id 1pXaXO-0008eK-11 + for ding@ding.de; Thu, 02 Mar 2023 05:27:26 +0100 +Date: Thu, 2 Mar 2023 05:27:25 +0100 +To: ding +From: =?iso-8859-1?Q?S=C3=BCderbar_Foo_=28SI=29_GmbH?= +Subject: Test +Message-ID: +X-Mailer: PHPMailer 6.7.1 (https://github.com/PHPMailer/PHPMailer) +Return-Path: bounce@foo.de +MIME-Version: 1.0 +Content-Type: text/html; charset=iso-8859-1 +X-Authenticated-Sender: demo@foo.de + +
Hallo, dies ist ein Beispiel-Text.
\ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/four_nested_emails.eml b/plugins/vendor/webklex/php-imap/tests/messages/four_nested_emails.eml new file mode 100644 index 00000000..0b34e986 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/four_nested_emails.eml @@ -0,0 +1,69 @@ +To: test@example.com +From: test@example.com +Subject: 3-third-subject +Content-Type: multipart/mixed; + boundary="------------2E5D78A17C812FEFF825F7D5" + +This is a multi-part message in MIME format. +--------------2E5D78A17C812FEFF825F7D5 +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +3-third-content +--------------2E5D78A17C812FEFF825F7D5 +Content-Type: message/rfc822; + name="2-second-email.eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="2-second-email.eml" + +To: test@example.com +From: test@example.com +Subject: 2-second-subject +Content-Type: multipart/mixed; + boundary="------------9919377E37A03209B057D47F" + +This is a multi-part message in MIME format. +--------------9919377E37A03209B057D47F +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +2-second-content +--------------9919377E37A03209B057D47F +Content-Type: message/rfc822; + name="1-first-email.eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="1-first-email.eml" + +To: test@example.com +From: test@example.com +Subject: 1-first-subject +Content-Type: multipart/mixed; + boundary="------------0919377E37A03209B057D47A" + +This is a multi-part message in MIME format. +--------------0919377E37A03209B057D47A +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +1-first-content +--------------0919377E37A03209B057D47A +Content-Type: message/rfc822; + name="0-zero-email.eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="0-zero-email.eml" + +To: test@example.com +From: test@example.com +Subject: 0-zero-subject +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +0-zero-content +--------------0919377E37A03209B057D47A-- + +--------------9919377E37A03209B057D47F-- + +--------------2E5D78A17C812FEFF825F7D5-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/gbk_charset.eml b/plugins/vendor/webklex/php-imap/tests/messages/gbk_charset.eml new file mode 100644 index 00000000..b40936bd --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/gbk_charset.eml @@ -0,0 +1,9 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="X-GBK" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/html_only.eml b/plugins/vendor/webklex/php-imap/tests/messages/html_only.eml new file mode 100644 index 00000000..ce3ee17c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/html_only.eml @@ -0,0 +1,9 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/imap_mime_header_decode_returns_false.eml b/plugins/vendor/webklex/php-imap/tests/messages/imap_mime_header_decode_returns_false.eml new file mode 100644 index 00000000..af3a7f36 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/imap_mime_header_decode_returns_false.eml @@ -0,0 +1,9 @@ +From: from@there.com +To: to@here.com +Subject: =?UTF-8?B?nnDusSNdG92w6Fuw61fMjAxOF8wMy0xMzMyNTMzMTkzLnBkZg==?= +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/inline_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/inline_attachment.eml new file mode 100644 index 00000000..be60f598 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/inline_attachment.eml @@ -0,0 +1,41 @@ +Content-Type: multipart/mixed; + boundary="----=_Part_1114403_1160068121.1505882828080" + +------=_Part_1114403_1160068121.1505882828080 +Content-Type: multipart/related; + boundary="----=_Part_1114404_576719783.1505882828080" + +------=_Part_1114404_576719783.1505882828080 +Content-Type: text/html;charset=UTF-8 +Content-Transfer-Encoding: quoted-printable + + +------=_Part_1114404_576719783.1505882828080 +Content-Type: image/png +Content-Disposition: inline +Content-Transfer-Encoding: base64 +Content-ID: + +iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAB+FBMVEUAAAA/mUPidDHiLi5Cn0Xk +NTPmeUrkdUg/m0Q0pEfcpSbwaVdKskg+lUP4zA/iLi3msSHkOjVAmETdJSjtYFE/lkPnRj3sWUs8 +kkLeqCVIq0fxvhXqUkbVmSjwa1n1yBLepyX1xxP0xRXqUkboST9KukpHpUbuvRrzrhF/ljbwalju +ZFM4jELaoSdLtElJrUj1xxP6zwzfqSU4i0HYnydMtUlIqUfywxb60AxZqEXaoifgMCXptR9MtklH +pEY2iUHWnSjvvRr70QujkC+pUC/90glMuEnlOjVMt0j70QriLS1LtEnnRj3qUUXfIidOjsxAhcZF +o0bjNDH0xxNLr0dIrUdmntVTkMoyfL8jcLBRuErhJyrgKyb4zA/5zg3tYFBBmUTmQTnhMinruBzv +vhnxwxZ/st+Ktt5zp9hqota2vtK6y9FemNBblc9HiMiTtMbFtsM6gcPV2r6dwroseLrMrbQrdLGd +yKoobKbo3Zh+ynrgVllZulTsXE3rV0pIqUf42UVUo0JyjEHoS0HmsiHRGR/lmRz/1hjqnxjvpRWf +wtOhusaz0LRGf7FEfbDVmqHXlJeW0pbXq5bec3fX0nTnzmuJuWvhoFFhm0FtrziBsjaAaDCYWC+u +Si6jQS3FsSfLJiTirCOkuCG1KiG+wSC+GBvgyhTszQ64Z77KAAAARXRSTlMAIQRDLyUgCwsE6ebm +5ubg2dLR0byXl4FDQzU1NDEuLSUgC+vr6urq6ubb29vb2tra2tG8vLu7u7uXl5eXgYGBgYGBLiUA +LabIAAABsElEQVQoz12S9VPjQBxHt8VaOA6HE+AOzv1wd7pJk5I2adpCC7RUcHd3d3fXf5PvLkxh +eD++z+yb7GSRlwD/+Hj/APQCZWxM5M+goF+RMbHK594v+tPoiN1uHxkt+xzt9+R9wnRTZZQpXQ0T +5uP1IQxToyOAZiQu5HEpjeA4SWIoksRxNiGC1tRZJ4LNxgHgnU5nJZBDvuDdl8lzQRBsQ+s9PZt7 +s7Pz8wsL39/DkIfZ4xlB2Gqsq62ta9oxVlVrNZpihFRpGO9fzQw1ms0NDWZz07iGkJmIFH8xxkc3 +a/WWlubmFkv9AB2SEpDvKxbjidN2faseaNV3zoHXvv7wMODJdkOHAegweAfFPx4G67KluxzottCU +9n8CUqXzcIQdXOytAHqXxomvykhEKN9EFutG22p//0rbNvHVxiJywa8yS2KDfV1dfbu31H8jF1RH +iTKtWYeHxUvq3bn0pyjCRaiRU6aDO+gb3aEfEeVNsDgm8zzLy9egPa7Qt8TSJdwhjplk06HH43ZN +J3s91KKCHQ5x4sw1fRGYDZ0n1L4FKb9/BP5JLYxToheoFCVxz57PPS8UhhEpLBVeAAAAAElFTkSu +QmCC +------=_Part_1114404_576719783.1505882828080-- + +------=_Part_1114403_1160068121.1505882828080-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-275-2.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-275-2.eml new file mode 100644 index 00000000..d80e66ed --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-275-2.eml @@ -0,0 +1,123 @@ +Received: from AS4PR02MB8234.eurprd02.prod.outlook.com (2603:10a6:20b:4f1::17) + by PA4PR02MB7071.eurprd02.prod.outlook.com with HTTPS; Wed, 18 Jan 2023 + 09:17:10 +0000 +Received: from AS1PR02MB7917.eurprd02.prod.outlook.com (2603:10a6:20b:4a5::5) + by AS4PR02MB8234.eurprd02.prod.outlook.com (2603:10a6:20b:4f1::17) with + Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.19; Wed, 18 Jan + 2023 09:17:09 +0000 +Received: from AS1PR02MB7917.eurprd02.prod.outlook.com + ([fe80::4871:bdde:a499:c0d9]) by AS1PR02MB7917.eurprd02.prod.outlook.com + ([fe80::4871:bdde:a499:c0d9%9]) with mapi id 15.20.5986.023; Wed, 18 Jan 2023 + 09:17:09 +0000 +From: =?iso-8859-1?Q?Martin_B=FClow_Larsen?= +To: Cofman Drift +Subject: Test 1017 +Thread-Topic: Test 1017 +Thread-Index: AdkrHaKsy+bUiL/eTIS5W3AP+zzLjQ== +Date: Wed, 18 Jan 2023 09:17:09 +0000 +Message-ID: + +Accept-Language: da-DK, en-US +Content-Language: en-US +X-MS-Exchange-Organization-AuthAs: Internal +X-MS-Exchange-Organization-AuthMechanism: 04 +X-MS-Exchange-Organization-AuthSource: AS1PR02MB7917.eurprd02.prod.outlook.com +X-MS-Has-Attach: +X-MS-Exchange-Organization-Network-Message-Id: + 98cea1c9-a497-454a-6606-08daf934c6c4 +X-MS-Exchange-Organization-SCL: -1 +X-MS-TNEF-Correlator: +X-MS-Exchange-Organization-RecordReviewCfmType: 0 +x-ms-publictraffictype: Email +X-Microsoft-Antispam-Mailbox-Delivery: + ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097); +X-Microsoft-Antispam-Message-Info: + BzqL6hvPyQW0lSkWGop6vQlsIZK48umY74vuKlNgF0pb/H659W+0fuTB+6guqGM0oof00mlzu3gn1pu1R5pUOE2Fb58OqnBEFkB30vVrG6TNsG/6KBtecXkP3FptqO/WRmsxCQx7bK7J2VyS2SbOibqX8mDZhkTrwP1+IA0R9eD0/NvoMqX9GssewUDxSAbaaKdADCuU1dG7qpF8M9tfLDJz+dUL5qZoO+oGINGLLdo2y6Z/F+h3UWv7BXiS4BJKc+jwAng26BUMKmg2VVRdMvc+LbZTovUr9hyEq1orS9fOg1iIV6sPcyIVl3NIEy5bHMYh1d6sUCqvTO1UPSdf7lIvKxSszyKptIPNgioOvFpF9tTHDyKU5p1IiLm5FxW/+kGdPq6ZoTIZVriJoyjx6gWKpPY3vHN6bHUK9mA+LspIYAeuDFFvwkZx2b2Rtw3S99S7zz3eBqv3xlGqJixx/apl4Af7ZaxKFpMj9XZXAQVIv9BA0tIA+1nLByt4dPW4Xzoj3KcBbX5K/HkuR/30Lrq7gRQQDyNYgf5S/MO2MLJqcvnVFPXgVubK6XFu5quDibsZjPjxOUfBTJkJ/n4gB8Z8/TOM0oKD76hszXXoaWd9leUeQ1x88oy+QuXPRxzuLzVec3GiPNMYA42QvvTiWmrrhdceRzhV0J7pJBbi10ik+hXqSeNkldgktd5cWPss5F74yxAaEaPJO9I7MOUpE0XzlRfljPptykrIQt8SARMllykzJNrDt8VAl37ArEZbWxFLm3RuypOI0zgCZMRLf5JeElpCv1ay4wilz4vsYGr4fs3KUQzI1YY43uaDxNMz8k7dH/UkC9Dfg1oyHlNs+w== +Content-Type: multipart/alternative; + boundary="_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_" +MIME-Version: 1.0 + +--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_ +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Test + +Med venlig hilsen +Martin Larsen +Feline Holidays A/S +Tlf 78 77 04 12 + + + +--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_ +Content-Type: text/html; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
+

Test

+

 

+

= +Med venlig hilsen

+

Martin Larsen

+

Feline Holidays A/S

+

Tlf 78 77 04 12

+

 

+

 

+
+ + + +--_000_AS1PR02MB791721260DE0273A15AFEC3EB5C79AS1PR02MB7917eurp_-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-275.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-275.eml new file mode 100644 index 00000000..642d6a42 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-275.eml @@ -0,0 +1,208 @@ +Received: from FR0P281MB2649.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:50::12) + by BEZP281MB2374.DEUP281.PROD.OUTLOOK.COM with HTTPS; Tue, 17 Jan 2023 + 09:25:19 +0000 +Received: from DB6P191CA0002.EURP191.PROD.OUTLOOK.COM (2603:10a6:6:28::12) by + FR0P281MB2649.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:50::12) with Microsoft + SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id + 15.20.5986.23; Tue, 17 Jan 2023 09:25:18 +0000 +Received: from DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com + (2603:10a6:6:28:cafe::3b) by DB6P191CA0002.outlook.office365.com + (2603:10a6:6:28::12) with Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend + Transport; Tue, 17 Jan 2023 09:25:18 +0000 +Authentication-Results: spf=pass (sender IP is 80.241.56.171) + smtp.mailfrom=*****; dkim=pass (signature was verified) + header.d=jankoppe.de;dmarc=pass action=none + header.from=jankoppe.de;compauth=pass reason=100 +Received-SPF: Pass (protection.outlook.com: domain of **** designates + 80.241.56.171 as permitted sender) receiver=protection.outlook.com; + client-ip=80.241.56.171; helo=mout-p-201.mailbox.org; pr=C +Received: from **** + DB5EUR02FT011.mail.protection.outlook.com (10.13.58.70) with Microsoft SMTP + Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id + 15.20.6002.13 via Frontend Transport; Tue, 17 Jan 2023 09:25:18 +0000 +Received: from **** + (***) with Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.2375.34; Tue, 17 + Jan 2023 10:25:18 +0100 +Received: from ***** + (***) with Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.34; Tue, 17 Jan + 2023 10:25:16 +0100 +Received: from **** + (***) with Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.2375.34 via Frontend + Transport; Tue, 17 Jan 2023 10:25:16 +0100 +Received: from ***** + (***) with Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P521) id 15.1.2375.34; Tue, 17 + Jan 2023 10:25:18 +0100 +IronPort-SDR: qF6UeVYj8pb73gXrskSNOtfmUEgr2JLTtqbIK+/6ymuIu+hw8DzzyKrOGqm7zNPwG/4zr+ma5y + XERFv6Zyf/cxrWoVjWXswWrkCVjqQuHglLaONZt1Mg4okFzEByeEZsyg3/3n6kI4O+kgViBgLW + nNMzGlNLSqYBX+EDhOfE1GEWB/4iRbwDY32SnTr5BYqR0HwgHf+0M0E3b23/NqV6iYrF3KETah + cLtLRt/b5JY6f5KvmKoz0Y395r7MwryWR1eLKAU2j3w+ioNYBUw36K/hsIRojcquvQk9w3Qtfu + Yz1BUNwOEOwfxr0VjQScHirO +X-IRON-External-Mail-Tag: Extern +X-IronPort-MID: 60840111 +X-IPAS-Result: =?us-ascii?q?A0G0CQCSaMZjmKs48VBaglqEBz5Fk0mfZoFqEw8BAQEBA?= + =?us-ascii?q?QEBAQEJRAQBAQQDihcCJToEDQECBAEBAQEDAgMBAQEBBQEBAQQBAQECAQEGA?= + =?us-ascii?q?wEBAQIQAQEBAQEBAQEVCRkFDhAFLw1XDV0LgUQLgXQLAzENgjgiggQsgXYnA?= + =?us-ascii?q?QE4hE6DIwetVIEBgggBAQaCY5xECYFBi12ESYEhHD8BgU2EP4VPhXKaXIE7f?= + =?us-ascii?q?IEnDoFIgSk3A0QdQAMLbQpANRZKKxobB4EJKigVAwQEAwIGEwMiAg0oMRQEK?= + =?us-ascii?q?RMNJyZpCQIDImYDAwQoLQkgHwcmJDwHVj0CDx83BgMJAwIhToEgJAUDCxUqR?= + =?us-ascii?q?wQINgUGUhICCA8SDyxDDkI3NBMGgQYLDhEDUIFOBIENfwpXxUKgLYIqgVChG?= + =?us-ascii?q?oNmAZMikiGXS6gMgXwKFoFcTSQUgyJPAQIBAQENAQIBAQMBAgEBAQkBAQEBj?= + =?us-ascii?q?jaEDIosQzE7AgcLAQEDCYwjAQE?= +IronPort-PHdr: A9a23:3aIm3RBfYL78XRTcz0LxUyQUT0MY04WdBeb1wqQuh78GSKm/5ZOqZ + BWZua8wygaRAM6CsKgMotGVmp6jcFRI2YyGvnEGfc4EfD4+ouJSoTYdBtWYA1bwNv/gYn9yN + s1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgppPOT1HZPZg9iq2+yo9JDffQVFiCCgbb9uL + Bi6ohjdu8cIjYB/Nqs/1xzFr2dHdOhR2W5mP0+YkQzm5se38p5j8iBQtOwk+sVdT6j0fLk2Q + KJBAjg+PG87+MPktR/YTQuS/XQcSXkZkgBJAwfe8h73WIr6vzbguep83CmaOtD2TawxVD+/4 + apnVAPkhSEaPDM/7WrZiNF/jLhDrRyiuhJxw5Dab52aOvRwcazQZs8aSGhbU8pNSyBNHp+wY + o0SBOQBJ+ZYqIz9qkMKoxSkAwmnGebhyjhQhn/uw6IxzuMsERnB3Aw7A9IDq3bUo8/zNKcRV + uC11LHIwivZY/xLxzjw8Y7FeQ0urv+QR7x/a9bRyVUxGAPfiFWdsZDpMjKV2OkTvWWV7+RtW + OOhhmMmqAx8oDuiy8Uih4fGh48Y1FPJ+Th4zYs6J9C0VFJ3bN64HZZftiyXKoR7Tt4kTmp1u + yg60qULtJ2ncCQQ1pgqyAPTZ+aHfoWJ+B7vSeScLSp+iXl4YrywnQyy/lKlyuDkVsm7zlJKr + i1dn9nJsXANygDT5tGfSvdk4EutxSuD2xrW6u5eIEA0kbHUK5kuw7IqkZoTq0vDEjf3mEXwk + qCWal0p9+u05+j9fLnrqYKQO5V0hwz/KKgih86yDfkgPggLRWeb+OC81LP5/U3+RbVHluU2k + q7CsJDGPskbpLS2AwlW0oYk8xa/Fymp3M4FknYZNF5FfgmIgJDzO17SOPD4Eeu/g1O0nTt23 + /zGJKHuAo3RLnjfl7fsZbJ960lTyAoyy9BT/olUCqwZIPLrXU/xrsDYAwQiPAyp2eboFc9y2 + poQWWKIGK+YPrndsUWV6e41PuaDetxdhDGoL/8q5virlmIhgVgHYYGjwIEbYTW2Ge55Kl+VJ + 3bh0fkbFmJfnAM4BM/tkEWPGWpLYG2ud6A14DI8EJqrS4vOENP+yIed1Tu2S8UFLltNDUqBR + C+ASg== +IronPort-Data: A9a23:VhC+4aKGZF33Q9F0FE+RvpMlxSXFcZb7ZxGr2PjKsXjdYENS1zBVm + zYfDDuGOvjcMGT0etAkYN6x8kwD7MLQm9Q3G1ForCE8RH9jl5HIVI+TRqvSF3rJd5WcFiqLz + Cm/hv3odp1coqr0/E/F3oAMLhCQ7InQLlbGILes1htZGEk1F0/NtTo5w7Ri2tcx3oDga++wk + YqaT/P3aQfNNwFcbzp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMebS4K8bhL + wr15ODjpz2Bp3/BPfv++lrzWhVirrc/pmFigFIOM0SpqkAqSiDfTs/XnRfTAKtao2zhojx/9 + DlCnZWXSl0jF72Qo9YUcCEfFTpSP4Rt/KCSdBBTseTLp6HHW37r3ukrFARsZdRe/+92BWtJ5 + bofMj9lghKr17rwmu7iDLQywJ18daEHP6tH0p1k5SneFuoOQ5nFQKLS/dIe0DpYasVmQ66OO + 5JAMGMHgBLoWwRwMVsFObICo/qFn1bzdyRihGDOnP9ii4TU5Fcojeaxb4O9lsaxbcFSkUee4 + 3nb53z+GA0yPsGFxTPA/HW2mebVkWX3Veov+KaQ8/l3nBiLgzZLUVsTXFq/q/6pzEmkVLqzN + nD45AIniqto/mW7EuLPVj6A53ifkhw1cN5PRrhSBB629oLY5AOQB24hRzFHacA7uMJeeQHGx + mNljPu0X2E06uT9pWa1r+zI9WroUcQABTVaDRLoWzfp9PHPjenfZDrlQ8xnEajdYjbdQGmpm + mHiQMQWo7wVgYYh2r+//Favvt5Bjp3OUxJw/kCNBjvj6wp4YISid8qv81ezARd8wGSxEQXpU + JsswZL2AAUy4XelyHzlrAIlQejB2hp9GGeA6WOD5rF4n9hXx1atfJpL/BZ1L1pzP8APdFfBO + RGM4lMAv88JYiL6Ncebhr5d7ex0ncAM8vy6DpjpgiZmO/CdiSfcrH02DaJu9zmyziDAbp3Ty + b/AKJvyUSlDYUiW5Dq7RuEZ3L4tgzsj3XvUX4yzwBGt0dKjiI29Ft843K+1Rrlhtsus+VyNm + /4Gbpfi40gBDIXWP3eGmaZNdgpiBSZgWvjLRzl/K7TrzvxOQj9xUpc8ANoJJuRYokiivryZo + S/lAxEGmAGXaL+uAVziV02PoYjHBf5XxU/X9wR1Vbpx83R8M4up8okFcJ47Iesu+OB5lKcmT + fADeMKYGvkJRjmeo2YRapz0rYpDchW3hFvQYHP+PWViJsBtF17T59vpXgrz7y1SXCC5gs1v8 + bSv2zTSTYcHWwk/Xt3db+iizg3tsHVEwLByUkLEL8N9YkLp9IQ2eSX9guVuepMOIBPAwSOC2 + kCaDE5A9+XKpoY09vjPhLyF9tn2SrAjQxcDQWSCtOS4LyjX+Gan0LRsaufQcGCPTn7w9YWje + f5Rk6P2PsoBzQRDvIdLGrp2yb4zuon0rLhAwwU6QHjGYgj5Cr5kJXXaj8BDurcXnO1cvhaqH + 1rKoIEDf7CAOcfvF05XIxAqN7zR2fYRkzjUzPI0PESjunAup+faDBwMMknekjFZIZt0LJghn + bUrtvkQul62hRcdO9qbijxZqjaXJXsaXqR56pwXXN3xhgwwxg0QaJDQEHWsspSIdskJKgxwe + mbSgaPDg75b1gzFaXVqTSrB2u9UhJIvvhFWzQZceA3Sx4eY36E6jE9L7DA6bgVJ1REbgeh9D + W46ZUR6KJKH8ypsmMUeDXunHBtMBUPF90H8o7fTeLY1k6V1uqfxwKHR9ApDEI31M46RQ9SDw + Iyl9Q== +IronPort-HdrOrdr: A9a23:8y8NqqHssZLZ5JoIpLqE88eALOsnbusQ8zAXPidKKSC9E/b4qy + nKpp4mPHDP+VUssR0b9uxoW5PwI080l6QZ3WB5B97LNzUO01HFEGgN1+Xf/wE= +X-IronPort-Anti-Spam-Filtered: true +X-IronPort-AV: E=Sophos;i="5.97,222,1669071600"; + d="scan'208";a="60840111" +X-Amp-Result: SKIPPED(no attachment in message) +Received: from mout-p-201.mailbox.org ([80.241.56.171]) + by maila.burda.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2023 10:25:16 +0100 +Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) + (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) + key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) + (No client certificate requested) + by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Nx3QJ6GdJz9sQp + for <***>; Tue, 17 Jan 2023 10:25:12 +0100 (CET) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=****; s=MBO0001; + t=1673947512; + h=from:from:reply-to:subject:subject:date:date:message-id:message-id: + to:to:cc:mime-version:mime-version:content-type:content-type: + content-transfer-encoding:content-transfer-encoding; + bh=OMh+Pfp7SvIiDJjyXg53DevMPfaJRBhjQUkokwQIgDY=; + b=m3nM2KPbJdO7D+Vq/fMLLCXpkeDgvLs/JRzGTzWO4OoQhSaXLp76/vkBGPCU7BSGxir2Fu + g6e9Ggnrf0l8vL7rpvTgttta64wImaP9wOmJ0fOjzHcg/PX7sYjlUjyVyfThqZ7M5qg6/P + E9wItt4lQoUeQRVc6EoUlUaL7S+2R4P2WsQ6HCjulmpC3fmZdPOTXph/a1YfGvSfSj0pjp + LauH2n6EURKFmtMv8MbDcvTVKcq7o1bLGnK/RAjkLmRAORt+eC08IEAb5stVE6T6UPZ14Q + GUqrK2HEm5THS9vlH/11LwxwmnAdqUm8nl+Ymo3n1UNF9r8wkh8BUndGQFOQqQ== +Message-ID: <****> +Subject: Testing 123 +From: **** +To: *** +Content-Type: text/plain +Content-Transfer-Encoding: 7bit +Date: Tue, 17 Jan 2023 10:25:11 +0100 +Return-Path: *** +X-OrganizationHeadersPreserved: *** +X-MS-Exchange-Organization-ExpirationStartTime: 17 Jan 2023 09:25:18.2389 + (UTC) +X-MS-Exchange-Organization-ExpirationStartTimeReason: OriginalSubmit +X-MS-Exchange-Organization-ExpirationInterval: 1:00:00:00.0000000 +X-MS-Exchange-Organization-ExpirationIntervalReason: OriginalSubmit +X-MS-Exchange-Organization-Network-Message-Id: + ca3e116b-7c15-4efe-897e-08daf86cbfae +X-EOPAttributedMessage: 0 +X-MS-Exchange-Organization-MessageDirectionality: Originating +X-MS-Exchange-SkipListedInternetSender: + ip=[80.241.56.171];domain=mout-p-201.mailbox.org +X-MS-Exchange-ExternalOriginalInternetSender: + ip=[80.241.56.171];domain=mout-p-201.mailbox.org +X-CrossPremisesHeadersPromoted: + DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com +X-CrossPremisesHeadersFiltered: + DB5EUR02FT011.eop-EUR02.prod.protection.outlook.com +X-MS-PublicTrafficType: Email +X-MS-TrafficTypeDiagnostic: DB5EUR02FT011:EE_|FR0P281MB2649:EE_ +X-MS-Exchange-Organization-AuthSource: **** +X-MS-Exchange-Organization-AuthAs: Anonymous +X-OriginatorOrg: *** +X-MS-Office365-Filtering-Correlation-Id: ca3e116b-7c15-4efe-897e-08daf86cbfae +X-MS-Exchange-Organization-SCL: 1 +X-Microsoft-Antispam: BCL:0; +X-Forefront-Antispam-Report: + CIP:193.26.100.144;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mout-p-201.mailbox.org;PTR:mout-p-201.mailbox.org;CAT:NONE;SFS:(13230022)(4636009)(451199015)(6916009)(82310400005)(558084003)(2616005)(7116003)(6266002)(36005)(8676002)(86362001)(36756003)(5660300002)(1096003)(336012)(8936002)(156005)(7636003)(7596003);DIR:INB; +X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2023 09:25:18.1452 + (UTC) +X-MS-Exchange-CrossTenant-Network-Message-Id: ca3e116b-7c15-4efe-897e-08daf86cbfae +X-MS-Exchange-CrossTenant-Id: 0a3106bb-aab1-42df-9639-39f349ecd2a0 +X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0a3106bb-aab1-42df-9639-39f349ecd2a0**** +X-MS-Exchange-CrossTenant-AuthSource: *** +X-MS-Exchange-CrossTenant-AuthAs: Anonymous +X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem +X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR0P281MB2649 +X-MS-Exchange-Transport-EndToEndLatency: 00:00:01.4839051 +X-MS-Exchange-Processed-By-BccFoldering: 15.20.6002.012 +X-Microsoft-Antispam-Mailbox-Delivery: + ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(930097); +X-Microsoft-Antispam-Message-Info: + =?iso-8859-1?Q?DN6oyY29jzFhRK1BGCOfg1yFnX4ACBaHBh9nbhnIoNZ4DGdi6zN+tIXnUR?= + =?iso-8859-1?Q?AY3F6SV1doOncexZBgqeE70YqvkB0xmo97NgnkQFb48xPvmZwoiAqkmIrS?= + =?iso-8859-1?Q?EbPesMMRL/pVX22Pde2C0KNThL0e02Li5ZCNvDxq+mEt0T9cww7HhoY6SS?= + =?iso-8859-1?Q?vMbDIBDA4c6Gyvb+34A6rYNFyHtZFVMas8S1KP4bV7QtI2WooRBzL1tOgM?= + =?iso-8859-1?Q?gyRVbzR69Mk++hTLhqTK7kBIkGMFhUC1McOMGMTOuUh9Ay7vMeY/oNGwOG?= + =?iso-8859-1?Q?WEFVsQjOz6lY4FIc3A+U5t3LMxkHtxRCql//ZhfKfjy78hPR7FCzYk70+T?= + =?iso-8859-1?Q?iCLlDZNF73KjvxH82FFKOersAl26L1kb2x5F/d1XJxAJe7BTG20/LXuMmx?= + =?iso-8859-1?Q?wGJs7s+C69LYa4cliwtGTMEuS6Rd7bOLihXnIy6hn8UhjVhNBv0+yGjint?= + =?iso-8859-1?Q?hbwBnQJ4Ny2jeS42bJYmKw+7Dnol+pphbvhjhtsDvKifo4Xx7xM45eV2s3?= + =?iso-8859-1?Q?wfKtSfeNGIR3Oi0VwreHTtsCOfvY8jbP+T2Z6KOFtQRvlUyutOFnOB2x1J?= + =?iso-8859-1?Q?BVgSblJzekltOB7gCAmZiCQnZuUMOtVVqRfURwUhOuQ47I/2LDJzi/NQnf?= + =?iso-8859-1?Q?XiqeHojof9SfngGas5TNx9tuQxmFqw4AWJE7iy4hxJo2ehSt4ReEvPzyt9?= + =?iso-8859-1?Q?1DTwLNYbyZ8Ub7Uq3EtUDE5vn3jY2thuVBo8eemdrjOvsx+hdH9RxcFwYz?= + =?iso-8859-1?Q?qU8NIflZ0TMRHTT2M2aBdzB9zsR3Kda+I8tNi7T6DCWve+MEEmLeRa4lU6?= + =?iso-8859-1?Q?XAFgPATiTR9BGrBBrwqKLye2Pnn6Bx8Hs+R7sFsv6HnQkS8B585+mjXV0A?= + =?iso-8859-1?Q?jXMm+5KDT/IUTiTAeJPwBTNEAG6Yo8gDg+6/9EMuZtQYAYZnM4tMefCwBm?= + =?iso-8859-1?Q?oV/M1vLbCGr7m1BDeRerH34C/2SWa0XnU9zOzqvm6/ery2Cv81aakjQr+S?= + =?iso-8859-1?Q?FdFwyYhZi96v0+HHAeT1Ncyrb84GZVp0kb1VYOBI0JH7TTZy88PMtFfbXQ?= + =?iso-8859-1?Q?nrSZ/VgrVa7hCvBOf2VQnj6iMnNqaJlmnI+E/yXvDNQJn2JDhor7QrClSA?= + =?iso-8859-1?Q?rrCXMDZyWWZhhDrf+VkN7ePKkju46/dqh0NRjqz6571xFdftnXx/b9dli1?= + =?iso-8859-1?Q?+XoZOiqbV8FyrJNCWDLuZRc1gIr0KVbbxN9nggMGa5c8tslnJvW/OTImm7?= + =?iso-8859-1?Q?SEKOX/bZx/aOe9bLlgzQhqdtwBkOJurGSWeDajB/ko2pFUcIYWyMaB6dFW?= + =?iso-8859-1?Q?RcQgdjWDgNNqiUnyvY585ZCFJCfiMaWj8hglJWADRQdLHNSqFAtuZdVCc1?= + =?iso-8859-1?Q?HPXeZDkLqPP+0VfD8EO3A1Fmp+E3kIrykjPJtNslbzwmtL3ATsC8e2mcob?= + =?iso-8859-1?Q?NGBKDmktRjDYG3mhya2XCCiFWaYiig6J/s1ePtuRp3TbBojEAUg2E5xItx?= + =?iso-8859-1?Q?gRGc6bNfg9Rihie4+BZSN+l+ynuYJQ/FGK3CvQYA9gXp00ZtfPwlHx7mXA?= + =?iso-8859-1?Q?gaDydNv1CyuYCOgUeTxo4Bi7N4Rrz72tn9pYxoZ7okujjzLWuiK7etRoRz?= + =?iso-8859-1?Q?JwOHGQklwT4VgMwwLQdXxNR+WMLbOyXjt6bfrKSUHq34oLx6ZVk2F6r9HI?= + =?iso-8859-1?Q?5uaCMLO8dLt3O9rb8FdV3EfLGg+zThKobHlrVJ2WFZLm0xtSsbzC04WLdR?= + =?iso-8859-1?Q?Oqf0F2GVBbFjulBFs9mvdhDXD33oUn5atsgLnkAitzWZH8qgeTOKgCbZD4?= + =?iso-8859-1?Q?WIXnz+DQx0g6sgmqGwa5fkPzRn+NfdGnwNwRyjXcAw7jW5DVkAnzd2OkEc?= + =?iso-8859-1?Q?WrVWN1eIbPedT77yCWDwLAjGBWSrpmI1bZkqI=3D?= +MIME-Version: 1.0 + +Asdf testing123 this is a body \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-348.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-348.eml new file mode 100644 index 00000000..6c9d385d --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-348.eml @@ -0,0 +1,1261 @@ +MIME-Version: 1.0 +Date: Fri, 18 Nov 2022 16:52:06 +0100 +From: sender@testaddres.com +To: receiver@testaddres.com +Subject: 2 - test with a strange attachement +In-Reply-To: <30fdd5117dd9408487d74e9b50dedc27@testaddres.com> +References: + <30fdd5117dd9408487d74e9b50dedc27@testaddres.com> +User-Agent: REDACTED +Message-ID: <0a5495c56acb49d56545a2017dd1f931@testaddres.com> +X-Sender: sender@testaddres.com +Content-Type: multipart/mixed; + boundary="=_be6bc52b94449e229e651d02e56a25f1" + +--=_be6bc52b94449e229e651d02e56a25f1 +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=UTF-8; + format=flowed + + + +-------- Original Message -------- +Subject: 2 - test with a strange attachement +Date: 2022-11-09 08:36 + From: anotherSender@testaddres.com> +To: "receiver@testaddres.com" + +--- First Text as body test 80 column new line linux style 0x0A --- + +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor +incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis +nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu +fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in +culpa qui officia deserunt mollit anim id est laborum. + +--------------------------------------------------------- + + +--- Second Text as body test no column limit (865 characters) one single line ending with 0x0A --- + +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur + + +--------------------------------------------------------- + +Da: From Test sender in another language (IT) +Inviato: mercoledì 9 novembre 2022 03:17 +A: To in another language (IT) +Oggetto: Subject in another language + +--- Third Text as body test 80 column new line linux style 0x0A --- + +At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis +praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias +excepturi sint occaecati +cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia +animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et +expedita distinctio. Nam +libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo +minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, +omnis dolor repellendus. +Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus +saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. +Itaque earum rerum hic tenetur a +sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut +perferendis doloribus asperiores repellat. +--=_be6bc52b94449e229e651d02e56a25f1 +Content-Transfer-Encoding: base64 +Content-Type: application/pdf; + name="Kelvinsong—Font_test_page_bold.pdf" +Content-Disposition: attachment; + filename="Kelvinsong—Font_test_page_bold.pdf"; + size=35648 + +JVBERi0xLjUKJcfsj6IKNSAwIG9iago8PC9MZW5ndGggNiAwIFIvRmlsdGVyIC9GbGF0ZURlY29k +ZT4+CnN0cmVhbQp4nK1Y+3PbxhEe4wAcSXEMgC9IlEJDskWKNAHi/YjTmlbixMm400mqmf4Q9IdO +mqRJY3rMdqb/fr+9A0BSsltl0jiWgLu9vX18++3C7xzfC2PHpz/1w3dvOqtvMufHf3bEsrP9sfOu +E3tBmqaZWNh//u6Nc30D+dzJvTx3bn7AocBxA2yFfuQloRMHiRcFgXPzpnP1QGGqpvNWu9zwI95l +5ZY/NMyu1dN431TZQDF75XbIR/bxyfzm504QOjevO1fjU3s04mcPPprwR065OcfRC7Xc9h7PZ52X +N52vO4Hzb/z9Cn9/rmz+5otOFudOkgZenAYO/s/iyNl+3/nTPXwJ4ILv+YfeBIXvRaETRIXnZztv +FE3XhD9k734YgsKT1j+cOE8m/BKGT/uTxuIwdMIgSWGdE6ehE0WJtC7H5WFchLRRFE6e+Lv1IPKT +aj32M7lOXtbr8LJZF/JBLrwn+TjcrddRwXoTFaGnkic9+/JBFkTVvVmW7+RrOyHf2Cn0VPIU9Vr+ +XSfNIliaihviwikAie33zp+dzT0zEh6mIwu8KHWi0MsSPxXpAKDK7UNDw0/NtHr9cjsYHmkjZmvH +x+bRyfj07PQjypJIwNe/EQf7F/PJoxabOK0R0NAfTdTWeQ2GzCuE2VkYEizCyPNj5+ZvnW+vHsI6 +ppTbuRv6fubF8dVs/pebr+StNYbcNECAc8dNU69I6eBVt9U+Z5OLiTJq3UacG8DaGCbnXhYK4XKr +l1flnC1U9rSci9o7GhhmOW9burlEGbmua93dIMVJFpPnUeCludBle8cn9sxe+YFP+whE6iXSptWJ +PR5zHn40RVk/iuK9AoWkW6lyU8EwdMAJIYiC4LPZSbCyIY5wGKrFLxIsggusS4vjshP7dGSvTk73 +DMrCWklC7NHCNSkzFW3I/dmQ48fBlXFeSz/RehbPVifc9sc+H53ivzHuvSy3+eF6YJ/IwO7lIZLa +gtCvI2spjyfnrb1sJzEikvt1mp70DT681AY2s6d2FS95ckYZGS/O7mTvbpiSmh+ZouPxgCQFR8KB +29zY2L6PXHlzH0EeGhaMemCbdlMJ7wj9eQL3UKsgHyrTMBJlKjoBTn/29r71crcJIHZwJwSzRE25 +PJV0GWWkBULCOgG7EEhP42rJUkbt1tORFHbDMKXCk1s9e2i64kAu0F7p8Cbn5aYpDpRW5lX6v71a +6ZbZ1bR5mCcwMrwanCtUsL4oOxmJThEHDavFVErpr+KoD3mfFLkXFLJprPTh0fD/R0MBPIyE5m+v +hqzctANUc7lRFdaau1GQo1sFRBrqZFRFRlu22Dk2izBKKMSPBZtMtMcT7UG5QWoEkVVktIfPMI/p +0ZWNDdEuyk2/D/Hw7OyC4+Xi44lAdZIWXlan1WE6CHmOMuVRuVV01Dmh2rP5YMCfXfLLgmfc54KY +Y/IoK2rGaZfbBRULId8Cqes4/NQt55qhfmIx9U6VijBF0jZ40g4jtNyWFqMqzu/2Z2qn9U0X0+SC +HOH0i4dH5MwZt8fBjJ963sgO7tzlAkShk8Y1BVZ8MFMYGIFiv5teBkFLRUa8ybSF7h/74gjWh61p +65EyUrBYSc7KTUJv0q7XB40l3YkZqPPJND0YJWrMYpRoWvFvgmycpV5YzTmI4DRSdyFs0Jj6OBNV +cLCHI0m+hWBJt+HK0UyQjRuHxI7N8tQR9Ys+HtcFPxsfz2bHo9Ht9ukmkU92+tQMSfCs3C6BorZm +cB3gUvH70ex0uTwnHDoAJf/dA+fJ74e8P3mGThLMfM8Dw99xwM0Ep7iN4mflxkbjGVd9JAJt1bYJ +J5IiIZsqShmPh1h2iyxKvDS9su19Lgn8YjdSBRgYwqQmk4OtN/I1imIxNP2CzCGpmJSQVT+u5q4i +yu+b1PdN4kAH3EzywAsSmdOLZds0VFN03IaNwPu7W2lAvP+t74NSBPpFQWeJl1S3LhbZaTkXoQ0K +3ILLajgMFVWUaz3FldvY1Iz2+TSqhuswIaCIynmfaLkdVbIoFKk7pe5CunfXSjcL0FMd/jjKgPns +3h8HuZMeOBkjqIfjYEuQnG7ypWbo7Dlfg8DQu08t2+bycTaiZ63ema2sVbMV1M8vmLJmBktTU34o +rbUe9f1n5gA8igfF4qO9CaCcD0w5Alh8qvVQF9uFyRVT4SDc+ULHjAe1eFm0NfDR1tA4jWiMmwaZ +y/VPmLbGPUuTrxnXFgvNoAPdLluUWxX70IRRkVMUrwbMNBQSpDc5m76mcVNRmc7apsUnUik0lfPr +ayyaH4jD6kNxIDGLI5kCW/IOFKzoEU0Lso4eAgJ5uT3CbKMVxkODmx9jqK7qXBwRJ9yomar6pnKt +GUQf6xemsWaK9pxTYPXdOiJdbeG5qxHPdDWFiYDwB9OLJ2Gfa4pqmByWjsYIofQB0UW3Y0vsmQda +FioCat5O6/8Yz812u5zLO5cayV/DVdLBlU/FuHosx9XPOFNEVmTKEfOl7LQw4rZBh37W5klfWI+D +SJfS3nL7kvWYKlZxQkU+VbwtGFRCyvicVvUekEV+ML7QFOyJUPEBUKVdXwNmTEZBDvez1SjguqVb +EBZWmMZSE/60DQ3nAVBpj0g7xgABKqRroQ0A+OecVfYJXOn1OqXIBBhpga01At5CAlhJaWpm+KxQ +eBMbXEVTtSC/S4MCZQ4RQGgxqLJkjiqD/ZktDB5ynCFZhZzldX3DN36JQkCYkCaKzAJVRJesSRal +ReFYM3VXvUQJhJU5aYOXV3Ca9Q6qiEK9kOSs8WumSNjIxDUeiwWBqtrkHazoSWZf2UHww0EoNwup +ViZ759AXdI82EBuNCcs261WfXI0Z+ifamqxCfna2P7MKi6/sI9s7Gtn2ichpEIjvXzg5BZv0JQSY ++vlzSsAOvSJGxFwNSKqaa5sqgAfjVcR0Lutx32Kyprh7WtIeUkMRBf0ttFupM7tdZJ+KhUiQiA8u +HQajbZDQWkQbFmDqaAuokSrMH3CuSaCgfRJblHNz72a5Ullg0aenqCi40DW5ORCwRnGpIgiVx5JU +CH16XcXANshIFXMx0WsPRQE6rkE3pOqSnixUgvZ7vNAQRbLG3AUSO9C5XYoy3CF1P44EV6rzVEJO +jrhicILTuMMU8NBUUvFcEEFPRh7fq/MKMTBYTvQLlOaCSWrBZ5lB75wiAqwqoihuswLwuNNPgBFd +UVsIEmJoA5WrIkSR2TMJ07sOUs+SqRw58oi+UaoeMjP40tS6bjVQHA4KzWyNQeFXzNZ507P2RgXx +hZ/GRTMQPWHLlwaB45IZ9URLXzqiRYuYHfQyNw1SD99geVx3s3Lz37iX3mryHc+O8GPEdf0QE2vC +iqA3kZ5tlxKnEQx7gqbXjOyQvbxpWGSyWGgTpEQdANY6uxbM0+AICoABahI9QOJVw+WvhvzVIQW8 +gsJXInt9SrLoZyLTryy+y8f9/z06iJ1M/DOsWMWY5xVFkRbNbwr+zTdfvnjt/OGPn710XOfTX376 +7h/O37/HiP7D263z5i0eftrg8c1f//XT283eF/t/AGaEuvFlbmRzdHJlYW0KZW5kb2JqCjYgMCBv +YmoKMjY0NgplbmRvYmoKNCAwIG9iago8PC9UeXBlL1BhZ2UvTWVkaWFCb3ggWzAgMCA1OTUgODQy +XQovUm90YXRlIDkwL1BhcmVudCAzIDAgUgovUmVzb3VyY2VzPDwvUHJvY1NldFsvUERGIC9JbWFn +ZUMgL1RleHRdCi9FeHRHU3RhdGUgMTYgMCBSCi9YT2JqZWN0IDE3IDAgUgovRm9udCAxOCAwIFIK +Pj4KL0Fubm90c1sxMyAwIFJdL0NvbnRlbnRzIDUgMCBSCj4+CmVuZG9iagozIDAgb2JqCjw8IC9U +eXBlIC9QYWdlcyAvS2lkcyBbCjQgMCBSCl0gL0NvdW50IDEKPj4KZW5kb2JqCjEgMCBvYmoKPDwv +VHlwZSAvQ2F0YWxvZyAvUGFnZXMgMyAwIFIKL01ldGFkYXRhIDI1IDAgUgo+PgplbmRvYmoKNyAw +IG9iago8PC9UeXBlL0V4dEdTdGF0ZQovT1BNIDE+PmVuZG9iagoxMyAwIG9iago8PC9UeXBlL0Fu +bm90Ci9SZWN0IFswIDAgNTk0Ljk2IDE1XQovQm9yZGVyIFswIDAgMl0KL0MgWzEgMCAwXQovQTw8 +L1VSSShodHRwOi8vd3d3LmJ1bGx6aXAuY29tL2Rpc3BhdGNoLz9hY3Rpb249VHJpYWwmcHJvZHVj +dGlkPXBkZiZ2PTExLjExLjI4MDQmZj1Qcm9mZXNzaW9uYWwlMjBmZWF0dXJlczolMjBVc2VyJTIw +aXMlMjBub3QlMjBpbnRlcmFjdGl2ZSZyZD10cmlhbCZmbD0mcmZsPVBSTykKL1MvVVJJPj4KL1N1 +YnR5cGUvTGluaz4+ZW5kb2JqCjE2IDAgb2JqCjw8L1I3CjcgMCBSPj4KZW5kb2JqCjE3IDAgb2Jq +Cjw8L1IxMgoxMiAwIFI+PgplbmRvYmoKMTIgMCBvYmoKPDwvU3VidHlwZS9JbWFnZQovQ29sb3JT +cGFjZS9EZXZpY2VSR0IKL1dpZHRoIDQ4NQovSGVpZ2h0IDE3OAovQml0c1BlckNvbXBvbmVudCA4 +Ci9GaWx0ZXIvRmxhdGVEZWNvZGUKL0RlY29kZVBhcm1zPDwvUHJlZGljdG9yIDE1Ci9Db2x1bW5z +IDQ4NQovQ29sb3JzIDM+Pi9MZW5ndGggODU5Nj4+c3RyZWFtCnic7Z1PrF/Fdcfv29kKErY3cfAi +buxKkQKKI2ErSOFPFk1MKwVbIqHOJhg2UIjAKZGC8w/yx1RKGpME4mzAzqJxaSr5gdTEJgv8cKVU +BglXGDULE6gUE7qxXYnG3rmHN2RyfGbu3Lm/371zvnfe+SiKzHu/97tz5893Zs6ZOWfh8uXLDTAX +3rl052NHnv3335Z86NXvW/Xmv+xZc9Wqtg+8+fYFKtXSqTcLFupdXnnq3i2b1/v/XDzxWyrG//7f +pcLFMAyjPC/8cPcCuF7f8sDB8rJIHPzKjjtv/Vjbb9f89WMqKrn//u0PfvYG9+9Dv3pl9z8sli+D +YRgqfGH7Fmi9pmXsX9yxv/xzP/j+NbS+bvutolCe/7eH/apfayYzDEMF2l5D6zVt9n929FT5537z +zlse2f3Jtt9qCSXNroce3un+rTWTGYahws1bNh5HtodceOfSxs/tVzE7vPHMno3r10R/pSiUL/xw +9y1bNrp/P/jjX/3wX/9DpRiGYZTHWWhx9VrL7HDbJz68+N1dbb/VEkpuolGcyQzDKM/V71t14ZcP +0z9w9XrL3Qf+88zb5Z975Du7dtz44eivFIWS+z/N02gYK4oHbv/441+8tYHV6+On3vzkAwfLPxfT +0yjOF2rNZIZhqOAttKB6jelp1BJK7mk8debtj919oHwZDMNQgVtoEfX6wjuX1v7NYyqP5gfmBIpC +ya/JUOVsuevAf//PBZWSGIZRkgdu/zitIL0oIer147/4zZ4njpZ/Ll/Ghmgt+T+6ef2pp+4t/1zD +MNBA1OuNn9uvsn7kB+YEIJ5GwzBWMnB6bZ5Gjj/H46Bp45GDL5wyZ6Nh1M6aq1aFB4vh9HrHVw8X +ju7k4KE5QrSW/P4cT7NsQN+x97BZrg1jhRCKEpZeK94eTHgatZb8zZU3LbUM6IZhqBBaaLH0mjb7 +jx46Xv65mJ5GFzHA/VvxzIxhGOWJWmix9FrL7CDiSnMUhZJ7GrVmMsMwVIgeNADS68UTv935tcPl +n5s+MKd1uFDMrlozmWEY5WlLmQKk15ipCbSEkt+01JrJDMNQoc1Ci6LXWp7GdOovRaHknkZLTWAY +K4o2Cy2KXmvFKU17GrUOF/KIAZaawDBWFPyggQBFr7UyIiY8jYpCyWO6mjHEMFYOtONf3Ler7aI1 +hF5r3R5Mexq1jmSE53ge/8VvLrxj2QkMo34e/OwNbebZBkSvzdPISd+0NAxjxaKv11pxSkVoDoGi +FULctKT6scW1YVTPxvVr2tLGevT1Wuv2IA/NEYKQBN1Fd7K8uoaxEkifVXMo67UlQRfwiAEWMMQw +VhSJkM4OZb3W8jQmTsw0lgTdMIzipEM6O5T1WisjYtrTqHW4kJdK6x68YRgqpJPHOjT1WitOadrT +CJIE3QKGGMaKIhHS2aOp15hJ0BE8jYoRtw3DKE/6orVHTa8V45Riehr5TUvzNBrGiqLT0+hQ02st ++ywPzRGCkATdAoYYxooix9PoUNNrLfssD80hAEmCbp5Gw1hRpI8/cHT02pKgc4T/U+vCp2EYhaGx +/8juW/LjT+jotVac0rSnUetwYfqmpWEYhkNBrxXtswlPo+KqNlEqwzAMj4JeWxJ0TvqmpWEYhkdB +r7U8jYkTM4qexoT/05gKtDmj+b6wMc3MaCuQ0nqtFac07WkESYLuoMnjVMGRv+aqVW0ZdowcFC83 +XV56VOW5Wrz59gX6n3YphiEnempIab3Wuj2YTgKAkARdMXrqPBkSii0tw2RAJJR37jtSuOHCYmhZ +0oR9T2WNPx60lDn19L38fjYtqh45eLyaCGg50VNDiuq1oqcxcTdfcX3EPY26dxpnM8sUblBeXSA3 +UUFC7yreFh4P/oJVXiLLP3btKarXmEnQtYSS37RUH2+zGUNLNqhwzGr1JbG+BknyWd8dK/GCWs09 +Hvl3GjlF9VorTmna06gllLxU6uMtnXq4jZINyhcjIDdRGz1LGkgxxkPY6LSkYzxyoqeGlNNrrduD +k/A0Ioy3nHCOnJINKq6AgtxE1XKeC9OnYq7R8eC9Uau5R2W2Wxfl9NqSoHP48gEkempfE3bJ66DC +XANyExUh9G6jd1t4PMQLatXzeKSjziUopNeKSdATTliQJOgg0VN7mbALNyhfjIDcRDWH53hwU2GV +4XQyo6eGFNJrkDNPAq2FCS8Vznjr5QAp2aBiMQJyE1XLAyaKoeXwHA/hSgFZzQzIbJ5GRwm9VvQO +8ZWIAOQkFtR4y7SpFXbSckONon9Y2ItU9JqG+uK+XbxL1+eIA3Esj8c81x1K6LWWuyB95kFLKEWp +EDyNnswDoSWdtCAH18I1EUkJFaZkGdZctYpahxv36nPECQNmfS/Y9Hfsc0roNWYSdISTWGie/cwk +ciWrThx7QriJikN9jjjRA6FWM4OQOcTaGF2vFZOgJzyNIEnQ0Tz7OZa1wnMMX4yA3EQFAcfzMSC8 +nkHOTQ1LwkKbw+h6reUuSJ92QDiJhTneOoWp5BwjFiMgXmsX6aVkTC6CBrnoz/U54oQrtb4XnO1W +GmdcvbYk6AI+u0J5Gj1pI1LhqgOJICEidWy564DKJp13niodccLTWF9ElBkChgjG1Wst71A6CQDI +SSxMz37avlay6oRxZoVH6hDFqM8RJ+6OYq5m5mG2gHyCcfUawacXoiWUvFSw4y1twtYKGNJg3ERV +LIZweGr58McDxLE8HoPklxhRrxU9jXyiFoCEnkD27Le5RAoHDEEIkSGKoegB437XKq/8cQMm2rmp +QRjEZT2iXmsdfsD0NPJSYXoaPW3n+Uuu6UAiSGA6POtzxIkrrGjnpuZnqDStY+m1JUEX8FKBB/ON +BqMpXHUgITJAilF9agJ+dxR8NTMb83saHWPptZa7IB34CiT0BKan0RM1KJWsOpBIHZaaoAyWmiCf +sfRay12QCAoKkgQd1tPIESbswms6sRhB8A83MM7z+hxxlpogn1H0GjM1AUipJuHZF0Oo5JoOMzUB +yIXYKq/8WWqCfEbRay3vUHoe0xJKXqqpePaFWankmg4zNYHWJl106foccSCO5fGYOTVBlOH12jyN +Apwk6Pnw1WXhw1WAqQmaZYsQaWXhMpBS86j2VTriQK6wjkfftE1phtdrrZUIpqdRJEGf0B1ib8Iu +uaYDiSAx1OmrYanvyp+lJujL8HptSdA5vFTTss05E3bhJY9ITYDgH8ahPk+jpSboy8B6DeLTE4DE +fJiEp9Hj1piKAUNAWq1Z9vIdf+WNkmXYuH6NOK47rck+B0tNMAMD67WWJKXnMYTQE1P07F9eerTk +bgkkgoQohpZ9TxyprM8RJzyN01rN5DBnaoIoQ+q1oncoMY+BxHyYom2OVpolFRMkVj2gw7M+Rxx1 +reM/2o3Q3CNBuwd6wXlSE0QZUq9BoisIEEpV5R3iYQEJkQFSDOE8V7zyd3OLT2geSMVoB8MXWFr1 +TNPGxg8MnzaI5qHHv3jrsJYQx2B6reguwPQ08v1sfXeIBwfkXBdIpA4Ev+tHN6+nqWvwFWKIVj0/ +cPvHxbSBz2B6jelptCTok8BSEySKoTWyiqWsVKlnzCObnQym1wg+vRCEmA/12eYGByQnAGYxVBxx +JeVMpZ4xj2x2MoxeYyZBBwlyP0VPY0ksNYEAITXBUPE/O1Fp7sGvsRRjGL0G8Q4JtIIt4CdBhwIk +goQoBkLnafRG1uWlR8s8SKWeBwyYV5gB9BrEpycACWNS3x3iwQHJCQBSDBCH5/77t2/5yw8M+520 +aRCjVauei5nmB2cAvdZyywifnkBLKIXhzzyNaUQjgqQmAOnS9R0rEgsslUE6xjWWYgyg1wg+vRCE +UlWZNnRYMFMTqFiNb/vEh0lHuDOmvskeITVB4vgvPvPqNYh3SAAS5L6+aMXDgpMTIMx/RpJ94Z1y +UhLaCqo8VsQNESrNPV1Po2NevQZxywgsCfokwExNAEJ9x4oQHMvFzr2MxFx6DeLTE4CUyjyNnQBG +6nAcL6sj9HRRgCone/UrrOlN+SSYS69BfHoCkIQJ9aUNHRbM1ASkI7RlLLzMD3WkvskeIQn6pD2N +jrn0GsGnF6IllJNLgq4LSKx6hEgdzQpLgq5Vz9M9xueZXa+hvEMekDAm9UUrHhaL1MERXbrKY0Xq +SdAnGjBEMLteI/j0QhBSs1dpfBwWzNQEWg5PUYz6JnuE1ART9zQ6ZtRrEJ+eAMRnpRiteCpYaoK2 +YlQ52XNPo0o9T/0Yn2dGvdaSpPSmBiSMiXka0wjHLEirWWqCkRBaqVLP0w0YIphRrxF8egKQhAnm +aewEJEQGSDFEl65vsheeRpV6rsDT6JhFr0F8egKQUtVnfBwWS02QKEaVkz33NKrUcwXH+Dyz6DWI +W0aAkJpd0QY6FTBzAoAUo/oc4Sr1POmAIYLeeg3ilhGARJev7w7x4PDqAgk+A9J5qpzseUA+lXqu +xtPo6K3XIG4ZAYLPStGAPhUwcwJo2WTEydT6JnsRHlalues4xufpp9cg99AEIAkTqjQ+DgtITgAR +hZn6D0lJ4TI8ePsNvD9XOdlzrbSAIYPQT69BfHoCkOjy9RkfhwUzNQEI9aUmEFppqQkGoZ9ea7ll +EncaaWGy5a4D6mFMqjQ+DgtmagIQ6gsYguBprOYYn6eHXiu6ZWh9fWhvZJ588w/nH/zxUZVhb0nQ +eyGqCyRSR7M80S6e+K+SZSAFERNGfakJxFEuCxgyFD302iSJIzyNWgb0qYAQq74JNmpankZxwkzR +hy8ykI2EpSYYily9NkkS8K1WfcbHwbFIHW3F0BpZxa5oq9RzZcf4PLl6bZLEsSTovcBMTQASA0dr +jc+Pfo+KSj1XEzBEkKvXJkkcvtWqz/g4OJaagIOQmqDkwQkVx3J9nkZHll5XGUB9ZoTPysz6aUCS +oINE6gBJTVDsirZKPdd3jM+Tpdda99Aw4T4rM+t3YqkJEsXQGlkibsl4qNQzzc2nnr63pmsynm69 +rjKA+jxYEvReWGqCtmLUN7LEsr2+SwniZmx5uvXaJIkjwpiYWT+NpSbgVJ+aAKS5xyOdjLAA3Xpt +ksThPqvCxkcSncn1fuHis9QEdacmAHEsj4d6aNYOvbYYRhzhsyppfHSPnlYyBEtNkChGfSNLuFLr +OwGMcKa7Q6+nJRBjo5gE3T16WrYpzJwAKlYI0rLFfbv40qy+kSVsBfXty4s5aROk9Lo+f8ic8CsG +haXT+ammddYbMDVBs7xPp6Vf4WLQOOdlqM8R18A4lkcCJDRrSq/r84fMg2K8Me7GWbj5m2UeOieY +qQlAqM8RV72nEaQjpfS6Pn/IPCgmQed+qqmchefVhZOaAIEqHXG8i1a5LwfpSK16XZ8/ZB4Uk6CD +uMt6AZKaIIyo+cjBF46XtRpvXL9GrMvqG1kgjuXxwMlx0arXli2Fw10NhZcPwssxCdMnZmoCrS4t +DoHV54gDucI6HjihWeN6PQlRKIZwNRReLYZx1MDtVJipCRSLAZKLfTwQHMvjEea4UCSu1/W5C+ZB +uBpKymXUywFuwsZMTaBVDJCrleMB0tzjoX6nkRPR6yr9IfOgmAQ9ep8K3ITNq8sidSCkJhgVEMfy +eECFZo3oNbgcFEa4GhQ9jR5kaxVIagKQSB2iNuobWaKL1ncCGC0JZESv63MXzINiEvSElwPWhA0S +QcJSE5RBOMNhu+XMiJAv6ki9rtIfMjOKSdDT96kwzaAgLj6QSB0gqQnGA8SxPB4IAUMEUq8xhUAL +kZqg5DItfZ8Kc2wIzwxITgCQYoB7iWdAdNH6TgADJoG8Qq+r9IfMA3c1FJbI9H0qTMcOSAQJfrzM +HJ7jAeJYHg8oT6PjCr2u72LSPAhXQ8nlQ859KjRjKEgECZDzc6I26htZoovWty8HCRgiuEKv0SRA +F0xPowdthACmJmiUjmSQWNNQ576H+hxxII7l8VBPTRDlz3pdnz9kHhSToGdGboQyYYMEOYk6iAoH +DKGGE4YsqJYaBBDH8ngAehodf9br+vwh88BdDYVXi5n3qaBMoiARJHDiPHCqv/JX374cITVBlPf0 +GmrwI8BdDYVXi/leDhyPPEIECZCI8oIqRxaIY3k8wqA9ILyn1/X5Q+ZBMQl6r/tUINfJMFMTnDrz +9p2PHSk8n4WOYjQ3w/yAXGEdD0xPo+M9va7PHzIP3HVWePnQa0cP4nIAiSDBj5eBFKNKRxyIY3k8 +QFITRHlXr+tzF8yDcDUU9jT2ityIMFpAYtWLRZ9WMcT6ur6RBdLc44GTmiDKu3pdnz9kHhQ9jTPc +p1I3YWOmJgBxeKq3zuCAOJbHA9Nl7Vl44w/n6/OHzAN3NcB6Gj26JmyQCBIgx8tWQmoC3kVBzHED +gumy5iw88KNfIvisQABJgp6P7pgBiVVvqQnKAOJYHg+o1ARRFq6+dV9l/pB54K6zwuuj2SI36pqw +QVx8IJE6hJ9q4eZvqhRjPEAcy+MBGDBEYOvr96CtEK0duGKSFG6560CB9XX46F6cOvP2jr2HC5sR +P/j+NYf27hQXdsuba8NigKQmaOq6JhPtojW9YLQ/A9KaH90wJgdOagLDGAPTa6MeQByehjESptdG +PWjt0AED2xtVYnpt1EP50zK0sn5k9y2YsYGM+jC9NgzDmAam14ZhGNPA9NowDGMamF4bhmFMA9Nr +wzCMaWB6bRiGMQ1Mrw3DMKaB6bVhGMY0ML02DMOYBqbXhmEY08D02jAMYxqYXhuGYUyDhd///uzi +kWf9f2/btnXrtuvFhy5evHjs6K/Pnj2b/hjx4tKJV1897f9z8+ZNn97+qaHLXDmLR57zVb1hw4Yd +Oz8z+CPOnTt/7OjzZ8++Rfgfbtr0odWrV1933bXRljWMYlDP7BSllcnCw1/52qVLV8R3333XF2jQ ++v+kunv6qUPnz58Xfyk+Rjz5xIHXX/+d+NjfP7Rnw4ZrBi1zzYR1uGvXHcN2VppQDz79s7bfbt16 +/a7P3zHg4wyjF9Q/D//8GS5Kq1ateujLX1q3bm308y+dfPno0edpabgS+u3CngcfEj/69Kf/ii+K +oyocfoxq7fDhZ8Rn1q5d+/Vv7B2utJVDU+M/fl/mxBtWr2mr9O1v7RMz9HiPM4y+kFi/9NLL4off +3fct2vzxn1BPPv3qa6TUbil5zTXXPPTlPeVKqUSHXkcVJPwYQSoQrsFt8PciOud97et721YWQz2C +Ew4MwyhJqCThso90idaRfNlx0003jmE5RKNDr6NznYNXUHSLvUJmvAEJa5t2gvse+/aoj2j+NK2e +OfM6rVmEjcswSkI98Kt7vyF+KGx00T3iClkaRvTaG6bPnTv/nW/va/vLTZs+dN/997p/R20mf3ff +PZs3bxq0tJUTriyuvfYjd91956iPMJuVgUN05ce1mFbWtObgfnLHCvG7RPTa62xicd0wvY7aTLia +O+hjtBmnRVxY1/Rhdyyh706cZloqJP0//Zv+lhos/AZ64otLJ9xniB07bxP+z/D0y67P/y03QThL +GfUk+ioxq3eWnF755MmX3L/pM0586atcVdC3kVxu3/4p+oboymLHjs/cdPON/j/pD6kk586d8z9Z +t25dZjd1R3fCaZWW8FQh9Bb8Qc3ybE1/ErYXFZi6BxW4bTKmF1k88pwvpHPu0w+Xq+Jl921Ub6KS +Q3jVNbGGC59FUA3ztnDPDV+c3prKnz4M01kA8QHalfI64Z2ToOqlx7nO5ms1HCZtHDv6PP2V+7c/ +NeRe7fTp15rl7Sz9kBfA/ZbGXThDuxZPL0hdZ6OHij9PVx19norq/zM82pH+ALXmiy+eEN/pzyyE +ZhAO1QCNhXB0tw1eVw/ULhNaVrbqdXpx3bCuFpV1vrh2gyoh/Q7qB1TdvfbjTz91yHVWR2iBoZ5x +7NivxVO4r5lek3qA6JHcIkSadfTo8wkHnftOkomw1cOnk/6SmggLsrNQR1cWvhrbTulkLiuiw0Dg +R0Vme1EHEOLo+P739guJp28Wa6LOYofdLzwkQCOQ6iSxL6b6X1o6kW47GrT0FuFMENaYsE1Fu5b/ +AJX/+9/7gTjkQPuYJ5/4Ka+HTKtrWBh6TXp93kZ8n9S2CBXQeLnv/nvCFmzrbJ1/HvZh0WrRTs6P +kIU7dV+r9L4/efKnnUXiChAeNYkyobV5q16nF9fNn/Q6Kut81ZDZ9uLpmR8OW/cH+7/n/93WwHxI +R03G1O9dL+ysBP5X9Mpi2IfKRf1J/MSP2Kikutdp63b5Nru9D3+9s9e6YZNewgjCCTJa59QfRDN1 +OlGjuw3RN8LWJ82i8lDb0Z8LZUwQPS4WGo7Ey4aNy/U66tcVrc97Wpov7fly+qsa1hk6Xcrie4Tm +5siiRyidWD85+JCMfoC7uMM39SbBnDUHV55e9SBOT8AS12vaZYerG6pT3oNd1YSrjIaNq3CVwf+c +pCH8VS9zatiEfK4OR5TDt03aBJEv1tGSR79cwEdsqD6JGm5bFbbRqddOjDpP+4WIjh4trSBzORMq +JtfrqKx410vbIdQ2hF0iugrhxY42Lnc25IhLpkbkCKjve20i5axe0Trp1FyqHFftJ0++HC68uByH +3UxUbPgBPgtG39TXUs545JdCot4gqoSLFy+dPPlSaBuZhBcncl+GRgW1uqgaqjWqTd7ebjscDu9O +PyR9FQmiE6lotw5v4rTx4tKJxcXnROFd30rMrr4HhOLie0+061Cn37nztrXr1p4/d56aPHw1vuBN +X0sRJWliKwtaer9rfg36KHW7qKU+QaIw9FLbtm11a/zo8oca1LXX6VdfCzu6sBJEv0GQeUIx/Cpe +XW3TWxPrFc3ygNy+/VPUdm+dfWtp6USoO3ym7/R6RT/AnQ1tawVP/uI6Zwp0ZYsuj1yndSWn7kQF +S2huOA8JPXWmZzfErtlwDZV/w/L/Ny1+LN5knbNgevGXXky4Xup1IywMfxA1H3USV3j/IpOwYi88 +8eOfiH5Pchkaoahv0fgRek3jPNREX79RyRMHHqJNmL83CR/hnp5uWleG6Gd84Tvvakb/nL9d2zCj +enOOKepSJFuur+dvQmdeCESVlLtocvzG0VmQL3vbFvLUplu3baX3padkbgtC2fUdI31QPVxYhU6L +dK+LLiP4NNOpLNGtFRWD5oxrr7t29epVVIbMemibAqmzUYGdCct9VeKwpv/PdAtGf0vzEClap5xF +p0m+9op+OS9epzklOk1G/V5R7wLNW/Qik75uHdHr0NrourKQMPoY9TkxMPjwjta+a3v+k8QOqJNw +YLiel96NttkZvCk5qlzhLj6xxIv+tmk/n5ezhhKF7EtaYpoWkRIm47QFqe12Vf6GiRPOYb5jhIrs +fxUd0mGPCte/vGnStummpXG9srTNvrPFZohOgdExEn7SecL5T2h7Eapqeo3lcQcq6JM05YQ7pM57 +idEP8DpJW0uajCW8Jzp5ZL4IMhG9FviNW45JLmep1Ukv2794CmnHps2bRKPSUBTHSO67/x6xOub7 +02hjh4MtrdehfSOxBc4xI/h3me1EdufiJXyd0J0YHTBer6MLqHmc76IOXfWGT/FuxqZlWgovbSaO +unfapsOCNVc2fbQMs3m0oluB6B6rl59QwIdtpyXHEa4bOj200X2PnwWjXUs8pXN758n3xEzrYmS3 +XiesvQKxdw77dCa9rioJlQnt7E4lxQikR4iGF+fAwjfl0uYIJyQ/qqODJ6Fcvea22W6od/qCogZ0 +0ZXThw47F1B9EdrhChwOe75+z5l1oors+3m07bhtOqoaadt6M2urtRkoxGH5tmJnwuczqhxh+WyD +d49O23T0A3wWjL6p2JllhhZxZB5qbCZ1N7JDr/mSsFOvxUQXjn9aF+R02ejNiDbEqr/tnJMY5FSS +8KyL/8+cNVra49Rpy+MkgrREmWFFkLN4SRyl8qQHTLg0m9PtLh7nbieJihWFTBzg9aSlodNwFJVj +3rjR43ezxWaIVnhU+qN6Tc9dvXpV51PCOzvUYU4v3zGJHuJy8Irt9NBGX6Qz9IV40+gB2XTF0iuc +fvW1s2fPJlQu/9aSOh16zSs0rdfhO4e9doxz6ZmlSh/wEmvA6HeKRU102+i7V6fxgdN2lMXJU3hb +Z4agIjmLl2jELj5LpR3IOZEf+hJOe/Tu6Uib0WHP3zS6U+ZVmnA1J24S+YrKt7HmkD8Fpg84zgO9 +9fLJkF+HHd536fSQabMm81mwM1JCjp0qDa3xSbjDqwz16HWnT9wTWpFCzRKjy0cl93+4afOmde/S +Y9uY3gZ6IU4YiMOxFB1yzr987XUfuXjxEhU7/DauTZ2eE05UYnxHjFZ73x1czuIl+hl/miV6mbBh +7d55xG0GOvf4Ydu1xfV1l/5pxNJbhLrDvyc6b7lTj+FxRv/9Xll6ba3S9JoCox8Oj/fQK/hzbO+O +tHVr3YE8l7/C3Z53a2ohl+n7nNFJzp2HiZ6edCTOEYZv2tYZaJtIo/L1M697s62/uO+KJCoh7OeV +6LWor4ReR1+47QjzzcuHec8tH2FOjP9MEvfm+X6/rfDcVcWJDtoE3HAULVLCiBH1w/hvi04efffX +OWGeZjCAdh6enT9bRcILEl1pznDlR9zxm8Hvwuuhl401Td8psG3GdVNFW/QY19PajjO5Z5Eahjf7 ++Vv3vaDUXCkaOW/aeXbFdYaoK8hpOvWN18/8Ljw0MSX79c//6Z/bbg2J9VeivtpEtu8VwdkqLjrA +xGGMNr1uW/j0Ei9xGb3znCknJ8xTtAvmS2H+Mq1Xe4lJOsdwPAOJ4wptva7XReQwkEDfqbq5snE7 +j0nk03cK7DtX8XfvVWlNMMnlH3DydC6nwjdNuOV9f84/GuuY0OKaWDj6q2PR1wvXg21uscQLuxBl +OQ3Jb2H1JdpXhD5mBhHkUA8+cuTZzt4fRgWL9pi24wHRiUH01OgL5nsdOw88cDIlO3x64rTMPLSd +Ik1/eab6RENWJY7uut1hWllyjtlkErUopqfA/HA9YUiD/Nk6rLf0+oY6W+LQd5M92Se02PfnXqFj +SOWpaSaUoGPhj3/8o5DUhHSKYeC6b6cjhUd9DKF+s23b9e7y20yvIE8ghYElw8I7y1qnadXlpaXC +R1WbJCMaVVLc+o2GguLwYdkW6i8dKaUTMfLT+xh3Wze6vaXi0StTi4eNJfrGUCMhqrzphH4OUi56 +izYBcjv9NstbNDiff3Gua2HjCk2Z53iviL1FHZv6Rucwoe5HLx6N9eG/h4Zt2wBfWjqREDuqN/rD +6JY0ur7xlzDF6BMKk/mmibOG4u5xugZcayZiAsOycPny5WIP834Ajw8+AI53xXgm19J9ofelt+Y/ +8X6qkrSFoMk/bhH2upy2E68/xeYOW7CZ6d0dma3Pa3uk0U2rKB7xvGl/qeiL9D3RAEVRvTaMTtzJ +303LQWCiy/yphFIzjMExvTaw6HstyzBWDqbXBhbpMDXTivZgGMNiem1gkTjJO6G8TYYxBqbXBhbR +9XXmSSTDqBvTawMRfiBH5VyKYQDy/x/DPzUKZW5kc3RyZWFtCmVuZG9iagoxOCAwIG9iago8PC9S +OAo4IDAgUi9SMTAKMTAgMCBSL1IxNAoxNCAwIFI+PgplbmRvYmoKMjIgMCBvYmoKPDwvRmlsdGVy +L0ZsYXRlRGVjb2RlL0xlbmd0aCA1ODU+PnN0cmVhbQp4nF2UvW7cMBCE+3sKvcFxl5RkAwYbp3GR +IEjyAjqJMq6wTpDPRd4+M7NxihRjYI4/u9+szPPzy5eX7Xrvzt+P2/yz3bv1ui1He799HHPrLu31 +up3Mu+U63/86/Z3fpv10fv467b9+763DhraG/za9tfMPj18szsy3pb3v09yOaXttp6eU6tO61lPb +lv+WRo8Tl/Vzq9VQ6vsK6zWUhkabaygNj7SlhtJYaPsaSoPODjWUhkw71lDyRPtQQ6nX6mMNpVGr +Uw2lYrSXGkq+0M41lMaBdqmhNGhzq6HU66q1htLosIYsKGxeacFq4nUCGlgteGdasJp4C5s0sJp4 +h5EWrCZe12awmnizCoHVxJvZhoHVxOuqC1YTb2aSBlYTb2aSBlYTb36gBauJt6gQWE28RW2A1cRb +dDNYTbzOswhbQhrsysHqwcu6DlYXb5EFq4t3lAWri7dnVw5WF29h7A5WF29hdA5WD15OAcUlXCUL +Vo/58ttwsLp4RwbrYHXxFmaFOCXkzHFj5hI2kxeDklBIbYDVxZt5FcKWYFkIvUiwPIvJSCikVbDm +mC/DQfYSeCdasGbx9iyEahLa0CpYc3zPF1qw5uBl7JiqhJuJkMGa43vWZrDm4GWwGaw5eHUWrFm8 +vXoGa475ahWsOXjZBgKTcJZX4d9FQlc8CywJq0TAVyyldGHOKC7hKnaFSCRsZhoYspRS02awFvE2 +toFeJBRyvSyfTwgfGb5Wn49TN38cR9vuetL0ZPGpum7t36u333ae6qDTH+WnOLQKZW5kc3RyZWFt +CmVuZG9iago4IDAgb2JqCjw8L0Jhc2VGb250L0dBVkNCTytBcmlhbC9Gb250RGVzY3JpcHRvciA5 +IDAgUi9Ub1VuaWNvZGUgMjIgMCBSL1R5cGUvRm9udAovRmlyc3RDaGFyIDEvTGFzdENoYXIgNzIv +V2lkdGhzWyA3MjIgNTU2IDIyMiAyNzggNTU2IDUwMCAyNzggNjY3IDU1NiA2NjcgMzMzIDUwMCA1 +NTYgNjY3IDMzMwo1NTYgMjc4IDIyMiA3MjIgNTU2IDI3OCA1NTYgNTU2IDI3OCA1NTYgNTU2IDU1 +NiA1NTYgNzc4IDc3OCAzMzMKNzIyIDMzMyAyNzggNTAwIDYxMSA2MTEgNzIyIDU1NiA1NTYgNTU2 +IDUwMCAxMDE1IDgzMyA3MjIgNTU2IDU1Ngo1NTYgNTU2IDY2NyA2NjcgNjExIDY2NyA1MDAgNTg0 +IDUwMCA4MzMgNjY3IDcyMiA1NTYgOTQ0IDcyMiAyNzgKNTU2IDE5MSAyNzggNDAwIDI3OCA1NTYg +NTU2IDU1NiAzNTVdCi9TdWJ0eXBlL1RydWVUeXBlPj4KZW5kb2JqCjIzIDAgb2JqCjw8L0ZpbHRl +ci9GbGF0ZURlY29kZS9MZW5ndGggNTAyPj5zdHJlYW0KeJxd1E1u2zAQBeC9T6EbmDP8kQME3KSb +LFoUbS8gU1SgRWRBcRa9fd+8qbvo4gV4EWnyo0yfX16/vG7rfTh/P27tZ78Py7rNR/+4fR6tD9f+ +tm4n0WFe2/1v49/2Pu2n88vXaf/1e+8DBvTF+7fpvZ9/aOR/xOe029w/9qn1Y9re+uk5hPq8LPXU +t/m/R/niM67LY6hUT8ihomr1hLJYjdUTRrWaqieMyWqunqCcW6onKOeO1RMy516qJ5Rs9al6whit +TtUTili9Vk9I/KhWPSFx3bl6Qnqy2qsnpG51qZ6QbCHBWVhQ7ZMFVqE32boCq9Cb+RRWoTdzLqxC +b+ZgWIXebNsQWIXeYusKrEKvssIq9EbjC6xCr85WYRV6IxeCVeiN3AasQm8sVmEVeiO3AavQW4wv +sAq9xQbjVTCotpDCqvQWm6uwKr3jZBVWpbeYSGFV945WYVV608UqrOreZhVWpTdxXVjVvRwMq9Ib +7buhsKp7uRCsSm/hQrCqv1/uGValV/kUVnWvnSS+XJ4w2Tbw8QwG20ni/BgAbV2cPYNqB4vzY1A5 +GNboXiPgVTB4agScPYM921lFWKO/X64La6Q38ymskd5ke8YMBrXxHj4unF1Ju9uPqzy0z+Po250/ +ALzgdrHXrf/7jdhvu80akNMfVk8LMQplbmRzdHJlYW0KZW5kb2JqCjEwIDAgb2JqCjw8L0Jhc2VG +b250L1FaUEVYSitBcmlhbCxCb2xkL0ZvbnREZXNjcmlwdG9yIDExIDAgUi9Ub1VuaWNvZGUgMjMg +MCBSL1R5cGUvRm9udAovRmlyc3RDaGFyIDEvTGFzdENoYXIgNTgvV2lkdGhzWyA2NjcgNjExIDM4 +OSAzMzMgMjc4IDI3OCA3MjIgNTU2IDU1NiA1NTYgNzc4IDcyMiAyNzggNzIyIDY2Nwo3MjIgNzIy +IDc3OCA3MjIgNjY3IDYxMSA2MTEgMjc4IDU1NiAzMzMgNTU2IDU1NiA1NTYgNTU2IDI3OCAzMzMK +ODg5IDU1NiA1MDAgNjExIDk0NCA3MjIgMjc4IDYxMSA1NTYgNTU2IDU1NiA2MTEgODMzIDIzOCA2 +MTEgNTU2Cjg4OSA2MTEgNjExIDYxMSA2NjcgNTU2IDMzMyAyNzggNjExIDc3OCA2MTFdCi9TdWJ0 +eXBlL1RydWVUeXBlPj4KZW5kb2JqCjI0IDAgb2JqCjw8L0ZpbHRlci9GbGF0ZURlY29kZS9MZW5n +dGggMzEyPj5zdHJlYW0KeJxdksFugzAMhu88Rd6AkBLTSpUv7aWHTdO2F4BgKg4NiNLD3n6/TbvD +Dr+lDxL5s5zydDlf8ri68mOZ0pesbhhzv8h9eixJXCfXMRdVcP2Y1idZTbd2LsrTWzt//8zicECG +jd/bm5SfobYv1XYnTb3c5zbJ0uarFEfv+TgMXEju//0KcbvRDc+jAUc13qMCe94SqgCsK7Z4jwrc +sQW4U6zZAqwVI1uAUfHAFuBBMbEFmBTRRAPsFQe2AOF9jIEt3kfViGgSrVHURgQjMitSK4IRmRWp +FUGBTINUg4gtQFLcswW4V4QgmSSpJHVsAXaK8CVzJnUm+JI5kzqTsAUoitAnG4F0hAb6jY3Q6AgN +9BsbAVUX89qA7kiX/dqtS49lkbzai7CN66bHLH+PZp5mveWQ4heSYaHqCmVuZHN0cmVhbQplbmRv +YmoKMTQgMCBvYmoKPDwvQmFzZUZvbnQvRk1ZRExOK0M6XFdpbmRvd3NcRm9udHNcYXJpYWwudHRm +L0ZvbnREZXNjcmlwdG9yIDE1IDAgUi9Ub1VuaWNvZGUgMjQgMCBSL1R5cGUvRm9udAovRmlyc3RD +aGFyIDMyL0xhc3RDaGFyIDExNi9XaWR0aHNbCjI3OCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAz +MzMgMCAwCjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAKMCA2NjcgMCA3MjIgNzIyIDY2 +NyAwIDAgMCAyNzggMCAwIDU1NiA4MzMgMCA3NzgKMCAwIDcyMiAwIDYxMSAwIDAgMCAwIDAgMCAw +IDAgMCAwIDAKMCA1NTYgMCA1MDAgMCA1NTYgMjc4IDAgNTU2IDIyMiAwIDUwMCAyMjIgODMzIDU1 +NiA1NTYKMCAwIDMzMyAwIDI3OF0KL1N1YnR5cGUvVHJ1ZVR5cGU+PgplbmRvYmoKOSAwIG9iago8 +PC9UeXBlL0ZvbnREZXNjcmlwdG9yL0ZvbnROYW1lL0dBVkNCTytBcmlhbC9Gb250QkJveFswIC0y +MTAgOTc5IDcyOV0vRmxhZ3MgNAovQXNjZW50IDcyOQovQ2FwSGVpZ2h0IDcyOQovRGVzY2VudCAt +MjEwCi9JdGFsaWNBbmdsZSAwCi9TdGVtViAxNDYKL01pc3NpbmdXaWR0aCA3NTAKL0ZvbnRGaWxl +MiAxOSAwIFI+PgplbmRvYmoKMTkgMCBvYmoKPDwvRmlsdGVyL0ZsYXRlRGVjb2RlCi9MZW5ndGgx +IDYzMDI4L0xlbmd0aCAyODM2OT4+c3RyZWFtCnicpL0JfBTl/TD+PM+cuzu7O7vJHtnd7M5mkw3J +AoEkEAKRDLeISBAICRIJcgooBPA+CCqHEQVtS9VaxaviQd0cQDhaqPLTqqXaam21VanF89cotUg9 +yO77fZ7ZWTbV/t++n/9Onuf5zjPPzHN97+eZCcIIITtqRxxqmDGrohKx3+8uhKhx0RUL1xjnry5H +CL+86Or12p4j790FGX9BSLxy6ZplV4x63JtASILytuSyVdctNcpH4L5tLyxfsnDx/05r/A1CX56F +zJHLIcNdFViAkJueFy+/Yv21mfoeg9ORq1YvWmicPzMKodiwKxZeu8Z3p+VZhPI0yNSuXHjFkkz5 +aoh8a1avW2+cf/kXen3N2iVrHu76+FMoryOkVAgHUQGEgPAEKuDjyI9Q+iMIH9M0dXn6Y3qdpgTu +QL2ZgNButAdfjvagI+g5fAruehYdQD3o18iHJqIH0I3oh2gLEtE8yLkdXQyHAPk/xAXpHlSBHoZx +fBgdh7Jz0c3oIPJif/oTtAFt4l6HuzbBSBehcagBrUZ34gvTV6H56D3+VlSDLkRXojW4Pd2Uvit9 +T/ox9Dg6wP063Y9sKIAWwXE8/Znwp/Rf0BC440foPvQevseyF+lQSzuU/Clai+7nWnicXpb+BloQ +RddAG3g0HR3HR0kCnr4EfYT9+EZuAjzl0XQyfQxKhVALWo7uRwfxCDyFRIX56enp48gLdVwLT70P +daF9cPSiX6C3sSKcSj+WPoUK0GA0FfrTg36Lj3Kp/o2pehgxAUapDNXCldXol+hF9BqO4V+R1YIi +VAq6cH36DZSPhqM50Non4M4P8b/IzXBs4F7gJ6fHIweMy910tNH/oL/iAK7AM3AjKSOryYPcWiRD +jcPhWIwuh/G+F57+Lk7gfUQhr3KP8k/z34qFqRNpB8xIHP0E/RT9Ctuhpxpeh2/Bb+K/kQlkAfkJ +eZ/7If8k/3tpIfT6UnQFuhM9jf6F3XgUnokvwcvxjXgLvhvfh4/j1/DHZByZTVaSz7nlXBv3C348 +HLP4dfytwmbhDvHjVFPqWOp3qX+lK9Ob0UzAh43Q+h+hB6FnB9Cr6C043kPvYwHbsAMODUfxHHwD +HDfjO/EjeDd+EvdALa/h9/En+Av8Jf6WIDhEEiRRUgRHjKwl15AfkgfIq3C8Rv5OvuZ8XBGX4EZw +dVwztxpatYXbAcde7q98gH+VT8M4Vwo7hYeE3cLTwnPCKVGRbpGR/Juzj/aX97+bQqmtqZ2prlRP ++q/IA3MYgFGIoDpo/UI4VsB87wSMexa9jhUYuwAux2PxhTAyC/AK3IavhZG8Dd+PH2dt/zk+DKP0 +R/w5tNlOQqzNQ8kIMp7MgONSsoS0kR3kHtJD3iTfcBJn45ychyvnpnAt3BJuPXcdt5NLcr/h3uHe +585wZ+FI81Y+whfxcT7BT+EX8FfxD/If8R8J84VXhA9Eq3iFuFnsFf8hjZTGSg3STKlF2i7tk96Q +WwE7n0d70X6U88MnuI3cJG4vuotU8QXkt+S3gM8L0GJuOgFMJbvxVnIT7iHFwrXiGDIGX4RO8XEY +6xfIQ+QMGcNNx9PwLLSCDDeeJubzT0FSxz+P+vjD0LffwpOvFRV8M/lcVFAXRqQW6vwfbhif4F5B +b3PvYYl/GP2Zt2If7iNPcA2ABb/gxwpNKMo9gH7OteGb0F4yCSHrt/I2wOOL8FPAF2bjSvwVl0Yc +uQiwqIb7G7oVrSR/Qn1Ax1vRj/Fifhm6C1XhG9FH6GdAFWXClWK56MEvkcv5DpKHexDhn4Te1eJi +zAn56Dbcwt0vfk7eQlehV3krepd7Blr/Kvk5N50/JVyMlwMF3IQ2o7b0RnSd0MT/Hi9DHG5EJfwJ +4G43cpV8FNINwFXmA0/bB9R9EPjAOG465PgBcy4EvJgDHOJ+OO4FPsEDBl0OND4XuNhvUY84m/Si +ZYIDA9dBiH8ldTGal/4Zui+9DF2ZvgcNAX6wJX0jPHE3+gBtR7vxptQNaA0KA+W8iy8UJpNXhcnp +IaSDvEVmkZ0D5xdGuwT70adw/BxOxgqHUAf/RzQL1ae3pf8A2D0IOOx96DJ0AToJvfwMajifO4qq +UheRzvRkbg309z00M/1EOoKtaHl6FZqBDqPHJQEtlBIwx0n8e+jvDWgJuTi9nluSuhzGYTuMgg6j +dRXwn9v5Nv5W/mu0DWh+J/CbXUA3TwHlUNpH+iWb1q9b27Zm9ZVXrFq54vLly5YuuaylaW7jnNkz +Lhqn1489r27M6NpRNSOqqyqHD6sYOmRworxsUGm8pDhWFNUi4cJQMFDg93k9+Xlul+p02BWb1SJL +osBzBKPBk2KTW7VkvDXJx2Pnnz+EnscWQsbCnIzWpAZZkweWSWqtrJg2sKQOJZf+W0ndKKlnS2JV +q0N1QwZrk2Ja8vjEmNaL581sAvjOibFmLdnH4OkM3sFgO8DRKNygTfIvn6glcas2KTn56uUdk1on +wuM6bdYJsQlLrEMGo06rDUAbQElfbE0n9o3FDCC+SaM7CZLt0KhkIDZxUrIgNpG2IMmVTFq4ONkw +s2nSxGA02jxkcBJPWBS7LIli45POBCuCJrBqkuKEpMSq0S6nvUF3aJ2Dj3Zs61XRZa0JZXFs8cL5 +TUluYTOtw5WAeicmfdef9J87hYe7JzRtyb0a5Dom+S/X6GlHxxYtuWtmU+7VKI2bm+EZcC8pmdza +MRmq3gaDOG2WBrWRTc1NSbwJqtRoT2ivjP4tiU2iOa0rtKQlNj62vGNFK0xNoCOJLr4u2hUI6AfS +J1BgktYxuykWTdYHY80LJ4Y681HHxdd1F+hawcArQwZ3qi5jYDsdzgyg2HOBJdlrDGLFKTTt4uzI +Ytqi2FRAiKS2SIOWNMWgT6NotGQU6lg0CorBrxnDXcnFMCOXJy0TWjvU0TSf3p8UStSY1vElAgyI +9f19YM7CTI5Yon6JKEjxJItqcN2Ek4lEsrycoog0AeYU2jiWnY8YMvjqXhKLrVE1SGD4UAOM7cLm +0RUw/NEoneA7enV0GZwk22c2GecauizYhfSKRHOStNIrR80rnjn0Srt5JXt7awwwuQdRFdmTlOPZ +P6fqzZu0fHQSe/8/Li8xrk+bFZs2c16TNqmjNTO202YPODOuj8pey0DJvAlNXJBkIBLk2FVAyvnZ +wvSkSUnyJfAnMqRe3CvJgJUsB2uTk2rr+UbcbI1G/8ubetOn6F0sOXdbppnJ0YmB52MGnA9ontLB +QYNBvE6bPa+jwzrgGqCaUeHUTAIYj2Y3RbUJSTQHKLME/nrTR0fR0BxM6jBkE2gBwD8jK3M6oGAw +AzfDj2LnkMGTgdF1dEyOaZM7WjsW9qbbL4tpaqzjAHmOPNexZlKriTi96YN3BJOTtzXDWC3Ho4cM +jtErHR2LOxFXAtXowU7MgJoJdzQnZySaY8nLErForGkJ9KVzNFKis1snAETQ+M4Y3jqzU8dbZ81r +OqCCVbJ1dlMXwWRC6/jmzmK41nQAjBmd5RKaSzPpiUZP0DQMQ9NFZFY+eADsmHZ2lWcZ7HxRL0Ys +TzbzMFrUS4w81agozirSQbFc1MsbV3SzNA95spHXbpQelCktwxWVXjmIQOIgdtH4dcLJ7CbdWqOP +1sfoY0k9gRGhWV2QcxDKjsGoeyyux8FOeObFLLsXt3eO0YMH2JMuzpRsh5I0rz2bBy2nxXIeBPUZ +HZ9zrgdz5jV1j0XwfBZDifH0RzktNCKXhhhjong+N9GkkI5pswAD6UXrqKA157JGb0ziWHJB7Noo +7V2yMXZdFDJjSQ24NRTqRFNCzR0dGhwxGJVFjU1GTC/hwSF4UnOy/TKzbDAEOHHuVIFbGV51hygP +ydZ2g1nbWqiNAh1mdclF31sbtD6JL6Ex+2PN7xyJYkb9IKWNSjvmd8wDfIwmC2nFmXbAqSPUzJ4A +LbmXtQQz4bQIdIKllJY0yuSATcYu6CQXJViKWdpxQWzSYihBAwjdETBZUW1xMy0Vo0RDEf8/FsI5 +haggYQ/vUMeYZzhzZpBvR3LZwNPl2dPJNICOUjLUYBPQF0ay0eSKYHJVcyJbZCHtcwfQ9mhK4KPZ +zVNoaAWxMyXZvmghNBHkzdRFMci4ADK0psuMEaSCuoNqTosWwm10lDM1Ja9MDHgk8AQMLAoeRLuT +bG/QWpu1VuAheCYMdlBLCpBqS0F9ii2kfKPB6E8DMH9IFnbMgnsRnbZgUgJ+tnThkhhlrkmK78bo +0zby0Do0qymJgh0dMcAhaGLJZCgMj48nxfhUmsDfmkRs4RKq2S2lit0SQ+WA5rLRoU8LTopFm6EI +KWFjCQMHhHYZjRZ1UL2xpTUBI+HqcHdotR1A8C3Aq/j4osZW4Guaqk3W2FQvDMIZDMJUetYMDzIK +WkpoQbif/cWTVyQ6W6SScznsb3XCKCyzpzIlItlgFpHYHwBtiSTxjYKLtPP44nlMLsBE0cETSqbC +8OqAVUF6N1DR7IzYMO6fSm8NmhNm3AY5zaYAAHzvLMFbG3I54fyke9rFlwRhYIdQyS2NTV2EJqjo +m2e/uR7aigfaGug2muP6MdkL1vLLSIKnqMwWQIIvnUYCIp2zN42zcYPpQYpQIYqAmV4OhSNceZdY +GOnlBnXH/ZHXDnNl6AQEwpV1JQojB7hSrrBrTETv5WLdbk+lc9wQToOqKlisQbwawrMQjkDg0QIu +DPkqxBsgtEN4FsIRCK9BEBGCmF7VIKyG8BCEE/QKV8iFurSIOq6UK4B7C6ADTs6HPoeQhsBBO31Q +qw/NgLAAwnYID0EQWTmasxrCBghHIJxiV3TO13VPFbTd13UHS7pXrKpkpwuN0/kt7LR7brORTp9p +pBOnGsVGG8WGVxvZQ8cbaelgI3WXVLbT1GqvPDrOy3mhk15o+BqIMTmGnBiDDbqL86AkBMKJmRyd +c3cXxysfOsLxCHOEw2gxiqSPcrjL7qocZyVp8jlyowj5jPQZV0hft8NV+dC4C8j76FkIRyBw5H04 +/kr+ijaQE3TMIa6H8BCEIxBehfA5BJGcgOM9ON4l7yIneQdVQKiHsADCQxCOQPgcgkTegVglf6Go +xGIK10Mg5C8Qq+TP0K0/Q+wkbwP0NnkbmvZ6V01t5QEGJCoyQKQkA/iCGcDtrewlv+/6ugwwKg4z +DRh1iCtCY1EVV9RVMhzQz99Vd3mkl/ytW0tEdo0bRt5ASQgEWvIG1PwG0iA0QGiFsAaCCNCbAL2J +2iHsgLALQhICYBnEKgSNvAzhNxDeRMMg6BAaIMjktS6oppe82hUfHxnnJb8lLyIfjPhx8muW/oa8 +wNJXyP+w9CVIw5C+TF7oCkfQOBtcR3CPCqkKaQVcF8ivuovdkfQ4FzkCYxeBuAJCPYQZEBZA2A5B +JEdIUdfiiBsecgi9LCMo2YU+YenP0CMy0ldE9PgEQECNRvHR5wEE0UPaQ3Gix3feB6c0it91D0A0 +it+2DSAaxa/fCBCN4quuBohG8cUrAKJRfN4CgGgUnzEbIIh6yYP7i0sjNTNWYm2ck1wDo3QNjNI1 +MErXIJ5cQw/0NU/b9pOu8nIYsfv1RFl5pB30o8O4/WLc/ghuX4Lbb8btG3F7HW6/FLcncHsIt4dx +u47bD+FRMBTtWO8ZcFqr+3H7y7h9D25fh9vjuL0Etxfjdg3X6L0k2jW1iiWTWNI9jhIdpOeNBe7j +JFEY0SjgfBR4whGIX4WQZmc6FNKKjMIFYZoWdZfXG+dDR1euBvJ5Hm58HqbhefQeBB4m6HlAo+fh +Ic/DA5wQ10NYAOEohM8hpCGIULoIGr6dxU6IKyDUQ1gAYQOEzyGIrDmfQyBodaaJz7KG0UZXZBo+ +AwJPnoeDelCjJKoXqiE1oZ7PbQ9hZxjPCKfDpAZ5vcDT3S7Z1Yvt+/5l/+pfdmQZZyF3ke2UdZMd +mXR719fAuvG9XfFDkXEe/GMU5gHzcC2K4xJIR6F17HwECsk0rUYh8jSklV2hRrjN2RUfHDmIHfSu +fZGvQycjn4R6CYAfhw5F/qj18rgr8gfIeXpf5I3Q7ZGXKnplyDkc78WQHNRY0QOhUZE9L7OiG+HC +/V2Rm2myL3JTaEpkZYhdWGJcuHQdnOnOyMXxeZHz4XkTQ5dF9HXwzH2R+tClkTqj1Ah6z77IMGhC +wgDLobFlIVZpLAw5PZERc+bU9OLl+mBpp9QkzZBGSpXSYCkqRaRCKSjly25ZlR2yIltlWRZlXiYy +kvN70yf0BBWc+SKTnyJPY57BKqExQUyuEiwTdAFK5nHTyLRZ4/G05NFFaNplWvLMrFgvtoLxKMTG +Y5DOaNrs8clRiWm9UvriZE1iWlJquKSpE+O7miE3SbaC+TO7qRenadamIHXTHEAYuzbdGaTpoE13 +Njcjv/fqen+9e6yrdvLE74laM3Hi3M8/AC4cn9w5bVZT14innioc35ysZHA6DfC05A+oO+cA/gKf +mjTxAP4HTZqbDnBj8ReTLqb53NiJzc3TenEjK4c0/A8oB6jzD1ZOBilNyyFNDhvl7jfKlcD9UK6Y +JlDOYkElrFyJxcLK8ZiW61xXPGliZ3ExK+PT0DpWZp1Pyy3zcgmUKSlhZbzt6GVW5mVvOy2THMuK +hEJQJBxiRXAAhViREA6wIo3nilRkityeLXI7q4nD58qEjDL2E2YZ+wkok/hvf0vGJxK4e0zzovnU +FdYam7QEQmvyjquX+6lWr3Uuas74yOKtly1aTlPQa5tjSyYmF8Umap1j5n/P5fn08pjYxE40f9Ls +ps75+pKJXWP0MZNiCyc2d09pqK4ZUNft2bqqG77nYQ30YdW0rik133O5hl6eQuuqoXXV0Lqm6FNY +XYihekNTp4zGN0+Yb6TdxGYFtG0FW2C8V10zluHwmKj/5uBBUF12I1uiOanExiftEOilIeOGjKOX +gLToJQf1d2Yu+W8eEw0exLszl1TIdsXGo8T6q9ZdhfyTLp9o/K2DH2Stv4oOuBEn1v2nH1yblNQX +TqSrq9OS5bOmJevBgO6UJMhtpV1KjjbzbLZJvemjRuZQyBxNMzkuW5Dm1dE8iyVT8Lvzf1UmnUCp +oJ0c6sZ6GK9H65q5ZHjabAIcYXbGsXQQFCsqK9Y1QwfX4QReZz4j0+xEAhnniPbZDOuvykCZsVif +SY074ZZ15pBkf3SwEtkRW88ey4YzMb9pnIMbyVWgcaA7D4N0CKRDIK2EtJKr0N3xCEdqIha5JmKz +ToxI4sSI+dTmBGKOFTAcBNDZwZ4Y30PwSVHqJffpeUjgT3LIKvEnMSqQReEk4Q6T4ciC78NDkT+h +nqnrr7tIPV03vb8O1QOsnoVo+LCoK+oqgQiYLjqrcUfP6gL6Fmn8UagLXcp1k2uEg1CdDf0guSkB +I4zSX3UXlVQLvemv9KJ4WbVNtEoCAoEmCKLtM4sscxxBklxndVraLcQCs6Z77M5qy7uY4+sI1u2u +alygtD3hT0BjErQ1an+ipY41SoWjvw4i7HLX1tIwfBhOJIK6gnnJigQRRAaIA399vXrMVztseHMe +N6LKw1WxeEfl8SHvDD8+jOvGvlOnUp8YMZUd8yCrlPWijvZB9yCBw8JnBHEbNbwDE7xCpO1Rz7T0 +ofo+bNQb3At90lltgeO15yrbOpRV4f7yy9Rn8OwbUzNJq/A62HUXsWdbS50guNySrKq9uKobPeSQ +IdVd0kOOSxGnchrHcc+4frqNVdd/pk89A3XW1cNE4JZgN3JKmHYPasNx4qquGVlTJUpweFSM3/vR +b6fPO7zxutLzYgmcSM08jL/Cjs/e7v/2teaOnYd+kYqkNDSgRVezFimDyCCVWKwqRm4LbZP1IQ5D +2gOG2qWO3vSpHlUlcwD4qsfpZMDJHrudAX/XnVYrmeN0RBzE8Yw702qKit9pOXZazJbnxZCrujQO +R5XX5/WopH8jTGLReaXXbzw8b/qrqZn4BP7r4QM7O+b9/tv+tz9LfZGSabvXoj5+NL8PMK2ZtTuC +rrSQr2XuSkESLVdaeevXAr6ynswghBQoc+cx/GmZfrqur049WVeHKk4D6pyGedtPycMqcaSXq+pc +xSF/RaKqsrKqogKaVuKKjoi6qlxRT9RFcKoNb38Kb0+19eF7dtN0d+pK2pKnUu/iW9FxZEWLaUv2 +WoHUnhZ7cYMex1wdIdiK65AVLESuDomjpNEz0AK0Gm1Au6DmXbaH74VROt1y+qQKLQOsprHap/Yz +xKJ4JYmY+kopXlUch0ZVAVrli1LpyJE1+443zK2sHckdP952R3x6wcJLoDXjcC9ZQa4Aej+PjUvB +GrKGI9PxdGhIDJGAsAYKFfBr7qQjcrJF/RBVTO8bPgy1wbR0IR1mpSJAq8kbEfWMI2W4d+9euOEg +dHQL9JFDNeypfkK7VGd05FnE74Iyu3jWlzMtjC6g6d3ZhmeaffD48eNMO0t/RGoB5zhjxA4gLv1u +V34t6U2/q2v5tT/mMOEe4p4Fq/pqhPPhDmBjwKu4jxH5GHDxyb0I8d3XQ1116uk+1cCrLcLQRMtN +6jGKX8ADuoGTmRjmwVUYP7kj1VQg/P2bfGAJc9If8S7hKOB8IU7RFnQSw+EcCPNCfthu9wEj+pjh +NwX0AorgFhdSaA7yKgrECs1DFYDcxyE6Dj1mfe4Uv/uk0/AkkT7pQ6AUBnymF9hsIn2kSnOQqig0 +pnnZR557pn4RL24hW21bnS85BItk85NJeRd6LiiYEJydN98zv+Di4EpppW1R3irPyoLW4HXkGvFq +2/XOLeK90k71Jf/b5E3xTdufnYFsk8ap6dNIQQpMTyPypb8AGrJl4K+QHdmxrrsafessejRWPQzo +1KICZx5nhZvMgpb0x0bB/Y2WHRGXoii9YB42uhw2mwHIdjsA3Y2udYiydAWepCHqFjOLIjlTFBlF +9zWiHeEX76D4A11vSfRBTMGWNgZmhgK3tKGWJJmQ1BuaekStQA0BQ+oimu2X6RPIC8ENwQlhFP1h +CM3NzcFOe34vV9Gzym7nAwB0reIFwIxEfYKiueoeWVXp9bqB8YixotJ4nuqtqhzpUuOxIkmcs/L1 +XVd3rR+/4vWH37ju7gNP3njjk0/efOMFLeR1zOPznlnQnUq/nUqlnt9z737809SPPz+Fl+MVn12+ +GXD8PRCI3wKOWbGDYli3NdtzE7Cao4VMwGqMRXZQ9GgjRyXgSn4D2U7uk/lneGxBokA4i4AVgl+2 +stG10nlCmDrzwD5i/BmAT3UXQ9cQQ1cHQ1cYLb2AIqOJcQz7Aoqgg8wV6LMc9FkC1gRdIEKB7SCu +w5uQwSrajBlhPzgxNIN6Xy12UbnbglpAzLAfCGCCLaIuCBasWOhY17trgasAQ4MRj8ZcoiiNAPZV +Rb7tGff67B+/X7Gev2HsjZGfT3l5AfShDqhbgpELk1JGmwZFWVyq3Z+XJ86xU4JyuRjwmW5RVYDC ++UKYEqqPFgiH6dVwyAFXwgrtYbiXHII2WX0+LaK6CNEi0JSKN2iDKo6jCopgiXoaH6ukJEyyFSpu +N2EV6hani5j1nNBt7jwyJ5xP8+izu+DRlGHYbGSOj8pBNtrfVxulalofrY1Vpk8ZI4wRDwlHxEPS +i/JLIWmq0qzMdqxUFjuud1+fd7v7sPuDwAfBUwHliG1/HglbVVkUXw4F8kOhgBwKAKeUAyHOHlZ7 +yWPdM1zY1Yv9e2k7EW1YNyaKdQC5W3PI3Zold3ujdZ3vdWC0lOTxIbIRaUjFo3TFtbeeLCCryQbC +k4OkGEXw9k5GpC3AeM8kKP9l1AnCtL6vv+Wky03xAaItjqEJB7BjQ4plSFa3BNWQWqiGVfGX6VNI +AkKVIbVAMOl1VDNqwS1rgWrp1NqDkmQnYRDNPauIkm9n1JufoV5XrasKhpTKaU80XgMINXLkiGqg +WyYcgahBTIIuJEq8dLaG+Eoevf/z3ffdcMsD+EDeV797/cz5Tzz3yPzwnj3j6hYdvfnYB0tX/uCB +jrxX3/p0T9NThx/bunA4YGJj+kPeC5iYwGdypIStwK/T+fWHEKYkk1DgBJfFrHan4gxbrWWecIgP +l4WEMnvMrvgLQJHSVEqEmhSnWEKLxysojweBDgdy14KGCnIMOtP3gvqCu1Y9lqikgeLHMMHutU+y +b7bzk1xzXVcHuYu9q9QV+Yu9V9mvy99s78i/Pfi43WpT7A5ewlAfpohAF2kPYbpN0o5H9CiKh/cf +JI+hArJct0DrBGie3T0AL9w5eOHOEQPudQu01RrR/JSOtHZpwE1Szk1Szk3SujiTHXGM4mqcQK9P +76f3x3cM8ffiUV0Fr+ODeBSoAUd1W1Yy7Bjci+/JIFeij6FXhvmfTrRkZUD/SUpGoB9RXDNQLYte +XYLGAXUCGjVTdoTbKBIhjPmYYndaAXf2rnI6Q2U8QPtXldkL/P6Qh2FUiGFUZUUVRSqq/9VCUkWl +Q42XSgOGVVJNFjQRjGKYRGMUK4o39kR+tHLDs4/cVHVhvtu2rnfzisu35fdEP/35tS+vXLr4lh2p +j9/8VRrf6r9vS/KWGx/Of5Bce9OiW267Tdv74rKuxQseGBr+xV1HU19+SO2oAHBAFSwQK7KTEMW8 +w0hJf2MMe0+jXcwIEMGUJKIJWLKyxQQEU7aIJmDJShsTkORMYdkEJFM6y3K2TEY0ySYgmIBoAhYT +yMgxvabR3aQsV+5XnlReUoQLuQvtP+Q5N7AspIicJFhtnATS0G5/mePzOY7n7Igodl7iDpFDoDgS +vEu3Ip6HIuhlK99Llu4XBKteGKm2mmLOauhUDPiMKVfWXlyj2yW9KFYttUdHSDuchNKozZ5fjYhK +NAKKPtxM7wHg5D56D9nr6MXbGOr9neoeVMqdpjKhTv1QZUIO7OAzda7aWmbsbRma4IGzOZ1OEHvM +jWAH9dVdC3LiDd1WVcsVDanl+MLCOmaEAyJCGT1f0W21SntDraLHa5WiEKRDag0zHX+PlwolgvsU +3iJydrBLKvdT1QUpvClKE1VVlYYsBQMFV7mqPDEX58JkZ/9t5Kc/eOGFntQIvOBxbt/ZCx5PPQyc ++0f9K4EhUK03KvwM5KrENJI8E0fcJpCnZGbbbQJ5SmZK3QAcoIRuMMEDCMOo2ukw4pDDGvZ4Qm4q +ZG1Ong+H7A6MJD+oIEyFZgBjmFT8UYZHCRm60X8MmBzlcdVuJqadLJ4WuK6wo3Bn3hN5zytvKn8O +ypY8v6M8wOVZPe68vJcdznxHXr7DaQc+p+fRqnXHLrA3HU7dgzPN2O/k8euUB4Iw1F20Qa4F6mp1 +g7pd5dX/mof5GQ/zgxWh+onf5GH+HZr7MB6BnPhHUHJUl2Pv9/GyyEBeNoCbtVArD/gXG4MW4DQt +wPxPbpGHJgRAK5QrMHssw4RhtoMgJznG1yhna2uhrh1T0UIoZM9zgL7BewwO5/E4QzxTd0N2pxsk +Z9cqJ28KzAoaAF9chtzMZW/A0/LAzuWAryFPvgS6cHzOLzz3rbqlZ8+2udsGPXkXeat//4zb7j6K +5fV3nv51P25XO+449sj9XTPqveQfz6Sunp8687sX7+46Ad2fDpjmAblZiMrxJzmSM+LEEbwAczg4 +KKzbsd0O6lRQKArn261hjEpUqmgxW0sN+1SKOj4mN33M1vJlDKPjbxxX/8dEoZY+9VgLRaEhKwvw +REn3TCyYqM1zz9ZWcoulxfIK92JtvXxVaJO8OfSm/IbXJWl0DksNFiDOiVFlLkihKLtAm9VgJ9Cw +IH6d6qK9VGKajcRUdqG9JQPwpyQHf0py8KdkncrwR8VIBVYFfTu1n+rc6o7BwKNGdYdNogubbDgM +XPMQe04Y1+r2et8C32rfBh/vUzMFYDQYW3U0+rz0UT4vbbOvlxR3J7KmkyErc/GtzxCcTGDCgGWR +6wBVwHpKtZgW7TWxiz6Ays7m4F6MBat9EMMpuz2YX8RwKt8eFJjIDArncKrSwCYsxUuZ1SRKVDq6 +qfoVK0IutYbKSpyfg2vct93+wVNXNo6bcxkZd3hZT/81r93219TJn97+8Z53+mtm3HXR2sceueH6 +p/hZjhXDpg8b+9lfFrWm/vX7jr6b8TR8I37yV7ufO/tOy1PNvQ/e++yzMEsLQV56hSdg7O9g3gnH +MTvm4Y/IvAWECmVMwwjmLYp9HccROi0zmFbLkYBTXmf5XzQDsHIB4eohWY03gG1X4MgQMPUatdVN +P913kXqG2jzU20C1XdAQDNUW6DHYY1E4wBVKa5jRWlV9xoMiIk6UYiPd7pqF3N5tqb5pI50HuFv+ +eTv/zZ5tP0q5U9/2/nkP/hS/+ADi0CygmgKgGh+KoWHkhXN006OgYHgoFWNg35A5Q4e6o2FRGBR2 +28NU4DMnxel9zEeRcFIPHSUdp2mQUIBddPo5033HmaW4LMlxxR6FFvewJ3oYyXnO+SIGOjqoDOpj +bk/DOtvPGiKaDRGNhpxkfg+nKWYz9dM8AM7qRTSTVkvv9DDe72E9Pdc/szKoC1dkGmAGSvXTR3hx +mXeqd2r8Q+WTYYJlGL4J3YRv5NfLbba1ylX26313oA68jd8sb7Tdpmy23+n7jeuFPLeCwn6kQE27 +huKcwRxA1+Ecug6bdL2vMbzuiAVbxrnJMpTIKZ3IKZ3I4QKJdU5dAy7gxMipOomzF9/dU+k3Sd9v +kr7fdIL41yU5zPWSZd3FZqFis1Cx6VQpXucxTXXNo3uIZ8fwF01ZwwQMc56czsqbrPLsrm1hQ2m4 +rLNsoCh9oiukBYAJdGlaBU2GaKCzn+gs0xhXMOROy9o21AZ2WTeM3FDGFoJB0T2IsQW3XYwytiDm +sAXmBcfx+IjqjDFmqsoIcvLyc7hBLmvAK9as+vDI0U9XXrHlztSZt95Knbn7ss0rl2+6femyraOn +7pi1cfeeWzY8wQXL7l2x6+33di39cdngY1sPp0HNP7r9V3j28ttuXbBoy21n09N3zPhZ+y1P7UYZ +fx+lrDAqJ/PO+RT22yIg3UtcINvPMLSkQp7JBT91lAyieOl3McR0MX+Jy+8anLANClMP9wwH53Dk +owaMmRFoV13iHExVjSJqfNPRPpZoqWQct5INOOAsJSKVyq93/ifrZ8hpxDl1SS9n+pKL0eJ/qHVg +Xf9WVUVuRfqU0YELvXrsEu/c2FJulfeKwLLY9YGbwtsCd4Tv9z4ZOBz41PuhdkbLO8/7oHePlxtd +tlgkg8IzHAuoXhWileDXGwxp2EOrjYwrzcH9SA7uR0zcpzCuRbaccrb0mWw5W045Gx6luwYqWzsG +U1m7F2StSQUlJhWUmFRQss6VpQKX7iKuHYkBVAAiMEMBGfzPqlznROAhVAq6VSx9ojuqiZrpf2jD +Lc1MAPI2hyEAYcyzShWThLleiKwANNSpsWREdSmVfJAiQHy3i3kW45iht4fh/Zo93hsXzrqpYSQe +eeiKfWex9ML2vhuu/8cjz7xNXnl8/bVdT95408N4lnr9lRdu+NMaxd+4Est/eg+r96f+lvoi9VGq +++dHuOqf7Dv2wDYQf4DfBxDCm/k4W+Mz1pU0sBVEyULEOp6rwyJvJXWgdiNCfYQPy5k1hzYqy/pU +Ywkrs4ol8LK5CFBvLANUeehC1oHjx49zzcePn33i+HGoka15sBod6CFWY8U62622H9getZ2yCTCl +cWuNdbK10brEutf6vlWyWR0SbYlUJ4qCg7c9baXrIzGhjmeN24iQIEp1vHWUbbRQwdfzROMx/7DT +bGjd6ZNgiNGFEWqM9ff3qcYqCWs6Ul+iYhitbQvut1kHdKAitwvZRZPjmWUTsz/m4gnd85OaKf1B ++AOagubiEaxfc/moqnmj0ZIR9irHJMdU/8To5OLJU6c0znZcX+bwlpThuKW8MF42IjCydkJJo7+5 +8JJoY1nj1ObGJf4lJUvLrg5cX7i2eJP/tsC2wjuiW+IFDrXBgbhZVCmxOkuH2RpsxCZ5D5Hz0QQ0 +jRzqmTCas0aoETMaa4k1CZI4iKejUnJoX8X5xU4JS73kVt2pNoxFxe5dzuJh6hpQLg/iJ1GQPNhT +P6q8GMpbUIw8qFu0EXhEQdPcbZm1r75+aom09J3uh8Fs6UMVfX0twDtOwjDWt5wEyshoNNQBF9SD +5eUVo52lFU6Hc9Ysm807ehonI693ghwZTddVqurBjKhnhkSVu7ayvqoiY1OUUNSnTJ/51X01VZyB +8zUj3SOqSXGsiCeefDdfpRXXVIkiHysqLi6F0jVuFK3k6fofMz1K4zg/Q0tANQ7C3z7u4ZnNuy9/ +9Iu1cx+sLereES4rHNG4dtPTqT3HP03d9Ic/4B98iUV8WdPeqq9ST/3j3dTtqa8mzF58Pf4V1r/C +d6xd+Jt9f5o0J9+e8t4ye9SNbedvWai3rdAfnXbJ8j9tfAjX77qk5Sf9C7c5g6XnNWD79idw0c// +nFr26ZepB59M3nz52xvWfvCjX/z59DvYibVXXtrzSurdv75cXlqAL7z93gm3vbJ0685xO34L2JPu +BzRuFg4CFTpIB8WecYVgJ3+V43w9m4UtOflCDsybcI47RuSzfhlF+WXmlm8MZgrFRJvtl5l7T5uZ +RDEz8blM0Wp6c7zm0oNp6NtMp5LVanqOTMDiMJth5khGzv5G7HCqzJHyRU8G+IrJT0LVymamETLt +TmBxhTpMXSYvt7SqW7kd6kvCC+JR9ZRqk4Vm3Ega1OW2pPpP5Z/2fzosvMLbeQdns1oEnlfsDlmU +JAVgWVQkjBDdTOBkyxqapOTDJcJxNM9D8ziNV/LhLktYEOSwyIm9ZI1uQbLyiU4wIQexDXQFm+5W +NLRE4i5u4F/l3+O5HcBvejHWbQ3KUek9hduhYIWeq07pVYlskNolIv3A+eYfDX5UAAH+/EA6gQK1 +rw8Ioi4ApFRHF3H76FJkAkz5LUP9LDW2J9TWblGPHXMcO7ZFMFJgWtOStlnTkuGZ8wx5NK+ph3dy +snQwfYpunDD0rrVtLd/jIMr+gp2y2MsN15VVsowwMD9ZwYQRaD1bcACSjOEqHOOiXF6Ui5eKEkeq +fkea3nm6/ycPv4X/cd/kolCVcPCbyfhwaiKZh3ceuObOO4Cv7wSb6hPAZRez4t811mkBwfQyukrJ +85NjjbGlsXWW2yzi5YGrhDUW4P/CrTax1Gvh/KXlYW+hBfTpj3Pw/ePvLh/q/kaLJc8dLi8vK0Oh +wjBMUCQcdiHZD/emsvf6czQMP2gRCrvX2uiPiwo1Z8Te9Id6CVWeRDdVnESRIoIo05aKDPXEfIqW +4uySAc8daLubz1UbS+JKiD5XsdKnKRSZFfosJTAY2vgdu91qmuVhjS3CaZkVuDNMn2NAZvXtmx6G +tQYgGutxVrYG15IYM9+fXV9rqeun7seL2Pl0wwdu/M4tt0CA+a0DuUhVS7oa4q7FzB3O1uKCXRZ3 +OZike1e53RgZSyhIxoWGlUpy1HS6OO+K5nizHSSGo5XGako8FoVrNYwRA7yTxHe/sm7psk3b57b/ +alvqB/i8jaMumDb5lgdTf8ZXXBqfMG/07B9tS+0RDjYfWHLpz6pKD7cv62wdzl3s8i6dPnV12be7 +JGXUyskXX0dXV5amPxKuFl5HhbiC7ZtYRFYUEmyYrWxsPtYXUEhDlfZFaA1aX9iObivcge4XnuYe +tx/geuwv2l9DJwv/WehyuAtdhYVcuTjIVR7SIlPsjflzPY0Fy4WVhTe473Dfz93nuD+0Gz9Gdrv+ +4MhD+Sig5qsBnm446BpUyxR4bVCt6gQCCuaFFS4Y5i1q3HkBimugaQciPnPSfeak+zKTbm30xTUZ +A19mp/ZGmWGKXBBeNN/Ys5RoYRMIcwlAxhnj8hlblVroenYigdcGdSvwNd6pqgof7OUqe1bxFiUP +gK5VCmfMFZW0mWUJ7GOCE+bEXVwFUlOKU9WSylWqXPI9z52Xev6DvtQff/IsnvDcX/DgMUeqnvvB +k3+bf8WHmx99n5Dhn3/7K3zl7z/AczpPvDJk1z2PpD6/+1Dqk47DVAN6EGTYPKB7J8yLoUu6tQie +IBvU6VLDTiT7BlDRwB0EJhVF6MBYcIQtlVkYSVisbEeFn+UwomISIhApVM1hVa0Zf7NqKP5AVOp/ +TVT/MonqK5Oowt9DVJnTlgGUNHzYhOv0kVxQkkVZkHmZFwv8AT8RbVbgAVZQYbz53jwvJwY5XxS7 +HRD55VAUe62uKErQde9y+G0EvakTqd9Pahkq83l9XrcnnwCNlUQrM0uWpUBZD+Kvn553c/P6dRdd +f/fxTalOXHv348MnTf/xqov2pH4jHPQUXnhZ6tVjT6RSTy6s3DNy+KRPfvbhv8rDdDfNI4A49Osy +NtRn7FcThbAsSxLieDplVkvYhmSJ4ni+6q6WZnMXaFbNTqwBO28hWRlvrg5lmZnl/4GZWSz/gasp +Yy7JUEFmCqabjK1l+umT3+Fk1CoWZMa1BAEjizmU/He4ljGcnmgmPMIXn32QS5z9A3ebcHBPqv6Z +lH0PHRsw//lNMDYW9DobmyI2NttBjTaHB4bmAY1oNkICtv+f46HbjJ1BGfaV+s5oWMfM/4+jcdLw +K1L7dMBI7Gcj8W9D4P73EdjNvXP2A5Lsb6C9H72nfym09ArgrweAv5bgJ1jfA8H8oIe0luJL5Tzs +5oqLUdTtIyUoTBgD9NDWYiz6wg4uGhYtGMdLS4oHUHpxDqUXZynd3liscRyMYWkrW107yUaGKYWZ +Zba3GaYwpdBBayFr20txaaE52IXmYBdmmWphXLNia5apWpn7xVoQX3TJAKY6XW05kxlJlQ0lVXmy +HkoYTjg3lolrqWUDND6RjwVDgVBBiBOVuFriiUficgkfj5X47YVR5HXmRaFwfp4mwVmRUBLFIRsQ +e74LorAlGkXFHERs2y8QPbVCs4oYJX/UEtzP6cXFUQdzB+9dhbGDesYq968SLe68PIePsXQHN2C9 +2cV2x1C+PqLENYCze33SUAKsnW7ppEYTMAwXdyG5YnvqtV1/Sj3U040b/vwQxvfEn41etm/1pueu +iY7agsndN58aS+qfwf0n1q47gC/905t4Xc+y3h8OW9M+feZtM7Y+dCz1VfvCGuwCHHkMuH0R5R14 +sqHh2QETvHmeap4LW6y7rK9ZiVUgxCYDVxyACnIOKsgmKuxtlDVJEulaLFPGAAV0G1PI2DqOSFdb +PEwpw0wpa2m3YzuxmXhgM/HAZuDB/kabltnVdFS3QqP+C+KTM8SXIwu8GVak2bFmb7C32tfY+THN +/kRLW3Y7U1Y2GOiUqDOwiW0srG2pYAICg6rNWWFWdfsqjkMY1G1ZIIwg68/p2nRxjW4ZjUH82HPk +m+ee6xeFg/0/I/O+mUy6+6dDb44AY9oIY87hBrYOS8z+cyZApMxAcACMs2fMuK+zA45MGIoKiiEw +OQCyRb815oMVzcD7GimvI3STV/eo89hmr+6qaiMdMsxIB5UZaazESAvDRuoPGJvDyu1qtSbsEJ4V +gN5BX9mOdqEk4iuQjhrQe+gUEtwaZO5AnGAsutO58Wfm7O/mnH1mztkZXTWMODZnj/BvNucI6wnz +m7rawVJraW5bW9efNYHoajxTnbL2TzcwR5LZ6UlH/8hz1JqBcQYLRriY4jaZzfhfmCuqqZUto0ut +I8SR1inWudxm7o+cdLX1Le4tEPGUOzHVZJCwje8QnuI/lQUrj0fwb/J0X/oJ3eKOVnMajUBt7FZq +3TS3G87lTMrTtJClR7vdXpr/rj6hAOosKTlPthQUnMeX+/3jwTyRLFaLbBU4ntcEa74gwBlQjgim +rGi1IoHwGFAA8MvKERtGfC8ZrTuHCXiXkBSOCicEXrhApnm2YRLWwDRNSpzUSzZ3/0dKAhZq0/5f +TZMvzgnx3dTsTZzTm/pb2vqo/5AywDpKJnV1NAANUNuX7vuC1M+2SUiyWifXgaXrB0s3eM7Spcbk +n0Y1G554enKqW3HRoT2l+wAQVYerWlYdarWFQlYVUC/ztkVz4hwC0K0VLksRjPHgglqehqJgLSDf +u/u8AHprRToFNnetXJRfy+v5tXRK9pYA6KnNsaGb6ZNx29qWBKLGdhAeKYo8B1PBqJwfQOVVIFKq +MriGoxj+JNfO58ifsNR/H7kljfrPnAKCLyN/7P/52XvJh5+meAMX+XL2TsFjxi57TIDDCkimfs5e +8sReiWSpnzMnj8vqHtx/rYud+Y4OLH6fDvxhi6F6UTUDcaaaxXqZ5WIe6NXvgZb+yTSpexESndAD +lTO4llxuMxgPAWDAzhAQBwYzlh12FxP7QPEACHS/5iAKKW56WXAqnAVhIltsDiRbiNUm0v7ZVNon +G/RpHy1lUxHd5JPp+Vdmz8/2DNh/Tdcl648eVV977SjdEpbIoAgy92NHJMZkRBZzLOZZLLBYptge +oxBh2hsoB1RNcZzzYFlZLJkOLpkOcITtaROwolnd1U4WCWCtYQfo2zCYbE8SfRoD2EMOkUbkRipp +1O0ZNVE0p4s9FtFVzsTpitPMNAGSMjrTksPxDCII6hsQccr5JCjzVyublV/DUCpTlalOrowvsQ92 +NHGX8Ffbr3Vsscs2Isi19pGOGWQaN1HS5en28Q7rveQ+bqe0U97NPSGJbuJ0OIYJBBgRkRW7fZgg +AygrFzsvxjomRJYtVhswc4dDpfPU6m53E/dBshvEyvAuQZN78fC9isVqOhczHkTd0mjVdGWDDdsO +Qrcd2AZlSS8kTozGWXMWgxDTHxQq8JHmXKNitZc07teEVqFdAElCdne7qLwuoK9JtNT5+ykCM78b +nAVyTk+2UPytY+8FmUdA7WP+uC03MXccJMOHoazbrekXSAEBKaffRCT9JnO3TUsqcG1QLqOyp7/q +dFjpxcxurzf2RWsdg6Nsx9e+mlpHZQ0D9w6B3MyurkTz2rYW4CZ0KQnR+bJTfi7QF1qJM+Ogo4ch +tcCS9I2swVFQG3AMu+7FxfiSYd6CEXgBFg6lGp9NNQkHv/3i7vMbfsKd/WYy/8q3I/gT31KO8ADI +uAi1bwhhVMn5TQexbPreuhrdNlOBkv2Kly36f9yTAU7rMZdr/BxZYTEBuS7JIIZkInGcbOEJsUgy +z4Hq921W9eNyVD/OzN8LPEoUBVPMC1nVTzBoHTQyPcAIrkWzYc3WYGu1rbG12wSbnGtrZawvzdD5 +7NDk/87m4r+r9mVtrhytItGSqGP40tJ2+t/1PLb+UVu7hWfIYsolLn1iP4gjWYMIsY1Xw4dR3R8w +oUfWJ9fCEB7dN7lW1isNsLJWAmlEHUv7CgCsNECaGzPeb7HFaiVHPoQ8en56Xx6AhQZYCKCHgl91 +ZsUTzqF6A5EUTkZY+nexZHjxqjBVPbHrgRc5cvDFsynAmo38BsCY9m/b6TdJwCJ8R3gDOVAQGzrR +tIAT56v5+UFfMMjzKp9v89mC/JO+fY4XHJzP5w8SrVB3zcib4dMDTUKTZa46x7Ugb55vgb8xMDd4 +h+8+ohaEOc4dtlk8A+wDTw6SeEz7YF+jJ66B7f3LnFdJJMBFOr2SqRhKdJMInVSJrojTeZXMZXmJ +TjhjylKgvRAXOk2R6TRRyJm1IJ1xijnZt0wypmReIxJz+G5BaNE5i9z007VkkWX6v7960tLSFuy0 +uZmDzmbhCpg1x3E5b5PQVSzq32FWXI2KqiqRq5rEY0VoEd6KR76CJz/dk9p35NXUwd2/xoV//DMO +XvfJ3b9N/ZG8jK/AP30u9fhf3kvt2vtrPO+XqX+lXsXVONiNbT9IfWB45vh+oHU78uOhhka7xLUy +n0xTp+Vfol6Sz9uUMDBy5PMbfg33gAn53g3e3Y3uuHwIpsfwxjsaZebxltWMUDytu+k4yQEtgOEv +4LebI243R9yeVVLs/68Oku+6iwpydZVzXvA2Y0oy02H6i5hRRk3uTofCHCUOB3WU+L/fUVLpCxOY +l2jUBXDW6UbK7pm+6p7mz1IvpbbiGw4/2HLh8NtStwsHHe4l+644lOrvf4bD2zbMv9Vjp77Rh4Hb +7oEZ8KMisoHNQNRtc2D3yNC8yFL5ighvYS/UyCyWWFwMTIFhM3tthQKKCdhMwN2bfr/bHaiG9FR3 +UWm1i54XllarmdSZSeH6n7oL48Z1KK9mUnpdnwpAieOC0AXaLNv80BWhtZZrHdc5N1m3On9sf9LZ +6/zY8ZFTBdrRXM58l8vpcioWd5BEA16r6KZvugh+i8XrCxSEfb9MH83x5x41LHafD0WLGF75/U6n +Qw4PQK6Bm6Wy3oBw3PGAaL5JJ5qYwNwABcwhILJVmRateE1xezFXXOQn39kZlUUv/3+LXuJ/lAUx +ash81/+WofiCk/6MT5gqDhksA1sHTmor2HstxmstQvYtw5wfytisulXWnbVOdbTLPZqybNzGdAYH +cP5AQa0LZIMbgkMP1apgkqhFEQhZZt8c7LIUUBeRbltVUICwE7g8LmJMJoPPhp/h35ZsfF5fXowb +SgCjYwy72Vaq6MOk49hvrn/59emD5lyYPv3cnCvnDolO+yt+eNPOi378aGqYcHDGr6974M3CkuKL +rkq14eG3bRtlk/qv4qpqrpuynL7BNj/9Ef+/wutoGDeOrWW7UGnOrp14Dpzd9wrzpWZmsMAEAgCM +i7By9pw1QCUHtuXAoRw4aMJgC/kzCEFMABuAPqhxEbeIX8et5/mS0hFcbWgCN1W6sHBSZGLx5NJZ +XLM0v3DuoNvzHDHqkKTIU2wCJSYQN4FSE4gxvDIKG0CJCcRNoJR6MCZTaJA9XkyKudKSkc7q2MSS +SRXztMbYnJJVthX2lY6l+Uv819mut1/vvEm9qnhdyWauw3a7vcN5p7qp+NaSe+w7nTs94YyZMiQa +dwfjAUu8DMcRKgu4+crhcbQEWI99yHXB24MkWOK1DwmXluASwStkl1CE8BBLOOzlmKii7sQWw+9J +kxb2jkxFn3EE9SElxQ67TYiGCsNBWQIrl4i4pLgI8kQhHBwS0CkNbQde3+dFQ5hjmClwKtZwA27F +a/AOLOJenNSVIWEtL2/8HFqxQEnaTs9oU6AHF1gGbKa05PAHy7nNlJY4KsNlVMw7HGROGe0PI+Gy +QGXU3PgVNTlB1NwjCWOE426qadK73CYHcGd3BbhnU0ZRMDzjLG6ZfjJBd0RnVuFMuc6W4uiLeGp/ +S4LuiEmcpiMFRE7VKbqS2kz3wrSdo3Gce8IoPrgfB/GQoHeIwEzoITZvmEkfL2euVAC5GlvDwqSq +MrPYU1zKNkWyN4gya3eefJ+X9zF6FkFziM/fb1/w65tWPzWrYf6Y1KqZly+7+YsfPvr1ZuGgc8+T +yYdrR+G3mtqv3/ztT19M/fM+/Ef1yjvnjl83cdKymG9houbRJat/tfjy32x03HHXxktmVFWtHDRm +79VXvbpuPfu6wTDQIg7SPSrYxywG0WS5kgmIpvdR+r96H0XT+yj9X7yPwL8FEgZkQ+wT05Zesq5b +M7Zc7Bc1TCrorleM9+KMv/dj3cb4vJxh8l+Y/o33TW5/1uTuKcNypk+U992X6+qAqQcF/2TLhyp7 +s74+48bN/oI9SBbZi/+gxDH+WlmfeamGvfGflyrkO1JBwb5nzzf/pGP3MOjP1Fuej8cYX2+IO5v4 +Jvklmff2Zvzm1fwYeTJ/gXy182fCx05JQcRFXxAVLfkDBGZ+DkHkmwKzuzE/TkwLimQtKKJmVk9O +GBYUadG8WPM2eEmrd4233ct5/6NWtq/RzhZSTPvPqmXemjKkp9WkHWtWelr5jMfCkJ7WrPS0tnio +JXVOehqewOkq6MS52lmf8YmHBNXLRBeM7b5VogURm2GqUGUMV7ky+vEIsFaMvb8uvvW5xalv3/ht +6ps1z03Zc9Ob+4SDZzvfSZ199C5s/4SbcbbryN7LnmPfAkAW0MIm07fjwECnGCwMNl9xM0UDD0BG +5MgD1iy+ycJogAmSu5bxRVbkmINJHFk6sKQ/zUo92YR7Gq35dvsvM8/90MzExZm1bGIC1oBpndNi +mV1euNj0+gOQ40jT3XTdj2nyViRYZAEToeKd4+o7x11VVciw+ujm3uIKAZejQVyJtUIZprQqt8u3 +W3YoR5VTik1TGhTCE5tMMhueLVixMT9ffT3blAR3Wy0WTRbyZVlAQHxEyCdEsEBVn2hWJFuWyHgJ +JVBERi0xLjUKJbXtrvsKMyAwIG9iago8PCAvTGVuZ3RoIDQgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRl +RGVjb2RlCj4+CnN0cmVhbQp4nNVaa5vjNhX+7l8h7jZLXEuybrA7sEsLpdBC6UApk6U4sTOT7kyy +TWZ3OuXy23mPZE+cSEm3tHxg9tE6kXXec9HR0TlSPs8qRv82l+ytpmKX2+zZeca578ND2IqZqi4r ++uPs/CZ7azGpJnjHzhfZRT4VQtfFROgKHzUvnp+/F0bwfsTjM7zkj4n67OHlA3mg1CAV+Kisxwud +A6oUZkDl+4Q8bwqdz4tDWFEq7YQRjJdc6krU7LzN8k8f/orzz7KJKJ0UrrJscmTUaLAsgYZ/NFZa +brnzY0XjkXZvRSlUrWqPdAHBVL4uJi7fFhPFHalmCtk/SWZRVkpoZ1lVKkK1HpUrQh3bkIwnzobO +XknQ8MrUwstUBYHMIaUuuZZWCnCAgNwKGkZw8hBumIppLiJr56siGo0Zk4HiUZgKNS08ofOe45jU +phQ064JpJfb95yRyQH0SHsGhID3n5Iylpj/jlbVEunPU2hIPbi1T0pTSWGOI20X+cWF43rEZzUR3 +uVwFcdcFr/JXG7YtXH6Ltt4UE1nl92y5Yh90d+yTQlPni5KdX3WbIqsBsV7N4W8du2u2rGGXy801 +ewHS1fpuxWb3rHvdEQjP79erjjWrlq3WoOlK9m63YVddg7dcZPktC0qFmbPOueAvkBAydSTY9Xp1 +2bXslj6v2XZ90xHk3dWazQvTy+7HtSt4k7h9UKO5L6cZiXzPrtevAdE1cxp4xTwRDYE6bFNAH//i +xXW33V7fl4HmZbMkrjSIvYTWMNlyTmNL9hG60nK3zYpcPchLlvUzt1hvLrtbdrW8KWGUHDZg7YaE +fw3oZksj8bajGbD5LXgBAeMf5F0ti4nNL68KrJzbwP6mmJi8aTu22HhTLbtVu/WG7lbdzbLbkqVh +8WlG6Nf3R+Tdkic0d545uQOEu1pug9QQETPc3Gy9QVY0faxt7jGWzZsbeBHEszl5xXKa3SyJeHXJ +luQPi1cea3UfDLhcXQbFn726HVyjCq5B/pMW7a7x6oJ+vodB2l/3sYSmkcwKj7Y5sLd4t1hj+CsY +AjptuyIj11h4y5DveIOu74JcxUTngYuXYyfZvtQXXD73MiIq+RVmscKYkXq0ki/yc0/6yR9gvCp/ +51e/L/D4wH85D8vsPLz5qP/qQx/ivMvfb8gHvZZFlt40KgpUNZo6snHw/CLab4hGHwa3/LmPFWGj +w2MXKwxXZSWV0+YwNI0DB7yJIgfzVu491i9NmE64EDTIaiFwmGoIHHD3bgNvFMpHD79ZGR9A8CCf +2XmBCA7QBxWT0+D9uOKdx8efhh6ILrS/BNghxtAybMK6vY3B9wMMmIQYY0OIwbPzvRRoiPs41rhR +qKHlVQ3RptdyCDeeJ+03+IcHXEbU1dHkoQm2pejRdovLq+VnL65vVuuXXs7PNz6ovXp998X9lw+6 +BE2ekqM9+yWsz/O3C+97v373N+/99nc0C+9/QO7tfRGOiY8fFhj2Rz/4o/M//dmjf/yXT/4aHG/P +wbkZO3iO3UvWShvrDnfWC3I00zuoRrNo7mwiqb9Bm6HN0VpyYLQu4cRT7MmU+vjNNF4EoFpAEpKG +00aKJtHq9HJQhvBqNIWmv/Pd731/CpIf/PBH03xa/PjRT8g2k/Ktn/6MPjx+cvbzX1xMp8//9unf +//HPf/07cpapqCFbDdlqiQbMGmlabaZCVWh4p/BO4Z0CT4V3Cu90RVkgGvo0aDSldug36DcYbzDe +mCnUQONoAk2i1WgKTaMZODDmaio5RnGM4hjFJYmNJ0ZyjOS6/w40URXcUqbIadLxFOSheEqEQgIS +dd+hivBdU1o5lRIMJBhIMJAQQwJcAlzq2B5SgqCuKH7iyfunoD0JT9l/r/un6vvBqDYFdcFsEmaT +MJtUEIyEh+mkAj+YT8J8SEPReFCMMmJHT9k/a++4+KD6DhDBthK2lfAjCftK2FfCByR8QBq8NyaO +riOt4GIczsnhwNxQRERzaHBgPgvOzOHEHE7MO7RF6KO8TsAlBT4IeZaFTqwE+EYFH6gw3xUqhwoJ +diUAJrAaBIAEgASABPxaUhoKEMxehYmoYNtKZgCAFSooVUkASABIAEgASADINkggASIXYfXVPPTV +AKoBVKOzVhn+A1ANoNr2AwBWA6wGWA2wuj07mGUaBOR6EdYsMmxk6GgyACggK7xQAFYAVpBQAVQB +VAFUzftxGfRUAFKLEBw0gDSANMTTANEA0Tq1jjHzAi6OsJMMCBpcNbhqcNVN4KbBWUMdDaYaTPUi +RCYDpkZETIgBVqIUqZBm5Jm09ISQRvWfoYEBoLEJcxkIYqC+gRAGQhgIYSCEWYSQaCGEheYWmluA +WmhuAWgBaG0yJkqT2tUtGFkwsmBk53H5Aq0Qa/qFe6iW7d3GdkNiYSGfq5LGqVKGcdDDQQ8HPVwd +0Bx0cdDFmbQeVVIWB7O4fqdwUMjRTkHIsJ5LeaSDOd2CdpUkG9TL0vjMCo3THo2wL5Ksm1QJDgoE +ZURIcr0qdjuii6pPIkOsFhWYVirNTCaZ8fQZAVmjgX80qWQPVBBRpvfIBjPQpGaAsfR42L+BMzWw +fQPbN7B7A69tYOZmETbuGWZ7hjmZYbZnFGPoidmegdeM1lZGAwA0A9AMQDNQzQA0A9AMQLNFYiIp +HZiDcC6CvnOgzoE+V/13oM+BPgfwHMBzAM8BPAfhHMBzAM+zPgZTXtECrIWYLYDa3ilbiNkCqAVQ +C6AWQG0fKVqAtQBrQdx2iJAt9O1itwoZG0dkRV4sZKmltbUN++D/tJweVUW0HfTZ3gsC/1pVNtWW +fd6+K6dRGIesPc3lSJU9znwP8l5s00Pii8XjS9fMxaW2olLb7SrtNPtU/X1QfvtCW+8KbZaosadZ +XGWnGYba21Ht/U1K72m2X3zHpffYxsnSm71J1W1C1X0DMuQbuS+600x8Ke7BR6U4leGeX/AfqtqG +UhzVmKiiojs7WnUbqrqP6BdqcXKch2L869fi2bgY9yXK7pTLCab1+Dg2v17e9BtWdDy6iI5G/RvK +kfP4lO+LxCnf/ple7fSpw7wv4o1zOPxtsOGh7H9M0fLsQCXDS4c/7RhC1gibBs/ijecpGext+u9Z ++rTZs5nzgTUwYis8pYPYUD8+iywxnOjWbHe2SyeOL9P6UToxm58dogyT8PkJKZvmCFmVbzzZhMuy +pjNlxSbhgPpp+sSU508Kjvoi/zRiB/Mii+V0HI46y/L+DHieSKLY/h9FtXgTJdoF0Q71OHW0/z1Y +W/3/gHXfAIzHR/jacM0Nk6VDTatUOP/3lwpYCLW2RvkIw8N1w6H7YZAYDSD5bMwDdRjK7hGOv19w +JWpHVETUjxzW8f7S4jV7kpZ+ER2qMfkTVrPEZUVXxWM9zyGMcOevBmrJlFElx+JX8uF0aJR2urO9 +I37hg58tDQis60NE7MbDjCQki/02mtAT1PEM2lJjaVrJaq9Q2AZCTn4QkvPZsZuON742i0LELBHe +h5s0t3eTFiMcvTlDLa6P3Jz192ZWazqwPnVvdurSLLJMc+xwVhtZchTtysRHh99+Ghqd+Oxd89g3 +TEAjlFMZafqCx371oWvE5fDGh/s01B1moScvfMJJ0Rj1ZZ/s+eudUQ6qTuegBxloljqL/tayzwj5 +MB2tKB3derqHzHPIOutx1hkhpdJQt0tDhyx0nG9GGMfugg4S0NO3PlkeZfKDGU/eA71Z6hnP+y4Z +JTGPXQyNfiOgSyqSEQoUclMKz8pF2eEiFVJR7sdJZ5ybXiC3TKWyEhkqNqy9m/XhWVfp7wf9bPCh +MT8kXXTipVnlA3wd8r9FMoS/eTZNMUrkj478mgGTk4rnxcPNmU4TItQfyfP1183zx8PoRxQSVhj/ +voBdhTv3EruwxiSWdGIcXn15CJpjXkTpUpPuoi174oibrmkj9QZ38U8oDtUZXfhF+/Kg/qNo+Ghj +jY9GB3M//Pyg54+Fs00j+Sz+xC9bRgqkJamOSXK4iW8RcU5AHBfhOOERK0zqkg45K5pgIWladhs3 +0lIkk7W0o3xSpvJSg1H1V+emtaCNfoelD7EqpBuK0kPKkQckN2RxI/RU3+zYuLEUUNLZGgFr4BAS +ZMrApa2scqfEm8Q6HFNVcVJjh+WvFN85zz7M/gOSUtWRCmVuZHN0cmVhbQplbmRvYmoKNCAwIG9i +agogICAzMDk0CmVuZG9iagoyIDAgb2JqCjw8CiAgIC9FeHRHU3RhdGUgPDwKICAgICAgL2EwIDw8 +IC9DQSAxIC9jYSAxID4+CiAgID4+CiAgIC9Gb250IDw8CiAgICAgIC9mLTAtMCA1IDAgUgogICAg +ICAvZi0wLTEgNiAwIFIKICAgICAgL2YtMS0wIDcgMCBSCiAgICAgIC9mLTEtMSA4IDAgUgogICA+ +Pgo+PgplbmRvYmoKOSAwIG9iago8PCAvVHlwZSAvUGFnZQogICAvUGFyZW50IDEgMCBSCiAgIC9N +ZWRpYUJveCBbIDAgMCA2MTIgNzkyIF0KICAgL0NvbnRlbnRzIDMgMCBSCiAgIC9Hcm91cCA8PAog +ICAgICAvVHlwZSAvR3JvdXAKICAgICAgL1MgL1RyYW5zcGFyZW5jeQogICAgICAvSSB0cnVlCiAg +ICAgIC9DUyAvRGV2aWNlUkdCCiAgID4+CiAgIC9SZXNvdXJjZXMgMiAwIFIKPj4KZW5kb2JqCjEw +IDAgb2JqCjw8IC9MZW5ndGggMTEgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCiAgIC9TdWJ0 +eXBlIC9UeXBlMUMKPj4Kc3RyZWFtCnicnXoHQBTH9/9QllvuuLOuXQ5UxK7Yuyg2bBgRRYqgFKkK +SBUQRKwvIlKVIoiIIhYEERVBwF4Se4mJ3fSYqPHrLM6Z/b89jTHffH/tL7LsvJl5OzOvfd7MGBBj +Y2JgYKBxnG8/ee7E8QsGTVgW5E0MjAkhBvg7XGxGxI4GYidDsbOR2NpYZ96JLepk4vV2LNcZW4Q0 +wyfJaY5Po/Yt5HdLfHT/piUxNjAw7zNkhN2ykJgw/yV+4RY9vHpaDBxgM6SPRaBPUKT/0j59+nz8 +poX80Y+lSRFhy5DTzazBh4ZW3PEYuMhr2fJsmyHDelT27jlm+Hwfi8VL/JdGhIXHzIpaENhvrl9Q +pPfU4LQQR98JroPcZ0+a7DAzIDR6xXi7iVPsp02f8dkcp3nOLgNGHDtRW2fZpWu3RKvu1r369O0/ +ctToseNs3RZ6xsbFr9xRtHNXye49pXvL9h04WH646kj10eM1J+sbGk+dPnP23PkLFy9d/uLLK1ev +Xb9x89btu1/d+/qb+w8ePnr85Omzb7/7/ocff/r5l+e//vbi5avfX//rDRWb3jLduz+kz/M25hSk +bF+/dUtSekby2nVrNkAuIcuIQPJIW1JM9hBb0opMIBPJbDKXbCAtSRvSjpiSUmJGlMSctCfDyWSU +gh2ZSqYRBzKPOBIn4kL6E2cykswgzcgQYk9mkvlkEulJZhGefEYGkymkKxlNWpOxxIZ0J9ZkAOlH +ppM5ZAFxJV1IN2JFepBepDfpQ/qSgWQQGUqGkRFkFGlBOpAssp3kkp3EkBgRY8IZbCQmREH8iIqo +iYY0Jx1JJ9KZaIkFsSRjyDgSR9yIO1lIPIgnWUQWE29SSHzJarKXAAkg2WQXSSQ7SDzZSpaTMLKG +bCbRJJYcIGVkHykn+8lBspEcIlWkglSSw+QYOUKqyVGSQ46TOlJDTpCTpJZsIqdJA2kkp8gZkk8y +ySVynlwgX5CL5DJJJV+S6+QKuUqukdvkBrlJbpHd5A75mtwlX5FvyD1SQNLJY/KAPCSPyBNSRJ6S +FJJB6sl9cpacI8/ISpJAxpMI4k+iSCQJIaEkhqwggSSI3DLEpe+Ci+SMxJP40e/JS4NxBrMM5hv4 +GCw1iDXYaiAadjCcbnjW8J6RyqidkaVRb6PBRsOMNhm3MLYw7mk80HiU8UTj08b3jJ8Z/84Zcmac +wGm5HtwcbhEXwH3H/WbSyqSjSbBJrcktxQJFmGKv4qjiNW/Me/Ah/JemVqZ9TceYTjada+pu6msa +YrrKdKNpmWmV6UnTX5STlbOUq5VXlfeUL1W8Kk21V3Vcdd/M3uyI2T11sDpSXa1uUF9U31Q/Vf+u +0Wi6az5v9lmzRc1imiU1u93safPhzf2ar2qe3fznFpNbuLd0aenX8lgru1aOrYJb1bY621rRunlr +j9ZrW6e23tb6futfhDnCEmGlkC7sFc4Ij9vYt2Ftm7e1ajui7Zy2i9qGtE1sm9l2Z9uGtnfaPm9n +3K5ju2HtN7Tf1r60/fH2V9t/26FXh5cduY4dOvbvOKmjZ8cVnSw6ne90p9P3nd50VnXu0LlX55Gd +Z3c+0Lmu8/XO33fWmbcw720+Qbtam6Yt0pZrT2tvakULM4swi58s3lqaWnazHGQ5wXK65VxLd0sf +y+WWqyxTLIssT1he7WLQRdVFgFrRptagtpbW1xrVthG7iZm6bia1Oi9BtKH1OhuFpoD6CaJntc7T +RPOQXmwyFViRziUjUowAOK8bBdSJPgLd59PCIIYmAuTPzgXxMacJrdopdFfSkbRJYNeq6TUF82X2 +SNGUUju6Wygp2plaBnxdnbdV30DvOW4u52hnLdAAqqCGVHWejy3h2JCZzJZpgS3lmc0VW9qJtvz6 +W2r6q8MVZmQ+B3xjgwN5zURq1+Qm+Ck1offpG4Hms/y9e1k+zefYCWOKf4OwxPI5DVthLK6v1q03 +0VAP8YogkVHGthLpyeq97PALo3uxdsyGmfJbFolqyKOtI1NDvFkEcI8vUBs6APD/688uW8F0cIpy +9OWzQ7nKzPwtx4HXbKCrRXthqrKaJQn2Ss08uk20EKYpNWU0V+wqLFCmHRJclBpHGout3JUa0UVe +zbftqv9oZ6IZRQsOCSD+xhbEQsyjBNCd6CMv4glcRE7jVpsg0Fm06xXaWwtXg6pm7fLI/2zzaOCL +cE3dYOs3yVtZPCxkFzOjuSsgEesbP0nSu31dJWLZp40kvXK8L5G+msuS9Dz4lERULwdL0u20MbCE +H+xhy8aZa4bkiceEzBX0AHATmb0dGzSATeW/CqFRTYax29kTwCWbSHFBBaCuDbTN3Vt8XCHXf3I3 +Zg3MG/8/Z9a/TOZzCrmxt5xoG2zEa7rRW+IKASrDdy7OlaSXk8ZIhDuZLEk/HccRcLZxUZ9X5hwr +gzPQ4LdvCsyDoLglEXx6BFe0ZVtKIeyH4hUQBO4rli4K4VMiucKNWRsLEiTSrmcWMksskQh/O0CS +fklwgRB+wVJvJpj7KmhXqqz+UasJpd7iGEFnVi2ayYrmKysajt9eHj9zdWJtxo7ncyK576++otZA +vfF/T2rd6yofF8ndHd/A2mAjHlWWdpF11sS4uyzARvpE6I0i8xWPiD8JdkqND00SuwkzkXOk5hp1 +brIXmD1K7noCvDOjZntWneHoFdpeoN2mnBltPhjcnf28eTfF7vJ9FSeAP1kRyFqwzk5OjlpfiEiJ +2Mozs6XckchLa24DT6depAO+02q20HixhzBLSe2sBAcle6cbK0y87vcvan3/7i1zuIZL2XuJRHr1 +6SlJWTe3SaTNjTs8E3ZzgWmxGbANslMzd+/kQ7M5r3BPZ/CDhUXhjfF82WqqDuEqk7bHQjDvEebV +e5xbaZ05HM7NqtnHB6ZzkauGB8IMnp4QNwuzcXK2dNl+YY5ytnhfcFRqXtMgcYrgrETbdxfHCx5K +zVSkTBTclBorNKVqYaFSE3aEaYRVyav6coVr8zbsg1Ooj92bOklkUsBgiYw2eSaRjMzLPB0qWl3M +h3w2EiDmTJw129qdZlfnIiEYCSfj6WidFRftIklvL9dJ0ottO1DugyZI0lNfD3zLDZekZ/2PS9J3 +3p9Lknh1cjjEgW9WXAqvocF0zBFhpJKeo9bCKOU9FNdopYbmiZPF/oKnUvNGXI+kicpi5iJMUmqu +VjeNEJyUtDe7IMzDCUehnrcXLJSaL+hjbDceu6poGIr3M6wcKTeer9SAOFZsL3wcfmNcT7a9O83X +Dz8UCfXxdIyu5xG0m4Zq6ipMV2L7JGEG8kppbGopDEZFUje1RC8wFPzdlzjxmV5cSeWusirgj+xN +7Ic+KGJOBBp/5HsPSjdxL1zrh5jrRm4Q2ERUsi8SgP06VXYPsdjCCVvkciVVxaX/Q//hEOrp58xr +2NnHTZOFRKXmnphHowRXpS6ezhX0bHW3p4Zjx83YcXwuNPGcZiflGwRbnHt7erVplDCCaWzZFO1G +mBoBsVcA2C+T5HFkYYfR+KV/UQJwiOGjgoPLn+/M3J+1NTNlJxTAsZictXzOlm2PuJjUqJQA9Ja0 +/xlcC4i6FQG6mrFhEEVLgKOzrl+mGi08H3e0e8bFzDsn4SlPDZwqWT/zcN2Pgp3YUGtyrzFsYPf5 +wUO07ouvmPzaGNizl4tHd62GDaA5TeMF1ufdTdq/yGTUVmj6/O5WTuMlWtAFAlzxr3DYEZG+fPPS +z2uLrp+Hx3DPuXYYzATXqHm+fE4YdyAnO7UKjkHZciROi3S0W8SnBnJHN0qkxTY0L9KsuUTMfZeg +13nxAh1r4A1J+tlMIxGzjL6S9Oj3V7CQl6Q9fzQ6SdIJg7FsqrmfgrpR63O0pzy2Kzg0CL+7Et59 +PmolhNP+AE03Oc1Nukb8Rag1eVa52KqL//Qu2jWBaSZ0/MMnVENNZ59ivbWsJMpEv0Tj5SUqBCgY +gRHhFd0g/iDYKGmh8UClZjdde0gQG+lMRcHAqhSgrXWT4cPC6nvtwl7cEHpAoB1gh+MhANrXByIc +WQfUUJopthRfC2OUfu+IMBY1c3RTC5QLm6wLZXZiqPUc6q2rO4fRWGzgqEInB6n6q7lQxPxhj1MK +gO7Q9HD8RIr8iXfDiwTxQKrit9NsBUD49VjQ1Y+Sa+fKtRo2moaLv6EjYVPYDGEuKiAtQSNg1sN7 +sy6s15NZT7QXoXrHgUP8fsXS0LBEN+AXOh6g5rRV+ckr2iooWFucxFOzEm55hk3+CPSUzu/UOJxd +hXcjgZmFZLqDrlCvjuv1UXMzjaJJAgbzhdNikGiFRP9cakCnctvTBUQWYy7K9toW7XVH/GBmzS1C +h5G/DUmOSDq1gpoyl4ds6MoE7DsT+zrmM4Eu4zTO9MeDwiK05Vm0samd0Ee5W9dR6IvlmWL3BKEf +vqQ1tumvpHPE28IALC0ToUoYpNRYUkCRDUFTUtJkfBuKddP1b8OU9Ix4Uhiu1NzRi3WEUpbKF5ME +tqkhxoMutc6Ffbc55oBe6KOYaDe95ozDt4XiTrpBmIBvg8XL4s/CzXwoZAsBIm9Hs166hcxGXHhm +O5JQRJGXY2mYrqlBlntfeomKAlvMrkyKgkg6FaBwfiGdSo9wO3F5RtCsK3KnIdjpYBTTsnhuAF0l +HMpFWjjS6uKpPTtNe7KC8ETsvQh7L9jKfOkrTvNQXFgtTFZqvqV1OJnbu7owB3RJLZLdwpzD/ePj +PMAW/F4DdQDaYktNcV3R/p3bqoEP1b0Weik1mfQBpUJIePTaQOCd3fe//LGk4vTxageGiJAFMAUz +ZKpZfG4IR4dcoLYUYeJSntrMuM06sZa2iNp6nJvxL/PTUJZbWoaergONEc2FQFyaN02W9JoQrNSt +/xrL9IHYRViqJ2ua8vBtjA4QOLJ31PJD6/dk9gcr+gTE2MogJlEGMfUyiEn8/wUxiTKIqZdBTKIM +Ymz/CWLoT2wMjlbD3O41aYS9utFfpu8Rx8Zt4Vx02+ToxAbTeVhhqWSxsfjUuGRinBG5Oh1nUkPb +fHije+hQoYuS2WfgU5NIuetC9LceGzaz5tyR+PqkS0C7wpWb8B08tz9qcWL0weBiaIQLR/achEoo +Scpfw+cOP7oJqDEXkeqUPRmYEqbYwwjoc8r5jctjr8IwmAOzPPxmgw8s3eKVz78UJeFdXmlTnkJD +O4vdaYiwn91VOMdALCeqqPKvEv2WvRK+h2sF+3P4NGrskhLbl1uWFL7eHXjWaforOp4Orv+NttKe +gEOrS+L5zCFVkEqVnP+26dvGYBN7ZoDuwo7NpwaWdIRWI9o1DaGXhK7KWHZH6KbU9RLffiyIbelb +wQolGkCX0G8FOoNFcm5+oatmI3xfcBYuQkPWibpjfOQOwW7OlBkwBGzO21IDeAr1R+rP8jdsUMGg +0PlgnzfcsS+rf8o/y5+UjWIOGsD9KG6dZ3C/xQ48ujVX7mx1+SH4gm/0Pze01/xpo81h1mHXfT78 +nVph2T6fo3CKP5q/59DBwqWO5rAo3iPAF5Xzy0q9BDWe1EfcKlg8iN0Y6pYeR1t7Mm78+hUHffJS +vqbkIGuTk3S8KCVvDDXkaIc1W7OS6+PSWGuv47Rlcs78zIQETgYtZrStYI1qMesodRN6yHpD85om +CD3fIxpxBOoMO2xs8UkxiR3R9xhJV4gTBObCXCj+7tvPxqDtj6bDke3Ib7EmwJ+OYSPYaDa8LIBi +Gw4TGP8mc4Qu9nOXhfDbQ7iKkr3bGqABqoJgLvhLUlNNgyT9GEDwMXGcJH2bRfhuTAVh30zZvi25 +5vELTiJa2YB69cJHZ9moet6yhbNww+s6aw18zHsNp2niALFMYHPZWNaHebBgOtyGDtPehUc7Go7w +ccWcg8+MtdNQHdox7U06nzpgtqiivWmPn2yZNTNymOSujYbkrC0H+Zyfy6gFh6P5AT9lUlwvSdeu +mUnE2NUWaZMPI4v+3ZkFMxlXFVuhPQoV+w8/5VfNwQ7iQDTPazRRIu2/wLff+MQaDDom1PhHOoB2 +7vEGgVAUmy/kQd7qrER+XSgXYOE1eTnw4cm51dczv72Dcd9tB0phURxNfOdXlcNp1qC/bxDoYNZ8 +dxmbTWey2Wzm7kBOM4RObxosTJHzlEaaLZxNKvBNHsonMUMuyaJy3tNkPqWQ806Pq0h/xmf8zG2l +3JyDi3Krck8fXEk5PulnbvWznIqKdH59ITco2WtehgWfgV3Thkb5zk5CRTvwVVOW8Edczds4hZwI +pdMyYXZGVHnaIz4DlSrjjVf9oDR+fSRXsTrHe/VAPqk3t5Jxp5dUxS6KnbNkK+P4jN5c+sA4b+/V +sht7mlZZn/SGT8KuyY8Kys9mYLIkjqV7BL+lccneMAs8y6eCCziFuzry2yO4A3ty0irgPBzx/RJO +QENRzSle1k4v5iEEiaOnrl6qG5uzhjshbhMWKzUBtELMFCx0z0vWvxGfc+7MRM6fAzGQvBLs3kNP +iJ2I0PM6Qs8tCIGjxJaYojdzT40exgYirkl7hfiT69Zoguhzd/r+rPTszTL6PPgP9PlS3CTWCZdl +a56A1twYxTi2kqlpQqVMQvQSeT6WTmM/nAFu+GkhyEPvuX4CcPSAD2/jJ8jQKhuRzfjt8DV3f/+I +U/i710Reb9pT0DWrEZspXJsMBPa8hj5XaBKoD3qggJ2ca6StE0wAzIZGbHoiSRdOzpNIQJi5JH1h +u/fx4r3LwBlmuAbMgVBwSPMq4hMeeqHLVnFHVjQmostuB/fuw334WpLqxnaXyODjnSXp84Z7Ehk2 +6akklc/ZiunWMDNJerzfD5Hr+ddwCc4eyt+fzx9i8UJlKHds+zf1cA++laRz0/qjEdr+Kklbqq5J +ZOjJltj/O1OJWNtdRWzbnkqkw4kBUA2ny/cfhxI4tSp/FZ85pnITvOEiMhZsnQxdYbwtzmSsRPo8 +ccOZWLeViE/nYkm6fPfHR567V4A9uIcGu6zkUcEjxXuCl5INa+OFtp0gGoulQhGUrM1Zw+dM3A9b +KOFi0pakLwa+C1OPZwOZ9ctJT7Q1cCb7yDF+ZR4XGbcwwQf4Ufa3qZqafVF9TsueMHvBWxncxkfO +Ph0xpZkLgfHeoTKW37l16+YS4Ct3rZinjVRErg/a6Lpq3qoVrhACfkWLTmJorszbUcmnzKVt8mDH +kpTks/A79/WC3Q7m29lowUexyjcqPhYiYVUm7IRijPXP0FW1qCQS6dpRdiIz8U3983KJGCakYBhv +vUkiBolh2zbxaOEX6UrBV8nuUhv8o0kX+9BAATNH6qvQ9fMQREOortb1kwFYAjYdJ9C3NYq64si5 +E3yiJ2kRavZgi78FyA4uY22oDVebcboMvuKveR0YZM58ok0uLAf2vX57bbaMcdlXmNp8WAMfqkLf +sgR9iCft0tRV2FcaNlcLy9YmxK9IXLUqORwCIFAO8Lu3ZG/Ly8rMSisCPpnNEb6srblxe3rpoqku +bna2F4OqtCisYPRG/krNI+qFaT6bsBpiLsWDbtwqNikrjnK7g6g/ty2ucHUOPIC9R8rreBhAbQs3 +5rmkJVwHeuvPDmwrF+LhHyDD+MhdD7SaclqFkPWy7pej4g8mt3ZAAUsCjnWdOoyZMtXjmbS9lmUc +RReVga68UY4BQ2hz5ikEKDX9qGuTlXBwx8LhWnBaHxIXHpeQvC4SlsDyYziEhtSSnKKc7DTEXHw8 +2y9Qg7MXXlMD20N2zGDOrC7M4Kb3DS1K5i1dIQQp5zMbfGIUC2bLhEfwRePuEj66hPMOCYp3AidY +tBfXaD/KeCIKuk0WCrpNDQq/QwDhX1EVFI+8Eh2f5jqkO8aHRxi7pFu38PEE45l0u1c9zAa7yokU +o1j+e4eGSUL1W1P07AMGfZIpzBJVSPRXMkuc3idk+qBpl7BMeX/c39ouaborhCjZDDb2b211TQf/ +NKjXrPe/sXkuhCp//UwIU7JWrP9fdSLXlIPJnS4r0uRW5AP4kHiLnpBFWy9OXTYQkzoQT9DpIOeR +HNvAXAR0ONmOR+SU0RMSHFk7lNgb1lmgxUdYgQldhC7NGViernZUBKYB8xEtORShbs+kj3FqW0K5 +q2mXKqEODq8ssM3jJdLpayf0OZ1XIwZwSeiIVvMLeqkJLxiG2PXTJWJxOEMimuALfDo1c0pZYc2F +JPonu2CE7jDkJXWiU0/9Qi0QFjbGlSTwmQOOo9tozfnnOOQPArYMmDHrBmw+SNJAfoJEfC9skqSM +UR0kUtMpU5KogyHm51fbP8D0PLgoM4YrT8qNgeUQsSJ00WoeE+oyvZwwj+j0Ma9+RaX3cprFUj8h +XtdLqZw1/4T24i9pnGOuHyssaW892zXIdYhcTNAzdER++uIcPSs6CnnpyyF/saFzkM8QGQgdoFeE +5Uoa2CYcS8Hi6vf68Pxd9j+3uTLpI/335iPDv3LFTHGw/rNWLPlvVMX7r6uZ8d/Iqe8/YMUW/41s +9cnYujGHv9W9bRotSNL54RjPKmML0DYuv+qF4rx/UpJOq3eisyzZidXnPgPmA6wZawmYRErShlVn +JNJj6TtJOtQjAMNh99OSdGXYNJTThQBEjlXm60ojMTC1miiRaf2iUWdsbGzkvZbO2HY84stXDwIl +MgSDNfUB2grNjiJXsnyHTpLuJqKizfScjl/lHSQyYF06at/wKDckRnbnWI6zgNxMN2Lz3qsOIkid +9QJRae5xSfqyLoCX/njilST9EW0zD2fyw6qW2P+0C+Zsr1dIxLb5POw045dCTF93HN1Xt3f/4aIb +gMw3TzOSpNTufshYcFiLE6mIkoiZb6QkNQzsj5M9/PoVZsExHgHOQf7ey+2QcuVUP3zeqL6N2n/T +WJIetn4ukf7H5/OY09Ov9XJ8rovVZ/YLxf56CdbofvtQNnwvu526ZR8IFp+I57juuEx9Q3/T93rE +Uv7a8bxPv8N0oy987nMOuHuVS3pZ+7v00cYG5pnQgU9vUFNqPKWOddL2/1q4JLvoFICom/JOkh7u +pCPcmbyd0/xOzzbZCiOY8Sh5N3Aj6FoA8Pq9l6noQbw5uLypInN/VnF+bhlcgQO+mPO7rAuPjXAJ +dfFBJzkT57kY/eY9f3SyE/LRed7IqucblmTHgi8sCY/yx0CdmBqdwcffcl23pRt3IHFnci28hOOX +4Bpcl6Sbf8ipw0vsV2eAHHppkNflM6dQ43Z1kKTvRo5Br+3yHWKW4q2FO3N3H87eDyf5h66Xhpmz +jqxWOOSgsEMQyWk20M/0uHv+iA/HNhFKpO3SRz8rXK5PiNHiVb2tTPqEKBo0Gb23lOGfNs36C+qg +oVj9jUtTuz898yDW868azKwOIm4IXue5YXL8uLiwGeANC8pm34Y7UN9Q0rBvUq3P73AV6op2F/PJ ++dzSlcGrl8IwcGhYQ5vzNH5P2gnuN7ea0eYzEXAtWbCy1mXXNJgJblHO+q3Ng9sLMqqAb6hcOlQ7 +yXieIs7eK3Apqt6zEwSfzyeSXDgGe7ZVHs0o25KxqTSFpwuoo7CvIMBW6xneK57b9G1h4yUEzfOo +03/06uYDhiEEbGaMFtp7XDrCJR7d+MDB9yXSbIS9RCxdXRA4HdTqcdxKn2RP4EcuuCLjuGOI44pg +5zpEgYW21WnJvyMIXIwgkLUAZjoR2BAcXmDv9hJxTUlFv/3YSyL+r9A9/PGmWHbmCX5I1D36hzP3 +oW56sU5nKvmIxoeW6yXKTFjC+/Lq98I0sHhf3PGJwNqxafpjndHUTM9j/WAhUl/01POYh3nL+/Kg +9zzG2n4of/YJEyfWS6Y20hhxkUBn06ERuzDVG8pRB+YuHFD4F/tvnYpRrfXcAVaMPzeTdqLqB/dp +Ly1Q50nUkPWlxnxMBEcNGFfYF1gk3y/Y3tHR5/SLH4uOnzMvh5NJ5ct4zWtx2nv1W8NGyocyZTTi +w6zNPh42ltELf0498RNi3of5M/IXEf27npsNW/hJy+N/W5rpH2tCqzBP9RDNqhVsHRuETeguYy+Z +Sx/RHyPBvdBhaJGzeqP/fDz3Dvr/M2sk6b5TF9SNXz6TpG+eXQNmBUMHy090jfY9JNKWaCXp0qpn +qCqtMV7f3/EORXzt5xmSVJ9G5TjQ5946iYw5kYta1tVdwty96hGafoyTJL3ZtBbfZnUDagWPn8lP +iThb5+G3A2PR67eaL0nXn2OWZVHhgtradTfmPTYtKzlm54LOuoP9DGzeZnwYOvh3qGrNj2Aq9t04 +jAKSW7qzJGmb3cFZvJ3qLZF2v42UJN1ThCydGryxk4URD9S0+MJ92f87mvaVpIrATchS6fAFfnuN +Nc52t0KSvnLncJLXKyajUkfOGIHvDyKm4/PpGQxHbS2mogkWYojr2T+F1zykyXohMksb+XztIb37 +Xn6OGIz15TK96MrGvC9d+Es8jayvTAujR9/3uPZugxD16SGPOO/9Ic+7u58e8rxVctin9C8+E9/N +lfuJrUUi/iCc0p0YaWLt+IxiLkHbZB+UA96+Agx4mVUC+4xpmIotY1G03wRqrBWXfsSRvnocORU+ +nEdwbC27J1Dhb6cPgpwEFaK37Cqc22+HjExjp49w8LlFVdS04MJ9LSoasxo1GL3rkF8dX1GrO8+o +FR3Sv8FSS2vbsOZDBiF8bnPWhlprG+Cs7BhXo2NMXLJuKfBD3Rqolprl1Fyt2B5so10Y3x3AnyZB +1hnupf3REeaanTSrqVaIUbLUd+fl4y1HGoaTjVF2Z+Hy0fwb+uiTaPqQLfgrfD6kFfqeF95dlze5 +nTGxlTumvuPkQ4Eh1FUvH3z5Xm9OGnb2R3GOkCC/PH4tn7o5Yp4mE6hbmwS5dEl/GMfc2ujrLv3+ +sRBKvbHq3eTqpsnyOXaIfI6NZjdRf5VCDPi3GjGr6TLtIO/zfdXmw0PT1Pi29tOdUTN657/fJmXz +qEafvspvY/XpkiYhWxyTTd2z92wzYStAob+d1kpc31pcIWw3U35upiEb5Ds+rYiW9CaziR8JJ7Fk +B9lDDpOrBn0MnAzcDfYYnDP4ypAYtjL0MSw1PG34o5GxUXejKUZeRiFGa4zKja4atzQuN37AtePm +cXFcCneUO22iMplistbkpMlNRSuFlWKYwk6xTlGgOKS4rviRV/KWvA8fy6fzl00501Wm1aavlb2V +TsolyhhlrrJWeUV5W9VCZa6aovJQhao2q3JV+1S3VT+o3pp1MRtlFmWWojZVK9Ud1Z3UndXmaq3a +Qj1LHaeOV69UJ6gT1avUSerV6mT1GvVa9Tr1evUG9UY1qD9Xb1KnqDerU9Vb1GnqdHWGOlOdpc5W +b1VvU+eoc9V56nz1dnWBulC9Q12k3qku9g4O9vYuDaqo2Lu3oiKo1FurKmRTT6Zvp9PitnAq1lpX +dziJthbrOFVd6bw+WpiZFBoTsiIueXUAOIN/PfwEF7JL8kvyctLT9gGvosY3rlMz2sLmyCRmPHES +M2Mtnnlc06qY9E6xL4pKTQpOhe5YZ2ai8g1d5uu9L6xCm5IM8s+SIA+XYD4rivuqsu4LeMKfCt67 +yFxFfS8xXxMVk7cm42hikx+non2+R/mH0zjG3+jL+vTFj4SzOKoc/6NWVbnjm4vwDX938Xk0elOH +0aPNgdnS/AXA1PykJV6zZy2svGcOd4v2X6jgo/ZwM4IGToQRfLdrC2gz2vLeVz+bAx3Ddu1B58yf +3n34aF3pkonmsCBh7oJgXsWCdS/tI9EnzUKfNG3HWTqR+sIFNtkhCmlr5bO3PBYj/gtXbSZ8R4s4 +1c9wvWR/zv89S+TRWWGWyOazQGrMCPXQquhWExpBW1IFDaELxvyLlWnZ5g8nrmPDONVlEzr17AQ2 +h4WPnMT6aieZqDDJ/fOUdTZ8cnwtBn/0fhGAa9ntb86uG5JWrl26fokc9ge/+p+GGcKMPgzTCIfp +qX0KV/NO78do41WzA/LZBoCYhxGc6tNDXhmaT9kOtIimAmbkU/6kceO3g9ig327BYtSVCGDrGTah +668gjVPdlGu2/g3lY6lgwvZ/q7rOwYyVzGDCdD57BUe5L25TI6AKXnVKbrQGG92Q+9vJ/Tdh/+nY +/+p2KGYTAcJqoth0Fu3hSkPYNdoLBepexZLo8Q9fyP7z4/pl9IVC2to9NXwgi8Y1EwM2KeppC4Zp +RaR8ntxo+/E8WcWuiIHzWAv6s24rp7pWhJwckNPFcNDZhrGx97D3b3dxHfWnj3/lXdYwXB65w9/z +NxX1kTNIvfIP+oq1Yz5ymqpX//6jaDut6obJtV3eo5mRj0cXLSRSN3aVWuBEFh1lUyhwp/Ke1QCi +tt8cMXcyZ+WfntlvwcHa53OqyN/c1qeyzlxN7JlV14EOgjvfwAugBpJUPTsREckMTGfWH8S3oZWY +zuxuwsSmh3xG8dAEk52OxfVwHq4eLzsDR6EsqSCZz+93HJWwORe2ZfbWscDawrgJMAAsJTLOExmd ++xU7RRZg9wstkJGHFabLN14g8zZf49vTZokwA6a4+tjDIvBPW1iA87eGgj5Vm9ZS8yiYv1angfmp +UbCWmVdtKPwJ60BXOz6MQ9UoUMiawWzmLexr7XSKdkW7fnNeliLg2l9H5foX4qovRtFJdNilX+gQ +rH51Wa6eo6/mVDOAmetmMnNx5qeH0ov0h9JAu4pzP9fSrjqnBqDzRfrxKPt6NGunm4Hm+MmGvZql +MhXdUvHphr2OXJZtL51xbJPC7s8NehzvbqA3xEvxJeyZfmLxzPL4hvwfaSywa7qL2cvEubCdmrun +cqopvhBJLZlyD7qZWeD8IYOq3L4jHTOoy0U+tlo/xT/TtBo4W7z3NA+j6didG/NcNiecBzoXAfys +in7mKgdFnKN/UCAshegCOAR7JGK4q0QiWvGeRKxcMDdSK7ojuNxJJMJno9i6uOObkZ8tJmKq/5Qd +8awFZkdsCOv1w9Q32hq4/uce+T9yK5X+VoX5f3urojS5eBV/WBGR7pMehKy7yJcxsOOft9m6fdzZ +5VTV2wP7aeck9ZXB1EZI14OpwUzVf6iMxC73o9bmH5CYnKIm+uqR2Hw9EiuouaRV1We7zRiduNTF +NebIpTtZB2q1qidTa7p3HzdtyOAvXV+8uHPxKUYlLie1elUmM/XgPo5B9+Ifl532lB4H/sju/3zZ +aaH+slOAu68rrwKxC5u48sOdqb8uh6jkiPxphDZXvb8AZYReLoYZfvRyd6ghQnxeVChUH8aiZxKD +TFxyockaR9mFjaL9WDDtjLSFR9hQ6vovqv6yEIowt4Fw7m/95I9P/9Dvv77KtV9/let/MbtzFRNk +3IxJhYOnHjdjLoKysxqqR82/y6j5sR41WyFqVtEedheGm48CjwX+XvrLiCUH64GvPBGEjq6z14Ip +Wl8ISQlL470V+Wt2r9n5/ipi38fI8OMK6oeaId/2ygO6hdt1eFdGOZRC/pqdyXzOlqwfuRWpKzYv +hbng6xY4HwO7av7ciVqwq/F77Iu52250TN/GoDtq7YyO6dXaevAD96AoR/wTnfHnbg8j3IFVJ1bX +YroBDY1wD75y3jWoQpIuBqFptK3Djl+nI4tW4+vhABwsLjgB+6EgOWc1v93ucMqGV1xwhmemOzr0 +3t4wPBQWR0DslxgP93H994ScNT8Jp/LL9/ErC7nolTFrIoH3Xll0SksLqOEhZkg1CtXHswvgLCtc +vzH/Ck4cK6/5bw44FvkFo0UtXl74QKtyAEbYvn5067E/LzLWx9OB8k1AytNGqmaN+NZPvvjI5bOR +MYrGuN5sB2rCZKDR9I+kErYR5uqdE1+9Lu8eBkoWzd6lLaOvIZfynuicKkpLKyqC93p7BwV5e+8N +rtCqgovDSkuLi0tLw4qDg8PCgtGCptOOaHKOdDbVMi3G3elM/jsbf8yRPt1cxVxpH9aXeuJPX/xx +pZ6sB+2BEc+TIZ25Io8OdIBvKZv5/oy6Yh+6VN+jMlrcvS8aE0HbyHGsfy9+SyAthjxqqL8g3Q64 +W+cffQnP4IbXcTuYBQGxrn781lDu4La81D0oDyvWd084taRKKORU/76HVN6wfHtCtOPof9/KQfs1 +YcPjMHSg9n05MgyiZROSA1AHNqA8mM6ksxn+egcgxYWdSI+mPwGcZFUY3OlsYC8K4UYhiF05lW7D +u7cVUeKGprc4F8NpRcWsHaKKdqxFIYK8pZEJa6LRlQft9YRl4J3g7CyfXO8pzN6yHSpgb9AR2A0V +2XV1vGpf+rIAn6TooODE3WUH0or2aVUNPgdmz/ZavMCp3O/s2cMVJ81VL1mRydj3MIr7z9CSrbeS +o9TGy4q/g0taQg3KTf5jvKiX40W9HC9s5Xhh+1/Fi//g7Kbncqp/XMgl8oVc5DJaQeQLufX/lwu5 +9fKF3Hr5Qq6tfCHXVr6QmyhfyK2XL+QmyhdybT9eyFWpmOHl8DCKS01xySOLOZX+X/nOXfsrgou9 +tOvTIAXScFAdjBIL8KlLPFHKJxZwY7x8Z4IDP78kuMpc5bs81N+7NKxSTmnWY0qDfkSXGIVPo8Q/ +U5vyC3COPxlSiqnN//bf/wPDaOSsCmVuZHN0cmVhbQplbmRvYmoKMTEgMCBvYmoKICAgMTA4MjkK +ZW5kb2JqCjEyIDAgb2JqCjw8IC9MZW5ndGggMTMgMCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2Rl +Cj4+CnN0cmVhbQp4nGWWy24jNxBF9/qKXk4WA0tssikBgoFgsvEiD8TJB/BRnBEQy4KsWfjv07eO +MBlMFnaXqKrLU5cUmw+fnn55Op9u08Mf19f2bLdpnM79am+vX6/NpmqfT+fNLkz91G73T/6/vZTL +5mEtfn5/u9nL03m8bo7H6eHP9cu32/V9+vBzf63202aapoffr92up/Pn6cPfn54Zev56ufxjL3a+ +TdvN4+PUbaxyv5bLb+XFpgcv/vjU1+9Pt/ePa9l/GX+9X2wK/nkHUnvt9nYpza7l/Nk2x+32cTqO +8bixc//hu912S00d7Uu5bo6HZc0N2938uDnOcY232/WxOdadx+tjHV8YXzQeGA9r3LPH62NzTMPj +9bHmkzMrZ0Fnkc4yE2uuhfxF+ZnxrPFDhkcMM7WzMyTipJh5Z80b9h6vj5UNnSqdUBmvig/EB9V2 +artiamfVJjSTNBfmWjRX2FK71Th9Ld4X+Yvno79IfzFiU1/oZOlkarNqMz5n9ZipzaqN1EavRT+7 +t+Qk16evxfsiPyg/oZmkudDXor6WRtykyTpmreNC/qL8SH70fPxZ5M8hsBaaN+NDlg8Jn5OvI5qL +NCM9RvWY4EzinMmflZ/QT9JPaCZpRryK8iqiGV2TfRK1TyK1UbVLYd4iNvZJ1j7J9JLVSyYnKyeS +E5UT4YniifgQ3Qc8j/I84nn0dUEnug59RfUV8TbK24R+kn7Ch+Q+0FdSX4m+kvpKcCbfe+gn6c94 +MsuTGYZZDJW4esy8VfNWPKnypLIfqvZDgCeIJ8ATxBPoPfhvhN6Det9vfa2LNAPMwfc/zEHMAX+C +/+5gDmIO8ASvhSeIJ7B2wc8E8mfvEQ9n3xvUzqqd4Z/FP1M7+7rjyfrQiXY/uf53kiWUkq8GSklK +C9WLHM3MnDVzJj/7LwPqLOpMbVZtwcUiFwsuFrlYcLHIxYJbRW4V3Cpyq+BWkVuF1S5a7cJKFq1k +wZUiVwpsRWwFNl+NAk9xHlwpcqXSV1VflZWsfnLDU8VT4al+csNTxVPhqX5qwlDFUGGoYqjMVTVX +Y66muRqeNHnS8KTJk4YnTZ40eJp4GjxNPA2eJp4GTxNPg6eJp+FPkz8Ntia2BlsTW8OfJn8aa9e0 +dg2vmrxq8Dfxd/i7+Dv8Xfwd/u5vM/i7+Dv8Xfwd/i7+Dn8Xf4e5i7nD3MXcYe5i7jB3MXeYu5g7 +zF3MHeYu5g5zF7PBbGI2mE3MBrOJ2WA2MRvMJmaD2cRsMJuYDc9Nnhv8Jn6D38Rv8Jv4DX4Tv8Fv +4jf4TfwGv4nf4DfxD/iH+Af8Q/wD/iH+Af8Q/4B/iH/AP8Q/4B/iH/AP8Q/4h/gH/EP8A/4h/gH/ +EP+Af4h/wD/EP+Af4h/w6+503Hv+zk/xwz0W5971d36eHO6x+jp47c7fPHsj9rfoPZb+3pmD9v93 +J1n44UpGkm+Uw86P5Z2L3l/HauwwE3tOJNZk+3vsk3G186vLnmuVvw72iViG7g8e++tmX4ll4uEe +l+9BdZ3UvffbPbV9vV7XK6pfjv1uqlvp6Wzf7s+X14uq/O9f/gio4gplbmRzdHJlYW0KZW5kb2Jq +CjEzIDAgb2JqCiAgIDExNjkKZW5kb2JqCjE0IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3JpcHRv +cgogICAvRm9udE5hbWUgL1JLSUFUTStTV0lGVERBWTNCb2xkCiAgIC9Gb250RmFtaWx5IChTV0lG +VERBWTMpCiAgIC9GbGFncyA0CiAgIC9Gb250QkJveCBbIC0zOTQgLTExODMgMTYzNSA5MzggXQog +ICAvSXRhbGljQW5nbGUgMAogICAvQXNjZW50IDc3MAogICAvRGVzY2VudCAtNDMwCiAgIC9DYXBI +ZWlnaHQgOTM4CiAgIC9TdGVtViA4MAogICAvU3RlbUggODAKICAgL0ZvbnRGaWxlMyAxMCAwIFIK +Pj4KZW5kb2JqCjUgMCBvYmoKPDwgL1R5cGUgL0ZvbnQKICAgL1N1YnR5cGUgL1R5cGUxCiAgIC9C +YXNlRm9udCAvUktJQVRNK1NXSUZUREFZM0JvbGQKICAgL0ZpcnN0Q2hhciAzMgogICAvTGFzdENo +YXIgMjU1CiAgIC9Gb250RGVzY3JpcHRvciAxNCAwIFIKICAgL0VuY29kaW5nIC9XaW5BbnNpRW5j +b2RpbmcKICAgL1dpZHRocyBbIDI2MCAyODYgMzI2IDQzNyA0NzUgOTE3IDcwMCAxNzIgMzEwIDMx +MCA0NDMgNDYwIDI1OSAzMDAgMjU5IDI4NiA1NzYgNDA2IDUwMCA0NDYgNTcwIDQzOSA1MTYgNDAw +IDUxOCA0OTYgMjU5IDI1OSAzMjAgNDYwIDMyMCA0MzAgNzQwIDY3MiA2NDEgNjcxIDc0MCA1ODkg +NTE0IDcwNSA3MzYgMzgwIDM2OCA2NjkgNTYyIDkxMCA3MDMgNzQzIDU1OSA3NDMgNjMwIDUxMCA1 +NTIgNjg4IDY0NiA5NTIgNjM5IDU5MyA1NzAgMzMwIDI4NiAzMzAgNDgwIDUwMCA0MDAgNDg0IDU1 +NiA0MzMgNTQwIDQ0OCAzNTMgNDkyIDYwNSAzMTQgMzE4IDU1NSAzMjAgODYzIDU5MSA1MTggNTY1 +IDU2NSA0MTkgNDMwIDM4NCA1NzAgNDg2IDc1MCA0OTAgNDYxIDQzNSAzMTAgMjA0IDMxMCA0NjAg +MCA2MjMgMCAxODAgMCA0MzAgMTAwMCA0NjAgNDYwIDQwMCAxMzAwIDUxMCAyOTIgODcwIDAgNTcw +IDAgMCAxODAgMTgwIDQzMCA0MzAgMCA1MDAgOTQwIDQwMCAwIDQzMCAyOTIgNzU0IDAgNDM1IDU5 +MyAwIDI4NiA0NTMgNDU0IDAgNTg4IDIwNCA0NzQgNDAwIDcyMSAzODQgNDgwIDQ5NCAwIDcyMSA0 +NDggMjgyIDQ2MCA0MTUgMzgzIDQwMCA1NzEgNTIzIDIzMCA0MDAgMzUyIDM5MyA0ODAgODQwIDg0 +MCA4NDAgNDMwIDY3MiA2NzIgNjcyIDY3MiA2NzIgNjcyIDg1NSA2NzEgNTg5IDU4OSA1ODkgNTg5 +IDM4MCAzODAgMzgwIDM4MCA3NDAgNzAzIDc0MyA3NDMgNzQzIDc0MyA3NDMgNDYwIDc0MyA2ODgg +Njg4IDY4OCA2ODggNTkzIDU2OCA1OTAgNDg0IDQ4NCA0ODQgNDg0IDQ4NCA0ODQgNjg0IDQzMyA0 +NDggNDQ4IDQ0OCA0NDggMzE4IDMxOCAzMTggMzE4IDU0MSA1OTEgNTE4IDUxOCA1MTggNTE4IDUx +OCA0NjAgNTE4IDU3MCA1NzAgNTcwIDU3MCA0NjEgNTY1IDQ2MSBdCiAgICAvVG9Vbmljb2RlIDEy +IDAgUgo+PgplbmRvYmoKMTUgMCBvYmoKPDwgL0xlbmd0aCAxNiAwIFIKICAgL0ZpbHRlciAvRmxh +dGVEZWNvZGUKICAgL1N1YnR5cGUgL0NJREZvbnRUeXBlMEMKPj4Kc3RyZWFtCnicnXoHXFRH1/dS +7u7lLrsKchWNsmpEjb1hizHYsCsBCyAgKigoXTqogKjoSRBRilJFLChYsGAXe+wt0WhMjKlvuqZ4 +7jqL+51715Z8yfM+38fvt7sz8z9n2qkzg5XK1lZlZWWl954+1mPKyGG+fYdHhQerrGxVKpUVfdyl +N6TWYO8iNVFJbawkF2vJYCM52ZpcWrNZrdVzng7lMN6+fRuVqo2vfQf6Ue2xd5V/aprI34ccVJyV +lVrfddDwYcFRs0PGBodExoXFJY+Iik6ODZsXGte285y32vbp1dutW9sFIeEJYZHdunV7OZO28lRe +1lQqa5rRAxtlWqqHqodytb2qi2qD6rrqrupL1Y8qo9Vyq3yrUqstVjut6q3M1rx1kvVR689tBtss +tllns92mweZj2z6252zv2H5ri5yGa8F15Ppzo7gALp5byv2qtlE7qjuq3dRj1T7qfE2GpkCzRVOv +uav5nrfn2/Du/CQ+hs/gc3m087abbRdrl2G3xq7Cbrfd78JgYZwwRQgRlgrrhCrhiHBD66htp+2j +HaZ9TxukjdIu1uZoa7VXtT9pTfbO9p3sR9lPtZ9rf17XQzdK56uL0i3VlesO6S7q7ul+0El6O31L +/Vv6gfrR+mn6EH2cPku/Vl+pr9Nf0H+hf9RE1cShSdsmvZu4N5naZH6TjCYFTa419W4a3DSu6aqm +65tua1rf9HzTOw7tHbo5uDkMdZjoMNUh0GGeQ7RDssMKhwKHK47Wjh6ORY4/Of7p+KyZXTPHZm2b +dWk2v1las+XNcpvtbfaxk52To1Nrp5lOFU43nB6ITUV3MUBcJ/4s/imam09uvqj5582lFk4t+rSY +1SKvRXGLnS1utnjYwuzcxtndeZZzvPNK5wrneue7zt+05Fp2bNmn5dSWoS3jW2a3LGlZ3fJYy/ut +7Ft1bzWolV+rVa2qW51sdQ+OSb2PWR07hg3HbI41lzpI+aYO6mOmOaLUGxtMvTX678/gz+JyQf8N +vrdcrLid/9UH+B4/C1ZO5sxm1jfCbI5W3zSbT11eazbXGntEhvK5iRw+wW/FdmyHGuZtSC7N4Esz +sPXmVZsnf5C4i7uLxWLJg9TC0DS2H7jR4B85azZfGstt31DzwVng9wOqs58Ap8cSvIebRNZgis6L +NTaHIuwcnBvnYcoCPCDNgo0slSyjC5T32Z8D6GQilqxYTt8b10ktxDJBn4+fYg9xs6CfjSMkvVgu +6DFPaieWCImm7mKp3Jx6QzSr2s9oMJt/qnU3qxyr3M3mr7wawI9nmremM2eXeRqchD1vYlcDXJ93 +YMJGs/n7b4lQU08sD1s2mFU2Y9wj36+v+vocPIR7vsfehhEwO3HqXH5DLFdXUpJbAwdgVyxMgOGR +M4bO4leHcQfBrGq16rLZ/NRqgFnVOr6f2fzrswu8/jTuxTyxQghHa3GjoA88xlLESkFfjSNwq7hJ +0LfbjI/EKkG/A0/hl2JXQR+CScaF4sGNE5jWAENXhSSGpaYuWREPgRBzEVALn6yuK68tLi7K2Qh8 +oqmFiOqbX2BbbDfw9Aim9hjA2rJ2971uGfRdMdJYKEYIetbhGD4UsTnaHvrZAAcX7gksMZu/+G6c +WaU9Mctsvu18gJbrXj4F+PVfYSfIv5JZyIbCfBZclModoFWJnp+bzeaPp5lVzrvam81Pumyn9XU0 +mM1/XHjPrLK/+5B2uf8uiOQ9o0OZvYu+I74pFYoVm4vzK4GvLY4Z7Z8QGTlv4YFvDYCdztb8cIhf +vI1jWn+m7gmsGe96Yuo3X145de/K3EPuLnNhQUpCEq9nYzcYPcX8FAwEzp9xke8NYm34y5HYVWqT +WsaWkg71w8XSVbFm/ak9cJY/HVI7sHegj48LMD1OSYJB/MzY5OA5URuPukD9tq0Hq/iUMs4vcUAg +TOZHNUR/9+PZ4xdcAO2Z7xr4id+xfmPt9or42S4wPzM0IpGnFWRLf4gJMakZccCHpVZcO1yxbduu +TSG9DMA6TQvpFsAXRXKoPYxW3wE24x9PP9m736QpQ8bunX3bpQa2llSU8XrSrzhjgThPuMveFbsJ +W01viN0F/UrUSyepEe3YIHGMUM8yxXhBpn1gPCwmCZGs/+u0ydI31JjPer1GOlH6tPm5UnVACUuW +/hwLLNz0eGwCJOMkgNJxG9FNSsR3TMmJc7kxQf5B4AVT94ddhX2wq3RTMZ9RxiVnLloRDfyCuM11 +53ZdQQeDqRuGi3h2NzurphF34QxxrDATM8VJ4JPoo+j73rKNa/cDf7kyxN0QqolYEbTSY9G7abET +IBh8d3jehiNwrmr7GT7fg4YMVYY8rAy57y9DhkH4Zqgjderx3u+kNaYOZlXbh2RoI2zum1VvHLjC +f2pWtRPTV5WErs7YBxjKodWkuh4u8oInPbUTwwSmanwk9hD00/CYsR/V32RLxXHKhrQzbhajBNQ0 +RlvwXOm6XNcyGwsB/mjcJc4RzjUeseB+0j2qXmSTnvO/aTwmJgttnwkWOE/6H6p2YKUKnId/KrCp +W+MzsaeAXtJtsRe1zzfaGMPFFMH0pWmTOF6QhkqZ4gSZfideExcKuKB5nKA/WU/7ybp8OelLl4tQ +v3HnHh680L1iVYlf3pKbILmdAtgzBQBbsLGpkHxzCfT3Am5MPKRiU4AOXPzakLXhwLP2A7uy9ga8 +zuzEyJjYdH/gA713ogs2233immE/VGdVZfD63zBU0bcaFiX2FrDCto/sS1oq6vYHCxQnCkRyS1Gz +YWzuayRZipatZFMtJCXKZiWxGa+RTFR2rIGNU0ik2OaT3v+P+rUA4mRhn9u88+J2ni2iDX3Zl9kq +sHGLWSW07UEu2oFfRk63Sm1W6UvyzSr+6S1CAsgR27kb+axSLjJ97opI4PtPP4kGAy6HtWe5x2MP +9mPanv1ZO9b8cg/s5GJWWQ1YRXplNbCXmfKYZ3LpKJW4H83mSz6rzOa7VZ+ZzaRk5MOWimA2X73m ++h9nbVb1Si0yq1zfJD/X/cN2ZtXbd01mVef78bzZ/Hb6VurowU2au03T+WbVzM59KLzMpBl3vHPV +rBrqyANft2lBD4NXJkd7+ZGiOmwi2/7aZi5T9ItxbL28mxj1Qn/DGweLfQX9GnI+sv7+0kGcJOAI +V3GywBpNQ8VUAY9Kq0VPhaW9Isc/GnMtHCsVES5h7/07y3MjwH6Nyyw8XopMDzCP/zDM2Dmk4ace +WBhCpXVimrCDWf8rQw7+oSyFTR4k9qO6Fs8Yr1B96xjxPRk+ZXQUIfHjeHhrEXiTlt8AMPUdFguJ +uBagfHQZYCXmAgesZPSLxmFlIA26TGYyDuDnjzdCOaPWRO4a9cFyqekaNXE4gVbBVCwXVRp5VFup +QgRT/JhY8oup5BenFgMWc1v2b6s+DPyBrek9yI/He8UTmkCoJ6EfcI8CG9xcBsL8gLkzeBz77Z5e +2ELz0ipXgGyUnL4dfmr8RIwWOrNI0Y0i6xA8arShelf2jphAsfyBYoE4gExQgRsszn4wG6rA6K2I +7TSZn4W7nyK3c8xNhtuierEYOCsmmEL95KPh1+AYHHyhn1lJ2eS1584qPXOurAE7G6B8Bm3MSWVD +CmlDPooH0xFOz9yxBznHtsJlliWykYsh+coSYL8kTeH+6359i+RltrYoiw15ActMo6SR8hwxXvqU +1Le/wL6WdsgQdpR2Sr+K3gIbzSaIUwR23dRe9BI8pc+oTc8EHGdR7iGsKXHJPfWyeOcR7uIiYh8v +tZV1jL1NqjFAwLPSCXGgoL+OPymtl4xzxKkCdmUXxGmC/iKNPkxkw5dC8qVFtKxRsnyTSYJ+xRzq +pDdEiKtOZu3Z29iDRWAbAgIPsP4440/UXa2ASk5/B9OVUOLJcsVBNJnBGPa0txxaMtg8cbpA+M/K +sDY0GQs+T6l70DRkWPIwjpTr/r1lOEZSKRGAPfCzMF+TVLRpozBNRn2xDr+jKltO+bIC35QcRNiZ +sZo5TmDNvCFs3XJ0usQ1YKUyVnPcLdlZcJspzHaGgnOnOSbi7zI/RkidLHHwVOMhcbCA57GT+LZw +T/pBHCLo/8BflKDI/Ji/6KNQOytTT/niH2i/U6BWUoyFFE0WN3Wy8dY/EJ+2uCtflqBQO+MKaTSV +2DA8T70Qe71s1Qk3U8F0yj2OzJYCWvmESpDmfwB42bQAPDkYtyopMyw9LXXFQkikc0NaLp+2LPNt +rnRZybIa4D9D/if0MYC0/UYl6fNk0ueLcWByZ9ekBeRFJVtprPjcMgM0W/bXVu9/bsWsRvPfdY3R +GsW+WfflIhvxwiwU/5Ci+Ac6k+RjqcV67dgc8R0htFElDpXT8j7PI+hM0VfI2yP60ZLzJV4x5Hzm +9zpl6fNAOu11Sv+nanGxwOIL6DubFb9O/9jY+yWUxgpfcXXAZxZRv8feF98V9GNwr0W6BpqFv0wg +OSki7GFsbsFD5WqWFGlBKcwrAvVkWyxwtkWGLixZJtiEJy3dr2ncKboLem9audy9Ky0nQIbXKTYb +0djDgkZbLFY3yoJOYEHifGE0FljQTkr1gVGU0Ss4R6mio/GAOEzQu2IbpX7FuFQMlOEdysy82TYL ++oXRXV5HW/aGAkuT8Kq4hx3SyNGBwyzcbSH7iGxqD4t73jyAMiyixkAJFG+ca7oiDhf0D6R+ijNm +i5m7OFPGscgi0XLTVYUAhymy3MqGWXDJRhEj9jOdteA1igSHsIHPcWvjz2KM8Mt7YqxwwXTcQrPD +6PyijY1ivZ9TTn9NzNipUW2ZkOo1CfekzbfQTt0u9ov4r/Knfcc+Pszfxflyb1+gv+z9hj33fsC1 +q5tx3+UuHD20+whfOPi/TL69VHLyPUxOvo/LyfcJOfk+9bfk+/eXPraIi54VGkEJ5+zYis8Nemmu +lG7x5wOZXhxBqymRWlq0o2dXMUjQP8FTFvxDwkcKVaRRowR9LIJC1L3RTkyU9/AzRf8+bDwoegh6 +H9yoqN9q04/iLBlNsQSfpMalFniokqngu6YDMs7elFoY+4rJuYk584EfxPTubLQBTI5KNCggax5S +DNJwDi6/vym/tqAoP2cTlMOh5A3L+Q1rODaOItqetzWWcE7RKIbiGsUhN/RWshsqvG90kf2aGwZY +jMZ6HH3r3X5QVIea45TJUmEMFUbLBX9Fa6jgqkyUCjNe6QjVtr6mBXpa3VvkME2/Jao/loP2y/TH +Qw7ouJhSoiMer7IfTonynP5/sAbPiCyF7ciLlcJe3JiwO4ALsBA2soGYikte3piMt9yYfCN1x5Nk +OAs0QWkQx2EnPCLe3kyJ0mRKgOyz/GJ94sIWpc0Edwj9A3AyoMOaI1XHK2s3ra8HPsb0h9hF0F/C +1UtE7HDvAbY0wOXQwz5beHSA57c804FjfdzcWBfW+ZdpaGs4hJJ4OqZoBgwBj6XzF85PSEpZGgYj +IPi4cnNRfvZWPq8/gWuNHuKzbnuedtOMYwfEZVs41ipyeGfozLNeKHqjNfZ/8gjbYi9mf4LZuGTM +4W4f85BvQ/olhURHJiQlZs2iKY+4pfRZdObBIV7PJh1Ef7Gz8KpQjqGiFFRvClLr2bnvacAM2Vnd +UgrMvznV2DrU4ClKlvStbRtac0fwkvimkMruiB0EU3O886pi/3qli/T0ZUVqgU9FV+qp7KFxlOjP +QmoXPcFJSzdx+qeOtlJ2vSlbrTelYKqxRIwkyaulM5grmqZmk4d2iaihY4En0mfHLuaKLaQp2RSE +1HvlaU/NYR2YS/V8Orp6MvosmIeurIVpSg5RbDG2wXki4a3/houmWqCOW/+tY1Hu9TDmiFnKDI5h +hLhMKZ3A7qLJLxsN6EQsI5gH0odY2lIq5ZvNmfJwoSj55VDMcaKRRqAHow+N1JbpTL7yTNQ4V9oi +vuCsrmHUk+SXDfUm32ySno7Dzmy8GDEfqQeTXw7MlHxzyNPrdsyTe7Ms1kekZq+18nJqwmk547PK +OXYfqduJbHxeopQP1J3XUnldlnX40Dqybj5fwhkSn2lkdmKI5JPNTbM1+WSXh0gjae6zborYC3u+ +vhWW8fqL0sic8j0mnxyuwVbyyUncYxqZw0mzRoqsF+v5+o4S/TTpSXOWaXQeCyy90Zk7u1vEUcr1 +SiKBV42LKLg0eihm/MxVMeNSMtkhZfC0K94Eahvyok0246ddZTNmjhizSZS2av7RPa3/gvurWzNt +lROchRlh6YszsuUEJ6BUSXAW9edKl5dnKwmO/jaONuhj9uMCsSOpoj8d4IeLbwn679EkPRPrwzd5 +utSW1WymmLB7QdU8CIe4zKhkviCJKy/Iz6mAUihOhTgIWZQ2I4pfm8qdrIwNCwiKG2qI1qDthf2X +Dew02yxfEn+PhcZYkc0q1NTSgWl2OnCZV8XSJA0dxP0L0jAKYDubQlGJnZepMU1a8YX44Iszj38d +d3Cw4V2Y9E78HL4klqs+VnP0GPB3tk2c7J86x9/AeHLbuWwc8AP6e7l2uhR433AHLtzduJdPqeIi +fMP8fIF/N+rC+cPFew8bkIdSOuURsX4Z/klpIbti6lsaLzUlNWFfAO7CRk4fc6xEXJOynfwgPkFn +9vgUrCtiQ6QhUUCY1FPqLS4rCQfmxJ4wZ3w8BTIX4xDTkK2E+p5fJVZlF+YDruZQfXD7jeu7gjq5 +ACs4/KJRP/M0Hdw1M0cwKxe9r2QvDRVjc5ZkAFvNMXVg+CiPeQd+dQEs8H/RqK/3Rg419beQGGKk +3lghrhBkabUnad217ShIGmyuNOERiZLTDiav7RmU33lxbDf75e80xB9EhVR0t7DUyFvgbBKJxVkS +ucds4etotYw6KqgjoayM7aEOUW0r60mvvc1xRT1bocZQ/EVkoawP0mfLLrLyJjgc9dxrJNurRaLq +w+gTTcbLmrDhjAikAmm49K2YLbC7ts+/qM14mc49bana/PkXteHw9dSEd/Huqx+ZNNtb4ab6yx99 +109ZinhZDcTVCX/6GZvySaUcs2M6NtzkBKalvL4rupLpjXuWdllN1FSkViSQMncdX1bKvYVNGbFS +DzLtReoOpKVsuOTE7FDHJyVzP7OmlLb+BCYLwavOLGU1AYzwt1hTviyZQ+JC4qZOKNCM/FWe3lMf +9SdFUMnak9awkTjoZReEU/lZGrav1Awtgqc+Cj6XeJ6msfZxmk8Ww7Pnba/xPK/4qIcuhjiUOx2E +7xDPFeMcNWDAH/vOlfLLK7i+S1ibAcCm8y9g/JJgddjOWcX7i2t3UpHHr8cykwbcFs/zzOQTNecy +i+aBm0IveytfDXFjmwFfLeFzKzjP0vaU7AXwxjkaIlhCBGOfpV1Ry2Xq3EjEOJ21edC3kF+ewJ1L +/mM2sAC+8RUxo9GZujZ0f+qs1LBQKvLs6ytIoz8s2nVuHV+u8Vy3eBc85F/QN9JiWED72Z7JfG4C +91UhtnlAI9Cezj6KVSK2NvU9tJ61lFyxpdQhYD1t0mxKajaJrLXUN2ARtjS5spamDocWcfpXT6j2 +8ktoO/mJNMpxSaH0TiEGFG5br2YpoFGQZlK2k5QiltkL79vrVSvlZ81mKieVqBqs8lIFqkJUc1UR +qmRVvuqxVSur9lYRVu9blVmdtfrEuot1pPVK653WF6x/tLG36WzjZjPOJt4m3+aObbztJtvPuDe4 +YZw3t4hbyV1X26vHq7PU69WfqH9QmzS8ZoImWJOgKdTs1FzTfMt34d15H96Xz7PT2420y7A7aPel +3Vd2f9o9sUM7yc4sqASd0F8YIAwUpgmzhYVCqbBLOCl8r7XWDtVO1V7X/mZvY9/BPsd+l/11+/v2 +n9l/rrPX6XR6XTtdP52nLkX3vu4DXY5utS5Xt0aXp1urW6fL1xXoCnVFuvW6DbpiXYmuVFemK9ed +032uM+r76Yfpp+h366UmYpMZTfybBDQJDI6ICA6uDq+r2769ri68Otig1WqPV0/rZoCJmTHJ0Slp +WUvngw+ENcAPcKFwS+mWkg1r8yj0aNH21k20R4feB0Yx25GjmD1z+HrmDYOWmRs1NYloNmo4rWRf +b7JXa7U49xKbq9ZSIA3dn4bpxlBOi92+Qz3GYRrjb3Vn3boTfxxLQ2HY9wbt3o33L8J9/pPZdI5g +dpOHDCEv7I6lvkAWPmreHM9JgXvvucAnlbUX6vjEbdyE8D4jYRDf4YYvOS/He3d/JB/8Dtu8DdCV +P7N138Hj1fNGuoDvkim+EbyWRfzlyeQckvnBBeYxOZHallObt/K2wmnZRPgWKzntj3BzS+0Gfi3a +T81J6cRFp4dl+QHPWrk9xqk45vRP2NZwFE6lbVnC5/c6DGvQiQvbMLm0L5FEMVtKbaazBWjLVDjT +oMUiNcajIyWe0ej7zp9sh4Gtfn4QGBrLaS+rccy54cyLxQ0exbobRqm1OP1lUu8Jyt2pTAmJUgQU +oNPs3Kg+LB5oLzvARu89ANg9BOK9WQdqWrw8MnsezcGp32//2zSjmc3zadrQNIMMX8H1kjO1POCc +Ixsp4K4ESH4Qz2mfD/9/Xdi+fl/LDXt5Lylf1F6LB5YtX9RitnJTq/1IRope3FgOl9moVj687G/Q +TQ4mLGZWw8fzhSkcclduow2ghteelomWEdEtmX+EzP8B8Y8n/utlUMVGAsQeSWTjWdLMGRjNbmAX +EmjAfpaJh5+P8PK6VNnGuVCBTgG5cX1YEu2ZNP8DTQM6sDHw9wst0oZr0oJpzAF/NBVx2r9eVMWy +ofeI+9dPaB/lo5VD8sz5PuFhwQtHQCcYKM9cPlttPFhzfHvtvspbsumEYDPKT2Tl73uXObMQiqmO +ivr3fBudDdpb6hubg4cwm5CZ7Q2Qjv7sOralhcw6yEYjcKdLvj4CaMv/6n2ctXZhu18/Sq6hyY4t +5bQJv/pn57I23JHUsxk3AfvCnfvwCNDKbK73TDerek9oMJuzd1Gp/153s3mr0d2s6jyDSg/UDWbV +G1UN8CFcP7zjLByEHZnlWXxpj8OkhE252DWeRUOBtYB3h0MvaGdWvRtEHZ3/hZgSyon9ggN1NNNV +ZTbfekSdN/+USl81SYcJMHpGyFiYBWF5geW0/k5Q3m3/B8vRJRGmLzfpYXpuIixnLvtXVvxAGJiO +DYvlSDXKNbJmsN7TArt3mnoa3yS7fvKhLEWgvb9JyvUnx0ZceRtH4YBLP6Ebwb9dlmEvBea0E4C5 +mCYyF2ni2TKoYDkk18upOMtkPAkc4JvSlPcN+KZp6kmKQxJ+VEokgbLokyipmkDmKPMMp4ZTiZR+ +5DItrqmTm1Ko6cNUHGdSXZZtby2lhB9oFF0stKjKVsBb0qVFW9jXysIWsXaHV5Z+j6nAbpguFkZJ +U6AMXQJyOe3ouZCA7ZiwjdzM//OLKwzBoZtWlfitXvIh4JTnD6bayZo077DwBRAJSeWwB7aZVdab +t5hVBumeWeXq52dW6TQdzSrnTSqzii8ksbUPoJJNqHt1Dq+thE0rNizjK9zr87J+55LzZq+dTe7B +gdmNZHTI/58xTwxH4GbhgUP84hIuYXFIVhDwg32vUXpkf6j+PDn+1186azX/+la5T/PXl03ti4eW +xg4vX0c5bX2Z8o7WHSAMV/3j099JOFe5tervD4VoX37kkkHbUOg/YUh6pN+M5AOX7hTsPGbQfjnm +SMeO745z63d1xqNHdy5+5aJFbkNufUY+s5vJvZyD6dH/97uRFqT2r15dlAupbCLktHJYfT3MumgV +GpMNeblkZv3Sy91Ba0A7XtJotM/n8tobBxg70Sz/9XmDuQLEcX/hkwcf/5xvZOrrt96vr+7Vffr/ +srrzdcOZltklTBg0Oehj1KJd1YXPSHau/fsxV+b2u/dv6Prwa3RFN9eT7SiJeLUTypDr5Ku5EsA1 +3OZ9m9fthmooXbYpi069Bd9zKbkpqyNhCsz1XzCdArR2+pSRBhhxJPThXLPqna3kYL5JJrfi5EMO +5rflDRAKAeGJ3vSTtC5pHb/o4xkr1jAVtzPj6NJjgM3h5Cm4B3d9NvetM5svhpOKtzhOjJ+upS6a +DWuAnbCrqvwo1EJ51oalfNmIfTkrf+Mi1gXlB5Bj7hoMA2NgdjykXqW4VsP13BZ9zuUEnC7dXcMv +ruCSFicvSwA+eHHlaQOWo/UeZo16jfblfelfb2Wh16vHfvz4Hy5VF1Z8btBOBqZiNT2w6FAxBdsI +CrYNi7CP6a0DgDyeQh07RaUekuvFUq6UDU7WnErryjaSRD0Ak/BZ5ha2CqYoToavX1FyjwIeS2KN +eVH4BxQjH0RORhtRFVtdXVVVXR1bFRERGxvhQhkeZWQH5YxM68q6b4vDdihABaddE8Ndz7u0F47D +vsXl7iX87pMLy5YkeQ/JT+Z2ZxYnw0KIT4mZtZQnfubHjq5Nwh8ATrD9FN7QE9ijCrhVAdKbnNa0 +svFpXaK00viUHKT1uMoqOms7UKBzqKA0JzJhybIkcmbh24MgCoKX+PjwZfHctorCNWVQB9vDD8BW +qCs8fpzX1qyNmh+SmRQekb51x868yhqD9mTITk/PObN9p+4OPXduX90JF+1jVqkeakkkuH9Orli2 +q+ynV13W/DW9wi1otVv9jx6zQfaYDbLHdJc9pvu/ecx/MPfxxZw2IyujO1exvGRlDZwGs6qjkThG +zadehmiotC6/gcf+skRJ4INJ4GfTOrGijlhY/0IDTizCISZXLsnPbH56mfT/0Xr6etxX/je2ufT1 +uDjdbP66J7V9G0wl6TrlKWkwtyCNZjQNwovjd/Ex6VzF5PrAq3AV6g9WnOdjCrj4eeGp00jHmfXl +uFgkWSDJJKGK046awxVH58VCPEQuT06O5QuSudO7dtbDOdiaXplRyGtH3gz9Ezt99snHLnDDbP6h +K0X2Lt1oHgUfyTH+VgPPxK3cgrzUdbAeCnPzt27iYwq5OXFBPmSjgZVxpxbxO5aiLprbm1mWChH8 +zNg5Xd/1rz7uAvuKC47U8AvWcgkZAxfABF57Yy+XuiWrCjbCttzS0io+vZTznhc6EzwhqiAuf8mr +Df8336kNYh47l3yHfbMoEGu1s6JDpxtg8m6vu3P4gnLOrzqRshtTOsmkpU065EHOB3n83u1VdbUL +N8+VDz5ZiTiRja/Zzjpga8lrKdRz2rxyNhHHzw/HDqy1yWstUKw4W4J6k6YO8Mun70Tks4ONx/vg +4bQ81moMpw2NiVwWSeelGXu9SMVnp08L4otjuJ2bt63ZRmZ1ZM4ZUvF9BQ0HeG1wdQRFg2o6dG2n +6BAerJjl3/+ulo1U/hEwMygxLCFpyfIoGANxlqvvwgPltRVlRau3ygll+wdfYxfs1e5kb9Z+UD/W +hfX63fsbg/ZGOWkUud7kOwnAfnSTdXQb6ejbpKP7a1K9DDB4Sn/m2pZfswBvQwk6JeRGB7NBwN2/ +8Msn8A1cDzo4EMZBQKK3JTEpKVlTS6OZ3tmk+fI4SO8mkF3titGwA6bu6xKkUIAPTV1kU3v5z5Xz +6ydtnlk6evUQ4DehB86EwvtZRSwdAtkX+ZncXflJ6iypsSlRtqvBpFI/ZZOVuB6j0g8ryVR0wwn9 +KlEFQXyHEZNZTxftlspN+TuAP75vpmv36GAv/5nnsY0BcD6ZvTVqP+RTt3DMbSJzZxTOInnW+6I7 +tkbH29+g3S++HzEbFy+YmxCxgNfmp1CuzHmwsR6srxsbw9+NxgijdWoZO0sLiI5btHwB8D6zax9/ +v7HuzOG6yYwGYfPbs2ZMO4kvjubQ7QL2x16AkTz2nnCbtWA6997MrvP5CY9czsCW4uodspPU/h8t +ahH9CmVuZHN0cmVhbQplbmRvYmoKMTYgMCBvYmoKICAgODc5MgplbmRvYmoKMTcgMCBvYmoKPDwg +L0xlbmd0aCAxOCAwIFIKICAgL0ZpbHRlciAvRmxhdGVEZWNvZGUKPj4Kc3RyZWFtCnicbdfLbttG +FIDhvZ6Cy3QRiHPmSsAwUKQbL3pB3T7A3OgKqCWBlhd++1Lzn6ZB0AAJ8EfikN/wMuLxy9NPT+fT +bTr+tl3qc79N6+nctv52ed9qn0p/OZ0PRqZ2qjet8W99zdfDcd/4+ePt1l+fzuvl8PAwHX/fP3y7 +bR/Tpx/bpfQfDtM0HX/dWt9O55fp059fnvmv5/fr9e/+2s+3aT48Pk6tr/twP+frL/m1T8ex8een +tn9+un183jf77xt/fFz7JKMNh1Qvrb9dc+1bPr/0w8O8/3mcHtb9z+Ohn9t3n5t5Zruy1r/yNr5v +9u+LmPw4SvaabZ0py2eGcveRo9Xy1EIFSqhI6SiJstRCOSpTnipUoCoVqUYlqt+PbI66h5ViTDNT +jGkMxZhGKMY0lmJM4yhE5u7bx2IPJlDYTaTQmkThMwulx5IpPZZC6bFUSo+lUXosndJjWSnOkcxU +oQxVKaEaZalOOWql8Bl8gk/PtOAz+ASfwSf4DD7BZ/AJPoNP8Bl8gs/gE3wGn+DTa9DiM/gsPoPP +4jP4LD6Dz+Iz+Cw+wWfxCT6LT/BZfILP4hN8Fp/gs/gEn8Un+Cw+wWfxCT6LT/A5fILP4RN8Dp/g +c/gEn8Mn+Bw+vcccPr03HT69Gx0+vf8cPr3/HD69/xw+vf8cPr3/HD69/xw+vfsdPovP47P4PD6L +z+Oz+Dw+i8/js/g8PofP43P4PD6Hz+Nz+Dw+h8/jc/g8PofP43P4PD6Hz+Nz+Dw+hy/gc/gCPocv +4HP4Aj6HL+BzPJn1Cfw/T+SA3CMPyD3ygNyjC8g9uoDcowvIPbqA3KMLyD26gNyrDrlXHXKPLiL3 +6CJyjy4i95y9iDxwhiLywBmK+AKGiC9giPgChogvYIj4AoaIL2CI+AKGiC9giPiCGvAFNeALGBK+ +gCHh0zUm4Yuch4Qv4kv4Ir6ET1ejhE9Xo4RPV6OET1ejhE/Xn4QvIkr4IqKELyJK+KIe9fCJ3rVp ++KSw3TJTbLcMn1S+uQjF3hdLsffFUTrK8EnjPCyB0u0ipdslirlehs9m5nPJFHO2DJ8tOubw2aqf +DZ9tzODCyq/r1sLKr+tWZuXXdSuz8us6kln5dXXIrPz67M6s/Pr0zJ7SUQLFFZLjKH265LtPzMKx +5IXS7TKl3yyjCjOR6yj9lZUbpd/sFFdIXikMZaY4f2X4TGOUIhR7L/xy018axVHYy/CJrj9l+ETn +rESKuS6J0m8ulO49U8xLKYypx1IpZrc0inNbOsX1UlaK66UOn+haUfllqs/uKhRjVnz6tK749Gld +8QWOpeLTp03Fp0+biq/3b5/I4r5/IFfgnemrwFcdHvjKpVMH3C5MWG2UcjrFJVBXiulrM8Ue2oD/ +e6M0odhDsxSnqzmKG6V5CmoLFNQWKS6Iligmsy0Uk9kyxWS2QnGCGr6Mr+HL+Bq+jK8NX+yM2Wdq ++Xai768n93epr+8+9X3b9tee8cI13nfubzqnc//6Tna9XO9bjb//AJ+bDlkKZW5kc3RyZWFtCmVu +ZG9iagoxOCAwIG9iagogICAxMTM1CmVuZG9iagoxOSAwIG9iago8PCAvVHlwZSAvRm9udERlc2Ny +aXB0b3IKICAgL0ZvbnROYW1lIC9QR0RSSVkrU1dJRlREQVkzQm9sZAogICAvRm9udEZhbWlseSAo +U1dJRlREQVkzKQogICAvRmxhZ3MgNAogICAvRm9udEJCb3ggWyAtMzk0IC0xMTgzIDE2MzUgOTM4 +IF0KICAgL0l0YWxpY0FuZ2xlIDAKICAgL0FzY2VudCA3NzAKICAgL0Rlc2NlbnQgLTQzMAogICAv +Q2FwSGVpZ2h0IDkzOAogICAvU3RlbVYgODAKICAgL1N0ZW1IIDgwCiAgIC9Gb250RmlsZTMgMTUg +MCBSCj4+CmVuZG9iagoyMCAwIG9iago8PCAvVHlwZSAvRm9udAogICAvU3VidHlwZSAvQ0lERm9u +dFR5cGUwCiAgIC9CYXNlRm9udCAvUEdEUklZK1NXSUZUREFZM0JvbGQKICAgL0NJRFN5c3RlbUlu +Zm8KICAgPDwgL1JlZ2lzdHJ5IChBZG9iZSkKICAgICAgL09yZGVyaW5nIChJZGVudGl0eSkKICAg +ICAgL1N1cHBsZW1lbnQgMAogICA+PgogICAvRm9udERlc2NyaXB0b3IgMTkgMCBSCiAgIC9XIFsw +IFsgNTAwIDU4MCA1NzYgNzUwIDM5NiA0OTYgNDQ1IDUwMCA0NDUgNTQyIDQ0MSA1MTYgMzgwIDUx +OCA0NDggMzkwIDM0MiAzODUgMzA1IDM5OSAzODUgNjcyIDQ4NCA2NzIgNDg0IDY3MSA0ODQgNjcx +IDQzMyA2NzEgNDMzIDY3MSA0MzMgNjcxIDQzMyA3NDAgNzAwIDc0MCA1NDAgNTg5IDQ0OCA1ODkg +NDQ4IDU4OSA0NDggNTg5IDQ0OCA1ODkgNDQ4IDcwNSA0OTIgNzA1IDQ5MiA3MDUgNDkyIDcwNSA0 +OTIgNzM2IDYwNSA3MzYgNjA1IDM4MCAzMTggMzgwIDMxOCAzODAgMzE4IDM3OSAzMTQgMzgwIDMx +OCA3MTEgNjMyIDM2OCAzMTggNjY5IDU1NSA1NDkgNTYyIDMyMCA1NjIgMzIwIDU2MiA0NjAgNTYy +IDQzNiA1NjIgMzU2IDcwMyA1OTEgNzAzIDU5MSA3MDMgNTkxIDYxOCA3MDMgNTg5IDc0MyA1MTgg +NzQzIDUxOCA3NDMgNTE4IDYzMCA0MTkgNjMwIDQxOSA2MzAgNDE5IDUxMCA0MzAgNTEwIDQzMCA1 +MTAgNDMwIDU1MiAzODQgNTUyIDM4NCA1NTIgMzg0IDY4OCA1NzAgNjg4IDU3MCA2ODggNTcwIDY4 +OCA1NzAgNjg4IDU3MCA2ODggNTcxIDk1MiA3NTAgNTkzIDQ2MSA1NzAgNDM1IDU3MCA0MzUgMzQz +IDMxOCA0MDAgNDAwIDQwMCA0MDAgNDAwIDQwMCA0MDAgNDAwIDQwMCA0MDAgNzE2IDU3OSA1NzYg +NTUwIDUzOCAzMDAgMzAwIDUwMCAxODAgNDMwIDIzMCAxNzAyIDIyMCA1MDAgMCA2MDAgNjAwIDc2 +MCA2MDAgNjAwIDYwMCA2MDAgNjAwIDYwMCA2MDAgNjAwIDY4MCA4MDAgMzYwIDQ2MCAyODYgNTgw +IDU4MCA3MTggNDgwIDQ2MCA0NjAgNDM2IDQzNiA0NjAgNDYwIDQ2MCA0NjAgNDYwIDQ2MCAzMzAg +MzMwIDEwMDAgMTAwMCAxMDAwIDEwMDAgMzkwIDM5MCAzOTAgMzkwIDM5MCAzOTAgMzEwIDMxMCAz +MTAgMzEwIDMxMCAzMTAgNDA0IDQwNCA0MDQgNDA0IDQwNCA0MDQgNDA0IDI4MCAyODAgXV0KPj4K +ZW5kb2JqCjYgMCBvYmoKPDwgL1R5cGUgL0ZvbnQKICAgL1N1YnR5cGUgL1R5cGUwCiAgIC9CYXNl +Rm9udCAvUEdEUklZK1NXSUZUREFZM0JvbGQKICAgL0VuY29kaW5nIC9JZGVudGl0eS1ICiAgIC9E +ZXNjZW5kYW50Rm9udHMgWyAyMCAwIFJdCiAgIC9Ub1VuaWNvZGUgMTcgMCBSCj4+CmVuZG9iagoy +MSAwIG9iago8PCAvTGVuZ3RoIDIyIDAgUgogICAvRmlsdGVyIC9GbGF0ZURlY29kZQogICAvU3Vi +dHlwZSAvVHlwZTFDCj4+CnN0cmVhbQp4nH1WCVhU1R4/d4bjud6xMYWrqeCgLW5UEpoKZbIKiKzK +GigOiyP7AOOwyKKC2onYF0GQfZMQEc20cd/KNCJ7fWal9arXy77K972+c+nM93pnBkNt8c439zv3 +v/7+5/yXwwELC8BxnFVQiJfHOjfnMAeXlMQYr4zoRI0acBYAAI79naTJQJrFSdYyyUYuWVkYeWsa +bT3B7deV0Iax351senc8zt6ccoppPYe9LEamFk6SATnHzXZ4yTUlNUurid+cYTtfvcD2hcX2S+1s +E2ITdZpkOzu7cd+2Jue2Y97Hiczc3Gh1ckis7aZ4TUqmNj0jy3drWMJz6zYn6mI8kyri9KlpztkA +uAA34AeWAw8G2RV4Am/gD4JBEFgH1oNw8DwIBY7AB0wGS4EXWAtCgDtYAHwBD1aDMBAAAsFcEAGe +lDHluWAxWMHM+TDFUFACGsAB8DY4C66Aj8E34EcgcTJuCjeHW8St4Fw4H66Ma+beki2RrZT5yi7L +eflGeZo8GxskewNnMJDTBrlhmvSUVG18aoLBqBYle3LaaI+U3dJ0yUv0FFwiRC9BuYz8xr7WCMpT +pJctwgSltFD6RfpedBWUgeQrRvIVlLRD2UPeG/UQqW9GSfqFYuy/wHgd9hW8t6sb8yTqLnEhdneD +m2NUftjZbR0VeDLrP6K3oGyUbJmBAJOrQGYlgKSNLhFtBQPNF9cJyiLyLeOGCzERYoSgPEta2ddG +QbmYdLPFq0x+OrnAVpFs5UT2SQNilDBM54obBGULqWaMTYKSLCO2o1NFJ7baQGoYLVpQ/kO6xeC7 +CcU0XHQXGPCPGPBggZSTO2IIs5VOniEzGArlLfK19KO4SiBzpzkLynPkOpMLYgLh5BJbhQrKLLNJ +6spiPl9c6p9Ha+Fuz4H8g5jIMfEg9ZhMx43F7flVvK50YRSs0VdE4xT8pCNdqMFZeEd1yQCvPCQZ +mDEfgVoSg7iW4UwfXSN9IzoI9IB0Ulwi9JJWcSkjnzBvP11r9oX9tXRRDHUrLyCgpf4WvEhcDd8d +xF24Vr9TzWdQq7/i1el3qPl4GphHZaX5xLV1T1tAGb54mKTC+tvhPZF4OY4L8qMqvv7mPcKLOMbP +l87jlfQCCZfeE/NZ7E9KS0ZdRT9hEz0t+gvKRNJoQrUqpST9DO7ccpK+cpQGEpeuPW3rcWrferIG +ukeIaynISU/CmTi7TFfO5+3MWA5rt9fvbsb9uLe9ubutr7JpmEzkySqiEzfjNK0uOSMxX+s/j++b +cO6H+pZu3IJri5uL+LqK1i9gflXuGzrMKw+Sjgf3I4xeDaa55pgHSBiseq0SV5hS76cHUm/VWOpZ +m1OvyZx6VE3l1IXaPX1aN6i6hEc+OEsE3t1ozTbIn22QF9ugK5J8iLjALTWBpcmYZ5najrsK6gv4 +HbEwhDqvckzAfEZ+1SkytY9Y/qxSEhsSSRLFRQLxleaIdoLyeTKZOVILytx6yQuTyNqBNybQbIzM +3chS2m0lFYr7JgmvT1KCIlORWwIrIIJpYDp4AswAM8EsYA1swDzWEfxY3zD1A1PnSAGvgSpQDWpA +LagDe8H74Cq4Bj4Aw+Cf4H/gN86R28ClcxlcJtfJnee+kqlkobKtsnfkU+U28kQ5ll+X/yy/azHR +wsUiyqLL4pTFR3AS3ARfg9Xw1oSQCQY0ASHEo4lIQAo0CT2GlGgyehxNQVORJbJCIpqGpqMn0Aw0 +E81C1sgGzUYqZIvmIFfkhtyRB1qNPJEX8kZrkA9ai3yRH/JHASgQBaF1aD0KRiEoFIWhcBSBXkWR +KAptQBtRNNqE1CgGxaI4FI82xyQlxcT0JA4O9vYODib2xKgU9x8yjMsH6DCGCnrNOOqdjbeSQIz3 +uzeSbCn+a2Oct55RihglqIFaSb/Ce2o32vF+WoHx1it6B+NJFy0TYl/7PZqg4vrvrGET6+XfWWsY +i/Tj8qO0H9+zgnXv618wnnPKwjoSjXHzK42fSbuI3njoJr4j/fT+PtxMAzHEuk+y3Y0+NFLSjuk5 +GM+YrdaaHX4tXYKKiqePlewlc5JxWDGlOLwsCSfSOW/vGbjLNPwwDTF6+Ese55qYwRyMdRdyvjGO +vsMsk2gp/HXVNWOEAbNWSEYamYA/E7isp2uNblBxxaTxIiMc30odaN1LZO+QiZLCKGdyyGNGcImF +MkQqKcRqWuJqAlXKQJlgUvXT5nI4YS6Hq+ZySKQrS/KI971+0U6eOXK/HBQPFYPX/WJoMxWDorW2 +MIROjaGWjqoErKnNreHL++Ep4nL1iyNMl1rTBdSO/eD5hE9V1/CHp89f4nUtMF4TqYnGfOSWti8J +aPr3HdWbuFPbso2vK+u/AbMbdNUmx+OTJoPOg9vfKCzJwzxdSR+nnvSZe9V8/cMx+Kvuw38HMsSd +efU5fHGyCfHLy8cRdxJLAlQKOpHOpPOoPYXvJnzMQN0YB7VeE4L5+KSOm2R2+5cj++oLtCocWhBM +J+XzSYjMrP/hLP6UP775UOhsxWas3RaXFpXg7J9FZfwKYwnMcyzQJ+FUrKnX1vB5xanLYUNxx64W +1gLb9w50HDvw8cVGIuM/l0pg3Wc1TT24E7+Z217AQu78AuaUpZVmspArDtEN2Ddzdw7LejW1+FPf +2kQLYe6SjO1BOAqv3hfTw2/bnr4Sdmwdyj+Mz+PmskNNx9sId6qV2PBDpOhvT/GVh06RyFX399rb +OP/hyXLSPFkaHjFZQsyDRG0eJAq65l67jqWah4VZ8o178TLOjxvz0lx7G7LNTE3PSMpMLsp1ms8n +JfxCk4gDGzDhOK5vIfGCFz+tqe5kI6KxiI2IytKO23B7pa5c/2CKvGyM+6O3vx+kYyHtfURIYQ+G +5ECdFlMNhSMJH35FXvqWaAh0PeChUgx1bVxKxbhnV0enHvmSiAe/H1Y95NQc4S/N9bdhGwEjZNYZ +vB/X7Wko5KvLev8Fd1Rsq8zE3jjCJ4jO5BWL6cQAexWO7Is/G3cutjELJ+Kk3J1x7Jw9hzIb+Kzi +nOWwqcCQcwLfwv+9gD/HF7YcDBjc2K3Zj7txV2tVOz6Gj6e35PCNZS2fQ31VWpnp1BdluhjtYfaC +Lv0ZfBJf6+vv4wuboD4voSALb8E791ef40ek+dCUd1ocO5Z33mMROMfTGJj7oiHpbXwbH750mcxj +mxX0UJuYP0jcimooyMxdBv2pa+hz8ezuk9dUcZh/kwQyS3++NZ3Hl68cucPvcnzgFuX8t7co57Fb +VKHpFlVHgmFZS/lR3MHSYEzSblzy2WV0STLOG5P8YwRnzRH0myOIpDWsfrLN9eP8QP0cN9dPX8nB +luPd351oJdasfIoHifsjolPTGS27YNvhzsqj2/mbuXQF1S61b0yHR3s6KnuLeOKYcAy/RWZklsJ0 +ddbO6CqeTukgTkT7yY2sNrgxJac4vYynC7qg4hEPjtYkRKXxtTr40eGrJ/FNfiilL06tzdDMxvHN +ukOF/KOU7z//B39W2BAKZW5kc3RyZWFtCmVuZG9iagoyMiAwIG9iagogICAyNjEzCmVuZG9iagoy +MyAwIG9iago8PCAvTGVuZ3RoIDI0IDAgUgogICAvRmlsdGVyIC9GbGF0ZURlY29kZQo+PgpzdHJl +YW0KeJxdks9ugzAMxu88RY7doYLSgFcJVZq6Sw/7o3V7AEhMh7QGlNJD3352vqqTdoD8cL7PNonz +3f55H4bZ5O9xdAeeTT8EH/k8XqJj0/FxCNmqNH5w8+0rvd2pnbJczIfreebTPvRj1jQm/5DN8xyv +ZvHkx44fMmNM/hY9xyEczeJrd0DocJmmHz5xmE2RbbfGcy/pXtrptT2xyZN5ufeyP8zXpdj+FJ/X +iU2ZvldoyY2ez1PrOLbhyFlTFFvT9P024+D/7a0tLF3vvtuYNfVKpEUhi/AavFZmMAtXlFgWiVeI +V8JlkVgWiZeIl8rQ10m/AW+Ue7A01hDykOYheEm9hB5IeyALtsrIQ5rHojervRFqkdaqoKlSrQ61 +Ou0T+jL9C3JWmrN+hOZR2YGd5qyRs9Y49LXqLfQ26T3iXnij/ZfFKtWFt1YvQU+qJ5wV6VkRzpz0 +zC3YKlOLeJsu7nZDeoU6a/fZcJcYZSzSQKZ50EkYAt9ndhondaXnF1p7vskKZW5kc3RyZWFtCmVu +ZG9iagoyNCAwIG9iagogICAzODMKZW5kb2JqCjI1IDAgb2JqCjw8IC9UeXBlIC9Gb250RGVzY3Jp +cHRvcgogICAvRm9udE5hbWUgL0hRUUtGUCtTV0lGVERBWTNCb2xkSXRhbGljCiAgIC9Gb250RmFt +aWx5IChTV0lGVERBWTMpCiAgIC9GbGFncyA0CiAgIC9Gb250QkJveCBbIC0zNzIgLTExODMgMTYw +NCA5MzggXQogICAvSXRhbGljQW5nbGUgMAogICAvQXNjZW50IDc3MAogICAvRGVzY2VudCAtNDMw +CiAgIC9DYXBIZWlnaHQgOTM4CiAgIC9TdGVtViA4MAogICAvU3RlbUggODAKICAgL0ZvbnRGaWxl +MyAyMSAwIFIKPj4KZW5kb2JqCjcgMCBvYmoKPDwgL1R5cGUgL0ZvbnQKICAgL1N1YnR5cGUgL1R5 +cGUxCiAgIC9CYXNlRm9udCAvSFFRS0ZQK1NXSUZUREFZM0JvbGRJdGFsaWMKICAgL0ZpcnN0Q2hh +ciAzMgogICAvTGFzdENoYXIgMTQ2CiAgIC9Gb250RGVzY3JpcHRvciAyNSAwIFIKICAgL0VuY29k +aW5nIC9XaW5BbnNpRW5jb2RpbmcKICAgL1dpZHRocyBbIDIyMCAwIDAgMCAwIDAgMCAwIDAgMCAw +IDAgMCAwIDI3MCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCA2MzAgMCAwIDAg +MCAwIDAgNzE2IDAgMCAwIDAgMCA2NTYgMCAwIDAgMCAwIDU3NyAwIDAgODk5IDAgNTY4IDAgMCAw +IDAgMCAwIDAgNTIyIDUyMyA0MDkgNTMxIDQzNiAzNTAgNTExIDU0OSAzMDQgMCA1MjMgMjk1IDc4 +OCA1NDUgNDg3IDUyOSA1MTIgNDAyIDM2MiAzMjYgNTQ4IDQ3NSA2OTYgNDYyIDUxNSA0MDEgMCAw +IDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDE4OCBdCiAgICAvVG9V +bmljb2RlIDIzIDAgUgo+PgplbmRvYmoKMjYgMCBvYmoKPDwgL0xlbmd0aCAyNyAwIFIKICAgL0Zp +bHRlciAvRmxhdGVEZWNvZGUKICAgL1N1YnR5cGUgL0NJREZvbnRUeXBlMEMKPj4Kc3RyZWFtCnic +Y2RgYWFgZGQUCQ73dAtxcYw0dsrPSfEsSczJTGZgZGFgYGAEYqcf0j9kunnkfvAz/JBl/CHH9EOe ++YcIyx8Omd+JMmwuv+xY+3iUZIFqu3hUgBTDAR5VELWbH0SeEGzkYWJgZWRk49N28HRMyU9K9UxJ +zSvJLKl0zi+oLMpMzyhR0EjWVDAyMDTVUchOzSnLzNPR0YG7SAHkJAWIm+CCDAxMQKcxMoPdx8DM +wMzIqJS3p3vvD8O9jHv3fj+wl3mv2A+VH1P/qLDt/ZMs+sPw+4E/hux8u783f38u6l3aXf19Xvek +jaxm3yeJHp3j8Vvod0zAb2vDwIbz34W+xxz4bvVUftEO0d8Wv/l/x/4u+6263va7+HeL7/zfY7+X +fVdNv/lbXJ5v2fc7P5xFq/JY97eviOk25fitHGFo65Gy/aFc95tZt27s46hbwPpbPCpAqVuR4zfr +lahP3wW/G7z5HvKdwX6nhtys7/2iv03+yW1s/W7yS46VDxHaPKBQUwQF5wKhmlk/PLu/x07f0Mf2 +u6qbHSwj/KND5Eej6Bwerh4ePoZWRkYmZhZWNnYOTi5uHl4+fgFBIWERUTFxCUkpaRlZOXkFRSVl +FVU1dQ1NLW0dXT19A0MjYxNTM3MLSytrG1s7ewdHJ2cXVzd3D08vbx9fP/+AwKDgkNCw8IjIqOiY +2Lj4hMSk5JTUtPSMzKzsnNy8/ILCouKS0rLyisqq6prauvqGxqbmltY27sEAAJhry3MKZW5kc3Ry +ZWFtCmVuZG9iagoyNyAwIG9iagogICA1NjUKZW5kb2JqCjI4IDAgb2JqCjw8IC9MZW5ndGggMjkg +MCBSCiAgIC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCj4+CnN0cmVhbQp4nF2QwWrDMAyG734KHbtDcZJS +2CEYRnfJYetotgdwbDkzLLZRnEPefo5SOpjAht/6P/Fb8tK9dsFnkB8UTY8ZnA+WcI4LGYQBRx9E +3YD1Jt8V32bSScgC9+ucceqCi6JtQd5Kc860wuHFxgGfBADIK1kkH0Y4fF36/alfUvrBCUOGSigF +Fl0Z96bTu54QJMPHzpa+z+uxYH+OzzUhNKzrPZKJFuekDZIOI4q2KqWgdaWUwGD/9ZudGpz51sTu +urir0/CsWDWs7JnZu2ubsn35EdEsRCUd74VjbYF8wMfqUkwbxecX6UZzeQplbmRzdHJlYW0KZW5k +b2JqCjI5IDAgb2JqCiAgIDIzMwplbmRvYmoKMzAgMCBvYmoKPDwgL1R5cGUgL0ZvbnREZXNjcmlw +dG9yCiAgIC9Gb250TmFtZSAvUFdDREVaK1NXSUZUREFZM0JvbGRJdGFsaWMKICAgL0ZvbnRGYW1p +bHkgKFNXSUZUREFZMykKICAgL0ZsYWdzIDQKICAgL0ZvbnRCQm94IFsgLTM3MiAtMTE4MyAxNjA0 +IDkzOCBdCiAgIC9JdGFsaWNBbmdsZSAwCiAgIC9Bc2NlbnQgNzcwCiAgIC9EZXNjZW50IC00MzAK +ICAgL0NhcEhlaWdodCA5MzgKICAgL1N0ZW1WIDgwCiAgIC9TdGVtSCA4MAogICAvRm9udEZpbGUz +IDI2IDAgUgo+PgplbmRvYmoKMzEgMCBvYmoKPDwgL1R5cGUgL0ZvbnQKICAgL1N1YnR5cGUgL0NJ +REZvbnRUeXBlMAogICAvQmFzZUZvbnQgL1BXQ0RFWitTV0lGVERBWTNCb2xkSXRhbGljCiAgIC9D +SURTeXN0ZW1JbmZvCiAgIDw8IC9SZWdpc3RyeSAoQWRvYmUpCiAgICAgIC9PcmRlcmluZyAoSWRl +bnRpdHkpCiAgICAgIC9TdXBwbGVtZW50IDAKICAgPj4KICAgL0ZvbnREZXNjcmlwdG9yIDMwIDAg +UgogICAvVyBbMCBbIDUwMCA1NDEgNTIwIF1dCj4+CmVuZG9iago4IDAgb2JqCjw8IC9UeXBlIC9G +b250CiAgIC9TdWJ0eXBlIC9UeXBlMAogICAvQmFzZUZvbnQgL1BXQ0RFWitTV0lGVERBWTNCb2xk +SXRhbGljCiAgIC9FbmNvZGluZyAvSWRlbnRpdHktSAogICAvRGVzY2VuZGFudEZvbnRzIFsgMzEg +MCBSXQogICAvVG9Vbmljb2RlIDI4IDAgUgo+PgplbmRvYmoKMSAwIG9iago8PCAvVHlwZSAvUGFn +ZXMKICAgL0tpZHMgWyA5IDAgUiBdCiAgIC9Db3VudCAxCj4+CmVuZG9iagozMiAwIG9iago8PCAv +Q3JlYXRvciAoY2Fpcm8gMS4xMy4xIChodHRwOi8vY2Fpcm9ncmFwaGljcy5vcmcpKQogICAvUHJv +ZHVjZXIgKGNhaXJvIDEuMTMuMSAoaHR0cDovL2NhaXJvZ3JhcGhpY3Mub3JnKSkKPj4KZW5kb2Jq +CjMzIDAgb2JqCjw8IC9UeXBlIC9DYXRhbG9nCiAgIC9QYWdlcyAxIDAgUgo+PgplbmRvYmoKeHJl +ZgowIDM0CjAwMDAwMDAwMDAgNjU1MzUgZiAKMDAwMDAzNDYzNSAwMDAwMCBuIAowMDAwMDAzMjA5 +IDAwMDAwIG4gCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMzE4NiAwMDAwMCBuIAowMDAwMDE2 +MDg0IDAwMDAwIG4gCjAwMDAwMjg3MzUgMDAwMDAgbiAKMDAwMDAzMjM5NSAwMDAwMCBuIAowMDAw +MDM0NDY2IDAwMDAwIG4gCjAwMDAwMDMzNzUgMDAwMDAgbiAKMDAwMDAwMzU4OSAwMDAwMCBuIAow +MDAwMDE0NTE3IDAwMDAwIG4gCjAwMDAwMTQ1NDIgMDAwMDAgbiAKMDAwMDAxNTc5MCAwMDAwMCBu +IAowMDAwMDE1ODE0IDAwMDAwIG4gCjAwMDAwMTcxNzIgMDAwMDAgbiAKMDAwMDAyNjA3MCAwMDAw +MCBuIAowMDAwMDI2MDk0IDAwMDAwIG4gCjAwMDAwMjczMDggMDAwMDAgbiAKMDAwMDAyNzMzMiAw +MDAwMCBuIAowMDAwMDI3NjAyIDAwMDAwIG4gCjAwMDAwMjg4OTggMDAwMDAgbiAKMDAwMDAzMTYx +MCAwMDAwMCBuIAowMDAwMDMxNjM0IDAwMDAwIG4gCjAwMDAwMzIwOTYgMDAwMDAgbiAKMDAwMDAz +MjExOSAwMDAwMCBuIAowMDAwMDMyOTEzIDAwMDAwIG4gCjAwMDAwMzM1ODQgMDAwMDAgbiAKMDAw +MDAzMzYwNyAwMDAwMCBuIAowMDAwMDMzOTE5IDAwMDAwIG4gCjAwMDAwMzM5NDIgMDAwMDAgbiAK +MDAwMDAzNDIxOCAwMDAwMCBuIAowMDAwMDM0NzAwIDAwMDAwIG4gCjAwMDAwMzQ4MjggMDAwMDAg +biAKdHJhaWxlcgo8PCAvU2l6ZSAzNAogICAvUm9vdCAzMyAwIFIKICAgL0luZm8gMzIgMCBSCj4+ +CnN0YXJ0eHJlZgozNDg4MQolJUVPRgo= +--=_be6bc52b94449e229e651d02e56a25f1-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-382.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-382.eml new file mode 100644 index 00000000..f34b89fc --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-382.eml @@ -0,0 +1,9 @@ +From: MAILER-DAEMON@mta-09.someserver.com (Mail Delivery System) +To: to@here.com +Subject: Test +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-40.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-40.eml new file mode 100644 index 00000000..52e7ff9a --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-40.eml @@ -0,0 +1,39 @@ +Return-Path: +Delivered-To: receipent@receipent_domain.pl +Received: from h2.server.pl +\tby h2.server.pl with LMTP +\tid 4IDTIEUkm18ZSSkA87l24w +\t(envelope-from ) +\tfor ; Thu, 29 Oct 2020 21:21:25 +0100 +Return-path: +Envelope-to: receipent@receipent_domain.pl +Delivery-date: Thu, 29 Oct 2020 21:21:25 +0100 +Received: from sender_domain.pl ([server ip]) +\tby h2.server.pl with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 +\t(Exim 4.94) +\t(envelope-from ) +\tid 1kYEQG-00BPgD-S0 +\tfor receipent@receipent_domain.pl; Thu, 29 Oct 2020 21:21:25 +0100 +Received: by sender_domain.pl (Postfix, from userid 1000) +\tid 57DADAB; Thu, 29 Oct 2020 21:21:23 +0100 (CET) +DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sender_domain.pl; s=default; +\tt=1604002883; bh=CsZufJouWdjY/W12No6MSSMwbp0VaS8EOMGg9WptEaI=; +\th=From:To:Subject:Date; +\tb=v0NAncnNT/w+gInANxAkMt20ktM4LZquuwlokUmLpPyO3++8dy112olu63Dkn9L2E +\t GwfHGqW+8f7g494UK6asUKqTx8fHxlEJbHqAiEV5QrlynSeZDFXsKvGDW8XNMFBKop +\t sAjvp8NTUiNcA4MTbFaZ7RX15A/9d9QVEynU8MaNP2ZYKnq9J/JXgUjjMnx+FiULqf +\t xJN/5rjwHRx7f6JQoXXUxuck6Zh4tSDiLLnDFasrSxed6sTNfnZMAggCyb1++estNk +\t q6HNBwp85Az3ELo10RbBF/WM2FhxxFz1khncRtCyLXLUZ2lzhjan765KXpeYg7FUa9 +\t zItPWVTaTzTEg== +From: faked_sender@sender_domain.pl +To: receipent@receipent_domain.pl +Subject: Zly from +Message-Id: <20201029202123.57DADAB@sender_domain.pl> +Date: Thu, 29 Oct 2020 21:21:01 +0100 (CET) +Forward-Confirmed-ReverseDNS: Reverse and forward lookup success on server ip, -10 Spam score +SPFCheck: Server passes SPF test, -30 Spam score +X-DKIM: signer='sender_domain.pl' status='pass' reason='' +DKIMCheck: Server passes DKIM test, -20 Spam score +X-Spam-Score: -0.2 (/) + +Test message diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-401.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-401.eml new file mode 100644 index 00000000..386fdad8 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-401.eml @@ -0,0 +1,9 @@ +From: from@there.com +To: to@here.com +Subject: 1;00pm Client running few minutes late +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-410.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-410.eml new file mode 100644 index 00000000..e5fe0c62 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-410.eml @@ -0,0 +1,16 @@ +From: from@there.com +To: to@here.com +Subject: =?ISO-2022-JP?B?GyRCIXlCaBsoQjEzMhskQjlmISEhViUsITwlRyVzGyhCJhskQiUoJS8lOSVGJWolIiFXQGxMZ0U5JE4kPyRhJE4jURsoQiYbJEIjQSU1JW0lcyEhIVo3bjQpJSglLyU5JUYlaiUiISYlbyE8JS8hWxsoQg==?= +Date: Wed, 13 Sep 2017 13:05:45 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" + +Hi +--------------B832AF745285AEEC6D5AEE42 +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="=?ISO-2022-JP?B?GyRCIXlCaBsoQjEzMhskQjlmISEhViUsITwlRyVzGyhCJhskQiUoJS8lOSVGJWolIiFXQGxMZ0U5JE4kPyRhJE4jURsoQiYbJEIjQSU1JW0lcyEhIVo3bjQpJSglLyU5JUYlaiUiISYlbyE8JS8hWxsoQg==?=" + +SGkh +--------------B832AF745285AEEC6D5AEE42-- \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-410b.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-410b.eml new file mode 100644 index 00000000..b260a1e0 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-410b.eml @@ -0,0 +1,22 @@ +From: from@there.com +To: to@here.com +Subject: =?iso-8859-1?Q?386_-_400021804_-_19.,_Heiligenst=E4dter_Stra=DFe_80_-_081?= + =?iso-8859-1?Q?9306_-_Anfrage_Vergabevorschlag?= +Date: Wed, 13 Sep 2017 13:05:45 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" + +Hi +--------------B832AF745285AEEC6D5AEE42 +Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; + name="=?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?=" +Content-Description: =?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?= +Content-Disposition: attachment; + filename="=?iso-8859-1?Q?2021=5FM=E4ngelliste=5F0819306.xlsx?="; size=11641; + creation-date="Mon, 10 Jan 2022 09:01:00 GMT"; + modification-date="Mon, 10 Jan 2022 09:01:00 GMT" +Content-Transfer-Encoding: base64 + +SGkh +--------------B832AF745285AEEC6D5AEE42-- \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-410symbols.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-410symbols.eml new file mode 100644 index 00000000..b83a2f26 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-410symbols.eml @@ -0,0 +1,22 @@ +From: from@there.com +To: to@here.com +Subject: =?iso-8859-1?Q?386_-_400021804_-_19.,_Heiligenst=E4dter_Stra=DFe_80_-_081?= + =?iso-8859-1?Q?9306_-_Anfrage_Vergabevorschlag?= +Date: Wed, 13 Sep 2017 13:05:45 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" + +Hi +--------------B832AF745285AEEC6D5AEE42 +Content-Type: application/pdf; name="Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf" +Content-Description: Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf +Content-Disposition: attachment; + filename="Checkliste 10.,DAVIDGASSE 76-80;2;2.pdf"; size=3439313; + creation-date="Tue, 12 Sep 2023 06:53:03 GMT"; + modification-date="Tue, 12 Sep 2023 08:18:16 GMT" +Content-ID: <34A0EDD24A954140A472605B7526F190@there.com> +Content-Transfer-Encoding: base64 + +SGkh +--------------B832AF745285AEEC6D5AEE42-- \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-412.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-412.eml new file mode 100644 index 00000000..f28b81a7 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-412.eml @@ -0,0 +1,216 @@ +Return-Path: +Delivered-To: gmx@tonymarston.co.uk +Received: from ion.dnsprotect.com + by ion.dnsprotect.com with LMTP + id YFDRGeZ6d2SlCRUAzEkvSQ + (envelope-from ) + for ; Wed, 31 May 2023 12:50:46 -0400 +Return-path: +Envelope-to: gmx@tonymarston.co.uk +Delivery-date: Wed, 31 May 2023 12:50:46 -0400 +Received: from mail-vi1eur04olkn2050.outbound.protection.outlook.com ([40.92.75.50]:23637 helo=EUR04-VI1-obe.outbound.protection.outlook.com) + by ion.dnsprotect.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + (Exim 4.96) + (envelope-from ) + id 1q4P28-005pTm-0E + for gmx@tonymarston.co.uk; + Wed, 31 May 2023 12:50:46 -0400 +ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; + b=SYBG6BEOiWsmVfcgXUQJ0moS1SuG/IdTK6DIT4H3g7CQ+hbWIbItTxOhFzJiHP+q0uz+XzR1FzX2Daso+4iKotX7x2ViHIA0Hs65xUZVFtvflMsUrB+5RLlf3Pr7DiNKguQQtC+R2IBLvedc+IqElnMrTHcxLVS2gWl89MZx5Q0bXGWW/9wBVq6yvc6C69ynppcEdD0QZsoUQlp2DgzDpg8iG3y6dYGxFiTvLzw08nTQiCuqi8qQ+nmHyeeItIiAmyKynvyiL+kh4frcSDS67r6PU/CBxvto/nP3RCAxHuzJEGOpS7LJPqoJAlRSrUp2zpeEMpmDFJUE/Jo0K+EgcQ== +ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; + s=arcselector9901; + h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; + bh=ISg5C/1AgVASEPkGp/cgowfc/y9qywGvXMTv5yjJffs=; + b=eVYGErUWMxOeFGLg2nPuB0E/ngKet0hEVcN8Ay4ujGFY4k7i+1hrmnOMD6XiaIk3gVrqPalsmDjmEHpS0zV3+fPPTSktlSvkLrUr5ViVI1kMVBbBQsowLD5x3FpX7fnP2q17WPQ2P6R8Ibudkdnei8uq7gZhc3CSDLv4PfNma45H0FmdaB40mF2dCYzj5hEzr6jmMliANHJjznuDEFEUH3CfS1/iIA9rzhBKPKtahipTNeYiLqvZpKo1fO/XkZ57T44fqHkocfCyEK3Y1rehWudmkU8a9eEZlU5nBC6xoGO3P5Q1XIUNEHFmx2HH7eO8IgGzq/vbLMhcvbc3Ysdb2A== +ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; + dkim=none; arc=none +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; + s=selector1; + h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; + bh=ISg5C/1AgVASEPkGp/cgowfc/y9qywGvXMTv5yjJffs=; + b=Qv71Bx+LsM9Lo0uen0vxQzWI3ju4Q095ZMkKPXDaKsd5Y8dA3QteMpAPhy3/mAdP1+EV8NviDBhamtTG4qMO+zEqu/pyRpBGZOtjyiJGKh7aFh2bbodOkJkiGqH3jPwYBnE7T1XAqDVFmvRpuqIkqBe9FXeCZKRrF/Na5Y+zuklH7ebuGQVzIK+xol6q7BDgb/oLul7Wa3r3Lw40cPW5leUgwxngRFMucUVVO5aJ4MWlk76CmcN8XqgwVcFaACY80HLWRqRZfM8n24/KzV9nKSZIQFCgJi2CiqnEWVRSZZtZ9SudJJv4S3C/gU4OYoiFKr7GkEQibyqE2QkGHCBA1g== +Received: from PAXP193MB2364.EURP193.PROD.OUTLOOK.COM (2603:10a6:102:22b::9) + by DB8P193MB0773.EURP193.PROD.OUTLOOK.COM (2603:10a6:10:15a::10) with + Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.22; Wed, 31 May + 2023 16:50:03 +0000 +Received: from PAXP193MB2364.EURP193.PROD.OUTLOOK.COM + ([fe80::b962:59b:2d33:85c2]) by PAXP193MB2364.EURP193.PROD.OUTLOOK.COM + ([fe80::b962:59b:2d33:85c2%5]) with mapi id 15.20.6455.020; Wed, 31 May 2023 + 16:50:03 +0000 +From: Tony Marston +To: "gmx@tonymarston.co.uk" +Subject: RE: TEST MESSAGE +Thread-Topic: TEST MESSAGE +Thread-Index: AQHZjysmbQn8p2cYOEawNV6ywnFmN690oIyAgAAA5rw= +Date: Wed, 31 May 2023 16:50:03 +0000 +Message-ID: + +References: + + <944a7d16fcb607628f358cdd0f5ba8c0@tonymarston.co.uk> +In-Reply-To: <944a7d16fcb607628f358cdd0f5ba8c0@tonymarston.co.uk> +Accept-Language: en-GB, en-US +Content-Language: en-GB +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +x-ms-exchange-messagesentrepresentingtype: 1 +x-tmn: [ABOzTq1ytyWYuvBD5A4I78Eqna1hBLeM] +x-ms-publictraffictype: Email +x-ms-traffictypediagnostic: PAXP193MB2364:EE_|DB8P193MB0773:EE_ +x-ms-office365-filtering-correlation-id: 7fbd6771-9a0d-495d-c4d3-08db61f714a6 +x-microsoft-antispam: BCL:0; +x-microsoft-antispam-message-info: + fwWKs8Qs/JyQ+pSnCNC804PQ86JYn/R63U7P6WCeXLC/fVSGqcAnslOc2vbxC2cUeTPPfow1WAz3f73/7Uk+byKxiE6L48WkgL6BFKVkYCwPKcQ3ps6KyEdGL6uUvPqYKwf5gFgUiTt+fKDiR/GJljj6qmN51jd5lUBvLf1g59q3LryUC+lEy6iLQ8cjCivzmBcR+0C2+uaa/xsjJxokbIEQoMicjjUiVWFkxRFBDr6FO8kEQyzzs70pNivK6mcXpVeJSOiLQfYa/2Q5QDYhE8kznG1EYUzHBQD/sLp/maUgmpKj1b8ObeI13QXed1qih+CtdLYAmPs5GPaoz8aY7pmaxroKLjBAqfOAC2IeQ3grxdQ8eRXlrnZ29cQnvD9tDryUvE9nyQLinaM2Dft4MueHvBTL5+WOTNnVQB98zVjnop8iVkwNrBKzPYiox9ufs9XFXNl0+2fFn66647ET7y/DkBKcszTKYF5RRp5o59QAh8rUTsaKeGJkPkyowZd+i6R12NIavL+eOOgnKvziTTbNl1lGgP+3zTKbgbb6K+DxfbKNl1zaTNvonOHwzI3jfdkDRtg5BvZVKstyl9AfZqo6OZ7ii3JKgVquRVWAtEQ6J6tx1Va/nTVrn1478+Dj +x-ms-exchange-antispam-messagedata-chunkcount: 1 +x-ms-exchange-antispam-messagedata-0: + =?us-ascii?Q?EMaSeqWhMBslXR7KptI34/opub+lBzTReVt3ACHDu/w7NvVUPpdp4YhwogpL?= + =?us-ascii?Q?8V9o/Zj+8vv6zZ7YL0n2NpODi8fzrPScgRiZGtJmfS58OqfgW2yygp1BmawZ?= + =?us-ascii?Q?y99Omv39THENDmCAba4d8zYLikOc+HJUfhpWeb/L9yqut7T2QkPFJYoeN5vU?= + =?us-ascii?Q?LeJ1hoPlguhNnDwMtE3HTgAl0Hbesms0Rb7wGaTDsgAc7XOO+8XpqLamnU0m?= + =?us-ascii?Q?zPpkQXV8+V5dFU2HxgIcYPYSaTX1CLPCdNcCAr1uHPnN81Ntm9Jb7fpYs1oA?= + =?us-ascii?Q?tgzPMwt37Ks9eQucJWZ5LQnNmZl/kYtVnvkylqYYMWiAg3y2XtjVkW/Ut/V2?= + =?us-ascii?Q?6vMfyCB5fEGJrn/uCp+KwL1s7s/4B332Bn4zvwpYd5TioMSGf9Rdp157eAfg?= + =?us-ascii?Q?LiNlLjDFdRc5SSEkUEl1TeX0FOQLsaCsQQqC/hzb10boa49GuxpoKwRmwhAO?= + =?us-ascii?Q?LZ2+veS5Jr1qWngBGo4MTkEq7nD6vBRIXQmKiLMpJc+Gk3/PCADL+H0IRH0+?= + =?us-ascii?Q?4uHnvcVr6CrDDZ2BEwcaWOa/ct8yUI5G9SC5gFP53TaS2llCnYwHAX1PkMAo?= + =?us-ascii?Q?w2LHFHE5I5dtQQJHaWNGMJGYdPmb9dDrksggLWXN+IxsxvFcFNSK2GPaqOMJ?= + =?us-ascii?Q?H4ht1rpqHTlU0uzgjb19gKCCcBdZfIzv118RTjFYG+EX/rsHlNRei/OWdTBF?= + =?us-ascii?Q?xf5cdnap836rQmre5ZoubNsSw2qKSRJhmZH1pCHoCFLtreM1fk7kkVJfkUz5?= + =?us-ascii?Q?ApMa03dEfFvzVv5wvPdWBLiCqzI6z6z8fUmwg2XfvK9Nyxb1AOZoT7JUXnp2?= + =?us-ascii?Q?Me6dTKqGKsBx87Dtny+fANHqgOm+Eo/pBZqyXwN93udbltxPmtNJ84MJJjyx?= + =?us-ascii?Q?vbEiDnMVb4knBO+sBqlKAVUv1F9ZJA2oUTrOD7t1xx6nBmQTgoYN6zsi+dgw?= + =?us-ascii?Q?nPebsl1/6fUy73FWLUKkeA64PeSa00Zi/q53ylXmUZV4Pc+11blKdL8o+p32?= + =?us-ascii?Q?dTD0ndul0WvvpQf8RdYNtGJ/BMurqNfvHq9wJo7Iu4fgTElR50ngwEsr28Bc?= + =?us-ascii?Q?G81pAb2fNhID6ewyOGfj87kqybxUhv1E+4pquh770UagjD1J3rKAUiw1sxWp?= + =?us-ascii?Q?u+FSmd7HKgd2cKJsmMErnQelF3DNozw5d0qdNELXZNO03xlMiADVvhqEJuqc?= + =?us-ascii?Q?uArdsSo2hyApUaiB+dM4Fp+oeiGienEQl64NJ7QFxRb/h96J0iTL3Vp8+8Y?= + =?us-ascii?Q?=3D?= +Content-Type: multipart/alternative; + boundary="_000_PAXP193MB2364F1160B9E7C559D7D897ABB489PAXP193MB2364EURP_" +MIME-Version: 1.0 +X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-80ceb.templateTenant +X-MS-Exchange-CrossTenant-AuthAs: Internal +X-MS-Exchange-CrossTenant-AuthSource: PAXP193MB2364.EURP193.PROD.OUTLOOK.COM +X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 +X-MS-Exchange-CrossTenant-Network-Message-Id: 7fbd6771-9a0d-495d-c4d3-08db61f714a6 +X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2023 16:50:03.3982 + (UTC) +X-MS-Exchange-CrossTenant-fromentityheader: Hosted +X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa +X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 +X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8P193MB0773 +X-Spam-Status: No, score=-1.6 +X-Spam-Score: -15 +X-Spam-Bar: - +X-Ham-Report: Spam detection software, running on the system "ion.dnsprotect.com", + has NOT identified this incoming email as spam. The original + message has been attached to this so you can view it or label + similar future email. If you have any questions, see + root\@localhost for details. + Content preview: Here is my reply to your reply. Tony Marston From: gmx@tonymarston.co.uk + Sent: 31 May 2023 17:46 To: Tony Marston + Subject: Re: TEST MESSAGE + Content analysis details: (-1.6 points, 8.0 required) + pts rule name description + ---- ---------------------- -------------------------------------------------- + -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% + [score: 0.0005] + 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider + [tonymarston[at]hotmail.com] + -0.0 SPF_PASS SPF: sender matches SPF record + 0.5 SUBJ_ALL_CAPS Subject is all capitals + -0.0 SPF_HELO_PASS SPF: HELO matches SPF record + 0.0 HTML_MESSAGE BODY: HTML included in message + -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from + author's domain + 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily + valid + -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from + envelope-from domain + -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature + -0.0 T_SCC_BODY_TEXT_LINE No description available. +X-Spam-Flag: NO +X-From-Rewrite: unmodified, no actual sender determined from check mail permissions + +--_000_PAXP193MB2364F1160B9E7C559D7D897ABB489PAXP193MB2364EURP_ +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Here is my reply to your reply. + +Tony Marston + +From: gmx@tonymarston.co.uk +Sent: 31 May 2023 17:46 +To: Tony Marston +Subject: Re: TEST MESSAGE + +On 2023-05-25 13:06, Tony Marston wrote: +Here is my reply to your message +> Tony Marston + + +--_000_PAXP193MB2364F1160B9E7C559D7D897ABB489PAXP193MB2364EURP_ +Content-Type: text/html; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
+

Here is my reply to your reply.

+

 

+

Tony Marston

+

 

+
+

From: gmx@tonymarston.co.uk
+Sent: 31 May 2023 17:46
+To: Tony Marston
+Subject: Re: TEST MESSAGE

+
+

 

+

On 2023-05-25 13:06, Tony Marston wrote:
+Here is my reply to your message
+> Tony Marston

+

 

+
+ + + +--_000_PAXP193MB2364F1160B9E7C559D7D897ABB489PAXP193MB2364EURP_-- \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-413.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-413.eml new file mode 100644 index 00000000..9f0cbfa2 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-413.eml @@ -0,0 +1,32 @@ +Return-Path: +Delivered-To: gmx@tonymarston.co.uk +Received: from ion.dnsprotect.com + by ion.dnsprotect.com with LMTP + id oPy8IzIke2Rr4gIAzEkvSQ + (envelope-from ) + for ; Sat, 03 Jun 2023 07:29:54 -0400 +Return-path: +Envelope-to: gmx@tonymarston.net +Delivery-date: Sat, 03 Jun 2023 07:29:54 -0400 +Received: from [::1] (port=48740 helo=ion.dnsprotect.com) + by ion.dnsprotect.com with esmtpa (Exim 4.96) + (envelope-from ) + id 1q5PSF-000nPQ-1F + for gmx@tonymarston.net; + Sat, 03 Jun 2023 07:29:54 -0400 +MIME-Version: 1.0 +Date: Sat, 03 Jun 2023 07:29:54 -0400 +From: radicore +To: gmx@tonymarston.net +Subject: Test Message +User-Agent: Roundcube Webmail/1.6.0 +Message-ID: +X-Sender: radicore@radicore.org +Content-Type: text/plain; charset=US-ASCII; + format=flowed +Content-Transfer-Encoding: 7bit +X-From-Rewrite: unmodified, already matched + +This is just a test, so ignore it (if you can!) + +Tony Marston diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-414.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-414.eml new file mode 100644 index 00000000..302e4492 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-414.eml @@ -0,0 +1,27 @@ +From: from@there.com +To: to@here.com +Subject: Test +Date: Fri, 29 Sep 2017 10:55:23 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------5B1F217006A67C28E756A62E" + +This is a multi-part message in MIME format. + +--------------5B1F217006A67C28E756A62E +Content-Type: text/plain; charset=UTF-8; + name="../../example/MyFile.txt" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="../../example/MyFile.txt" + +TXlGaWxlQ29udGVudA== +--------------5B1F217006A67C28E756A62E +Content-Type: text/plain; charset=UTF-8; + name="php://foo" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="php://foo" + +TXlGaWxlQ29udGVudA== +--------------5B1F217006A67C28E756A62E-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-462.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-462.eml new file mode 100644 index 00000000..d13b3cf1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-462.eml @@ -0,0 +1,5 @@ +From: "postmaster@" +To: receipent@receipent_domain.tld +Subject: Undeliverable: Some subject + +Test message diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-511.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-511.eml new file mode 100644 index 00000000..7cd61faa --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-511.eml @@ -0,0 +1,5 @@ +From: COMPANYNAME | =?iso-8859-2?q?us=B3ugi?= +To: receipent@receipent_domain.tld +Subject: =?utf-8?B?UkU6IFtFWFRFUk5BTF0gUmU6IExvcmVtIElwc3VtIC8=?= =?utf-8?Q?40_one?= + +Test message diff --git a/plugins/vendor/webklex/php-imap/tests/messages/issue-544.eml b/plugins/vendor/webklex/php-imap/tests/messages/issue-544.eml new file mode 100644 index 00000000..96e2c48c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/issue-544.eml @@ -0,0 +1,220 @@ +Sender: "test@mail.com" +From: "test@mail.com" +Subject: Test bad boundary +To: "test_1@mail.com" +Cc: +Bcc: +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="-" + +This is a multi-part message in MIME format. + +--- +Content-Type: text/plain + +This message may contain an attachment in a PDF format. + +Special Comments +- +See attached document + +--- +Content-Type: application/pdf; name="file.pdf" +Content-Transfer-Encoding: base64 +Content-Disposition: inline; filename="file.pdf" +Content-MD5: MLGn6wT7mIo/SUBWQ/mmng== + +JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9UaXRsZSAoZmlsZS0xLnBkZikKL1Byb2R1Y2VyIChT +a2lhL1BERiBtMTE5IEdvb2dsZSBEb2NzIFJlbmRlcmVyKT4+CmVuZG9iagozIDAgb2JqCjw8L2Nh +IDEKL0JNIC9Ob3JtYWw+PgplbmRvYmoKNSAwIG9iago8PC9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9M +ZW5ndGggMTkzPj4gc3RyZWFtCnicdZBNDgIhDIX3PUUvILZDoZAYFxrHtYYb+JeYuHC8fyIwo2NM +oASa99FHgZFyLDgvGjs8PeAJRl1VP3sWGUsc9zgmww2We4u3FxQe2COT8zhc4AqHPwftysweVKXs +MSazxybBshdkMb4MxXQFnvsyojGw2oipmCzYmk7Vig2YzrgikrjGdAcxpBzVaa6ZwLaCfN55lmhn +0LdAqCAYdsyk4QuYpjtCIC/uB0irghtdOduoEG2B8YG7lD/3DS1VWPgKZW5kc3RyZWFtCmVuZG9i +agoyIDAgb2JqCjw8L1R5cGUgL1BhZ2UKL1Jlc291cmNlcyA8PC9Qcm9jU2V0IFsvUERGIC9UZXh0 +IC9JbWFnZUIgL0ltYWdlQyAvSW1hZ2VJXQovRXh0R1N0YXRlIDw8L0czIDMgMCBSPj4KL0ZvbnQg +PDwvRjQgNCAwIFI+Pj4+Ci9NZWRpYUJveCBbMCAwIDYxMiA3OTJdCi9Db250ZW50cyA1IDAgUgov +U3RydWN0UGFyZW50cyAwCi9QYXJlbnQgNiAwIFI+PgplbmRvYmoKNiAwIG9iago8PC9UeXBlIC9Q +YWdlcwovQ291bnQgMQovS2lkcyBbMiAwIFJdPj4KZW5kb2JqCjcgMCBvYmoKPDwvVHlwZSAvQ2F0 +YWxvZwovUGFnZXMgNiAwIFI+PgplbmRvYmoKOCAwIG9iago8PC9MZW5ndGgxIDE3ODUyCi9GaWx0 +ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggODc4OD4+IHN0cmVhbQp4nO16C3wURdbvqerueSWTzOT9 +mGQ6DAmSAQJ5kBAimZAHaowECJggSAJEAogEAoiPlbgughGF9VNUdAXf+GQSIgbUJauuu6IIq6gr +PoiIiroI+ikqSPr7V80EQtR75d7vPvz9tpvzr1NVp05Vn3PqdE0HYkQUCVBp6JiS0jI2n80g4nFo +zR9TOXbCssvWX0SkiHrLmAkTR9v+bF5FxPyoDx07ISNzqefpNMhXoV47qaSiuvKWOd8SZZ9F5Lx1 +xry6RraXf4X+dvTPnLFkkX6v6+0viEwHQFWXNM6a9+oVNeuI7HmoXzarrqmR4sgK/QWQd8y69IpL +Si/57HmiAZgvdEnDzHlL93yTeTsWvJHIck5Dfd3MrqiXoI91QX54AxoisqxJqGON1L9h3qKl/ZZo +DiLtVrRVXjp/Rl32j8Ma8DwPoP/ReXVLG7VN9mb0nY+6flndvPrY2mHvwxiVaCtpnN+0yEinteAv +Ff2NC+sbU9+q2E6UeIQo5M9oU8hCnJzEDAO8sGUVfU0F9Ccyo91BGTQJ2h6HrIa6QvIyBgidP3Nh +vHlU9wVU7KBjm45d6ZAtp11VssVGQ3BrdQvrppM+44qFl5I+a2H9XNIb6qcvJP3SukWXkX5KJ2nx +6+4qOfz2tPCCby2JFtl830cD0kX5SuXILcc2nZjlIEsoqtaTM4oyNMhzPE2gzSGelaJwMxpD5wLP +x81oLG5GE3CLcYqykq3BE1u0dVoWhiUGSuUfdAmPsGg8xKRycanSgr2uirEXjCUfDaYntDe6x7Es +8yjW5hPGNWDFNO0Z4QVS5YoCI6OCVo9Ca6WIGdyifQgNo0toNl1KjfSEGA2dw2jmqRbjo173jJ/Y +mYJ2Hk1TSJEWHhSwsLRtlFwDQS/DSk7xrBeP9c2tXwjZ3hjUK+Q4IodJCgs+kYtipL4oaddzjXeF +pY0GuZro/8mdhzgT9zv/N252kB9SHhS3ukrcWmHgNo2UazXTZOEVFfuY5lBzkGew5pIgz/HMDUFe +gb/PCvJqLxmNEiAV4E3giIpoIfxXBw9WYB9MonrUm9Ayn0S050ifD0V/hWyZT4voCvi6Hn3n0jy0 +z4LsZUAdsaD30qbTeEjNosXg69B6eu2U3COQzMQMw3DrWEGD1P3T2YpRWwheYB3aAyscIue8NDjf +bMzQgL6m4OxN8mmWAGfSENPPhOOZXPxRKuIjaFtPXW2iff9bCv8/uvAsZaByPF9kTxv7G63sxV/X +R36Fto3iQQnawxSvpuENQ8anoIOi7J5tHBT9ouSfY0BHkIg20hNsNj1B2+l5dgSjNtFWaqe/UyyV +0N10Nd1KKxCZk9FyA3w4HhFbQreyeKMdWf9eRO69tBOyF9I18EQMizM+o2W0XHkDo5aTnfohGioR +GTex843FyDL71OsoF7n0MmpkzUa1cbNxi/EAPUhblb8bJygEu2EG7p3Gl9o/jfcQwVPoNrqT9rFb +rE9hB12IfbZV+RNiaJ0yVWXGLOMYVpBCl2MNKmJ0J+vkXmivp09ZHLtaKYaW+w2/8SKkXDQVsbiO +trEcNoanaFOMCmMnctFgWgqtd1IbbcHdQc/RXhaqHTEeMI5QPA3CrloGe7zGOpXuE9d2F8JiGqw0 +kEagZz79mf5Gu5mH/YXP10K1TM2nXWnsQW4bRhOx2ocx8hP2Hb8G9zLlJbXMGI09vpz+KKxNf6UP +WQLLYGPZJD6Qz+f3KAuRKQfJnSdy+A10B7R/wLxsCw/lu5T71cfU46ak7i4jDB5Jo7vw/v0Ls+NJ +ddbEfs/eYh/xYj6N38X3K7eqj6ivm+vw1BcjK9xEj9F3LILlsXHsItbArmYr2B/ZnWwn240sV8Sr ++Fx+WGlQFijPqaNxT1Cb1Ou067UbTQe7q7tf7P5H93dGpnE9jUM8XIvV30b34Mm20i6ZKffRfqax +EBaGW2cpbCK7Cvc17CZ2H9vIHmHtmGU3288+Y1+zb9lxjsTITTyRp/B+uD18Ib+c38rv5rtw7+b/ +4j8osUo/xavkKAVKjTIfq1qhrMH9lPKhmqDuUg3YOVNbq63XNmqPac9rR0yh5t9byPLqj/efSD/x +QTd1r+xe293W3W58iHdGPGLKRW6cVsYhT9UhVy/FueRBxPkbLBS2S2DpbBQ7H5aZxuawBWwpLPkH +to49KNf+JHsWVnqbHcaa7dwl1zyE5/DRfCzui3k9X8DX8Ft4O3+LH1PMSogSrkQr6coYZapSryxS +rlDWKn7lVeV9Zb9yVPkRt6HaVLfaT01TveoYdZq6WL1H/VT9VJuivaJ9bLKZ5pmuN3WYvjIPN48y +V5rHmaeaV5u3mPdYahGdL9BT9HTvfc+6lGuVUuUpuplnqfH8Nf4a4nkazVQqOCKVb2Qr+e9YO++v +LTWN5CPZBXRETYOtX+Lr+VE+Uqlg5WwCzeHDAtpMUeqjKArUF+iQ+iye7TVoXmoKZdfww6ZQasNr +ewTm/KsyVPUqr9BeZR8zq/fSu6qNxbJD/GGlElHwnDpKq6YU5W56UlnAfkdP8VIcMY5bViGOL2CP +Ii9UsUz2vYKTJL8AUZSrfIRcNpf/kw5hH6+k29lMdRbdTFnsavqUHsKuGKhdZko3RbOX+Wy1hUey +duLqI3i6Eaw/U7Qo+gObqqwzHebv4G22S7XRB8rjWP0u/qRSoR7RxrMG7IDf0fW0wLiWrtCq1dfZ +LFLYJEpVu5DdrlYy1RSUy5BVpiCnbcHu3oY8UKRUoCUOkXM+4mIiMsQ63HcgT6iIoNnY4xcii71G +7aYq3kGztDCGrINM/Er3eJpsPER3GrPoMuMWGox8sMK4Gho30se0mjay5d1X4b2ZjJ3zATtfK+O7 +tDJjMG/h7/AJfO3p/oW1U1kcfY77SVRG4WzYor6N82ehscp4E9F9FjLsnTSdzqMDeMovMcM5Sidl +dV/AW40ypRHPu4/GGQ8bbmajBuNSnF+fpQfNGtWZvfCxn72O572K6vl4Y5FS3z0bdlgNK/hgrcXI +Pzf4iidWFfkKR51dMDJ/RF5uTnZW5rChGUMGD/KmDzxrQFpqf0+/FN2dnORKTIiPi42JjoqMcDrC +w+yhITarxWzSVIUzGlTqKavV/Wm1fjXNc845g0XdU4eGul4NtX4dTWWny/j1Wimmny7pg+QlfSR9 +AUnfSUnm0AuoYPAgvdSj+3eWePQONnlcNfibSjw1uv+Q5Cskv0bydvApKRigl8Y1lOh+VquX+suW +NLSU1pZAXWuIrdhTXG8bPIhabSFgQ8D5Yz2NrSx2FJMMjy3Nb8WJ145F+RM8JaX+eE+JWIFfSS2t +m+mvHFddWpKYklIzeJCfFc/wTPeTZ7Q/3CtFqFhO4zcV+81yGn22eBq6UW8d1NmyqsNB02u9oTM9 +M+umVPuVuhoxh9OLeUv8sVceiDtVhfKI4uoVvXsTlZbSuNm6qLa0rND9G8ZV9+5NEVhTAx0Yy1PL +alvKMPUqGLF8go7Z+PKaaj9bjil18STiqQLPV+8pFS21c3S/1TPa09AypxauSWjx0/grUtoSEnxb +jS5KKNVbqqo9Kf7CRE9NXYmrNYpaxl+xOd6nx5/eM3hQq8MZMGxrWHiQCbX3ZupP9klOiguufPxJ +yzKxIs+5CAi/PkPHSqo9eKY8AfV51DIjD2K4ahhG+WfCI7P91uLaFke+aBfj/Vqqw6O3fEuIAM+h +f53eUhdsMaU6viXBijg5GWro7+H9Xq8/PV2EiLkYPsUaR8l6zuBBSzq4x9Po0FHAfFQJ29bV5GfA +/CkpwsE3dvhoOir+5nHVgbpO0xPbyJfhrfHzWtHT2dMTPVH0NPf0nBxe60Ekt8sTdrTfknbyX7gj +JrK0Id/PYv4H3fWB/vIJnvJxk6v10pbaoG3Lq06rBfrzTvYFOX9kcbWSyIMcT1RkL4JyyklhUakO +9aup+GeSQT2zw2xBVMoWppf5HbXnBLDGlpLyKwd1GEfEKFmcGhZcpj/fe3p95Gn105YX2qJgwXhV +lldNbmmxndaHUAtMeG6wQMRTVXWKXuynidiZqfjXYXTmCapJ9PtgsmIhgPgLNAWrpwkmBvkaXCI6 +Bw8qQ6JraSnz6GUttS11HUbzdI/u8LRs5c/z51saS2t7AqfD2HZjor9sVQ1s1cDysSk4jW71sJXj +Wn1s5YTJ1VsdRPrKquo2znhx7eia1v7oq96qE/lkKxetolFUdFGhcoaHbOMWKZ+41UfULHtV2SDr +MzoYyTZLTxujGR080OboaeNoUwNtPtkmLpFjiquqe0eP3JI1g+ULT3yDqw6xWPr+IlJwPjmDX1DB +y2RS5WcU8SUFw0Ot1p/Raz5zvWazIj/NiK8wGG632frqVf879IaHhPQR0KC3r21+xWWxqCf1Yrgj +NLSPgNDb1za/4rJaVfFRVerFcKfd3kfApP0v6tV6640MC/sZvX1t8yuukBCT1Cu+RWF4tMPRR8Bs +OvVB8Ez0hprED8MevXEREX0ELCJKzlxvmN0s9YrQhwkSo6L6CFjhzfAz1xsebpZKhV4MT4qJ6SNg +E1Fy5nodDosMXBH6IvHExfURCIE3+9rmV1xOp+2kXidRSnz8f4/eiF56MTzV5eojEGoTnyXP+IqO +OqUXw9N1vY9AGIIs9sz1xsbaxQdb8U8MH+Lx9BEIR3/CmetNSAg7qRfDM9PS+gg40d/XNr/icrnC +5H4SWwrDhw8c2EcgAtGXfOZ6k5PD5X4SWwrD8wcN6iMQKaLvzPXquuOkXgwvzszsIxATiSg5c72p +qZFyo4mtiuHleXl9BOJFlJy53vT0aLkhnCSHTxg1qo+AS0TJmesdMiRObgixpTB8SmlpHwE3oiTr +zPVmZSWKP2PIvxFg+Mzy8j4CKYiSvrb5FVdeXhJ8I/+J4VupSjlrc1qce/ezykDqAnFlYJs3yb1V +GaAktY10+zoUz+aI6MzwosGKjrNLhkQdOB+0CbRdEX+DmaYki78HAZeBmkGbQNtBu0HInkDRq4Pm +g9aDukSPkqS42nS3o2iAEo+x8TiBhCuxdBhkgBRyAzNAY0HTQKtB60EmKSda5oOWgbaDjsgenxLb +dksW1h7bdqMsNs+5NFNW6wLVKVNldfOFNYGyYlygLDk3IJYfEBuWHWgeMjpQDhgUKCNSM5tFabNn +dhbFKDF4yBgsvBHI+IsUzhi5aYMSTX4QV0zBFp8Ssbl/Wub67YpKTOEKo5nkNjoV1mZ3ZhbZuMEP +I5Dc/Et+KNDDD20Oc2auLzqP76dNoO0ghe/H/SH/kJbxLmFzYCFoPWg7aBfoMMjEu3Dvw/0B/4DC ++fuUASoETQOtB20HHQaZ+ftAB39P/M6RKPhCEOfvAR38XTzWu8BwvhfcXr4XS3ujLXdE5lbJeDOC +jDs1yMQmBpmImMwO/nrbDwMRUWnwNCLqGaUfjaIspV9b6jB3hxLXVjDb3cE/2qx73RuKhvI95AeJ +o+gezLyHdFAlqBbUCDKBewvcW9QMWgPaAPKDEGVAB0jnO0Cvgt6ioSAfqBJk4bvbME0H39WWNtpd +FMNf43/D68HNd/K/y/JV/pIsX+F/leXLKJNR7uAvtSW7qSgE/YQxDpQOlBno1/hfNvePcBtFTr4d +tnMDM0CFoLGgaaDVIBPfzvu1zXRHQMkztAOvfzdvo89k+RDdZyHfHLcvrRgBqAtIyz8bHGC9vj6N ++9LW3omqgLSbbwEnIO0Pq8AJSLvyWnAC0i5dAk5A2sw54ASkTZ4GTkDa2CpwgA5+z9P9B7hzx85l +elE4vxxWuhxWuhxWupxUfrm46QdVrO2utvR0WGydzzsw3d28jTU/y5rHs+b7WHM9a76GNV/LmgtY +88Ws2cuaXaw5mTX7WPMzLA+maGa+9tOqI3xxrHkHa36CNTex5jTWnMqa+7NmneX6OnhK27lZsiiV +xeYiselQnj0K2Secp8CiKYj5FOSE7cBdIEPWfBDS+wWE45NF2W9zemGgPiQ/c37ROfwFDHwBbniB +9oFUOOgFhNELUPICFIQDC0HTQJ2gwyADZIJ0Pyx8tcRwYAaoEDQNtAx0GGSSyzkM4jQ/uMRNcmEZ +wUWPFTX+Am7xIT+Fp/iSHC6H13GOstrFwpPZ2GQjmeeSPFtGOC3ODmbf8p39++/sZC2y8pv5akqC +I9YEy9VtPyS5O9gdbWnPuIui2e2UrCLq2AhKY6ko86hJ1nPIZRFlNrn4Yygz21yTMCy8LW2QexsL +E6O2uH9wHXB/5urgYA+6nnG/rXeorM39Jloe2+Le47rB/XJGhwUtz6Z1MBTbdCm61ZXnfmKHFL0W +Heva3NeIYov7d64x7rku2VEf6Li4CTVfuHt82mT3OdBX4pru9jVB5xZ3oetid0FAKkeM2eIeiiV4 +A2w6FjvQJSf1JEuFE3M7WINvkHmtudo81jzcnGkeZE4xu81J5kRzlCXC4rCEWUItNovFYrKoFm4h +S1SH0eXzir+vR5nkf54Qv3EZqZJ3cJJ/Xpd/gufMwuk88kcq5bx8wmhW7u+cQeXTdf/RCZ4OZhs3 +2a95RjN/RDmVV43253nLO8zGeH+ut9xvrryoupWxm2vQ6ucr8Wu/qrqDGaJpeaL4vriVGHMuvylR +lGctv6mmhuJilhTGFUaMco4oK/kZqA2i99QVdxqf5F9bPqHa/2hSjT9TMEZSTbn/P8QHyK3sa3ak +tGQr+0oUNdVblVHs69Lxol0ZVVJTU97BJkk50tlXkEPEfCXlLHgxCznSLckBuXUBuVSMh1x/UUDO +aqVUKZdqtUo5lQm51qb+pSWt/ftLmVidmqRMU6zeW2ZHKmRSU6VMTDPtkDI7YpqFjH+UFHG5IJLs +kiIsgVxSxMUSpMikUyIZQZEbTorcIGdS2CkZV0DG3tUjY++CjPfXXvWjvV62eWTNjCni422tp7Qe +VOu/cUlDnL95uq63zqgJftVNq50+o0GUdfX+Gk99iX+Gp0RvHTnlZ7qniO6RnpJWnBOrqlun+OpL +2kb6RpZ66kpqNo+pzM49ba4bTs6VXfkzyiqFsmwx15jcn+nOFd1jxFy5Yq5cMdcY3xg5F8kYr6xu +tdDomuIpgXIzD7EhXmsTU2pGxzgaR8ngHZkSd03iNpxWNlKIt8Yf6hntt4NE1+CiwUWiC3tKdIWJ +L/TBrrhrRqYkbmMbg10ONDs9o8m7aHHTYoornV0S+NeEC02LFguDB9Db9EsX+kr9vrqSpkX4VeBP +n1DuLxw3ubrVbEZrrXgkf35PW0hIaYfRGWgcgsZ80agoJwVFW4Fos1qDgj/1/+JgWSx2QTN/ZjPz +JbNF1FSj+JPLqzhSQVXwU+g2nKXE66GpBg/YxLysqUdHcNleLwXqJJ65hxYtDnJBWywKloGRGNLU +Y5KTlzCW96TFFkGhyFwkvnto4gsQfkOnOFOcqQDxX4p+1JXOH30aHSdd7RRproh18Dl8HiQH+eIb +eaPCK1gF58xDPEFrhEC82nhTnPcCx4Gpjk8oo+LQsKG0gE2NzEmJLuIDWcdTTwkt2wAraCe0pPri +eAHZeME0mk/LaBOpG9C/Qb33jjiv4+jUqYeoECqycrKit+3cuVOM3YcFH9c68et5r6/EFhoaOnoi +SbSFhYSAl2iz2O3gJSo+uzN7rrqMr+Z3WtTHVWYlk8YVq8ZCOdthI7jPZ0vxZA8lJn6XIOG3Oxx8 +IpjPfc7wcHCu0FBgmN0uW4/44sPDTRPFdz2BdjswIVTz2cOzNaErTOjSmK75NK7Fh2xjBWw5BUyy +wIuHCnoClYKKEwVUWBg7gjlHDBvKptJULwt0pnicJpM5Z/jw3Cx+vL3ojarb92csUq8adbX7yTE7 +puGVU2YcVPZp2/BbNIlt911t46o91Z5tL7FrOVE5rgt5lW181ATXLD5Tq7fOiKp1dbr3aG9Gvh// +ceTHUYdjv4j/OKnLbbhj3G5vQkFMQUJ5QqN7jds8hPe3D4nJ5zn2cl5qL4s613WhbZJ9lv1j06cx +x9g3YQ4WrYSFOMIp0RVidpIt2qWExHUY37cLOwvmaeGIuCxhxa+flu5IdYb3CID5pl0IgPnaN0B0 +h6c6HLudzOH0OWudzU7V7QsJ4RPdPmFqZ4RwgxODAm5wmsLCgHGyT2gICQkxTXSGORwmUf+yXfjD +GZgswPhqxWzORREyDiJklETI+Ijob3aImtkherabd5n3mQ2z6jYX4lygmJPFKsxxwu3mZDGfOVTM +ZQ4Vms0JYiJzfHJ2pfDqNyfd6a04BOZEr902dUGBQ7Q5TngLDmCvFR4qLBDkHOGMgMdpKlswlRak +5Jg8/dLScrIjhmdlxsQ6s5wsKiYrc3hOdpqnn0nJq39x2ZuL5+y5rnZtxuYT+uOLlzy48aql915/ +z6rj969nSsu4Ih52rIxHvLrjLy/tffVF8f293DioJqujKBrRcY8v1k2uaD5RmapNtU4MqVfmavOt +9SGW6A7jQI+pDvjGCy7JJXBAxDvasaijCeqwiPz4Ya6iiIqEIte4iCnx4111EfMS6lxLTUujj/Kj +cQ6KYeH22NjKmNqYRvyEdYWvcWxwcIdDTXTZzLSNP0rM6JS7icmdIVzlYIzdFulSQ2KxlWQ4gPm6 +XXgFzPdbhENiffYO4712YXm78KxYFZjPpYvtQpV1QHq2387sCW7UNqemZYvy6WTsPDdzx3QYP/qm +CEUxWQ6LmMIhve6QceDob/b1T8/u8bWMCuFZoN7L7y7p9zDpd5f0eIz0Pvye28vvcLK3Qvj8ANoQ +A0cXiDYZCXD3ianoKDwUMSJjasGJBQUMbh8R0bPXcTpYsJDFmuB9cjooK5OcUeaUGOF6lpI2QDr/ +4m2Dvtz6WfdhFvXemyyM/XjQ1rZ8xqoTe/m40LxJN1z9CJsUe387czOFhbKzuj/o/sGhb9rWwG67 +vrjhIZEtIxEOzdobFMsG+pKjrCw8PiN+aDxSd/xdoXfbH7FbEuxn2f3xnfFqvDCrL8GdnWSxK6Hh +LhuL5t6oSFUxkW19FIsyIqUNI31qrGRipTFjpfliU1X8OLmFiX3fuXlYXrZMql6XO3sNsXif2L3x +Pjt2L0XJ1HqWTKv9xH6mQcG0iv0s02yUsLhIvu0iWsB80i7TbYdx7GmZce+Pi3+WbaMUOspsyKve +o703nNdb4PimwFEgd90h76GpyK8FBQUnsO1GiCRbfIUvyuE0Wc0mi4mbHNaIRHKawhPxyvWmX3st +82I/LsxyenKycrJzh2M7xpqFG6Kjs6I9zrb16yMTrlty/pTEvMzxJbt2KetWLZibXXZhxJ9sZbXT +V/14CXbeSvE/zZGX8SZlD/viuU2YSpFokmiWiO3wowx56mG0HkYVwZskOB4ibKtINEk0S8TgE3Lj +UA+j9TAYfMKXJDi8EMS7T6JJolminFm+HHsYrYeRM+cLzjpcbISx1jXWDVa/tdO6z3rEaiar29po +bbauDzZ1WQ2rzW1lxMwqXqcmRfh8sJz1GvxO0kyqzWRO1Uhdr25Q/Wqn2qWaOtUjKidVV3ejpqoi +WYuAAHPMFyvCQVVFEKg2Mb8qQ0HtCQUw3TITyHXaRCyoF1jGVMadeqci4S4skO9U+Nsrd5sgsd8W +LviFU7rXG4nThYKsu7K9vV39Yteu49Fq2vG9YvdcB8gV3mQVPntvX57mP5+zr7dO85DP2dcfp/nA +FyKdIC0uzg+bc/PkOWJzdk6gHDosUPZLDZwvUqNjs8M1t7Ze26epYwFHNMWtNWrNmqHhVzsOU0pq +YCPmBjdiNKJ5PbFOOiJ+rOq0m7pwtusxvthZviS5F6XxSRo/uA8twU0YsDwYQ+ZgOukCukA93QXC +B9iF0gvC8KLW98qCta9r17YdKxNvqxXds9UUvK0iKJmt9S0KdQx2nO0od6iFul/nbn1gqCcpMzoz +aXRSo75Gt+TH5ieeF3teYo3lotApsVMS51jmhs52zIudm9ipvxH1ftz7CW8kH4g6kNylG3qMR/U6 +vNE5ar6jTD3PMdnxccgXSd2OEGcYXlYuk5mZYlxhIRQW3/MGiu85osSL44NbeCa+/24bc9h8tlpb +s03V5QFFlwcUG3KTL0SkMltcsH6sXVjQJt5Zwnw2oU5kLzAHfTnCXrZFLDKLZwWPJIHDSOBgkkrU +ydgatoH52RGmulkhG4u8LtOB8A5ziEmYQ8zAHGIZTJ5KIHFUbhApGiOmY6FiKhYhfMbi3WNy41jv +N5bcJhUO8db65oDjxKnWwFsLJ5TCQ84RwRMKZGlBpDMrWqTDmJjoKC5OKwOcSq8zyooH8m9pWLl7 +zuJ9V01ePcT50JKljz28qKm1e7b2XMu4cauMO+7vPn7j+fknjisP7HzxlTdf2fF24C8JCnaWuDRF +YRxvjzjtXyGd9L3FIAtZjG6yktU4gZO+Tf5/5RBgKIUC7WQHhkkMpzCgg8KBTuCPiCMnMJIigFEU +CYwGHqcYigLGUjQwDniM4ikWfALFg0+kBKBLYhIlApPJZfxAbok6JQFTyA3sRzrQA/ye+lMKMJX6 +AdOA39EA8gDPov7AgZQGTJfopQHGURpEZwEHSxxC6cAM8gKH0mDgMOC3lElDgFmUAcymocY3lCNx +OA0D5lIWMI+yjf+kERLzKQc4UmIBDQeeTbnAUZQHLKQRxtfko3xgEY0EjqYCYDHwKyqhs4GlNApY +RoXGERpDPuA5VAQ8l0YDz5NYTsXA86kEWIHfH4fpAoljaQywks4BjqNzjS9pvMQJdB6wCmfRQzSR +KoCTJF5IFwCraazxL6qhSuBk4CG6iMaBn0ITgFOpCnixxGk00fiCamkSsI4uBE4Hfk4zqAY4kyYD +6+ki4CU0xfiMZklsoKnA2XSxcZDmUC34uRIvpTrgPJqO9stoBnC+xEaaaXxKC6geuJBmAZskLqIG +4xNaTLOBS2gO8HLgx7SU5gKvoHnAK+ky4FUSr6b5wN9RI/AaWmAcwI9agc3UBLyWFgF/T4sN8f9w +lwD/IHE5XW7sp+tpKXAFXQFcSVcCb6CrjA+pha4G3ki/Q8sq4Id0E10DvJmWAVfTtcA1wC76I/0e +eAtdB/wP+oOxj26VeBstB66lFcDbaSV67wDuozvpBuA6ajE+oLvoRuDdtAr4J4n30M3A9bQauIHW +AO8Fvk/30R+B99MtwAfoP4AP0q3Ge/QQ3Wa8Sw/TWuBGuh34iMRH6Q7gY3Qn8HG6C/iExCfpbuAm ++hPQT/cAW4F7qY3WAzfTBmA73We8Q0/R/cY/aYvEp+kBYAc9CNxKDwG3SXyGNgKfpUeMt+k5ehT4 +Z4nb6TFgJz0O/As9AXyengS+QJuMt+hF8gP/Sq3Gm/SSxL9RG/DvtNnYQy9TO3AHPQV8hbYAX6Wn +gTvx/ttDr9FW4C6Ju2kb8B/0LPB1es54g94Avk576M/AN2k78C3qNP5Bb0v8Jz0PfIdeAO6lF4Hv +SnyP/gp8n14CfkB/M3bTPold9LKxiz6kHcD99ArwI4kH6FXgx7QT+Am9BvyUdhuv0UGJn9E/gJ/T +68ZO+oLeAP5L4iHaA/yS3jJepcP0NvCIxK/on8Cv6R3gf9Je4DcSv6X3jFfoKL0P/I4+AH4P3EE/ +0D7gMeoCHqcPgT9KPEEfGS9TNx0AGvQx8N85/f98Tv/qN57Tv/jVOf2zX8jpn/0kpx/8hZz+6U9y ++ie/IqcfOJnTF56W0z/6hZz+kczpH/0kp++XOX1/r5y+X+b0/TKn7++V0z/8SU7vkjm9S+b0rt9g +Tn/n/1FO3/PvnP7vnP6by+m/9XP6bzen/9I5/d85/d85/edz+t9/+zn9vwCXmHoeCmVuZHN0cmVh +bQplbmRvYmoKOSAwIG9iago8PC9UeXBlIC9Gb250RGVzY3JpcHRvcgovRm9udE5hbWUgL0FBQUFB +QStBcmlhbE1UCi9GbGFncyA0Ci9Bc2NlbnQgOTA1LjI3MzQ0Ci9EZXNjZW50IC0yMTEuOTE0MDYK +L1N0ZW1WIDQ1Ljg5ODQzOAovQ2FwSGVpZ2h0IDcxNS44MjAzMQovSXRhbGljQW5nbGUgMAovRm9u +dEJCb3ggWy02NjQuNTUwNzggLTMyNC43MDcwMyAyMDAwIDEwMDUuODU5MzhdCi9Gb250RmlsZTIg +OCAwIFI+PgplbmRvYmoKMTAgMCBvYmoKPDwvVHlwZSAvRm9udAovRm9udERlc2NyaXB0b3IgOSAw +IFIKL0Jhc2VGb250IC9BQUFBQUErQXJpYWxNVAovU3VidHlwZSAvQ0lERm9udFR5cGUyCi9DSURU +b0dJRE1hcCAvSWRlbnRpdHkKL0NJRFN5c3RlbUluZm8gPDwvUmVnaXN0cnkgKEFkb2JlKQovT3Jk +ZXJpbmcgKElkZW50aXR5KQovU3VwcGxlbWVudCAwPj4KL1cgWzE2IFszMzMuMDA3ODEgMjc3Ljgz +MjAzXSAyMCA3MiA1NTYuMTUyMzQgNzMgWzI3Ny44MzIwM10gNzYgNzkgMjIyLjE2Nzk3IDgzIFs1 +NTYuMTUyMzRdXQovRFcgNzUwPj4KZW5kb2JqCjExIDAgb2JqCjw8L0ZpbHRlciAvRmxhdGVEZWNv +ZGUKL0xlbmd0aCAyNzE+PiBzdHJlYW0KeJxdkdtqxCAQhu99irncXizRbNplIQSWLAu56IGmfQCj +k1RojBhzkbevhzSFCiofM//vzJjVza3RykH2ZifRooNeaWlxnhYrEDoclCYsB6mE2yieYuSGZF7c +rrPDsdH9RMoSIHv30dnZFQ5XOXX4QLJXK9EqPcDhs249t4sx3ziidkBJVYHE3js9c/PCR4Qsyo6N +9HHl1qPX/GV8rAYhj8xSNWKSOBsu0HI9ICmpXxWUd78qglr+ixdJ1fXii9uQzQqfTemJVYGKOtLT +JdE9UR3p8RTpTKPv5pD/+u3PMxrTGItXfktO50jFJRkWm0UShSrDNPcRiMVa330ceWw7NKw07r9i +JhNUYf8AtiGI+QplbmRzdHJlYW0KZW5kb2JqCjQgMCBvYmoKPDwvVHlwZSAvRm9udAovU3VidHlw +ZSAvVHlwZTAKL0Jhc2VGb250IC9BQUFBQUErQXJpYWxNVAovRW5jb2RpbmcgL0lkZW50aXR5LUgK +L0Rlc2NlbmRhbnRGb250cyBbMTAgMCBSXQovVG9Vbmljb2RlIDExIDAgUj4+CmVuZG9iagp4cmVm +CjAgMTIKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDA0MDEg +MDAwMDAgbiAKMDAwMDAwMDEwMSAwMDAwMCBuIAowMDAwMDEwNDU5IDAwMDAwIG4gCjAwMDAwMDAx +MzggMDAwMDAgbiAKMDAwMDAwMDYwOSAwMDAwMCBuIAowMDAwMDAwNjY0IDAwMDAwIG4gCjAwMDAw +MDA3MTEgMDAwMDAgbiAKMDAwMDAwOTU4NSAwMDAwMCBuIAowMDAwMDA5ODE5IDAwMDAwIG4gCjAw +MDAwMTAxMTcgMDAwMDAgbiAKdHJhaWxlcgo8PC9TaXplIDEyCi9Sb290IDcgMCBSCi9JbmZvIDEg +MCBSPj4Kc3RhcnR4cmVmCjEwNTk4CiUlRU9GCg== + +----- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/ks_c_5601-1987_headers.eml b/plugins/vendor/webklex/php-imap/tests/messages/ks_c_5601-1987_headers.eml new file mode 100644 index 00000000..a8de3d08 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/ks_c_5601-1987_headers.eml @@ -0,0 +1,10 @@ +Subject: =?ks_c_5601-1987?B?UkU6IMi4v/i01LKyIEVyc2m01MDMILjevcPB9rimILq4s8K9wLTP?= + =?ks_c_5601-1987?B?tNku?= +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +Thread-Topic: =?ks_c_5601-1987?B?yLi/+LTUsrIgRXJzabTUwMwguN69w8H2uKYgurizwr3AtM+02S4=?= +From: =?ks_c_5601-1987?B?seggx/bB+A==?= +To: to@here.com + +Content diff --git a/plugins/vendor/webklex/php-imap/tests/messages/mail_that_is_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/mail_that_is_attachment.eml new file mode 100644 index 00000000..89215cf8 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/mail_that_is_attachment.eml @@ -0,0 +1,28 @@ +Sender: xxx@yyy.cz +MIME-Version: 1.0 +Message-ID: <2244696771454641389@google.com> +Date: Sun, 15 Feb 2015 10:21:51 +0000 +Subject: Report domain: yyy.cz Submitter: google.com Report-ID: 2244696771454641389 +From: noreply-dmarc-support via xxx +To: xxx@yyy.cz +Content-Type: application/zip; + name="google.com!yyy.cz!1423872000!1423958399.zip" +Content-Disposition: attachment; + filename="google.com!yyy.cz!1423872000!1423958399.zip" +Content-Transfer-Encoding: base64 +Reply-To: noreply-dmarc-support@google.com + +UEsDBAoAAAAIABRPT0bdJB+DSwIAALgKAAAuAAAAZ29vZ2xlLmNvbSFzdW5mb3guY3ohMTQyMzg3 +MjAwMCExNDIzOTU4Mzk5LnhtbO1WwY6bMBC971dEuQcDIQSQQ3rqF7RnZIwh7oJt2WY32a+viQ2h +u9moqnarqOop8Gbmjd/4OQbuj127eCJSUc52y8DzlwvCMK8oa3bL79++rpLlYp8/wJqQqkT4MX9Y +LKAkgktddESjCmk0YAblsikY6kjecN60xMO8g2ACbQ7pEG1zxg1De1pVHZJ4pXox0H2Zl9k8V3PU +EhWYM42wLiireX7QWmQAuErvUgkQKCkDiKlnIj1x2tunXRjF8SbxDfFbMtvFaaJVHoZRFKfxdhtE +myiOgnWSQnAJ23SjmxQSscYpM1BJGsryIArXyTb0fdPMImOcsOocTTfJOjWUw7slA7+yTd3mA4aC +txSfCtGXLVUHMi2Em1GxXPVGytHDL4bMIjaMqkfa5RIC++BAJeozNvxaSOSS/CBYQyAcoi6QGjGB +dR4MyoaH80qvrcrMEnM5LlDy52kEivcSk4KKPIz9bVYnpZ9Fvr/OsB9kWbgOTa8pZSzCvGemLQT2 +YYRdZ/KE2t6MrxoDw0yoElxRbTxtvMaImckMmeUNIxFIKZMwTceJr11gGtFM7aueZr9GjZBWhGla +U3OiprIDQRWRRS15N9+nOex43lRD1OtDIYnqW30hfLXY2xZw7h4YnCT3Mqma08GZ3g+gvhgMvFYy +JI82+R3HpL4XbDdesIm84SB/tE9Gr99wSm3+k646xQbu0Sl/uptW0Sfu5tXzH6b3dP7vd1f/+vl/ +KU83eRnpzbX6uY5JzMeJZ25PLwji920S/r8m/tVrAoLLR+hPUEsBAgoACgAAAAgAFE9PRt0kH4NL +AgAAuAoAAC4AAAAAAAAAAAAAAAAAAAAAAGdvb2dsZS5jb20hc3VuZm94LmN6ITE0MjM4NzIwMDAh +MTQyMzk1ODM5OS54bWxQSwUGAAAAAAEAAQBcAAAAlwIAAAAA \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/missing_date.eml b/plugins/vendor/webklex/php-imap/tests/messages/missing_date.eml new file mode 100644 index 00000000..5f8a6032 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/missing_date.eml @@ -0,0 +1,7 @@ +From: from@here.com +To: to@here.com +Subject: Nuu +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/missing_from.eml b/plugins/vendor/webklex/php-imap/tests/messages/missing_from.eml new file mode 100644 index 00000000..e09dd9d9 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/missing_from.eml @@ -0,0 +1,7 @@ +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/mixed_filename.eml b/plugins/vendor/webklex/php-imap/tests/messages/mixed_filename.eml new file mode 100644 index 00000000..4a353da3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/mixed_filename.eml @@ -0,0 +1,25 @@ +Date: Fri, 02 Feb 2018 22:23:06 +0300 +To: foo@bar.com +Subject: =?windows-1251?B?0eLl5ujpIO/w4OnxLevo8fI=?= +From: =?windows-1251?B?z/Dg6fH7IHx8IM/g8PLK7uw=?= +Content-Transfer-Encoding: quoted-printable +Content-Type: multipart/mixed; + boundary="=_743251f7a933f6b30c004fcb14eabb57" +Content-Disposition: inline + +This is a message in Mime Format. If you see this, your mail reader does not support this format. + +--=_743251f7a933f6b30c004fcb14eabb57 +Content-Type: text/html; charset=windows-1251 +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline + + +--=_743251f7a933f6b30c004fcb14eabb57 +Content-Type: application/octet-stream +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="Price4VladDaKar.xlsx" + +UEsDBBQAAgAIAHOyQkwNlxQhWwEAAAYFAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbK2UTU7D +CwALANECAAAT1E4AAAA= +--=_743251f7a933f6b30c004fcb14eabb57-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/multipart_without_body.eml b/plugins/vendor/webklex/php-imap/tests/messages/multipart_without_body.eml new file mode 100644 index 00000000..8f86799f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/multipart_without_body.eml @@ -0,0 +1,110 @@ +Received: from AS8PR02MB6805.eurprd02.prod.outlook.com (2603:10a6:20b:252::8) + by PA4PR02MB7071.eurprd02.prod.outlook.com with HTTPS; Sat, 11 Mar 2023 + 08:24:33 +0000 +Received: from omef0ahNgeoJu.eurprd02.prod.outlook.com (2603:10a6:10:33c::12) + by AS8PR02MB6805.eurprd02.prod.outlook.com (2603:10a6:20b:252::8) with + Microsoft SMTP Server (version=TLS1_2, + cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Sat, 11 Mar + 2023 08:24:31 +0000 +Received: from omef0ahNgeoJu.eurprd02.prod.outlook.com + ([fe80::38c0:9c40:7fc6:93a7]) by omef0ahNgeoJu.eurprd02.prod.outlook.com + ([fe80::38c0:9c40:7fc6:93a7%7]) with mapi id 15.20.6178.019; Sat, 11 Mar 2023 + 08:24:31 +0000 +From: =?iso-8859-1?Q?Foo_B=FClow_Bar?= +To: some one +Subject: This mail will not contain a body +Thread-Topic: This mail will not contain a body +Thread-Index: AdlT8uVmpHPvImbCRM6E9LODIvAcQA== +Date: Sat, 11 Mar 2023 08:24:31 +0000 +Message-ID: + +Accept-Language: da-DK, en-US +Content-Language: en-US +X-MS-Exchange-Organization-AuthAs: Internal +X-MS-Exchange-Organization-AuthMechanism: 04 +X-MS-Exchange-Organization-AuthSource: omef0ahNgeoJu.eurprd02.prod.outlook.com +X-MS-Has-Attach: +X-MS-Exchange-Organization-Network-Message-Id: + aa546a02-2b7a-4fb1-7fd4-08db220a09f1 +X-MS-Exchange-Organization-SCL: -1 +X-MS-TNEF-Correlator: +X-MS-Exchange-Organization-RecordReviewCfmType: 0 +x-ms-publictraffictype: Email +X-Microsoft-Antispam-Mailbox-Delivery: + ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(425001)(930097); +X-Microsoft-Antispam-Message-Info: + PeifKDwBVlQGeDu/c7oB3MKTffBwvlRIg5GJo1AiA4LroGAjwgwlg+oPfLetX9CgtbtKZy4gZnbjLCn3jJnod5ehn3Sv9gQaoH9PWkH/PIj6izaJzwlcEk81/MdprZFrORMwR7TGNqP/7ELAHw8rOH2Dmz9vGCE4cv0EwyYS3ShUhXABj4eJ17GNu1B4o53T2m9CzTgm647FRR5jpvk5xNIjQOwrhonVXMkCf2XKwF21sd/k4XLS/jX08tFJXBNyBALhsB4cG9gx2rxZYDn11SBejGFDw4eaqIQw6fYsmsyZvEoCnBkO+vK9lGIrQhRzGj7nJ41+uHVBcUYThce7P/ORpxl3GgThHyQpXQDV00JbP1aCBzm+4w8TyFiL0aOHXDhU9UKRHg3A01F+oH8IKAIaYazLCoOzbVcijSw0icNjBQsNLWa0FvfRT8y/rIvGkOB3rZpKf7ZR0g7cSlDAB3Ml2AaTbIB4ZL6QMukP/waDIObMZFmlVaAvmJzdTEdhGSLtUBFk4CNJhd6szcwaaPZxROumOGtz0sDke2iap8wRZqpdMWHVYi/trA+IESlF2G8TPzZiXs1lRDvYjNlam5r+1Ay1zlSmKTMnGbfNvsJgHkTlcgswKTlip4jGFPh6INTSDZtx9dQuDi4vbyNQiN1qVxoOPScTXzxUKVZ2PJ+8ipL2dqudLb3R2GSDHL10uQTuoIftA/Wjf67QZ629qQ== +Content-Type: multipart/alternative; + boundary="_000_omef0ahNgeoJuEB51C568ED2227A2DAABB5BB9omef0ahNgeoJueurp_" +MIME-Version: 1.0 + +--_000_omef0ahNgeoJuEB51C568ED2227A2DAABB5BB9omef0ahNgeoJueurp_ +Content-Type: text/plain; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +This mail will not contain a body + + + +--_000_omef0ahNgeoJuEB51C568ED2227A2DAABB5BB9omef0ahNgeoJueurp_ +Content-Type: text/html; charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + + + + + + +
+

This mail will not contain a bo= +dy

+

 

+
+ + + +--_000_omef0ahNgeoJuEB51C568ED2227A2DAABB5BB9omef0ahNgeoJueurp_-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/multiple_html_parts_and_attachments.eml b/plugins/vendor/webklex/php-imap/tests/messages/multiple_html_parts_and_attachments.eml new file mode 100644 index 00000000..5ccbd2c3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/multiple_html_parts_and_attachments.eml @@ -0,0 +1,203 @@ +Return-Path: +Delivered-To: to@there.com +Return-path: +Envelope-to: to@there.com +Delivery-date: Thu, 16 Feb 2023 09:19:23 +0000 +From: FromName +Content-Type: multipart/alternative; + boundary="Apple-Mail=_5382A451-FE2F-4504-9E3F-8FEB0B716E43" +Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) +Subject: multiple_html_parts_and_attachments +Date: Thu, 16 Feb 2023 10:19:02 +0100 +To: to@there.com + + + +--Apple-Mail=_5382A451-FE2F-4504-9E3F-8FEB0B716E43 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; + charset=utf-8 + +This is the first html part + +=EF=BF=BC + +This is the second html part + +=EF=BF=BC + +This is the last html part +https://www.there.com + + +--Apple-Mail=_5382A451-FE2F-4504-9E3F-8FEB0B716E43 +Content-Type: multipart/mixed; + boundary="Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE" + + +--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE +Content-Transfer-Encoding: 7bit +Content-Type: text/html; + charset=us-ascii + +This is the first html part

+--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE +Content-Disposition: inline; + filename=attachment1.pdf +Content-Type: application/pdf; + x-unix-mode=0666; + name="attachment1.pdf" +Content-Transfer-Encoding: base64 + +JVBERi0xLjMKJcTl8uXrp/Og0MTGCjMgMCBvYmoKPDwgL0ZpbHRlciAvRmxhdGVEZWNvZGUgL0xl +bmd0aCA5MyA+PgpzdHJlYW0KeAEdjDsOgCAQBXtP8U7AzwWW3sZOKmtDKExEhej9JWbamamIqFAd +G6ww3jowacEcGC1jxQm55Jby/bzbgbZ3W2v6CzPCkBJu9AxSQRBRGFKBnIvGdPVz/ABGZhatCmVu +ZHN0cmVhbQplbmRvYmoKMSAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDIgMCBSIC9SZXNv +dXJjZXMgNCAwIFIgL0NvbnRlbnRzIDMgMCBSIC9NZWRpYUJveCBbMCAwIDU5NS4yNzU2IDg0MS44 +ODk4XQo+PgplbmRvYmoKNCAwIG9iago8PCAvUHJvY1NldCBbIC9QREYgL0ltYWdlQiAvSW1hZ2VD +IC9JbWFnZUkgXSAvWE9iamVjdCA8PCAvSW0xIDUgMCBSID4+ID4+CmVuZG9iago1IDAgb2JqCjw8 +IC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggMTE0IC9IZWlnaHQgMjMgL0lu +dGVycG9sYXRlIHRydWUKL0NvbG9yU3BhY2UgNiAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvQml0 +c1BlckNvbXBvbmVudCA4IC9MZW5ndGggMTUzNCAvRmlsdGVyCi9GbGF0ZURlY29kZSA+PgpzdHJl +YW0KeAHtmAlTllUUxz9CZTVN+75rmkJmZqMpVgoCoogikArhgmyhKYoKCqK4gQQoCgIBKiiEGCIg +u4CoKU1Mi/uu7fUB7CdnunPnPmLvy4Bj08s888w592z3/J9zz7kvN286/voWgb9u9Hc8PUagu2/T +Y4cOQxBwoNoXZXBvonrj0uCfLg3ui3zvjk9bUD16/MP7xh3j2Vo0z9jVhTNvd3476rerA2XdYA1l +29nHvZoGzyq3Xb+PNG1M58p556CETV9W+6pt2ILqgpR4QXVsRL4yFCIwIRnRkWMf3ZY1lG1n7xFU +jey6239i9iJASMharBT+FVXq8Hmf2icmNT47pe7+8Uc7O0cqWwgjrsHqmnbR/wlUvz7psmJLzISF +O4DFXlSLK/0xmZe0Tip25bYlCp+AuNQXptUgHRW6i3WDFbWiioDgxA39Aw4MDS6dv27tnko/ZQ6x +r2bqB5H5T01u4MNNWrJN1bygWn7IZ+qyDEKMmFesV8KUmK3sp6Zpol9s2qt+B31XpFc1Tjrz4/CZ +8SkSKDot9o/rA1QgehSiIbP20VWCEze2HR2nRLgir6Y2N++lma9Mrxoxtzguc8mfXba3TUcZQmSV +zAZPgdReVAmHSd1hD0JDDJq5X3n2XJz1tHc9i06B+xanxhksahm7Q5DyAPvI+bsfnNAGXbh/pnjI +3DOXLfVzO/J+6K7nfGoR8T79w7tIQfUB13b0H3ZvHfBxhThZnxclhkgf6hI96nlYNsDK6/6VqKGM +QwjAEeWGFvcnJzewwtcZPmdvP9f2xyY2872UK2wf8WhByg4Jh+aa7M+QWtMRE+t7c2EYVvp3v3MH +OHPqHTapkITAvL7FXXk2jrzBukQUAE7rP7UBjJhTNphfPe9MS8E5JQdLn6HhI92Q9yksmYrmxbND +qZyc0k9gOWsSV6ToXz731vWLQ1hHyhdpaR+PQmX9ZFiOADS2lB9sckGEjNSSqukA6xRUprui2q9d +cGKFs4Oy28IckRrpyKL1bS+q63KjiLJqW7S4Wr5lGSwHWXk24hpsfvksVZmYkBHmHDpoRNAccOWq +45vRiJLzI1gBN8oY0ET6+7U3qKKXfKuFFSmTV9jVWbeGBadeWJBEgZYC29g6AdHAGV+JSN5jwgpZ +PH5iLCyanAi+nYjoG9StCmSkozvRaXtRdQ4qYwPTlmdEJcfzSDfg0P16ZZC4NeIaLDrNR1zpgaPD +drJVaUGCKucFz3qX1vdJshxJfQVzJqasIH1Rk6YUhOMqbVeo0n/Gu45Nwu4oDUYEwtSzevDMYkWd +Nwq4op0qQ4jX/A6qQNZ0dE1F24WqNFI2YH2YQeLTiKuz1AwAYksTYNzMWLU5NnMprKAauWk1tPUC +LG5J1rivGqjqUkFVdwWqTEBc0U+IAoz0IuM51OyJgjUQqNKHb5udLFrfdqEakpTElpJyFjBe1SM9 +QZDBvw6jwdIwMWeHp7oGEFKGLytiu/GLSOg5a9erTX7/3XvhGxNpoaxYk+0ZqsUHbl1gmDsqCgSB +aPW/dB03a6A+rdWfL78JIPQcfl/oWzrL/HJtZwTLuqCq5pHO5pYFkZHeORelrlSoMvKgGdnqd1n4 +hjWsgHYvosrtmt3SKhlqkgW/hflAdGlpy7agqrLTcdBp22s1ryyQHLlD6uZCj4/KRZS6Mwx2afoK +aK/o7Uwig2Uc0EjJiIvK9r2zgVf6KvO39rAHyh6LsrFl4G4pCvGP/Zz7AMdWCtuabM9qlSjysbg1 +cQqyS4K5XBGUGYGIxxpIr1UjOzGxvm1HVVJmUludpO+ez8ZcwgsR8R2ZsLByrg2WwmOsIOWhuZVW ++TL4oOXqQrXI+BMFrm1c5iUc84JLux76Zd9qaZUsGlJJKrN4rtLnlkVrFZb/0oSuXysheHPFjUlf +rqat4QoTfkeoQEY6yr9BUGB45nerWr/zfVWp3ZngoKkjhqbOcikCqxMdLsoDNNdgxZ4/Pay60etk +xxg01WKvE0TkLrq/dsq508Psda6nY6Ntr6BqY6z/j5oD1b741g5U7yaq3aHtWLcXgb8Bi7W2lwpl +bmRzdHJlYW0KZW5kb2JqCjcgMCBvYmoKPDwgL04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0xl +bmd0aCAzNDMgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBdZA7SwNBFIXPxsiCpkgh +Vim2sRBWiZsgdpKoiJBiiYqPbrKJiZDHsFkRG7HzD4iVYCdprWKhIP4CQVCxshC1FwI+wnomUTaF +3uHOfHPm3N3LBUIRIWU5DKBS9dzsfNpYXVs39BeEEIWOJEzh1GXKtjO04PdUHETrFpq63Yypb8VO +P7Kv+eP9+7Q5rYvGYuD7kwbyhbrDly+m5UjXA7Q42d72pOI98pDLpsgHiotdbijOdfm841nKztBz +TY46JZEnP5LNXI9e7OFKeUv9V4XqPlKoLqteh5kxzGIOGS4DNixOYQJT1PBPTbJTM4MaJHbgYhNF +lOCxOkVFoowCeQFVOBiHSbYQZybUrFnLCGYYaLUIMPnMx6tAE0/A2e7PSAxVCYzQEz0CLt6lcEVX +4661wvWNhNW5a4NNoP/Q999WAH0UaN/5/mfT99snQN8DcNn6BsE0ZMMKZW5kc3RyZWFtCmVuZG9i +ago2IDAgb2JqClsgL0lDQ0Jhc2VkIDcgMCBSIF0KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1Bh +Z2VzIC9NZWRpYUJveCBbMCAwIDU5NS4yNzU2IDg0MS44ODk4XSAvQ291bnQgMSAvS2lkcyBbIDEg +MCBSIF0KPj4KZW5kb2JqCjggMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cgL1BhZ2VzIDIgMCBSID4+ +CmVuZG9iago5IDAgb2JqCjw8IC9UaXRsZSAo/v9cMDAwU1wwMDBjXDAwMGhcMDAwZVwwMDByXDAw +MG1cMDAwrVwwMDBhXDAwMGZcMDAwYlwwMDBlXDAwMGVcMDAwbFwwMDBkXDAwMGlcMDAwblwwMDBn +XDAwMCBcMDAwMlwwMDAwXDAwMDJcMDAwM1wwMDAtXDAwMDBcMDAwMlwwMDAtXDAwMDFcMDAwNlww +MDAgXDAwMG9cMDAwbVwwMDAgXDAwMDFcMDAwMFwwMDAuXDAwMDFcMDAwMVwwMDAuXDAwMDBcMDAw +M1wwMDAuXDAwMHBcMDAwblwwMDBnKQovUHJvZHVjZXIgKG1hY09TIFZlcnNpZSAxMy4yIFwoYnVp +bGQgMjJENDlcKSBRdWFydHogUERGQ29udGV4dCkgL0NyZWF0b3IgKFZvb3J2ZXJ0b25pbmcpCi9D +cmVhdGlvbkRhdGUgKEQ6MjAyMzAyMTYwOTExNDdaMDAnMDAnKSAvTW9kRGF0ZSAoRDoyMDIzMDIx +NjA5MTE0N1owMCcwMCcpCj4+CmVuZG9iagp4cmVmCjAgMTAKMDAwMDAwMDAwMCA2NTUzNSBmIAow +MDAwMDAwMTg2IDAwMDAwIG4gCjAwMDAwMDI2MDIgMDAwMDAgbiAKMDAwMDAwMDAyMiAwMDAwMCBu +IAowMDAwMDAwMzAwIDAwMDAwIG4gCjAwMDAwMDAzODkgMDAwMDAgbiAKMDAwMDAwMjU2NyAwMDAw +MCBuIAowMDAwMDAyMTI1IDAwMDAwIG4gCjAwMDAwMDI2OTUgMDAwMDAgbiAKMDAwMDAwMjc0NCAw +MDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDEwIC9Sb290IDggMCBSIC9JbmZvIDkgMCBSIC9JRCBb +IDxlNzk0OWE2YzQ2MWM1MDYxNTk0ODU5YjkxZjczYzAzMz4KPGU3OTQ5YTZjNDYxYzUwNjE1OTQ4 +NTliOTFmNzNjMDMzPiBdID4+CnN0YXJ0eHJlZgozMTYxCiUlRU9GCg== +--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE +Content-Transfer-Encoding: 7bit +Content-Type: text/html; + charset=us-ascii + +

This is the second html part

+--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE +Content-Disposition: inline; + filename=attachment2.pdf +Content-Type: application/pdf; + x-unix-mode=0666; + name="attachment2.pdf" +Content-Transfer-Encoding: base64 + +JVBERi0xLjMKJcTl8uXrp/Og0MTGCjMgMCBvYmoKPDwgL0ZpbHRlciAvRmxhdGVEZWNvZGUgL0xl +bmd0aCA5MyA+PgpzdHJlYW0KeAEdjDsOgCAQBXtP8U4ALB9Zehs7qawNoTARFaL3l5hpZ6YiokJ1 +XHBCezeCLQnmwGgZK07IJbeU7+fdDrS926TpL4yCNl6Q8QyrnAjWhiEVyLkQpquf4wdGBBarCmVu +ZHN0cmVhbQplbmRvYmoKMSAwIG9iago8PCAvVHlwZSAvUGFnZSAvUGFyZW50IDIgMCBSIC9SZXNv +dXJjZXMgNCAwIFIgL0NvbnRlbnRzIDMgMCBSIC9NZWRpYUJveCBbMCAwIDU5NS4yNzU2IDg0MS44 +ODk4XQo+PgplbmRvYmoKNCAwIG9iago8PCAvUHJvY1NldCBbIC9QREYgL0ltYWdlQiAvSW1hZ2VD +IC9JbWFnZUkgXSAvWE9iamVjdCA8PCAvSW0xIDUgMCBSID4+ID4+CmVuZG9iago1IDAgb2JqCjw8 +IC9UeXBlIC9YT2JqZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggMTIxIC9IZWlnaHQgMzAgL0lu +dGVycG9sYXRlIHRydWUKL0NvbG9yU3BhY2UgNiAwIFIgL0ludGVudCAvUGVyY2VwdHVhbCAvQml0 +c1BlckNvbXBvbmVudCA4IC9MZW5ndGggMTczNSAvRmlsdGVyCi9GbGF0ZURlY29kZSA+PgpzdHJl +YW0KeAHtl4lT1kUYx/+Eymq677s0TTHzajSPPBFE8UA0T1RuxRMVUfEAEVECFQVREQ9UxiNFVFAU +FJAxGrDM+9bu+gPsI8+0s+27v3qFmnLm987OO8+9u9999nn2d++e+3MRcBFwEXARcBFwEXBE4Le7 +Td3RYAQcYbUpGjyL6wgCNkQdZS5ijUHAEVabojETNd737vWW311v2fg4/1UEG6KOMn2RVdU9Hul1 +mrFme6guh7568aO62s4/3WoucoM1jL1nnws43nL0Xu/t/yXLv93O+XMd0rZEjluUMjRu1ayMuZXV +PWQljrDaFPrip6xIEKi7R+fqcugxC1NRVZzuKXKDNYy9Z/8nUP/1dsjAt4IOsf0n+51kQDzue2rd +zvFs04aoo0zBQsa+Nrj4+QGlrwwqebR3VV1dJ6WCMBZjsLrlA9EPBdQ9J28C3qUbYoDo1lWflXmR +sE/7l106384RVptCIZNfOJwIoUlLJbfnr41VqhHz0l4fehht54ityA1WzLbvHxGyeFnTEQfahBSE +L03cURis3CH2HB7y6aTcFwce4zQHxK5Vt0Og3ntk8JA5q5iiY2j+wqwZynHQ7DWs5/Dx/sHx6e8E +Hwyam1FUOuDit+1HJayQiWamx/9yp5myp8ShajV6D0UpZHHKqapeSkUo9nX8VN/AWZlvDyvqODF/ +Xmbsr/W+1u0oR+AFVWIqCYTP2N2gsfNgsA1RR5mKwBpwLynzYz0QLUbtUyr/GVkvBR5F6DNmz4y0 +eQaL2aptYWgZnEWn8G3cL+i8faMkQuaOiVyTJn0rPonY+urgYlT8XzjXAS1QP9anEnsuZrPP9kuQ +5I0x4oj2iXrVM/5lsgAk7w0vxAxjAkKAmBgfK+/3wsBjSDiy9hN2NulT+Wz/ExyiCoXvU37laFmh +1IEl2dPQem5HXOS/trYzCRCbPlcJOSCQZyLyxxFWm0IiXDzfjpUreCEIdbS8n4pvVAyD7Ra9GcRO +/pFFYIs7CYb7rSutqUgEJzlhSZKxC5ejXbZxMizbF8trl9qwhZyCcbC+U9fLvKLF/sblD+9ca4Uc +LcdUXtkbg8KjA2G5LND4kqiwqZujmQLJrqJhoE366aG4F7ev+iABJYz7Ts0RrbEdETr9b9w9Bl/O +kWZqQ9RRJgEpRLgvWDtT2LjVc2CpA2o6YzEGm7t3tMphXNgm7txZaFTQ1AcVquarLqhSc6ORACYJ +D5Ki/fn2++Tbm0GHhBXtzSuthV2UNZ1QFA1hgRcDKhJs6UlfVM1HfiEq+e8amYew+kx3WCy5Oxyo +qCg7ZLiayNiOHkSneZdShVgwg3RC5QirTSGhWtcXH14yMakJDCkm3Nkfb7YQA2MxBovNiYo+1NUu +kVtYPythjwI1tRdar/wSUP5BgButS3CnNSvtG5p2xeYoQqVvjVD2LweWsEjY9QUhqICdzFeDyAj3 +lwRiwESUaOUI8W7wQTWR53Z0S6FpRlK7eI2QSyK0Ieoow0WKM6vyHMSXmMZidJbsAlV8qSGUtZEL +VsZnzoIVqCctXwTt+VCXsCBgvKsNqHWtQK2HAmpaLaEoR8wCtpQyYxw54Y+B50RATW237k6E6p+K +NCExmfjcOIo2jxClcoTVpsArLCmJOEk5U2juakhJEbiw0bE1WIow7iybd76sgdaPRHxTNk2CZqmi +4v+brz+OSllMWYb2RKBhUOcfuP98osGpWWQi2scP9RfTcyLvs3rayvkEbzt+l9QifQoboo6y7298 +AErUMYq8HoRHI22FB4DIBWrV+HR2w+6xrESvxtPT7q9NoKa3QvNgkG7FFFHLliDhCKA9EWgY1HwF +sFrKL91TdsEnP6HIQyn1nhN5Qq12p+PASRGEJ9DZs3/60BAbR1htCumnvHX1+EL3jtkAJnyQwvI1 +Ch0wc52UKZ3lrCnObJO3E99QYC61mu5fXOaHr9/0bHxp96u3hw2P/5zXCLderoAnAg2DmlnkBHnI +cV+yd4Xw3mNS+o7sxXMiHWp9O2Kv/uXO0hHYhTHoxTZEHWWCA+8EFVwRGdvCWW23qDwknDj9HVZy +1WBJUfoXWgYFs6AoiA4LLa8p8kr6rBjwkuRLRGahMRlfBzQdKb8YGFr5TMvMv9/6ZfDwo1wLzfMg +IjlRpuCfPJydEafauhEKFz6C1ETGdlR8iMScqSqmQTT4E0aP70RzT9UNxUZneacB4JmabsoXmue6 +Yq9caHuoNODLmq5YKuE/TjAjb+Z9xYMuX2j7oMH17Xjp65jBNoWXMV0zKwI2RB1l1giu0EsEHGG1 +KbyM6ZpZEbAh6spcBFwEXARcBB4aBH4HWDJl2AplbmRzdHJlYW0KZW5kb2JqCjcgMCBvYmoKPDwg +L04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VSR0IgL0xlbmd0aCAzNDMgL0ZpbHRlciAvRmxhdGVEZWNv +ZGUgPj4Kc3RyZWFtCngBdZA7SwNBFIXPxsiCpkghVim2sRBWiZsgdpKoiJBiiYqPbrKJiZDHsFkR +G7HzD4iVYCdprWKhIP4CQVCxshC1FwI+wnomUTaF3uHOfHPm3N3LBUIRIWU5DKBS9dzsfNpYXVs3 +9BeEEIWOJEzh1GXKtjO04PdUHETrFpq63Yypb8VOP7Kv+eP9+7Q5rYvGYuD7kwbyhbrDly+m5UjX +A7Q42d72pOI98pDLpsgHiotdbijOdfm841nKztBzTY46JZEnP5LNXI9e7OFKeUv9V4XqPlKoLqte +h5kxzGIOGS4DNixOYQJT1PBPTbJTM4MaJHbgYhNFlOCxOkVFoowCeQFVOBiHSbYQZybUrFnLCGYY +aLUIMPnMx6tAE0/A2e7PSAxVCYzQEz0CLt6lcEVX4661wvWNhNW5a4NNoP/Q999WAH0UaN/5/mfT +99snQN8DcNn6BsE0ZMMKZW5kc3RyZWFtCmVuZG9iago2IDAgb2JqClsgL0lDQ0Jhc2VkIDcgMCBS +IF0KZW5kb2JqCjIgMCBvYmoKPDwgL1R5cGUgL1BhZ2VzIC9NZWRpYUJveCBbMCAwIDU5NS4yNzU2 +IDg0MS44ODk4XSAvQ291bnQgMSAvS2lkcyBbIDEgMCBSIF0KPj4KZW5kb2JqCjggMCBvYmoKPDwg +L1R5cGUgL0NhdGFsb2cgL1BhZ2VzIDIgMCBSID4+CmVuZG9iago5IDAgb2JqCjw8IC9UaXRsZSAo +/v9cMDAwU1wwMDBjXDAwMGhcMDAwZVwwMDByXDAwMG1cMDAwrVwwMDBhXDAwMGZcMDAwYlwwMDBl +XDAwMGVcMDAwbFwwMDBkXDAwMGlcMDAwblwwMDBnXDAwMCBcMDAwMlwwMDAwXDAwMDJcMDAwM1ww +MDAtXDAwMDBcMDAwMlwwMDAtXDAwMDFcMDAwNlwwMDAgXDAwMG9cMDAwbVwwMDAgXDAwMDFcMDAw +MFwwMDAuXDAwMDFcMDAwMVwwMDAuXDAwMDFcMDAwMFwwMDAuXDAwMHBcMDAwblwwMDBnKQovUHJv +ZHVjZXIgKG1hY09TIFZlcnNpZSAxMy4yIFwoYnVpbGQgMjJENDlcKSBRdWFydHogUERGQ29udGV4 +dCkgL0NyZWF0b3IgKFZvb3J2ZXJ0b25pbmcpCi9DcmVhdGlvbkRhdGUgKEQ6MjAyMzAyMTYwOTEx +MzhaMDAnMDAnKSAvTW9kRGF0ZSAoRDoyMDIzMDIxNjA5MTEzOFowMCcwMCcpCj4+CmVuZG9iagp4 +cmVmCjAgMTAKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMTg2IDAwMDAwIG4gCjAwMDAwMDI4 +MDMgMDAwMDAgbiAKMDAwMDAwMDAyMiAwMDAwMCBuIAowMDAwMDAwMzAwIDAwMDAwIG4gCjAwMDAw +MDAzODkgMDAwMDAgbiAKMDAwMDAwMjc2OCAwMDAwMCBuIAowMDAwMDAyMzI2IDAwMDAwIG4gCjAw +MDAwMDI4OTYgMDAwMDAgbiAKMDAwMDAwMjk0NSAwMDAwMCBuIAp0cmFpbGVyCjw8IC9TaXplIDEw +IC9Sb290IDggMCBSIC9JbmZvIDkgMCBSIC9JRCBbIDxjOWI4YzBlZGQ5Mjk1Y2U3ZmQ2YzFkOWJj +ZTJhZTRiOD4KPGM5YjhjMGVkZDkyOTVjZTdmZDZjMWQ5YmNlMmFlNGI4PiBdID4+CnN0YXJ0eHJl +ZgozMzYyCiUlRU9GCg== +--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE +Content-Transfer-Encoding: 7bit +Content-Type: text/html; + charset=us-ascii + +

This is the last html part
https://www.there.com



+
+--Apple-Mail=_7C42F551-D023-4101-858E-D004D27871BE-- + +--Apple-Mail=_5382A451-FE2F-4504-9E3F-8FEB0B716E43-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/multiple_nested_attachments.eml b/plugins/vendor/webklex/php-imap/tests/messages/multiple_nested_attachments.eml new file mode 100644 index 00000000..ad48d47b --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/multiple_nested_attachments.eml @@ -0,0 +1,84 @@ +Date: Mon, 15 Jan 2018 10:54:09 +0100 +User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 + Thunderbird/52.5.0 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------85793CE1578A77318D5A90A6" +Content-Language: en-US + +This is a multi-part message in MIME format. +--------------85793CE1578A77318D5A90A6 +Content-Type: multipart/alternative; + boundary="------------32D598A7FC3F8A8E228998B0" + + +--------------32D598A7FC3F8A8E228998B0 +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Transfer-Encoding: 7bit + + +------------------------------------------------------------------------ + + + + +--------------32D598A7FC3F8A8E228998B0 +Content-Type: multipart/related; + boundary="------------261DC39B47CFCDB73BCE3C18" + + +--------------261DC39B47CFCDB73BCE3C18 +Content-Type: text/html; charset=utf-8 +Content-Transfer-Encoding: 8bit + + + + + + + +


+

+
+ + + Â +
+ + + + + + + +

+

+
+
+ + + +--------------261DC39B47CFCDB73BCE3C18 +Content-Type: image/png; + name="mleokdgdlgkkecep.png" +Content-Transfer-Encoding: base64 +Content-ID: +Content-Disposition: inline; + filename="mleokdgdlgkkecep.png" + +iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAACklE +QVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg== +--------------261DC39B47CFCDB73BCE3C18-- + +--------------32D598A7FC3F8A8E228998B0-- + +--------------85793CE1578A77318D5A90A6 +Content-Type: image/png; + name="FF4D00-1.png" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="FF4D00-1.png" + +iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAACklE +QVR4nGNiAAAABgADNjd8qAAAAABJRU5ErkJggg== +--------------85793CE1578A77318D5A90A6-- \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/nestes_embedded_with_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/nestes_embedded_with_attachment.eml new file mode 100644 index 00000000..44498103 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/nestes_embedded_with_attachment.eml @@ -0,0 +1,145 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_NextPart_000_000_000" + +This is a multi-part message in MIME format. + +------=_NextPart_000_000_000 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_111_000" + + +------=_NextPart_000_111_000 +Content-Type: text/plain; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +Dear Sarah + +------=_NextPart_000_111_000 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + + + +
Dear Sarah,
+ + +------=_NextPart_000_111_000-- + +------=_NextPart_000_000_000 +Content-Type: message/rfc822; + name="first.eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="first.eml" + +From: from@there.com +To: to@here.com +Subject: FIRST +Date: Sat, 28 Apr 2018 14:37:16 -0400 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="----=_NextPart_000_222_000" + +This is a multi-part message in MIME format. + +------=_NextPart_000_222_000 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_222_111" + + +------=_NextPart_000_222_111 +Content-Type: text/plain; + charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +Please respond directly to this email to update your RMA + + +2018-04-17T11:04:03-04:00 +------=_NextPart_000_222_111 +Content-Type: text/html; + charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + + + +
Please respond directly to this = +email to=20 +update your RMA
+ +------=_NextPart_000_222_111-- + +------=_NextPart_000_222_000 +Content-Type: image/png; + name="chrome.png" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="chrome.png" + +iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAB+FBMVEUAAAA/mUPidDHiLi5Cn0Xk +NTPmeUrkdUg/m0Q0pEfcpSbwaVdKskg+lUP4zA/iLi3msSHkOjVAmETdJSjtYFE/lkPnRj3sWUs8 +kkLeqCVIq0fxvhXqUkbVmSjwa1n1yBLepyX1xxP0xRXqUkboST9KukpHpUbuvRrzrhF/ljbwalju +ZFM4jELaoSdLtElJrUj1xxP6zwzfqSU4i0HYnydMtUlIqUfywxb60AxZqEXaoifgMCXptR9MtklH +pEY2iUHWnSjvvRr70QujkC+pUC/90glMuEnlOjVMt0j70QriLS1LtEnnRj3qUUXfIidOjsxAhcZF +o0bjNDH0xxNLr0dIrUdmntVTkMoyfL8jcLBRuErhJyrgKyb4zA/5zg3tYFBBmUTmQTnhMinruBzv +vhnxwxZ/st+Ktt5zp9hqota2vtK6y9FemNBblc9HiMiTtMbFtsM6gcPV2r6dwroseLrMrbQrdLGd +yKoobKbo3Zh+ynrgVllZulTsXE3rV0pIqUf42UVUo0JyjEHoS0HmsiHRGR/lmRz/1hjqnxjvpRWf +wtOhusaz0LRGf7FEfbDVmqHXlJeW0pbXq5bec3fX0nTnzmuJuWvhoFFhm0FtrziBsjaAaDCYWC+u +Si6jQS3FsSfLJiTirCOkuCG1KiG+wSC+GBvgyhTszQ64Z77KAAAARXRSTlMAIQRDLyUgCwsE6ebm +5ubg2dLR0byXl4FDQzU1NDEuLSUgC+vr6urq6ubb29vb2tra2tG8vLu7u7uXl5eXgYGBgYGBLiUA +LabIAAABsElEQVQoz12S9VPjQBxHt8VaOA6HE+AOzv1wd7pJk5I2adpCC7RUcHd3d3fXf5PvLkxh +eD++z+yb7GSRlwD/+Hj/APQCZWxM5M+goF+RMbHK594v+tPoiN1uHxkt+xzt9+R9wnRTZZQpXQ0T +5uP1IQxToyOAZiQu5HEpjeA4SWIoksRxNiGC1tRZJ4LNxgHgnU5nJZBDvuDdl8lzQRBsQ+s9PZt7 +s7Pz8wsL39/DkIfZ4xlB2Gqsq62ta9oxVlVrNZpihFRpGO9fzQw1ms0NDWZz07iGkJmIFH8xxkc3 +a/WWlubmFkv9AB2SEpDvKxbjidN2faseaNV3zoHXvv7wMODJdkOHAegweAfFPx4G67KluxzottCU +9n8CUqXzcIQdXOytAHqXxomvykhEKN9EFutG22p//0rbNvHVxiJywa8yS2KDfV1dfbu31H8jF1RH +iTKtWYeHxUvq3bn0pyjCRaiRU6aDO+gb3aEfEeVNsDgm8zzLy9egPa7Qt8TSJdwhjplk06HH43ZN +J3s91KKCHQ5x4sw1fRGYDZ0n1L4FKb9/BP5JLYxToheoFCVxz57PPS8UhhEpLBVeAAAAAElFTkSu +QmCC + +------=_NextPart_000_222_000-- + +------=_NextPart_000_000_000 +Content-Type: message/rfc822; + name="second.eml" +Content-Transfer-Encoding: 7bit +Content-Disposition: attachment; + filename="second.eml" + +From: from@there.com +To: to@here.com +Subject: SECOND +Date: Sat, 28 Apr 2018 13:37:30 -0400 +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_333_000" + +This is a multi-part message in MIME format. + +------=_NextPart_000_333_000 +Content-Type: text/plain; + charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +T whom it may concern: +------=_NextPart_000_333_000 +Content-Type: text/html; + charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + + + +
T whom it may concern:
+ + +------=_NextPart_000_333_000-- + +------=_NextPart_000_000_000-- + diff --git a/plugins/vendor/webklex/php-imap/tests/messages/null_content_charset.eml b/plugins/vendor/webklex/php-imap/tests/messages/null_content_charset.eml new file mode 100644 index 00000000..0f19eb44 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/null_content_charset.eml @@ -0,0 +1,8 @@ +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +From: from@there.com +To: to@here.com + +Hi! \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/pec.eml b/plugins/vendor/webklex/php-imap/tests/messages/pec.eml new file mode 100644 index 00000000..15dfacca --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/pec.eml @@ -0,0 +1,65 @@ +To: test@example.com +From: test@example.com +Subject: Certified +Date: Mon, 2 Oct 2017 12:13:43 +0200 +Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha1"; boundary="----258A05BDE519DE69AAE8D59024C32F5E" + +This is an S/MIME signed message + +------258A05BDE519DE69AAE8D59024C32F5E +Content-Type: multipart/mixed; boundary="----------=_1506939223-24530-42" +Content-Transfer-Encoding: binary + +------------=_1506939223-24530-42 +Content-Type: multipart/alternative; + boundary="----------=_1506939223-24530-43" +Content-Transfer-Encoding: binary + +------------=_1506939223-24530-43 +Content-Type: text/plain; charset="iso-8859-1" +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +Signed + +------------=_1506939223-24530-43 +Content-Type: text/html; charset="iso-8859-1" +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +Signed + +------------=_1506939223-24530-43-- + +------------=_1506939223-24530-42 +Content-Type: application/xml; name="data.xml" +Content-Disposition: inline; filename="data.xml" +Content-Transfer-Encoding: base64 + +PHhtbC8+ + +------------=_1506939223-24530-42 +Content-Type: message/rfc822; name="postacert.eml" +Content-Disposition: inline; filename="postacert.eml" +Content-Transfer-Encoding: 7bit + +To: test@example.com +From: test@example.com +Subject: test-subject +Date: Mon, 2 Oct 2017 12:13:50 +0200 +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +test-content + +------------=_1506939223-24530-42-- + +------258A05BDE519DE69AAE8D59024C32F5E +Content-Type: application/x-pkcs7-signature; name="smime.p7s" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; filename="smime.p7s" + +MQ== + +------258A05BDE519DE69AAE8D59024C32F5E-- + diff --git a/plugins/vendor/webklex/php-imap/tests/messages/plain.eml b/plugins/vendor/webklex/php-imap/tests/messages/plain.eml new file mode 100644 index 00000000..4d3d22b1 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/plain.eml @@ -0,0 +1,9 @@ +From: from@someone.com +To: to@someone-else.com +Subject: Example +Date: Mon, 21 Jan 2023 19:36:45 +0200 +Content-Type: text/plain; + charset=\"us-ascii\" +Content-Transfer-Encoding: quoted-printable + +Hi there! \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/plain_only.eml b/plugins/vendor/webklex/php-imap/tests/messages/plain_only.eml new file mode 100644 index 00000000..bbf9f3b3 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/plain_only.eml @@ -0,0 +1,9 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/plain_text_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/plain_text_attachment.eml new file mode 100644 index 00000000..6ec6a6c5 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/plain_text_attachment.eml @@ -0,0 +1,21 @@ +To: to@here.com +From: from@there.com +Subject: Plain text attachment +Date: Tue, 21 Aug 2018 09:05:14 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------B832AF745285AEEC6D5AEE42" + +This is a multi-part message in MIME format. +--------------B832AF745285AEEC6D5AEE42 +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +Test +--------------B832AF745285AEEC6D5AEE42 +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="a.txt" + +SGkh +--------------B832AF745285AEEC6D5AEE42-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/references.eml b/plugins/vendor/webklex/php-imap/tests/messages/references.eml new file mode 100644 index 00000000..478383cf --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/references.eml @@ -0,0 +1,11 @@ +Message-ID: <123@example.com> +From: no_host +Cc: "This one: is \"right\"" , No-address +In-Reply-To: +References: <231d9ac57aec7d8c1a0eacfeab8af6f3@example.com> <08F04024-A5B3-4FDE-BF2C-6710DE97D8D9@example.com> +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi +How are you? diff --git a/plugins/vendor/webklex/php-imap/tests/messages/simple_multipart.eml b/plugins/vendor/webklex/php-imap/tests/messages/simple_multipart.eml new file mode 100644 index 00000000..60a6521c --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/simple_multipart.eml @@ -0,0 +1,23 @@ +From: from@there.com +To: to@here.com +Date: Wed, 27 Sep 2017 12:48:51 +0200 +Subject: test +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0081_01D32C91.033E7020" + +This is a multipart message in MIME format. + +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: 7bit + +MyPlain +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/html; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +MyHtml +------=_NextPart_000_0081_01D32C91.033E7020-- + diff --git a/plugins/vendor/webklex/php-imap/tests/messages/structured_with_attachment.eml b/plugins/vendor/webklex/php-imap/tests/messages/structured_with_attachment.eml new file mode 100644 index 00000000..f795ec3a --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/structured_with_attachment.eml @@ -0,0 +1,24 @@ +From: from@there.com +To: to@here.com +Subject: Test +Date: Fri, 29 Sep 2017 10:55:23 +0200 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="------------5B1F217006A67C28E756A62E" + +This is a multi-part message in MIME format. +--------------5B1F217006A67C28E756A62E +Content-Type: text/plain; charset=iso-8859-15; format=flowed +Content-Transfer-Encoding: 7bit + +Test + +--------------5B1F217006A67C28E756A62E +Content-Type: text/plain; charset=UTF-8; + name="MyFile.txt" +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename="MyFile.txt" + +TXlGaWxlQ29udGVudA== +--------------5B1F217006A67C28E756A62E-- diff --git a/plugins/vendor/webklex/php-imap/tests/messages/thread_my_topic.eml b/plugins/vendor/webklex/php-imap/tests/messages/thread_my_topic.eml new file mode 100644 index 00000000..9a196351 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/thread_my_topic.eml @@ -0,0 +1,10 @@ +Message-ID: <123@example.com> +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/thread_re_my_topic.eml b/plugins/vendor/webklex/php-imap/tests/messages/thread_re_my_topic.eml new file mode 100644 index 00000000..db4fdf41 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/thread_re_my_topic.eml @@ -0,0 +1,11 @@ +Message-ID: <456@example.com> +In-Reply-To: <123@example.com> +From: from@there.com +To: to@here.com +Subject: Re: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/thread_unrelated.eml b/plugins/vendor/webklex/php-imap/tests/messages/thread_unrelated.eml new file mode 100644 index 00000000..e47faa81 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/thread_unrelated.eml @@ -0,0 +1,10 @@ +Message-ID: <999@example.com> +From: from@there.com +To: to@here.com +Subject: Wut +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; + charset="us-ascii" +Content-Transfer-Encoding: quoted-printable + +Hi diff --git a/plugins/vendor/webklex/php-imap/tests/messages/undefined_charset_header.eml b/plugins/vendor/webklex/php-imap/tests/messages/undefined_charset_header.eml new file mode 100644 index 00000000..117a33e4 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/undefined_charset_header.eml @@ -0,0 +1,20 @@ +X-Real-To: +X-Stored-In: BlaBla +Return-Path: +Received: from + by bla.bla (CommuniGate Pro RULE 6.1.13) + with RULE id 14057804; Mon, 27 Feb 2017 13:21:44 +0930 +X-Autogenerated: Mirror +Resent-From: +Resent-Date: Mon, 27 Feb 2017 13:21:44 +0930 +Message-Id: <201702270351.BGF77614@bla.bla> +From: =?X-IAS-German?B?bXlHb3Y=?= +To: sales@bla.bla +Subject: =?X-IAS-German?B?U3VibWl0IHlvdXIgdGF4IHJlZnVuZCB8IEF1c3RyYWxpYW4gVGF4YXRpb24gT2ZmaWNlLg==?= +Date: 27 Feb 2017 04:51:29 +0100 +MIME-Version: 1.0 +Content-Type: text/html; + charset="iso-8859-1" +Content-Transfer-Encoding: quoted-printable + +) \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients.eml b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients.eml new file mode 100644 index 00000000..5d33ecff --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients.eml @@ -0,0 +1,8 @@ +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +From: from@there.com +To: "Undisclosed Recipients" <> + +Hi! diff --git a/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_minus.eml b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_minus.eml new file mode 100644 index 00000000..73f7b83f --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_minus.eml @@ -0,0 +1,8 @@ +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +From: from@there.com +To: undisclosed-recipients:; + +Hi! diff --git a/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_space.eml b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_space.eml new file mode 100644 index 00000000..6c06cbd4 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/undisclosed_recipients_space.eml @@ -0,0 +1,8 @@ +Subject: test +MIME-Version: 1.0 +Content-Type: text/plain +Date: Wed, 27 Sep 2017 12:48:51 +0200 +From: from@there.com +To: Undisclosed recipients:; + +Hi! diff --git a/plugins/vendor/webklex/php-imap/tests/messages/unknown_encoding.eml b/plugins/vendor/webklex/php-imap/tests/messages/unknown_encoding.eml new file mode 100644 index 00000000..271bc4e2 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/unknown_encoding.eml @@ -0,0 +1,24 @@ +From: from@there.com +To: to@here.com +Date: Wed, 27 Sep 2017 12:48:51 +0200 +Subject: test +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0081_01D32C91.033E7020" + +This is a multipart message in MIME format. + +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/plain; + charset= +Content-Transfer-Encoding: foobar + +MyPlain + +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/html; + charset="" +Content-Transfer-Encoding: quoted-printable + +MyHtml +------=_NextPart_000_0081_01D32C91.033E7020-- + diff --git a/plugins/vendor/webklex/php-imap/tests/messages/without_charset_plain_only.eml b/plugins/vendor/webklex/php-imap/tests/messages/without_charset_plain_only.eml new file mode 100644 index 00000000..bd4fe5de --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/without_charset_plain_only.eml @@ -0,0 +1,8 @@ +From: from@there.com +To: to@here.com +Subject: Nuu +Date: Wed, 13 Sep 2017 13:05:45 +0200 +Content-Type: text/plain; charset= +Content-Transfer-Encoding: quoted-printable + +Hi \ No newline at end of file diff --git a/plugins/vendor/webklex/php-imap/tests/messages/without_charset_simple_multipart.eml b/plugins/vendor/webklex/php-imap/tests/messages/without_charset_simple_multipart.eml new file mode 100644 index 00000000..d1a092d2 --- /dev/null +++ b/plugins/vendor/webklex/php-imap/tests/messages/without_charset_simple_multipart.eml @@ -0,0 +1,23 @@ +From: from@there.com +To: to@here.com +Date: Wed, 27 Sep 2017 12:48:51 +0200 +Subject: test +Content-Type: multipart/alternative; + boundary="----=_NextPart_000_0081_01D32C91.033E7020" + +This is a multipart message in MIME format. + +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/plain; + charset= +Content-Transfer-Encoding: 7bit + +MyPlain +------=_NextPart_000_0081_01D32C91.033E7020 +Content-Type: text/html; + charset="" +Content-Transfer-Encoding: quoted-printable + +MyHtml +------=_NextPart_000_0081_01D32C91.033E7020-- +