Issues (7)

src/Entity/AbstractEntity.php (1 issue)

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