From caff1023ea72bb2ea94130e18a2a6e2ccf819e5f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 10 Apr 2020 14:19:56 +0200 Subject: Format control structures, classes, methods and function To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst --- .../lib/Migration/PopulateNewlyIntroducedDatabaseFields.php | 4 +--- apps/workflowengine/lib/Migration/Version2000Date20190808074233.php | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'apps/workflowengine/lib/Migration') diff --git a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php index 3c8d4ce81f8..6f344c2ee2d 100644 --- a/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php +++ b/apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php @@ -62,14 +62,13 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep { ->set('entity', $qb->createNamedParameter(File::class)) ->where($qb->expr()->emptyString('entity')) ->execute(); - } protected function populateScopeTable(Statement $ids): void { $qb = $this->dbc->getQueryBuilder(); $insertQuery = $qb->insert('flow_operations_scope'); - while($id = $ids->fetchColumn(0)) { + while ($id = $ids->fetchColumn(0)) { $insertQuery->values(['operation_id' => $qb->createNamedParameter($id), 'type' => IManager::SCOPE_ADMIN]); $insertQuery->execute(); } @@ -86,5 +85,4 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep { return $selectQuery->execute(); } - } diff --git a/apps/workflowengine/lib/Migration/Version2000Date20190808074233.php b/apps/workflowengine/lib/Migration/Version2000Date20190808074233.php index 787cd06bfa1..cfbd852d49f 100644 --- a/apps/workflowengine/lib/Migration/Version2000Date20190808074233.php +++ b/apps/workflowengine/lib/Migration/Version2000Date20190808074233.php @@ -112,14 +112,14 @@ class Version2000Date20190808074233 extends SimpleMigrationStep { } protected function ensureEntityColumns(Table $table) { - if(!$table->hasColumn('entity')) { + if (!$table->hasColumn('entity')) { $table->addColumn('entity', Type::STRING, [ 'notnull' => true, 'length' => 256, 'default' => '', ]); } - if(!$table->hasColumn('events')) { + if (!$table->hasColumn('events')) { $table->addColumn('events', Type::TEXT, [ 'notnull' => true, 'default' => '[]', -- cgit v1.2.3