Passed
Pull Request — master (#107)
by
unknown
03:07
created
Classes/Common/MetsDocument.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         $fileMimeType = $this->getFileMimeType($id);
169 169
         $fileLocation = $this->getFileLocation($id);
170 170
         if ($fileMimeType === 'application/vnd.kitodo.iiif') {
171
-            $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation . 'info.json' : $fileLocation . '/info.json');
171
+            $fileLocation = (strrpos($fileLocation, 'info.json') === strlen($fileLocation) - 9) ? $fileLocation : (strrpos($fileLocation, '/') === strlen($fileLocation) ? $fileLocation.'info.json' : $fileLocation.'/info.json');
172 172
             $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey);
173 173
             IiifHelper::setUrlReader(IiifUrlReader::getInstance());
174 174
             IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
                 return $service->getImageUrl();
179 179
             }
180 180
         } elseif ($fileMimeType === 'application/vnd.netfpx') {
181
-            $baseURL = $fileLocation . (strpos($fileLocation, '?') === false ? '?' : '');
181
+            $baseURL = $fileLocation.(strpos($fileLocation, '?') === false ? '?' : '');
182 182
             // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server'
183
-            return $baseURL . '&CVT=jpeg';
183
+            return $baseURL.'&CVT=jpeg';
184 184
         }
185 185
         return $fileLocation;
186 186
     }
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function getFileLocation($id)
193 193
     {
194
-        $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]');
194
+        $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/mets:FLocat[@LOCTYPE="URL"]');
195 195
         if (
196 196
             !empty($id)
197 197
             && !empty($location)
198 198
         ) {
199 199
             return (string) $location[0]->attributes('http://www.w3.org/1999/xlink')->href;
200 200
         } else {
201
-            $this->logger->warning('There is no file node with @ID "' . $id . '"');
201
+            $this->logger->warning('There is no file node with @ID "'.$id.'"');
202 202
             return '';
203 203
         }
204 204
     }
@@ -209,14 +209,14 @@  discard block
 block discarded – undo
209 209
      */
210 210
     public function getFileMimeType($id)
211 211
     {
212
-        $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE');
212
+        $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="'.$id.'"]/@MIMETYPE');
213 213
         if (
214 214
             !empty($id)
215 215
             && !empty($mimetype)
216 216
         ) {
217 217
             return (string) $mimetype[0];
218 218
         } else {
219
-            $this->logger->warning('There is no file node with @ID "' . $id . '" or no MIME type specified');
219
+            $this->logger->warning('There is no file node with @ID "'.$id.'" or no MIME type specified');
220 220
             return '';
221 221
         }
222 222
     }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             return $this->logicalUnits[$id];
238 238
         } elseif (!empty($id)) {
239 239
             // Get specified logical unit.
240
-            $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]');
240
+            $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]');
241 241
         } else {
242 242
             // Get all logical units at top level.
243 243
             $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]/mets:div');
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
             // Retain current PID.
378 378
             $cPid = ($this->cPid ? $this->cPid : $this->pid);
379 379
         } elseif (!$cPid) {
380
-            $this->logger->warning('Invalid PID ' . $cPid . ' for metadata definitions');
380
+            $this->logger->warning('Invalid PID '.$cPid.' for metadata definitions');
381 381
             return [];
382 382
         }
383 383
         // Get metadata from parsed metadata array if available.
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
         if (!empty($this->logicalUnits[$id])) {
419 419
             $dmdIds = $this->logicalUnits[$id]['dmdId'];
420 420
         } else {
421
-            $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@DMDID');
421
+            $dmdIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@DMDID');
422 422
             $dmdIds = (string) $dmdIds[0];
423 423
         }
424 424
         if (!empty($dmdIds)) {
@@ -444,11 +444,11 @@  discard block
 block discarded – undo
444 444
                     ) {
445 445
                         $obj->extractMetadata($this->dmdSec[$dmdId]['xml'], $metadata);
446 446
                     } else {
447
-                        $this->logger->warning('Invalid class/method "' . $class . '->extractMetadata()" for metadata format "' . $this->dmdSec[$dmdId]['type'] . '"');
447
+                        $this->logger->warning('Invalid class/method "'.$class.'->extractMetadata()" for metadata format "'.$this->dmdSec[$dmdId]['type'].'"');
448 448
                     }
449 449
                 }
450 450
             } else {
451
-                $this->logger->notice('Unsupported metadata format "' . $this->dmdSec[$dmdId]['type'] . '" in dmdSec with @ID "' . $dmdId . '"');
451
+                $this->logger->notice('Unsupported metadata format "'.$this->dmdSec[$dmdId]['type'].'" in dmdSec with @ID "'.$dmdId.'"');
452 452
                 // Continue searching for supported metadata with next @DMDID.
453 453
                 continue;
454 454
             }
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
             if (!empty($this->logicalUnits[$id])) {
457 457
                 $metadata['type'] = [$this->logicalUnits[$id]['type']];
458 458
             } else {
459
-                $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $id . '"]/@TYPE');
459
+                $struct = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$id.'"]/@TYPE');
460 460
                 if (!empty($struct)) {
461 461
                     $metadata['type'] = [(string) $struct[0]];
462 462
                 }
@@ -573,13 +573,13 @@  discard block
 block discarded – undo
573 573
                             $values instanceof \DOMNodeList
574 574
                             && $values->length > 0
575 575
                         ) {
576
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values->item(0)->nodeValue);
576
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values->item(0)->nodeValue);
577 577
                         } elseif (!($values instanceof \DOMNodeList)) {
578
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $values);
578
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $values);
579 579
                         }
580 580
                     }
581
-                    if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) {
582
-                        $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0];
581
+                    if (empty($metadata[$resArray['index_name'].'_sorting'][0])) {
582
+                        $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0];
583 583
                     }
584 584
                 }
585 585
             }
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
         if ($hasSupportedMetadata) {
596 596
             return $metadata;
597 597
         } else {
598
-            $this->logger->warning('No supported metadata found for logical structure with @ID "' . $id . '"');
598
+            $this->logger->warning('No supported metadata found for logical structure with @ID "'.$id.'"');
599 599
             return [];
600 600
         }
601 601
     }
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
      */
623 623
     public function getStructureDepth($logId)
624 624
     {
625
-        $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*');
625
+        $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*');
626 626
         if (!empty($ancestors)) {
627 627
             return count($ancestors);
628 628
         } else {
@@ -646,9 +646,9 @@  discard block
 block discarded – undo
646 646
             $this->registerNamespaces($this->mets);
647 647
         } else {
648 648
             if (!empty($location)) {
649
-                $this->logger->error('No METS part found in document with location "' . $location . '".');
649
+                $this->logger->error('No METS part found in document with location "'.$location.'".');
650 650
             } else if (!empty($this->recordId)) {
651
-                $this->logger->error('No METS part found in document with recordId "' . $this->recordId . '".');
651
+                $this->logger->error('No METS part found in document with recordId "'.$this->recordId.'".');
652 652
             } else {
653 653
                 $this->logger->error('No METS part found in current document.');
654 654
             }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
                 return true;
671 671
             }
672 672
         }
673
-        $this->logger->error('Could not load XML file from "' . $location . '"');
673
+        $this->logger->error('Could not load XML file from "'.$location.'"');
674 674
         return false;
675 675
     }
676 676
 
@@ -725,15 +725,15 @@  discard block
 block discarded – undo
725 725
             $dmdIds = $this->mets->xpath('./mets:dmdSec/@ID');
726 726
             if (!empty($dmdIds)) {
727 727
                 foreach ($dmdIds as $dmdId) {
728
-                    if ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) {
728
+                    if ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[not(@MDTYPE="OTHER")]/@MDTYPE')) {
729 729
                         if (!empty($this->formats[(string) $type[0]])) {
730 730
                             $type = (string) $type[0];
731
-                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']);
731
+                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
732 732
                         }
733
-                    } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) {
733
+                    } elseif ($type = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"]/@OTHERMDTYPE')) {
734 734
                         if (!empty($this->formats[(string) $type[0]])) {
735 735
                             $type = (string) $type[0];
736
-                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="' . (string) $dmdId . '"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="' . $type . '"]/mets:xmlData/' . strtolower($type) . ':' . $this->formats[$type]['rootElement']);
736
+                            $xml = $this->mets->xpath('./mets:dmdSec[@ID="'.(string) $dmdId.'"]/mets:mdWrap[@MDTYPE="OTHER"][@OTHERMDTYPE="'.$type.'"]/mets:xmlData/'.strtolower($type).':'.$this->formats[$type]['rootElement']);
737 737
                         }
738 738
                     }
739 739
                     if (!empty($xml)) {
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
             // Retain current PID.
919 919
             $cPid = ($this->cPid ? $this->cPid : $this->pid);
920 920
             if (!$cPid) {
921
-                $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions');
921
+                $this->logger->error('Invalid PID '.$cPid.' for structure definitions');
922 922
                 $this->thumbnailLoaded = true;
923 923
                 return $this->thumbnail;
924 924
             }
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
                 if (!empty($resArray['thumbnail'])) {
956 956
                     $strctType = Helper::getIndexNameFromUid($resArray['thumbnail'], 'tx_dlf_structures', $cPid);
957 957
                     // Check if this document has a structure element of the desired type.
958
-                    $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="' . $strctType . '"]/@ID');
958
+                    $strctIds = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@TYPE="'.$strctType.'"]/@ID');
959 959
                     if (!empty($strctIds)) {
960 960
                         $strctId = (string) $strctIds[0];
961 961
                     }
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
                     }
979 979
                 }
980 980
             } else {
981
-                $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database');
981
+                $this->logger->error('No structure of type "'.$metadata['type'][0].'" found in database');
982 982
             }
983 983
             $this->thumbnailLoaded = true;
984 984
         }
Please login to merge, or discard this patch.
Classes/Common/Doc.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -569,14 +569,14 @@  discard block
 block discarded – undo
569 569
                     if ($fileContent !== false) {
570 570
                         $textFormat = $this->getTextFormat($fileContent);
571 571
                     } else {
572
-                        $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"');
572
+                        $this->logger->warning('Couldn\'t load full text file for structure node @ID "'.$id.'"');
573 573
                         return $fullText;
574 574
                     }
575 575
                     break;
576 576
                 }
577 577
             }
578 578
         } else {
579
-            $this->logger->warning('Invalid structure node @ID "' . $id . '"');
579
+            $this->logger->warning('Invalid structure node @ID "'.$id.'"');
580 580
             return $fullText;
581 581
         }
582 582
         // Is this text format supported?
@@ -595,12 +595,12 @@  discard block
 block discarded – undo
595 595
                     $textMiniOcr = $obj->getTextAsMiniOcr($ocrTextXml);
596 596
                     $this->rawTextArray[$id] = $textMiniOcr;
597 597
                 } else {
598
-                    $this->logger->warning('Invalid class/method "' . $class . '->getRawText()" for text format "' . $textFormat . '"');
598
+                    $this->logger->warning('Invalid class/method "'.$class.'->getRawText()" for text format "'.$textFormat.'"');
599 599
                 }
600 600
             }
601 601
             $fullText = $textMiniOcr;
602 602
         } else {
603
-            $this->logger->warning('Unsupported text format "' . $textFormat . '" in physical node with @ID "' . $id . '"');
603
+            $this->logger->warning('Unsupported text format "'.$textFormat.'" in physical node with @ID "'.$id.'"');
604 604
         }
605 605
         return $fullText;
606 606
     }
@@ -674,10 +674,10 @@  discard block
 block discarded – undo
674 674
                     $title = self::getTitle($partof, true);
675 675
                 }
676 676
             } else {
677
-                Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING);
677
+                Helper::log('No document with UID '.$uid.' found or document not accessible', LOG_SEVERITY_WARNING);
678 678
             }
679 679
         } else {
680
-            Helper::log('Invalid UID ' . $uid . ' for document', LOG_SEVERITY_ERROR);
680
+            Helper::log('Invalid UID '.$uid.' for document', LOG_SEVERITY_ERROR);
681 681
         }
682 682
         return $title;
683 683
     }
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
             // the actual loading is format specific
809 809
             return $this->loadLocation($location);
810 810
         } else {
811
-            $this->logger->error('Invalid file location "' . $location . '" for document loading');
811
+            $this->logger->error('Invalid file location "'.$location.'" for document loading');
812 812
         }
813 813
         return false;
814 814
     }
@@ -949,7 +949,7 @@  discard block
 block discarded – undo
949 949
         // Set metadata definitions' PID.
950 950
         $cPid = ($this->cPid ? $this->cPid : $this->pid);
951 951
         if (!$cPid) {
952
-            $this->logger->error('Invalid PID ' . $cPid . ' for metadata definitions');
952
+            $this->logger->error('Invalid PID '.$cPid.' for metadata definitions');
953 953
             return [];
954 954
         }
955 955
         if (
@@ -1184,12 +1184,12 @@  discard block
 block discarded – undo
1184 1184
      */
1185 1185
     public function __get($var)
1186 1186
     {
1187
-        $method = '_get' . ucfirst($var);
1187
+        $method = '_get'.ucfirst($var);
1188 1188
         if (
1189 1189
             !property_exists($this, $var)
1190 1190
             || !method_exists($this, $method)
1191 1191
         ) {
1192
-            $this->logger->warning('There is no getter function for property "' . $var . '"');
1192
+            $this->logger->warning('There is no getter function for property "'.$var.'"');
1193 1193
             return;
1194 1194
         } else {
1195 1195
             return $this->$method();
@@ -1222,12 +1222,12 @@  discard block
 block discarded – undo
1222 1222
      */
1223 1223
     public function __set($var, $value)
1224 1224
     {
1225
-        $method = '_set' . ucfirst($var);
1225
+        $method = '_set'.ucfirst($var);
1226 1226
         if (
1227 1227
             !property_exists($this, $var)
1228 1228
             || !method_exists($this, $method)
1229 1229
         ) {
1230
-            $this->logger->warning('There is no setter function for property "' . $var . '"');
1230
+            $this->logger->warning('There is no setter function for property "'.$var.'"');
1231 1231
         } else {
1232 1232
             $this->$method($value);
1233 1233
         }
Please login to merge, or discard this patch.
Classes/Command/BaseCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
 
275 275
         if ($doc !== null) {
276 276
             // Get the closest ancestor of the current document which has a MPTR child.
277
-            $parentMptr = $doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $doc->toplevelId . '"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr');
277
+            $parentMptr = $doc->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$doc->toplevelId.'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr');
278 278
             if (!empty($parentMptr)) {
279 279
                 $parentLocation = (string) $parentMptr[0]->attributes('http://www.w3.org/1999/xlink')->href;
280 280
 
Please login to merge, or discard this patch.
Classes/Command/IndexCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->initializeRepositories($input->getOption('pid'));
97 97
 
98 98
         if ($this->storagePid == 0) {
99
-            $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.');
99
+            $io->error('ERROR: No valid PID ('.$this->storagePid.') given.');
100 100
             exit(1);
101 101
         }
102 102
 
@@ -111,13 +111,13 @@  discard block
 block discarded – undo
111 111
             if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) {
112 112
                 $output_solrCores = [];
113 113
                 foreach ($allSolrCores as $index_name => $uid) {
114
-                    $output_solrCores[] = $uid . ' : ' . $index_name;
114
+                    $output_solrCores[] = $uid.' : '.$index_name;
115 115
                 }
116 116
                 if (empty($output_solrCores)) {
117
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n");
117
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n");
118 118
                     exit(1);
119 119
                 } else {
120
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n");
120
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n");
121 121
                     exit(1);
122 122
                 }
123 123
             }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
             $document = $this->documentRepository->findByUid($input->getOption('doc'));
158 158
 
159 159
             if ($document === null) {
160
-                $io->error('ERROR: Document with UID "' . $input->getOption('doc') . '" could not be found on PID ' . $this->storagePid . ' .');
160
+                $io->error('ERROR: Document with UID "'.$input->getOption('doc').'" could not be found on PID '.$this->storagePid.' .');
161 161
                 exit(1);
162 162
             } else {
163 163
                 $doc = Doc::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true);
@@ -182,17 +182,17 @@  discard block
 block discarded – undo
182 182
         }
183 183
 
184 184
         if ($doc === null) {
185
-            $io->error('ERROR: Document "' . $input->getOption('doc') . '" could not be loaded.');
185
+            $io->error('ERROR: Document "'.$input->getOption('doc').'" could not be loaded.');
186 186
             exit(1);
187 187
         }
188 188
 
189 189
         $document->setSolrcore($solrCoreUid);
190 190
 
191 191
         if ($dryRun) {
192
-            $io->section('DRY RUN: Would index ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
192
+            $io->section('DRY RUN: Would index '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
193 193
         } else {
194 194
             if ($io->isVerbose()) {
195
-                $io->section('Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
195
+                $io->section('Indexing '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
196 196
             }
197 197
             $document->setDoc($doc);
198 198
             // save to database
Please login to merge, or discard this patch.
Classes/Command/ReindexCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $this->initializeRepositories($input->getOption('pid'));
101 101
 
102 102
         if ($this->storagePid == 0) {
103
-            $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.');
103
+            $io->error('ERROR: No valid PID ('.$this->storagePid.') given.');
104 104
             exit(1);
105 105
         }
106 106
 
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
             if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) {
116 116
                 $output_solrCores = [];
117 117
                 foreach ($allSolrCores as $index_name => $uid) {
118
-                    $output_solrCores[] = $uid . ' : ' . $index_name;
118
+                    $output_solrCores[] = $uid.' : '.$index_name;
119 119
                 }
120 120
                 if (empty($output_solrCores)) {
121
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n");
121
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n");
122 122
                     exit(1);
123 123
                 } else {
124
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n");
124
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n");
125 125
                     exit(1);
126 126
                 }
127 127
             }
@@ -163,15 +163,15 @@  discard block
 block discarded – undo
163 163
             $doc = Doc::getInstance($document->getLocation(), ['storagePid' => $this->storagePid], true);
164 164
 
165 165
             if ($doc === null) {
166
-                $io->warning('WARNING: Document "' . $document->getLocation() . '" could not be loaded. Skip to next document.');
166
+                $io->warning('WARNING: Document "'.$document->getLocation().'" could not be loaded. Skip to next document.');
167 167
                 continue;
168 168
             }
169 169
 
170 170
             if ($dryRun) {
171
-                $io->writeln('DRY RUN: Would index ' . ($id + 1) . '/' . count($documents) . '  with UID "' . $document->getUid() . '" ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
171
+                $io->writeln('DRY RUN: Would index '.($id + 1).'/'.count($documents).'  with UID "'.$document->getUid().'" ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
172 172
             } else {
173 173
                 if ($io->isVerbose()) {
174
-                    $io->writeln(date('Y-m-d H:i:s') . ' Indexing ' . ($id + 1) . '/' . count($documents) . ' with UID "' . $document->getUid() . '" ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
174
+                    $io->writeln(date('Y-m-d H:i:s').' Indexing '.($id + 1).'/'.count($documents).' with UID "'.$document->getUid().'" ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
175 175
                 }
176 176
                 $document->setDoc($doc);
177 177
                 // save to database
Please login to merge, or discard this patch.
Classes/Command/HarvestCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $this->initializeRepositories($input->getOption('pid'));
111 111
 
112 112
         if ($this->storagePid == 0) {
113
-            $io->error('ERROR: No valid PID (' . $this->storagePid . ') given.');
113
+            $io->error('ERROR: No valid PID ('.$this->storagePid.') given.');
114 114
             exit(1);
115 115
         }
116 116
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
             if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) {
129 129
                 $output_solrCores = [];
130 130
                 foreach ($allSolrCores as $index_name => $uid) {
131
-                    $output_solrCores[] = $uid . ' : ' . $index_name;
131
+                    $output_solrCores[] = $uid.' : '.$index_name;
132 132
                 }
133 133
                 if (empty($output_solrCores)) {
134
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. No valid cores found on PID ' . $this->storagePid . ".\n");
134
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. No valid cores found on PID '.$this->storagePid.".\n");
135 135
                     exit(1);
136 136
                 } else {
137
-                    $io->error('ERROR: No valid Solr core ("' . $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . implode("\n", $output_solrCores) . "\n");
137
+                    $io->error('ERROR: No valid Solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".implode("\n", $output_solrCores)."\n");
138 138
                     exit(1);
139 139
                 }
140 140
             }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             exit(1);
155 155
         }
156 156
         if (!GeneralUtility::isValidUrl($baseUrl)) {
157
-            $io->error('ERROR: No valid OAI Base URL set for library with given UID ("' . $input->getOption('lib') . '").');
157
+            $io->error('ERROR: No valid OAI Base URL set for library with given UID ("'.$input->getOption('lib').'").');
158 158
             exit(1);
159 159
         } else {
160 160
             try {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
                 }
196 196
             }
197 197
             if (empty($set)) {
198
-                $io->error('ERROR: OAI interface does not provide a set with given setSpec ("' . $input->getOption('set') . '").');
198
+                $io->error('ERROR: OAI interface does not provide a set with given setSpec ("'.$input->getOption('set').'").');
199 199
                 exit(1);
200 200
             }
201 201
         }
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         }
209 209
 
210 210
         // Process all identifiers.
211
-        $baseLocation = $baseUrl . (parse_url($baseUrl, PHP_URL_QUERY) ? '&' : '?');
211
+        $baseLocation = $baseUrl.(parse_url($baseUrl, PHP_URL_QUERY) ? '&' : '?');
212 212
         foreach ($identifiers as $identifier) {
213 213
             // Build OAI GetRecord URL...
214 214
             $params = [
@@ -216,13 +216,13 @@  discard block
 block discarded – undo
216 216
                 'metadataPrefix' => 'mets',
217 217
                 'identifier' => (string) $identifier->identifier
218 218
             ];
219
-            $docLocation = $baseLocation . http_build_query($params);
219
+            $docLocation = $baseLocation.http_build_query($params);
220 220
             // ...index the document...
221 221
             $document = null;
222 222
             $doc = Doc::getInstance($docLocation, ['storagePid' => $this->storagePid], true);
223 223
 
224 224
             if ($doc === null) {
225
-                $io->warning('WARNING: Document "' . $docLocation . '" could not be loaded. Skip to next document.');
225
+                $io->warning('WARNING: Document "'.$docLocation.'" could not be loaded. Skip to next document.');
226 226
                 continue;
227 227
             }
228 228
 
@@ -239,10 +239,10 @@  discard block
 block discarded – undo
239 239
             $document->setSolrcore($solrCoreUid);
240 240
 
241 241
             if ($dryRun) {
242
-                $io->writeln('DRY RUN: Would index ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
242
+                $io->writeln('DRY RUN: Would index '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
243 243
             } else {
244 244
                 if ($io->isVerbose()) {
245
-                    $io->writeln(date('Y-m-d H:i:s') . ' Indexing ' . $document->getUid() . ' ("' . $document->getLocation() . '") on PID ' . $this->storagePid . ' and Solr core ' . $solrCoreUid . '.');
245
+                    $io->writeln(date('Y-m-d H:i:s').' Indexing '.$document->getUid().' ("'.$document->getLocation().'") on PID '.$this->storagePid.' and Solr core '.$solrCoreUid.'.');
246 246
                 }
247 247
                 $document->setDoc($doc);
248 248
                 // save to database
@@ -267,6 +267,6 @@  discard block
 block discarded – undo
267 267
      */
268 268
     protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io)
269 269
     {
270
-        $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:' . "\n    " . $exception->getMessage());
270
+        $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:'."\n    ".$exception->getMessage());
271 271
     }
272 272
 }
Please login to merge, or discard this patch.
Classes/Updates/MigrateSettings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function getDescription(): string
56 56
     {
57
-        return 'This wizard migrates existing front end plugins of the extension Kitodo.Presentation (dlf) to' .
58
-            ' make use of the Extbase naming scheme. Therefore it updates the field values' .
57
+        return 'This wizard migrates existing front end plugins of the extension Kitodo.Presentation (dlf) to'.
58
+            ' make use of the Extbase naming scheme. Therefore it updates the field values'.
59 59
             ' "pi_flexform" within the tt_content table';
60 60
     }
61 61
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         foreach ($fields as $field) {
171 171
             // change the index attribute if it doesn't start with 'settings.' yet
172 172
             if (strpos($field['index'], 'settings.') === false) {
173
-                $field['index'] = 'settings.' . $field['index'];
173
+                $field['index'] = 'settings.'.$field['index'];
174 174
             }
175 175
         }
176 176
 
Please login to merge, or discard this patch.
Classes/Updates/FileLocationUpdater.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
                             $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
173 173
                         ),
174 174
                         $queryBuilder->expr()->comparison(
175
-                            'CAST(CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS DECIMAL) AS CHAR)',
175
+                            'CAST(CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS DECIMAL) AS CHAR)',
176 176
                             ExpressionBuilder::NEQ,
177
-                            'CAST(' . $queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]) . ' AS CHAR)'
177
+                            'CAST('.$queryBuilder->quoteIdentifier($this->fieldsToMigrate[$table]).' AS CHAR)'
178 178
                         )
179 179
                     )
180 180
                     ->orderBy('uid')
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 }
188 188
             } catch (DBALException $e) {
189 189
                 throw new \RuntimeException(
190
-                    'Database query failed. Error was: ' . $e->getPrevious()->getMessage(),
190
+                    'Database query failed. Error was: '.$e->getPrevious()->getMessage(),
191 191
                     1511950673
192 192
                 );
193 193
             }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
247 247
 
248 248
         $fileUid = null;
249
-        $sourcePath = Environment::getPublicPath() . '/' . $fieldItem;
249
+        $sourcePath = Environment::getPublicPath().'/'.$fieldItem;
250 250
 
251 251
         // maybe the file was already moved, so check if the original file still exists
252 252
         if (file_exists($sourcePath)) {
Please login to merge, or discard this patch.
Classes/Common/Indexer.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                         $parent->setDoc($doc);
116 116
                         $success = self::add($parent);
117 117
                     } else {
118
-                        Helper::log('Could not load parent document with UID ' . $document->getDoc()->parentId, LOG_SEVERITY_ERROR);
118
+                        Helper::log('Could not load parent document with UID '.$document->getDoc()->parentId, LOG_SEVERITY_ERROR);
119 119
                         return false;
120 120
                     }
121 121
                 }
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 self::$processedDocs[] = $document->getUid();
126 126
                 // Delete old Solr documents.
127 127
                 $updateQuery = self::$solr->service->createUpdate();
128
-                $updateQuery->addDeleteQuery('uid:' . $document->getUid());
128
+                $updateQuery->addDeleteQuery('uid:'.$document->getUid());
129 129
                 self::$solr->service->update($updateQuery);
130 130
 
131 131
                 // Index every logical unit as separate Solr document.
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
             } catch (\Exception $e) {
175 175
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
176 176
                     Helper::addMessage(
177
-                        Helper::getLanguageService()->getLL('flash.solrException') . ' ' . htmlspecialchars($e->getMessage()),
177
+                        Helper::getLanguageService()->getLL('flash.solrException').' '.htmlspecialchars($e->getMessage()),
178 178
                         Helper::getLanguageService()->getLL('flash.error'),
179 179
                         FlashMessage::ERROR,
180 180
                         true,
181 181
                         'core.template.flashMessages'
182 182
                     );
183 183
                 }
184
-                Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
184
+                Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR);
185 185
                 return false;
186 186
             }
187 187
         } else {
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         // Sanitize input.
215 215
         $pid = max(intval($pid), 0);
216 216
         if (!$pid) {
217
-            Helper::log('Invalid PID ' . $pid . ' for metadata configuration', LOG_SEVERITY_ERROR);
217
+            Helper::log('Invalid PID '.$pid.' for metadata configuration', LOG_SEVERITY_ERROR);
218 218
             return '';
219 219
         }
220 220
         // Load metadata configuration.
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         $suffix = (in_array($index_name, self::$fields['tokenized']) ? 't' : 'u');
224 224
         $suffix .= (in_array($index_name, self::$fields['stored']) ? 's' : 'u');
225 225
         $suffix .= (in_array($index_name, self::$fields['indexed']) ? 'i' : 'u');
226
-        $index_name .= '_' . $suffix;
226
+        $index_name .= '_'.$suffix;
227 227
         return $index_name;
228 228
     }
229 229
 
@@ -356,11 +356,11 @@  discard block
 block discarded – undo
356 356
                     $solrDoc->setField(self::getIndexFieldName($index_name, $document->getPid()), $data, self::$fields['fieldboost'][$index_name]);
357 357
                     if (in_array($index_name, self::$fields['sortables'])) {
358 358
                         // Add sortable fields to index.
359
-                        $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]);
359
+                        $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
360 360
                     }
361 361
                     if (in_array($index_name, self::$fields['facets'])) {
362 362
                         // Add facets to index.
363
-                        $solrDoc->setField($index_name . '_faceting', $data);
363
+                        $solrDoc->setField($index_name.'_faceting', $data);
364 364
                     }
365 365
                     if (in_array($index_name, self::$fields['autocomplete'])) {
366 366
                         $autocomplete = array_merge($autocomplete, $data);
@@ -385,14 +385,14 @@  discard block
 block discarded – undo
385 385
             } catch (\Exception $e) {
386 386
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
387 387
                     Helper::addMessage(
388
-                        Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
388
+                        Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()),
389 389
                         Helper::getLanguageService()->getLL('flash.error'),
390 390
                         FlashMessage::ERROR,
391 391
                         true,
392 392
                         'core.template.flashMessages'
393 393
                     );
394 394
                 }
395
-                Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
395
+                Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR);
396 396
                 return false;
397 397
             }
398 398
         }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                                 $data = self::removeAppendsFromAuthor($data);
459 459
                             }
460 460
                             // Add facets to index.
461
-                            $solrDoc->setField($index_name . '_faceting', $data);
461
+                            $solrDoc->setField($index_name.'_faceting', $data);
462 462
                         }
463 463
                     }
464 464
                 }
@@ -476,14 +476,14 @@  discard block
 block discarded – undo
476 476
             } catch (\Exception $e) {
477 477
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
478 478
                     Helper::addMessage(
479
-                        Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
479
+                        Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()),
480 480
                         Helper::getLanguageService()->getLL('flash.error'),
481 481
                         FlashMessage::ERROR,
482 482
                         true,
483 483
                         'core.template.flashMessages'
484 484
                     );
485 485
                 }
486
-                Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
486
+                Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR);
487 487
                 return false;
488 488
             }
489 489
         }
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
     private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') {
535 535
         $solrDoc = $updateQuery->createDocument();
536 536
         // Create unique identifier from document's UID and unit's XML ID.
537
-        $solrDoc->setField('id', $document->getUid() . $unit['id']);
537
+        $solrDoc->setField('id', $document->getUid().$unit['id']);
538 538
         $solrDoc->setField('uid', $document->getUid());
539 539
         $solrDoc->setField('pid', $document->getPid());
540 540
         $solrDoc->setField('partof', $document->getPartof());
Please login to merge, or discard this patch.