Passed
Push — master ( 5573bb...437f03 )
by Sébastien
03:09
created

AccessLog   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 26
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A jsonSerialize() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Entity;
6
7
use Doctrine\ORM\Mapping as ORM;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="access_log")
12
 */
13
class AccessLog implements \JsonSerializable
14
{
15
    /**
16
     * @ORM\Id
17
     * @ORM\Column(name="id", type="integer")
18
     * @ORM\GeneratedValue(strategy="IDENTITY")
19
     *
20
     * @var int
21
     */
22
    private $id;
23
24
    /**
25
     * @ORM\Column(name="name", type="string", length=32)
26
     */
27
    private $name;
28
29
    public function __construct(string $name)
30
    {
31
        $this->name = $name;
32
    }
33
34
    public function jsonSerialize()
35
    {
36
        return [
37
            'id'   => $this->id,
38
            'name' => $this->name
39
        ];
40
    }
41
}
42