Passed
Branch feature/2.0 (ef99fd)
by Jonathan
11:25
created
src/Webtrees/Module/PatronymicLineage/Http/RequestHandlers/SurnamesList.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         
70 70
         $initial = $request->getAttribute('alpha');
71 71
         $initials_list = collect($this->indilist_service->surnameAlpha(false, false, I18N::locale()))
72
-            ->reject(function ($count, $initial) {
72
+            ->reject(function($count, $initial) {
73 73
 
74 74
                 return $initial === '@' || $initial === ',';
75 75
             });
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
         $show_all = $request->getQueryParams()['show_all'] ?? 'no';
78 78
         
79 79
         if ($show_all === 'yes') {
80
-            $title = I18N::translate('Patronymic Lineages') . ' — ' . I18N::translate('All');
80
+            $title = I18N::translate('Patronymic Lineages').' — '.I18N::translate('All');
81 81
             $surnames = $this->indilist_service->surnames('', '', false, false, I18N::locale());
82 82
         } elseif ($initial !== null && mb_strlen($initial) == 1) {
83
-            $title = I18N::translate('Patronymic Lineages') . ' — ' . $initial;
83
+            $title = I18N::translate('Patronymic Lineages').' — '.$initial;
84 84
             $surnames = $this->indilist_service->surnames('', $initial, false, false, I18N::locale());
85 85
         } else {
86
-            $title =  I18N::translate('Patronymic Lineages');
86
+            $title = I18N::translate('Patronymic Lineages');
87 87
             $surnames = [];
88 88
         }
89 89
         
90
-        return $this->viewResponse($this->module->name() . '::surnames-page', [
90
+        return $this->viewResponse($this->module->name().'::surnames-page', [
91 91
             'title'         =>  $title,
92 92
             'module'        =>  $this->module,
93 93
             'tree'          =>  $tree,
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Http/RequestHandlers/LineagesPage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -72,16 +72,16 @@
 block discarded – undo
72 72
         
73 73
         $initial = mb_substr($surname, 0, 1);
74 74
         $initials_list = collect($this->indilist_service->surnameAlpha(false, false, I18N::locale()))
75
-            ->reject(function ($count, $initial) {
75
+            ->reject(function($count, $initial) {
76 76
 
77 77
                 return $initial === '@' || $initial === ',';
78 78
             });
79 79
             
80
-        $title = I18N::translate('Patronymic Lineages') . ' — ' . $surname;
80
+        $title = I18N::translate('Patronymic Lineages').' — '.$surname;
81 81
         
82 82
         $lineages = app()->make(LineageBuilder::class, ['surname' => $surname])->buildLineages();
83 83
         
84
-        return $this->viewResponse($this->module->name() . '::lineages-page', [
84
+        return $this->viewResponse($this->module->name().'::lineages-page', [
85 85
             'title'         =>  $title,
86 86
             'module'        =>  $this->module,
87 87
             'tree'          =>  $tree,
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/PatronymicLineageModule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function loadRoutes(Map $router): void
63 63
     {
64
-        $router->attach('', '', static function (Map $router) {
64
+        $router->attach('', '', static function(Map $router) {
65 65
 
66
-            $router->attach('', '/module-maj/lineages', static function (Map $router) {
66
+            $router->attach('', '/module-maj/lineages', static function(Map $router) {
67 67
 
68
-                $router->attach('', '/Page', static function (Map $router) {
68
+                $router->attach('', '/Page', static function(Map $router) {
69 69
 
70 70
                     $router->get(SurnamesList::class, '/{tree}/list{/alpha}', SurnamesList::class);
71 71
                     $router->get(LineagesPage::class, '/{tree}/lineage/{surname}', LineagesPage::class);
@@ -113,6 +113,6 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function headContent(): string
115 115
     {
116
-        return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">';
116
+        return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">';
117 117
     }
118 118
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Model/LineageNode.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     public function addFamily(Family $fams): object
69 69
     {
70 70
         if (!$this->linked_fams->has($fams->xref())) {
71
-            $this->linked_fams->put($fams->xref(), (object) [
71
+            $this->linked_fams->put($fams->xref(), (object)[
72 72
                 'family'   =>  $fams,
73 73
                 'children' =>  new Collection()
74 74
             ]);
@@ -135,6 +135,6 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function hasFollowUpSurname(): bool
137 137
     {
138
-        return mb_strlen($this->followUpSurname()) > 0 ;
138
+        return mb_strlen($this->followUpSurname()) > 0;
139 139
     }
140 140
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/PatronymicLineage/Model/LineageBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
             }
108 108
         }
109 109
       
110
-        return $root_lineages->sort(function (LineageRootNode $a, LineageRootNode $b) {
110
+        return $root_lineages->sort(function(LineageRootNode $a, LineageRootNode $b) {
111 111
 
112 112
             if ($a->numberChildNodes() == $b->numberChildNodes()) {
113 113
                 return 0;
Please login to merge, or discard this patch.
src/Webtrees/Module/AbstractModuleMaj.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function boot() : void
36 36
     {
37
-        View::registerNamespace($this->name(), $this->resourcesFolder() . 'views/');
37
+        View::registerNamespace($this->name(), $this->resourcesFolder().'views/');
38 38
         
39 39
         $this->loadRoutes(app(RouterContainer::class)->getMap());
40 40
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function resourcesFolder(): string
47 47
     {
48
-        return Webtrees::MODULES_DIR . trim($this->name(), '_') . '/resources/';
48
+        return Webtrees::MODULES_DIR.trim($this->name(), '_').'/resources/';
49 49
     }
50 50
     
51 51
     /**
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      */
73 73
     public function customTranslations(string $language) : array
74 74
     {
75
-        $translation_file = $this->resourcesFolder() . 'lang/' . $language . '/messages.php';
75
+        $translation_file = $this->resourcesFolder().'lang/'.$language.'/messages.php';
76 76
         
77 77
         try {
78 78
             $translation  = new Translation($translation_file);
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
     {
101 101
         /** @var ModuleThemeInterface $theme */
102 102
         $theme = app(ModuleThemeInterface::class);
103
-        $css_file = $this->resourcesFolder() . 'css/' . $theme->name() . '.min.css';
103
+        $css_file = $this->resourcesFolder().'css/'.$theme->name().'.min.css';
104 104
         
105
-        if(file_exists($css_file)) {
106
-            return $this->assetUrl('css/' . $theme->name() . '.min.css');
105
+        if (file_exists($css_file)) {
106
+            return $this->assetUrl('css/'.$theme->name().'.min.css');
107 107
         }
108 108
         else {
109 109
             return $this->assetUrl('css/default.min.css');
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Services/TaskScheduleService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
         $query = DB::table('maj_admintasks')
196 196
             ->select()
197 197
             ->where('majat_status', '=', 'enabled')
198
-            ->where(function (Builder $query) {
198
+            ->where(function(Builder $query) {
199 199
 
200 200
                 $query->where('majat_running', '=', 0)
201 201
                 ->orWhere('majat_last_run', '<=', Carbon::now()->subSeconds(self::TASK_TIME_OUT));
202 202
             });
203 203
             
204 204
         if (!$force) {
205
-            $query->where(function (Builder $query) {
205
+            $query->where(function(Builder $query) {
206 206
 
207 207
                 $query->where('majat_running', '=', 0)
208 208
                     ->orWhereRaw('DATE_ADD(majat_last_run, INTERVAL majat_frequency MINUTE) <= NOW()');
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         if (
239 239
             !$task_schedule->isRunning() &&
240 240
             ($force || $task_schedule->lastRunTime()->add($task_schedule->frequency())->lessThan(Carbon::now())) &&
241
-            $task_schedule->setLastResult(false) &&  // @phpstan-ignore-line  Used as setter, not as a condition
241
+            $task_schedule->setLastResult(false) && // @phpstan-ignore-line  Used as setter, not as a condition
242 242
             $task = $this->findTask($task_schedule->taskId())
243 243
         ) {
244 244
             $task_schedule->startRunning();
@@ -267,17 +267,17 @@  discard block
 block discarded – undo
267 267
      */
268 268
     public static function rowMapper(): Closure
269 269
     {
270
-        return static function (stdClass $row): TaskSchedule {
270
+        return static function(stdClass $row): TaskSchedule {
271 271
 
272 272
             return new TaskSchedule(
273
-                (int) $row->majat_id,
273
+                (int)$row->majat_id,
274 274
                 $row->majat_task_id,
275 275
                 $row->majat_status === 'enabled',
276 276
                 Carbon::parse($row->majat_last_run),
277
-                (bool) $row->majat_last_result,
277
+                (bool)$row->majat_last_result,
278 278
                 CarbonInterval::minutes($row->majat_frequency),
279
-                (int) $row->majat_nb_occur,
280
-                (bool) $row->majat_running
279
+                (int)$row->majat_nb_occur,
280
+                (bool)$row->majat_running
281 281
             );
282 282
         };
283 283
     }
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Services/HealthCheckService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function changesByRecordType(Tree $tree, int $nb_days): Collection
80 80
     {
81 81
         return DB::table('change')
82
-            ->joinSub($this->allGedcomRecords($tree), 'gedrecords', function (JoinClause $join) use ($tree) {
82
+            ->joinSub($this->allGedcomRecords($tree), 'gedrecords', function(JoinClause $join) use ($tree) {
83 83
 
84 84
                 $join->on('change.xref', '=', 'gedrecords.ged_id')
85 85
                     ->where('change.gedcom_id', '=', $tree->id());
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 new Expression('MAX(log_time) AS lastoccurred')
116 116
             )
117 117
             ->where('log_type', '=', 'error')
118
-            ->where(function (Builder $query) use ($tree) {
118
+            ->where(function(Builder $query) use ($tree) {
119 119
                 $query->where('gedcom_id', '=', $tree->id())
120 120
                     ->orWhereNull('gedcom_id');
121 121
             })
Please login to merge, or discard this patch.
src/Webtrees/Module/AdminTasks/Http/RequestHandlers/TaskEditPage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             throw new HttpNotFoundException(I18N::translate('The attached module could not be found.'));
68 68
         }
69 69
         
70
-        $task_sched_id = (int) $request->getAttribute('task');
70
+        $task_sched_id = (int)$request->getAttribute('task');
71 71
         $task_schedule = $this->taskschedules_service->find($task_sched_id);
72 72
         
73 73
         if ($task_schedule === null) {
@@ -83,9 +83,9 @@  discard block
 block discarded – undo
83 83
         /** @var TaskInterface|ConfigurableTaskInterface $task */
84 84
         $has_task_config = $task instanceof ConfigurableTaskInterface;
85 85
         
86
-        return $this->viewResponse($this->module->name() . '::admin/tasks-edit', [
86
+        return $this->viewResponse($this->module->name().'::admin/tasks-edit', [
87 87
             'module'            =>  $this->module,
88
-            'title'             =>  I18N::translate('Edit the administrative task') . ' - ' . $task->name(),
88
+            'title'             =>  I18N::translate('Edit the administrative task').' - '.$task->name(),
89 89
             'task_schedule'     =>  $task_schedule,
90 90
             'task'              =>  $task,
91 91
             'has_task_config'   =>  $has_task_config,
Please login to merge, or discard this patch.