@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function loadRoutes(Map $router): void |
63 | 63 | { |
64 | - $router->attach('', '', static function (Map $router): void { |
|
64 | + $router->attach('', '', static function(Map $router): void { |
|
65 | 65 | |
66 | - $router->attach('', '/module-maj/welcomeblock/{block_id}', static function (Map $router): void { |
|
66 | + $router->attach('', '/module-maj/welcomeblock/{block_id}', static function(Map $router): void { |
|
67 | 67 | $router->tokens(['block_id' => '\d+']); |
68 | 68 | $router->get(MatomoStats::class, '/matomostats', MatomoStats::class); |
69 | 69 | }); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $fab_login_block_view = app(\Fisharebest\Webtrees\Module\LoginBlockModule::class) |
92 | 92 | ->getBlock($tree, $block_id, ModuleBlockInterface::CONTEXT_EMBED); |
93 | 93 | |
94 | - $content = view($this->name() . '::block-embed', [ |
|
94 | + $content = view($this->name().'::block-embed', [ |
|
95 | 95 | 'block_id' => $block_id, |
96 | 96 | 'fab_welcome_block_view' => $fab_welcome_block_view, |
97 | 97 | 'fab_login_block_view' => $fab_login_block_view, |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function editBlockConfiguration(Tree $tree, int $block_id): string |
129 | 129 | { |
130 | - return view($this->name() . '::config', $this->matomoSettings($block_id)); |
|
130 | + return view($this->name().'::config', $this->matomoSettings($block_id)); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function saveBlockConfiguration(ServerRequestInterface $request, int $block_id): void |
138 | 138 | { |
139 | - $params = (array) $request->getParsedBody(); |
|
139 | + $params = (array)$request->getParsedBody(); |
|
140 | 140 | |
141 | 141 | $matomo_enabled = $params['matomo_enabled'] == 'yes'; |
142 | 142 | $this->setBlockSetting($block_id, 'matomo_enabled', $matomo_enabled ? 'yes' : 'no'); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | ->setBlockSetting($block_id, 'matomo_token', trim($params['matomo_token'])) |
160 | 160 | ->setBlockSetting($block_id, 'matomo_siteid', $params['matomo_siteid']); |
161 | 161 | |
162 | - Registry::cache()->file()->forget($this->name() . '-matomovisits-yearly-' . $block_id); |
|
162 | + Registry::cache()->file()->forget($this->name().'-matomovisits-yearly-'.$block_id); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | 'matomo_enabled' => $this->isMatomoEnabled($block_id), |
186 | 186 | 'matomo_url' => $this->getBlockSetting($block_id, 'matomo_url'), |
187 | 187 | 'matomo_token' => $this->getBlockSetting($block_id, 'matomo_token'), |
188 | - 'matomo_siteid' => (int) $this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
188 | + 'matomo_siteid' => (int)$this->getBlockSetting($block_id, 'matomo_siteid', '0') |
|
189 | 189 | ]; |
190 | 190 | } |
191 | 191 | } |
@@ -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 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | // How to update the database schema for this module |
56 | 56 | private const SCHEMA_TARGET_VERSION = 2; |
57 | 57 | private const SCHEMA_SETTING_NAME = 'MAJ_HOOKS_SCHEMA_VERSION'; |
58 | - private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__ . '\Schema'; |
|
58 | + private const SCHEMA_MIGRATION_PREFIX = __NAMESPACE__.'\Schema'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * {@inheritDoc} |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function loadRoutes(Map $router): void |
98 | 98 | { |
99 | - $router->attach('', '', static function (Map $router): void { |
|
99 | + $router->attach('', '', static function(Map $router): void { |
|
100 | 100 | |
101 | - $router->attach('', '/module-maj/hooks', static function (Map $router): void { |
|
101 | + $router->attach('', '/module-maj/hooks', static function(Map $router): void { |
|
102 | 102 | |
103 | - $router->attach('', '/config/admin', static function (Map $router): void { |
|
103 | + $router->attach('', '/config/admin', static function(Map $router): void { |
|
104 | 104 | |
105 | 105 | $router->get(AdminConfigPage::class, '', AdminConfigPage::class); |
106 | 106 | $router->get(ModulesHooksPage::class, '/{hook_name}', ModulesHooksPage::class); |
@@ -77,9 +77,9 @@ |
||
77 | 77 | */ |
78 | 78 | protected function updateHookOrder(HookCollectorInterface $hook_collector, ServerRequestInterface $request): void |
79 | 79 | { |
80 | - $params = (array) $request->getParsedBody(); |
|
80 | + $params = (array)$request->getParsedBody(); |
|
81 | 81 | |
82 | - $order = (array) ($params['order'] ?? []); |
|
82 | + $order = (array)($params['order'] ?? []); |
|
83 | 83 | $order = array_flip($order); |
84 | 84 | |
85 | 85 | foreach ($hook_collector->hooks() as $hook) { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | throw new HttpNotFoundException(I18N::translate('The attached module could not be found.')); |
59 | 59 | } |
60 | 60 | |
61 | - return $this->viewResponse($this->module->name() . '::admin/config', [ |
|
61 | + return $this->viewResponse($this->module->name().'::admin/config', [ |
|
62 | 62 | 'title' => $this->module->title(), |
63 | 63 | 'hook_interfaces_list' => $this->hook_service->all(true) |
64 | 64 | ]); |