Fix PHP 7.4 compatibility: remove union return types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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)";
|
||||
|
||||
Reference in New Issue
Block a user