Passed
Pull Request — master (#70)
by Alexander
03:07
created
Classes/Common/Solr.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     {
135 135
         // Get next available core name if none given.
136 136
         if (empty($core)) {
137
-            $core = 'dlfCore' . self::getNextCoreNumber();
137
+            $core = 'dlfCore'.self::getNextCoreNumber();
138 138
         }
139 139
         // Get Solr service instance.
140 140
         $solr = self::getInstance($core);
@@ -230,13 +230,13 @@  discard block
 block discarded – undo
230 230
                 ->execute();
231 231
 
232 232
             while ($resArray = $result->fetch()) {
233
-                $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i';
233
+                $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i';
234 234
             }
235 235
 
236 236
             // Check if queried field is valid.
237 237
             $splitQuery = explode(':', $query, 2);
238 238
             if (in_array($splitQuery[0], $fields)) {
239
-                $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')';
239
+                $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')';
240 240
             } else {
241 241
                 $query = self::escapeQuery($query);
242 242
             }
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
     {
303 303
         $number = max(intval($number), 0);
304 304
         // Check if core already exists.
305
-        $solr = self::getInstance('dlfCore' . $number);
305
+        $solr = self::getInstance('dlfCore'.$number);
306 306
         if (!$solr->ready) {
307 307
             return $number;
308 308
         } else {
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
                 $config['path'] .= 'solr/';
344 344
             }
345 345
             // Set connection timeout lower than PHP's max_execution_time.
346
-            $max_execution_time = intval(ini_get('max_execution_time')) ?: 30;
346
+            $max_execution_time = intval(ini_get('max_execution_time')) ? : 30;
347 347
             $config['timeout'] = MathUtility::forceIntegerInRange($conf['solrTimeout'], 1, $max_execution_time, 10);
348 348
             $this->config = $config;
349 349
         }
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
         // Set filter query to just get toplevel documents.
378 378
         $params['filterquery'][] = ['query' => 'toplevel:true'];
379 379
         // Set join query to get all documents with the same uids.
380
-        $params['query'] = '{!join from=uid to=uid}' . $params['query'];
380
+        $params['query'] = '{!join from=uid to=uid}'.$params['query'];
381 381
         // Perform search to determine the total number of toplevel hits and fetch the required rows.
382 382
         $selectQuery = $this->service->createSelect($params);
383 383
         $results = $this->service->select($selectQuery);
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         // Set query.
435 435
         $parameters['query'] = $query;
436 436
         // Calculate cache identifier.
437
-        $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true));
437
+        $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true));
438 438
         $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
439 439
         $resultSet = [];
440 440
         if (($entry = $cache->get($cacheIdentifier)) === false) {
@@ -565,12 +565,12 @@  discard block
 block discarded – undo
565 565
      */
566 566
     public function __get($var)
567 567
     {
568
-        $method = '_get' . ucfirst($var);
568
+        $method = '_get'.ucfirst($var);
569 569
         if (
570 570
             !property_exists($this, $var)
571 571
             || !method_exists($this, $method)
572 572
         ) {
573
-            $this->logger->warning('There is no getter function for property "' . $var . '"');
573
+            $this->logger->warning('There is no getter function for property "'.$var.'"');
574 574
             return;
575 575
         } else {
576 576
             return $this->$method();
@@ -603,12 +603,12 @@  discard block
 block discarded – undo
603 603
      */
604 604
     public function __set($var, $value)
605 605
     {
606
-        $method = '_set' . ucfirst($var);
606
+        $method = '_set'.ucfirst($var);
607 607
         if (
608 608
             !property_exists($this, $var)
609 609
             || !method_exists($this, $method)
610 610
         ) {
611
-            $this->logger->warning('There is no setter function for property "' . $var . '"');
611
+            $this->logger->warning('There is no setter function for property "'.$var.'"');
612 612
         } else {
613 613
             $this->$method($value);
614 614
         }
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
                     'scheme' => $this->config['scheme'],
646 646
                     'host' => $this->config['host'],
647 647
                     'port' => $this->config['port'],
648
-                    'path' => '/' . $this->config['path'],
648
+                    'path' => '/'.$this->config['path'],
649 649
                     'core' => $core,
650 650
                     'username' => $this->config['username'],
651 651
                     'password' => $this->config['password'],
Please login to merge, or discard this patch.
Classes/Common/Indexer.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 if ($parent->ready) {
106 106
                     $errors = self::add($parent, $core);
107 107
                 } else {
108
-                    $logger->error('Could not load parent document with UID ' . $doc->parentId);
108
+                    $logger->error('Could not load parent document with UID '.$doc->parentId);
109 109
                     return 1;
110 110
                 }
111 111
             }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 self::$processedDocs[] = $doc->uid;
115 115
                 // Delete old Solr documents.
116 116
                 $updateQuery = self::$solr->service->createUpdate();
117
-                $updateQuery->addDeleteQuery('uid:' . $doc->uid);
117
+                $updateQuery->addDeleteQuery('uid:'.$doc->uid);
118 118
                 self::$solr->service->update($updateQuery);
119 119
                 // Index every logical unit as separate Solr document.
120 120
                 foreach ($doc->tableOfContents as $logicalUnit) {
@@ -178,14 +178,14 @@  discard block
 block discarded – undo
178 178
             } catch (\Exception $e) {
179 179
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
180 180
                     Helper::addMessage(
181
-                        Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
181
+                        Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()),
182 182
                         Helper::getMessage('flash.error', true),
183 183
                         FlashMessage::ERROR,
184 184
                         true,
185 185
                         'core.template.flashMessages'
186 186
                     );
187 187
                 }
188
-                $logger->error('Apache Solr threw exception: "' . $e->getMessage() . '"');
188
+                $logger->error('Apache Solr threw exception: "'.$e->getMessage().'"');
189 189
                 return 1;
190 190
             }
191 191
         } else {
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         // Sanitize input.
221 221
         $pid = max(intval($pid), 0);
222 222
         if (!$pid) {
223
-            $logger->error('Invalid PID ' . $pid . ' for metadata configuration');
223
+            $logger->error('Invalid PID '.$pid.' for metadata configuration');
224 224
             return '';
225 225
         }
226 226
         // Load metadata configuration.
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u');
230 230
         $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u');
231 231
         $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u');
232
-        $index_name .= '_' . $suffix;
232
+        $index_name .= '_'.$suffix;
233 233
         return $index_name;
234 234
     }
235 235
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
             $updateQuery = self::$solr->service->createUpdate();
331 331
             $solrDoc = $updateQuery->createDocument();
332 332
             // Create unique identifier from document's UID and unit's XML ID.
333
-            $solrDoc->setField('id', $doc->uid . $logicalUnit['id']);
333
+            $solrDoc->setField('id', $doc->uid.$logicalUnit['id']);
334 334
             $solrDoc->setField('uid', $doc->uid);
335 335
             $solrDoc->setField('pid', $doc->pid);
336 336
             if (MathUtility::canBeInterpretedAsInteger($logicalUnit['points'])) {
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
                     $solrDoc->setField(self::getIndexFieldName($index_name, $doc->pid), $data, self::$fields['fieldboost'][$index_name]);
371 371
                     if (in_array($index_name, self::$fields['sortables'])) {
372 372
                         // Add sortable fields to index.
373
-                        $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]);
373
+                        $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
374 374
                     }
375 375
                     if (in_array($index_name, self::$fields['facets'])) {
376 376
                         // Add facets to index.
377
-                        $solrDoc->setField($index_name . '_faceting', $data);
377
+                        $solrDoc->setField($index_name.'_faceting', $data);
378 378
                     }
379 379
                     if (in_array($index_name, self::$fields['autocomplete'])) {
380 380
                         $autocomplete = array_merge($autocomplete, $data);
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
             } catch (\Exception $e) {
400 400
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
401 401
                     Helper::addMessage(
402
-                        Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
402
+                        Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()),
403 403
                         Helper::getMessage('flash.error', true),
404 404
                         FlashMessage::ERROR,
405 405
                         true,
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
             $updateQuery = self::$solr->service->createUpdate();
447 447
             $solrDoc = $updateQuery->createDocument();
448 448
             // Create unique identifier from document's UID and unit's XML ID.
449
-            $solrDoc->setField('id', $doc->uid . $physicalUnit['id']);
449
+            $solrDoc->setField('id', $doc->uid.$physicalUnit['id']);
450 450
             $solrDoc->setField('uid', $doc->uid);
451 451
             $solrDoc->setField('pid', $doc->pid);
452 452
             $solrDoc->setField('page', $page);
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                             }
481 481
                         }
482 482
                         // Add facets to index.
483
-                        $solrDoc->setField($index_name . '_faceting', $data);
483
+                        $solrDoc->setField($index_name.'_faceting', $data);
484 484
                     }
485 485
                 }
486 486
             }
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             } catch (\Exception $e) {
498 498
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
499 499
                     Helper::addMessage(
500
-                        Helper::getMessage('flash.solrException', true) . '<br />' . htmlspecialchars($e->getMessage()),
500
+                        Helper::getMessage('flash.solrException', true).'<br />'.htmlspecialchars($e->getMessage()),
501 501
                         Helper::getMessage('flash.error', true),
502 502
                         FlashMessage::ERROR,
503 503
                         true,
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $fileMimeType = $this->getFileMimeType($id);
170 170
         $fileLocation = $this->getFileLocation($id);
171 171
         if ($fileMimeType === 'application/vnd.kitodo.iiif') {
172
-            $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation . 'info.json' : $fileLocation . '/info.json');
172
+            $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation.'info.json' : $fileLocation.'/info.json');
173 173
             $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey);
174 174
             IiifHelper::setUrlReader(IiifUrlReader::getInstance());
175 175
             IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
                 return $service->getImageUrl();
180 180
             }
181 181
         } elseif ($fileMimeType === 'application/vnd.netfpx') {
182
-            $baseURL = $fileLocation . (strpos($fileLocation, '?') === false ? '?' : '');
182
+            $baseURL = $fileLocation.(strpos($fileLocation, '?') === false ? '?' : '');
183 183
             // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server'
184
-            return $baseURL . '&CVT=jpeg';
184
+            return $baseURL.'&CVT=jpeg';
185 185
         }
186 186
         return $fileLocation;
187 187
     }
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function getFileLocation($id)
194 194
     {
195
-        $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]');
195
+        $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]');
196 196
         if (
197 197
             !empty($id)
198 198
             && !empty($location)
199 199
         ) {
200 200
             return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href;
201 201
         } else {
202
-            $this->logger->warning('There is no file node with @ID "' . $id . '"');
202
+            $this->logger->warning('There is no file node with @ID "'.$id.'"');
203 203
             return '';
204 204
         }
205 205
     }
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
      */
211 211
     public function getFileMimeType($id)
212 212
     {
213
-        $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE');
213
+        $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE');
214 214
         if (
215 215
             !empty($id)
216 216
             && !empty($mimetype)
217 217
         ) {
218 218
             return (string) $mimetype[0];
219 219
         } else {
220
-            $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified');
220
+            $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified');
221 221
             return '';
222 222
         }
223 223
     }
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
             return $this->logicalUnits[$id];
239 239
         } elseif (!empty($id)) {
240 240
             // Get specified logical unit.
241
-            $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]');
241
+            $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]');
242 242
         } else {
243 243
             // Get all logical units at top level.
244 244
             $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
             // Retain current PID.
379 379
             $cPid = ($this->cPid ? $this->cPid : $this->pid);
380 380
         } elseif (!$cPid) {
381
-            $this->logger->warning('Invalid PID ' . $cPid . ' for metadata definitions');
381
+            $this->logger->warning('Invalid PID '.$cPid.' for metadata definitions');
382 382
             return [];
383 383
         }
384 384
         // Get metadata from parsed metadata array if available.
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
         if (!empty($this->logicalUnits[$id])) {
420 420
             $dmdIds = $this->logicalUnits[$id]['dmdId'];
421 421
         } else {
422
-            $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@DMDID');
422
+            $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID');
423 423
             $dmdIds = (string) $dmdIds[0];
424 424
         }
425 425
         if (!empty($dmdIds)) {
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
                     ) {
446 446
                         $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata);
447 447
                     } else {
448
-                        $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->dmdSec[$dmdId]['type'] . '"');
448
+                        $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"');
449 449
                     }
450 450
                 }
451 451
             } else {
452
-                $this->logger->notice('Unsupported metadata format "' . $this->dmdSec[$dmdId]['type'] . '" in dmdSec with @ID "' . $dmdId . '"');
452
+                $this->logger->notice('Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"');
453 453
                 // Continue searching for supported metadata with next @DMDID.
454 454
                 continue;
455 455
             }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
             if (!empty($this->logicalUnits[$id])) {
458 458
                 $metadata['type'] = [$this->logicalUnits[$id]['type']];
459 459
             } else {
460
-                $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE');
460
+                $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE');
461 461
                 if (!empty($struct)) {
462 462
                     $metadata['type'] = [(string) $struct[0]];
463 463
                 }
@@ -574,13 +574,13 @@  discard block
 block discarded – undo
574 574
                             $values instanceof \DOMNodeList
575 575
                             && $values->length > 0
576 576
                         ) {
577
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue);
577
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue);
578 578
                         } elseif (!($values instanceof \DOMNodeList)) {
579
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values);
579
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values);
580 580
                         }
581 581
                     }
582
-                    if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) {
583
-                        $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0];
582
+                    if (empty($metadata[$resArray['index_name'].'_sorting'][0])) {
583
+                        $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0];
584 584
                     }
585 585
                 }
586 586
             }
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         if ($hasSupportedMetadata) {
643 643
             return $metadata;
644 644
         } else {
645
-            $this->logger->warning('No supported metadata found for logical structure with @ID "' . $id . '"');
645
+            $this->logger->warning('No supported metadata found for logical structure with @ID "'.$id.'"');
646 646
             return [];
647 647
         }
648 648
     }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
      */
673 673
     public function getStructureDepth($logId)
674 674
     {
675
-        $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*');
675
+        $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*');
676 676
         if (!empty($ancestors)) {
677 677
             return count($ancestors);
678 678
         } else {
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             // Register namespaces.
695 695
             $this->registerNamespaces($this->mets);
696 696
         } else {
697
-            $this->logger->error('No METS part found in document with UID ' . $this->uid);
697
+            $this->logger->error('No METS part found in document with UID '.$this->uid);
698 698
         }
699 699
     }
700 700
 
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
                 return true;
723 723
             }
724 724
         }
725
-        $this->logger->error('Could not load XML file from "' . $location . '"');
725
+        $this->logger->error('Could not load XML file from "'.$location.'"');
726 726
         return false;
727 727
     }
728 728
 
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
     {
747 747
         $partof = 0;
748 748
         // Get the closest ancestor of the current document which has a MPTR child.
749
-        $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $this->_getToplevelId() . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr');
749
+        $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->_getToplevelId().'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr');
750 750
         if (!empty($parentMptr)) {
751 751
             $parentLocation = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href;
752 752
             if ($parentLocation != $this->location) {
@@ -813,15 +813,15 @@  discard block
 block discarded – undo
813 813
             $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID');
814 814
             if (!empty($dmdIds)) {
815 815
                 foreach ($dmdIds as $dmdId) {
816
-                    if ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) {
816
+                    if ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) {
817 817
                         if (!empty($this->formats[(string) $type[0]])) {
818 818
                             $type = (string) $type[0];
819
-                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']);
819
+                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
820 820
                         }
821
-                    } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) {
821
+                    } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) {
822 822
                         if (!empty($this->formats[(string) $type[0]])) {
823 823
                             $type = (string) $type[0];
824
-                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']);
824
+                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
825 825
                         }
826 826
                     }
827 827
                     if (!empty($xml)) {
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
             // Retain current PID.
1007 1007
             $cPid = ($this->cPid ? $this->cPid : $this->pid);
1008 1008
             if (!$cPid) {
1009
-                $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions');
1009
+                $this->logger->error('Invalid PID '.$cPid.' for structure definitions');
1010 1010
                 $this->thumbnailLoaded = true;
1011 1011
                 return $this->thumbnail;
1012 1012
             }
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
                 if (!empty($resArray['thumbnail'])) {
1044 1044
                     $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid);
1045 1045
                     // Check if this document has a structure element of the desired type.
1046
-                    $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID');
1046
+                    $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID');
1047 1047
                     if (!empty($strctIds)) {
1048 1048
                         $strctId = (string) $strctIds[0];
1049 1049
                     }
@@ -1066,7 +1066,7 @@  discard block
 block discarded – undo
1066 1066
                     }
1067 1067
                 }
1068 1068
             } else {
1069
-                $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database');
1069
+                $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database');
1070 1070
             }
1071 1071
             $this->thumbnailLoaded = true;
1072 1072
         }
Please login to merge, or discard this patch.
Classes/Common/DocumentList.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         if ($this->valid()) {
138 138
             return $this->getRecord($this->elements[$this->position]);
139 139
         } else {
140
-            $this->logger->notice('Invalid position "' . $this->position . '" for list element');
140
+            $this->logger->notice('Invalid position "'.$this->position.'" for list element');
141 141
             return;
142 142
         }
143 143
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                     // Restrict the fields to the required ones
242 242
                     $params['fields'] = 'uid,id,toplevel,thumbnail,page';
243 243
                     foreach ($this->solrConfig as $solr_name) {
244
-                        $params['fields'] .= ',' . $solr_name;
244
+                        $params['fields'] .= ','.$solr_name;
245 245
                     }
246 246
                     // If it is a fulltext search, enable highlighting.
247 247
                     if ($this->metadata['fulltextSearch']) {
@@ -263,15 +263,15 @@  discard block
 block discarded – undo
263 263
                     // Extend filter query to get all documents with the same UID.
264 264
                     foreach ($params['filterquery'] as $key => $value) {
265 265
                         if (isset($value['query'])) {
266
-                            $params['filterquery'][$key]['query'] = $value['query'] . ' OR toplevel:true';
266
+                            $params['filterquery'][$key]['query'] = $value['query'].' OR toplevel:true';
267 267
                         }
268 268
                     }
269 269
                     // Add filter query to get all documents with the required uid.
270
-                    $params['filterquery'][] = ['query' => 'uid:' . Solr::escapeQuery($record['uid'])];
270
+                    $params['filterquery'][] = ['query' => 'uid:'.Solr::escapeQuery($record['uid'])];
271 271
                     // Add sorting.
272 272
                     $params['sort'] = $this->metadata['options']['params']['sort'];
273 273
                     // Set query.
274
-                    $params['query'] = $this->metadata['options']['select'] . ' OR toplevel:true';
274
+                    $params['query'] = $this->metadata['options']['select'].' OR toplevel:true';
275 275
                     // Perform search for all documents with the same uid that either fit to the search or marked as toplevel.
276 276
                     $selectQuery = $this->solr->service->createSelect($params);
277 277
                     $result = $this->solr->service->select($selectQuery);
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
             $position < 0
347 347
             || $position >= $this->count
348 348
         ) {
349
-            $this->logger->warning('Invalid position "' . $position . '" for element moving');
349
+            $this->logger->warning('Invalid position "'.$position.'" for element moving');
350 350
             return;
351 351
         }
352 352
         $steps = intval($steps);
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         if (($position + $steps) < 0
355 355
             || ($position + $steps) >= $this->count
356 356
         ) {
357
-            $this->logger->warning('Invalid steps "' . $steps . '" for moving element at position "' . $position . '"');
357
+            $this->logger->warning('Invalid steps "'.$steps.'" for moving element at position "'.$position.'"');
358 358
             return;
359 359
         }
360 360
         $element = $this->remove($position);
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
         if ($this->offsetExists($offset)) {
433 433
             return $this->getRecord($this->elements[$offset]);
434 434
         } else {
435
-            $this->logger->notice('Invalid offset "' . $offset . '" for list element');
435
+            $this->logger->notice('Invalid offset "'.$offset.'" for list element');
436 436
             return;
437 437
         }
438 438
     }
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
             $position < 0
477 477
             || $position >= $this->count
478 478
         ) {
479
-            $this->logger->warning('Invalid position "' . $position . '" for element removing');
479
+            $this->logger->warning('Invalid position "'.$position.'" for element removing');
480 480
             return;
481 481
         }
482 482
         $removed = array_splice($this->elements, $position, 1);
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
             $position < 0
502 502
             || $position >= $this->count
503 503
         ) {
504
-            $this->logger->warning('Invalid position "' . $position . '" for element removing');
504
+            $this->logger->warning('Invalid position "'.$position.'" for element removing');
505 505
             return;
506 506
         }
507 507
         $removed = array_splice($this->elements, $position, $length);
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
                     ->execute();
595 595
 
596 596
                 while ($resArray = $result->fetch()) {
597
-                    $this->solrConfig[$resArray['index_name']] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . 's' . ($resArray['index_indexed'] ? 'i' : 'u');
597
+                    $this->solrConfig[$resArray['index_name']] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').'s'.($resArray['index_indexed'] ? 'i' : 'u');
598 598
                 }
599 599
                 // Add static fields.
600 600
                 $this->solrConfig['type'] = 'type';
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
         foreach ($this->elements as $num => $element) {
623 623
             // Is this element sortable?
624 624
             if (!empty($element['s'][$by])) {
625
-                $newOrder[$element['s'][$by] . str_pad($num, 6, '0', STR_PAD_LEFT)] = $element;
625
+                $newOrder[$element['s'][$by].str_pad($num, 6, '0', STR_PAD_LEFT)] = $element;
626 626
             } else {
627 627
                 $nonSortable[] = $element;
628 628
             }
@@ -760,12 +760,12 @@  discard block
 block discarded – undo
760 760
      */
761 761
     public function __get($var)
762 762
     {
763
-        $method = '_get' . ucfirst($var);
763
+        $method = '_get'.ucfirst($var);
764 764
         if (
765 765
             !property_exists($this, $var)
766 766
             || !method_exists($this, $method)
767 767
         ) {
768
-            $this->logger->warning('There is no getter function for property "' . $var . '"');
768
+            $this->logger->warning('There is no getter function for property "'.$var.'"');
769 769
             return;
770 770
         } else {
771 771
             return $this->$method();
@@ -798,12 +798,12 @@  discard block
 block discarded – undo
798 798
      */
799 799
     public function __set($var, $value)
800 800
     {
801
-        $method = '_set' . ucfirst($var);
801
+        $method = '_set'.ucfirst($var);
802 802
         if (
803 803
             !property_exists($this, $var)
804 804
             || !method_exists($this, $method)
805 805
         ) {
806
-            $this->logger->warning('There is no setter function for property "' . $var . '"');
806
+            $this->logger->warning('There is no setter function for property "'.$var.'"');
807 807
         } else {
808 808
             $this->$method($value);
809 809
         }
Please login to merge, or discard this patch.
Classes/Common/Helper.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 if (!preg_match('/[0-9]{8}-[0-9]{1}/i', $id)) {
137 137
                     return false;
138 138
                 } elseif ($checksum == 10) {
139
-                    return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
139
+                    return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD');
140 140
                 } elseif (substr($id, -1, 1) != $checksum) {
141 141
                     return false;
142 142
                 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
279 279
         // Merge initialisation vector and encrypted data.
280 280
         if ($encrypted !== false) {
281
-            $encrypted = base64_encode($iv . $encrypted);
281
+            $encrypted = base64_encode($iv.$encrypted);
282 282
         }
283 283
         return $encrypted;
284 284
     }
@@ -332,8 +332,8 @@  discard block
 block discarded – undo
332 332
     public static function getHookObjects($scriptRelPath)
333 333
     {
334 334
         $hookObjects = [];
335
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'])) {
336
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) {
335
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'])) {
336
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) {
337 337
                 $hookObjects[] = GeneralUtility::makeInstance($classRef);
338 338
             }
339 339
         }
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
             !$uid
360 360
             || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'])
361 361
         ) {
362
-            self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR);
362
+            self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR);
363 363
             return '';
364 364
         }
365 365
 
@@ -370,15 +370,15 @@  discard block
 block discarded – undo
370 370
         // Should we check for a specific PID, too?
371 371
         if ($pid !== -1) {
372 372
             $pid = max(intval($pid), 0);
373
-            $where = $queryBuilder->expr()->eq($table . '.pid', $pid);
373
+            $where = $queryBuilder->expr()->eq($table.'.pid', $pid);
374 374
         }
375 375
 
376 376
         // Get index_name from database.
377 377
         $result = $queryBuilder
378
-            ->select($table . '.index_name AS index_name')
378
+            ->select($table.'.index_name AS index_name')
379 379
             ->from($table)
380 380
             ->where(
381
-                $queryBuilder->expr()->eq($table . '.uid', $uid),
381
+                $queryBuilder->expr()->eq($table.'.uid', $uid),
382 382
                 $where,
383 383
                 self::whereExpression($table)
384 384
             )
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         if ($resArray = $result->fetch()) {
389 389
             return $resArray['index_name'];
390 390
         } else {
391
-            self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING);
391
+            self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING);
392 392
             return '';
393 393
         }
394 394
     }
@@ -407,9 +407,9 @@  discard block
 block discarded – undo
407 407
         // Analyze code and set appropriate ISO table.
408 408
         $isoCode = strtolower(trim($code));
409 409
         if (preg_match('/^[a-z]{3}$/', $isoCode)) {
410
-            $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey) . 'Resources/Private/Data/iso-639-2b.xml';
410
+            $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey).'Resources/Private/Data/iso-639-2b.xml';
411 411
         } elseif (preg_match('/^[a-z]{2}$/', $isoCode)) {
412
-            $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey) . 'Resources/Private/Data/iso-639-1.xml';
412
+            $file = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath(self::$extKey).'Resources/Private/Data/iso-639-1.xml';
413 413
         } else {
414 414
             // No ISO code, return unchanged.
415 415
             return $code;
@@ -426,13 +426,13 @@  discard block
 block discarded – undo
426 426
                 $lang = $GLOBALS['LANG']->getLLL($isoCode, $iso639);
427 427
             }
428 428
         } else {
429
-            self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
429
+            self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
430 430
             return $code;
431 431
         }
432 432
         if (!empty($lang)) {
433 433
             return $lang;
434 434
         } else {
435
-            self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
435
+            self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
436 436
             return $code;
437 437
         }
438 438
     }
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
             } elseif (\TYPO3_MODE === 'BE') {
461 461
                 self::$messages = $GLOBALS['LANG']->includeLLFile($file, false, true);
462 462
             } else {
463
-                self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
463
+                self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
464 464
             }
465 465
         }
466 466
         // Get translation.
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
             } elseif (\TYPO3_MODE === 'BE') {
471 471
                 $translated = $GLOBALS['LANG']->getLLL($key, self::$messages);
472 472
             } else {
473
-                self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
473
+                self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
474 474
             }
475 475
         }
476 476
         // Escape HTML characters if applicable.
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
             !$index_name
498 498
             || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'])
499 499
         ) {
500
-            self::log('Invalid UID ' . $index_name . ' or table "' . $table . '"', LOG_SEVERITY_ERROR);
500
+            self::log('Invalid UID '.$index_name.' or table "'.$table.'"', LOG_SEVERITY_ERROR);
501 501
             return '';
502 502
         }
503 503
 
@@ -508,14 +508,14 @@  discard block
 block discarded – undo
508 508
         // Should we check for a specific PID, too?
509 509
         if ($pid !== -1) {
510 510
             $pid = max(intval($pid), 0);
511
-            $where = $queryBuilder->expr()->eq($table . '.pid', $pid);
511
+            $where = $queryBuilder->expr()->eq($table.'.pid', $pid);
512 512
         }
513 513
         // Get index_name from database.
514 514
         $result = $queryBuilder
515
-            ->select($table . '.uid AS uid')
515
+            ->select($table.'.uid AS uid')
516 516
             ->from($table)
517 517
             ->where(
518
-                $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
518
+                $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($index_name)),
519 519
                 $where,
520 520
                 self::whereExpression($table)
521 521
             )
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
         if (count($allResults) == 1) {
528 528
             return $allResults[0]['uid'];
529 529
         } else {
530
-            self::log('No UID for given index_name "' . $index_name . '" and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING);
530
+            self::log('No UID for given index_name "'.$index_name.'" and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING);
531 531
             return '';
532 532
         }
533 533
     }
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
             '-' => 39,
586 586
             ':' => 17,
587 587
         ];
588
-        $urn = strtolower($base . $id);
588
+        $urn = strtolower($base.$id);
589 589
         if (preg_match('/[^a-z0-9:-]/', $urn)) {
590 590
             self::log('Invalid chars in given parameters', LOG_SEVERITY_WARNING);
591 591
             return '';
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
             $checksum += ($i + 1) * intval(substr($digits, $i, 1));
600 600
         }
601 601
         $checksum = substr(intval($checksum / intval(substr($digits, -1, 1))), -1, 1);
602
-        return $base . $id . $checksum;
602
+        return $base.$id.$checksum;
603 603
     }
604 604
 
605 605
     /**
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
         // Cast to string for security reasons.
631 631
         $key = (string) $key;
632 632
         if (!$key) {
633
-            self::log('Invalid key "' . $key . '" for session data retrieval', LOG_SEVERITY_WARNING);
633
+            self::log('Invalid key "'.$key.'" for session data retrieval', LOG_SEVERITY_WARNING);
634 634
             return;
635 635
         }
636 636
         // Get the session data.
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
         } elseif (\TYPO3_MODE === 'BE') {
640 640
             return $GLOBALS['BE_USER']->getSessionData($key);
641 641
         } else {
642
-            self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
642
+            self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
643 643
             return;
644 644
         }
645 645
     }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
         // Cast to string for security reasons.
749 749
         $key = (string) $key;
750 750
         if (!$key) {
751
-            self::log('Invalid key "' . $key . '" for session data saving', LOG_SEVERITY_WARNING);
751
+            self::log('Invalid key "'.$key.'" for session data saving', LOG_SEVERITY_WARNING);
752 752
             return false;
753 753
         }
754 754
         // Save value in session data.
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             $GLOBALS['BE_USER']->setAndSaveSessionData($key, $value);
761 761
             return true;
762 762
         } else {
763
-            self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
763
+            self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
764 764
             return false;
765 765
         }
766 766
     }
@@ -783,7 +783,7 @@  discard block
 block discarded – undo
783 783
         // Sanitize input.
784 784
         $pid = max(intval($pid), 0);
785 785
         if (!$pid) {
786
-            self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING);
786
+            self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING);
787 787
             return $index_name;
788 788
         }
789 789
         // Check if "index_name" is an UID.
@@ -800,13 +800,13 @@  discard block
 block discarded – undo
800 800
         // First fetch the uid of the received index_name
801 801
         $result = $queryBuilder
802 802
             ->select(
803
-                $table . '.uid AS uid',
804
-                $table . '.l18n_parent AS l18n_parent'
803
+                $table.'.uid AS uid',
804
+                $table.'.l18n_parent AS l18n_parent'
805 805
             )
806 806
             ->from($table)
807 807
             ->where(
808
-                $queryBuilder->expr()->eq($table . '.pid', $pid),
809
-                $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
808
+                $queryBuilder->expr()->eq($table.'.pid', $pid),
809
+                $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($index_name)),
810 810
                 self::whereExpression($table, true)
811 811
             )
812 812
             ->setMaxResults(1)
@@ -819,12 +819,12 @@  discard block
 block discarded – undo
819 819
             $resArray = $allResults[0];
820 820
 
821 821
             $result = $queryBuilder
822
-                ->select($table . '.index_name AS index_name')
822
+                ->select($table.'.index_name AS index_name')
823 823
                 ->from($table)
824 824
                 ->where(
825
-                    $queryBuilder->expr()->eq($table . '.pid', $pid),
826
-                    $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']),
827
-                    $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content)),
825
+                    $queryBuilder->expr()->eq($table.'.pid', $pid),
826
+                    $queryBuilder->expr()->eq($table.'.uid', $resArray['l18n_parent']),
827
+                    $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content)),
828 828
                     self::whereExpression($table, true)
829 829
                 )
830 830
                 ->setMaxResults(1)
@@ -842,14 +842,14 @@  discard block
 block discarded – undo
842 842
         if (empty($labels[$table][$pid][$GLOBALS['TSFE']->sys_language_content][$index_name])) {
843 843
             // Check if this table is allowed for translation.
844 844
             if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) {
845
-                $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]);
845
+                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]);
846 846
                 if ($GLOBALS['TSFE']->sys_language_content > 0) {
847 847
                     $additionalWhere = $queryBuilder->expr()->andX(
848 848
                         $queryBuilder->expr()->orX(
849
-                            $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]),
850
-                            $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content))
849
+                            $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]),
850
+                            $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content))
851 851
                         ),
852
-                        $queryBuilder->expr()->eq($table . '.l18n_parent', 0)
852
+                        $queryBuilder->expr()->eq($table.'.l18n_parent', 0)
853 853
                     );
854 854
                 }
855 855
 
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
                     ->select('*')
859 859
                     ->from($table)
860 860
                     ->where(
861
-                        $queryBuilder->expr()->eq($table . '.pid', $pid),
861
+                        $queryBuilder->expr()->eq($table.'.pid', $pid),
862 862
                         $additionalWhere,
863 863
                         self::whereExpression($table, true)
864 864
                     )
@@ -876,10 +876,10 @@  discard block
 block discarded – undo
876 876
                         }
877 877
                     }
878 878
                 } else {
879
-                    self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE);
879
+                    self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE);
880 880
                 }
881 881
             } else {
882
-                self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING);
882
+                self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING);
883 883
             }
884 884
         }
885 885
 
@@ -918,9 +918,9 @@  discard block
 block discarded – undo
918 918
             return GeneralUtility::makeInstance(ConnectionPool::class)
919 919
                 ->getQueryBuilderForTable($table)
920 920
                 ->expr()
921
-                ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
921
+                ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
922 922
         } else {
923
-            self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
923
+            self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
924 924
             return '1=-1';
925 925
         }
926 926
     }
Please login to merge, or discard this patch.
Classes/Common/IiifManifest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -694,16 +694,16 @@  discard block
 block discarded – undo
694 694
                     && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null)
695 695
                 ) {
696 696
                     if (is_string($values)) {
697
-                        $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)];
697
+                        $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)];
698 698
                     } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) {
699 699
                         $metadata[$resArray['index_name']] = [];
700 700
                         foreach ($values->data() as $value) {
701
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value);
701
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value);
702 702
                         }
703 703
                     }
704 704
                 }
705
-                if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) {
706
-                    $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0];
705
+                if (empty($metadata[$resArray['index_name'].'_sorting'][0])) {
706
+                    $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0];
707 707
                 }
708 708
             }
709 709
         }
@@ -831,7 +831,7 @@  discard block
 block discarded – undo
831 831
                     }
832 832
                 }
833 833
             } else {
834
-                $this->logger->warning('Invalid structure resource @id "' . $id . '"');
834
+                $this->logger->warning('Invalid structure resource @id "'.$id.'"');
835 835
                 return $rawText;
836 836
             }
837 837
             $this->rawTextArray[$id] = $rawText;
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
                 }
881 881
             }
882 882
         }
883
-        $this->logger->error('Could not load IIIF manifest from "' . $location . '"');
883
+        $this->logger->error('Could not load IIIF manifest from "'.$location.'"');
884 884
         return false;
885 885
     }
886 886
 
Please login to merge, or discard this patch.
Classes/Plugin/PageView.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
             $(document).ready(function() {
79 79
                 if (dlfUtils.exists(dlfViewer)) {
80 80
                     tx_dlf_viewer = new dlfViewer({
81
-                        controls: ["' . implode('", "', $this->controls) . '"],
82
-                        div: "' . $this->conf['elementId'] . '",
83
-                        images: ' . json_encode($this->images) . ',
84
-                        fulltexts: ' . json_encode($this->fulltexts) . ',
85
-                        annotationContainers: ' . json_encode($this->annotationContainers) . ',
86
-                        useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0) . '
81
+                        controls: ["' . implode('", "', $this->controls).'"],
82
+                        div: "' . $this->conf['elementId'].'",
83
+                        images: ' . json_encode($this->images).',
84
+                        fulltexts: ' . json_encode($this->fulltexts).',
85
+                        annotationContainers: ' . json_encode($this->annotationContainers).',
86
+                        useInternalProxy: ' . ($this->conf['useInternalProxy'] ? 1 : 0).'
87 87
                     });
88 88
                 }
89 89
             });
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
         $markerArray = [];
106 106
         if ($this->piVars['id']) {
107 107
             if ($this->conf['crop']) {
108
-                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="' . htmlspecialchars($this->pi_getLL('editMode', '')) . '">' . htmlspecialchars($this->pi_getLL('editMode', '')) . '</a>';
109
-                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '">' . htmlspecialchars($this->pi_getLL('editRemove', '')) . '</a>';
108
+                $markerArray['###EDITBUTTON###'] = '<a href="javascript: tx_dlf_viewer.activateSelection();" title="'.htmlspecialchars($this->pi_getLL('editMode', '')).'">'.htmlspecialchars($this->pi_getLL('editMode', '')).'</a>';
109
+                $markerArray['###EDITREMOVE###'] = '<a href="javascript: tx_dlf_viewer.resetCropSelection();" title="'.htmlspecialchars($this->pi_getLL('editRemove', '')).'">'.htmlspecialchars($this->pi_getLL('editRemove', '')).'</a>';
110 110
             } else {
111 111
                 $markerArray['###EDITBUTTON###'] = '';
112 112
                 $markerArray['###EDITREMOVE###'] = '';
113 113
             }
114 114
             if ($this->conf['magnifier']) {
115
-                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '">' . htmlspecialchars($this->pi_getLL('magnifier', '')) . '</a>';
115
+                $markerArray['###MAGNIFIER###'] = '<a href="javascript: tx_dlf_viewer.activateMagnifier();" title="'.htmlspecialchars($this->pi_getLL('magnifier', '')).'">'.htmlspecialchars($this->pi_getLL('magnifier', '')).'</a>';
116 116
             } else {
117 117
                 $markerArray['###MAGNIFIER###'] = '';
118 118
             }
@@ -147,15 +147,15 @@  discard block
 block discarded – undo
147 147
                 'additionalParams' => GeneralUtility::implodeArrayForUrl($this->prefixId, $params, '', true, false),
148 148
                 'title' => $label
149 149
             ];
150
-            $output = '<form id="addToBasketForm" action="' . $this->cObj->typoLink_URL($basketConf) . '" method="post">';
151
-            $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="' . htmlspecialchars($this->piVars['page']) . '">';
152
-            $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="' . htmlspecialchars($this->piVars['page']) . '">';
150
+            $output = '<form id="addToBasketForm" action="'.$this->cObj->typoLink_URL($basketConf).'" method="post">';
151
+            $output .= '<input type="hidden" name="tx_dlf[startpage]" id="startpage" value="'.htmlspecialchars($this->piVars['page']).'">';
152
+            $output .= '<input type="hidden" name="tx_dlf[endpage]" id="endpage" value="'.htmlspecialchars($this->piVars['page']).'">';
153 153
             $output .= '<input type="hidden" name="tx_dlf[startX]" id="startX">';
154 154
             $output .= '<input type="hidden" name="tx_dlf[startY]" id="startY">';
155 155
             $output .= '<input type="hidden" name="tx_dlf[endX]" id="endX">';
156 156
             $output .= '<input type="hidden" name="tx_dlf[endY]" id="endY">';
157 157
             $output .= '<input type="hidden" name="tx_dlf[rotation]" id="rotation">';
158
-            $output .= '<button id="submitBasketForm" onclick="this.form.submit()">' . $label . '</button>';
158
+            $output .= '<button id="submitBasketForm" onclick="this.form.submit()">'.$label.'</button>';
159 159
             $output .= '</form>';
160 160
             $output .= '<script>';
161 161
             $output .= '$(document).ready(function() { $("#submitBasketForm").click(function() { $("#addToBasketForm").submit(); }); });';
@@ -191,18 +191,18 @@  discard block
 block discarded – undo
191 191
                         'parameter' => $GLOBALS['TSFE']->id,
192 192
                         'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
193 193
                         'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
194
-                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($image['url']),
194
+                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($image['url']),
195 195
                     ];
196 196
                     $image['url'] = $this->cObj->typoLink_URL($linkConf);
197 197
                 }
198 198
                 $image['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpImages]);
199 199
                 break;
200 200
             } else {
201
-                $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"');
201
+                $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"');
202 202
             }
203 203
         }
204 204
         if (empty($image)) {
205
-            $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->conf['fileGrpImages'] . '"');
205
+            $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->conf['fileGrpImages'].'"');
206 206
         }
207 207
         return $image;
208 208
     }
@@ -230,18 +230,18 @@  discard block
 block discarded – undo
230 230
                         'parameter' => $GLOBALS['TSFE']->id,
231 231
                         'forceAbsoluteUrl' => !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0,
232 232
                         'forceAbsoluteUrl.' => ['scheme' => !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http'],
233
-                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url=' . urlencode($fulltext['url']),
233
+                        'additionalParams' => '&eID=tx_dlf_pageview_proxy&url='.urlencode($fulltext['url']),
234 234
                     ];
235 235
                     $fulltext['url'] = $this->cObj->typoLink_URL($linkConf);
236 236
                 }
237 237
                 $fulltext['mimetype'] = $this->doc->getFileMimeType($this->doc->physicalStructureInfo[$this->doc->physicalStructure[$page]]['files'][$fileGrpFulltext]);
238 238
                 break;
239 239
             } else {
240
-                $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"');
240
+                $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"');
241 241
             }
242 242
         }
243 243
         if (empty($fulltext)) {
244
-            $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->conf['fileGrpFulltext'] . '"');
244
+            $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->conf['fileGrpFulltext'].'"');
245 245
         }
246 246
         return $fulltext;
247 247
     }
Please login to merge, or discard this patch.
Classes/Hooks/UserFunc.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@
 block discarded – undo
56 56
     public function displayThumbnail(&$params)
57 57
     {
58 58
         // Simulate TCA field type "passthrough".
59
-        $output = '<input type="hidden" name="' . $params['itemFormElName'] . '" value="' . $params['itemFormElValue'] . '" />';
59
+        $output = '<input type="hidden" name="'.$params['itemFormElName'].'" value="'.$params['itemFormElValue'].'" />';
60 60
         if (!empty($params['itemFormElValue'])) {
61
-            $output .= '<img alt="Thumbnail" title="' . $params['itemFormElValue'] . '" src="' . $params['itemFormElValue'] . '" />';
61
+            $output .= '<img alt="Thumbnail" title="'.$params['itemFormElValue'].'" src="'.$params['itemFormElValue'].'" />';
62 62
         }
63 63
         return $output;
64 64
     }
Please login to merge, or discard this patch.
Classes/Common/AbstractPlugin.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             $templateFile = $this->conf['templateFile'];
82 82
         } else {
83 83
             // Load default template from extension.
84
-            $templateFile = 'EXT:' . $this->extKey . '/Resources/Private/Templates/' . Helper::getUnqualifiedClassName(get_class($this)) . '.tmpl';
84
+            $templateFile = 'EXT:'.$this->extKey.'/Resources/Private/Templates/'.Helper::getUnqualifiedClassName(get_class($this)).'.tmpl';
85 85
         }
86 86
         // Substitute strings like "EXT:" in given template file location.
87 87
         $fileResource = $GLOBALS['TSFE']->tmpl->getFileName($templateFile);
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
             $conf = Helper::mergeRecursiveWithOverrule($flexFormConf, $conf);
108 108
         }
109 109
         // Read plugin TS configuration.
110
-        $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '.'];
110
+        $pluginConf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_dlf_'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'.'];
111 111
         if (is_array($pluginConf)) {
112 112
             $conf = Helper::mergeRecursiveWithOverrule($pluginConf, $conf);
113 113
         }
114 114
         // Read general TS configuration.
115
-        $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId . '.'];
115
+        $generalConf = $GLOBALS['TSFE']->tmpl->setup['plugin.'][$this->prefixId.'.'];
116 116
         if (is_array($generalConf)) {
117 117
             $conf = Helper::mergeRecursiveWithOverrule($generalConf, $conf);
118 118
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         // Set default plugin variables.
128 128
         $this->pi_setPiVarDefaults();
129 129
         // Load translation files.
130
-        $this->pi_loadLL('EXT:' . $this->extKey . '/Resources/Private/Language/' . Helper::getUnqualifiedClassName(get_class($this)) . '.xml');
130
+        $this->pi_loadLL('EXT:'.$this->extKey.'/Resources/Private/Language/'.Helper::getUnqualifiedClassName(get_class($this)).'.xml');
131 131
     }
132 132
 
133 133
     /**
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             if (!$this->doc->ready) {
152 152
                 // Destroy the incomplete object.
153 153
                 $this->doc = null;
154
-                $this->logger->error('Failed to load document with UID ' . $this->piVars['id']);
154
+                $this->logger->error('Failed to load document with UID '.$this->piVars['id']);
155 155
             } else {
156 156
                 // Set configuration PID.
157 157
                 $this->doc->cPid = $this->conf['pages'];
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
                 // Try to load document.
180 180
                 $this->loadDocument();
181 181
             } else {
182
-                $this->logger->error('Failed to load document with record ID "' . $this->piVars['recordId'] . '"');
182
+                $this->logger->error('Failed to load document with record ID "'.$this->piVars['recordId'].'"');
183 183
             }
184 184
         } else {
185
-            $this->logger->error('Invalid UID ' . $this->piVars['id'] . ' or PID ' . $this->conf['pages'] . ' for document loading');
185
+            $this->logger->error('Invalid UID '.$this->piVars['id'].' or PID '.$this->conf['pages'].' for document loading');
186 186
         }
187 187
     }
188 188
 
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
         if (!$cache) {
236 236
             $conf['no_cache'] = true;
237 237
         }
238
-        $conf['parameter'] = $altPageId ?: ($this->pi_tmpPageId ?: 'current');
239
-        $conf['additionalParams'] = $this->conf['parent.']['addParams'] . HttpUtility::buildQueryString($urlParameters, '&', true) . $this->pi_moreParams;
238
+        $conf['parameter'] = $altPageId ? : ($this->pi_tmpPageId ? : 'current');
239
+        $conf['additionalParams'] = $this->conf['parent.']['addParams'].HttpUtility::buildQueryString($urlParameters, '&', true).$this->pi_moreParams;
240 240
         // Add additional configuration for absolute URLs.
241 241
         $conf['forceAbsoluteUrl'] = !empty($this->conf['forceAbsoluteUrl']) ? 1 : 0;
242 242
         $conf['forceAbsoluteUrl.']['scheme'] = !empty($this->conf['forceAbsoluteUrl']) && !empty($this->conf['forceAbsoluteUrlHttps']) ? 'https' : 'http';
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
     {
258 258
         if (!$this->frontendController->config['config']['disableWrapInBaseClass']) {
259 259
             // Use class name instead of $this->prefixId for content wrapping because $this->prefixId is the same for all plugins.
260
-            $content = '<div class="tx-dlf-' . strtolower(Helper::getUnqualifiedClassName(get_class($this))) . '">' . $content . '</div>';
260
+            $content = '<div class="tx-dlf-'.strtolower(Helper::getUnqualifiedClassName(get_class($this))).'">'.$content.'</div>';
261 261
             if (!$this->frontendController->config['config']['disablePrefixComment']) {
262
-                $content = "\n\n<!-- BEGIN: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n" . $content . "\n\n<!-- END: Content of extension '" . $this->extKey . "', plugin '" . Helper::getUnqualifiedClassName(get_class($this)) . "' -->\n\n";
262
+                $content = "\n\n<!-- BEGIN: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n".$content."\n\n<!-- END: Content of extension '".$this->extKey."', plugin '".Helper::getUnqualifiedClassName(get_class($this))."' -->\n\n";
263 263
             }
264 264
         }
265 265
         return $content;
Please login to merge, or discard this patch.