Passed
Pull Request — master (#123)
by Sebastian
04:18
created
Classes/Common/SolrSearch.php 2 patches
Upper-Lower-Casing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @param array $searchParams
35 35
      * @param QueryResult $listedMetadata
36 36
      */
37
-    public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = null)
37
+    public function __construct($documentRepository, $collection, $settings, $searchParams, $listedMetadata = NULL)
38 38
     {
39 39
         $this->documentRepository = $documentRepository;
40 40
         $this->collection = $collection;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
     public function count()
52 52
     {
53
-        if ($this->result === null) {
53
+        if ($this->result === NULL) {
54 54
             return 0;
55 55
         }
56 56
 
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
     public function offsetGet($offset)
92 92
     {
93 93
         $idx = $this->result['document_keys'][$offset];
94
-        $document = $this->result['documents'][$idx] ?? null;
94
+        $document = $this->result['documents'][$idx] ?? NULL;
95 95
 
96
-        if ($document !== null) {
96
+        if ($document !== NULL) {
97 97
             // It may happen that a Solr group only includes non-toplevel results,
98 98
             // in which case metadata of toplevel entry isn't yet filled.
99 99
             if (empty($document['metadata'])) {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
             // get title of parent/grandparent/... if empty
109 109
             if (empty($document['title']) && $document['partOf'] > 0) {
110
-                $superiorTitle = Doc::getTitle($document['partOf'], true);
110
+                $superiorTitle = Doc::getTitle($document['partOf'], TRUE);
111 111
                 if (!empty($superiorTitle)) {
112 112
                     $document['title'] = '[' . $superiorTitle . ']';
113 113
                 }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
             if (!empty($this->searchParams['query'])) {
181 181
                 $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')';
182 182
             }
183
-            $params['fulltext'] = true;
183
+            $params['fulltext'] = TRUE;
184 184
         } else {
185 185
             // Retain given search field if valid.
186 186
             if (!empty($this->searchParams['query'])) {
@@ -289,17 +289,17 @@  discard block
 block discarded – undo
289 289
         $this->params = $params;
290 290
 
291 291
         // Send off query to get total number of search results in advance
292
-        $this->submit(0, 1, false);
292
+        $this->submit(0, 1, FALSE);
293 293
     }
294 294
 
295
-    public function submit($start, $rows, $processResults = true)
295
+    public function submit($start, $rows, $processResults = TRUE)
296 296
     {
297 297
         $params = $this->params;
298 298
         $params['start'] = $start;
299 299
         $params['rows'] = $rows;
300 300
 
301 301
         // Perform search.
302
-        $result = $this->searchSolr($params, true);
302
+        $result = $this->searchSolr($params, TRUE);
303 303
 
304 304
         // Initialize values
305 305
         $documents = [];
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                             $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]);
330 330
                         }
331 331
                     }
332
-                    if ($doc['toplevel'] === false) {
332
+                    if ($doc['toplevel'] === FALSE) {
333 333
                         // this maybe a chapter, article, ..., year
334 334
                         if ($doc['type'] === 'year') {
335 335
                             continue;
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                             }
354 354
                             $documents[$doc['uid']]['searchResults'][] = $searchResult;
355 355
                         }
356
-                    } else if ($doc['toplevel'] === true) {
356
+                    } else if ($doc['toplevel'] === TRUE) {
357 357
                         foreach ($params['listMetadataRecords'] as $indexName => $solrField) {
358 358
                             if (isset($doc['metadata'][$indexName])) {
359 359
                                 $documents[$doc['uid']]['metadata'][$indexName] = $doc['metadata'][$indexName];
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
         $params['filterquery'][] = ['query' => 'toplevel:true'];
422 422
 
423 423
         // Perform search.
424
-        $result = $this->searchSolr($params, true);
424
+        $result = $this->searchSolr($params, TRUE);
425 425
 
426 426
         foreach ($result['documents'] as $doc) {
427 427
             // translate language code if applicable
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      *
447 447
      * @return array The Apache Solr Documents that were fetched
448 448
      */
449
-    protected function searchSolr($parameters = [], $enableCache = true)
449
+    protected function searchSolr($parameters = [], $enableCache = TRUE)
450 450
     {
451 451
         // Set query.
452 452
         $parameters['query'] = isset($parameters['query']) ? $parameters['query'] : '*';
@@ -465,10 +465,10 @@  discard block
 block discarded – undo
465 465
         }
466 466
 
467 467
         $cacheIdentifier = '';
468
-        $cache = null;
468
+        $cache = NULL;
469 469
         // Calculate cache identifier.
470
-        if ($enableCache === true) {
471
-            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true));
470
+        if ($enableCache === TRUE) {
471
+            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, TRUE));
472 472
             $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
473 473
         }
474 474
         $resultSet = [
@@ -476,22 +476,22 @@  discard block
 block discarded – undo
476 476
             'numberOfToplevels' => 0,
477 477
             'numFound' => 0,
478 478
         ];
479
-        if ($enableCache === false || ($entry = $cache->get($cacheIdentifier)) === false) {
479
+        if ($enableCache === FALSE || ($entry = $cache->get($cacheIdentifier)) === FALSE) {
480 480
             $selectQuery = $solr->service->createSelect($parameters);
481 481
 
482 482
             $grouping = $selectQuery->getGrouping();
483 483
             $grouping->addField('uid');
484 484
             $grouping->setLimit(100); // Results in group (TODO: check)
485
-            $grouping->setNumberOfGroups(true);
485
+            $grouping->setNumberOfGroups(TRUE);
486 486
 
487
-            if ($parameters['fulltext'] === true) {
487
+            if ($parameters['fulltext'] === TRUE) {
488 488
                 // get highlighting component and apply settings
489 489
                 $selectQuery->getHighlighting();
490 490
             }
491 491
 
492 492
             $solrRequest = $solr->service->createRequest($selectQuery);
493 493
 
494
-            if ($parameters['fulltext'] === true) {
494
+            if ($parameters['fulltext'] === TRUE) {
495 495
                 // If it is a fulltext search, enable highlighting.
496 496
                 // field for which highlighting is going to be performed,
497 497
                 // is required if you want to have OCR highlighting
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
             $resultSet['numberOfToplevels'] = $uidGroup->getNumberOfGroups();
513 513
             $resultSet['numFound'] = $uidGroup->getMatches();
514 514
             $highlighting = [];
515
-            if ($parameters['fulltext'] === true) {
515
+            if ($parameters['fulltext'] === TRUE) {
516 516
                 $data = $result->getData();
517 517
                 $highlighting = $data['ocrHighlighting'];
518 518
             }
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
             }
544 544
 
545 545
             // Save value in cache.
546
-            if (!empty($resultSet) && $enableCache === true) {
546
+            if (!empty($resultSet) && $enableCache === TRUE) {
547 547
                 $cache->set($cacheIdentifier, $resultSet);
548 548
             }
549 549
         } else {
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             // in which case metadata of toplevel entry isn't yet filled.
99 99
             if (empty($document['metadata'])) {
100 100
                 $document['metadata'] = $this->fetchToplevelMetadataFromSolr([
101
-                    'query' => 'uid:' . $document['uid'],
101
+                    'query' => 'uid:'.$document['uid'],
102 102
                     'start' => 0,
103 103
                     'rows' => 1,
104 104
                     'sort' => ['score' => 'desc'],
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             if (empty($document['title']) && $document['partOf'] > 0) {
110 110
                 $superiorTitle = Doc::getTitle($document['partOf'], true);
111 111
                 if (!empty($superiorTitle)) {
112
-                    $document['title'] = '[' . $superiorTitle . ']';
112
+                    $document['title'] = '['.$superiorTitle.']';
113 113
                 }
114 114
             }
115 115
         }
@@ -172,13 +172,13 @@  discard block
 block discarded – undo
172 172
         // Set search query.
173 173
         if (
174 174
             (!empty($this->searchParams['fulltext']))
175
-            || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($this->searchParams['query']), $matches)
175
+            || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($this->searchParams['query']), $matches)
176 176
         ) {
177 177
             // If the query already is a fulltext query e.g using the facets
178 178
             $this->searchParams['query'] = empty($matches[1]) ? $this->searchParams['query'] : $matches[1];
179 179
             // Search in fulltext field if applicable. Query must not be empty!
180 180
             if (!empty($this->searchParams['query'])) {
181
-                $query = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($this->searchParams['query'])) . ')';
181
+                $query = $fields['fulltext'].':('.Solr::escapeQuery(trim($this->searchParams['query'])).')';
182 182
             }
183 183
             $params['fulltext'] = true;
184 184
         } else {
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
                         in_array($this->searchParams['extOperator'][$i], $allowedOperators)
202 202
                     ) {
203 203
                         if (!empty($query)) {
204
-                            $query .= ' ' . $this->searchParams['extOperator'][$i] . ' ';
204
+                            $query .= ' '.$this->searchParams['extOperator'][$i].' ';
205 205
                         }
206
-                        $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($this->searchParams['extQuery'][$i]) . ')';
206
+                        $query .= Indexer::getIndexFieldName($this->searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($this->searchParams['extQuery'][$i]).')';
207 207
                     }
208 208
                 }
209 209
             }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         // Add filter query for date search
213 213
         if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) {
214 214
             // combine dateFrom and dateTo into range search
215
-            $params['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}'. $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']';
215
+            $params['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']';
216 216
         }
217 217
 
218 218
         // Add filter query for faceting.
@@ -229,12 +229,12 @@  discard block
 block discarded – undo
229 229
         ) {
230 230
             // Search in document and all subordinates (valid for up to three levels of hierarchy).
231 231
             $params['filterquery'][]['query'] = '_query_:"{!join from='
232
-                . $fields['uid'] . ' to=' . $fields['partof'] . '}'
233
-                . $fields['uid'] . ':{!join from=' . $fields['uid'] . ' to=' . $fields['partof'] . '}'
234
-                . $fields['uid'] . ':' . $this->searchParams['documentId'] . '"' . ' OR {!join from='
235
-                . $fields['uid'] . ' to=' . $fields['partof'] . '}'
236
-                . $fields['uid'] . ':' . $this->searchParams['documentId'] . ' OR '
237
-                . $fields['uid'] . ':' . $this->searchParams['documentId'];
232
+                . $fields['uid'].' to='.$fields['partof'].'}'
233
+                . $fields['uid'].':{!join from='.$fields['uid'].' to='.$fields['partof'].'}'
234
+                . $fields['uid'].':'.$this->searchParams['documentId'].'"'.' OR {!join from='
235
+                . $fields['uid'].' to='.$fields['partof'].'}'
236
+                . $fields['uid'].':'.$this->searchParams['documentId'].' OR '
237
+                . $fields['uid'].':'.$this->searchParams['documentId'];
238 238
         }
239 239
 
240 240
         // if collections are given, we prepare the collection query string
@@ -243,25 +243,25 @@  discard block
 block discarded – undo
243 243
             $virtualCollectionsQueryString = '';
244 244
             foreach ($this->collection as $collectionEntry) {
245 245
                 // check for virtual collections query string
246
-                if($collectionEntry->getIndexSearch()) {
247
-                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ;
246
+                if ($collectionEntry->getIndexSearch()) {
247
+                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')';
248 248
                 } else {
249
-                    $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"';
249
+                    $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"';
250 250
                 }
251 251
             }
252 252
             
253 253
             // distinguish between simple collection browsing and actual searching within the collection(s)
254
-            if(!empty($collectionsQueryString)) {
255
-                if(empty($query)) {
256
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)';
254
+            if (!empty($collectionsQueryString)) {
255
+                if (empty($query)) {
256
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)';
257 257
                 } else {
258
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))';
258
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))';
259 259
                 }
260 260
             }
261 261
 
262 262
             // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separatly
263
-            if(!empty($virtualCollectionsQueryString)) {
264
-                $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')';
263
+            if (!empty($virtualCollectionsQueryString)) {
264
+                $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')';
265 265
             }
266 266
 
267 267
             // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those
@@ -294,8 +294,8 @@  discard block
 block discarded – undo
294 294
         if ($this->listedMetadata) {
295 295
             foreach ($this->listedMetadata as $metadata) {
296 296
                 if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) {
297
-                    $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u');
298
-                    $params['fields'] .= ',' . $listMetadataRecord;
297
+                    $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u');
298
+                    $params['fields'] .= ','.$listMetadataRecord;
299 299
                     $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord;
300 300
                 }
301 301
             }
@@ -339,8 +339,8 @@  discard block
 block discarded – undo
339 339
                 }
340 340
                 if ($documents[$doc['uid']]) {
341 341
                     // translate language code if applicable
342
-                    if($doc['metadata']['language']) {
343
-                        foreach($doc['metadata']['language'] as $indexName => $language) {
342
+                    if ($doc['metadata']['language']) {
343
+                        foreach ($doc['metadata']['language'] as $indexName => $language) {
344 344
                             $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]);
345 345
                         }
346 346
                     }
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
                             $children = $childrenOf[$doc['uid']] ?? [];
380 380
                             if (!empty($children)) {
381 381
                                 $metadataOf = $this->fetchToplevelMetadataFromSolr([
382
-                                    'query' => 'partof:' . $doc['uid'],
382
+                                    'query' => 'partof:'.$doc['uid'],
383 383
                                     'start' => 0,
384 384
                                     'rows' => 100,
385 385
                                 ]);
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
         if ($this->listedMetadata) {
427 427
             foreach ($this->listedMetadata as $metadata) {
428 428
                 if ($metadata->getIndexStored() || $metadata->getIndexIndexed()) {
429
-                    $listMetadataRecord = $metadata->getIndexName() . '_' . ($metadata->getIndexTokenized() ? 't' : 'u') . ($metadata->getIndexStored() ? 's' : 'u') . ($metadata->getIndexIndexed() ? 'i' : 'u');
430
-                    $params['fields'] .= ',' . $listMetadataRecord;
429
+                    $listMetadataRecord = $metadata->getIndexName().'_'.($metadata->getIndexTokenized() ? 't' : 'u').($metadata->getIndexStored() ? 's' : 'u').($metadata->getIndexIndexed() ? 'i' : 'u');
430
+                    $params['fields'] .= ','.$listMetadataRecord;
431 431
                     $params['listMetadataRecords'][$metadata->getIndexName()] = $listMetadataRecord;
432 432
                 }
433 433
             }
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
 
441 441
         foreach ($result['documents'] as $doc) {
442 442
             // translate language code if applicable
443
-            if($doc['metadata']['language']) {
444
-                foreach($doc['metadata']['language'] as $indexName => $language) {
443
+            if ($doc['metadata']['language']) {
444
+                foreach ($doc['metadata']['language'] as $indexName => $language) {
445 445
                     $doc['metadata']['language'][$indexName] = Helper::getLanguageName($doc['metadata']['language'][$indexName]);
446 446
                 }
447 447
             }
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
         $cache = null;
484 484
         // Calculate cache identifier.
485 485
         if ($enableCache === true) {
486
-            $cacheIdentifier = Helper::digest($solr->core . print_r($parameters, true));
486
+            $cacheIdentifier = Helper::digest($solr->core.print_r($parameters, true));
487 487
             $cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('tx_dlf_solr');
488 488
         }
489 489
         $resultSet = [
Please login to merge, or discard this patch.
Classes/Api/Viaf/Client.php 3 patches
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.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage dlf
26 26
  * @access public
27 27
  **/
28
-class Client
29
-{
28
+class Client {
30 29
     /**
31 30
      * This holds the logger
32 31
      *
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
      * @param RequestFactory $requestFactory a request object to inject
64 63
      * @return void
65 64
      **/
66
-    public function __construct($viaf, RequestFactory $requestFactory)
67
-    {
65
+    public function __construct($viaf, RequestFactory $requestFactory) {
68 66
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
69 67
         $this->viafUrl = 'http://viaf.org/viaf/' . $viaf;
70 68
         $this->requestFactory = $requestFactory;
@@ -86,8 +84,7 @@  discard block
 block discarded – undo
86 84
      *
87 85
      * @return object|bool
88 86
      **/
89
-    public function getData()
90
-    {
87
+    public function getData() {
91 88
         $url = $this->getApiEndpoint();
92 89
         try {
93 90
             $response = $this->requestFactory->request($url);
@@ -103,8 +100,7 @@  discard block
 block discarded – undo
103 100
      *
104 101
      * @return string
105 102
      **/
106
-    protected function getApiEndpoint()
107
-    {
103
+    protected function getApiEndpoint() {
108 104
         return $this->viafUrl . '/' . $this->endpoint;
109 105
     }
110 106
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,14 +47,14 @@  discard block
 block discarded – undo
47 47
      *
48 48
      * @var string
49 49
      **/
50
-    private $viafUrl = null;
50
+    private $viafUrl = NULL;
51 51
 
52 52
     /**
53 53
      * The request object
54 54
      *
55 55
      * @var RequestFactoryInterface
56 56
      **/
57
-    private $requestFactory = null;
57
+    private $requestFactory = NULL;
58 58
 
59 59
     /**
60 60
      * Constructs a new instance
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             $response = $this->requestFactory->request($url);
94 94
         } catch (\Exception $e) {
95 95
             $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.');
96
-            return false;
96
+            return FALSE;
97 97
         }
98 98
         return $response->getBody()->getContents();
99 99
     }
Please login to merge, or discard this patch.
Classes/Api/Viaf/Profile.php 2 patches
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage dlf
26 26
  * @access public
27 27
  **/
28
-class Profile
29
-{
28
+class Profile {
30 29
     /**
31 30
      * This holds the logger
32 31
      *
@@ -57,8 +56,7 @@  discard block
 block discarded – undo
57 56
      *
58 57
      * @return void
59 58
      **/
60
-    public function __construct($viaf)
61
-    {
59
+    public function __construct($viaf) {
62 60
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
63 61
         $this->client = new Client($viaf, GeneralUtility::makeInstance(RequestFactory::class));
64 62
     }
@@ -68,8 +66,7 @@  discard block
 block discarded – undo
68 66
      *
69 67
      * @return array|false
70 68
      **/
71
-    public function getData()
72
-    {
69
+    public function getData() {
73 70
         $this->getRaw();
74 71
         if (!empty($this->raw)) {
75 72
             $data = [];
@@ -87,8 +84,7 @@  discard block
 block discarded – undo
87 84
      *
88 85
      * @return string|false
89 86
      **/
90
-    public function getAddress()
91
-    {
87
+    public function getAddress() {
92 88
         $this->getRaw();
93 89
         if (!empty($this->raw->asXML())) {
94 90
             return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0];
@@ -103,8 +99,7 @@  discard block
 block discarded – undo
103 99
      *
104 100
      * @return string|false
105 101
      **/
106
-    public function getFullName()
107
-    {
102
+    public function getFullName() {
108 103
         $this->getRaw();
109 104
         if (!empty($this->raw->asXML())) {
110 105
             $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text');
@@ -122,8 +117,7 @@  discard block
 block discarded – undo
122 117
      *
123 118
      * @return void
124 119
      **/
125
-    protected function getRaw()
126
-    {
120
+    protected function getRaw() {
127 121
         $data = $this->client->getData();
128 122
         if (!isset($this->raw) && $data != false) {
129 123
             $this->raw = Helper::getXmlFileAsString($data);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      *
49 49
      * @var \SimpleXmlElement|false
50 50
      **/
51
-    private $raw = null;
51
+    private $raw = NULL;
52 52
 
53 53
     /**
54 54
      * Constructs client instance
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             return $data;
79 79
         } else {
80 80
             $this->logger->warning('No data found for given VIAF URL');
81
-            return false;
81
+            return FALSE;
82 82
         }
83 83
     }
84 84
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0];
95 95
         } else {
96 96
             $this->logger->warning('No address found for given VIAF URL');
97
-            return false;
97
+            return FALSE;
98 98
         }
99 99
     }
100 100
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
             return $name;
114 114
         } else {
115 115
             $this->logger->warning('No name found for given VIAF URL');
116
-            return false;
116
+            return FALSE;
117 117
         }
118 118
     }
119 119
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     protected function getRaw()
126 126
     {
127 127
         $data = $this->client->getData();
128
-        if (!isset($this->raw) && $data != false) {
128
+        if (!isset($this->raw) && $data != FALSE) {
129 129
             $this->raw = Helper::getXmlFileAsString($data);
130 130
             $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#');
131 131
         }
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 3 patches
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.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @subpackage dlf
30 30
  * @access public
31 31
  */
32
-class MetadataController extends AbstractController
33
-{
32
+class MetadataController extends AbstractController {
34 33
     /**
35 34
      * @var CollectionRepository
36 35
      */
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
     /**
40 39
      * @param CollectionRepository $collectionRepository
41 40
      */
42
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
43
-    {
41
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
44 42
         $this->collectionRepository = $collectionRepository;
45 43
     }
46 44
 
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
     /**
53 51
      * @param MetadataRepository $metadataRepository
54 52
      */
55
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
56
-    {
53
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
57 54
         $this->metadataRepository = $metadataRepository;
58 55
     }
59 56
 
@@ -65,16 +62,14 @@  discard block
 block discarded – undo
65 62
     /**
66 63
      * @param StructureRepository $structureRepository
67 64
      */
68
-    public function injectStructureRepository(StructureRepository $structureRepository)
69
-    {
65
+    public function injectStructureRepository(StructureRepository $structureRepository) {
70 66
         $this->structureRepository = $structureRepository;
71 67
     }
72 68
 
73 69
     /**
74 70
      * @return string|void
75 71
      */
76
-    public function mainAction()
77
-    {
72
+    public function mainAction() {
78 73
         $this->cObj = $this->configurationManager->getContentObject();
79 74
 
80 75
         // Load current document.
@@ -130,8 +125,7 @@  discard block
 block discarded – undo
130 125
      *
131 126
      * @return string The metadata array ready for output
132 127
      */
133
-    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false)
134
-    {
128
+    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false) {
135 129
         if ($useOriginalIiifManifestMetadata) {
136 130
             $iiifData = [];
137 131
             foreach ($metadata as $row) {
@@ -269,8 +263,7 @@  discard block
 block discarded – undo
269 263
                     }
270 264
 
271 265
                     if (is_array($metadata[$i][$name])) {
272
-                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue)
273
-                        {
266
+                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) {
274 267
                             return !empty($metadataValue);
275 268
                         }));
276 269
                     }
@@ -294,8 +287,7 @@  discard block
 block discarded – undo
294 287
      *
295 288
      * @return array metadata
296 289
      */
297
-    private function getMetadata()
298
-    {
290
+    private function getMetadata() {
299 291
         $metadata = [];
300 292
         if ($this->settings['rootline'] < 2) {
301 293
             // Get current structure's @ID.
@@ -333,8 +325,7 @@  discard block
 block discarded – undo
333 325
      *
334 326
      * @return array metadata
335 327
      */
336
-    private function getMetadataForIds($id, $metadata)
337
-    {
328
+    private function getMetadataForIds($id, $metadata) {
338 329
         $useOriginalIiifManifestMetadata = $this->settings['originalIiifMetadata'] == 1 && $this->document->getDoc() instanceof IiifManifest;
339 330
         foreach ($id as $sid) {
340 331
             if ($useOriginalIiifManifestMetadata) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         // Load current document.
81 81
         $this->loadDocument($this->requestData);
82 82
         if (
83
-            $this->document === null
84
-            || $this->document->getDoc() === null
83
+            $this->document === NULL
84
+            || $this->document->getDoc() === NULL
85 85
         ) {
86 86
             // Quit without doing anything if required variables are not set.
87 87
             return '';
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      *
131 131
      * @return string The metadata array ready for output
132 132
      */
133
-    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = false)
133
+    protected function printMetadata(array $metadata, $useOriginalIiifManifestMetadata = FALSE)
134 134
     {
135 135
         if ($useOriginalIiifManifestMetadata) {
136 136
             $iiifData = [];
@@ -148,14 +148,14 @@  discard block
 block discarded – undo
148 148
                             $iiifData[$key] = [
149 149
                                 'label' => $key,
150 150
                                 'value' => $group,
151
-                                'buildUrl' => true,
151
+                                'buildUrl' => TRUE,
152 152
                             ];
153 153
                         } else {
154 154
                             // Data output
155 155
                             $iiifData[$key] = [
156 156
                                 'label' => $key,
157 157
                                 'value' => $group,
158
-                                'buildUrl' => false,
158
+                                'buildUrl' => FALSE,
159 159
                             ];
160 160
                         }
161 161
                     } else {
@@ -172,18 +172,18 @@  discard block
 block discarded – undo
172 172
                                 $iiifData[$key]['data'][] = [
173 173
                                     'label' => $nolabel ? '' : $label,
174 174
                                     'value' => $value,
175
-                                    'buildUrl' => true,
175
+                                    'buildUrl' => TRUE,
176 176
                                 ];
177 177
                             } else {
178 178
                                 $iiifData[$key]['data'][] = [
179 179
                                     'label' => $label,
180 180
                                     'value' => $value,
181
-                                    'buildUrl' => false,
181
+                                    'buildUrl' => FALSE,
182 182
                                 ];
183 183
                             }
184 184
                         }
185 185
                     }
186
-                    $this->view->assign('useIiif', true);
186
+                    $this->view->assign('useIiif', TRUE);
187 187
                     $this->view->assign('iiifData', $iiifData);
188 188
                 }
189 189
             }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                     if ($name == 'title') {
214 214
                         // Get title of parent document if needed.
215 215
                         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
216
-                            $superiorTitle = Doc::getTitle($this->document->getPartof(), true);
216
+                            $superiorTitle = Doc::getTitle($this->document->getPartof(), TRUE);
217 217
                             if (!empty($superiorTitle)) {
218 218
                                 $metadata[$i][$name] = ['[' . $superiorTitle . ']'];
219 219
                             }
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 1 patch
Braces   +32 added lines, -64 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
  * @property-read string $toplevelId This holds the toplevel structure's @ID (METS) or the manifest's @id (IIIF)
51 51
  * @property-read string $parentHref URL of the parent document (determined via mptr element), or empty string if none is available
52 52
  */
53
-final class MetsDocument extends Doc
54
-{
53
+final class MetsDocument extends Doc {
55 54
     /**
56 55
      * Subsections / tags that may occur within `<mets:amdSec>`.
57 56
      *
@@ -176,8 +175,7 @@  discard block
 block discarded – undo
176 175
      *
177 176
      * @return  void
178 177
      */
179
-    public function addMetadataFromMets(&$metadata, $id)
180
-    {
178
+    public function addMetadataFromMets(&$metadata, $id) {
181 179
         $details = $this->getLogicalStructure($id);
182 180
         if (!empty($details)) {
183 181
             $metadata['mets_order'][0] = $details['order'];
@@ -191,8 +189,7 @@  discard block
 block discarded – undo
191 189
      * {@inheritDoc}
192 190
      * @see \Kitodo\Dlf\Common\Doc::establishRecordId()
193 191
      */
194
-    protected function establishRecordId($pid)
195
-    {
192
+    protected function establishRecordId($pid) {
196 193
         // Check for METS object @ID.
197 194
         if (!empty($this->mets['OBJID'])) {
198 195
             $this->recordId = (string) $this->mets['OBJID'];
@@ -212,8 +209,7 @@  discard block
 block discarded – undo
212 209
      * {@inheritDoc}
213 210
      * @see \Kitodo\Dlf\Common\Doc::getDownloadLocation()
214 211
      */
215
-    public function getDownloadLocation($id)
216
-    {
212
+    public function getDownloadLocation($id) {
217 213
         $fileMimeType = $this->getFileMimeType($id);
218 214
         $fileLocation = $this->getFileLocation($id);
219 215
         if ($fileMimeType === 'application/vnd.kitodo.iiif') {
@@ -238,8 +234,7 @@  discard block
 block discarded – undo
238 234
      * {@inheritDoc}
239 235
      * @see \Kitodo\Dlf\Common\Doc::getFileLocation()
240 236
      */
241
-    public function getFileLocation($id)
242
-    {
237
+    public function getFileLocation($id) {
243 238
         $location = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/mets:FLocat[@LOCTYPE="URL"]');
244 239
         if (
245 240
             !empty($id)
@@ -256,8 +251,7 @@  discard block
 block discarded – undo
256 251
      * {@inheritDoc}
257 252
      * @see \Kitodo\Dlf\Common\Doc::getFileMimeType()
258 253
      */
259
-    public function getFileMimeType($id)
260
-    {
254
+    public function getFileMimeType($id) {
261 255
         $mimetype = $this->mets->xpath('./mets:fileSec/mets:fileGrp/mets:file[@ID="' . $id . '"]/@MIMETYPE');
262 256
         if (
263 257
             !empty($id)
@@ -274,8 +268,7 @@  discard block
 block discarded – undo
274 268
      * {@inheritDoc}
275 269
      * @see \Kitodo\Dlf\Common\Doc::getLogicalStructure()
276 270
      */
277
-    public function getLogicalStructure($id, $recursive = false)
278
-    {
271
+    public function getLogicalStructure($id, $recursive = false) {
279 272
         $details = [];
280 273
         // Is the requested logical unit already loaded?
281 274
         if (
@@ -315,8 +308,7 @@  discard block
 block discarded – undo
315 308
      *
316 309
      * @return array Array of the element's id, label, type and physical page indexes/mptr link
317 310
      */
318
-    protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false)
319
-    {
311
+    protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false) {
320 312
         // Get attributes.
321 313
         foreach ($structure->attributes() as $attribute => $value) {
322 314
             $attributes[$attribute] = (string) $value;
@@ -420,8 +412,7 @@  discard block
 block discarded – undo
420 412
      * {@inheritDoc}
421 413
      * @see \Kitodo\Dlf\Common\Doc::getMetadata()
422 414
      */
423
-    public function getMetadata($id, $cPid = 0)
424
-    {
415
+    public function getMetadata($id, $cPid = 0) {
425 416
         // Make sure $cPid is a non-negative integer.
426 417
         $cPid = max(intval($cPid), 0);
427 418
         // If $cPid is not given, try to get it elsewhere.
@@ -675,8 +666,7 @@  discard block
 block discarded – undo
675 666
      * @param string $id: The "@ID" attribute of the file node
676 667
      * @return void
677 668
      */
678
-    protected function getMetadataIds($id)
679
-    {
669
+    protected function getMetadataIds($id) {
680 670
         // Load amdSecChildIds concordance
681 671
         $this->_getMdSec();
682 672
         $this->_getFileInfos();
@@ -723,8 +713,7 @@  discard block
 block discarded – undo
723 713
      * {@inheritDoc}
724 714
      * @see \Kitodo\Dlf\Common\Doc::getFullText()
725 715
      */
726
-    public function getFullText($id)
727
-    {
716
+    public function getFullText($id) {
728 717
         $fullText = '';
729 718
 
730 719
         // Load fileGrps and check for full text files.
@@ -739,8 +728,7 @@  discard block
 block discarded – undo
739 728
      * {@inheritDoc}
740 729
      * @see Doc::getStructureDepth()
741 730
      */
742
-    public function getStructureDepth($logId)
743
-    {
731
+    public function getStructureDepth($logId) {
744 732
         $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*');
745 733
         if (!empty($ancestors)) {
746 734
             return count($ancestors);
@@ -753,8 +741,7 @@  discard block
 block discarded – undo
753 741
      * {@inheritDoc}
754 742
      * @see \Kitodo\Dlf\Common\Doc::init()
755 743
      */
756
-    protected function init($location)
757
-    {
744
+    protected function init($location) {
758 745
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(get_class($this));
759 746
         // Get METS node from XML file.
760 747
         $this->registerNamespaces($this->xml);
@@ -778,8 +765,7 @@  discard block
 block discarded – undo
778 765
      * {@inheritDoc}
779 766
      * @see \Kitodo\Dlf\Common\Doc::loadLocation()
780 767
      */
781
-    protected function loadLocation($location)
782
-    {
768
+    protected function loadLocation($location) {
783 769
         $fileResource = Helper::getUrl($location);
784 770
         if ($fileResource !== false) {
785 771
             $xml = Helper::getXmlFileAsString($fileResource);
@@ -797,8 +783,7 @@  discard block
 block discarded – undo
797 783
      * {@inheritDoc}
798 784
      * @see \Kitodo\Dlf\Common\Doc::ensureHasFulltextIsSet()
799 785
      */
800
-    protected function ensureHasFulltextIsSet()
801
-    {
786
+    protected function ensureHasFulltextIsSet() {
802 787
         // Are the fileGrps already loaded?
803 788
         if (!$this->fileGrpsLoaded) {
804 789
             $this->_getFileGrps();
@@ -809,8 +794,7 @@  discard block
 block discarded – undo
809 794
      * {@inheritDoc}
810 795
      * @see Doc::setPreloadedDocument()
811 796
      */
812
-    protected function setPreloadedDocument($preloadedDocument)
813
-    {
797
+    protected function setPreloadedDocument($preloadedDocument) {
814 798
 
815 799
         if ($preloadedDocument instanceof \SimpleXMLElement) {
816 800
             $this->xml = $preloadedDocument;
@@ -823,8 +807,7 @@  discard block
 block discarded – undo
823 807
      * {@inheritDoc}
824 808
      * @see Doc::getDocument()
825 809
      */
826
-    protected function getDocument()
827
-    {
810
+    protected function getDocument() {
828 811
         return $this->mets;
829 812
     }
830 813
 
@@ -835,8 +818,7 @@  discard block
 block discarded – undo
835 818
      *
836 819
      * @return array Array of metadata sections with their IDs as array key
837 820
      */
838
-    protected function _getMdSec()
839
-    {
821
+    protected function _getMdSec() {
840 822
         if (!$this->mdSecLoaded) {
841 823
             $this->loadFormats();
842 824
 
@@ -878,8 +860,7 @@  discard block
 block discarded – undo
878 860
         return $this->mdSec;
879 861
     }
880 862
 
881
-    protected function _getDmdSec()
882
-    {
863
+    protected function _getDmdSec() {
883 864
         $this->_getMdSec();
884 865
         return $this->dmdSec;
885 866
     }
@@ -893,8 +874,7 @@  discard block
 block discarded – undo
893 874
      *
894 875
      * @return array|null The processed metadata section
895 876
      */
896
-    protected function processMdSec($element)
897
-    {
877
+    protected function processMdSec($element) {
898 878
         $mdId = (string) $element->attributes()->ID;
899 879
         if (empty($mdId)) {
900 880
             return null;
@@ -934,8 +914,7 @@  discard block
 block discarded – undo
934 914
      *
935 915
      * @return array Array of file use groups with file IDs
936 916
      */
937
-    protected function _getFileGrps()
938
-    {
917
+    protected function _getFileGrps() {
939 918
         if (!$this->fileGrpsLoaded) {
940 919
             // Get configured USE attributes.
941 920
             $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey);
@@ -987,8 +966,7 @@  discard block
 block discarded – undo
987 966
      * @access protected
988 967
      * @return array
989 968
      */
990
-    protected function _getFileInfos()
991
-    {
969
+    protected function _getFileInfos() {
992 970
         $this->_getFileGrps();
993 971
         return $this->fileInfos;
994 972
     }
@@ -997,8 +975,7 @@  discard block
 block discarded – undo
997 975
      * {@inheritDoc}
998 976
      * @see \Kitodo\Dlf\Common\Doc::prepareMetadataArray()
999 977
      */
1000
-    protected function prepareMetadataArray($cPid)
1001
-    {
978
+    protected function prepareMetadataArray($cPid) {
1002 979
         $ids = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID]/@ID');
1003 980
         // Get all logical structure nodes with metadata.
1004 981
         if (!empty($ids)) {
@@ -1016,8 +993,7 @@  discard block
 block discarded – undo
1016 993
      *
1017 994
      * @return \SimpleXMLElement The XML's METS part as \SimpleXMLElement object
1018 995
      */
1019
-    protected function _getMets()
1020
-    {
996
+    protected function _getMets() {
1021 997
         return $this->mets;
1022 998
     }
1023 999
 
@@ -1025,8 +1001,7 @@  discard block
 block discarded – undo
1025 1001
      * {@inheritDoc}
1026 1002
      * @see \Kitodo\Dlf\Common\Doc::_getPhysicalStructure()
1027 1003
      */
1028
-    protected function _getPhysicalStructure()
1029
-    {
1004
+    protected function _getPhysicalStructure() {
1030 1005
         // Is there no physical structure array yet?
1031 1006
         if (!$this->physicalStructureLoaded) {
1032 1007
             // Does the document have a structMap node of type "PHYSICAL"?
@@ -1088,8 +1063,7 @@  discard block
 block discarded – undo
1088 1063
      * {@inheritDoc}
1089 1064
      * @see \Kitodo\Dlf\Common\Doc::_getSmLinks()
1090 1065
      */
1091
-    protected function _getSmLinks()
1092
-    {
1066
+    protected function _getSmLinks() {
1093 1067
         if (!$this->smLinksLoaded) {
1094 1068
             $smLinks = $this->mets->xpath('./mets:structLink/mets:smLink');
1095 1069
             if (!empty($smLinks)) {
@@ -1107,8 +1081,7 @@  discard block
 block discarded – undo
1107 1081
      * {@inheritDoc}
1108 1082
      * @see \Kitodo\Dlf\Common\Doc::_getThumbnail()
1109 1083
      */
1110
-    protected function _getThumbnail($forceReload = false)
1111
-    {
1084
+    protected function _getThumbnail($forceReload = false) {
1112 1085
         if (
1113 1086
             !$this->thumbnailLoaded
1114 1087
             || $forceReload
@@ -1187,8 +1160,7 @@  discard block
 block discarded – undo
1187 1160
      * {@inheritDoc}
1188 1161
      * @see \Kitodo\Dlf\Common\Doc::_getToplevelId()
1189 1162
      */
1190
-    protected function _getToplevelId()
1191
-    {
1163
+    protected function _getToplevelId() {
1192 1164
         if (empty($this->toplevelId)) {
1193 1165
             // Get all logical structure nodes with metadata, but without associated METS-Pointers.
1194 1166
             $divs = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@DMDID and not(./mets:mptr)]');
@@ -1217,8 +1189,7 @@  discard block
 block discarded – undo
1217 1189
      *
1218 1190
      * @return string|null
1219 1191
      */
1220
-    public function _getParentHref()
1221
-    {
1192
+    public function _getParentHref() {
1222 1193
         if ($this->parentHref === null) {
1223 1194
             $this->parentHref = '';
1224 1195
 
@@ -1240,8 +1211,7 @@  discard block
 block discarded – undo
1240 1211
      *
1241 1212
      * @return array Properties to be serialized
1242 1213
      */
1243
-    public function __sleep()
1244
-    {
1214
+    public function __sleep() {
1245 1215
         // \SimpleXMLElement objects can't be serialized, thus save the XML as string for serialization
1246 1216
         $this->asXML = $this->xml->asXML();
1247 1217
         return ['uid', 'pid', 'recordId', 'parentId', 'asXML'];
@@ -1254,8 +1224,7 @@  discard block
 block discarded – undo
1254 1224
      *
1255 1225
      * @return string String representing the METS object
1256 1226
      */
1257
-    public function __toString()
1258
-    {
1227
+    public function __toString() {
1259 1228
         $xml = new \DOMDocument('1.0', 'utf-8');
1260 1229
         $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), true));
1261 1230
         $xml->formatOutput = true;
@@ -1270,8 +1239,7 @@  discard block
 block discarded – undo
1270 1239
      *
1271 1240
      * @return void
1272 1241
      */
1273
-    public function __wakeup()
1274
-    {
1242
+    public function __wakeup() {
1275 1243
         $xml = Helper::getXmlFileAsString($this->asXML);
1276 1244
         if ($xml !== false) {
1277 1245
             $this->asXML = '';
Please login to merge, or discard this patch.
Classes/Controller/TableOfContentsController.php 2 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
  * @subpackage dlf
25 25
  * @access public
26 26
  */
27
-class TableOfContentsController extends AbstractController
28
-{
27
+class TableOfContentsController extends AbstractController {
29 28
     /**
30 29
      * This holds the active entries according to the currently selected page
31 30
      *
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
      *
40 39
      * @return void
41 40
      */
42
-    public function mainAction()
43
-    {
41
+    public function mainAction() {
44 42
         // Load current document.
45 43
         $this->loadDocument($this->requestData);
46 44
         if (
@@ -66,8 +64,7 @@  discard block
 block discarded – undo
66 64
      * @access protected
67 65
      * @return array HMENU array
68 66
      */
69
-    protected function makeMenuArray()
70
-    {
67
+    protected function makeMenuArray() {
71 68
         // Set default values for page if not set.
72 69
         // $this->requestData['page'] may be integer or string (physical structure @ID)
73 70
         if (
@@ -143,8 +140,7 @@  discard block
 block discarded – undo
143 140
      *
144 141
      * @return array HMENU array for menu entry
145 142
      */
146
-    protected function getMenuEntry(array $entry, $recursive = false)
147
-    {
143
+    protected function getMenuEntry(array $entry, $recursive = false) {
148 144
         $entry = $this->resolveMenuEntry($entry);
149 145
 
150 146
         $entryArray = [];
@@ -238,8 +234,7 @@  discard block
 block discarded – undo
238 234
      * @param array $entry
239 235
      * @return array
240 236
      */
241
-    protected function resolveMenuEntry($entry)
242
-    {
237
+    protected function resolveMenuEntry($entry) {
243 238
         // If the menu entry points to the parent document,
244 239
         // resolve to the parent UID set on indexation.
245 240
         $doc = $this->document->getDoc();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
         // Load current document.
45 45
         $this->loadDocument($this->requestData);
46 46
         if (
47
-            $this->document === null
48
-            || $this->document->getDoc() === null
47
+            $this->document === NULL
48
+            || $this->document->getDoc() === NULL
49 49
         ) {
50 50
             // Quit without doing anything if required variables are not set.
51 51
             return;
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
             }
103 103
             // Go through table of contents and create all menu entries.
104 104
             foreach ($this->document->getDoc()->tableOfContents as $entry) {
105
-                $menuArray[] = $this->getMenuEntry($entry, true);
105
+                $menuArray[] = $this->getMenuEntry($entry, TRUE);
106 106
             }
107 107
         } else {
108 108
             // Go through table of contents and create top-level menu entries.
109 109
             foreach ($this->document->getDoc()->tableOfContents as $entry) {
110
-                $menuArray[] = $this->getMenuEntry($entry, false);
110
+                $menuArray[] = $this->getMenuEntry($entry, FALSE);
111 111
             }
112 112
             // Build table of contents from database.
113 113
             $result = $this->documentRepository->getTableOfContentsFromDb($this->document->getUid(), $this->document->getPid(), $this->settings);
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
                         'pagination' => '',
127 127
                         'targetUid' => $resArray['uid']
128 128
                     ];
129
-                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, false);
129
+                    $menuArray[0]['_SUB_MENU'][] = $this->getMenuEntry($entry, FALSE);
130 130
                 }
131 131
             }
132 132
         }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      *
144 144
      * @return array HMENU array for menu entry
145 145
      */
146
-    protected function getMenuEntry(array $entry, $recursive = false)
146
+    protected function getMenuEntry(array $entry, $recursive = FALSE)
147 147
     {
148 148
         $entry = $this->resolveMenuEntry($entry);
149 149
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         }
202 202
         // Build sub-menu if available and called recursively.
203 203
         if (
204
-            $recursive === true
204
+            $recursive === TRUE
205 205
             && !empty($entry['children'])
206 206
         ) {
207 207
             // Build sub-menu only if one of the following conditions apply:
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                     if (in_array($child['id'], $this->activeEntries)) {
220 220
                         $entryArray['ITEM_STATE'] = 'ACT';
221 221
                     }
222
-                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, true);
222
+                    $entryArray['_SUB_MENU'][] = $this->getMenuEntry($child, TRUE);
223 223
                 }
224 224
             }
225 225
             // Append "IFSUB" to "ITEM_STATE" if this entry has sub-entries.
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.
Classes/Controller/SearchController.php 3 patches
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -108,13 +108,13 @@  discard block
 block discarded – undo
108 108
         }
109 109
 
110 110
         // sanitize date search input
111
-        if(empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) {
111
+        if (empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) {
112 112
             $this->searchParams['dateFrom'] = '*';
113 113
         }
114
-        if(empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) {
114
+        if (empty($this->searchParams['dateTo']) && !empty($this->searchParams['dateFrom'])) {
115 115
             $this->searchParams['dateTo'] = 'NOW';
116 116
         }
117
-        if($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) {
117
+        if ($this->searchParams['dateFrom'] > $this->searchParams['dateTo']) {
118 118
             $tmpDate = $this->searchParams['dateFrom'];
119 119
             $this->searchParams['dateFrom'] = $this->searchParams['dateTo'];
120 120
             $this->searchParams['dateTo'] = $tmpDate;
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
         // Add uHash parameter to suggest parameter to make a basic protection of this form.
177 177
         if ($this->settings['suggest']) {
178
-            $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()) . Environment::getExtensionsPath(), 'SearchSuggest'));
178
+            $this->view->assign('uHash', GeneralUtility::hmac((string) (new Typo3Version()).Environment::getExtensionsPath(), 'SearchSuggest'));
179 179
         }
180 180
 
181 181
         $this->view->assign('viewData', $this->viewData);
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         // Get facets from plugin configuration.
199 199
         $facets = [];
200 200
         foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) {
201
-            $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
201
+            $facets[$facet.'_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
202 202
         }
203 203
 
204 204
         $this->view->assign('facetsMenu', $this->makeFacetsMenuArray($facets));
@@ -240,13 +240,13 @@  discard block
 block discarded – undo
240 240
         $searchParams = $this->searchParams;
241 241
         if (
242 242
             (!empty($searchParams['fulltext']))
243
-            || preg_match('/' . $fields['fulltext'] . ':\((.*)\)/', trim($searchParams['query']), $matches)
243
+            || preg_match('/'.$fields['fulltext'].':\((.*)\)/', trim($searchParams['query']), $matches)
244 244
         ) {
245 245
             // If the query already is a fulltext query e.g using the facets
246 246
             $searchParams['query'] = empty($matches[1]) ? $searchParams['query'] : $matches[1];
247 247
             // Search in fulltext field if applicable. Query must not be empty!
248 248
             if (!empty($this->searchParams['query'])) {
249
-                $search['query'] = $fields['fulltext'] . ':(' . Solr::escapeQuery(trim($searchParams['query'])) . ')';
249
+                $search['query'] = $fields['fulltext'].':('.Solr::escapeQuery(trim($searchParams['query'])).')';
250 250
             }
251 251
         } else {
252 252
             // Retain given search field if valid.
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
         // extract collections from collection parameter
260 260
         $collection = null;
261 261
         if ($this->searchParams['collection']) {
262
-            foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
262
+            foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
263 263
                 $collection[] = $this->collectionRepository->findByUid($collectionEntry);
264 264
             }
265 265
             
@@ -269,26 +269,26 @@  discard block
 block discarded – undo
269 269
             $virtualCollectionsQueryString = '';
270 270
             foreach ($collection as $collectionEntry) {
271 271
                 // check for virtual collections query string
272
-                if($collectionEntry->getIndexSearch()) {
273
-                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ;
272
+                if ($collectionEntry->getIndexSearch()) {
273
+                    $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '('.$collectionEntry->getIndexSearch().')' : ' OR ('.$collectionEntry->getIndexSearch().')';
274 274
                 }
275 275
                 else {
276
-                    $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"';
276
+                    $collectionsQueryString .= empty($collectionsQueryString) ? '"'.$collectionEntry->getIndexName().'"' : ' OR "'.$collectionEntry->getIndexName().'"';
277 277
                 }
278 278
             }
279 279
             
280 280
             // distinguish between simple collection browsing and actual searching within the collection(s)
281
-            if(!empty($collectionsQueryString)) {
282
-                if(empty($searchParams['query'])) {
283
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . ') AND toplevel:true AND partof:0)';
281
+            if (!empty($collectionsQueryString)) {
282
+                if (empty($searchParams['query'])) {
283
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.') AND toplevel:true AND partof:0)';
284 284
                 } else {
285
-                    $collectionsQueryString = '(collection_faceting:(' . $collectionsQueryString . '))';
285
+                    $collectionsQueryString = '(collection_faceting:('.$collectionsQueryString.'))';
286 286
                 }
287 287
             }
288 288
 
289 289
             // virtual collections might query documents that are neither toplevel:true nor partof:0 and need to be searched separatly
290
-            if(!empty($virtualCollectionsQueryString)) {
291
-                $virtualCollectionsQueryString = '(' . $virtualCollectionsQueryString . ')';
290
+            if (!empty($virtualCollectionsQueryString)) {
291
+                $virtualCollectionsQueryString = '('.$virtualCollectionsQueryString.')';
292 292
             }
293 293
 
294 294
             // combine both querystrings into a single filterquery via OR if both are given, otherwise pass either of those
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         // add filter query for date search
299 299
         if (!empty($this->searchParams['dateFrom']) && !empty($this->searchParams['dateTo'])) {
300 300
             // combine dateFrom and dateTo into filterquery as range search
301
-            $search['params']['filterquery'][]['query'] = '{!join from=' . $fields['uid'] . ' to=' . $fields['uid'] . '}' . $fields['date'] . ':[' . $this->searchParams['dateFrom'] . ' TO ' . $this->searchParams['dateTo'] . ']';
301
+            $search['params']['filterquery'][]['query'] = '{!join from='.$fields['uid'].' to='.$fields['uid'].'}'.$fields['date'].':['.$this->searchParams['dateFrom'].' TO '.$this->searchParams['dateTo'].']';
302 302
         }
303 303
 
304 304
         // Add extended search query.
@@ -316,9 +316,9 @@  discard block
 block discarded – undo
316 316
                         in_array($searchParams['extOperator'][$i], $allowedOperators)
317 317
                     ) {
318 318
                         if (!empty($search['query'])) {
319
-                            $search['query'] .= ' ' . $searchParams['extOperator'][$i] . ' ';
319
+                            $search['query'] .= ' '.$searchParams['extOperator'][$i].' ';
320 320
                         }
321
-                        $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']) . ':(' . Solr::escapeQuery($searchParams['extQuery'][$i]) . ')';
321
+                        $search['query'] .= Indexer::getIndexFieldName($searchParams['extField'][$i], $this->settings['storagePid']).':('.Solr::escapeQuery($searchParams['extQuery'][$i]).')';
322 322
                     }
323 323
                 }
324 324
             }
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
         $entryArray['doNotLinkIt'] = 0;
445 445
         // Check if facet is already selected.
446 446
         $queryColumn = array_column($search['params']['filterquery'], 'query');
447
-        $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
447
+        $index = array_search($field.':("'.Solr::escapeQuery($value).'")', $queryColumn);
448 448
         if ($index !== false) {
449 449
             // Facet is selected, thus remove it from filter.
450 450
             unset($queryColumn[$index]);
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
             }
459 459
         } else {
460 460
             // Facet is not selected, thus add it to filter.
461
-            $queryColumn[] = $field . ':("' . Solr::escapeQuery($value) . '")';
461
+            $queryColumn[] = $field.':("'.Solr::escapeQuery($value).'")';
462 462
             $entryArray['ITEM_STATE'] = 'NO';
463 463
         }
464 464
         $entryArray['queryColumn'] = $queryColumn;
Please login to merge, or discard this patch.
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
  * @subpackage dlf
33 33
  * @access public
34 34
  */
35
-class SearchController extends AbstractController
36
-{
35
+class SearchController extends AbstractController {
37 36
     /**
38 37
      * @var CollectionRepository
39 38
      */
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
     /**
43 42
      * @param CollectionRepository $collectionRepository
44 43
      */
45
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
46
-    {
44
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
47 45
         $this->collectionRepository = $collectionRepository;
48 46
     }
49 47
 
@@ -55,8 +53,7 @@  discard block
 block discarded – undo
55 53
     /**
56 54
      * @param MetadataRepository $metadataRepository
57 55
      */
58
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
59
-    {
56
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
60 57
         $this->metadataRepository = $metadataRepository;
61 58
     }
62 59
 
@@ -71,8 +68,7 @@  discard block
 block discarded – undo
71 68
      *
72 69
      * @return void
73 70
      */
74
-    public function searchAction()
75
-    {
71
+    public function searchAction() {
76 72
         // if search was triggered, get search parameters from POST variables
77 73
         $this->searchParams = $this->getParametersSafely('searchParameter');
78 74
 
@@ -87,8 +83,7 @@  discard block
 block discarded – undo
87 83
      *
88 84
      * @return void
89 85
      */
90
-    public function mainAction()
91
-    {
86
+    public function mainAction() {
92 87
         $listViewSearch = false;
93 88
         // Quit without doing anything if required variables are not set.
94 89
         if (empty($this->settings['solrcore'])) {
@@ -188,8 +183,7 @@  discard block
 block discarded – undo
188 183
      *
189 184
      * @return string HTML output of facets menu
190 185
      */
191
-    protected function addFacetsMenu()
192
-    {
186
+    protected function addFacetsMenu() {
193 187
         // Quit without doing anything if no facets are configured.
194 188
         if (empty($this->settings['facets']) && empty($this->settings['facetCollections'])) {
195 189
             return '';
@@ -214,8 +208,7 @@  discard block
 block discarded – undo
214 208
      *
215 209
      * @return array HMENU array
216 210
      */
217
-    public function makeFacetsMenuArray($facets)
218
-    {
211
+    public function makeFacetsMenuArray($facets) {
219 212
         $menuArray = [];
220 213
         // Set default value for facet search.
221 214
         $search = [
@@ -271,8 +264,7 @@  discard block
 block discarded – undo
271 264
                 // check for virtual collections query string
272 265
                 if($collectionEntry->getIndexSearch()) {
273 266
                     $virtualCollectionsQueryString .= empty($virtualCollectionsQueryString) ? '(' . $collectionEntry->getIndexSearch() . ')' : ' OR ('. $collectionEntry->getIndexSearch() . ')' ;
274
-                }
275
-                else {
267
+                } else {
276 268
                     $collectionsQueryString .= empty($collectionsQueryString) ? '"' . $collectionEntry->getIndexName() . '"' : ' OR "' . $collectionEntry->getIndexName() . '"';
277 269
                 }
278 270
             }
@@ -421,8 +413,7 @@  discard block
 block discarded – undo
421 413
      *
422 414
      * @return array The array for the facet's menu entry
423 415
      */
424
-    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state)
425
-    {
416
+    protected function getFacetsMenuEntry($field, $value, $count, $search, &$state) {
426 417
         $entryArray = [];
427 418
         // Translate value.
428 419
         if ($field == 'owner_faceting') {
@@ -473,8 +464,7 @@  discard block
 block discarded – undo
473 464
      *
474 465
      * @return string The extended search form or an empty string
475 466
      */
476
-    protected function addExtendedSearch()
477
-    {
467
+    protected function addExtendedSearch() {
478 468
         // Quit without doing anything if no fields for extended search are selected.
479 469
         if (
480 470
             empty($this->settings['extendedSlotCount'])
Please login to merge, or discard this patch.
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $this->searchParams = $this->getParametersSafely('searchParameter');
78 78
 
79 79
         // output is done by main action
80
-        $this->forward('main', null, null, ['searchParameter' => $this->searchParams]);
80
+        $this->forward('main', NULL, NULL, ['searchParameter' => $this->searchParams]);
81 81
     }
82 82
 
83 83
     /**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function mainAction()
91 91
     {
92
-        $listViewSearch = false;
92
+        $listViewSearch = FALSE;
93 93
         // Quit without doing anything if required variables are not set.
94 94
         if (empty($this->settings['solrcore'])) {
95 95
             $this->logger->warning('Incomplete plugin configuration');
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
         if (isset($listRequestData['searchParameter']) && is_array($listRequestData['searchParameter'])) {
105 105
             $this->searchParams = array_merge($this->searchParams ? : [], $listRequestData['searchParameter']);
106
-            $listViewSearch = true;
106
+            $listViewSearch = TRUE;
107 107
             $GLOBALS['TSFE']->fe_user->setKey('ses', 'search', $this->searchParams);
108 108
         }
109 109
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         // If a targetPid is given, the results will be shown by ListView on the target page.
130 130
         if (!empty($this->settings['targetPid']) && !empty($this->searchParams) && !$listViewSearch) {
131
-            $this->redirect('main', 'ListView', null,
131
+            $this->redirect('main', 'ListView', NULL,
132 132
                 [
133 133
                     'searchParameter' => $this->searchParams,
134 134
                     'widgetPage' => $widgetPage
@@ -139,16 +139,16 @@  discard block
 block discarded – undo
139 139
         // If no search has been executed, no variables habe to be prepared. An empty form will be shown.
140 140
         if (is_array($this->searchParams) && !empty($this->searchParams)) {
141 141
             // get all sortable metadata records
142
-            $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
142
+            $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
143 143
 
144 144
             // get all metadata records to be shown in results
145
-            $listedMetadata = $this->metadataRepository->findByIsListed(true);
145
+            $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
146 146
 
147 147
             $solrResults = [];
148 148
             $numResults = 0;
149 149
             // Do not execute the Solr search if used together with ListView plugin.
150 150
             if (!$listViewSearch) {
151
-                $solrResults = $this->documentRepository->findSolrByCollection(null, $this->settings, $this->searchParams, $listedMetadata);
151
+                $solrResults = $this->documentRepository->findSolrByCollection(NULL, $this->settings, $this->searchParams, $listedMetadata);
152 152
                 $numResults = $solrResults->getNumFound();
153 153
             }
154 154
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         // Get facets from plugin configuration.
199 199
         $facets = [];
200
-        foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], true) as $facet) {
200
+        foreach (GeneralUtility::trimExplode(',', $this->settings['facets'], TRUE) as $facet) {
201 201
             $facets[$facet . '_faceting'] = Helper::translate($facet, 'tx_dlf_metadata', $this->settings['storagePid']);
202 202
         }
203 203
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
         // if collections are given, we prepare the collection query string
259 259
         // extract collections from collection parameter
260
-        $collection = null;
260
+        $collection = NULL;
261 261
         if ($this->searchParams['collection']) {
262 262
             foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
263 263
                 $collection[] = $this->collectionRepository->findByUid($collectionEntry);
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         // Check if facet is already selected.
446 446
         $queryColumn = array_column($search['params']['filterquery'], 'query');
447 447
         $index = array_search($field . ':("' . Solr::escapeQuery($value) . '")', $queryColumn);
448
-        if ($index !== false) {
448
+        if ($index !== FALSE) {
449 449
             // Facet is selected, thus remove it from filter.
450 450
             unset($queryColumn[$index]);
451 451
             $queryColumn = array_values($queryColumn);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
             $state = 'ACTIFSUB';
454 454
             // Reset facets
455 455
             if ($this->settings['resetFacets']) {
456
-                $entryArray['resetFacet'] = true;
456
+                $entryArray['resetFacet'] = TRUE;
457 457
                 $entryArray['queryColumn'] = $queryColumn;
458 458
             }
459 459
         } else {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         }
485 485
 
486 486
         // Get field selector options.
487
-        $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], true);
487
+        $searchFields = GeneralUtility::trimExplode(',', $this->settings['extendedFields'], TRUE);
488 488
 
489 489
         $slotCountArray = [];
490 490
         for ($i = 0; $i < $this->settings['extendedSlotCount']; $i++) {
Please login to merge, or discard this patch.
Classes/Controller/ListViewController.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
         // extract collection(s) from collection parameter
76 76
         $collection = null;
77 77
         if ($this->searchParams['collection']) {
78
-            foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
78
+            foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
79 79
                 $collection[] = $this->collectionRepository->findByUid($collectionEntry);
80 80
             }
81 81
         }
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @subpackage dlf
30 30
  * @access public
31 31
  */
32
-class ListViewController extends AbstractController
33
-{
32
+class ListViewController extends AbstractController {
34 33
     /**
35 34
      * @var CollectionRepository
36 35
      */
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
     /**
40 39
      * @param CollectionRepository $collectionRepository
41 40
      */
42
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
43
-    {
41
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
44 42
         $this->collectionRepository = $collectionRepository;
45 43
     }
46 44
 
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
     /**
53 51
      * @param MetadataRepository $metadataRepository
54 52
      */
55
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
56
-    {
53
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
57 54
         $this->metadataRepository = $metadataRepository;
58 55
     }
59 56
 
@@ -68,8 +65,7 @@  discard block
 block discarded – undo
68 65
      *
69 66
      * @return void
70 67
      */
71
-    public function mainAction()
72
-    {
68
+    public function mainAction() {
73 69
         $this->searchParams = $this->getParametersSafely('searchParameter');
74 70
 
75 71
         // extract collection(s) from collection parameter
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $this->searchParams = $this->getParametersSafely('searchParameter');
74 74
 
75 75
         // extract collection(s) from collection parameter
76
-        $collection = null;
76
+        $collection = NULL;
77 77
         if ($this->searchParams['collection']) {
78 78
             foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
79 79
                 $collection[] = $this->collectionRepository->findByUid($collectionEntry);
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
         $GLOBALS['TSFE']->fe_user->setKey('ses', 'widgetPage', $widgetPage);
88 88
 
89 89
         // get all sortable metadata records
90
-        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
90
+        $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
91 91
 
92 92
         // get all metadata records to be shown in results
93
-        $listedMetadata = $this->metadataRepository->findByIsListed(true);
93
+        $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
94 94
 
95 95
         $solrResults = [];
96 96
         $numResults = 0;
97 97
         if (is_array($this->searchParams) && !empty($this->searchParams)) {
98
-            $solrResults = $this->documentRepository->findSolrByCollection($collection ? : null, $this->settings, $this->searchParams, $listedMetadata);
98
+            $solrResults = $this->documentRepository->findSolrByCollection($collection ? : NULL, $this->settings, $this->searchParams, $listedMetadata);
99 99
             $numResults = $solrResults->getNumFound();
100 100
         }
101 101
 
Please login to merge, or discard this patch.