Skip to content

Commit edd8d9e

Browse files
committed
coding style
1 parent 2ab51be commit edd8d9e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Bridges/DatabaseTracy/ConnectionPanel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ public function logQuery(Nette\Database\Connection $connection, $result): void
6060
$trace = $result instanceof \PDOException ? $result->getTrace() : debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
6161
foreach ($trace as $row) {
6262
if (isset($row['file']) && is_file($row['file']) && !Tracy\Debugger::getBluescreen()->isCollapsed($row['file'])) {
63-
if ((strpos($row['function'] ?? '', 'call_user_func') === 0)
63+
if (
64+
(strpos($row['function'] ?? '', 'call_user_func') === 0)
6465
|| (is_subclass_of($row['class'] ?? '', '\\Nette\\Database\\Connection'))
6566
) {
6667
continue;

src/Database/Drivers/SqliteDriver.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,21 @@ public function convertException(\PDOException $e): Nette\Database\DriverExcepti
4040
if ($code !== 19) {
4141
return Nette\Database\DriverException::from($e);
4242

43-
} elseif (strpos($msg, 'must be unique') !== false
43+
} elseif (
44+
strpos($msg, 'must be unique') !== false
4445
|| strpos($msg, 'is not unique') !== false
4546
|| strpos($msg, 'UNIQUE constraint failed') !== false
4647
) {
4748
return Nette\Database\UniqueConstraintViolationException::from($e);
4849

49-
} elseif (strpos($msg, 'may not be null') !== false
50+
} elseif (
51+
strpos($msg, 'may not be null') !== false
5052
|| strpos($msg, 'NOT NULL constraint failed') !== false
5153
) {
5254
return Nette\Database\NotNullConstraintViolationException::from($e);
5355

54-
} elseif (strpos($msg, 'foreign key constraint failed') !== false
56+
} elseif (
57+
strpos($msg, 'foreign key constraint failed') !== false
5558
|| strpos($msg, 'FOREIGN KEY constraint failed') !== false
5659
) {
5760
return Nette\Database\ForeignKeyConstraintViolationException::from($e);

0 commit comments

Comments
 (0)