Skip to content

Commit

Permalink
refactor: removed unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Oct 5, 2024
1 parent 591c7be commit d76f181
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 43 deletions.
2 changes: 1 addition & 1 deletion phpmyfaq/src/phpMyFAQ/Setup/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ class Installer extends Setup
*
* @throws \Exception
*/
public function __construct(private System $system)
public function __construct(private readonly System $system)
{
parent::__construct();

Expand Down
5 changes: 0 additions & 5 deletions phpmyfaq/src/phpMyFAQ/Setup/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ public function optimizeTables(): void
}
}

public function setDryRun(bool $dryRun): void
{
$this->dryRun = $dryRun;
}

/**
* @throws Exception
*/
Expand Down
39 changes: 2 additions & 37 deletions phpmyfaq/src/phpMyFAQ/Setup/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class Upgrade extends Setup

private bool $isNightly;

private bool $isMaintenanceEnabled = false;

public function __construct(protected System $system, private readonly Configuration $configuration)
{
parent::__construct($this->system);
Expand Down Expand Up @@ -151,7 +149,7 @@ public function downloadPackage(string $version): string
/**
* Method to verify the downloaded phpMyFAQ package
*
* @param string $path | Path to zip file
* @param string $path | Path to a zip file
* @param string $version | Version to verify
* @throws TransportExceptionInterface|ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|JsonException
*/
Expand Down Expand Up @@ -255,26 +253,6 @@ public function createTemporaryBackup(string $backupName, callable $progressCall
return file_exists($outputZipFile);
}

/**
* Method to delete the temporary created backup.
*
* @param string $backupName | Name of the created backup
*/
public function deleteTemporaryBackup(string $backupName): bool
{
if (is_file($this->upgradeDirectory . DIRECTORY_SEPARATOR . $backupName)) {
return unlink($this->upgradeDirectory . DIRECTORY_SEPARATOR . $backupName);
}
return false;
}

/**
* Method to restore from the temporary backup
*/
public function restoreTemporaryBackup()
{
}

/**
* Method to install the package
*/
Expand Down Expand Up @@ -372,11 +350,6 @@ public function getFilename(string $version): string
return sprintf(self::PHPMYFAQ_FILENAME, $version);
}

public function getUpgradeDirectory(): string
{
return $this->upgradeDirectory;
}

public function setUpgradeDirectory(string $upgradeDirectory): void
{
$this->upgradeDirectory = $upgradeDirectory;
Expand All @@ -394,14 +367,6 @@ public function setIsNightly(bool $isNightly): void

public function isMaintenanceEnabled(): bool
{
return $this->isMaintenanceEnabled = $this->configuration->get('main.maintenanceMode');
}

public function setIsMaintenanceEnabled(bool $isMaintenanceEnabled): Upgrade
{
$this->isMaintenanceEnabled = $isMaintenanceEnabled;
$this->configuration->set('main.maintenanceMode', $isMaintenanceEnabled);

return $this;
return $this->configuration->get('main.maintenanceMode');
}
}

0 comments on commit d76f181

Please sign in to comment.