| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function find(Identity $identity): ?Identity |
||
| 27 | { |
||
| 28 | if ($this->isEmpty()) { |
||
| 29 | return null; |
||
| 30 | } |
||
| 31 | |||
| 32 | if (!$identity->isPersisted()) { |
||
| 33 | return null; |
||
| 34 | } |
||
| 35 | |||
| 36 | |||
| 37 | if ($identity instanceof NamedIdentity) { |
||
| 38 | return $this->findByName($identity->getName()); |
||
| 39 | } |
||
| 40 | |||
| 41 | return $this->findById($identity->getId()); |
||
| 42 | } |
||
| 71 |