Passed
Pull Request — master (#123)
by
unknown
11:14
created
Classes/Validation/SaxonXslToSvrlValidator.php 3 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
     protected function process(mixed $value): string
62 62
     {
63 63
         // using source from standard input
64
-        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], null, null, $value->saveXML());
64
+        $process = new Process(['java', '-jar', $this->jar, '-xsl:'.$this->xsl, '-s:-'], null, null, $value->saveXML());
65 65
         $process->run();
66 66
         // executes after the command finish
67 67
         if (!$process->isSuccessful()) {
68
-            $this->logger->error('Processing exits with code "' . $process->getExitCode() . '"');
68
+            $this->logger->error('Processing exits with code "'.$process->getExitCode().'"');
69 69
             throw new InvalidArgumentException('Processing was not successful.', 1724862680);
70 70
         }
71 71
         return $process->getOutput();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
     protected function process(mixed $value): string
62 62
     {
63 63
         // using source from standard input
64
-        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], null, null, $value->saveXML());
64
+        $process = new Process(['java', '-jar', $this->jar, '-xsl:' . $this->xsl, '-s:-'], NULL, NULL, $value->saveXML());
65 65
         $process->run();
66 66
         // executes after the command finish
67 67
         if (!$process->isSuccessful()) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,14 +30,12 @@
 block discarded – undo
30 30
  *
31 31
  * @access public
32 32
  */
33
-class SaxonXslToSvrlValidator extends AbstractDlfValidator implements LoggerAwareInterface
34
-{
33
+class SaxonXslToSvrlValidator extends AbstractDlfValidator implements LoggerAwareInterface {
35 34
     private string $jar;
36 35
 
37 36
     private string $xsl;
38 37
 
39
-    public function __construct(array $configuration)
40
-    {
38
+    public function __construct(array $configuration) {
41 39
         parent::__construct(DOMDocument::class);
42 40
         $this->jar = GeneralUtility::getFileAbsFileName($configuration["jar"] ?? '');
43 41
         $this->xsl = GeneralUtility::getFileAbsFileName($configuration["xsl"] ?? '');
Please login to merge, or discard this patch.
Classes/Middleware/DOMDocumentValidation.php 3 patches
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.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@
 block discarded – undo
33 33
  * @subpackage dlf
34 34
  * @access public
35 35
  */
36
-class DOMDocumentValidation implements MiddlewareInterface
37
-{
36
+class DOMDocumentValidation implements MiddlewareInterface {
38 37
     use LoggerAwareTrait;
39 38
 
40 39
     /**
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,13 +83,13 @@
 block discarded – undo
83 83
         }
84 84
 
85 85
         $content = GeneralUtility::getUrl($urlParam);
86
-        if ($content === false) {
86
+        if ($content === FALSE) {
87 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
-        if ($document->loadXML($content) === false) {
92
+        if ($document->loadXML($content) === FALSE) {
93 93
             $this->logger->debug('Error converting content of "' . $urlParam . '" to xml.');
94 94
             throw new InvalidArgumentException('Error converting content to xml.', 1724420648);
95 95
         }
Please login to merge, or discard this patch.
Tests/Unit/Validation/SaxonXslToSvrlValidatorTest.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
  *
29 29
  * @access public
30 30
  */
31
-class SaxonXslToSvrlValidatorTest extends UnitTestCase
32
-{
31
+class SaxonXslToSvrlValidatorTest extends UnitTestCase {
33 32
     const SVRL = <<<SVRL
34 33
         <svrl:schematron-output
35 34
             xmlns:svrl="http://purl.oclc.org/dsdl/schematron">
Please login to merge, or discard this 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.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     public function setUp(): void
48 48
     {
49 49
         parent::setUp();
50
-        $this->resetSingletonInstances = true;
50
+        $this->resetSingletonInstances = TRUE;
51 51
         $this->dlfExtensionPath = Environment::getExtensionsPath() . 'dlf';
52 52
     }
53 53
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
         $reflection = new ReflectionClass($saxonXslToSvrlValidator);
73 73
 
74 74
         $result = $reflection->getProperty("result");
75
-        $result->setAccessible(true);
75
+        $result->setAccessible(TRUE);
76 76
         $result->setValue($saxonXslToSvrlValidator, new Result());
77 77
 
78 78
         $method = $reflection->getMethod("addErrorsOfSvrl");
79
-        $method->setAccessible(true);
79
+        $method->setAccessible(TRUE);
80 80
         $method->invoke($saxonXslToSvrlValidator, self::SVRL);
81 81
 
82 82
         self::assertTrue($result->getValue($saxonXslToSvrlValidator)->hasErrors());
Please login to merge, or discard this patch.
Tests/Unit/Validation/DOMDocumentValidationStackTest.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@
 block discarded – undo
29 29
  *
30 30
  * @access public
31 31
  */
32
-class DOMDocumentValidationStackTest extends UnitTestCase
33
-{
32
+class DOMDocumentValidationStackTest extends UnitTestCase {
34 33
     public function setUp(): void
35 34
     {
36 35
         parent::setUp();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     public function setUp(): void
35 35
     {
36 36
         parent::setUp();
37
-        $this->resetSingletonInstances = true;
37
+        $this->resetSingletonInstances = TRUE;
38 38
     }
39 39
 
40 40
     public function testValueTypeException(): void
Please login to merge, or discard this patch.
Tests/Unit/Validation/XmlSchemesValidatorTest.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
  *
27 27
  * @access public
28 28
  */
29
-class XmlSchemesValidatorTest extends UnitTestCase
30
-{
29
+class XmlSchemesValidatorTest extends UnitTestCase {
31 30
     const METS = <<<METS
32 31
         <mets:mets
33 32
             xmlns:mets="http://www.loc.gov/METS/"
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
     public function setUp(): void
71 71
     {
72 72
         parent::setUp();
73
-        $this->resetSingletonInstances = true;
73
+        $this->resetSingletonInstances = TRUE;
74 74
     }
75 75
 
76 76
     public function testValidation(): void
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 3 patches
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.
Braces   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,8 +39,7 @@  discard block
 block discarded – undo
39 39
  *
40 40
  * @abstract
41 41
  */
42
-abstract class AbstractController extends ActionController implements LoggerAwareInterface
43
-{
42
+abstract class AbstractController extends ActionController implements LoggerAwareInterface {
44 43
     use LoggerAwareTrait;
45 44
 
46 45
     /**
@@ -248,8 +247,7 @@  discard block
 block discarded – undo
248 247
      *
249 248
      * @return null|string|array
250 249
      */
251
-    protected function getParametersSafely(string $parameterName)
252
-    {
250
+    protected function getParametersSafely(string $parameterName) {
253 251
         if ($this->request->hasArgument($parameterName)) {
254 252
             return $this->request->getArgument($parameterName);
255 253
         }
@@ -444,7 +442,8 @@  discard block
 block discarded – undo
444 442
         $lastStartRecordNumberGrid = 0; // due to validity outside the loop
445 443
         foreach (range($firstPage, $lastPage) as $i) {
446 444
             // detect which pagination is active: ListView or GridView
447
-            if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') {  // ListView
445
+            if (get_class($pagination) == 'TYPO3\CMS\Core\Pagination\SimplePagination') {
446
+// ListView
448 447
                 $lastStartRecordNumberGrid = $i; // save last $startRecordNumber for LastPage button
449 448
 
450 449
                 $pages[$i] = [
@@ -457,7 +456,8 @@  discard block
 block discarded – undo
457 456
                 if (in_array($i, $aRange)) {
458 457
                     array_push($pagesSect, ['label' => $i, 'startRecordNumber' => $i]);
459 458
                 };
460
-            } else { // GridView
459
+            } else {
460
+// GridView
461 461
                 // to calculate the values for generation the links for the pagination pages
462 462
                 /** @var \Kitodo\Dlf\Pagination\PageGridPaginator $paginator */
463 463
                 $itemsPerPage = $paginator->getPublicItemsPerPage();
@@ -537,8 +537,7 @@  discard block
 block discarded – undo
537 537
      *
538 538
      * @return AbstractDocument
539 539
      */
540
-    private function getDocumentByUid(int $documentId)
541
-    {
540
+    private function getDocumentByUid(int $documentId) {
542 541
         // TODO: implement multiView as it is in getDocumentByUrl
543 542
         $doc = null;
544 543
         $this->document = $this->documentRepository->findOneByIdAndSettings($documentId);
@@ -563,8 +562,7 @@  discard block
 block discarded – undo
563 562
      *
564 563
      * @return AbstractDocument
565 564
      */
566
-    protected function getDocumentByUrl(string $documentId)
567
-    {
565
+    protected function getDocumentByUrl(string $documentId) {
568 566
         $doc = AbstractDocument::getInstance($documentId, $this->settings, true);
569 567
 
570 568
         if (isset($this->settings['multiViewType']) && $doc->tableOfContents[0]['type'] === $this->settings['multiViewType']) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @access protected
66 66
      * @var Document|null This holds the current document
67 67
      */
68
-    protected ?Document $document = null;
68
+    protected ?Document $document = NULL;
69 69
 
70 70
     /**
71 71
      * @access protected
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         // Try to get document format from database
150 150
         if (!empty($documentId)) {
151 151
 
152
-            $doc = null;
152
+            $doc = NULL;
153 153
 
154 154
             if (MathUtility::canBeInterpretedAsInteger($documentId)) {
155 155
                 $doc = $this->getDocumentByUid($documentId);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 $doc = $this->getDocumentByUrl($documentId);
158 158
             }
159 159
 
160
-            if ($this->document !== null && $doc !== null) {
160
+            if ($this->document !== NULL && $doc !== NULL) {
161 161
                 $this->document->setCurrentDocument($doc);
162 162
             }
163 163
 
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
 
166 166
             $this->document = $this->documentRepository->findOneByRecordId($this->requestData['recordId']);
167 167
 
168
-            if ($this->document !== null) {
169
-                $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true);
170
-                if ($doc !== null) {
168
+            if ($this->document !== NULL) {
169
+                $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, TRUE);
170
+                if ($doc !== NULL) {
171 171
                     $this->document->setCurrentDocument($doc);
172 172
                 } else {
173 173
                     $this->logger->error('Failed to load document with record ID "' . $this->requestData['recordId'] . '"');
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
      */
225 225
     protected function isDocMissing(): bool
226 226
     {
227
-        return $this->document === null || $this->document->getCurrentDocument() === null;
227
+        return $this->document === NULL || $this->document->getCurrentDocument() === NULL;
228 228
     }
229 229
 
230 230
     /**
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         if ($this->request->hasArgument($parameterName)) {
254 254
             return $this->request->getArgument($parameterName);
255 255
         }
256
-        return null;
256
+        return NULL;
257 257
     }
258 258
 
259 259
     /**
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
             if (isset($this->settings['multiViewType']) && $this->document->getCurrentDocument()->tableOfContents[0]['type'] === $this->settings['multiViewType']) {
382 382
                 $i = 0;
383 383
                 foreach ($this->documentArray as $document) {
384
-                    if ($document !== null) {
384
+                    if ($document !== NULL) {
385 385
                         $this->requestData['docPage'][$i] = MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i], 1, $document->numPages, 1);
386 386
                         $i++;
387 387
                     }
@@ -496,8 +496,8 @@  discard block
 block discarded – undo
496 496
         };
497 497
 
498 498
         // Safely get the next and previous page numbers
499
-        $nextPageNumber = isset($pages[$currentPageNumber + 1]) ? $pages[$currentPageNumber + 1]['startRecordNumber'] : null;
500
-        $previousPageNumber = isset($pages[$currentPageNumber - 1]) ? $pages[$currentPageNumber - 1]['startRecordNumber'] : null;
499
+        $nextPageNumber = isset($pages[$currentPageNumber + 1]) ? $pages[$currentPageNumber + 1]['startRecordNumber'] : NULL;
500
+        $previousPageNumber = isset($pages[$currentPageNumber - 1]) ? $pages[$currentPageNumber - 1]['startRecordNumber'] : NULL;
501 501
 
502 502
         // 'startRecordNumber' is not required in GridView, only the variant for each loop is required
503 503
         // 'endRecordNumber' is not required in both views
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
     private function getDocumentByUid(int $documentId)
544 544
     {
545 545
         // TODO: implement multiView as it is in getDocumentByUrl
546
-        $doc = null;
546
+        $doc = NULL;
547 547
         $this->document = $this->documentRepository->findOneByIdAndSettings($documentId);
548 548
 
549 549
         if ($this->document) {
550
-            $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, true);
550
+            $doc = AbstractDocument::getInstance($this->document->getLocation(), $this->settings, TRUE);
551 551
             // fix for count(): Argument #1 ($value) must be of type Countable|array, null given
552 552
             $this->documentArray[] = $doc;
553 553
         } else {
@@ -568,13 +568,13 @@  discard block
 block discarded – undo
568 568
      */
569 569
     protected function getDocumentByUrl(string $documentId)
570 570
     {
571
-        $doc = AbstractDocument::getInstance($documentId, $this->settings, true);
571
+        $doc = AbstractDocument::getInstance($documentId, $this->settings, TRUE);
572 572
 
573 573
         if (isset($this->settings['multiViewType']) && $doc->tableOfContents[0]['type'] === $this->settings['multiViewType']) {
574 574
             $childDocuments = $doc->tableOfContents[0]['children'];
575 575
             $i = 0;
576 576
             foreach ($childDocuments as $document) {
577
-                $this->documentArray[] = AbstractDocument::getInstance($document['points'], $this->settings, true);
577
+                $this->documentArray[] = AbstractDocument::getInstance($document['points'], $this->settings, TRUE);
578 578
                 if (!isset($this->requestData['docPage'][$i]) && isset(explode('#', $document['points'])[1])) {
579 579
                     $initPage = explode('#', $document['points'])[1];
580 580
                     $this->requestData['docPage'][$i] = $initPage;
@@ -587,21 +587,21 @@  discard block
 block discarded – undo
587 587
         if (isset($this->requestData['multipleSource']) && is_array($this->requestData['multipleSource'])) {
588 588
             $i = 0;
589 589
             foreach ($this->requestData['multipleSource'] as $location) {
590
-                $document = AbstractDocument::getInstance($location, $this->settings, true);
591
-                if ($document !== null) {
590
+                $document = AbstractDocument::getInstance($location, $this->settings, TRUE);
591
+                if ($document !== NULL) {
592 592
                     $this->documentArray['extra_' . $i] = $document;
593 593
                 }
594 594
                 $i++;
595 595
             }
596 596
         }
597 597
 
598
-        if ($doc !== null) {
598
+        if ($doc !== NULL) {
599 599
             $this->document = GeneralUtility::makeInstance(Document::class);
600 600
 
601 601
             if ($doc->recordId) {
602 602
                 // find document from repository by recordId
603 603
                 $docFromRepository = $this->documentRepository->findOneByRecordId($doc->recordId);
604
-                if ($docFromRepository !== null) {
604
+                if ($docFromRepository !== NULL) {
605 605
                     $this->document = $docFromRepository;
606 606
                 }
607 607
             }
Please login to merge, or discard this patch.
Classes/Validation/AbstractDlfValidator.php 2 patches
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.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  *
30 30
  * @access public
31 31
  */
32
-abstract class AbstractDlfValidator extends AbstractValidator
33
-{
32
+abstract class AbstractDlfValidator extends AbstractValidator {
34 33
     use LoggerAwareTrait;
35 34
 
36 35
     protected string $valueClassName;
@@ -38,8 +37,7 @@  discard block
 block discarded – undo
38 37
     /**
39 38
      * @param $valueClassName string The class name of the value
40 39
      */
41
-    public function __construct(string $valueClassName)
42
-    {
40
+    public function __construct(string $valueClassName) {
43 41
         $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class);
44 42
         $this->valueClassName = $valueClassName;
45 43
     }
Please login to merge, or discard this patch.
Classes/Controller/AnnotationController.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@
 block discarded – undo
22 22
  * @subpackage dlf
23 23
  * @access public
24 24
  */
25
-class AnnotationController extends AbstractController
26
-{
25
+class AnnotationController extends AbstractController {
27 26
     /**
28 27
      * The main method of the plugin
29 28
      *
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
         $this->loadDocument();
35 35
 
36 36
         if (
37
-            $this->document === null
38
-            || $this->document->getCurrentDocument() === null
37
+            $this->document === NULL
38
+            || $this->document->getCurrentDocument() === NULL
39 39
         ) {
40 40
             // Quit without doing anything if required variables are not set.
41 41
         } else {
Please login to merge, or discard this patch.
Classes/Controller/PageViewController.php 3 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@  discard block
 block discarded – undo
31 31
  *
32 32
  * @access public
33 33
  */
34
-class PageViewController extends AbstractController
35
-{
34
+class PageViewController extends AbstractController {
36 35
     /**
37 36
      * @access protected
38 37
      * @var array Holds the controls to add to the map
@@ -258,8 +257,7 @@  discard block
 block discarded – undo
258 257
      * @param $page
259 258
      * @return false|int|mixed|string|null
260 259
      */
261
-    public function convertMeasureOrPage($document, $measure = null, $page = null)
262
-    {
260
+    public function convertMeasureOrPage($document, $measure = null, $page = null) {
263 261
         $return = null;
264 262
         $measure2Page = array_column($document->musicalStructure, 'page');
265 263
         if ($measure) {
@@ -370,8 +368,7 @@  discard block
 block discarded – undo
370 368
      *
371 369
      * @return array URL and MIME type of fulltext file
372 370
      */
373
-    protected function getScore(int $page, MetsDocument $specificDoc = null)
374
-    {
371
+    protected function getScore(int $page, MetsDocument $specificDoc = null) {
375 372
         $score = [];
376 373
         $loc = '';
377 374
         if ($specificDoc) {
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
             }
185 185
 
186 186
             $navigationArray[$i]['next'] = [
187
-                'tx_dlf[docPage][' . $i . ']' =>
187
+                'tx_dlf[docPage]['.$i.']' =>
188 188
                     MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1)
189 189
             ];
190 190
             $navigationArray[$i]['prev'] = [
191
-                'tx_dlf[docPage][' . $i . ']' =>
191
+                'tx_dlf[docPage]['.$i.']' =>
192 192
                     MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1)
193 193
             ];
194 194
 
195 195
             $navigateAllPageNext = array_merge(
196 196
                 $navigateAllPageNext,
197 197
                 [
198
-                    'tx_dlf[docPage][' . $i . ']' =>
198
+                    'tx_dlf[docPage]['.$i.']' =>
199 199
                         MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] + 1, 1, $document->numPages, 1)
200 200
                 ]
201 201
             );
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             $navigateAllPagePrev = array_merge(
204 204
                 $navigateAllPagePrev,
205 205
                 [
206
-                    'tx_dlf[docPage][' . $i . ']' =>
206
+                    'tx_dlf[docPage]['.$i.']' =>
207 207
                         MathUtility::forceIntegerInRange((int) $this->requestData['docPage'][$i] - 1, 1, $document->numPages, 1)
208 208
                 ]
209 209
             );
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $navigateAllMeasureNext = array_merge(
212 212
                 $navigateAllMeasureNext,
213 213
                 [
214
-                    'tx_dlf[docMeasure][' . $i . ']' =>
214
+                    'tx_dlf[docMeasure]['.$i.']' =>
215 215
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1)
216 216
                 ]
217 217
             );
@@ -219,19 +219,19 @@  discard block
 block discarded – undo
219 219
             $navigateAllMeasurePrev = array_merge(
220 220
                 $navigateAllMeasurePrev,
221 221
                 [
222
-                    'tx_dlf[docMeasure][' . $i . ']' =>
222
+                    'tx_dlf[docMeasure]['.$i.']' =>
223 223
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1)
224 224
                 ]
225 225
             );
226 226
 
227 227
             if ($document->numMeasures > 0) {
228 228
                 $navigationMeasureArray[$i]['next'] = [
229
-                    'tx_dlf[docMeasure][' . $i . ']' =>
229
+                    'tx_dlf[docMeasure]['.$i.']' =>
230 230
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] + 1, 1, $document->numMeasures, 1)
231 231
                 ];
232 232
 
233 233
                 $navigationMeasureArray[$i]['prev'] = [
234
-                    'tx_dlf[docMeasure][' . $i . ']' =>
234
+                    'tx_dlf[docMeasure]['.$i.']' =>
235 235
                         MathUtility::forceIntegerInRange((int) $this->requestData['docMeasure'][$i] - 1, 1, $document->numMeasures, 1)
236 236
                 ];
237 237
             }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             }
286 286
             $params = array_merge(
287 287
                 ['tx_dlf' => $this->requestData],
288
-                ['tx_dlf[multipleSource][' . $nextMultipleSourceKey . ']' => $formAddDocument->getLocation()],
288
+                ['tx_dlf[multipleSource]['.$nextMultipleSourceKey.']' => $formAddDocument->getLocation()],
289 289
                 ['tx_dlf[multiview]' => 1]
290 290
             );
291 291
             $uriBuilder = $this->uriBuilder;
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                             // build link for each measure
334 334
                             $params = [
335 335
                                 'tx_dlf' => $this->requestData,
336
-                                'tx_dlf[docMeasure][' . $docNumber . ']' => $i
336
+                                'tx_dlf[docMeasure]['.$docNumber.']' => $i
337 337
                             ];
338 338
                         } else {
339 339
                             // build link for each measure
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
         }
418 418
 
419 419
         if (empty($score)) {
420
-            $this->logger->notice('No score file found for page "' . $page . '" in fileGrps "' . ($this->extConf['files']['fileGrpScore'] ?? '') . '"');
420
+            $this->logger->notice('No score file found for page "'.$page.'" in fileGrps "'.($this->extConf['files']['fileGrpScore'] ?? '').'"');
421 421
         }
422 422
         return $score;
423 423
     }
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
                 $fulltext['mimetype'] = $file['mimeType'];
449 449
                 break;
450 450
             } else {
451
-                $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrp "' . $fileGrpFulltext . '"');
451
+                $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrp "'.$fileGrpFulltext.'"');
452 452
             }
453 453
         }
454 454
         if (empty($fulltext)) {
455
-            $this->logger->notice('No full-text file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpFulltext'] . '"');
455
+            $this->logger->notice('No full-text file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpFulltext'].'"');
456 456
         }
457 457
         return $fulltext;
458 458
     }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
                         'measureIdLinks' => $docMeasures['measureLinks']
513 513
                     ];
514 514
 
515
-                    $jsViewer .= 'tx_dlf_viewer[' . $i . '] = new dlfViewer(' . json_encode($viewer) . ');
515
+                    $jsViewer .= 'tx_dlf_viewer['.$i.'] = new dlfViewer('.json_encode($viewer).');
516 516
                             ';
517 517
                     $i++;
518 518
                 }
@@ -521,8 +521,8 @@  discard block
 block discarded – undo
521 521
             // Viewer configuration.
522 522
             $viewerConfiguration = '$(document).ready(function() {
523 523
                     if (dlfUtils.exists(dlfViewer)) {
524
-                        ' . $jsViewer . '
525
-                        viewerCount = ' . ($i - 1) . ';
524
+                        ' . $jsViewer.'
525
+                        viewerCount = ' . ($i - 1).';
526 526
                     }
527 527
                 });';
528 528
         } else {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             // Viewer configuration.
553 553
             $viewerConfiguration = '$(document).ready(function() {
554 554
                     if (dlfUtils.exists(dlfViewer)) {
555
-                        tx_dlf_viewer = new dlfViewer(' . json_encode($viewer) . ');
555
+                        tx_dlf_viewer = new dlfViewer(' . json_encode($viewer).');
556 556
                     }
557 557
                 });';
558 558
         }
@@ -645,12 +645,12 @@  discard block
 block discarded – undo
645 645
                 }
646 646
                 break;
647 647
             } else {
648
-                $this->logger->notice('No image file found for page "' . $page . '" in fileGrp "' . $fileGrpImages . '"');
648
+                $this->logger->notice('No image file found for page "'.$page.'" in fileGrp "'.$fileGrpImages.'"');
649 649
             }
650 650
         }
651 651
 
652 652
         if (empty($image)) {
653
-            $this->logger->warning('No image file found for page "' . $page . '" in fileGrps "' . $this->extConf['files']['fileGrpImages'] . '"');
653
+            $this->logger->warning('No image file found for page "'.$page.'" in fileGrps "'.$this->extConf['files']['fileGrpImages'].'"');
654 654
         }
655 655
 
656 656
         return $image;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
 
147 147
         $this->view->assign('docCount', is_array($this->documentArray) ? count($this->documentArray) : 0);
148 148
         $this->view->assign('docArray', $this->documentArray);
149
-        $this->view->assign('docPage', $this->requestData['docPage'] ?? null);
149
+        $this->view->assign('docPage', $this->requestData['docPage'] ?? NULL);
150 150
         $this->view->assign('docType', $this->document->getCurrentDocument()->tableOfContents[0]['type']);
151 151
 
152
-        $this->view->assign('multiview', $this->requestData['multiview'] ?? null);
153
-        if ($this->requestData['multiview'] ?? false) {
152
+        $this->view->assign('multiview', $this->requestData['multiview'] ?? NULL);
153
+        if ($this->requestData['multiview'] ?? FALSE) {
154 154
             $this->multipageNavigation();
155 155
         }
156 156
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             // convert either page or measure if requestData exists
180 180
             if ($this->requestData['docPage'][$i] && empty($this->requestData['docMeasure'][$i])) {
181 181
                 // convert document page information to measure count information
182
-                $this->requestData['docMeasure'][$i] = $this->convertMeasureOrPage($document, null, $this->requestData['docPage'][$i]);
182
+                $this->requestData['docMeasure'][$i] = $this->convertMeasureOrPage($document, NULL, $this->requestData['docPage'][$i]);
183 183
 
184 184
             } elseif ((empty($this->requestData['docPage'][$i]) || $this->requestData['docPage'][$i] === 1) && $this->requestData['docMeasure'][$i]) {
185 185
                 $this->requestData['docPage'][$i] = $this->convertMeasureOrPage($document, $this->requestData['docMeasure'][$i]);
@@ -261,9 +261,9 @@  discard block
 block discarded – undo
261 261
      * @param $page
262 262
      * @return false|int|mixed|string|null
263 263
      */
264
-    public function convertMeasureOrPage($document, $measure = null, $page = null)
264
+    public function convertMeasureOrPage($document, $measure = NULL, $page = NULL)
265 265
     {
266
-        $return = null;
266
+        $return = NULL;
267 267
         $measure2Page = array_column($document->musicalStructure, 'page');
268 268
         if ($measure) {
269 269
             $return = $measure2Page[$measure];
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
      * @param int|null $docNumber
310 310
      * @return array
311 311
      */
312
-    protected function getMeasures(int $page, MetsDocument $specificDoc = null, $docNumber = null): array
312
+    protected function getMeasures(int $page, MetsDocument $specificDoc = NULL, $docNumber = NULL): array
313 313
     {
314 314
         if ($specificDoc) {
315 315
             $doc = $specificDoc;
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
      *
374 374
      * @return array URL and MIME type of fulltext file
375 375
      */
376
-    protected function getScore(int $page, MetsDocument $specificDoc = null)
376
+    protected function getScore(int $page, MetsDocument $specificDoc = NULL)
377 377
     {
378 378
         $score = [];
379 379
         $loc = '';
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                     // Configure @action URL for form.
404 404
                     $uri = $this->uriBuilder->reset()
405 405
                         ->setTargetPageUid($this->pageUid)
406
-                        ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? true : false)
406
+                        ->setCreateAbsoluteUri(!empty($this->settings['forceAbsoluteUrl']) ? TRUE : FALSE)
407 407
                         ->setArguments(
408 408
                             [
409 409
                                 'eID' => 'tx_dlf_pageview_proxy',
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
             $jsViewer = 'tx_dlf_viewer = [];';
473 473
             $i = 0;
474 474
             foreach ($this->documentArray as $document) {
475
-                if ($document !== null) {
475
+                if ($document !== NULL) {
476 476
                     $docPage = $this->requestData['docPage'][$i];
477 477
                     $docImage = [];
478 478
                     $docFulltext = [];
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                             $docPage = $measure2Page[$this->requestData['docMeasure'][$i]];
487 487
                         }
488 488
                     }
489
-                    if ($docPage == null) {
489
+                    if ($docPage == NULL) {
490 490
                         $docPage = 1;
491 491
                     }
492 492
                     $docImage[0] = $this->getImage($docPage, $document);
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
             $docPage = $this->requestData['page'] ?? 0;
533 533
 
534 534
             $docMeasures = $this->getMeasures($docPage);
535
-            if ($this->requestData['measure'] ?? false) {
535
+            if ($this->requestData['measure'] ?? FALSE) {
536 536
                 $currentMeasureId = $docMeasures['measureCounterToMeasureId'][$this->requestData['measure']];
537 537
             }
538 538
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
             if ($iiif instanceof ManifestInterface) {
578 578
                 $canvas = $iiif->getContainedResourceById($canvasId);
579 579
                 /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */
580
-                if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
580
+                if ($canvas != NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
581 581
                     $annotationContainers = [];
582 582
                     /*
583 583
                      *  TODO Analyzing the annotations on the server side requires loading the annotation lists / pages
@@ -587,11 +587,11 @@  discard block
 block discarded – undo
587 587
                      *  On the other hand, server connections are potentially better than client connections. Downloading annotation lists
588 588
                      */
589 589
                     foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
590
-                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
590
+                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
591 591
                             foreach ($textAnnotations as $annotation) {
592 592
                                 if (
593 593
                                     $annotation->getBody()->getFormat() == 'text/plain'
594
-                                    && $annotation->getBody()->getChars() != null
594
+                                    && $annotation->getBody()->getChars() != NULL
595 595
                                 ) {
596 596
                                     $annotationListData = [];
597 597
                                     $annotationListData['uri'] = $annotationContainer->getId();
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
      *
628 628
      * @return array URL and MIME type of image file
629 629
      */
630
-    protected function getImage(int $page, MetsDocument $specificDoc = null): array
630
+    protected function getImage(int $page, MetsDocument $specificDoc = NULL): array
631 631
     {
632 632
         $image = [];
633 633
         // Get @USE value of METS fileGrp.
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         }
678 678
 
679 679
         // Get the files for the specified file group
680
-        $files = $physicalStructureInfo['files'] ?? null;
680
+        $files = $physicalStructureInfo['files'] ?? NULL;
681 681
         if ($files && !empty($files[$fileGrpImages])) {
682 682
             // Get the file info for the specified file group
683 683
             if ($specificDoc) {
@@ -687,6 +687,6 @@  discard block
 block discarded – undo
687 687
             }
688 688
         }
689 689
 
690
-        return null;
690
+        return NULL;
691 691
     }
692 692
 }
Please login to merge, or discard this patch.