Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
CollectedMetric
100.00% covered (success)
100.00%
7 / 7
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 toArray
100.00% covered (success)
100.00%
6 / 6
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4/**
5 * SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 */
8
9namespace OCA\Libresign\Service\UsageStatistics\Model;
10
11final class CollectedMetric {
12    public function __construct(
13        public readonly string $category,
14        public readonly string $key,
15        public readonly string $type,
16        public readonly int|bool|string $value,
17    ) {
18    }
19
20    /** @return array{category: string, key: string, type: string, value: int|bool|string} */
21    public function toArray(): array {
22        return [
23            'category' => $this->category,
24            'key' => $this->key,
25            'type' => $this->type,
26            'value' => $this->value,
27        ];
28    }
29}