@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | public static function fromString(string $reference): self |
25 | 25 | { |
26 | 26 | if (false == strpos($reference, '@')) { |
27 | - throw new \InvalidArgumentException('Invalid reference composition. A model reference should consist of schema <class>@<id>. [' . $reference . '] was passed instead.'); |
|
27 | + throw new \InvalidArgumentException('Invalid reference composition. A model reference should consist of schema <class>@<id>. ['.$reference.'] was passed instead.'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | list($className, $id) = explode('@', $reference); |
31 | 31 | |
32 | - if("" === $id) { |
|
33 | - throw new \InvalidArgumentException('Missing id on model reference. [' . $reference . '] was passed.'); |
|
32 | + if ("" === $id) { |
|
33 | + throw new \InvalidArgumentException('Missing id on model reference. ['.$reference.'] was passed.'); |
|
34 | 34 | } |
35 | 35 | |
36 | - return new static($className, (int) $id); |
|
36 | + return new static($className, (int)$id); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $className = $this->className(); |
47 | 47 | |
48 | - if($this->id == 0) { |
|
48 | + if ($this->id == 0) { |
|
49 | 49 | return new $className($attributes); |
50 | 50 | } |
51 | 51 | |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function get(): string |
69 | 69 | { |
70 | - return $this->className . '@' . $this->id; |
|
70 | + return $this->className.'@'.$this->id; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | public function equals($other): bool |