Completed
Push — master ( 014eb2...0ec7e8 )
by Alejandro
14s queued 12s
created

ShortUrlVisited   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 66.67%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 18
ccs 4
cts 6
cp 0.6667
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 3 1
A __construct() 0 3 1
A visitId() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Shlinkio\Shlink\Core\EventDispatcher;
5
6
use JsonSerializable;
7
8
final class ShortUrlVisited implements JsonSerializable
9
{
10
    /** @var string */
11
    private $visitId;
12
13 10
    public function __construct(string $visitId)
14
    {
15 10
        $this->visitId = $visitId;
16
    }
17
18 8
    public function visitId(): string
19
    {
20 8
        return $this->visitId;
21
    }
22
23
    public function jsonSerialize(): array
24
    {
25
        return ['visitId' => $this->visitId];
26
    }
27
}
28