Passed
Pull Request — master (#123)
by Sebastian
03:43
created
Classes/Api/Orcid/Profile.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
             $this->raw->registerXPathNamespace('personal-details', 'http://www.orcid.org/ns/personal-details');
130 130
             $givenNames = $this->raw->xpath('./personal-details:name/personal-details:given-names');
131 131
             $familyName = $this->raw->xpath('./personal-details:name/personal-details:family-name');
132
-            return (string) $givenNames[0] . ' ' . (string) $familyName[0];
132
+            return (string) $givenNames[0].' '.(string) $familyName[0];
133 133
         } else {
134 134
             $this->logger->warning('No name found for given ORCID');
135 135
             return false;
Please login to merge, or discard this patch.
Classes/Common/Helper.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                 if (!preg_match('/\d{8}-\d{1}/i', $id)) {
144 144
                     return false;
145 145
                 } elseif ($checksum == 10) {
146
-                    return self::checkIdentifier(($digits + 1) . substr($id, -2, 2), 'SWD');
146
+                    return self::checkIdentifier(($digits + 1).substr($id, -2, 2), 'SWD');
147 147
                 } elseif (substr($id, -1, 1) != $checksum) {
148 148
                     return false;
149 149
                 }
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $encrypted = openssl_encrypt($string, self::$cipherAlgorithm, $key, OPENSSL_RAW_DATA, $iv);
316 316
         // Merge initialisation vector and encrypted data.
317 317
         if ($encrypted !== false) {
318
-            $encrypted = base64_encode($iv . $encrypted);
318
+            $encrypted = base64_encode($iv.$encrypted);
319 319
         }
320 320
         return $encrypted;
321 321
     }
@@ -369,8 +369,8 @@  discard block
 block discarded – undo
369 369
     public static function getHookObjects($scriptRelPath)
370 370
     {
371 371
         $hookObjects = [];
372
-        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'])) {
373
-            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey . '/' . $scriptRelPath]['hookClass'] as $classRef) {
372
+        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'])) {
373
+            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][self::$extKey.'/'.$scriptRelPath]['hookClass'] as $classRef) {
374 374
                 $hookObjects[] = GeneralUtility::makeInstance($classRef);
375 375
             }
376 376
         }
@@ -397,12 +397,12 @@  discard block
 block discarded – undo
397 397
             // NOTE: Only use tables that don't have too many entries!
398 398
             || !in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures', 'tx_dlf_solrcores'])
399 399
         ) {
400
-            self::log('Invalid UID "' . $uid . '" or table "' . $table . '"', LOG_SEVERITY_ERROR);
400
+            self::log('Invalid UID "'.$uid.'" or table "'.$table.'"', LOG_SEVERITY_ERROR);
401 401
             return '';
402 402
         }
403 403
 
404
-        $makeCacheKey = function ($pid, $uid) {
405
-            return $pid . '.' . $uid;
404
+        $makeCacheKey = function($pid, $uid) {
405
+            return $pid.'.'.$uid;
406 406
         };
407 407
 
408 408
         static $cache = [];
@@ -412,9 +412,9 @@  discard block
 block discarded – undo
412 412
 
413 413
             $result = $queryBuilder
414 414
                 ->select(
415
-                    $table . '.index_name AS index_name',
416
-                    $table . '.uid AS uid',
417
-                    $table . '.pid AS pid',
415
+                    $table.'.index_name AS index_name',
416
+                    $table.'.uid AS uid',
417
+                    $table.'.pid AS pid',
418 418
                 )
419 419
                 ->from($table)
420 420
                 ->execute();
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
         $result = $cache[$table][$cacheKey] ?? '';
433 433
 
434 434
         if ($result === '') {
435
-            self::log('No "index_name" with UID ' . $uid . ' and PID ' . $pid . ' found in table "' . $table . '"', LOG_SEVERITY_WARNING);
435
+            self::log('No "index_name" with UID '.$uid.' and PID '.$pid.' found in table "'.$table.'"', LOG_SEVERITY_WARNING);
436 436
         }
437 437
 
438 438
         return $result;
@@ -459,11 +459,11 @@  discard block
 block discarded – undo
459 459
             // No ISO code, return unchanged.
460 460
             return $code;
461 461
         }
462
-        $lang = LocalizationUtility::translate('LLL:' . $file . ':' . $code);
462
+        $lang = LocalizationUtility::translate('LLL:'.$file.':'.$code);
463 463
         if (!empty($lang)) {
464 464
             return $lang;
465 465
         } else {
466
-            self::log('Language code "' . $code . '" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
466
+            self::log('Language code "'.$code.'" not found in ISO-639 table', LOG_SEVERITY_NOTICE);
467 467
             return $code;
468 468
         }
469 469
     }
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
             '-' => 39,
561 561
             ':' => 17,
562 562
         ];
563
-        $urn = strtolower($base . $id);
563
+        $urn = strtolower($base.$id);
564 564
         if (preg_match('/[^a-z\d:-]/', $urn)) {
565 565
             self::log('Invalid chars in given parameters', LOG_SEVERITY_WARNING);
566 566
             return '';
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
             $checksum += ($i + 1) * intval(substr($digits, $i, 1));
575 575
         }
576 576
         $checksum = substr(intval($checksum / intval(substr($digits, -1, 1))), -1, 1);
577
-        return $base . $id . $checksum;
577
+        return $base.$id.$checksum;
578 578
     }
579 579
 
580 580
     /**
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
         // Sanitize input.
669 669
         $pid = max(intval($pid), 0);
670 670
         if (!$pid) {
671
-            self::log('Invalid PID ' . $pid . ' for translation', LOG_SEVERITY_WARNING);
671
+            self::log('Invalid PID '.$pid.' for translation', LOG_SEVERITY_WARNING);
672 672
             return $index_name;
673 673
         }
674 674
         /** @var \TYPO3\CMS\Frontend\Page\PageRepository $pageRepository */
@@ -690,13 +690,13 @@  discard block
 block discarded – undo
690 690
         // First fetch the uid of the received index_name
691 691
         $result = $queryBuilder
692 692
             ->select(
693
-                $table . '.uid AS uid',
694
-                $table . '.l18n_parent AS l18n_parent'
693
+                $table.'.uid AS uid',
694
+                $table.'.l18n_parent AS l18n_parent'
695 695
             )
696 696
             ->from($table)
697 697
             ->where(
698
-                $queryBuilder->expr()->eq($table . '.pid', $pid),
699
-                $queryBuilder->expr()->eq($table . '.index_name', $queryBuilder->expr()->literal($index_name)),
698
+                $queryBuilder->expr()->eq($table.'.pid', $pid),
699
+                $queryBuilder->expr()->eq($table.'.index_name', $queryBuilder->expr()->literal($index_name)),
700 700
                 self::whereExpression($table, true)
701 701
             )
702 702
             ->setMaxResults(1)
@@ -709,12 +709,12 @@  discard block
 block discarded – undo
709 709
             $resArray = $allResults[0];
710 710
 
711 711
             $result = $queryBuilder
712
-                ->select($table . '.index_name AS index_name')
712
+                ->select($table.'.index_name AS index_name')
713 713
                 ->from($table)
714 714
                 ->where(
715
-                    $queryBuilder->expr()->eq($table . '.pid', $pid),
716
-                    $queryBuilder->expr()->eq($table . '.uid', $resArray['l18n_parent']),
717
-                    $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId())),
715
+                    $queryBuilder->expr()->eq($table.'.pid', $pid),
716
+                    $queryBuilder->expr()->eq($table.'.uid', $resArray['l18n_parent']),
717
+                    $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId())),
718 718
                     self::whereExpression($table, true)
719 719
                 )
720 720
                 ->setMaxResults(1)
@@ -732,14 +732,14 @@  discard block
 block discarded – undo
732 732
         if (empty($labels[$table][$pid][$languageAspect->getContentId()][$index_name])) {
733 733
             // Check if this table is allowed for translation.
734 734
             if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) {
735
-                $additionalWhere = $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]);
735
+                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]);
736 736
                 if ($languageAspect->getContentId() > 0) {
737 737
                     $additionalWhere = $queryBuilder->expr()->andX(
738 738
                         $queryBuilder->expr()->orX(
739
-                            $queryBuilder->expr()->in($table . '.sys_language_uid', [-1, 0]),
740
-                            $queryBuilder->expr()->eq($table . '.sys_language_uid', intval($languageAspect->getContentId()))
739
+                            $queryBuilder->expr()->in($table.'.sys_language_uid', [-1, 0]),
740
+                            $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($languageAspect->getContentId()))
741 741
                         ),
742
-                        $queryBuilder->expr()->eq($table . '.l18n_parent', 0)
742
+                        $queryBuilder->expr()->eq($table.'.l18n_parent', 0)
743 743
                     );
744 744
                 }
745 745
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
                     ->select('*')
749 749
                     ->from($table)
750 750
                     ->where(
751
-                        $queryBuilder->expr()->eq($table . '.pid', $pid),
751
+                        $queryBuilder->expr()->eq($table.'.pid', $pid),
752 752
                         $additionalWhere,
753 753
                         self::whereExpression($table, true)
754 754
                     )
@@ -766,10 +766,10 @@  discard block
 block discarded – undo
766 766
                         }
767 767
                     }
768 768
                 } else {
769
-                    self::log('No translation with PID ' . $pid . ' available in table "' . $table . '" or translation not accessible', LOG_SEVERITY_NOTICE);
769
+                    self::log('No translation with PID '.$pid.' available in table "'.$table.'" or translation not accessible', LOG_SEVERITY_NOTICE);
770 770
                 }
771 771
             } else {
772
-                self::log('No translations available for table "' . $table . '"', LOG_SEVERITY_WARNING);
772
+                self::log('No translations available for table "'.$table.'"', LOG_SEVERITY_WARNING);
773 773
             }
774 774
         }
775 775
 
@@ -811,9 +811,9 @@  discard block
 block discarded – undo
811 811
             return GeneralUtility::makeInstance(ConnectionPool::class)
812 812
                 ->getQueryBuilderForTable($table)
813 813
                 ->expr()
814
-                ->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
814
+                ->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
815 815
         } else {
816
-            self::log('Unexpected TYPO3_MODE "' . \TYPO3_MODE . '"', LOG_SEVERITY_ERROR);
816
+            self::log('Unexpected TYPO3_MODE "'.\TYPO3_MODE.'"', LOG_SEVERITY_ERROR);
817 817
             return '1=-1';
818 818
         }
819 819
     }
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
      */
853 853
     public static function polyfillExtbaseClassesForTYPO3v9()
854 854
     {
855
-        $classes = require __DIR__ . '/../../Configuration/Extbase/Persistence/Classes.php';
855
+        $classes = require __DIR__.'/../../Configuration/Extbase/Persistence/Classes.php';
856 856
 
857 857
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
858 858
         $configurationManager = $objectManager->get(ConfigurationManager::class);
@@ -908,10 +908,10 @@  discard block
 block discarded – undo
908 908
         try {
909 909
             $response = $requestFactory->request($url, 'GET', $configuration);
910 910
         } catch (\Exception $e) {
911
-            self::log('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.', LOG_SEVERITY_WARNING);
911
+            self::log('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.', LOG_SEVERITY_WARNING);
912 912
             return false;
913 913
         }
914
-        $content  = $response->getBody()->getContents();
914
+        $content = $response->getBody()->getContents();
915 915
 
916 916
         return $content;
917 917
     }
Please login to merge, or discard this patch.
Tests/routeFunctionalInstance.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,10 +15,10 @@
 block discarded – undo
15 15
 preg_match("@.*/(?:acceptance|functional-[a-z\d]+)@", $_SERVER['REQUEST_URI'], $matches);
16 16
 
17 17
 if (!empty($matches)) {
18
-    $root = realpath($_SERVER['DOCUMENT_ROOT'] . $matches[0]);
18
+    $root = realpath($_SERVER['DOCUMENT_ROOT'].$matches[0]);
19 19
     if ($root !== false) {
20
-        putenv('TYPO3_PATH_ROOT=' . $root);
21
-        putenv('TYPO3_PATH_APP=' . $root);
20
+        putenv('TYPO3_PATH_ROOT='.$root);
21
+        putenv('TYPO3_PATH_APP='.$root);
22 22
     }
23 23
 }
24 24
 
Please login to merge, or discard this patch.
Classes/Api/Viaf/Client.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     public function __construct($viaf, RequestFactory $requestFactory)
67 67
     {
68 68
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
69
-        $this->viafUrl = 'http://viaf.org/viaf/' . $viaf;
69
+        $this->viafUrl = 'http://viaf.org/viaf/'.$viaf;
70 70
         $this->requestFactory = $requestFactory;
71 71
     }
72 72
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         try {
93 93
             $response = $this->requestFactory->request($url);
94 94
         } catch (\Exception $e) {
95
-            $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
95
+            $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.');
96 96
             return false;
97 97
         }
98 98
         return $response->getBody()->getContents();
@@ -105,6 +105,6 @@  discard block
 block discarded – undo
105 105
      **/
106 106
     protected function getApiEndpoint()
107 107
     {
108
-        return $this->viafUrl . '/' . $this->endpoint;
108
+        return $this->viafUrl.'/'.$this->endpoint;
109 109
     }
110 110
 }
Please login to merge, or discard this patch.
Classes/Api/Orcid/Client.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         try {
106 106
             $response = $this->requestFactory->request($url);
107 107
         } catch (\Exception $e) {
108
-            $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
108
+            $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.');
109 109
             return false;
110 110
         }
111 111
         return $response->getBody()->getContents();
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
      **/
119 119
     private function getApiEndpoint()
120 120
     {
121
-        $url  = 'https://' . $this->level . '.' . self::HOSTNAME;
122
-        $url .= '/v' . self::VERSION . '/';
121
+        $url  = 'https://'.$this->level.'.'.self::HOSTNAME;
122
+        $url .= '/v'.self::VERSION.'/';
123 123
         $url .= $this->orcid;
124
-        $url .= '/' . $this->endpoint;
124
+        $url .= '/'.$this->endpoint;
125 125
         return $url;
126 126
     }
127 127
 }
Please login to merge, or discard this patch.
Classes/Format/Mods.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         if (!empty($name)) {
100 100
             $this->metadata['author'][$i] = [
101 101
                 'name' => $name,
102
-                'url' => 'https://orcid.org/' . $orcidId
102
+                'url' => 'https://orcid.org/'.$orcidId
103 103
             ];
104 104
         } else {
105 105
             //fallback into display form
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         }
147 147
         // Append "valueURI" to name using Unicode unit separator.
148 148
         if (isset($authors[$i]['valueURI'])) {
149
-            $this->metadata['author'][$i] .= chr(31) . (string) $authors[$i]['valueURI'];
149
+            $this->metadata['author'][$i] .= chr(31).(string) $authors[$i]['valueURI'];
150 150
         }
151 151
     }
152 152
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         if (!empty($name)) {
188 188
             $this->metadata['holder'][$i] = [
189 189
                 'name' => $name,
190
-                'url' => 'http://viaf.org/viaf/' . $viafId
190
+                'url' => 'http://viaf.org/viaf/'.$viafId
191 191
             ];
192 192
         } else {
193 193
             //fallback into display form
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         $this->getHolderFromXmlDisplayForm($holders, $i);
200 200
         // Append "valueURI" to name using Unicode unit separator.
201 201
         if (isset($holders[$i]['valueURI'])) {
202
-            $this->metadata['holder'][$i] .= chr(31) . (string) $holders[$i]['valueURI'];
202
+            $this->metadata['holder'][$i] .= chr(31).(string) $holders[$i]['valueURI'];
203 203
         }
204 204
     }
205 205
 
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             array_unshift($metadata, $data);
113 113
         }
114 114
         if (empty($metadata)) {
115
-            $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid());
115
+            $this->logger->warning('No metadata found for document with UID '.$this->document->getUid());
116 116
             return '';
117 117
         }
118 118
         ksort($metadata);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
216 216
                             $superiorTitle = Doc::getTitle($this->document->getPartof(), true);
217 217
                             if (!empty($superiorTitle)) {
218
-                                $metadata[$i][$name] = ['[' . $superiorTitle . ']'];
218
+                                $metadata[$i][$name] = ['['.$superiorTitle.']'];
219 219
                             }
220 220
                         }
221 221
                         if (!empty($value)) {
Please login to merge, or discard this patch.
Classes/Common/Indexer.php 1 patch
Spacing   +17 added lines, -17 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
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             $solrDoc->setField('title', $metadata['title'][0], self::$fields['fieldboost']['title']);
338 338
             $solrDoc->setField('volume', $metadata['volume'][0], self::$fields['fieldboost']['volume']);
339 339
             // verify date formatting
340
-            if(strtotime($metadata['date'][0])) {
340
+            if (strtotime($metadata['date'][0])) {
341 341
                 // do not alter dates YYYY or YYYY-MM or YYYY-MM-DD
342 342
                 if (
343 343
                     preg_match("/^[\d]{4}$/", $metadata['date'][0])
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 ) {
347 347
                     $solrDoc->setField('date', $metadata['date'][0]);
348 348
                 // change date YYYYMMDD to YYYY-MM-DD
349
-                } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])){
349
+                } elseif (preg_match("/^[\d]{8}$/", $metadata['date'][0])) {
350 350
                     $solrDoc->setField('date', date("Y-m-d", strtotime($metadata['date'][0])));
351 351
                 // convert any datetime to proper ISO extended datetime format and timezone for SOLR
352 352
                 } else {
@@ -374,11 +374,11 @@  discard block
 block discarded – undo
374 374
                     $solrDoc->setField(self::getIndexFieldName($index_name, $document->getPid()), $data, self::$fields['fieldboost'][$index_name]);
375 375
                     if (in_array($index_name, self::$fields['sortables'])) {
376 376
                         // Add sortable fields to index.
377
-                        $solrDoc->setField($index_name . '_sorting', $metadata[$index_name . '_sorting'][0]);
377
+                        $solrDoc->setField($index_name.'_sorting', $metadata[$index_name.'_sorting'][0]);
378 378
                     }
379 379
                     if (in_array($index_name, self::$fields['facets'])) {
380 380
                         // Add facets to index.
381
-                        $solrDoc->setField($index_name . '_faceting', $data);
381
+                        $solrDoc->setField($index_name.'_faceting', $data);
382 382
                     }
383 383
                     if (in_array($index_name, self::$fields['autocomplete'])) {
384 384
                         $autocomplete = array_merge($autocomplete, $data);
@@ -403,14 +403,14 @@  discard block
 block discarded – undo
403 403
             } catch (\Exception $e) {
404 404
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
405 405
                     Helper::addMessage(
406
-                        Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
406
+                        Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()),
407 407
                         Helper::getLanguageService()->getLL('flash.error'),
408 408
                         FlashMessage::ERROR,
409 409
                         true,
410 410
                         'core.template.flashMessages'
411 411
                     );
412 412
                 }
413
-                Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
413
+                Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR);
414 414
                 return false;
415 415
             }
416 416
         }
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
                                 $data = self::removeAppendsFromAuthor($data);
477 477
                             }
478 478
                             // Add facets to index.
479
-                            $solrDoc->setField($index_name . '_faceting', $data);
479
+                            $solrDoc->setField($index_name.'_faceting', $data);
480 480
                         }
481 481
                     }
482 482
                     // Add sorting information to physical sub-elements if applicable.
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                         !empty($data)
485 485
                         && substr($index_name, -8) == '_sorting'
486 486
                     ) {
487
-                        $solrDoc->setField($index_name , $doc->metadataArray[$doc->toplevelId][$index_name]);
487
+                        $solrDoc->setField($index_name, $doc->metadataArray[$doc->toplevelId][$index_name]);
488 488
                     }
489 489
                 }
490 490
             }
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
             } catch (\Exception $e) {
502 502
                 if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) {
503 503
                     Helper::addMessage(
504
-                        Helper::getLanguageService()->getLL('flash.solrException') . '<br />' . htmlspecialchars($e->getMessage()),
504
+                        Helper::getLanguageService()->getLL('flash.solrException').'<br />'.htmlspecialchars($e->getMessage()),
505 505
                         Helper::getLanguageService()->getLL('flash.error'),
506 506
                         FlashMessage::ERROR,
507 507
                         true,
508 508
                         'core.template.flashMessages'
509 509
                     );
510 510
                 }
511
-                Helper::log('Apache Solr threw exception: "' . $e->getMessage() . '"', LOG_SEVERITY_ERROR);
511
+                Helper::log('Apache Solr threw exception: "'.$e->getMessage().'"', LOG_SEVERITY_ERROR);
512 512
                 return false;
513 513
             }
514 514
         }
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
     private static function getSolrDocument($updateQuery, $document, $unit, $fullText = '') {
560 560
         $solrDoc = $updateQuery->createDocument();
561 561
         // Create unique identifier from document's UID and unit's XML ID.
562
-        $solrDoc->setField('id', $document->getUid() . $unit['id']);
562
+        $solrDoc->setField('id', $document->getUid().$unit['id']);
563 563
         $solrDoc->setField('uid', $document->getUid());
564 564
         $solrDoc->setField('pid', $document->getPid());
565 565
         $solrDoc->setField('partof', $document->getPartof());
Please login to merge, or discard this patch.
Classes/Controller/CollectionController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,20 +96,20 @@
 block discarded – undo
96 96
         foreach ($collections as $collection) {
97 97
             $solr_query = '';
98 98
             if ($collection->getIndexSearch() != '') {
99
-                $solr_query .= '(' . $collection->getIndexSearch() . ')';
99
+                $solr_query .= '('.$collection->getIndexSearch().')';
100 100
             } else {
101
-                $solr_query .= 'collection:("' . Solr::escapeQuery($collection->getIndexName()) . '")';
101
+                $solr_query .= 'collection:("'.Solr::escapeQuery($collection->getIndexName()).'")';
102 102
             }
103 103
 
104 104
             // virtual collection might yield documents, that are not toplevel true or partof anything
105 105
             if ($collection->getIndexSearch()) {
106 106
                 $params['query'] = $solr_query;
107 107
             } else {
108
-                $params['query'] = $solr_query . ' AND partof:0 AND toplevel:true';
108
+                $params['query'] = $solr_query.' AND partof:0 AND toplevel:true';
109 109
             }
110 110
             $partOfNothing = $solr->search_raw($params);
111 111
 
112
-            $params['query'] = $solr_query . ' AND NOT partof:0 AND toplevel:true';
112
+            $params['query'] = $solr_query.' AND NOT partof:0 AND toplevel:true';
113 113
             $partOfSomething = $solr->search_raw($params);
114 114
             // Titles are all documents that are "root" elements i.e. partof == 0
115 115
             $collectionInfo['titles'] = [];
Please login to merge, or discard this patch.