@@ -64,7 +64,7 @@ |
||
| 64 | 64 | $key = $this->queryBuilder->quoter()->quoteColumnName(reset($pk)); |
| 65 | 65 | $value = "(SELECT COALESCE(MAX($key),0) FROM $tableName)+1"; |
| 66 | 66 | } else { |
| 67 | - $value = (int)$value; |
|
| 67 | + $value = (int) $value; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return "DBCC CHECKIDENT ('$tableName', RESEED, $value)"; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | if ($this->pdo !== null) { |
| 117 | - $this->logger?->log( |
|
| 117 | + $this->logger ? ->log( |
|
| 118 | 118 | LogLevel::DEBUG, |
| 119 | 119 | 'Closing DB connection: ' . $this->driver->getDsn() . ' ' . __METHOD__, |
| 120 | 120 | ); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | if ($this->serverVersion === '') { |
| 184 | 184 | /** @var mixed */ |
| 185 | - $version = $this->getSlavePDO()?->getAttribute(PDO::ATTR_SERVER_VERSION); |
|
| 185 | + $version = $this->getSlavePDO() ? ->getAttribute(PDO::ATTR_SERVER_VERSION); |
|
| 186 | 186 | $this->serverVersion = is_string($version) ? $version : 'Version could not be determined.'; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -240,13 +240,13 @@ discard block |
||
| 240 | 240 | $token = 'Opening DB connection: ' . $this->driver->getDsn(); |
| 241 | 241 | |
| 242 | 242 | try { |
| 243 | - $this->logger?->log(LogLevel::INFO, $token); |
|
| 244 | - $this->profiler?->begin($token, [__METHOD__]); |
|
| 243 | + $this->logger ? ->log(LogLevel::INFO, $token); |
|
| 244 | + $this->profiler ? ->begin($token, [__METHOD__]); |
|
| 245 | 245 | $this->initConnection(); |
| 246 | - $this->profiler?->end($token, [__METHOD__]); |
|
| 246 | + $this->profiler ? ->end($token, [__METHOD__]); |
|
| 247 | 247 | } catch (PDOException $e) { |
| 248 | - $this->profiler?->end($token, [__METHOD__]); |
|
| 249 | - $this->logger?->log(LogLevel::ERROR, $token); |
|
| 248 | + $this->profiler ? ->end($token, [__METHOD__]); |
|
| 249 | + $this->logger ? ->log(LogLevel::ERROR, $token); |
|
| 250 | 250 | |
| 251 | 251 | throw new Exception($e->getMessage(), (array) $e->errorInfo, $e); |
| 252 | 252 | } |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $this->db->getSchema()->setTransactionIsolationLevel($isolationLevel); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $this->logger?->log( |
|
| 63 | + $this->logger ? ->log( |
|
| 64 | 64 | LogLevel::DEBUG, |
| 65 | 65 | 'Begin transaction' . ($isolationLevel ? ' with isolation level ' . $isolationLevel : '') |
| 66 | 66 | . ' ' . __METHOD__ |
| 67 | 67 | ); |
| 68 | 68 | |
| 69 | - $this->db->getPDO()?->beginTransaction(); |
|
| 69 | + $this->db->getPDO() ? ->beginTransaction(); |
|
| 70 | 70 | $this->level = 1; |
| 71 | 71 | |
| 72 | 72 | return; |
@@ -75,10 +75,10 @@ discard block |
||
| 75 | 75 | $schema = $this->db->getSchema(); |
| 76 | 76 | |
| 77 | 77 | if ($schema->supportsSavepoint()) { |
| 78 | - $this->logger?->log(LogLevel::DEBUG, 'Set savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 78 | + $this->logger ? ->log(LogLevel::DEBUG, 'Set savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 79 | 79 | $schema->createSavepoint('LEVEL' . $this->level); |
| 80 | 80 | } else { |
| 81 | - $this->logger?->log( |
|
| 81 | + $this->logger ? ->log( |
|
| 82 | 82 | LogLevel::DEBUG, |
| 83 | 83 | 'Transaction not started: nested transaction not supported ' . __METHOD__ |
| 84 | 84 | ); |
@@ -102,18 +102,18 @@ discard block |
||
| 102 | 102 | $this->level--; |
| 103 | 103 | |
| 104 | 104 | if ($this->level === 0) { |
| 105 | - $this->logger?->log(LogLevel::DEBUG, 'Commit transaction ' . __METHOD__); |
|
| 106 | - $this->db->getPDO()?->commit(); |
|
| 105 | + $this->logger ? ->log(LogLevel::DEBUG, 'Commit transaction ' . __METHOD__); |
|
| 106 | + $this->db->getPDO() ? ->commit(); |
|
| 107 | 107 | return; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $schema = $this->db->getSchema(); |
| 111 | 111 | |
| 112 | 112 | if ($schema->supportsSavepoint()) { |
| 113 | - $this->logger?->log(LogLevel::DEBUG, 'Release savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 113 | + $this->logger ? ->log(LogLevel::DEBUG, 'Release savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 114 | 114 | $schema->releaseSavepoint('LEVEL' . $this->level); |
| 115 | 115 | } else { |
| 116 | - $this->logger?->log( |
|
| 116 | + $this->logger ? ->log( |
|
| 117 | 117 | LogLevel::INFO, |
| 118 | 118 | 'Transaction not committed: nested transaction not supported ' . __METHOD__ |
| 119 | 119 | ); |
@@ -145,17 +145,17 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | $this->level--; |
| 147 | 147 | if ($this->level === 0) { |
| 148 | - $this->logger?->log(LogLevel::INFO, 'Roll back transaction ' . __METHOD__); |
|
| 149 | - $this->db->getPDO()?->rollBack(); |
|
| 148 | + $this->logger ? ->log(LogLevel::INFO, 'Roll back transaction ' . __METHOD__); |
|
| 149 | + $this->db->getPDO() ? ->rollBack(); |
|
| 150 | 150 | return; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $schema = $this->db->getSchema(); |
| 154 | 154 | if ($schema->supportsSavepoint()) { |
| 155 | - $this->logger?->log(LogLevel::DEBUG, 'Roll back to savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 155 | + $this->logger ? ->log(LogLevel::DEBUG, 'Roll back to savepoint ' . $this->level . ' ' . __METHOD__); |
|
| 156 | 156 | $schema->rollBackSavepoint('LEVEL' . $this->level); |
| 157 | 157 | } else { |
| 158 | - $this->logger?->log( |
|
| 158 | + $this->logger ? ->log( |
|
| 159 | 159 | LogLevel::INFO, |
| 160 | 160 | 'Transaction not rolled back: nested transaction not supported ' . __METHOD__ |
| 161 | 161 | ); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | throw new Exception('Failed to set isolation level: transaction was inactive.'); |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | - $this->logger?->log( |
|
| 171 | + $this->logger ? ->log( |
|
| 172 | 172 | LogLevel::DEBUG, |
| 173 | 173 | 'Setting transaction isolation level to ' . $this->level . ' ' . __METHOD__ |
| 174 | 174 | ); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | try { |
| 48 | - $this->pdoStatement = $pdo?->prepare($sql); |
|
| 48 | + $this->pdoStatement = $pdo ? ->prepare($sql); |
|
| 49 | 49 | $this->bindPendingParams(); |
| 50 | 50 | } catch (PDOException $e) { |
| 51 | 51 | $message = $e->getMessage() . "\nFailed to prepare SQL: $sql"; |
@@ -79,11 +79,11 @@ discard block |
||
| 79 | 79 | && $this->db->getTransaction() === null |
| 80 | 80 | ) { |
| 81 | 81 | $this->db->transaction( |
| 82 | - fn (string $rawSql) => $this->internalExecute($rawSql), |
|
| 82 | + fn(string $rawSql) => $this->internalExecute($rawSql), |
|
| 83 | 83 | $this->isolationLevel |
| 84 | 84 | ); |
| 85 | 85 | } else { |
| 86 | - $this->pdoStatement?->execute(); |
|
| 86 | + $this->pdoStatement ? ->execute(); |
|
| 87 | 87 | } |
| 88 | 88 | break; |
| 89 | 89 | } catch (PDOException $e) { |
@@ -1083,6 +1083,4 @@ |
||
| 1083 | 1083 | $viewNames[$schema] = $this->findViewNames($schema); |
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | - return $this->viewNames[$schema] = $viewNames; |
|
| 1087 | - } |
|
| 1088 | -} |
|
| 1086 | + return $this->viewNames[$schema] = $viewNames |
|
| 1089 | 1087 | \ No newline at end of file |