mirror of
https://github.com/nextcloud/server.git
synced 2026-10-08 20:51:14 +02:00
38 lines
759 B
PHP
38 lines
759 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace OCA\DAV\CalDAV\Import;
|
|
|
|
use JsonSerializable;
|
|
|
|
final readonly class ImportCountEvent implements JsonSerializable {
|
|
public function __construct(
|
|
public int $vevent,
|
|
public int $vtodo,
|
|
public int $vjournal,
|
|
) {
|
|
}
|
|
|
|
public function total(): int {
|
|
return $this->vevent + $this->vtodo + $this->vjournal;
|
|
}
|
|
|
|
/**
|
|
* @return array{type: 'count', vevent: int, vtodo: int, vjournal: int}
|
|
*/
|
|
#[\Override]
|
|
public function jsonSerialize(): array {
|
|
return [
|
|
'type' => 'count',
|
|
'vevent' => $this->vevent,
|
|
'vtodo' => $this->vtodo,
|
|
'vjournal' => $this->vjournal,
|
|
];
|
|
}
|
|
}
|