Total Complexity | 5 |
Total Lines | 31 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
5 | final class Type implements RelationshipType |
||
6 | { |
||
7 | /** @var string */ |
||
8 | private $type; |
||
9 | /** @var bool */ |
||
10 | private $isReadOperation; |
||
11 | |||
12 | public function __construct(string $type, bool $isReadOperation) |
||
13 | { |
||
14 | $this->type = $type; |
||
15 | $this->isReadOperation = $isReadOperation; |
||
16 | } |
||
17 | |||
18 | public static function get(string $type): self |
||
19 | { |
||
20 | return new self($type, true); |
||
21 | } |
||
22 | |||
23 | public static function post(string $type): self |
||
24 | { |
||
25 | return new self($type, false); |
||
26 | } |
||
27 | |||
28 | public function __toString(): string |
||
29 | { |
||
30 | return $this->type; |
||
31 | } |
||
32 | |||
33 | public function isReadOperation(): bool |
||
36 | } |
||
37 | } |
||
38 |