@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | if ($library) { |
76 | 76 | $feedMeta['copyright'] = $library->getLabel(); |
77 | 77 | } else { |
78 | - $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"'); |
|
78 | + $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"'); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | if ( |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | ) { |
96 | 96 | $superiorTitle = AbstractDocument::getTitle($document->getPartof(), true); |
97 | 97 | if (!empty($superiorTitle)) { |
98 | - $title .= '[' . $superiorTitle . ']'; |
|
98 | + $title .= '['.$superiorTitle.']'; |
|
99 | 99 | } |
100 | 100 | } |
101 | 101 | // Get title of document. |
102 | 102 | if (!empty($document->getTitle())) { |
103 | - $title .= ' ' . $document->getTitle(); |
|
103 | + $title .= ' '.$document->getTitle(); |
|
104 | 104 | } |
105 | 105 | // Set default title if empty. |
106 | 106 | if (empty($title)) { |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | } |
109 | 109 | // Append volume information. |
110 | 110 | if (!empty($document->getVolume())) { |
111 | - $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume(); |
|
111 | + $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume(); |
|
112 | 112 | } |
113 | 113 | // Is this document new or updated? |
114 | 114 | if ($document->getCrdate() == $document->getTstamp()) { |
115 | - $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title); |
|
115 | + $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title); |
|
116 | 116 | } else { |
117 | - $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title); |
|
117 | + $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | $document->setTitle($title); |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | $this->view->assign('calendarData', $calendarData); |
135 | 135 | $this->view->assign('documentId', $this->document->getUid()); |
136 | 136 | $this->view->assign('yearLinkTitle', $yearLinkTitle); |
137 | - $this->view->assign('parentDocumentId', $this->document->getPartof() ?: $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
138 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
137 | + $this->view->assign('parentDocumentId', $this->document->getPartof() ? : $this->document->getCurrentDocument()->tableOfContents[0]['points']); |
|
138 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle($this->document->getPartof()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | } |
221 | 221 | |
222 | 222 | $this->view->assign('documentId', $this->document->getUid()); |
223 | - $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ?: $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
223 | + $this->view->assign('allYearDocTitle', $this->document->getCurrentDocument()->getTitle((int) $this->document->getUid()) ? : $this->document->getCurrentDocument()->tableOfContents[0]['label']); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | protected function getCalendarYear(array &$calendarData, array $calendarIssuesByMonth, int $year, int $firstMonth = 1, int $lastMonth = 12): void |
240 | 240 | { |
241 | 241 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
242 | - $key = $year . '-' . $i; |
|
242 | + $key = $year.'-'.$i; |
|
243 | 243 | |
244 | 244 | $calendarData[$key] = [ |
245 | 245 | 'DAYMON_NAME' => strftime('%a', strtotime('last Monday')), |
@@ -249,16 +249,16 @@ discard block |
||
249 | 249 | 'DAYFRI_NAME' => strftime('%a', strtotime('last Friday')), |
250 | 250 | 'DAYSAT_NAME' => strftime('%a', strtotime('last Saturday')), |
251 | 251 | 'DAYSUN_NAME' => strftime('%a', strtotime('last Sunday')), |
252 | - 'MONTHNAME' => strftime('%B', strtotime($year . '-' . $i . '-1')) . ' ' . $year, |
|
252 | + 'MONTHNAME' => strftime('%B', strtotime($year.'-'.$i.'-1')).' '.$year, |
|
253 | 253 | 'CALYEAR' => ($i == $firstMonth) ? $year : '' |
254 | 254 | ]; |
255 | 255 | |
256 | - $firstOfMonth = strtotime($year . '-' . $i . '-1'); |
|
256 | + $firstOfMonth = strtotime($year.'-'.$i.'-1'); |
|
257 | 257 | $lastOfMonth = strtotime('last day of', ($firstOfMonth)); |
258 | 258 | $firstOfMonthStart = strtotime('last Monday', $firstOfMonth); |
259 | 259 | // There are never more than 6 weeks in a month. |
260 | 260 | for ($j = 0; $j <= 5; $j++) { |
261 | - $firstDayOfWeek = strtotime('+ ' . $j . ' Week', $firstOfMonthStart); |
|
261 | + $firstDayOfWeek = strtotime('+ '.$j.' Week', $firstOfMonthStart); |
|
262 | 262 | |
263 | 263 | $calendarData[$key]['week'][$j] = [ |
264 | 264 | 'DAYMON' => ['dayValue' => ' '], |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | ]; |
272 | 272 | // Every week has seven days. ;-) |
273 | 273 | for ($k = 0; $k <= 6; $k++) { |
274 | - $currentDayTime = strtotime('+ ' . $k . ' Day', $firstDayOfWeek); |
|
274 | + $currentDayTime = strtotime('+ '.$k.' Day', $firstDayOfWeek); |
|
275 | 275 | if ( |
276 | 276 | $currentDayTime >= $firstOfMonth |
277 | 277 | && $currentDayTime <= $lastOfMonth |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | private function fillCalendar(array &$calendarData, int $currentDayTime, string $dayLinks, array $dayLinkDiv, int $firstDayOfWeek, int $k): void |
344 | 344 | { |
345 | - switch (strftime('%w', strtotime('+ ' . $k . ' Day', $firstDayOfWeek))) { |
|
345 | + switch (strftime('%w', strtotime('+ '.$k.' Day', $firstDayOfWeek))) { |
|
346 | 346 | case '0': |
347 | 347 | $this->fillDay($calendarData, $currentDayTime, 'DAYSUN', $dayLinks, $dayLinkDiv); |
348 | 348 | break; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $_day = date('j', $dateTimestamp); |
447 | 447 | $issuesByYear[$_year][$_month][$_day][] = $issue; |
448 | 448 | } else { |
449 | - $this->logger->warning('Document with UID ' . $issue['uid'] . 'has no valid date of publication'); |
|
449 | + $this->logger->warning('Document with UID '.$issue['uid'].'has no valid date of publication'); |
|
450 | 450 | } |
451 | 451 | } |
452 | 452 | // Sort by years. |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | foreach ($year['children'] as $month) { |
490 | 490 | foreach ($month['children'] as $day) { |
491 | 491 | foreach ($day['children'] as $issue) { |
492 | - $title = $issue['label'] ?: $issue['orderlabel']; |
|
492 | + $title = $issue['label'] ? : $issue['orderlabel']; |
|
493 | 493 | if (strtotime($title) !== false) { |
494 | 494 | $title = strftime('%x', strtotime($title)); |
495 | 495 | } |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $metadata['video_duration'] = [$videoDuration]; |
54 | 54 | } |
55 | 55 | |
56 | - $metadata['duration'] = $metadata['video_duration'] ?: $metadata['audio_duration'] ?: []; |
|
56 | + $metadata['duration'] = $metadata['video_duration'] ? : $metadata['audio_duration'] ? : []; |
|
57 | 57 | |
58 | 58 | if ($useExternalApis) { |
59 | 59 | // TODO? |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | } |
124 | 124 | return ' '; |
125 | 125 | } |
126 | - return htmlspecialchars((string) $attributes['CONTENT']) . ' '; |
|
126 | + return htmlspecialchars((string) $attributes['CONTENT']).' '; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | private function getCoordinates(\SimpleXMLElement $attributes): string |
139 | 139 | { |
140 | - return (string) $attributes['HPOS'] . ' ' . (string) $attributes['VPOS'] . ' ' . (string) $attributes['WIDTH'] . ' ' . (string) $attributes['HEIGHT']; |
|
140 | + return (string) $attributes['HPOS'].' '.(string) $attributes['VPOS'].' '.(string) $attributes['WIDTH'].' '.(string) $attributes['HEIGHT']; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function __construct(string $viaf, RequestFactory $requestFactory) |
66 | 66 | { |
67 | 67 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | - $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
|
68 | + $this->viafUrl = 'http://viaf.org/viaf/'.$viaf; |
|
69 | 69 | $this->requestFactory = $requestFactory; |
70 | 70 | } |
71 | 71 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | try { |
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
98 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | **/ |
111 | 111 | private function getApiEndpoint(): string |
112 | 112 | { |
113 | - return $this->viafUrl . '/' . $this->endpoint; |
|
113 | + return $this->viafUrl.'/'.$this->endpoint; |
|
114 | 114 | } |
115 | 115 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | try { |
112 | 112 | $response = $this->requestFactory->request($url); |
113 | 113 | } catch (\Exception $e) { |
114 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
114 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | return $response->getBody()->getContents(); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | **/ |
127 | 127 | private function getApiEndpoint(): string |
128 | 128 | { |
129 | - $url = 'https://' . $this->level . '.' . self::HOSTNAME; |
|
130 | - $url .= '/v' . self::VERSION . '/'; |
|
129 | + $url = 'https://'.$this->level.'.'.self::HOSTNAME; |
|
130 | + $url .= '/v'.self::VERSION.'/'; |
|
131 | 131 | $url .= $this->orcid; |
132 | - $url .= '/' . $this->endpoint; |
|
132 | + $url .= '/'.$this->endpoint; |
|
133 | 133 | return $url; |
134 | 134 | } |
135 | 135 | } |
@@ -653,16 +653,16 @@ discard block |
||
653 | 653 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
654 | 654 | $values = $iiifResource->jsonPath($resArray['xpath_sorting']); |
655 | 655 | if (is_string($values)) { |
656 | - $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)]; |
|
656 | + $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)]; |
|
657 | 657 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) { |
658 | 658 | $metadata[$resArray['index_name']] = []; |
659 | 659 | foreach ($values->data() as $value) { |
660 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value); |
|
660 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value); |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | } |
664 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
665 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
664 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
665 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
666 | 666 | } |
667 | 667 | } |
668 | 668 | } |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | } |
773 | 773 | } |
774 | 774 | } else { |
775 | - $this->logger->warning('Invalid structure resource @id "' . $id . '"'); |
|
775 | + $this->logger->warning('Invalid structure resource @id "'.$id.'"'); |
|
776 | 776 | return $rawText; |
777 | 777 | } |
778 | 778 | $this->rawTextArray[$id] = $rawText; |
@@ -817,7 +817,7 @@ discard block |
||
817 | 817 | return true; |
818 | 818 | } |
819 | 819 | } |
820 | - $this->logger->error('Could not load IIIF manifest from "' . $location . '"'); |
|
820 | + $this->logger->error('Could not load IIIF manifest from "'.$location.'"'); |
|
821 | 821 | return false; |
822 | 822 | } |
823 | 823 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $this->xEndPosition = $highlight['lrx']; |
88 | 88 | $this->yBeginPosition = $highlight['uly']; |
89 | 89 | $this->yEndPosition = $highlight['lry']; |
90 | - $this->id = $this->xBeginPosition . '_' . $this->yBeginPosition; |
|
90 | + $this->id = $this->xBeginPosition.'_'.$this->yBeginPosition; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | // Get next available core name if none given. |
129 | 129 | if (empty($core)) { |
130 | - $core = 'dlfCore' . self::getNextCoreNumber(); |
|
130 | + $core = 'dlfCore'.self::getNextCoreNumber(); |
|
131 | 131 | } |
132 | 132 | // Get Solr service instance. |
133 | 133 | $solr = self::getInstance($core); |
@@ -217,13 +217,13 @@ discard block |
||
217 | 217 | ->execute(); |
218 | 218 | |
219 | 219 | while ($resArray = $result->fetchAssociative()) { |
220 | - $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i'; |
|
220 | + $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i'; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | // Check if queried field is valid. |
224 | 224 | $splitQuery = explode(':', $query, 2); |
225 | 225 | if (in_array($splitQuery[0], $fields)) { |
226 | - $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')'; |
|
226 | + $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')'; |
|
227 | 227 | } else { |
228 | 228 | $query = self::escapeQuery($query); |
229 | 229 | } |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | $number = max($number, 0); |
332 | 332 | // Check if core already exists. |
333 | - $solr = self::getInstance('dlfCore' . $number); |
|
333 | + $solr = self::getInstance('dlfCore'.$number); |
|
334 | 334 | if (!$solr->ready) { |
335 | 335 | return $number; |
336 | 336 | } else { |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $parameters['start'] = 0; |
389 | 389 | $parameters['rows'] = $this->limit; |
390 | 390 | // Calculate cache identifier. |
391 | - $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true)); |
|
391 | + $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true)); |
|
392 | 392 | $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr'); |
393 | 393 | $resultSet = []; |
394 | 394 | $entry = $cache->get($cacheIdentifier); |
@@ -520,12 +520,12 @@ discard block |
||
520 | 520 | */ |
521 | 521 | public function __get(string $var) |
522 | 522 | { |
523 | - $method = 'magicGet' . ucfirst($var); |
|
523 | + $method = 'magicGet'.ucfirst($var); |
|
524 | 524 | if ( |
525 | 525 | !property_exists($this, $var) |
526 | 526 | || !method_exists($this, $method) |
527 | 527 | ) { |
528 | - $this->logger->warning('There is no getter function for property "' . $var . '"'); |
|
528 | + $this->logger->warning('There is no getter function for property "'.$var.'"'); |
|
529 | 529 | return null; |
530 | 530 | } else { |
531 | 531 | return $this->$method(); |
@@ -558,12 +558,12 @@ discard block |
||
558 | 558 | */ |
559 | 559 | public function __set(string $var, $value): void |
560 | 560 | { |
561 | - $method = 'magicSet' . ucfirst($var); |
|
561 | + $method = 'magicSet'.ucfirst($var); |
|
562 | 562 | if ( |
563 | 563 | !property_exists($this, $var) |
564 | 564 | || !method_exists($this, $method) |
565 | 565 | ) { |
566 | - $this->logger->warning('There is no setter function for property "' . $var . '"'); |
|
566 | + $this->logger->warning('There is no setter function for property "'.$var.'"'); |
|
567 | 567 | } else { |
568 | 568 | $this->$method($value); |
569 | 569 | } |
@@ -603,7 +603,7 @@ discard block |
||
603 | 603 | 'scheme' => $this->config['scheme'], |
604 | 604 | 'host' => $this->config['host'], |
605 | 605 | 'port' => $this->config['port'], |
606 | - 'path' => '/' . $this->config['path'], |
|
606 | + 'path' => '/'.$this->config['path'], |
|
607 | 607 | 'core' => $core, |
608 | 608 | 'username' => $this->config['username'], |
609 | 609 | 'password' => $this->config['password'] |