AbstractEntity   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setId() 0 4 1
A getId() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Shlinkio\Shlink\Common\Entity;
6
7
abstract class AbstractEntity
8
{
9
    protected ?string $id = null;
10
11
    public function getId(): string
12
    {
13
        return $this->id;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->id could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
14
    }
15
16
    /**
17
     * @internal
18
     */
19
    public function setId(string $id): self
20
    {
21
        $this->id = $id;
22
        return $this;
23
    }
24
}
25