Completed
Push — master ( e2d2d8...1e45e0 )
by
unknown
48s queued 45s
created
Classes/Domain/Repository/DocumentRepository.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
         $excludeOtherWhere = '';
360 360
         if ($settings['excludeOther']) {
361
-            $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']);
361
+            $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']);
362 362
         }
363 363
         // Check if there are any metadata to suggest.
364 364
         $result = $queryBuilder
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
411 411
             ->getConnectionForTable('tx_dlf_documents');
412 412
 
413
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
414
-            'FROM `tx_dlf_documents` ' .
415
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
416
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
417
-            'WHERE `tx_dlf_documents`.`record_id` = ? ' .
418
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
413
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
414
+            'FROM `tx_dlf_documents` '.
415
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
416
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
417
+            'WHERE `tx_dlf_documents`.`record_id` = ? '.
418
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
419 419
             $where;
420 420
 
421 421
         $values = [
@@ -445,13 +445,13 @@  discard block
 block discarded – undo
445 445
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
446 446
             ->getConnectionForTable('tx_dlf_documents');
447 447
 
448
-        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' .
449
-            'FROM `tx_dlf_documents` ' .
450
-            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' .
451
-            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' .
452
-            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' .
453
-            'AND `tx_dlf_relations`.`ident`="docs_colls" ' .
454
-            'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' .
448
+        $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '.
449
+            'FROM `tx_dlf_documents` '.
450
+            'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '.
451
+            'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '.
452
+            'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '.
453
+            'AND `tx_dlf_relations`.`ident`="docs_colls" '.
454
+            'AND '.Helper::whereExpression('tx_dlf_collections').' '.
455 455
             'GROUP BY `tx_dlf_documents`.`uid` ';
456 456
 
457 457
         $values = [
@@ -533,13 +533,13 @@  discard block
 block discarded – undo
533 533
         // Set search query.
534 534
         if (
535 535
             (!empty($searchParams['fulltext']))
536
-            || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches)
536
+            || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches)
537 537
         ) {
538 538
             // If the query already is a fulltext query e.g using the facets
539 539
             $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1];
540 540
             // Search in fulltext field if applicable. Query must not be empty!
541 541
             if (!empty($searchParams['query'])) {
542
-                $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')';
542
+                $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')';
543 543
             }
544 544
             $params['fulltext'] = true;
545 545
         } else {
@@ -562,9 +562,9 @@  discard block
 block discarded – undo
562 562
                         in_array($searchParams['extOperator'][$i], $allowedOperators)
563 563
                     ) {
564 564
                         if (!empty($query)) {
565
-                            $query .= ' ' . $searchParams['extOperator'][$i] . ' ';
565
+                            $query .= ' '.$searchParams['extOperator'][$i].' ';
566 566
                         }
567
-                        $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')';
567
+                        $query .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')';
568 568
                     }
569 569
                 }
570 570
             }
@@ -584,22 +584,22 @@  discard block
 block discarded – undo
584 584
         ) {
585 585
             // Search in document and all subordinates (valid for up to three levels of hierarchy).
586 586
             $params['filterquery'][]['query'] = '_query_:"{!join from='
587
-                . $fields['uid'] . ' to=' . $fields['partof'] . '}'
588
-                . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}'
589
-                . $fields['uid'] . ':' . $searchParams['documentId'] . '"' . ' OR {!join from='
590
-                . $fields['uid'] . ' to=' . $fields['partof'] . '}'
591
-                . $fields['uid'] . ':' . $searchParams['documentId'] . ' OR '
592
-                . $fields['uid'] . ':' . $searchParams['documentId'];
587
+                . $fields['uid'].' to='.$fields['partof'].'}'
588
+                . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}'
589
+                . $fields['uid'].':'.$searchParams['documentId'].'"'.' OR {!join from='
590
+                . $fields['uid'].' to='.$fields['partof'].'}'
591
+                . $fields['uid'].':'.$searchParams['documentId'].' OR '
592
+                . $fields['uid'].':'.$searchParams['documentId'];
593 593
         }
594 594
 
595 595
         // if a collection is given, we prepare the collection query string
596 596
         if ($collection) {
597 597
             if ($collection instanceof \Kitodo\Dlf\Domain\Model\Collection) {
598
-                $collectionsQueryString = '"' . $collection->getIndexName() . '"';
598
+                $collectionsQueryString = '"'.$collection->getIndexName().'"';
599 599
             } else {
600 600
                 $collectionsQueryString = '';
601 601
                 foreach ($collection as $index => $collectionEntry) {
602
-                    $collectionsQueryString .= ($index > 0 ? ' OR ' : '') . '"' . $collectionEntry->getIndexName() . '"';
602
+                    $collectionsQueryString .= ($index > 0 ? ' OR ' : '').'"'.$collectionEntry->getIndexName().'"';
603 603
                 }
604 604
             }
605 605
 
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
                 $params['filterquery'][]['query'] = 'toplevel:true';
608 608
                 $params['filterquery'][]['query'] = 'partof:0';
609 609
             }
610
-            $params['filterquery'][]['query'] = 'collection_faceting:(' . $collectionsQueryString . ')';
610
+            $params['filterquery'][]['query'] = 'collection_faceting:('.$collectionsQueryString.')';
611 611
         }
612 612
 
613 613
         // Set some query parameters.
@@ -636,8 +636,8 @@  discard block
 block discarded – undo
636 636
         if ($listedMetadata) {
637 637
             foreach ($listedMetadata as $metadata) {
638 638
                 if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) {
639
-                    $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u');
640
-                    $params['fields'] .= ',' . $listMetadataRecord;
639
+                    $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u');
640
+                    $params['fields'] .= ','.$listMetadataRecord;
641 641
                     $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord;
642 642
                 }
643 643
             }
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
                     if (empty($documents[$doc['uid']]['title']) && ($documents[$doc['uid']]['partOf'] > 0)) {
724 724
                         $parentDocument = $this->findByUid($documents[$doc['uid']]['partOf']);
725 725
                         if ($parentDocument) {
726
-                            $documents[$doc['uid']]['title'] = '[' . $parentDocument->getTitle() . ']';
726
+                            $documents[$doc['uid']]['title'] = '['.$parentDocument->getTitle().']';
727 727
                         }
728 728
                     }
729 729
                 }
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
         $metadataArray = [];
748 748
 
749 749
         // Set some query parameters.
750
-        $params['query'] = 'uid:' . $uid;
750
+        $params['query'] = 'uid:'.$uid;
751 751
         $params['start'] = 0;
752 752
         $params['rows'] = 1;
753 753
         $params['sort'] = ['score' => 'desc'];
@@ -759,8 +759,8 @@  discard block
 block discarded – undo
759 759
         if ($listedMetadata) {
760 760
             foreach ($listedMetadata as $metadata) {
761 761
                 if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) {
762
-                    $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u');
763
-                    $params['fields'] .= ',' . $listMetadataRecord;
762
+                    $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u');
763
+                    $params['fields'] .= ','.$listMetadataRecord;
764 764
                     $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord;
765 765
                 }
766 766
             }
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
         $cache = null;
811 811
         // Calculate cache identifier.
812 812
         if ($enableCache === true) {
813
-            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true));
813
+            $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true));
814 814
             $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
815 815
         }
816 816
         $resultSet = [
Please login to merge, or discard this patch.
Tests/Functional/FunctionalTestCase.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration();
72 72
 
73 73
         if ($this->disableJsonWrappedResponse) {
74
-            $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function ($ext) {
74
+            $this->frameworkExtensionsToLoad = array_filter($this->frameworkExtensionsToLoad, function($ext) {
75 75
                 return $ext !== 'Resources/Core/Functional/Extensions/json_response';
76 76
             });
77 77
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
85 85
 
86
-        $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-' . $this->identifier . '/';
86
+        $this->baseUrl = 'http://web:8000/public/typo3temp/var/tests/functional-'.$this->identifier.'/';
87 87
         $this->httpClient = new HttpClient([
88 88
             'base_uri' => $this->baseUrl,
89 89
             'http_errors' => false,
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
 
128 128
     protected function addSiteConfig($identifier, $baseUrl)
129 129
     {
130
-        $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml');
130
+        $siteConfig = Yaml::parseFile(__DIR__.'/../Fixtures/siteconfig.yaml');
131 131
         $siteConfig['base'] = $baseUrl;
132 132
         $siteConfig['languages'][0]['base'] = $baseUrl;
133 133
 
134
-        $siteConfigPath = $this->instancePath . '/typo3conf/sites/' . $identifier;
134
+        $siteConfigPath = $this->instancePath.'/typo3conf/sites/'.$identifier;
135 135
         @mkdir($siteConfigPath, 0775, true);
136
-        file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig));
136
+        file_put_contents($siteConfigPath.'/config.yaml', Yaml::dump($siteConfig));
137 137
     }
138 138
 
139 139
     protected function initializeRepository(string $className, int $storagePid)
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $jsonDocuments = json_decode(file_get_contents($path), true);
153 153
 
154 154
         $updateQuery = $solr->service->createUpdate();
155
-        $documents = array_map(function ($jsonDoc) use ($updateQuery) {
155
+        $documents = array_map(function($jsonDoc) use ($updateQuery) {
156 156
             $document = $updateQuery->createDocument();
157 157
             foreach ($jsonDoc as $key => $value) {
158 158
                 $document->setField($key, $value);
Please login to merge, or discard this patch.
Tests/Functional/Api/OaiPmhTest.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
     {
38 38
         parent::setUp();
39 39
 
40
-        $this->oaiUrl = $this->baseUrl . '/index.php?id=' . $this->oaiPage;
41
-        $this->oaiUrlNoStoragePid = $this->baseUrl . '/index.php?id=' . $this->oaiPageNoStoragePid;
40
+        $this->oaiUrl = $this->baseUrl.'/index.php?id='.$this->oaiPage;
41
+        $this->oaiUrlNoStoragePid = $this->baseUrl.'/index.php?id='.$this->oaiPageNoStoragePid;
42 42
 
43
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
44
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
45
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
46
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/pages.xml');
47
-        $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/pages.xml');
48
-        $this->importDataSet(__DIR__ . '/../../Fixtures/OaiPmh/solrcores.xml');
43
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
44
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml');
45
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
46
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/pages.xml');
47
+        $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/pages.xml');
48
+        $this->importDataSet(__DIR__.'/../../Fixtures/OaiPmh/solrcores.xml');
49 49
 
50 50
         $this->persistenceManager = $this->objectManager->get(PersistenceManager::class);
51 51
         $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             $coreName = Solr::createCore();
63 63
             $solr = Solr::getInstance($coreName);
64 64
 
65
-            $this->importSolrDocuments($solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json');
65
+            $this->importSolrDocuments($solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json');
66 66
         }
67 67
 
68 68
         $oaiCoreModel = $this->solrCoreRepository->findByUid(11001);
Please login to merge, or discard this patch.
Tests/Functional/Common/SolrIndexingTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
         $this->documentRepository = $this->initializeRepository(DocumentRepository::class, 20000);
44 44
         $this->solrCoreRepository = $this->initializeRepository(SolrCoreRepository::class, 20000);
45 45
 
46
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_1.xml');
47
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/libraries.xml');
48
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/metadata.xml');
46
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_1.xml');
47
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/libraries.xml');
48
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/metadata.xml');
49 49
     }
50 50
 
51 51
     /**
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
     {
113 113
         $core = $this->createSolrCore();
114 114
 
115
-        $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml');
116
-        $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_1.solr.json');
117
-        $this->importSolrDocuments($core->solr, __DIR__ . '/../../Fixtures/Common/documents_fulltext.solr.json');
115
+        $this->importDataSet(__DIR__.'/../../Fixtures/Common/documents_fulltext.xml');
116
+        $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_1.solr.json');
117
+        $this->importSolrDocuments($core->solr, __DIR__.'/../../Fixtures/Common/documents_fulltext.solr.json');
118 118
 
119 119
         $collections = $this->collectionRepository->findCollectionsBySettings([
120 120
             'index_name' => ['Musik', 'Projekt: Dresdner Hefte'],
Please login to merge, or discard this patch.