-
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathAnalytic.php
More file actions
44 lines (40 loc) · 933 Bytes
/
Analytic.php
File metadata and controls
44 lines (40 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
declare(strict_types=1);
namespace Pan\ValueObjects;
/**
* @internal
*/
final readonly class Analytic
{
/**
* Returns all analytics.
*
* @return array<int, Analytic>
*/
public function __construct(
public int $id,
public string|int|null $tenant,
public string $name,
public int $impressions,
public int $hovers,
public int $clicks,
) {
//
}
/**
* Returns the analytic as an array.
*
* @return array{id: int, tenant: string|int|null, name: string, impressions: int, hovers: int, clicks: int}
*/
public function toArray(): array
{
return [
'id' => $this->id,
'tenant' => $this->tenant,
'name' => $this->name,
'impressions' => $this->impressions,
'hovers' => $this->hovers,
'clicks' => $this->clicks,
];
}
}