Skip to content

Commit

Permalink
style(php): Run composer run cs:fix
Browse files Browse the repository at this point in the history
Signed-off-by: Baptiste Fotia <[email protected]>
  • Loading branch information
zak39 committed Jul 10, 2024
1 parent 3425eaa commit a9c70be
Showing 1 changed file with 30 additions and 36 deletions.
66 changes: 30 additions & 36 deletions lib/Migration/ReRunChangeGroupnamesForPgSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,38 @@

namespace OCA\Workspace\Migration;

use OCP\IConfig;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
use OCA\Workspace\Upgrade\Upgrade;
use OCA\Workspace\Upgrade\UpgradeV300;
use OCP\AppFramework\Services\IAppConfig;
use OCP\IConfig;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;

class ReRunChangeGroupnamesForPgSql implements IRepairStep {
public function __construct(
private IConfig $config,
private IAppConfig $appConfig,
private UpgradeV300 $upgrade,
) {
}

public function getName(): string {
return 'Rerun the change groupnames repair step for a Nextcloud instance using PostgreSQL.';
}

public function run(IOutput $output): void {
$sgbdName = $this->config->getSystemValue('dbtype');

if ($sgbdName !== 'pgsql') {
return;
}

$statusMigration = boolval($this->appConfig->getAppValue(Upgrade::CONTROL_MIGRATION_V3, '1'));

if ($statusMigration === true) {
return;
}

class ReRunChangeGroupnamesForPgSql implements IRepairStep
{
public function __construct(
private IConfig $config,
private IAppConfig $appConfig,
private UpgradeV300 $upgrade,
)
{
}

public function getName(): string
{
return 'Rerun the change groupnames repair step for a Nextcloud instance using PostgreSQL.';
}

public function run(IOutput $output): void
{
$sgbdName = $this->config->getSystemValue('dbtype');

if ($sgbdName !== 'pgsql')
{
return;
}

$statusMigration = boolval($this->appConfig->getAppValue(Upgrade::CONTROL_MIGRATION_V3, '1'));

if ($statusMigration === true)
{
return;
}

$this->upgrade->upgrade();
}
$this->upgrade->upgrade();
}
}

0 comments on commit a9c70be

Please sign in to comment.