@@ -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(); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | private function mapAdapterMapper(): Closure |
134 | 134 | { |
135 | - return function (stdClass $row): ?GeoAnalysisMapAdapter { |
|
135 | + return function(stdClass $row): ?GeoAnalysisMapAdapter { |
|
136 | 136 | if (null === $map = $this->mapdefinition_service->find($row->majgm_map_id)) { |
137 | 137 | return null; |
138 | 138 | } |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | return new GeoAnalysisMapAdapter( |
146 | - (int) $row->majgm_id, |
|
147 | - (int) $row->majgm_majgv_id, |
|
146 | + (int)$row->majgm_id, |
|
147 | + (int)$row->majgm_majgv_id, |
|
148 | 148 | $map, |
149 | 149 | app($row->majgm_mapper), |
150 | 150 | new MapViewConfig($row->majgm_feature_prop, $this->mapperConfigDecoder($row->majgm_config)) |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if ($cacheKey === null) { |
126 | 126 | return null; |
127 | 127 | } |
128 | - return Registry::cache()->array()->remember($cacheKey, function (): ?array { |
|
128 | + return Registry::cache()->array()->remember($cacheKey, function(): ?array { |
|
129 | 129 | $map_def = $this->data('map'); |
130 | 130 | if ( |
131 | 131 | !$this->setGeometryEngine() |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | if ($map_def === null || !($map_def instanceof MapDefinitionInterface)) { |
202 | 202 | return null; |
203 | 203 | } |
204 | - return spl_object_id($this) . '-map-' . $map_def->id(); |
|
204 | + return spl_object_id($this).'-map-'.$map_def->id(); |
|
205 | 205 | } |
206 | 206 | return $this->cache_key; |
207 | 207 | } |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function loadRoutes($router): void |
104 | 104 | { |
105 | - $router->attach('', '', static function (Map $router): void { |
|
105 | + $router->attach('', '', static function(Map $router): void { |
|
106 | 106 | |
107 | - $router->attach('', '/module-maj/certificates', static function (Map $router): void { |
|
107 | + $router->attach('', '/module-maj/certificates', static function(Map $router): void { |
|
108 | 108 | |
109 | - $router->attach('', '/admin', static function (Map $router): void { |
|
109 | + $router->attach('', '/admin', static function(Map $router): void { |
|
110 | 110 | |
111 | 111 | $router->get(AdminConfigPage::class, '/config{/tree}', AdminConfigPage::class); |
112 | 112 | $router->post(AdminConfigAction::class, '/config/{tree}', AdminConfigAction::class) |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'permission_preference' => 'MAJ_CERTIF_SHOW_CERT' |
130 | 130 | ]); |
131 | 131 | |
132 | - $router->attach('', '/certificate/{tree}/{cid}', static function (Map $router): void { |
|
132 | + $router->attach('', '/certificate/{tree}/{cid}', static function(Map $router): void { |
|
133 | 133 | |
134 | 134 | $router->extras([ |
135 | 135 | 'middleware' => [AuthTreePreference::class], |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function headContent(): string |
169 | 169 | { |
170 | - return '<link rel="stylesheet" href="' . e($this->moduleCssUrl()) . '">'; |
|
170 | + return '<link rel="stylesheet" href="'.e($this->moduleCssUrl()).'">'; |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function listUrl(Tree $tree, array $parameters = []): string |
178 | 178 | { |
179 | - return route(CertificatesList::class, ['tree' => $tree->name() ] + $parameters); |
|
179 | + return route(CertificatesList::class, ['tree' => $tree->name()] + $parameters); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function listIsEmpty(Tree $tree): bool |
196 | 196 | { |
197 | - return Auth::accessLevel($tree) > (int) $tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string) Auth::PRIV_HIDE); |
|
197 | + return Auth::accessLevel($tree) > (int)$tree->getPreference('MAJ_CERTIF_SHOW_CERT', (string)Auth::PRIV_HIDE); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $title = I18N::translate('Certificates'); |
81 | 81 | |
82 | - $cities = array_map(function (string $item): array { |
|
82 | + $cities = array_map(function(string $item): array { |
|
83 | 83 | return [$this->url_obfuscator_service->obfuscate($item), $item]; |
84 | 84 | }, $this->certif_filesystem->cities($tree)); |
85 | 85 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $certificates = $this->certif_filesystem->certificatesForCity($tree, $city); |
91 | 91 | } |
92 | 92 | |
93 | - return $this->viewResponse($this->module->name() . '::certificates-list', [ |
|
93 | + return $this->viewResponse($this->module->name().'::certificates-list', [ |
|
94 | 94 | 'title' => $title, |
95 | 95 | 'tree' => $tree, |
96 | 96 | 'module_name' => $this->module->name(), |
@@ -87,7 +87,7 @@ |
||
87 | 87 | throw new HttpAccessDeniedException(); |
88 | 88 | } |
89 | 89 | |
90 | - return $this->viewResponse($this->module->name() . '::admin/config', [ |
|
90 | + return $this->viewResponse($this->module->name().'::admin/config', [ |
|
91 | 91 | 'module_name' => $this->module->name(), |
92 | 92 | 'title' => $this->module->title(), |
93 | 93 | 'tree' => $tree, |
@@ -100,7 +100,7 @@ |
||
100 | 100 | return redirect(route(TreePage::class, ['tree' => $tree->name()])); |
101 | 101 | } |
102 | 102 | |
103 | - return $this->viewResponse($this->module->name() . '::certificate-page', [ |
|
103 | + return $this->viewResponse($this->module->name().'::certificate-page', [ |
|
104 | 104 | 'title' => I18N::translate('Certificate - %s', $certificate->name()), |
105 | 105 | 'tree' => $tree, |
106 | 106 | 'module_name' => $this->module->name(), |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $tree = $certificate->tree(); |
44 | 44 | return DB::table('individuals') |
45 | 45 | ->where('i_file', '=', $tree->id()) |
46 | - ->where('i_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%') |
|
46 | + ->where('i_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%') |
|
47 | 47 | ->select(['individuals.*']) |
48 | 48 | ->get() |
49 | 49 | ->map(Registry::individualFactory()->mapper($tree)) |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $tree = $certificate->tree(); |
65 | 65 | return DB::table('families') |
66 | 66 | ->where('f_file', '=', $tree->id()) |
67 | - ->where('f_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%') |
|
67 | + ->where('f_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%') |
|
68 | 68 | ->select(['families.*']) |
69 | 69 | ->get() |
70 | 70 | ->map(Registry::familyFactory()->mapper($tree)) |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $tree = $certificate->tree(); |
86 | 86 | return DB::table('media') |
87 | 87 | ->where('m_file', '=', $tree->id()) |
88 | - ->where('m_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%') |
|
88 | + ->where('m_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%') |
|
89 | 89 | ->select(['media.*']) |
90 | 90 | ->get() |
91 | 91 | ->map(Registry::mediaFactory()->mapper($tree)) |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | return DB::table('other') |
108 | 108 | ->where('o_file', '=', $tree->id()) |
109 | 109 | ->where('o_type', '=', 'NOTE') |
110 | - ->where('o_gedcom', 'like', '% _ACT ' . $this->escapedSqlPath($certificate) . '%') |
|
110 | + ->where('o_gedcom', 'like', '% _ACT '.$this->escapedSqlPath($certificate).'%') |
|
111 | 111 | ->select(['other.*']) |
112 | 112 | ->get() |
113 | 113 | ->map(Registry::noteFactory()->mapper($tree)) |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function oneLinkedSource(Certificate $certificate): ?Source |
136 | 136 | { |
137 | 137 | $regex_query = preg_quote($certificate->gedcomPath(), '/'); |
138 | - $regex_pattern = '/[1-9] SOUR @(' . Gedcom::REGEX_XREF . ')@(?:\n[2-9]\s(?:(?!SOUR)\w+)\s.*)*\n[2-9] _ACT ' . $regex_query . '/i'; //phpcs:ignore Generic.Files.LineLength.TooLong |
|
138 | + $regex_pattern = '/[1-9] SOUR @('.Gedcom::REGEX_XREF.')@(?:\n[2-9]\s(?:(?!SOUR)\w+)\s.*)*\n[2-9] _ACT '.$regex_query.'/i'; //phpcs:ignore Generic.Files.LineLength.TooLong |
|
139 | 139 | |
140 | 140 | foreach ($this->linkedRecordsLists($certificate) as $linked_records) { |
141 | 141 | foreach ($linked_records as $gedcom_record) { |
@@ -125,6 +125,6 @@ |
||
125 | 125 | */ |
126 | 126 | private function stringLengthEstimate(int $text_length, int $font_size): int |
127 | 127 | { |
128 | - return $text_length * (int) ceil(($font_size + 2) * 0.5); |
|
128 | + return $text_length * (int)ceil(($font_size + 2) * 0.5); |
|
129 | 129 | } |
130 | 130 | } |