| Conditions | 3 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function run(): Exception |
||
| 19 | { |
||
| 20 | $message = $this->e->getMessage() . PHP_EOL . 'The SQL being executed was: ' . $this->rawSql; |
||
| 21 | $errorInfo = $this->e instanceof PDOException ? $this->e->errorInfo : null; |
||
| 22 | |||
| 23 | return match ( |
||
| 24 | str_contains($message, self::MSG_INTEGRITY_EXCEPTION_1) || |
||
| 25 | str_contains($message, self::MGS_INTEGRITY_EXCEPTION_2) |
||
| 26 | ) { |
||
| 27 | true => new IntegrityException($message, $errorInfo, $this->e), |
||
| 28 | default => new Exception($message, $errorInfo, $this->e), |
||
| 29 | }; |
||
| 32 |