@@ -89,18 +89,18 @@ |
||
| 89 | 89 | |
| 90 | 90 | /** @var \Illuminate\Support\Collection<int, \Fisharebest\Webtrees\Individual> $list_ancestors */ |
| 91 | 91 | $list_ancestors = $list_ancestors |
| 92 | - ->filter(function (stdClass $value) use ($tree): bool { |
|
| 92 | + ->filter(function(stdClass $value) use ($tree): bool { |
|
| 93 | 93 | $indi = Registry::individualFactory()->make($value->majs_i_id, $tree); |
| 94 | 94 | return $indi !== null && $indi->canShowName(); |
| 95 | 95 | }) |
| 96 | - ->mapWithKeys(function (stdClass $value) use ($tree): array { |
|
| 96 | + ->mapWithKeys(function(stdClass $value) use ($tree): array { |
|
| 97 | 97 | $indi = Registry::individualFactory()->make($value->majs_i_id, $tree); |
| 98 | - return [(int) $value->majs_sosa => $indi]; |
|
| 98 | + return [(int)$value->majs_sosa => $indi]; |
|
| 99 | 99 | }); |
| 100 | 100 | |
| 101 | 101 | $nb_ancestors_shown = $list_ancestors->count(); |
| 102 | 102 | |
| 103 | - return $this->viewResponse($this->module->name() . '::list-ancestors-indi-tab', [ |
|
| 103 | + return $this->viewResponse($this->module->name().'::list-ancestors-indi-tab', [ |
|
| 104 | 104 | 'module_name' => $this->module->name(), |
| 105 | 105 | 'title' => I18N::translate('Sosa Ancestors'), |
| 106 | 106 | 'tree' => $tree, |
@@ -89,18 +89,18 @@ |
||
| 89 | 89 | |
| 90 | 90 | /** @var \Illuminate\Support\Collection<int, \Fisharebest\Webtrees\Family> $list_families */ |
| 91 | 91 | $list_families = $list_families |
| 92 | - ->filter(function (stdClass $value) use ($tree): bool { |
|
| 92 | + ->filter(function(stdClass $value) use ($tree): bool { |
|
| 93 | 93 | $fam = Registry::familyFactory()->make($value->f_id, $tree); |
| 94 | 94 | return $fam !== null && $fam->canShow(); |
| 95 | 95 | }) |
| 96 | - ->mapWithKeys(function (stdClass $value) use ($tree): array { |
|
| 96 | + ->mapWithKeys(function(stdClass $value) use ($tree): array { |
|
| 97 | 97 | $fam = Registry::familyFactory()->make($value->f_id, $tree); |
| 98 | - return [(int) $value->majs_sosa => $fam]; |
|
| 98 | + return [(int)$value->majs_sosa => $fam]; |
|
| 99 | 99 | }); |
| 100 | 100 | |
| 101 | 101 | $nb_families_shown = $list_families->count(); |
| 102 | 102 | |
| 103 | - return $this->viewResponse($this->module->name() . '::list-ancestors-fam-tab', [ |
|
| 103 | + return $this->viewResponse($this->module->name().'::list-ancestors-fam-tab', [ |
|
| 104 | 104 | 'module_name' => $this->module->name(), |
| 105 | 105 | 'title' => I18N::translate('Sosa Ancestors'), |
| 106 | 106 | 'tree' => $tree, |
@@ -72,14 +72,14 @@ |
||
| 72 | 72 | |
| 73 | 73 | $unique_ancestors = $this->records_service |
| 74 | 74 | ->listAncestors($tree, Auth::check() ? Auth::user() : new DefaultUser()) |
| 75 | - ->uniqueStrict(fn(stdClass $item): string => $item->majs_i_id); |
|
| 75 | + ->uniqueStrict(fn(stdClass $item) : string => $item->majs_i_id); |
|
| 76 | 76 | |
| 77 | 77 | foreach ($unique_ancestors as $item) { |
| 78 | 78 | $ancestor = Registry::individualFactory()->make($item->majs_i_id, $tree); |
| 79 | 79 | if ($ancestor === null || !$ancestor->canShow()) { |
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | - $generation = $this->records_service->generation((int) $item->majs_sosa); |
|
| 82 | + $generation = $this->records_service->generation((int)$item->majs_sosa); |
|
| 83 | 83 | $significantplace = new GeoAnalysisPlace($tree, null, $depth); |
| 84 | 84 | foreach ($this->significantPlaces($ancestor) as $place) { |
| 85 | 85 | $significantplace = new GeoAnalysisPlace($tree, $place, $depth, true); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $record instanceof Individual && |
| 72 | 72 | $this->sosa_records_service->isSosa($record->tree(), $current_user, $record) |
| 73 | 73 | ) { |
| 74 | - return view($this->module->name() . '::icons/sosa', [ 'size_style' => $size ]); |
|
| 74 | + return view($this->module->name().'::icons/sosa', ['size_style' => $size]); |
|
| 75 | 75 | } |
| 76 | 76 | return ''; |
| 77 | 77 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $interval_lastrun = $task_schedule->lastRunTime()->diffAsCarbonInterval(CarbonImmutable::now()); |
| 116 | 116 | $interval_frequency = CarbonInterval::minutes($task_schedule->frequency()); |
| 117 | 117 | $interval = $interval_lastrun->greaterThan($interval_frequency) ? $interval_lastrun : $interval_frequency; |
| 118 | - $nb_days = (int) $interval->ceilDay()->totalDays; |
|
| 118 | + $nb_days = (int)$interval->ceilDay()->totalDays; |
|
| 119 | 119 | |
| 120 | 120 | $view_params_site = [ |
| 121 | 121 | 'nb_days' => $nb_days, |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | continue; |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - $webmaster = $this->user_service->find((int) $tree->getPreference('WEBMASTER_USER_ID')); |
|
| 137 | + $webmaster = $this->user_service->find((int)$tree->getPreference('WEBMASTER_USER_ID')); |
|
| 138 | 138 | if ($webmaster === null) { |
| 139 | 139 | continue; |
| 140 | 140 | } |
@@ -155,9 +155,9 @@ discard block |
||
| 155 | 155 | new TreeUser($tree), |
| 156 | 156 | $webmaster, |
| 157 | 157 | new NoReplyUser(), |
| 158 | - I18N::translate('Health Check Report') . ' - ' . I18N::translate('Tree %s', $tree->name()), |
|
| 159 | - view($this->module->name() . '::tasks/healthcheck/email-healthcheck-text', $view_params), |
|
| 160 | - view($this->module->name() . '::tasks/healthcheck/email-healthcheck-html', $view_params) |
|
| 158 | + I18N::translate('Health Check Report').' - '.I18N::translate('Tree %s', $tree->name()), |
|
| 159 | + view($this->module->name().'::tasks/healthcheck/email-healthcheck-text', $view_params), |
|
| 160 | + view($this->module->name().'::tasks/healthcheck/email-healthcheck-html', $view_params) |
|
| 161 | 161 | ); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | public function configView(ServerRequestInterface $request): string |
| 172 | 172 | { |
| 173 | - return $this->module === null ? '' : view($this->module->name() . '::tasks/healthcheck/config', [ |
|
| 173 | + return $this->module === null ? '' : view($this->module->name().'::tasks/healthcheck/config', [ |
|
| 174 | 174 | 'all_trees' => $this->tree_service->all() |
| 175 | 175 | ]); |
| 176 | 176 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | foreach ($this->tree_service->all() as $tree) { |
| 188 | 188 | if (Auth::isManager($tree)) { |
| 189 | - $tree_enabled = $validator->boolean('HEALTHCHECK_ENABLED_' . $tree->id(), false); |
|
| 189 | + $tree_enabled = $validator->boolean('HEALTHCHECK_ENABLED_'.$tree->id(), false); |
|
| 190 | 190 | $tree->setPreference(self::TREE_PREFERENCE_NAME, $tree_enabled ? '1' : '0'); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -62,13 +62,13 @@ discard block |
||
| 62 | 62 | $module = $this->module; |
| 63 | 63 | $module_name = $this->module->name(); |
| 64 | 64 | return Registry::responseFactory()->response(['data' => $this->taskschedules_service->all(true, true) |
| 65 | - ->map(function (TaskSchedule $schedule) use ($module, $module_name): array { |
|
| 65 | + ->map(function(TaskSchedule $schedule) use ($module, $module_name): array { |
|
| 66 | 66 | $task = $this->taskschedules_service->findTask($schedule->taskId()); |
| 67 | 67 | $task_name = $task !== null ? $task->name() : I18N::translate('Task not found'); |
| 68 | 68 | $last_run_timestamp = Registry::timestampFactory()->make($schedule->lastRunTime()->getTimestamp()); |
| 69 | 69 | |
| 70 | 70 | return [ |
| 71 | - 'edit' => view($module_name . '::admin/tasks-table-options', [ |
|
| 71 | + 'edit' => view($module_name.'::admin/tasks-table-options', [ |
|
| 72 | 72 | 'task_sched_id' => $schedule->id(), |
| 73 | 73 | 'task_sched_enabled' => $schedule->isEnabled(), |
| 74 | 74 | 'task_edit_route' => route(TaskEditPage::class, ['task' => $schedule->id()]), |
@@ -78,38 +78,36 @@ discard block |
||
| 78 | 78 | ]) |
| 79 | 79 | ]), |
| 80 | 80 | 'status' => [ |
| 81 | - 'display' => view($module_name . '::components/yes-no-icons', [ |
|
| 81 | + 'display' => view($module_name.'::components/yes-no-icons', [ |
|
| 82 | 82 | 'yes' => $schedule->isEnabled() |
| 83 | 83 | ]), |
| 84 | 84 | 'raw' => $schedule->isEnabled() ? 1 : 0 |
| 85 | 85 | ], |
| 86 | 86 | 'task_name' => [ |
| 87 | - 'display' => '<bdi>' . e($task_name) . '</bdi>', |
|
| 87 | + 'display' => '<bdi>'.e($task_name).'</bdi>', |
|
| 88 | 88 | 'raw' => $task_name |
| 89 | 89 | ], |
| 90 | 90 | 'last_run' => [ |
| 91 | 91 | 'display' => $last_run_timestamp->timestamp() === 0 ? |
| 92 | - view('components/datetime', ['timestamp' => $last_run_timestamp]) : |
|
| 93 | - view('components/datetime-diff', ['timestamp' => $last_run_timestamp]), |
|
| 92 | + view('components/datetime', ['timestamp' => $last_run_timestamp]) : view('components/datetime-diff', ['timestamp' => $last_run_timestamp]), |
|
| 94 | 93 | 'raw' => $schedule->lastRunTime()->getTimestamp() |
| 95 | 94 | ], |
| 96 | 95 | 'last_result' => [ |
| 97 | - 'display' => view($module_name . '::components/yes-no-icons', [ |
|
| 96 | + 'display' => view($module_name.'::components/yes-no-icons', [ |
|
| 98 | 97 | 'yes' => $schedule->wasLastRunSuccess() |
| 99 | 98 | ]), |
| 100 | 99 | 'raw' => $schedule->wasLastRunSuccess() ? 1 : 0 |
| 101 | 100 | ], |
| 102 | 101 | 'frequency' => |
| 103 | - '<bdi>' . e(CarbonInterval::minutes($schedule->frequency())->cascade()->forHumans()) . '</bdi>', |
|
| 102 | + '<bdi>'.e(CarbonInterval::minutes($schedule->frequency())->cascade()->forHumans()).'</bdi>', |
|
| 104 | 103 | 'nb_occurrences' => $schedule->remainingOccurrences() > 0 ? |
| 105 | - I18N::number($schedule->remainingOccurrences()) : |
|
| 106 | - I18N::translate('Unlimited'), |
|
| 107 | - 'running' => view($module_name . '::components/yes-no-icons', [ |
|
| 104 | + I18N::number($schedule->remainingOccurrences()) : I18N::translate('Unlimited'), |
|
| 105 | + 'running' => view($module_name.'::components/yes-no-icons', [ |
|
| 108 | 106 | 'yes' => $schedule->isRunning(), |
| 109 | 107 | 'text_yes' => I18N::translate('Running'), |
| 110 | 108 | 'text_no' => I18N::translate('Not running') |
| 111 | 109 | ]), |
| 112 | - 'run' => view($module_name . '::admin/tasks-table-run', [ |
|
| 110 | + 'run' => view($module_name.'::admin/tasks-table-run', [ |
|
| 113 | 111 | 'task_sched_id' => $schedule->id(), |
| 114 | 112 | 'run_route' => route(TaskTrigger::class, [ |
| 115 | 113 | 'task' => $schedule->taskId(), |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $task_id = Validator::attributes($request)->string('task', ''); |
| 58 | 58 | $token = $this->module->getPreference('MAJ_AT_FORCE_EXEC_TOKEN'); |
| 59 | 59 | $force_token = Validator::queryParams($request)->string('force', ''); |
| 60 | - $force = $token !== '' && $token === $force_token; |
|
| 60 | + $force = $token !== '' && $token === $force_token; |
|
| 61 | 61 | |
| 62 | 62 | $task_schedules = $this->taskschedules_service->findTasksToRun($force, $task_id); |
| 63 | 63 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'success' |
| 84 | 84 | ); |
| 85 | 85 | //phpcs:ignore Generic.Files.LineLength.TooLong |
| 86 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” has been updated.'); |
|
| 86 | + Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” has been updated.'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return Registry::responseFactory()->redirect(AdminConfigPage::class); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | FlashMessages::addMessage(I18N::translate('An error occured while updating the scheduled task.'), 'danger'); |
| 141 | 141 | //@phpcs:ignore Generic.Files.LineLength.TooLong |
| 142 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : Task Schedule “' . $task_schedule->id() . '” could not be updated. See error log.'); |
|
| 142 | + Log::addConfigurationLog('Module '.$this->module->title().' : Task Schedule “'.$task_schedule->id().'” could not be updated. See error log.'); |
|
| 143 | 143 | return false; |
| 144 | 144 | } |
| 145 | 145 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | 'danger' |
| 172 | 172 | ); |
| 173 | 173 | //phpcs:ignore Generic.Files.LineLength.TooLong |
| 174 | - Log::addConfigurationLog('Module ' . $this->module->title() . ' : AdminTask “' . $task->name() . '” specific settings could not be updated. See error log.'); |
|
| 174 | + Log::addConfigurationLog('Module '.$this->module->title().' : AdminTask “'.$task->name().'” specific settings could not be updated. See error log.'); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return true; |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | $token = $this->token_service->generateRandomToken(); |
| 58 | 58 | $this->module->setPreference('MAJ_AT_FORCE_EXEC_TOKEN', $token); |
| 59 | - Log::addConfigurationLog($this->module->title() . ' : New token generated.'); |
|
| 59 | + Log::addConfigurationLog($this->module->title().' : New token generated.'); |
|
| 60 | 60 | |
| 61 | 61 | return Registry::responseFactory()->response(['token' => $token]); |
| 62 | 62 | } |