Skip to content

Commit 8a76418

Browse files
susnuxpringelmann
authored andcommitted
chore: apply code style
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 0150af1 commit 8a76418

8 files changed

Lines changed: 419 additions & 419 deletions

File tree

core/Command/Db/DbIndexUsage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
*/
99
namespace OC\Core\Command\Db;
1010

11+
use Doctrine\DBAL\Platforms\MySQLPlatform;
12+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1113
use OC\DB\Connection;
1214
use Symfony\Component\Console\Command\Command;
1315
use Symfony\Component\Console\Helper\Table;
1416
use Symfony\Component\Console\Input\InputInterface;
1517
use Symfony\Component\Console\Input\InputOption;
1618
use Symfony\Component\Console\Output\OutputInterface;
17-
use Doctrine\DBAL\Platforms\MySQLPlatform;
18-
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1919

2020
class DbIndexUsage extends Command {
2121

core/Command/Db/DbInfo.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
*/
99
namespace OC\Core\Command\Db;
1010

11+
use Doctrine\DBAL\Platforms\MySQLPlatform;
12+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
13+
use Doctrine\DBAL\Platforms\SqlitePlatform;
1114
use OC\DB\Connection;
1215
use Symfony\Component\Console\Command\Command;
1316
use Symfony\Component\Console\Helper\Table;
1417
use Symfony\Component\Console\Input\InputInterface;
1518
use Symfony\Component\Console\Input\InputOption;
1619
use Symfony\Component\Console\Output\OutputInterface;
17-
use Doctrine\DBAL\Platforms\MySQLPlatform;
18-
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
19-
use Doctrine\DBAL\Platforms\SqlitePlatform;
2020

2121
class DbInfo extends Command {
2222

@@ -37,7 +37,7 @@ protected function configure(): void {
3737
#[\Override]
3838
protected function execute(InputInterface $input, OutputInterface $output): int {
3939
$platform = $this->connection->getDatabasePlatform();
40-
$asJson = $input->getOption('json');
40+
$asJson = $input->getOption('json');
4141

4242
if ($platform instanceof MySQLPlatform) {
4343
$rows = $this->getMySQLInfo();
@@ -76,9 +76,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7676

7777
private function getMySQLInfo(): array {
7878
$result = $this->connection->executeQuery(
79-
"SELECT VERSION() AS version, @@innodb_buffer_pool_size AS buffer_pool,
79+
'SELECT VERSION() AS version, @@innodb_buffer_pool_size AS buffer_pool,
8080
@@max_connections AS max_conn, @@character_set_database AS charset,
81-
@@transaction_isolation AS tx_isolation"
81+
@@transaction_isolation AS tx_isolation'
8282
);
8383
$info = $result->fetchAssociative();
8484

@@ -114,7 +114,7 @@ private function getPostgreSQLInfo(): array {
114114

115115
private function getSQLiteInfo(): array {
116116
$result = $this->connection->executeQuery('SELECT sqlite_version() AS version');
117-
$info = $result->fetchAssociative();
117+
$info = $result->fetchAssociative();
118118
return [
119119
['setting' => 'Engine', 'value' => 'SQLite'],
120120
['setting' => 'Version', 'value' => $info['version']],

core/Command/Db/DbLocks.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
*/
99
namespace OC\Core\Command\Db;
1010

11+
use Doctrine\DBAL\Platforms\MySQLPlatform;
12+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1113
use OC\DB\Connection;
1214
use Symfony\Component\Console\Command\Command;
1315
use Symfony\Component\Console\Helper\Table;
1416
use Symfony\Component\Console\Input\InputInterface;
1517
use Symfony\Component\Console\Input\InputOption;
1618
use Symfony\Component\Console\Output\OutputInterface;
17-
use Doctrine\DBAL\Platforms\MySQLPlatform;
18-
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1919

2020
class DbLocks extends Command {
2121

@@ -39,19 +39,19 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3939
$asJson = $input->getOption('json');
4040

4141
if ($platform instanceof MySQLPlatform) {
42-
$sql = "SELECT r.trx_id AS waiting_trx_id,
42+
$sql = 'SELECT r.trx_id AS waiting_trx_id,
4343
r.trx_mysql_thread_id AS waiting_thread,
4444
r.trx_query AS waiting_query,
4545
b.trx_id AS blocking_trx_id,
4646
b.trx_mysql_thread_id AS blocking_thread,
4747
b.trx_query AS blocking_query
4848
FROM information_schema.innodb_lock_waits w
4949
JOIN information_schema.innodb_trx b ON b.trx_id = w.blocking_trx_id
50-
JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id";
50+
JOIN information_schema.innodb_trx r ON r.trx_id = w.requesting_trx_id';
5151
$headers = ['Waiting TRX', 'Waiting Thread', 'Waiting Query', 'Blocking TRX', 'Blocking Thread', 'Blocking Query'];
5252
$cols = ['waiting_trx_id', 'waiting_thread', 'waiting_query', 'blocking_trx_id', 'blocking_thread', 'blocking_query'];
5353
} elseif ($platform instanceof PostgreSQLPlatform) {
54-
$sql = "SELECT blocked_locks.pid AS blocked_pid,
54+
$sql = 'SELECT blocked_locks.pid AS blocked_pid,
5555
blocked_activity.usename AS blocked_user,
5656
blocking_locks.pid AS blocking_pid,
5757
blocking_activity.usename AS blocking_user,
@@ -65,9 +65,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6565
AND blocking_locks.relation IS NOT DISTINCT FROM blocked_locks.relation
6666
AND blocking_locks.pid != blocked_locks.pid
6767
JOIN pg_catalog.pg_stat_activity blocking_activity ON blocking_activity.pid = blocking_locks.pid
68-
WHERE NOT blocked_locks.granted";
68+
WHERE NOT blocked_locks.granted';
6969
$headers = ['Blocked PID', 'Blocked User', 'Blocking PID', 'Blocking User', 'Blocked Query', 'Duration'];
70-
$cols = ['blocked_pid', 'blocked_user', 'blocking_pid', 'blocking_user', 'blocked_query', 'blocked_duration'];
70+
$cols = ['blocked_pid', 'blocked_user', 'blocking_pid', 'blocking_user', 'blocked_query', 'blocked_duration'];
7171
} else {
7272
$output->writeln('<comment>db:locks is not supported for SQLite and Oracle (SQLite uses file-level locking).</comment>');
7373
return Command::SUCCESS;
@@ -92,7 +92,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9292
$table->setHeaders($headers);
9393

9494
foreach ($rows as $row) {
95-
$table->addRow(array_map(fn($col) => $row[$col] ?? '', $cols));
95+
$table->addRow(array_map(fn ($col) => $row[$col] ?? '', $cols));
9696
}
9797

9898
$table->render();

core/Command/Db/DbSize.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
*/
99
namespace OC\Core\Command\Db;
1010

11+
use Doctrine\DBAL\Platforms\MySQLPlatform;
12+
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1113
use OC\DB\Connection;
1214
use Symfony\Component\Console\Command\Command;
1315
use Symfony\Component\Console\Helper\Table;
1416
use Symfony\Component\Console\Input\InputInterface;
1517
use Symfony\Component\Console\Input\InputOption;
1618
use Symfony\Component\Console\Output\OutputInterface;
17-
use Doctrine\DBAL\Platforms\MySQLPlatform;
18-
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1919

2020
class DbSize extends Command {
2121

@@ -36,10 +36,10 @@ protected function configure(): void {
3636
#[\Override]
3737
protected function execute(InputInterface $input, OutputInterface $output): int {
3838
$platform = $this->connection->getDatabasePlatform();
39-
$asJson = $input->getOption('json');
39+
$asJson = $input->getOption('json');
4040

4141
if ($platform instanceof MySQLPlatform) {
42-
$sql = "
42+
$sql = '
4343
SELECT table_name AS `table`,
4444
ROUND((data_length + index_length) / 1024 / 1024, 2) AS total_mb,
4545
ROUND(data_length / 1024 / 1024, 2) AS data_mb,
@@ -49,9 +49,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4949
FROM information_schema.tables
5050
WHERE table_schema = DATABASE()
5151
ORDER BY (data_length + index_length) DESC
52-
";
52+
';
5353
$headers = ['Table', 'Total (MB)', 'Data (MB)', 'Index (MB)', 'Rows', 'Avg Row (bytes)'];
54-
$cols = ['table', 'total_mb', 'data_mb', 'index_mb', 'rows', 'avg_row_bytes'];
54+
$cols = ['table', 'total_mb', 'data_mb', 'index_mb', 'rows', 'avg_row_bytes'];
5555
} elseif ($platform instanceof PostgreSQLPlatform) {
5656
$sql = "
5757
SELECT relname AS table,
@@ -66,7 +66,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6666
ORDER BY pg_total_relation_size(c.oid) DESC
6767
";
6868
$headers = ['Table', 'Total (MB)', 'Data (MB)', 'Index (MB)', 'Rows (est.)', 'Avg Row (bytes)'];
69-
$cols = ['table', 'total_mb', 'data_mb', 'index_mb', 'rows', 'avg_row_bytes'];
69+
$cols = ['table', 'total_mb', 'data_mb', 'index_mb', 'rows', 'avg_row_bytes'];
7070
} else {
7171
$output->writeln('<comment>db:size is not supported for SQLite and Oracle.</comment>');
7272
return Command::SUCCESS;
@@ -83,7 +83,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8383
$table->setHeaders($headers);
8484

8585
foreach ($rows as $row) {
86-
$table->addRow(array_map(fn($col) => $row[$col], $cols));
86+
$table->addRow(array_map(fn ($col) => $row[$col], $cols));
8787
}
8888

8989
$table->render();

0 commit comments

Comments
 (0)