Passed
Pull Request — master (#123)
by
unknown
11:14
created
Classes/Api/Orcid/Client.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         try {
112 112
             $response = $this->requestFactory->request($url);
113 113
         } catch (\Exception $e) {
114
-            $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
114
+            $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.');
115 115
             return false;
116 116
         }
117 117
         return $response->getBody()->getContents();
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
      **/
127 127
     private function getApiEndpoint(): string
128 128
     {
129
-        $url  = 'https://' . $this->level . '.' . self::HOSTNAME;
130
-        $url .= '/v' . self::VERSION . '/';
129
+        $url  = 'https://'.$this->level.'.'.self::HOSTNAME;
130
+        $url .= '/v'.self::VERSION.'/';
131 131
         $url .= $this->orcid;
132
-        $url .= '/' . $this->endpoint;
132
+        $url .= '/'.$this->endpoint;
133 133
         return $url;
134 134
     }
135 135
 }
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
@@ -653,16 +653,16 @@  discard block
 block discarded – undo
653 653
                 if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) {
654 654
                     $values = $iiifResource->jsonPath($resArray['xpath_sorting']);
655 655
                     if (is_string($values)) {
656
-                        $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)];
656
+                        $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)];
657 657
                     } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) {
658 658
                         $metadata[$resArray['index_name']] = [];
659 659
                         foreach ($values->data() as $value) {
660
-                            $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value);
660
+                            $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value);
661 661
                         }
662 662
                     }
663 663
                 }
664
-                if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) {
665
-                    $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0];
664
+                if (empty($metadata[$resArray['index_name'].'_sorting'][0])) {
665
+                    $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0];
666 666
                 }
667 667
             }
668 668
         }
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
                     }
773 773
                 }
774 774
             } else {
775
-                $this->logger->warning('Invalid structure resource @id "' . $id . '"');
775
+                $this->logger->warning('Invalid structure resource @id "'.$id.'"');
776 776
                 return $rawText;
777 777
             }
778 778
             $this->rawTextArray[$id] = $rawText;
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
                 return true;
818 818
             }
819 819
         }
820
-        $this->logger->error('Could not load IIIF manifest from "' . $location . '"');
820
+        $this->logger->error('Could not load IIIF manifest from "'.$location.'"');
821 821
         return false;
822 822
     }
823 823
 
Please login to merge, or discard this patch.
Classes/Common/Solr/SearchResult/Highlight.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         $this->xEndPosition = $highlight['lrx'];
88 88
         $this->yBeginPosition = $highlight['uly'];
89 89
         $this->yEndPosition = $highlight['lry'];
90
-        $this->id = $this->xBeginPosition . '_' . $this->yBeginPosition;
90
+        $this->id = $this->xBeginPosition.'_'.$this->yBeginPosition;
91 91
     }
92 92
 
93 93
     /**
Please login to merge, or discard this patch.
Classes/Common/Solr/Solr.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         // Get next available core name if none given.
129 129
         if (empty($core)) {
130
-            $core = 'dlfCore' . self::getNextCoreNumber();
130
+            $core = 'dlfCore'.self::getNextCoreNumber();
131 131
         }
132 132
         // Get Solr service instance.
133 133
         $solr = self::getInstance($core);
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
                 ->execute();
218 218
 
219 219
             while ($resArray = $result->fetchAssociative()) {
220
-                $fields[] = $resArray['index_name'] . '_' . ($resArray['index_tokenized'] ? 't' : 'u') . ($resArray['index_stored'] ? 's' : 'u') . 'i';
220
+                $fields[] = $resArray['index_name'].'_'.($resArray['index_tokenized'] ? 't' : 'u').($resArray['index_stored'] ? 's' : 'u').'i';
221 221
             }
222 222
 
223 223
             // Check if queried field is valid.
224 224
             $splitQuery = explode(':', $query, 2);
225 225
             if (in_array($splitQuery[0], $fields)) {
226
-                $query = $splitQuery[0] . ':(' . self::escapeQuery(trim($splitQuery[1], '()')) . ')';
226
+                $query = $splitQuery[0].':('.self::escapeQuery(trim($splitQuery[1], '()')).')';
227 227
             } else {
228 228
                 $query = self::escapeQuery($query);
229 229
             }
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
     {
331 331
         $number = max($number, 0);
332 332
         // Check if core already exists.
333
-        $solr = self::getInstance('dlfCore' . $number);
333
+        $solr = self::getInstance('dlfCore'.$number);
334 334
         if (!$solr->ready) {
335 335
             return $number;
336 336
         } else {
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         $parameters['start'] = 0;
389 389
         $parameters['rows'] = $this->limit;
390 390
         // Calculate cache identifier.
391
-        $cacheIdentifier = Helper::digest($this->core . print_r(array_merge($this->params, $parameters), true));
391
+        $cacheIdentifier = Helper::digest($this->core.print_r(array_merge($this->params, $parameters), true));
392 392
         $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
393 393
         $resultSet = [];
394 394
         $entry = $cache->get($cacheIdentifier);
@@ -520,12 +520,12 @@  discard block
 block discarded – undo
520 520
      */
521 521
     public function __get(string $var)
522 522
     {
523
-        $method = 'magicGet' . ucfirst($var);
523
+        $method = 'magicGet'.ucfirst($var);
524 524
         if (
525 525
             !property_exists($this, $var)
526 526
             || !method_exists($this, $method)
527 527
         ) {
528
-            $this->logger->warning('There is no getter function for property "' . $var . '"');
528
+            $this->logger->warning('There is no getter function for property "'.$var.'"');
529 529
             return null;
530 530
         } else {
531 531
             return $this->$method();
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
      */
559 559
     public function __set(string $var, $value): void
560 560
     {
561
-        $method = 'magicSet' . ucfirst($var);
561
+        $method = 'magicSet'.ucfirst($var);
562 562
         if (
563 563
             !property_exists($this, $var)
564 564
             || !method_exists($this, $method)
565 565
         ) {
566
-            $this->logger->warning('There is no setter function for property "' . $var . '"');
566
+            $this->logger->warning('There is no setter function for property "'.$var.'"');
567 567
         } else {
568 568
             $this->$method($value);
569 569
         }
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                     'scheme' => $this->config['scheme'],
604 604
                     'host' => $this->config['host'],
605 605
                     'port' => $this->config['port'],
606
-                    'path' => '/' . $this->config['path'],
606
+                    'path' => '/'.$this->config['path'],
607 607
                     'core' => $core,
608 608
                     'username' => $this->config['username'],
609 609
                     'password' => $this->config['password']
Please login to merge, or discard this patch.
Classes/Common/AbstractDocument.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -664,14 +664,14 @@  discard block
 block discarded – undo
664 664
                     if ($fileContent !== false) {
665 665
                         $textFormat = $this->getTextFormat($fileContent);
666 666
                     } else {
667
-                        $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"');
667
+                        $this->logger->warning('Couldn\'t load full text file for structure node @ID "'.$id.'"');
668 668
                         return $fullText;
669 669
                     }
670 670
                     break;
671 671
                 }
672 672
             }
673 673
         } else {
674
-            $this->logger->warning('Invalid structure node @ID "' . $id . '"');
674
+            $this->logger->warning('Invalid structure node @ID "'.$id.'"');
675 675
             return $fullText;
676 676
         }
677 677
         // Is this text format supported?
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
             }
684 684
             $fullText = $textMiniOcr;
685 685
         } else {
686
-            $this->logger->warning('Unsupported text format "' . $textFormat . '" in physical node with @ID "' . $id . '"');
686
+            $this->logger->warning('Unsupported text format "'.$textFormat.'" in physical node with @ID "'.$id.'"');
687 687
         }
688 688
         return $fullText;
689 689
     }
@@ -712,10 +712,10 @@  discard block
 block discarded – undo
712 712
                 $textMiniOcr = $obj->getTextAsMiniOcr($ocrTextXml);
713 713
                 $this->rawTextArray[$id] = $textMiniOcr;
714 714
             } else {
715
-                $this->logger->warning('Invalid class/method "' . $class . '->getRawText()" for text format "' . $textFormat . '"');
715
+                $this->logger->warning('Invalid class/method "'.$class.'->getRawText()" for text format "'.$textFormat.'"');
716 716
             }
717 717
         } else {
718
-            $this->logger->warning('Class "' . $class . ' does not exists for "' . $textFormat . ' text format"');
718
+            $this->logger->warning('Class "'.$class.' does not exists for "'.$textFormat.' text format"');
719 719
         }
720 720
         return $textMiniOcr;
721 721
     }
@@ -790,10 +790,10 @@  discard block
 block discarded – undo
790 790
                     $title = self::getTitle($partof, true);
791 791
                 }
792 792
             } else {
793
-                Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING);
793
+                Helper::log('No document with UID '.$uid.' found or document not accessible', LOG_SEVERITY_WARNING);
794 794
             }
795 795
         } else {
796
-            Helper::log('Invalid UID ' . $uid . ' for document', LOG_SEVERITY_ERROR);
796
+            Helper::log('Invalid UID '.$uid.' for document', LOG_SEVERITY_ERROR);
797 797
         }
798 798
         return $title;
799 799
     }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
             // the actual loading is format specific
884 884
             return $this->loadLocation($location);
885 885
         } else {
886
-            $this->logger->error('Invalid file location "' . $location . '" for document loading');
886
+            $this->logger->error('Invalid file location "'.$location.'" for document loading');
887 887
         }
888 888
         return false;
889 889
     }
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
         // Set metadata definitions' PID.
1036 1036
         $cPid = ($this->cPid ? $this->cPid : $this->pid);
1037 1037
         if (!$cPid) {
1038
-            $this->logger->error('Invalid PID ' . $cPid . ' for metadata definitions');
1038
+            $this->logger->error('Invalid PID '.$cPid.' for metadata definitions');
1039 1039
             return [];
1040 1040
         }
1041 1041
         if (
@@ -1212,12 +1212,12 @@  discard block
 block discarded – undo
1212 1212
      */
1213 1213
     public function __get(string $var)
1214 1214
     {
1215
-        $method = 'magicGet' . ucfirst($var);
1215
+        $method = 'magicGet'.ucfirst($var);
1216 1216
         if (
1217 1217
             !property_exists($this, $var)
1218 1218
             || !method_exists($this, $method)
1219 1219
         ) {
1220
-            $this->logger->warning('There is no getter function for property "' . $var . '"');
1220
+            $this->logger->warning('There is no getter function for property "'.$var.'"');
1221 1221
             return null;
1222 1222
         } else {
1223 1223
             return $this->$method();
@@ -1250,12 +1250,12 @@  discard block
 block discarded – undo
1250 1250
      */
1251 1251
     public function __set(string $var, $value): void
1252 1252
     {
1253
-        $method = '_set' . ucfirst($var);
1253
+        $method = '_set'.ucfirst($var);
1254 1254
         if (
1255 1255
             !property_exists($this, $var)
1256 1256
             || !method_exists($this, $method)
1257 1257
         ) {
1258
-            $this->logger->warning('There is no setter function for property "' . $var . '"');
1258
+            $this->logger->warning('There is no setter function for property "'.$var.'"');
1259 1259
         } else {
1260 1260
             $this->$method($value);
1261 1261
         }
Please login to merge, or discard this patch.
Classes/Command/BaseCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      *
335 335
      * @return void
336 336
      */
337
-    private function addCollections(Document &$document, array $collections): void
337
+    private function addCollections(Document & $document, array $collections): void
338 338
     {
339 339
         foreach ($collections as $collection) {
340 340
             $documentCollection = $this->collectionRepository->findOneByIndexName($collection);
@@ -376,11 +376,11 @@  discard block
 block discarded – undo
376 376
 
377 377
         for ($i = 0; $i < $count; $i++) {
378 378
             // Build the next part to add
379
-            $nextPart = ($i === 0 ? '' : $delimiter) . $metadataAuthor[$i];
379
+            $nextPart = ($i === 0 ? '' : $delimiter).$metadataAuthor[$i];
380 380
             // Check if adding this part and ellipsis in future would exceed the character limit
381
-            if (strlen($authors . $nextPart . $delimiter . $ellipsis) > 255) {
381
+            if (strlen($authors.$nextPart.$delimiter.$ellipsis) > 255) {
382 382
                 // Add ellipsis and stop adding more authors
383
-                $authors .= $delimiter . $ellipsis;
383
+                $authors .= $delimiter.$ellipsis;
384 384
                 break;
385 385
             }
386 386
             // Add the part to the main string
Please login to merge, or discard this patch.
Classes/Domain/Repository/DocumentRepository.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
         $excludeOtherWhere = '';
386 386
         if ($settings['excludeOther']) {
387
-            $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']);
387
+            $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']);
388 388
         }
389 389
         // Check if there are any metadata to suggest.
390 390
         return $queryBuilder
@@ -438,12 +438,12 @@  discard block
 block discarded – undo
438 438
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
439 439
             ->getConnectionForTable('tx_dlf_documents');
440 440
 
441
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
442
-            'FROM `tx_dlf_documents` ' .
443
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
444
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
445
-            'WHERE `tx_dlf_documents`.`record_id` = ? ' .
446
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
441
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
442
+            'FROM `tx_dlf_documents` '.
443
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
444
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
445
+            'WHERE `tx_dlf_documents`.`record_id` = ? '.
446
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
447 447
             $where;
448 448
 
449 449
         $values = [
@@ -474,13 +474,13 @@  discard block
 block discarded – undo
474 474
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
475 475
             ->getConnectionForTable('tx_dlf_documents');
476 476
 
477
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
478
-            'FROM `tx_dlf_documents` ' .
479
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
480
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
481
-            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' .
482
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
483
-            'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' .
477
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
478
+            'FROM `tx_dlf_documents` '.
479
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
480
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
481
+            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '.
482
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
483
+            'AND '.Helper::whereExpression('tx_dlf_collections').' '.
484 484
             'GROUP BY `tx_dlf_documents`.`uid` ';
485 485
 
486 486
         $values = [
Please login to merge, or discard this patch.
Classes/Middleware/SearchSuggest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
         $output = [];
56 56
         $solrCore = (string) $parameters['solrcore'];
57 57
         $uHash = (string) $parameters['uHash'];
58
-        if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) {
58
+        if (hash_equals(GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'), $uHash) === false) {
59 59
             throw new \InvalidArgumentException('No valid parameter passed!', 1580585079);
60 60
         }
61 61
         // Perform Solr query.
Please login to merge, or discard this patch.
Classes/Middleware/SearchInDocument.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
         $encrypted = (string) $parameters['encrypted'];
73 73
         if (empty($encrypted)) {
74
-            throw new \InvalidArgumentException('No valid parameter passed: ' . $parameters['middleware'] . '  ' . $parameters['encrypted'] . '!', 1580585079);
74
+            throw new \InvalidArgumentException('No valid parameter passed: '.$parameters['middleware'].'  '.$parameters['encrypted'].'!', 1580585079);
75 75
         }
76 76
 
77 77
         $output = [
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
      */
175 175
     private function getQuery(array $parameters): string
176 176
     {
177
-        return $this->fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $this->fields['uid'] . ':' . $this->getUid($parameters['uid']);
177
+        return $this->fields['fulltext'].':('.Solr::escapeQuery((string) $parameters['q']).') AND '.$this->fields['uid'].':'.$this->getUid($parameters['uid']);
178 178
     }
179 179
 
180 180
     /**
Please login to merge, or discard this patch.