You've already forked Atomcms-edit
refactor: fix PHPStan errors, remove unused code, replace shell_exec with Process
- Fix all 54 PHPStan errors (strict comparisons, unused methods, nullsafe) - Remove unused HasPermissionColumns trait, checkGitHubUpdates, getGitHubLatestCommit - Replace all 31 shell_exec calls with Process facade in Commandocentrum - Add helper methods: runCommand, fileExists, dirExists, readFile - Fix EmulatorJarService and EmulatorSqlService type issues
This commit is contained in:
Regular → Executable
+5
-5
@@ -162,11 +162,11 @@ class EmulatorJarService
|
||||
$installedJarCommit = $this->settings->getOrDefault('emulator_jar_commit', null);
|
||||
|
||||
$isUpdate = false;
|
||||
if ($installedJarCommit !== null && $commitSha !== null) {
|
||||
if ($installedJarCommit !== null) {
|
||||
$isUpdate = $installedJarCommit !== $commitSha;
|
||||
} elseif ($installedDate !== null && $commitDate) {
|
||||
} elseif ($installedDate !== null && $commitDate !== null) {
|
||||
$isUpdate = (int) $installedDate < $commitDate;
|
||||
} elseif ($installedDate === null && $commitDate) {
|
||||
} elseif ($installedDate === null && $commitDate !== null) {
|
||||
$isUpdate = true;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ class EmulatorJarService
|
||||
}
|
||||
|
||||
return [
|
||||
'update_available' => $hasJarUpdates || $hasSourceUpdates,
|
||||
'update_available' => $hasJarUpdates,
|
||||
'current_version' => $this->settings->getOrDefault('emulator_version', '0.0.0'),
|
||||
'latest_version' => $jarInfo['version'],
|
||||
'release_name' => $hasSourceUpdates ? 'Source Update' : 'Direct URL',
|
||||
@@ -307,7 +307,7 @@ class EmulatorJarService
|
||||
}
|
||||
|
||||
return [
|
||||
'update_available' => $hasJarUpdates || $hasSourceUpdates,
|
||||
'update_available' => $hasJarUpdates,
|
||||
'current_version' => $this->settings->getOrDefault('emulator_version', '0.0.0'),
|
||||
'latest_version' => $hasSourceUpdates ? ($sourceInfo['latest_timestamp'] ? date('Y.m.d', $sourceInfo['latest_timestamp']) : $version) : $version,
|
||||
'release_name' => $hasSourceUpdates ? 'Source Update' : 'Latest from GitHub',
|
||||
|
||||
Reference in New Issue
Block a user