| Conditions | 3 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 3 | public function add(Notification $notification): void |
|
| 19 | { |
||
| 20 | 3 | $deduplicationKey = $notification->deduplicationKey(); |
|
| 21 | 3 | if (!is_null($deduplicationKey) && $this->hasNotificationOfDeduplicationKey($deduplicationKey)) { |
|
| 22 | 1 | throw new LogicException( |
|
| 23 | 1 | sprintf( |
|
| 24 | 1 | 'Notification of deduplication key (%s) already exists.', |
|
| 25 | 1 | $deduplicationKey |
|
| 26 | ) |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | 3 | $this->getEntityManager()->persist($notification); |
|
| 30 | 3 | } |
|
| 31 | |||
| 60 |