Fix Pint formatting

This commit is contained in:
root
2026-06-09 01:25:14 -04:00
parent 6be4875c5e
commit 20a0b6c4e5
1485 changed files with 11318 additions and 10273 deletions
+14 -10
View File
@@ -24,31 +24,34 @@ class ConfigUpdateService
public function runTask(string $task, bool $dry, bool $force, DateTimeZone $tz): array
{
if (!isset($this->tasks[$task])) {
if (! isset($this->tasks[$task])) {
return ['ok' => false, 'message' => 'Unknown task.'];
}
$lockFile = storage_path('app/locks/config_update_' . $task . '.lock');
if (!is_dir(dirname($lockFile))) {
$lockFile = storage_path('app/locks/config_update_'.$task.'.lock');
if (! is_dir(dirname($lockFile))) {
@mkdir(dirname($lockFile), 0775, true);
}
$fp = @fopen($lockFile, 'c+');
if (!$fp) {
if (! $fp) {
return ['ok' => false, 'message' => 'Unable to open lock file.'];
}
if (!$force && !flock($fp, LOCK_EX | LOCK_NB)) {
if (! $force && ! flock($fp, LOCK_EX | LOCK_NB)) {
fclose($fp);
return ['ok' => false, 'message' => 'Task is already running.'];
}
try {
$method = $this->tasks[$task];
$ok = (bool) $this->{$method}($dry, $force, $tz);
return ['ok' => $ok, 'task' => $task];
} catch (\Throwable $e) {
Log::error('ConfigUpdate task failed: ' . $e->getMessage());
Log::error('ConfigUpdate task failed: '.$e->getMessage());
return ['ok' => false, 'message' => $e->getMessage()];
} finally {
try {
@@ -74,11 +77,12 @@ class ConfigUpdateService
{
$now = new DateTimeImmutable('now', $tz);
$isJune1 = $now->format('n-j') === '6-1';
if (!$isJune1 && !$force) {
if (! $isJune1 && ! $force) {
return true;
}
$value = $now->format('Y') . '-12-31';
$value = $now->format('Y').'-12-31';
return $dry ? true : Configuration::setConfigValueByKey('date_age_reference', $value);
}
@@ -86,7 +90,7 @@ class ConfigUpdateService
{
$now = new DateTimeImmutable('now', $tz);
$isFeb1 = $now->format('n-j') === '2-1';
if (!$isFeb1 && !$force) {
if (! $isFeb1 && ! $force) {
return true;
}
@@ -97,7 +101,7 @@ class ConfigUpdateService
{
$now = new DateTimeImmutable('now', $tz);
$isJun1 = $now->format('n-j') === '6-1';
if (!$isJun1 && !$force) {
if (! $isJun1 && ! $force) {
return true;
}