@@ -113,11 +113,11 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function loadRoutes(Map $router): void |
115 | 115 | { |
116 | - $router->attach('', '', static function (Map $router): void { |
|
116 | + $router->attach('', '', static function(Map $router): void { |
|
117 | 117 | |
118 | - $router->attach('', '/module-maj/certificates', static function (Map $router): void { |
|
118 | + $router->attach('', '/module-maj/certificates', static function(Map $router): void { |
|
119 | 119 | |
120 | - $router->attach('', '/admin', static function (Map $router): void { |
|
120 | + $router->attach('', '/admin', static function(Map $router): void { |
|
121 | 121 | |
122 | 122 | $router->get(AdminConfigPage::class, '/config{/tree}', AdminConfigPage::class); |
123 | 123 | $router->post(AdminConfigAction::class, '/config/{tree}', AdminConfigAction::class) |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'permission_preference' => 'MAJ_CERTIF_SHOW_CERT' |
141 | 141 | ]); |
142 | 142 | |
143 | - $router->attach('', '/certificate/{tree}/{cid}', static function (Map $router): void { |
|
143 | + $router->attach('', '/certificate/{tree}/{cid}', static function(Map $router): void { |
|
144 | 144 | |
145 | 145 | $router->extras([ |
146 | 146 | 'middleware' => [AuthTreePreference::class], |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function headContent(): string |
180 | 180 | { |
181 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
181 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function listUrl(Tree $tree, array $parameters = []): string |
191 | 191 | { |
192 | - return route(CertificatesList::class, ['tree' => $tree->name() ] + $parameters); |
|
192 | + return route(CertificatesList::class, ['tree' => $tree->name()] + $parameters); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function listIsEmpty(Tree $tree): bool |
209 | 209 | { |
210 | - return Auth::accessLevel($tree) > (int) $tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string) Auth::PRIV_HIDE); |
|
210 | + return Auth::accessLevel($tree) > (int)$tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string)Auth::PRIV_HIDE); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | return parent::generate($prefix, $suffix); |
55 | 55 | } |
56 | 56 | |
57 | - $setting_name = 'MAJ_MISC_XREF_NEXT_' . $prefix; |
|
57 | + $setting_name = 'MAJ_MISC_XREF_NEXT_'.$prefix; |
|
58 | 58 | // Lock the row, so that only one new XREF may be generated at a time. |
59 | - $num = (int) DB::table('gedcom_setting') |
|
59 | + $num = (int)DB::table('gedcom_setting') |
|
60 | 60 | ->where('gedcom_id', '=', $tree->id()) |
61 | 61 | ->where('setting_name', '=', $setting_name) |
62 | 62 | ->lockForUpdate() |
@@ -64,13 +64,13 @@ discard block |
||
64 | 64 | |
65 | 65 | $increment = 1.0; |
66 | 66 | do { |
67 | - $num += (int) $increment; |
|
67 | + $num += (int)$increment; |
|
68 | 68 | |
69 | 69 | // This exponential increment allows us to scan over large blocks of |
70 | 70 | // existing data in a reasonable time. |
71 | 71 | $increment *= 1.01; |
72 | 72 | |
73 | - $xref = $prefix . $num . $suffix; |
|
73 | + $xref = $prefix.$num.$suffix; |
|
74 | 74 | |
75 | 75 | // Records may already exist with this sequence number. |
76 | 76 | $already_used = |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | DB::table('change')->where('gedcom_id', '=', $tree->id())->where('xref', '=', $xref)->exists(); |
83 | 83 | } while ($already_used); |
84 | 84 | |
85 | - $tree->setPreference($setting_name, (string) $num); |
|
85 | + $tree->setPreference($setting_name, (string)$num); |
|
86 | 86 | |
87 | 87 | return $xref; |
88 | 88 | } |
@@ -68,25 +68,25 @@ |
||
68 | 68 | $show_all = Validator::queryParams($request)->string('show_all', 'no') === 'yes'; |
69 | 69 | |
70 | 70 | if ($show_all) { |
71 | - $title = I18N::translate('Patronymic Lineages') . ' — ' . I18N::translate('All'); |
|
71 | + $title = I18N::translate('Patronymic Lineages').' — '.I18N::translate('All'); |
|
72 | 72 | $surnames = array_filter( |
73 | 73 | $all_surnames, |
74 | 74 | static fn (string $x): bool => $x !== '' && $x !== Individual::NOMEN_NESCIO, |
75 | 75 | ARRAY_FILTER_USE_KEY |
76 | 76 | ); |
77 | 77 | } elseif (array_key_exists($initial, $initials_list)) { |
78 | - $title = I18N::translate('Patronymic Lineages') . ' — ' . $initial; |
|
78 | + $title = I18N::translate('Patronymic Lineages').' — '.$initial; |
|
79 | 79 | $surnames = array_filter( |
80 | 80 | $all_surnames, |
81 | 81 | static fn (string $x): bool => I18N::language()->initialLetter($x) === $initial, |
82 | 82 | ARRAY_FILTER_USE_KEY |
83 | 83 | ); |
84 | 84 | } else { |
85 | - $title = I18N::translate('Patronymic Lineages'); |
|
85 | + $title = I18N::translate('Patronymic Lineages'); |
|
86 | 86 | $surnames = []; |
87 | 87 | } |
88 | 88 | |
89 | - return $this->viewResponse($this->module->name() . '::surnames-page', [ |
|
89 | + return $this->viewResponse($this->module->name().'::surnames-page', [ |
|
90 | 90 | 'title' => $title, |
91 | 91 | 'module' => $this->module, |
92 | 92 | 'tree' => $tree, |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | ->redirect(LineagesPage::class, ['tree' => $tree->name(), 'surname' => $surname]); |
69 | 69 | } |
70 | 70 | |
71 | - if ($surname === '' || $surname === Individual::NOMEN_NESCIO) { |
|
71 | + if ($surname === '' || $surname === Individual::NOMEN_NESCIO) { |
|
72 | 72 | return Registry::responseFactory()->redirect(SurnamesList::class, ['tree' => $tree->name()]); |
73 | 73 | } |
74 | 74 | |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | uasort($surname_variants, I18N::comparator()); |
87 | 87 | $surname_legend = implode('/', $surname_variants); |
88 | 88 | |
89 | - $title = I18N::translate('Patronymic Lineages') . ' — ' . $surname_legend; |
|
89 | + $title = I18N::translate('Patronymic Lineages').' — '.$surname_legend; |
|
90 | 90 | |
91 | 91 | $lineages = app()->make(LineageBuilder::class, ['surname' => $surname])->buildLineages(); |
92 | 92 | |
93 | - return $this->viewResponse($this->module->name() . '::lineages-page', [ |
|
93 | + return $this->viewResponse($this->module->name().'::lineages-page', [ |
|
94 | 94 | 'title' => $title, |
95 | 95 | 'module' => $this->module, |
96 | 96 | 'tree' => $tree, |
@@ -72,11 +72,11 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function loadRoutes(Map $router): void |
74 | 74 | { |
75 | - $router->attach('', '', static function (Map $router): void { |
|
75 | + $router->attach('', '', static function(Map $router): void { |
|
76 | 76 | |
77 | - $router->attach('', '/module-maj/lineages', static function (Map $router): void { |
|
77 | + $router->attach('', '/module-maj/lineages', static function(Map $router): void { |
|
78 | 78 | |
79 | - $router->attach('', '/Page', static function (Map $router): void { |
|
79 | + $router->attach('', '/Page', static function(Map $router): void { |
|
80 | 80 | |
81 | 81 | $router->get(SurnamesList::class, '/{tree}/list{/alpha}', SurnamesList::class); |
82 | 82 | $router->get(LineagesPage::class, '/{tree}/lineage/{surname}', LineagesPage::class); |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | |
110 | 110 | // If a surname is already in the query attribute, use it |
111 | 111 | if ($surname === null) { |
112 | - $surname_attr = Validator::attributes($request)->string('surname', ''); |
|
113 | - $surname_param = Validator::queryParams($request)->string('surname', ''); |
|
114 | - $surname_body = Validator::parsedBody($request)->string('surname', ''); |
|
112 | + $surname_attr = Validator::attributes($request)->string('surname', ''); |
|
113 | + $surname_param = Validator::queryParams($request)->string('surname', ''); |
|
114 | + $surname_body = Validator::parsedBody($request)->string('surname', ''); |
|
115 | 115 | $surname = $surname_attr !== '' ? $surname_attr : ( |
116 | 116 | $surname_param !== '' ? $surname_param : ( |
117 | 117 | $surname_body !== '' ? $surname_body : null |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'surname' => $surname |
135 | 135 | ] + $parameters); |
136 | 136 | } |
137 | - return route(SurnamesList::class, ['tree' => $tree->name() ] + $parameters); |
|
137 | + return route(SurnamesList::class, ['tree' => $tree->name()] + $parameters); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | */ |
153 | 153 | public function headContent(): string |
154 | 154 | { |
155 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
155 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if ($cacheKey === null) { |
140 | 140 | return null; |
141 | 141 | } |
142 | - return Registry::cache()->array()->remember($cacheKey, function (): ?array { |
|
142 | + return Registry::cache()->array()->remember($cacheKey, function(): ?array { |
|
143 | 143 | $map_def = $this->data('map'); |
144 | 144 | if ( |
145 | 145 | !$this->setGeometryEngine() |
@@ -214,6 +214,6 @@ discard block |
||
214 | 214 | if ($map_def === null || !($map_def instanceof MapDefinitionInterface)) { |
215 | 215 | return null; |
216 | 216 | } |
217 | - return spl_object_id($this) . '-map-' . $map_def->id(); |
|
217 | + return spl_object_id($this).'-map-'.$map_def->id(); |
|
218 | 218 | } |
219 | 219 | } |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | if ($source_parts === false) { |
50 | 50 | return null; |
51 | 51 | } |
52 | - $source_parts = array_map(function (string $part): string { |
|
52 | + $source_parts = array_map(function(string $part): string { |
|
53 | 53 | if (preg_match('/^#([^#]+)#$/i', $part, $column_id) === 1) { |
54 | 54 | return $this->columnName($column_id[1]); |
55 | 55 | } |
56 | 56 | return $this->sanitizeString(str_replace(['?', '*'], ['_', '%'], $part)); |
57 | 57 | }, array_filter($source_parts)); |
58 | 58 | $source_parts[] = "'%'"; |
59 | - $concat_statement = 'CONCAT(' . implode(', ', $source_parts) . ')'; |
|
59 | + $concat_statement = 'CONCAT('.implode(', ', $source_parts).')'; |
|
60 | 60 | |
61 | 61 | // Extract columns used in target |
62 | 62 | $columns = []; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | // Get the mapping |
68 | 68 | $rows = DB::table('maj_geodata_ref') //DB::table('maj_geodata_ref') |
69 | 69 | ->select($columns) |
70 | - ->whereRaw($this->sanitizeString($source) . " LIKE " . $concat_statement) |
|
70 | + ->whereRaw($this->sanitizeString($source)." LIKE ".$concat_statement) |
|
71 | 71 | ->get(); |
72 | 72 | |
73 | 73 | // Format the output ID |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | return null; |
76 | 76 | } |
77 | 77 | |
78 | - $mapping = (array) $rows->first(); |
|
78 | + $mapping = (array)$rows->first(); |
|
79 | 79 | |
80 | 80 | return str_replace( |
81 | - array_map(fn($tag) => '{' . $tag . '}', $columns_select[1]), |
|
81 | + array_map(fn($tag) => '{'.$tag.'}', $columns_select[1]), |
|
82 | 82 | array_map(fn($tag) => $mapping[$this->columnName($tag)] ?? '', $columns_select[1]), |
83 | 83 | $target_format |
84 | 84 | ); |
@@ -74,14 +74,14 @@ |
||
74 | 74 | |
75 | 75 | return $query_individuals->unionAll($query_families) |
76 | 76 | ->get()->pluck('g_gedcom') |
77 | - ->flatMap(static function (string $gedcom): array { |
|
77 | + ->flatMap(static function(string $gedcom): array { |
|
78 | 78 | preg_match_all('/\n2 PLAC (.+)/', $gedcom, $matches); |
79 | 79 | return $matches[1]; |
80 | 80 | }) |
81 | 81 | ->sort(I18N::comparator())->reverse() |
82 | - ->mapWithKeys(static function (string $place): array { |
|
82 | + ->mapWithKeys(static function(string $place): array { |
|
83 | 83 | $place_array = array_reverse(array_filter(array_map('trim', explode(",", $place)))); |
84 | - return [ count($place_array) => $place_array ]; |
|
84 | + return [count($place_array) => $place_array]; |
|
85 | 85 | }) |
86 | 86 | ->sortKeys() |
87 | 87 | ->last() ?? []; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function boot(): void |
35 | 35 | { |
36 | - View::registerNamespace($this->name(), $this->resourcesFolder() . 'views/'); |
|
36 | + View::registerNamespace($this->name(), $this->resourcesFolder().'views/'); |
|
37 | 37 | |
38 | 38 | $this->loadRoutes(Registry::routeFactory()->routeMap()); |
39 | 39 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function resourcesFolder(): string |
45 | 45 | { |
46 | - return Webtrees::MODULES_DIR . trim($this->name(), '_') . '/resources/'; |
|
46 | + return Webtrees::MODULES_DIR.trim($this->name(), '_').'/resources/'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function customTranslations(string $language): array |
71 | 71 | { |
72 | - $translation_file = $this->resourcesFolder() . 'lang/' . $language . '/messages.php'; |
|
72 | + $translation_file = $this->resourcesFolder().'lang/'.$language.'/messages.php'; |
|
73 | 73 | |
74 | 74 | try { |
75 | 75 | $translation = new Translation($translation_file); |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | { |
97 | 97 | /** @var ModuleThemeInterface $theme */ |
98 | 98 | $theme = app(ModuleThemeInterface::class); |
99 | - $css_file = $this->resourcesFolder() . 'css/' . $theme->name() . '.min.css'; |
|
99 | + $css_file = $this->resourcesFolder().'css/'.$theme->name().'.min.css'; |
|
100 | 100 | |
101 | 101 | if (file_exists($css_file)) { |
102 | - return $this->assetUrl('css/' . $theme->name() . '.min.css'); |
|
102 | + return $this->assetUrl('css/'.$theme->name().'.min.css'); |
|
103 | 103 | } else { |
104 | 104 | return $this->assetUrl('css/default.min.css'); |
105 | 105 | } |