We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -60,7 +60,8 @@ discard block |
||
60 | 60 | * |
61 | 61 | * @return void |
62 | 62 | */ |
63 | - private function renderTool() { |
|
63 | + private function renderTool() |
|
64 | + { |
|
64 | 65 | if (!empty($this->settings['tool'])) { |
65 | 66 | switch ($this->settings['tool']) { |
66 | 67 | case 'tx_dlf_annotationtool': |
@@ -97,7 +98,8 @@ discard block |
||
97 | 98 | * |
98 | 99 | * @return void |
99 | 100 | */ |
100 | - private function renderToolByName(string $tool) { |
|
101 | + private function renderToolByName(string $tool) |
|
102 | + { |
|
101 | 103 | $this->$tool(); |
102 | 104 | $this->view->assign($tool, true); |
103 | 105 | } |
@@ -185,7 +185,8 @@ discard block |
||
185 | 185 | * |
186 | 186 | * @return void |
187 | 187 | */ |
188 | - protected function configureProxyUrl(&$url) { |
|
188 | + protected function configureProxyUrl(&$url) |
|
189 | + { |
|
189 | 190 | $this->uriBuilder->reset() |
190 | 191 | ->setTargetPageUid($GLOBALS['TSFE']->id) |
191 | 192 | ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl'])) |
@@ -282,7 +283,8 @@ discard block |
||
282 | 283 | * |
283 | 284 | * @return void |
284 | 285 | */ |
285 | - protected function setPage() { |
|
286 | + protected function setPage() |
|
287 | + { |
|
286 | 288 | if (!empty($this->requestData['logicalPage'])) { |
287 | 289 | $this->requestData['page'] = $this->document->getDoc()->getPhysicalPage($this->requestData['logicalPage']); |
288 | 290 | // The logical page parameter should not appear again |
@@ -299,7 +301,8 @@ discard block |
||
299 | 301 | * |
300 | 302 | * @return void |
301 | 303 | */ |
302 | - protected function setDefaultPage() { |
|
304 | + protected function setDefaultPage() |
|
305 | + { |
|
303 | 306 | // Set default values if not set. |
304 | 307 | // $this->requestData['page'] may be integer or string (physical structure @ID) |
305 | 308 | if ( |
@@ -269,7 +269,7 @@ |
||
269 | 269 | * @return void |
270 | 270 | */ |
271 | 271 | private function sortMenuForNewspapers(&$menu) { |
272 | - usort($menu[0]['_SUB_MENU'], function ($firstYear, $secondYear) { |
|
272 | + usort($menu[0]['_SUB_MENU'], function($firstYear, $secondYear) { |
|
273 | 273 | return $firstYear['orderlabel'] <=> $secondYear['orderlabel']; |
274 | 274 | }); |
275 | 275 | } |
@@ -245,7 +245,8 @@ discard block |
||
245 | 245 | * @param array $type |
246 | 246 | * @return string |
247 | 247 | */ |
248 | - private function getTranslatedType($type) { |
|
248 | + private function getTranslatedType($type) |
|
249 | + { |
|
249 | 250 | return Helper::translate($type, 'tx_dlf_structures', $this->settings['storagePid']); |
250 | 251 | } |
251 | 252 | |
@@ -256,7 +257,8 @@ discard block |
||
256 | 257 | * @param array &$menu |
257 | 258 | * @return void |
258 | 259 | */ |
259 | - private function sortMenu(&$menu) { |
|
260 | + private function sortMenu(&$menu) |
|
261 | + { |
|
260 | 262 | if ($menu[0]['type'] == $this->getTranslatedType("newspaper")) { |
261 | 263 | $this->sortMenuForNewspapers($menu); |
262 | 264 | } |
@@ -268,8 +270,10 @@ discard block |
||
268 | 270 | * @param array &$menu |
269 | 271 | * @return void |
270 | 272 | */ |
271 | - private function sortMenuForNewspapers(&$menu) { |
|
272 | - usort($menu[0]['_SUB_MENU'], function ($firstYear, $secondYear) { |
|
273 | + private function sortMenuForNewspapers(&$menu) |
|
274 | + { |
|
275 | + usort($menu[0]['_SUB_MENU'], function ($firstYear, $secondYear) |
|
276 | + { |
|
273 | 277 | return $firstYear['orderlabel'] <=> $secondYear['orderlabel']; |
274 | 278 | }); |
275 | 279 | } |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']); |
338 | 338 | $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']); |
339 | 339 | // verify date formatting |
340 | - if(strtotime($metadata['date'][0])) { |
|
340 | + if (strtotime($metadata['date'][0])) { |
|
341 | 341 | // do not alter dates YYYY or YYYY-MM or YYYY-MM-DD |
342 | 342 | if ( |
343 | 343 | preg_match("/^[\d]{4}$/", $metadata['date'][0]) |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | ) { |
347 | 347 | $solrDoc->setField('date', $metadata['date'][0]); |
348 | 348 | // change date YYYYMMDD to YYYY-MM-DD |
349 | - } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])){ |
|
349 | + } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])) { |
|
350 | 350 | $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0]))); |
351 | 351 | // convert any datetime to proper ISO extended datetime format and timezone for SOLR |
352 | 352 | } elseif (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}T.*$/", $metadata['date'][0])) { |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | !empty($data) |
484 | 484 | && substr($index_name, -8) == '_sorting' |
485 | 485 | ) { |
486 | - $solrDoc->setField($index_name , $doc->metadataArray[$doc->toplevelId][$index_name]); |
|
486 | + $solrDoc->setField($index_name, $doc->metadataArray[$doc->toplevelId][$index_name]); |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | ) { |
347 | 347 | $solrDoc->setField('date', $metadata['date'][0]); |
348 | 348 | // change date YYYYMMDD to YYYY-MM-DD |
349 | - } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])){ |
|
349 | + } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])) { |
|
350 | 350 | $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0]))); |
351 | 351 | // convert any datetime to proper ISO extended datetime format and timezone for SOLR |
352 | 352 | } elseif (preg_match("/^[0-9]{4}-[0-9]{2}-[0-9]{2}T.*$/", $metadata['date'][0])) { |
@@ -555,7 +555,8 @@ discard block |
||
555 | 555 | * |
556 | 556 | * @return \Solarium\Core\Query\DocumentInterface |
557 | 557 | */ |
558 | - private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') { |
|
558 | + private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') |
|
559 | + { |
|
559 | 560 | $solrDoc = $updateQuery->createDocument(); |
560 | 561 | // Create unique identifier from document's UID and unit's XML ID. |
561 | 562 | $solrDoc->setField('id', $document->getUid() . $unit['id']); |
@@ -579,7 +580,8 @@ discard block |
||
579 | 580 | * |
580 | 581 | * @return array|string |
581 | 582 | */ |
582 | - private static function removeAppendsFromAuthor($authors) { |
|
583 | + private static function removeAppendsFromAuthor($authors) |
|
584 | + { |
|
583 | 585 | if (is_array($authors)) { |
584 | 586 | foreach ($authors as $i => $author) { |
585 | 587 | $splitName = explode(chr(31), $author); |
@@ -898,7 +898,8 @@ |
||
898 | 898 | * |
899 | 899 | * @return array |
900 | 900 | */ |
901 | - protected function initializeMetadata($format) { |
|
901 | + protected function initializeMetadata($format) |
|
902 | + { |
|
902 | 903 | return [ |
903 | 904 | 'title' => [], |
904 | 905 | 'title_sorting' => [], |
@@ -365,8 +365,8 @@ |
||
365 | 365 | $searchResult['snippet'] = $doc['snippet']; |
366 | 366 | $searchResult['highlight'] = $doc['highlight']; |
367 | 367 | $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
368 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
369 | - preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
|
368 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
369 | + preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
|
370 | 370 | } |
371 | 371 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
372 | 372 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | // Add filter query for date search |
213 | 213 | if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) { |
214 | 214 | // combine dateFrom and dateTo into range search |
215 | - $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
215 | + $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']'; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | // Add filter query for faceting. |
@@ -243,16 +243,16 @@ discard block |
||
243 | 243 | $virtualCollectionsQueryString = ''; |
244 | 244 | foreach ($this->collection as $collectionEntry) { |
245 | 245 | // check for virtual collections query string |
246 | - if($collectionEntry->getIndexSearch()) { |
|
247 | - $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ; |
|
246 | + if ($collectionEntry->getIndexSearch()) { |
|
247 | + $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR (' . $collectionEntry->getIndexSearch() . ')'; |
|
248 | 248 | } else { |
249 | 249 | $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"'; |
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | 253 | // distinguish between simple collection browsing and actual searching within the collection(s) |
254 | - if(!empty($collectionsQueryString)) { |
|
255 | - if(empty($query)) { |
|
254 | + if (!empty($collectionsQueryString)) { |
|
255 | + if (empty($query)) { |
|
256 | 256 | $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)'; |
257 | 257 | } else { |
258 | 258 | $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))'; |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | } |
261 | 261 | |
262 | 262 | // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separatly |
263 | - if(!empty($virtualCollectionsQueryString)) { |
|
263 | + if (!empty($virtualCollectionsQueryString)) { |
|
264 | 264 | $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')'; |
265 | 265 | } |
266 | 266 | |
@@ -339,8 +339,8 @@ discard block |
||
339 | 339 | } |
340 | 340 | if ($documents[$doc['uid']]) { |
341 | 341 | // translate language code if applicable |
342 | - if($doc['metadata']['language']) { |
|
343 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
342 | + if ($doc['metadata']['language']) { |
|
343 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
344 | 344 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]); |
345 | 345 | } |
346 | 346 | } |
@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | if ($this->searchParams['fulltext'] == '1') { |
365 | 365 | $searchResult['snippet'] = $doc['snippet']; |
366 | 366 | $searchResult['highlight'] = $doc['highlight']; |
367 | - $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
368 | - preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
367 | + $searchResult['highlight_word'] = preg_replace('/^;|;$/', '', // remove ; at beginning or end |
|
368 | + preg_replace('/;+/', ';', // replace any multiple of ; with a single ; |
|
369 | 369 | preg_replace('/[{~\d*}{\s+}{^=*\d+.*\d*}`~!@#$%\^&*()_|+-=?;:\'",.<>\{\}\[\]\\\]/', ';', $this->searchParams['query']))); // replace search operators and special characters with ; |
370 | 370 | } |
371 | 371 | $documents[$doc['uid']]['searchResults'][] = $searchResult; |
@@ -442,8 +442,8 @@ discard block |
||
442 | 442 | |
443 | 443 | foreach ($result['documents'] as $doc) { |
444 | 444 | // translate language code if applicable |
445 | - if($doc['metadata']['language']) { |
|
446 | - foreach($doc['metadata']['language'] as $indexName => $language) { |
|
445 | + if ($doc['metadata']['language']) { |
|
446 | + foreach ($doc['metadata']['language'] as $indexName => $language) { |
|
447 | 447 | $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]); |
448 | 448 | } |
449 | 449 | } |
@@ -102,7 +102,7 @@ |
||
102 | 102 | $listRequestData = GeneralUtility::_GPmerged('tx_dlf_listview'); |
103 | 103 | |
104 | 104 | if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) { |
105 | - $this->searchParams = array_merge($this->searchParams ?: [], $listRequestData['searchParameter']); |
|
105 | + $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']); |
|
106 | 106 | $listViewSearch = true; |
107 | 107 | $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams); |
108 | 108 | } |
@@ -358,7 +358,8 @@ discard block |
||
358 | 358 | * |
359 | 359 | * @return string The collection query string |
360 | 360 | */ |
361 | - private function addCollectionsQuery($query) { |
|
361 | + private function addCollectionsQuery($query) |
|
362 | + { |
|
362 | 363 | // if collections are given, we prepare the collections query string |
363 | 364 | // extract collections from collection parameter |
364 | 365 | $collections = null; |
@@ -453,7 +454,8 @@ discard block |
||
453 | 454 | * |
454 | 455 | * @return array menu array |
455 | 456 | */ |
456 | - private function processResults($facet, $facetCollectionArray, $search) { |
|
457 | + private function processResults($facet, $facetCollectionArray, $search) |
|
458 | + { |
|
457 | 459 | $menuArray = []; |
458 | 460 | |
459 | 461 | if ($facet) { |