Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Coverage | 45.45% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | trait ContentIdTrait |
||
15 | { |
||
16 | /** |
||
17 | * Content id |
||
18 | * |
||
19 | * @var string|null |
||
20 | */ |
||
21 | private $contentId; |
||
22 | |||
23 | 9 | private function __construct(?string $contentId) |
|
24 | { |
||
25 | 9 | $this->contentId = $contentId; |
|
26 | 9 | } |
|
27 | |||
28 | public static function withContentId(string $contentId = null): self |
||
35 | } |
||
36 | |||
37 | 9 | public static function withoutContentId(): self |
|
38 | { |
||
39 | 9 | return new self(null); |
|
40 | } |
||
41 | |||
42 | public function contentId(): ?string |
||
45 | } |
||
46 | } |
||
47 |