diff --git a/src/Dibi/Bridges/Tracy/Panel.php b/src/Dibi/Bridges/Tracy/Panel.php index 1b1f88eb..a0b2e2ff 100644 --- a/src/Dibi/Bridges/Tracy/Panel.php +++ b/src/Dibi/Bridges/Tracy/Panel.php @@ -89,8 +89,8 @@ class Panel implements Tracy\IBarPanel $totalTime += $event->time; } return '' - . $count . ' queries' - . ($totalTime ? ' / ' . number_format($totalTime * 1000, 1, '.', ' ') . ' ms' : '') + . $count . "\u{a0}queries" + . ($totalTime ? ' / ' . number_format($totalTime * 1000, 1, '.', "\u{202f}") . "\u{202f}ms" : '') . ''; } @@ -131,7 +131,7 @@ class Panel implements Tracy\IBarPanel [$connection->onEvent, \dibi::$numOfQueries, \dibi::$totalTime] = $backup; } - $s .= '' . number_format($event->time * 1000, 3, '.', ' '); + $s .= '' . number_format($event->time * 1000, 3, '.', "\u{202f}"); if ($explain) { static $counter; $counter++; @@ -155,8 +155,8 @@ class Panel implements Tracy\IBarPanel return ' -

Queries: ' . count($this->events) - . ($totalTime === null ? '' : ', time: ' . number_format($totalTime * 1000, 1, '.', ' ') . ' ms') . ', ' +

Queries:\u{a0}' . count($this->events) + . ($totalTime === null ? '' : ", time:\u{a0}" . number_format($totalTime * 1000, 1, '.', "\u{202f}") . "\u{202f}ms") . ', ' . htmlspecialchars($this->getConnectionName($singleConnection)) . '

@@ -172,6 +172,6 @@ class Panel implements Tracy\IBarPanel $driver = $connection->getConfig('driver'); return (is_object($driver) ? get_class($driver) : $driver) . ($connection->getConfig('name') ? '/' . $connection->getConfig('name') : '') - . ($connection->getConfig('host') ? ' @ ' . $connection->getConfig('host') : ''); + . ($connection->getConfig('host') ? "\u{202f}@\u{202f}" . $connection->getConfig('host') : ''); } } diff --git a/src/Dibi/Drivers/SqliteDriver.php b/src/Dibi/Drivers/SqliteDriver.php index fe0b216f..cdeb9fa7 100644 --- a/src/Dibi/Drivers/SqliteDriver.php +++ b/src/Dibi/Drivers/SqliteDriver.php @@ -57,7 +57,7 @@ class SqliteDriver implements Dibi\Driver } else { try { $this->connection = new SQLite3($config['database']); - } catch (\Exception $e) { + } catch (\Throwable $e) { throw new Dibi\DriverException($e->getMessage(), $e->getCode()); } } diff --git a/src/Dibi/dibi.php b/src/Dibi/dibi.php index cf003188..1753d4fd 100644 --- a/src/Dibi/dibi.php +++ b/src/Dibi/dibi.php @@ -163,7 +163,7 @@ class dibi /** * Strips microseconds part. */ - public static function stripMicroseconds(\DateTimeInterface $dt): \DateTimeInterface + public static function stripMicroseconds(DateTimeInterface $dt): DateTimeInterface { $class = get_class($dt); return new $class($dt->format('Y-m-d H:i:s'), $dt->getTimezone()); diff --git a/tests/dibi/Connection.substitutions.phpt b/tests/dibi/Connection.substitutions.phpt index d2155082..2c1a98f2 100644 --- a/tests/dibi/Connection.substitutions.phpt +++ b/tests/dibi/Connection.substitutions.phpt @@ -1,4 +1,5 @@ query('SELECT COUNT(*) FROM [products]')->fetchSingle()); }); @@ -89,7 +89,7 @@ test('nested transaction() call fail', function () use ($conn) { throw new Exception('my exception'); }); }); - }, \Throwable::class, 'my exception'); + }, Throwable::class, 'my exception'); Assert::same(5, (int) $conn->query('SELECT COUNT(*) FROM [products]')->fetchSingle()); }); @@ -115,17 +115,17 @@ test('begin(), commit() & rollback() calls are forbidden in transaction()', func $conn->transaction(function (Dibi\Connection $connection) { $connection->begin(); }); - }, \LogicException::class, Dibi\Connection::class . '::begin() call is forbidden inside a transaction() callback'); + }, LogicException::class, Dibi\Connection::class . '::begin() call is forbidden inside a transaction() callback'); Assert::exception(function () use ($conn) { $conn->transaction(function (Dibi\Connection $connection) { $connection->commit(); }); - }, \LogicException::class, Dibi\Connection::class . '::commit() call is forbidden inside a transaction() callback'); + }, LogicException::class, Dibi\Connection::class . '::commit() call is forbidden inside a transaction() callback'); Assert::exception(function () use ($conn) { $conn->transaction(function (Dibi\Connection $connection) { $connection->rollback(); }); - }, \LogicException::class, Dibi\Connection::class . '::rollback() call is forbidden inside a transaction() callback'); + }, LogicException::class, Dibi\Connection::class . '::rollback() call is forbidden inside a transaction() callback'); }); diff --git a/tests/dibi/DataSource.phpt b/tests/dibi/DataSource.phpt index 12ac9245..c7190718 100644 --- a/tests/dibi/DataSource.phpt +++ b/tests/dibi/DataSource.phpt @@ -1,4 +1,5 @@