Rétablir la compatibilité avec PHP 8.2
This commit is contained in:
parent
9a2b4068da
commit
63224d8b06
12 changed files with 16 additions and 16 deletions
|
|
@ -198,7 +198,7 @@ final class AgendaService
|
|||
? $end
|
||||
->modify(
|
||||
$start->getTimestamp() -
|
||||
new DateTimeImmutable($row['starts_at'])->getTimestamp() .
|
||||
(new DateTimeImmutable($row['starts_at']))->getTimestamp() .
|
||||
' seconds',
|
||||
)
|
||||
->format('Y-m-d H:i:s')
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ final class AssociationBrand
|
|||
throw new RuntimeException(t('service.logo.too_large'));
|
||||
}
|
||||
$tmp = (string) $upload['tmp_name'];
|
||||
$mime = new finfo(FILEINFO_MIME_TYPE)->file($tmp);
|
||||
$mime = (new finfo(FILEINFO_MIME_TYPE))->file($tmp);
|
||||
$extension = self::MIME_EXTENSIONS[$mime] ?? null;
|
||||
if (!$extension) {
|
||||
throw new RuntimeException(t('service.logo.format'));
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ final class BackupService
|
|||
if (!is_dir($backupDir) && !mkdir($backupDir, 0775, true) && !is_dir($backupDir)) {
|
||||
throw new RuntimeException(t('service.backup.directory_failed'));
|
||||
}
|
||||
$stamp = new DateTimeImmutable('now', new DateTimeZone('Europe/Paris'))->format('Ymd-His');
|
||||
$stamp = (new DateTimeImmutable('now', new DateTimeZone('Europe/Paris')))->format('Ymd-His');
|
||||
$suffix = $reason === 'pre-restore' ? '-avant-restauration' : '';
|
||||
$target = $backupDir . '/globinours-' . $stamp . $suffix . '.zip';
|
||||
// Certains volumes synchronisés acceptent les ZIP mais SQLite ne peut pas
|
||||
|
|
@ -50,7 +50,7 @@ final class BackupService
|
|||
$manifest = [
|
||||
'application' => 'Globinours',
|
||||
'format_version' => self::FORMAT_VERSION,
|
||||
'created_at' => new DateTimeImmutable('now', new DateTimeZone('Europe/Paris'))->format(
|
||||
'created_at' => (new DateTimeImmutable('now', new DateTimeZone('Europe/Paris')))->format(
|
||||
DateTimeInterface::ATOM,
|
||||
),
|
||||
'reason' => $reason,
|
||||
|
|
@ -434,7 +434,7 @@ final class BackupService
|
|||
|
||||
private static function describe(string $path): array
|
||||
{
|
||||
$modified = new DateTimeImmutable('@' . (filemtime($path) ?: time()))->setTimezone(
|
||||
$modified = (new DateTimeImmutable('@' . (filemtime($path) ?: time())))->setTimezone(
|
||||
new DateTimeZone('Europe/Paris'),
|
||||
);
|
||||
return ['name' => basename($path), 'size' => filesize($path) ?: 0, 'date' => $modified->format('d/m/Y H:i:s')];
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ final class PrivacyService
|
|||
'deposited_animals' =>
|
||||
'SELECT internal_code,name,intake_date,intake_type,intake_reason,intake_circumstances FROM animals WHERE depositor_contact_id=? ORDER BY intake_date',
|
||||
];
|
||||
$payload = ['generated_at' => new DateTimeImmutable()->format(DATE_ATOM), 'contact' => $contact];
|
||||
$payload = ['generated_at' => (new DateTimeImmutable())->format(DATE_ATOM), 'contact' => $contact];
|
||||
foreach ($queries as $key => $sql) {
|
||||
$q = $db->prepare($sql);
|
||||
$q->execute([$id]);
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ final class PrivateMediaService
|
|||
http_response_code(404);
|
||||
return;
|
||||
}
|
||||
$mime = new finfo(FILEINFO_MIME_TYPE)->file($path) ?: 'application/octet-stream';
|
||||
$mime = (new finfo(FILEINFO_MIME_TYPE))->file($path) ?: 'application/octet-stream';
|
||||
PrivacyService::logAccess(
|
||||
'private_' . $kind,
|
||||
$id,
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@ final class SystemHealthService
|
|||
return [
|
||||
'checks' => $checks,
|
||||
'summary' => $summary,
|
||||
'generated_at' => new DateTimeImmutable('now', new DateTimeZone('Europe/Paris'))->format('d/m/Y H:i:s'),
|
||||
'generated_at' => (new DateTimeImmutable('now', new DateTimeZone('Europe/Paris')))->format('d/m/Y H:i:s'),
|
||||
'php' => PHP_VERSION,
|
||||
'sqlite' => (string) $db->query('SELECT sqlite_version()')->fetchColumn(),
|
||||
];
|
||||
|
|
@ -181,7 +181,7 @@ final class SystemHealthService
|
|||
$lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ?: [];
|
||||
$dates = [];
|
||||
for ($i = 0; $i < $days; $i++) {
|
||||
$dates[] = new DateTimeImmutable("-$i days")->format('d-M-Y');
|
||||
$dates[] = (new DateTimeImmutable("-$i days"))->format('d-M-Y');
|
||||
}
|
||||
$count = 0;
|
||||
foreach (array_slice($lines, -1000) as $line) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue