Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2167,9 +2167,7 @@ public function updateEmailTemplate(string $templateName): JSONResponse
templateContent: $templateContent
);

$updateMsg = "Failed to update template {$templateName}";
if ($success === true) {
}
$updateMsg = ($success === true) ? "Template {$templateName} updated successfully" : "Failed to update template {$templateName}";

return new JSONResponse(
[
Expand Down Expand Up @@ -2713,9 +2711,7 @@ public function cancelArchiMateImport(): JSONResponse
try {
$result = $this->settingsService->cancelArchiMateImport();

$message = 'ArchiMate import cancellation failed';
if ($result['cancelled'] === true) {
}
$message = ($result['cancelled'] === true) ? 'ArchiMate import cancellation succeeded' : 'ArchiMate import cancellation failed';

return new JSONResponse(
[
Expand Down Expand Up @@ -3436,9 +3432,7 @@ public function syncOrganisations(): JSONResponse
// Call the settings service method.
$result = $this->settingsService->syncOrganisationsToVoorzieningenOptimized($options);

$statusCode = 500;
if ($result['success'] === true) {
}
$statusCode = ($result['success'] === true) ? 200 : 500;

$this->logger->info(
'SettingsController: Organisation sync completed',
Expand Down Expand Up @@ -3581,9 +3575,7 @@ public function updateCronjobConfig(): JSONResponse
$data = $this->request->getParams();
$result = $this->settingsService->updateCronjobConfig($data);

$statusCode = 400;
if ($result['success'] === true) {
}
$statusCode = ($result['success'] === true) ? 200 : 400;

return new JSONResponse($result, $statusCode);
} catch (\Exception $e) {
Expand Down
20 changes: 5 additions & 15 deletions lib/Service/SettingsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -2093,9 +2093,7 @@ public function updateEmailSettings(array $emailSettings): array

// Convert boolean values to strings.
if (is_bool($value) === true) {
$value = 'false';
if ($value === true) {
}
$value = ($value === true) ? 'true' : 'false';
}

$this->config->setValueString($this->appName, $configKey, (string) $value);
Expand Down Expand Up @@ -2631,9 +2629,7 @@ private function getConnectionDetails(array $emailSettings): array

switch ($transportType) {
case 'smtp':
$usernameValue = 'none';
if (empty($emailSettings['smtpUsername']) === false) {
}
$usernameValue = (empty($emailSettings['smtpUsername']) === false) ? 'configured' : 'none';
return [
'type' => 'SMTP',
'host' => $emailSettings['smtpHost'] ?? '',
Expand Down Expand Up @@ -2971,9 +2967,7 @@ public function getVersionInfo(): array
$openRegisterInstalled = $this->isOpenRegisterInstalled();
$openRegisterEnabled = $openRegisterInstalled && $this->isOpenRegisterEnabled();

$versionComparisonValue = null;
if ($storedConfigVersion !== null) {
}
$versionComparisonValue = ($storedConfigVersion !== null) ? version_compare($currentAppVersion, $storedConfigVersion) : null;

$versionInfo = [
'appName' => 'SoftwareCatalog',
Expand Down Expand Up @@ -3055,9 +3049,7 @@ public function forceUpdate(): array
);

// Return concise response to avoid serialization issues with large nested structures.
$messageValue = 'Force update completed but configuration needs attention';
if ($success === true) {
}
$messageValue = ($success === true) ? 'Force update completed successfully' : 'Force update completed but configuration needs attention';

return [
'success' => $success,
Expand Down Expand Up @@ -3207,9 +3199,7 @@ public function manualImport(bool $forceImport=false): array
// If force import is requested or auto-config not completed, reset auto-configuration flag.
if ($forceImport === true || $versionInfo['autoConfigCompleted'] === false) {
$this->config->setValueString($this->appName, 'auto_config_completed', 'false');
$reasonValue = 'auto_config_not_completed';
if ($forceImport === true) {
}
$reasonValue = ($forceImport === true) ? 'force_import_requested' : 'auto_config_not_completed';

$this->logger->info(
'SettingsService: Reset auto-configuration flag',
Expand Down