| Total Complexity | 8 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Coverage | 87.5% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class FlatReference |
||
| 10 | { |
||
| 11 | /** @var string */ |
||
| 12 | protected $className; |
||
| 13 | |||
| 14 | protected $id; |
||
| 15 | |||
| 16 | 37 | public function __construct(string $className, $id) |
|
| 17 | { |
||
| 18 | 37 | $this->className = $className; |
|
| 19 | 37 | $this->id = $id; |
|
| 20 | 37 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Recreate the model instance that is referred to by this collection id |
||
| 24 | * @return Model |
||
| 25 | */ |
||
| 26 | 23 | public function instance(): Model |
|
| 29 | } |
||
| 30 | |||
| 31 | 3 | public function id() |
|
| 32 | { |
||
| 33 | 3 | return $this->id; |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | public function className(): string |
|
| 37 | { |
||
| 38 | 3 | return $this->className; |
|
| 39 | } |
||
| 40 | |||
| 41 | 33 | public function get(): string |
|
| 42 | { |
||
| 43 | 33 | return $this->className.'@'.$this->id; |
|
| 44 | } |
||
| 45 | |||
| 46 | 1 | public function equals($other): bool |
|
| 49 | } |
||
| 50 | |||
| 51 | public function __toString() |
||
| 54 | } |
||
| 55 | } |
||
| 56 |