@@ -75,16 +75,16 @@ |
||
75 | 75 | |
76 | 76 | $initial = mb_substr($surname, 0, 1); |
77 | 77 | $initials_list = collect($this->indilist_module->surnameAlpha($tree, false, false, I18N::locale())) |
78 | - ->reject(function (int $count, string $initial): bool { |
|
78 | + ->reject(function(int $count, string $initial): bool { |
|
79 | 79 | |
80 | 80 | return $initial === '@' || $initial === ','; |
81 | 81 | }); |
82 | 82 | |
83 | - $title = I18N::translate('Patronymic Lineages') . ' — ' . $surname; |
|
83 | + $title = I18N::translate('Patronymic Lineages').' — '.$surname; |
|
84 | 84 | |
85 | 85 | $lineages = app()->make(LineageBuilder::class, ['surname' => $surname])->buildLineages(); |
86 | 86 | |
87 | - return $this->viewResponse($this->module->name() . '::lineages-page', [ |
|
87 | + return $this->viewResponse($this->module->name().'::lineages-page', [ |
|
88 | 88 | 'title' => $title, |
89 | 89 | 'module' => $this->module, |
90 | 90 | 'tree' => $tree, |
@@ -68,7 +68,7 @@ discard block |
||
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 |
||
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 | } |
@@ -81,12 +81,12 @@ |
||
81 | 81 | } |
82 | 82 | } catch (Throwable $ex) { |
83 | 83 | return $this->viewResponse('errors/unhandled-exception', [ |
84 | - 'error' => I18N::translate('Error while retrieving Matomo statistics: ') . |
|
84 | + 'error' => I18N::translate('Error while retrieving Matomo statistics: '). |
|
85 | 85 | (Auth::isAdmin() ? $ex->getMessage() : I18N::translate('Log in as admin for error details')) |
86 | 86 | ], StatusCodeInterface::STATUS_INTERNAL_SERVER_ERROR); |
87 | 87 | } |
88 | 88 | |
89 | - return $this->viewResponse($this->module->name() . '::matomo-stats', [ |
|
89 | + return $this->viewResponse($this->module->name().'::matomo-stats', [ |
|
90 | 90 | 'visits_year' => $nb_visits_year, |
91 | 91 | 'visits_today' => $nb_visits_today |
92 | 92 | ]); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | public function visitsThisYear(WelcomeBlockModule $module, int $block_id): ?int |
41 | 41 | { |
42 | 42 | return Registry::cache()->file()->remember( |
43 | - $module->name() . '-matomovisits-yearly-' . $block_id, |
|
44 | - function () use ($module, $block_id): ?int { |
|
43 | + $module->name().'-matomovisits-yearly-'.$block_id, |
|
44 | + function() use ($module, $block_id) : ?int { |
|
45 | 45 | $visits_year = $this->visits($module, $block_id, 'year'); |
46 | 46 | if ($visits_year === null) { |
47 | 47 | return null; |
48 | 48 | } |
49 | - $visits_today = (int) $this->visits($module, $block_id, 'day'); |
|
49 | + $visits_today = (int)$this->visits($module, $block_id, 'day'); |
|
50 | 50 | |
51 | 51 | return $visits_year - $visits_today; |
52 | 52 | }, |
@@ -64,8 +64,8 @@ discard block |
||
64 | 64 | public function visitsToday(WelcomeBlockModule $module, int $block_id): ?int |
65 | 65 | { |
66 | 66 | return Registry::cache()->array()->remember( |
67 | - $module->name() . '-matomovisits-daily-' . $block_id, |
|
68 | - function () use ($module, $block_id): ?int { |
|
67 | + $module->name().'-matomovisits-daily-'.$block_id, |
|
68 | + function() use ($module, $block_id) : ?int { |
|
69 | 69 | return $this->visits($module, $block_id, 'day'); |
70 | 70 | } |
71 | 71 | ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | ]); |
108 | 108 | |
109 | 109 | if ($response->getStatusCode() === StatusCodeInterface::STATUS_OK) { |
110 | - $result = json_decode((string) $response->getBody(), true)['value'] ?? null; |
|
110 | + $result = json_decode((string)$response->getBody(), true)['value'] ?? null; |
|
111 | 111 | if ($result !== null) { |
112 | 112 | return (int)$result; |
113 | 113 | } |
@@ -66,21 +66,21 @@ |
||
66 | 66 | { |
67 | 67 | if ($use_long && $record instanceof Individual) { |
68 | 68 | return |
69 | - view($this->module()->name() . '::icons/source-status', [ |
|
69 | + view($this->module()->name().'::icons/source-status', [ |
|
70 | 70 | 'module_name' => $this->module()->name(), |
71 | 71 | 'source_status' => $this->source_status_service->sourceStatusForRecord($record), |
72 | 72 | 'context' => 'INDI', |
73 | - 'size_style' => $size ]) . |
|
74 | - view($this->module()->name() . '::icons/source-status', [ |
|
73 | + 'size_style' => $size]). |
|
74 | + view($this->module()->name().'::icons/source-status', [ |
|
75 | 75 | 'module_name' => $this->module()->name(), |
76 | 76 | 'source_status' => $this->source_status_service->sourceStatusForBirth($record), |
77 | 77 | 'context' => 'INDI:BIRT', |
78 | - 'size_style' => $size ]) . |
|
79 | - ($record->isDead() ? view($this->module()->name() . '::icons/source-status', [ |
|
78 | + 'size_style' => $size]). |
|
79 | + ($record->isDead() ? view($this->module()->name().'::icons/source-status', [ |
|
80 | 80 | 'module_name' => $this->module()->name(), |
81 | 81 | 'source_status' => $this->source_status_service->sourceStatusForDeath($record), |
82 | 82 | 'context' => 'INDI:DEAT', |
83 | - 'size_style' => $size ]) : '') ; |
|
83 | + 'size_style' => $size]) : ''); |
|
84 | 84 | } |
85 | 85 | return ''; |
86 | 86 | } |
@@ -71,37 +71,37 @@ discard block |
||
71 | 71 | 'issourced' => [ |
72 | 72 | 'birth' => [ |
73 | 73 | 'position' => 7, |
74 | - 'column_def' => [ 'class' => 'text-center' ], |
|
75 | - 'th' => view($this->module()->name() . '::components/column-th-issourced', [ |
|
74 | + 'column_def' => ['class' => 'text-center'], |
|
75 | + 'th' => view($this->module()->name().'::components/column-th-issourced', [ |
|
76 | 76 | 'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label()) |
77 | 77 | ]), |
78 | - 'records' => $records->map(function (Individual $individual): array { |
|
78 | + 'records' => $records->map(function(Individual $individual): array { |
|
79 | 79 | $source_status = $this->source_status_service->sourceStatusForBirth($individual); |
80 | 80 | return [ |
81 | 81 | 'order' => $source_status->order(), |
82 | - 'text' => view($this->module()->name() . '::icons/source-status', [ |
|
82 | + 'text' => view($this->module()->name().'::icons/source-status', [ |
|
83 | 83 | 'module_name' => $this->module()->name(), |
84 | 84 | 'source_status' => $source_status, |
85 | 85 | 'context' => 'INDI:BIRT', |
86 | - 'size_style' => '' ]) |
|
86 | + 'size_style' => '']) |
|
87 | 87 | ]; |
88 | 88 | })->toArray() |
89 | 89 | ], |
90 | 90 | 'death' => [ |
91 | 91 | 'position' => 12, |
92 | - 'column_def' => [ 'class' => 'text-center' ], |
|
93 | - 'th' => view($this->module()->name() . '::components/column-th-issourced', [ |
|
92 | + 'column_def' => ['class' => 'text-center'], |
|
93 | + 'th' => view($this->module()->name().'::components/column-th-issourced', [ |
|
94 | 94 | 'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:DEAT')->label()) |
95 | 95 | ]), |
96 | - 'records' => $records->map(function (Individual $individual): array { |
|
96 | + 'records' => $records->map(function(Individual $individual): array { |
|
97 | 97 | $source_status = $this->source_status_service->sourceStatusForDeath($individual); |
98 | 98 | return $individual->isDead() ? [ |
99 | 99 | 'order' => $source_status->order(), |
100 | - 'text' => view($this->module()->name() . '::icons/source-status', [ |
|
100 | + 'text' => view($this->module()->name().'::icons/source-status', [ |
|
101 | 101 | 'module_name' => $this->module()->name(), |
102 | 102 | 'source_status' => $source_status, |
103 | 103 | 'context' => 'INDI:DEAT', |
104 | - 'size_style' => '' ]) |
|
104 | + 'size_style' => '']) |
|
105 | 105 | ] : ['order' => 0, 'text' => '']; |
106 | 106 | })->toArray() |
107 | 107 | ] |
@@ -120,19 +120,19 @@ discard block |
||
120 | 120 | 'issourced' => [ |
121 | 121 | 'marr' => [ |
122 | 122 | 'position' => 10, |
123 | - 'column_def' => [ 'class' => 'text-center' ], |
|
124 | - 'th' => view($this->module()->name() . '::components/column-th-issourced', [ |
|
123 | + 'column_def' => ['class' => 'text-center'], |
|
124 | + 'th' => view($this->module()->name().'::components/column-th-issourced', [ |
|
125 | 125 | 'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('FAM:MARR')->label()) |
126 | 126 | ]), |
127 | - 'records' => $records->map(function (Family $family): array { |
|
127 | + 'records' => $records->map(function(Family $family): array { |
|
128 | 128 | $source_status = $this->source_status_service->sourceStatusForMarriage($family); |
129 | 129 | return $family->getMarriage() !== null ? [ |
130 | 130 | 'order' => $source_status->order(), |
131 | - 'text' => view($this->module()->name() . '::icons/source-status', [ |
|
131 | + 'text' => view($this->module()->name().'::icons/source-status', [ |
|
132 | 132 | 'module_name' => $this->module()->name(), |
133 | 133 | 'source_status' => $source_status, |
134 | 134 | 'context' => 'FAM:MARR', |
135 | - 'size_style' => '' ]) |
|
135 | + 'size_style' => '']) |
|
136 | 136 | ] : ['order' => 0, 'text' => '']; |
137 | 137 | })->toArray() |
138 | 138 | ] |
@@ -172,37 +172,37 @@ discard block |
||
172 | 172 | 'issourced' => [ |
173 | 173 | 'indi' => [ |
174 | 174 | 'position' => 3, |
175 | - 'column_def' => [ 'class' => 'text-center' ], |
|
176 | - 'th' => view($this->module()->name() . '::components/column-th-issourced', [ |
|
175 | + 'column_def' => ['class' => 'text-center'], |
|
176 | + 'th' => view($this->module()->name().'::components/column-th-issourced', [ |
|
177 | 177 | 'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI')->label()) |
178 | 178 | ]), |
179 | - 'records' => $records->map(function (Individual $individual): array { |
|
179 | + 'records' => $records->map(function(Individual $individual): array { |
|
180 | 180 | $source_status = $this->source_status_service->sourceStatusForRecord($individual); |
181 | 181 | return [ |
182 | 182 | 'order' => $source_status->order(), |
183 | - 'text' => view($this->module()->name() . '::icons/source-status', [ |
|
183 | + 'text' => view($this->module()->name().'::icons/source-status', [ |
|
184 | 184 | 'module_name' => $this->module()->name(), |
185 | 185 | 'source_status' => $source_status, |
186 | 186 | 'context' => 'INDI', |
187 | - 'size_style' => '' ]) |
|
187 | + 'size_style' => '']) |
|
188 | 188 | ]; |
189 | 189 | })->toArray() |
190 | 190 | ], |
191 | 191 | 'birth' => [ |
192 | 192 | 'position' => 7, |
193 | - 'column_def' => [ 'class' => 'text-center' ], |
|
194 | - 'th' => view($this->module()->name() . '::components/column-th-issourced', [ |
|
193 | + 'column_def' => ['class' => 'text-center'], |
|
194 | + 'th' => view($this->module()->name().'::components/column-th-issourced', [ |
|
195 | 195 | 'title' => I18N::translate('%s sourced', Registry::elementFactory()->make('INDI:BIRT')->label()) |
196 | 196 | ]), |
197 | - 'records' => $records->map(function (Individual $individual): array { |
|
197 | + 'records' => $records->map(function(Individual $individual): array { |
|
198 | 198 | $source_status = $this->source_status_service->sourceStatusForBirth($individual); |
199 | 199 | return [ |
200 | 200 | 'order' => $source_status->order(), |
201 | - 'text' => view($this->module()->name() . '::icons/source-status', [ |
|
201 | + 'text' => view($this->module()->name().'::icons/source-status', [ |
|
202 | 202 | 'module_name' => $this->module()->name(), |
203 | 203 | 'source_status' => $source_status, |
204 | 204 | 'context' => 'INDI:BIRT', |
205 | - 'size_style' => '' ]) |
|
205 | + 'size_style' => '']) |
|
206 | 206 | ]; |
207 | 207 | })->toArray() |
208 | 208 | ] |
@@ -149,7 +149,7 @@ |
||
149 | 149 | */ |
150 | 150 | public function order(): int |
151 | 151 | { |
152 | - return ($this->hasSource() ? 1 : 0) * (1 + ($this->hasSupportingDocument() ? 1 : 0)); |
|
152 | + return ($this->hasSource() ? 1 : 0) * (1 + ($this->hasSupportingDocument() ? 1 : 0)); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -228,7 +228,7 @@ |
||
228 | 228 | public function order(): int |
229 | 229 | { |
230 | 230 | return ($this->factHasDate() ? 1 : 0) * ($this->hasSource() ? 1 : -1) * |
231 | - ( 1 + ($this->factHasPreciseDate() ? 1 : 0) * (1 + |
|
231 | + (1 + ($this->factHasPreciseDate() ? 1 : 0) * (1 + |
|
232 | 232 | 0b010 * ($this->sourceMatchesFactDate() ? 1 : 0) + |
233 | 233 | 0b100 * ($this->hasSupportingDocument() ? 1 : 0) |
234 | 234 | ) |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function headContent(): string |
77 | 77 | { |
78 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
78 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function bodyContent(): string |
86 | 86 | { |
87 | - return '<script src="' . $this->assetUrl('js/issourced.min.js') . '"></script>'; |
|
87 | + return '<script src="'.$this->assetUrl('js/issourced.min.js').'"></script>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | $source_status_service = app(SourceStatusService::class); |
107 | 107 | |
108 | 108 | $spouse_families_status = $individual->spouseFamilies()->map( |
109 | - function (Family $sfamily) use ($source_status_service): array { |
|
110 | - return [ $sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
109 | + function(Family $sfamily) use ($source_status_service): array { |
|
110 | + return [$sfamily, $source_status_service->sourceStatusForMarriage($sfamily)]; |
|
111 | 111 | } |
112 | - )->filter(function (array $item): bool { |
|
112 | + )->filter(function(array $item): bool { |
|
113 | 113 | return $item[1]->isSet(); |
114 | 114 | }); |
115 | 115 | |
116 | - return view($this->name() . '::sidebar/content', [ |
|
116 | + return view($this->name().'::sidebar/content', [ |
|
117 | 117 | 'module_name' => $this->name(), |
118 | 118 | 'individual' => $individual, |
119 | 119 | 'source_status_individual' => $source_status_service->sourceStatusForRecord($individual), |
@@ -130,8 +130,8 @@ discard block |
||
130 | 130 | public function listSubscribedHooks(): array |
131 | 131 | { |
132 | 132 | return [ |
133 | - app()->makeWith(IsSourcedStatusHook::class, [ 'module' => $this ]), |
|
134 | - app()->makeWith(IsSourcedStatusColumnsHook::class, [ 'module' => $this ]) |
|
133 | + app()->makeWith(IsSourcedStatusHook::class, ['module' => $this]), |
|
134 | + app()->makeWith(IsSourcedStatusColumnsHook::class, ['module' => $this]) |
|
135 | 135 | ]; |
136 | 136 | } |
137 | 137 | } |