From 1be2531f82b20bf2df81e4a21d5d7b43b6c844f4 Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Sun, 24 May 2026 21:29:09 +0700 Subject: [PATCH] Fix PHP 7.4 compatibility: remove union return types Co-Authored-By: Claude Sonnet 4.6 --- scripts/send_email.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/send_email.php b/scripts/send_email.php index 3a769813..f32ad622 100755 --- a/scripts/send_email.php +++ b/scripts/send_email.php @@ -34,7 +34,7 @@ function log_msg(string $msg): void echo '[' . date('Y-m-d H:i:s') . '] ' . $msg . PHP_EOL; } -function download_pdf(string $url): string|false +function download_pdf(string $url) { $ch = curl_init($url); curl_setopt_array($ch, [ @@ -59,7 +59,7 @@ function download_pdf(string $url): string|false return $data; } -function encrypt_pdf(string $input_path, string $password): string|false +function encrypt_pdf(string $input_path, string $password) { $output_path = $input_path . '_enc.pdf'; $cmd = sprintf( @@ -126,7 +126,7 @@ function send_email( string $subject, string $body_html, array $attachments = [] -): ?string { +) { $socket = @fsockopen('tcp://' . $smtp['server'], SMTP_PORT, $errno, $errstr, 30); if (!$socket) { return "Connection to {$smtp['server']}:" . SMTP_PORT . " failed: $errstr ($errno)";