Passed
Pull Request — master (#123)
by
unknown
04:32
created
Classes/Middleware/DOMDocumentValidation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -78,19 +78,19 @@
 block discarded – undo
78 78
         $validation = GeneralUtility::makeInstance(DOMDocumentValidationStack::class, $settings['domDocumentValidationValidators']);
79 79
 
80 80
         if (!GeneralUtility::isValidUrl($urlParam)) {
81
-            $this->logger->debug('Parameter "' . $urlParam . '" is not a valid url.');
81
+            $this->logger->debug('Parameter "'.$urlParam.'" is not a valid url.');
82 82
             throw new InvalidArgumentException('Value of url parameter is not a valid url.', 1724852611);
83 83
         }
84 84
 
85 85
         $content = GeneralUtility::getUrl($urlParam);
86 86
         if ($content === false) {
87
-            $this->logger->debug('Error while loading content of "' . $urlParam . '"');
87
+            $this->logger->debug('Error while loading content of "'.$urlParam.'"');
88 88
             throw new InvalidArgumentException('Error while loading content of url.', 1724420640);
89 89
         }
90 90
 
91 91
         $document = new DOMDocument();
92 92
         if ($document->loadXML($content) === false) {
93
-            $this->logger->debug('Error converting content of "' . $urlParam . '" to xml.');
93
+            $this->logger->debug('Error converting content of "'.$urlParam.'" to xml.');
94 94
             throw new InvalidArgumentException('Error converting content to xml.', 1724420648);
95 95
         }
96 96
 
Please login to merge, or discard this patch.
Tests/Unit/Validation/SaxonXslToSvrlValidatorTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     {
49 49
         parent::setUp();
50 50
         $this->resetSingletonInstances = true;
51
-        $this->dlfExtensionPath = Environment::getExtensionsPath() . 'dlf';
51
+        $this->dlfExtensionPath = Environment::getExtensionsPath().'dlf';
52 52
     }
53 53
 
54 54
     public function testJarFileNotFound(): void
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
         $this->expectException(InvalidArgumentException::class);
64 64
         $this->expectExceptionMessage("XSL Schematron file not found.");
65 65
         // It only checks if a file exists at the specified path, so we can use one of the test files.
66
-        new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
66
+        new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml']);
67 67
     }
68 68
 
69 69
     public function testValidation(): void
70 70
     {
71
-        $saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml', "xsl" => $this->dlfExtensionPath . '/Tests/Fixtures/Format/alto.xml']);
71
+        $saxonXslToSvrlValidator = new SaxonXslToSvrlValidator(["jar" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml', "xsl" => $this->dlfExtensionPath.'/Tests/Fixtures/Format/alto.xml']);
72 72
         $reflection = new ReflectionClass($saxonXslToSvrlValidator);
73 73
 
74 74
         $result = $reflection->getProperty("result");
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
                 if ($doc !== null) {
165 165
                     $this->document->setCurrentDocument($doc);
166 166
                 } else {
167
-                    $this->logger->error('Failed to load document with record ID "' . $this->requestData['recordId'] . '"');
167
+                    $this->logger->error('Failed to load document with record ID "'.$this->requestData['recordId'].'"');
168 168
                 }
169 169
             }
170 170
         } else {
171
-            $this->logger->error('Invalid ID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
171
+            $this->logger->error('Invalid ID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading');
172 172
         }
173 173
     }
174 174
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             && !MathUtility::canBeInterpretedAsInteger($this->requestData['id'])
266 266
             && !GeneralUtility::isValidUrl($this->requestData['id'])
267 267
         ) {
268
-            $this->logger->warning('Invalid ID or URI "' . $this->requestData['id'] . '" for document loading');
268
+            $this->logger->warning('Invalid ID or URI "'.$this->requestData['id'].'" for document loading');
269 269
             unset($this->requestData['id']);
270 270
         }
271 271
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     {
326 326
         if (!array_key_exists($setting, $this->settings) || empty($this->settings[$setting])) {
327 327
             $this->settings[$setting] = $value;
328
-            $this->logger->warning('Setting "' . $setting . '" not set, using default value "' . $value . '". Probably FlexForm for controller "' . get_class($this) . '" is not read.');
328
+            $this->logger->warning('Setting "'.$setting.'" not set, using default value "'.$value.'". Probably FlexForm for controller "'.get_class($this).'" is not read.');
329 329
         } else {
330 330
             $this->settings[$setting] = (int) $this->settings[$setting];
331 331
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         $pages = [];
411 411
         $pagesSect = [];
412 412
         $aRange = [];
413
-        $nRange = 5;    // ToDo: should be made configurable
413
+        $nRange = 5; // ToDo: should be made configurable
414 414
 
415 415
         // lower limit of the range
416 416
         $nBottom = $currentPageNumber - $nRange;
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
         // check whether the first screen page is > 1, if yes then points must be added
427 427
         if ($aRange[0] > 1) {
428
-            array_push($pagesSect, ['label' => '...','startRecordNumber' => '...']);
428
+            array_push($pagesSect, ['label' => '...', 'startRecordNumber' => '...']);
429 429
         };
430 430
         $lastStartRecordNumberGrid = 0; // due to validity outside the loop
431 431
         foreach (range($firstPage, $lastPage) as $i) {
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
                 // Check if screen page is in range
470 470
                 if (in_array($i, $aRange)) {
471
-                    array_push($pagesSect, ['label' => $i,'startRecordNumber' => $startRecordNumber]);
471
+                    array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $startRecordNumber]);
472 472
                 };
473 473
             };
474 474
         };
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
             // fix for count(): Argument #1 ($value) must be of type Countable|array, null given
535 535
             $this->documentArray[] = $doc;
536 536
         } else {
537
-            $this->logger->error('Invalid UID "' . $documentId . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
537
+            $this->logger->error('Invalid UID "'.$documentId.'" or PID "'.$this->settings['storagePid'].'" for document loading');
538 538
         }
539 539
 
540 540
         return $doc;
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             foreach ($this->requestData['multipleSource'] as $location) {
573 573
                 $document = AbstractDocument::getInstance($location, $this->settings, true);
574 574
                 if ($document !== null) {
575
-                    $this->documentArray['extra_' . $i] = $document;
575
+                    $this->documentArray['extra_'.$i] = $document;
576 576
                 }
577 577
                 $i++;
578 578
             }
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 
597 597
             $this->document->setLocation($documentId);
598 598
         } else {
599
-            $this->logger->error('Invalid location given "' . $documentId . '" for document loading');
599
+            $this->logger->error('Invalid location given "'.$documentId.'" for document loading');
600 600
         }
601 601
 
602 602
         return $doc;
Please login to merge, or discard this patch.
Classes/Hooks/DataHandler.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
                     ) {
126 126
                         // Get current configuration.
127 127
                         $result = $queryBuilder
128
-                            ->select($table . '.is_listed AS is_listed')
128
+                            ->select($table.'.is_listed AS is_listed')
129 129
                             ->from($table)
130 130
                             ->where(
131
-                                $queryBuilder->expr()->eq($table . '.uid', (int) $id),
131
+                                $queryBuilder->expr()->eq($table.'.uid', (int) $id),
132 132
                                 Helper::whereExpression($table)
133 133
                             )
134 134
                             ->setMaxResults(1)
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
                     ) {
152 152
                         // Get current configuration.
153 153
                         $result = $queryBuilder
154
-                            ->select($table . '.index_autocomplete AS index_autocomplete')
154
+                            ->select($table.'.index_autocomplete AS index_autocomplete')
155 155
                             ->from($table)
156 156
                             ->where(
157
-                                $queryBuilder->expr()->eq($table . '.uid', (int) $id),
157
+                                $queryBuilder->expr()->eq($table.'.uid', (int) $id),
158 158
                                 Helper::whereExpression($table)
159 159
                             )
160 160
                             ->setMaxResults(1)
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
         if ($solr->ready) {
325 325
             // Delete Solr document.
326 326
             $updateQuery = $solr->service->createUpdate();
327
-            $updateQuery->addDeleteQuery('uid:' . (int) $id);
327
+            $updateQuery->addDeleteQuery('uid:'.(int) $id);
328 328
             $updateQuery->addCommit(false);
329 329
             $solr->service->update($updateQuery);
330 330
         }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             $document->setCurrentDocument($doc);
349 349
             Indexer::add($document, $documentRepository);
350 350
         } else {
351
-            $this->logger->error('Failed to re-index document with UID ' . (string) $id);
351
+            $this->logger->error('Failed to re-index document with UID '.(string) $id);
352 352
         }
353 353
     }
354 354
 
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                     try {
400 400
                         $response = $solr->service->coreAdmin($query);
401 401
                         if ($response->getWasSuccessful() == false) {
402
-                            $this->logger->warning('Core ' . $resArray['core'] . ' could not be deleted from Apache Solr');
402
+                            $this->logger->warning('Core '.$resArray['core'].' could not be deleted from Apache Solr');
403 403
                         }
404 404
                     } catch (\Exception $e) {
405 405
                         $this->logger->warning($e->getMessage());
Please login to merge, or discard this patch.
Classes/Validation/AbstractDlfValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     public function validate($value): Result
48 48
     {
49 49
         if (!$value instanceof $this->valueClassName) {
50
-            $this->logger->debug('Value must be an instance of ' . $this->valueClassName . '.');
50
+            $this->logger->debug('Value must be an instance of '.$this->valueClassName.'.');
51 51
             throw new InvalidArgumentException('Type of value is not valid.', 1723126505626);
52 52
         }
53 53
         return parent::validate($value);
Please login to merge, or discard this patch.
Classes/Controller/ListViewController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         // extract collection(s) from collection parameter
84 84
         $collections = [];
85 85
         if (is_array($this->searchParams) && array_key_exists('collection', $this->searchParams)) {
86
-            foreach(explode(',', $this->searchParams['collection']) as $collectionEntry) {
86
+            foreach (explode(',', $this->searchParams['collection']) as $collectionEntry) {
87 87
                 if (!empty($collectionEntry)) {
88 88
                     $collections[] = $this->collectionRepository->findByUid((int) $collectionEntry);
89 89
                 }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             $simplePagination = new SimplePagination($solrPaginator);
117 117
 
118 118
             $pagination = $this->buildSimplePagination($simplePagination, $solrPaginator);
119
-            $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $solrPaginator ]);
119
+            $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $solrPaginator]);
120 120
         }
121 121
 
122 122
         $this->view->assign('viewData', $this->viewData);
Please login to merge, or discard this patch.
Classes/Controller/PageGridController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $pageGridPagination = new PageGridPagination($pageGridPaginator);
67 67
 
68 68
         $pagination = $this->buildSimplePagination($pageGridPagination, $pageGridPaginator);
69
-        $this->view->assignMultiple([ 'pagination' => $pagination, 'paginator' => $pageGridPaginator ]);
69
+        $this->view->assignMultiple(['pagination' => $pagination, 'paginator' => $pageGridPaginator]);
70 70
 
71 71
         $this->view->assign('docUid', $this->requestData['id']);
72 72
 
Please login to merge, or discard this patch.
Classes/Controller/MetadataController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
         }
132 132
 
133 133
         if (empty(array_filter($metadata))) {
134
-            $this->logger->warning('No metadata found for document with UID ' . $this->document->getUid());
134
+            $this->logger->warning('No metadata found for document with UID '.$this->document->getUid());
135 135
             return $this->htmlResponse();
136 136
         }
137 137
         ksort($metadata);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                     $this->parseMetadata($i, $name, $value, $metadata);
185 185
 
186 186
                     if (is_array($metadata[$i][$name])) {
187
-                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function ($metadataValue) {
187
+                        $metadata[$i][$name] = array_values(array_filter($metadata[$i][$name], function($metadataValue) {
188 188
                             return !empty($metadataValue);
189 189
                         }));
190 190
                     }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
         if (empty(implode('', $value)) && $this->settings['getTitle'] && $this->document->getPartof()) {
402 402
             $superiorTitle = AbstractDocument::getTitle($this->document->getPartof(), true);
403 403
             if (!empty($superiorTitle)) {
404
-                $metadata[$i]['title'] = ['[' . $superiorTitle . ']'];
404
+                $metadata[$i]['title'] = ['['.$superiorTitle.']'];
405 405
             }
406 406
         }
407 407
     }
Please login to merge, or discard this patch.
Classes/Controller/PageViewController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -183,18 +183,18 @@  discard block
 block discarded – undo
183 183
             }
184 184
 
185 185
             $navigationArray[$i]['next'] = [
186
-                'tx_dlf[docPage][' . $i . ']' =>
186
+                'tx_dlf[docPage]['.$i.']' =>
187 187
                     MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1)
188 188
             ];
189 189
             $navigationArray[$i]['prev'] = [
190
-                'tx_dlf[docPage][' . $i . ']' =>
190
+                'tx_dlf[docPage]['.$i.']' =>
191 191
                     MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1)
192 192
             ];
193 193
 
194 194
             $navigateAllPageNext = array_merge(
195 195
                 $navigateAllPageNext,
196 196
                 [
197
-                    'tx_dlf[docPage][' . $i . ']' =>
197
+                    'tx_dlf[docPage]['.$i.']' =>
198 198
                         MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1)
199 199
                 ]
200 200
             );
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $navigateAllPagePrev = array_merge(
203 203
                 $navigateAllPagePrev,
204 204
                 [
205
-                    'tx_dlf[docPage][' . $i . ']' =>
205
+                    'tx_dlf[docPage]['.$i.']' =>
206 206
                         MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1)
207 207
                 ]
208 208
             );
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $navigateAllMeasureNext = array_merge(
211 211
                 $navigateAllMeasureNext,
212 212
                 [
213
-                    'tx_dlf[docMeasure][' . $i . ']' =>
213
+                    'tx_dlf[docMeasure]['.$i.']' =>
214 214
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1)
215 215
                 ]
216 216
             );
@@ -218,19 +218,19 @@  discard block
 block discarded – undo
218 218
             $navigateAllMeasurePrev = array_merge(
219 219
                 $navigateAllMeasurePrev,
220 220
                 [
221
-                    'tx_dlf[docMeasure][' . $i . ']' =>
221
+                    'tx_dlf[docMeasure]['.$i.']' =>
222 222
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1)
223 223
                 ]
224 224
             );
225 225
 
226 226
             if ($document->numMeasures > 0) {
227 227
                 $navigationMeasureArray[$i]['next'] = [
228
-                    'tx_dlf[docMeasure][' . $i . ']' =>
228
+                    'tx_dlf[docMeasure]['.$i.']' =>
229 229
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1)
230 230
                 ];
231 231
 
232 232
                 $navigationMeasureArray[$i]['prev'] = [
233
-                    'tx_dlf[docMeasure][' . $i . ']' =>
233
+                    'tx_dlf[docMeasure]['.$i.']' =>
234 234
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1)
235 235
                 ];
236 236
             }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
             }
285 285
             $params = array_merge(
286 286
                 ['tx_dlf' => $this->requestData],
287
-                ['tx_dlf[multipleSource][' . $nextMultipleSourceKey . ']' => $formAddDocument->getLocation()],
287
+                ['tx_dlf[multipleSource]['.$nextMultipleSourceKey.']' => $formAddDocument->getLocation()],
288 288
                 ['tx_dlf[multiview]' => 1]
289 289
             );
290 290
             $uriBuilder = $this->uriBuilder;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
                             // build link for each measure
333 333
                             $params = [
334 334
                                 'tx_dlf' => $this->requestData,
335
-                                'tx_dlf[docMeasure][' . $docNumber . ']' => $i
335
+                                'tx_dlf[docMeasure]['.$docNumber.']' => $i
336 336
                             ];
337 337
                         } else {
338 338
                             // build link for each measure
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         }
417 417
 
418 418
         if (empty($score)) {
419
-            $this->logger->notice('No score file found for page "' . $page . '" in fileGrps "' . ($this->settings['fileGrpScore'] ?? '') . '"');
419
+            $this->logger->notice('No score file found for page "'.$page.'" in fileGrps "'.($this->settings['fileGrpScore'] ?? '').'"');
420 420
         }
421 421
         return $score;
422 422
     }
@@ -447,11 +447,11 @@  discard block
 block discarded – undo
447 447
                 $fulltext['mimetype'] = $file['mimeType'];
448 448
                 break;
449 449
             } else {
450
-                $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"');
450
+                $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"');
451 451
             }
452 452
         }
453 453
         if (empty($fulltext)) {
454
-            $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"');
454
+            $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"');
455 455
         }
456 456
         return $fulltext;
457 457
     }
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                         'measureIdLinks' => $docMeasures['measureLinks']
512 512
                     ];
513 513
 
514
-                    $jsViewer .= 'tx_dlf_viewer[' . $i . '] = new dlfViewer(' . json_encode($viewer) . ');
514
+                    $jsViewer .= 'tx_dlf_viewer['.$i.'] = new dlfViewer('.json_encode($viewer).');
515 515
                             ';
516 516
                     $i++;
517 517
                 }
@@ -520,8 +520,8 @@  discard block
 block discarded – undo
520 520
             // Viewer configuration.
521 521
             $viewerConfiguration = '$(document).ready(function() {
522 522
                     if (dlfUtils.exists(dlfViewer)) {
523
-                        ' . $jsViewer . '
524
-                        viewerCount = ' . ($i - 1) . ';
523
+                        ' . $jsViewer.'
524
+                        viewerCount = ' . ($i - 1).';
525 525
                     }
526 526
                 });';
527 527
         } else {
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
             // Viewer configuration.
552 552
             $viewerConfiguration = '$(document).ready(function() {
553 553
                     if (dlfUtils.exists(dlfViewer)) {
554
-                        tx_dlf_viewer = new dlfViewer(' . json_encode($viewer) . ');
554
+                        tx_dlf_viewer = new dlfViewer(' . json_encode($viewer).');
555 555
                     }
556 556
                 });';
557 557
         }
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
                     }
648 648
                     break;
649 649
                 } else {
650
-                    $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"');
650
+                    $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"');
651 651
                 }
652 652
 
653 653
             } else {
@@ -667,12 +667,12 @@  discard block
 block discarded – undo
667 667
                     }
668 668
                     break;
669 669
                 } else {
670
-                    $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"');
670
+                    $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"');
671 671
                 }
672 672
             }
673 673
         }
674 674
         if (empty($image)) {
675
-            $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"');
675
+            $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"');
676 676
         }
677 677
         return $image;
678 678
     }
Please login to merge, or discard this patch.