Passed
Pull Request — master (#123)
by Sebastian
03:12
created
Build/Documentation/dbdocs/generate.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,16 +11,16 @@
 block discarded – undo
11 11
  * LICENSE.txt file that was distributed with this source code.
12 12
  */
13 13
 
14
-$classLoader = require_once __DIR__ . '/../../../vendor/autoload.php';
14
+$classLoader = require_once __DIR__.'/../../../vendor/autoload.php';
15 15
 
16 16
 $outputPath = $argv[1] ?? null;
17 17
 if (empty($outputPath) || !is_writable(($outputPath))) {
18
-    echo 'Error: Output path not specified or not writable' . "\n";
18
+    echo 'Error: Output path not specified or not writable'."\n";
19 19
     exit(1);
20 20
 }
21 21
 
22
-putenv('TYPO3_PATH_ROOT=' . __DIR__ . '/public');
23
-putenv('TYPO3_PATH_APP=' . __DIR__);
22
+putenv('TYPO3_PATH_ROOT='.__DIR__.'/public');
23
+putenv('TYPO3_PATH_APP='.__DIR__);
24 24
 
25 25
 // For compatibility with TYPO v9
26 26
 define('PATH_thisScript', __FILE__);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 $classLoader = require_once __DIR__ . '/../../../vendor/autoload.php';
15 15
 
16
-$outputPath = $argv[1] ?? null;
16
+$outputPath = $argv[1] ?? NULL;
17 17
 if (empty($outputPath) || !is_writable(($outputPath))) {
18 18
     echo 'Error: Output path not specified or not writable' . "\n";
19 19
     exit(1);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 // For request types other than "FE", the configuration manager would try to access the database.
29 29
 \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_FE);
30
-\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, false);
30
+\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, FALSE);
31 31
 
32 32
 $generator = new \Kitodo\DbDocs\Generator();
33 33
 $tables = $generator->collectTables();
Please login to merge, or discard this patch.
Classes/ViewHelpers/MetadataWrapVariableViewHelper.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,13 +35,11 @@
 block discarded – undo
35 35
  *     {typoscript -> kitodo:metadataWrapVariable(name: 'wrapInfo')}
36 36
  *
37 37
  */
38
-class MetadataWrapVariableViewHelper extends AbstractViewHelper
39
-{
38
+class MetadataWrapVariableViewHelper extends AbstractViewHelper {
40 39
     /**
41 40
      * @return void
42 41
      */
43
-    public function initializeArguments()
44
-    {
42
+    public function initializeArguments() {
45 43
         $this->registerArgument('name', 'string', 'Name of variable to create', true);
46 44
     }
47 45
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function initializeArguments()
44 44
     {
45
-        $this->registerArgument('name', 'string', 'Name of variable to create', true);
45
+        $this->registerArgument('name', 'string', 'Name of variable to create', TRUE);
46 46
     }
47 47
 
48 48
     /**
Please login to merge, or discard this patch.
Classes/Controller/FeedsController.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         if ($library) {
72 72
             $feedMeta['copyright'] = $library->getLabel();
73 73
         } else {
74
-            $this->logger->error('Failed to fetch label of selected library with "' . $this->settings['library'] . '"');
74
+            $this->logger->error('Failed to fetch label of selected library with "'.$this->settings['library'].'"');
75 75
         }
76 76
 
77 77
         if (
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
                 ) {
92 92
                     $superiorTitle = Doc::getTitle($document->getPartof(), true);
93 93
                     if (!empty($superiorTitle)) {
94
-                        $title .= '[' . $superiorTitle . ']';
94
+                        $title .= '['.$superiorTitle.']';
95 95
                     }
96 96
                 }
97 97
                 // Get title of document.
98 98
                 if (!empty($document->getTitle())) {
99
-                    $title .= ' ' . $document->getTitle();
99
+                    $title .= ' '.$document->getTitle();
100 100
                 }
101 101
                 // Set default title if empty.
102 102
                 if (empty($title)) {
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
                 }
105 105
                 // Append volume information.
106 106
                 if (!empty($document->getVolume())) {
107
-                    $title .= ', ' . LocalizationUtility::translate('volume', 'dlf') . ' ' . $document->getVolume();
107
+                    $title .= ', '.LocalizationUtility::translate('volume', 'dlf').' '.$document->getVolume();
108 108
                 }
109 109
                 // Is this document new or updated?
110 110
                 if ($document->getCrdate() == $document->getTstamp()) {
111
-                    $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf') . ' ' . trim($title);
111
+                    $title = LocalizationUtility::translate('plugins.feeds.new', 'dlf').' '.trim($title);
112 112
                 } else {
113
-                    $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf') . ' ' . trim($title);
113
+                    $title = LocalizationUtility::translate('plugins.feeds.update', 'dlf').' '.trim($title);
114 114
                 }
115 115
 
116 116
                 $document->setTitle($title);
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 FeedsController extends AbstractController
29
-{
28
+class FeedsController extends AbstractController {
30 29
 
31 30
     /**
32 31
      * @var LibraryRepository
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
     /**
37 36
      * @param LibraryRepository $libraryRepository
38 37
      */
39
-    public function injectLibraryRepository(LibraryRepository $libraryRepository)
40
-    {
38
+    public function injectLibraryRepository(LibraryRepository $libraryRepository) {
41 39
         $this->libraryRepository = $libraryRepository;
42 40
     }
43 41
 
@@ -46,8 +44,7 @@  discard block
 block discarded – undo
46 44
      *
47 45
      * @return void
48 46
      */
49
-    public function initializeAction()
50
-    {
47
+    public function initializeAction() {
51 48
         $this->request->setFormat('xml');
52 49
     }
53 50
 
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
      *
57 54
      * @return void
58 55
      */
59
-    public function mainAction()
60
-    {
56
+    public function mainAction() {
61 57
         // access to GET parameter tx_dlf_feeds['collection']
62 58
         $requestData = $this->request->getArguments();
63 59
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             || GeneralUtility::inList($this->settings['collections'], $requestData['collection'])
81 81
         ) {
82 82
 
83
-            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], true), $this->settings['limit']);
83
+            $documents = $this->documentRepository->findAllByCollectionsLimited(GeneralUtility::intExplode(',', $requestData['collection'], TRUE), $this->settings['limit']);
84 84
 
85 85
             foreach ($documents as $document) {
86 86
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                 if ((empty($document->getTitle()) || !empty($this->settings['prependSuperiorTitle']))
90 90
                     && !empty($document->getPartof())
91 91
                 ) {
92
-                    $superiorTitle = Doc::getTitle($document->getPartof(), true);
92
+                    $superiorTitle = Doc::getTitle($document->getPartof(), TRUE);
93 93
                     if (!empty($superiorTitle)) {
94 94
                         $title .= '[' . $superiorTitle . ']';
95 95
                     }
Please login to merge, or discard this patch.
Classes/Controller/OaiPmhController.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -243,10 +243,10 @@  discard block
 block discarded – undo
243 243
             if ($root->item(0) instanceof \DOMNode) {
244 244
                 $mets = $xml->saveXML($root->item(0));
245 245
             } else {
246
-                $this->logger->error('No METS part found in document with location "' . $record['location'] . '"');
246
+                $this->logger->error('No METS part found in document with location "'.$record['location'].'"');
247 247
             }
248 248
         } else {
249
-            $this->logger->error('Could not load XML file from "' . $record['location'] . '"');
249
+            $this->logger->error('Could not load XML file from "'.$record['location'].'"');
250 250
         }
251 251
         return $mets;
252 252
     }
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
             $pageSettings = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
413 413
             $storagePid = $pageSettings["plugin."]["tx_dlf."]["persistence."]["storagePid"];
414 414
             if ($storagePid > 0) {
415
-                $this->logger->notice('No records found with PID ' . $storagePid);
415
+                $this->logger->notice('No records found with PID '.$storagePid);
416 416
             } else {
417 417
                 $this->logger->notice('No records found');
418 418
             }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
             if (!empty($resArray)) {
496 496
                 // check, if all required fields are available for a given identifier
497 497
                 foreach ($details['requiredFields'] as $required) {
498
-                    $methodName = 'get' . GeneralUtility::underscoredToUpperCamelCase($required);
498
+                    $methodName = 'get'.GeneralUtility::underscoredToUpperCamelCase($required);
499 499
                     if (empty($resArray->$methodName())) {
500 500
                         // Skip metadata formats whose requirements are not met.
501 501
                         continue 2;
@@ -600,9 +600,9 @@  discard block
 block discarded – undo
600 600
 
601 601
             if ($resArray = $result->fetch()) {
602 602
                 if ($resArray['index_query'] != "") {
603
-                    $solr_query .= '(' . $resArray['index_query'] . ')';
603
+                    $solr_query .= '('.$resArray['index_query'].')';
604 604
                 } else {
605
-                    $solr_query .= 'collection:' . '"' . $resArray['index_name'] . '"';
605
+                    $solr_query .= 'collection:'.'"'.$resArray['index_name'].'"';
606 606
                 }
607 607
             } else {
608 608
                 $this->error = 'noSetHierarchy';
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
         }
615 615
         // Check for required fields.
616 616
         foreach ($this->formats[$this->parameters['metadataPrefix']]['requiredFields'] as $required) {
617
-            $solr_query .= ' NOT ' . $required . ':""';
617
+            $solr_query .= ' NOT '.$required.':""';
618 618
         }
619 619
         // toplevel="true" is always required
620 620
         $solr_query .= ' AND toplevel:true';
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
             ) {
629 629
                 $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'],
630 630
                     $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900);
631
-                $from = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.000Z';
631
+                $from = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.000Z';
632 632
             } else {
633 633
                 $this->error = 'badArgument';
634 634
                 return;
@@ -644,7 +644,7 @@  discard block
 block discarded – undo
644 644
             ) {
645 645
                 $timestamp = gmmktime($date_array['tm_hour'], $date_array['tm_min'], $date_array['tm_sec'],
646 646
                     $date_array['tm_mon'] + 1, $date_array['tm_mday'], $date_array['tm_year'] + 1900);
647
-                $until = date("Y-m-d", $timestamp) . 'T' . date("H:i:s", $timestamp) . '.999Z';
647
+                $until = date("Y-m-d", $timestamp).'T'.date("H:i:s", $timestamp).'.999Z';
648 648
                 if ($from != "*" && $from > $until) {
649 649
                     $this->error = 'badArgument';
650 650
                 }
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
                 $this->error = 'badArgument';
662 662
             }
663 663
         }
664
-        $solr_query .= ' AND timestamp:[' . $from . ' TO ' . $until . ']';
664
+        $solr_query .= ' AND timestamp:['.$from.' TO '.$until.']';
665 665
         $documentSet = [];
666 666
         $solr = Solr::getInstance($this->settings['solrcore']);
667 667
         if (!$solr->ready) {
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
         $resumptionTokenInfo['cursor'] = $currentCursor;
781 781
         $resumptionTokenInfo['completeListSize'] = $documentListSet['metadata']['completeListSize'];
782 782
         $expireDateTime = new \DateTime();
783
-        $expireDateTime->add(new \DateInterval('PT' . $this->settings['expired'] . 'S'));
783
+        $expireDateTime->add(new \DateInterval('PT'.$this->settings['expired'].'S'));
784 784
         $resumptionTokenInfo['expired'] = $expireDateTime;
785 785
 
786 786
         $omitResumptionToken = $currentCursor === 0 && $numShownDocuments >= $documentListSet['metadata']['completeListSize'];
Please login to merge, or discard this patch.
Braces   +19 added lines, -38 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
  * @subpackage dlf
28 28
  * @access public
29 29
  */
30
-class OaiPmhController extends AbstractController
31
-{
30
+class OaiPmhController extends AbstractController {
32 31
     /**
33 32
      * @var TokenRepository
34 33
      */
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
     /**
38 37
      * @param TokenRepository $tokenRepository
39 38
      */
40
-    public function injectTokenRepository(TokenRepository $tokenRepository)
41
-    {
39
+    public function injectTokenRepository(TokenRepository $tokenRepository) {
42 40
         $this->tokenRepository = $tokenRepository;
43 41
     }
44 42
 
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
     /**
51 49
      * @param CollectionRepository $collectionRepository
52 50
      */
53
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
54
-    {
51
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
55 52
         $this->collectionRepository = $collectionRepository;
56 53
     }
57 54
 
@@ -63,8 +60,7 @@  discard block
 block discarded – undo
63 60
     /**
64 61
      * @param LibraryRepository $libraryRepository
65 62
      */
66
-    public function injectLibraryRepository(LibraryRepository $libraryRepository)
67
-    {
63
+    public function injectLibraryRepository(LibraryRepository $libraryRepository) {
68 64
         $this->libraryRepository = $libraryRepository;
69 65
     }
70 66
 
@@ -73,8 +69,7 @@  discard block
 block discarded – undo
73 69
      *
74 70
      * @return void
75 71
      */
76
-    public function initializeAction()
77
-    {
72
+    public function initializeAction() {
78 73
         $this->request->setFormat('xml');
79 74
     }
80 75
 
@@ -122,8 +117,7 @@  discard block
 block discarded – undo
122 117
      *
123 118
      * @return void
124 119
      */
125
-    protected function deleteExpiredTokens()
126
-    {
120
+    protected function deleteExpiredTokens() {
127 121
         // Delete expired resumption tokens.
128 122
         $this->tokenRepository->deleteExpiredTokens($this->settings['expired']);
129 123
     }
@@ -135,8 +129,7 @@  discard block
 block discarded – undo
135 129
      *
136 130
      * @return void
137 131
      */
138
-    protected function getUrlParams()
139
-    {
132
+    protected function getUrlParams() {
140 133
         $allowedParams = [
141 134
             'verb',
142 135
             'identifier',
@@ -166,8 +159,7 @@  discard block
 block discarded – undo
166 159
      *
167 160
      * @return array $metadata: The mapped metadata array
168 161
      */
169
-    protected function getDcData(array $record)
170
-    {
162
+    protected function getDcData(array $record) {
171 163
         $metadata = [];
172 164
 
173 165
         $metadata[] = ['dc:identifier' => $record['record_id']];
@@ -232,8 +224,7 @@  discard block
 block discarded – undo
232 224
      *
233 225
      * @return string: The fetched METS XML
234 226
      */
235
-    protected function getMetsData(array $record)
236
-    {
227
+    protected function getMetsData(array $record) {
237 228
         $mets = null;
238 229
         // Load METS file.
239 230
         $xml = new \DOMDocument();
@@ -256,8 +247,7 @@  discard block
 block discarded – undo
256 247
      *
257 248
      * @return void
258 249
      */
259
-    public function mainAction()
260
-    {
250
+    public function mainAction() {
261 251
         // Get allowed GET and POST variables.
262 252
         $this->getUrlParams();
263 253
 
@@ -324,8 +314,7 @@  discard block
 block discarded – undo
324 314
      *
325 315
      * @return void
326 316
      */
327
-    protected function verbGetRecord()
328
-    {
317
+    protected function verbGetRecord() {
329 318
         if (count($this->parameters) !== 3 || empty($this->parameters['metadataPrefix']) || empty($this->parameters['identifier'])) {
330 319
             $this->error = 'badArgument';
331 320
             return;
@@ -377,8 +366,7 @@  discard block
 block discarded – undo
377 366
      *
378 367
      * @return void
379 368
      */
380
-    protected function verbIdentify()
381
-    {
369
+    protected function verbIdentify() {
382 370
         $library = $this->libraryRepository->findByUid($this->settings['library']);
383 371
 
384 372
         $oaiIdentifyInfo = [];
@@ -427,8 +415,7 @@  discard block
 block discarded – undo
427 415
      *
428 416
      * @return void
429 417
      */
430
-    protected function verbListIdentifiers()
431
-    {
418
+    protected function verbListIdentifiers() {
432 419
         // If we have a resumption token we can continue our work
433 420
         if (!empty($this->parameters['resumptionToken'])) {
434 421
             // "resumptionToken" is an exclusive argument.
@@ -482,8 +469,7 @@  discard block
 block discarded – undo
482 469
      *
483 470
      * @return void
484 471
      */
485
-    protected function verbListMetadataFormats()
486
-    {
472
+    protected function verbListMetadataFormats() {
487 473
         $resArray = [];
488 474
         // check for the optional "identifier" parameter
489 475
         if (isset($this->parameters['identifier'])) {
@@ -515,8 +501,7 @@  discard block
 block discarded – undo
515 501
      *
516 502
      * @return void
517 503
      */
518
-    protected function verbListRecords()
519
-    {
504
+    protected function verbListRecords() {
520 505
         // Check for invalid arguments.
521 506
         if (!empty($this->parameters['resumptionToken'])) {
522 507
             // "resumptionToken" is an exclusive argument.
@@ -571,8 +556,7 @@  discard block
 block discarded – undo
571 556
      *
572 557
      * @return void
573 558
      */
574
-    protected function verbListSets()
575
-    {
559
+    protected function verbListSets() {
576 560
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
577 561
         $this->settings['hideEmptyOaiNames'] = true;
578 562
 
@@ -588,8 +572,7 @@  discard block
 block discarded – undo
588 572
      *
589 573
      * @return array|null Array of matching records
590 574
      */
591
-    protected function fetchDocumentUIDs()
592
-    {
575
+    protected function fetchDocumentUIDs() {
593 576
         $solr_query = '';
594 577
         // Check "set" for valid value.
595 578
         if (!empty($this->parameters['set'])) {
@@ -698,8 +681,7 @@  discard block
 block discarded – undo
698 681
      *
699 682
      * @return array of enriched records
700 683
      */
701
-    protected function generateOutputForDocumentList(array $documentListSet)
702
-    {
684
+    protected function generateOutputForDocumentList(array $documentListSet) {
703 685
         $documentsToProcess = array_splice($documentListSet['elements'], 0, (int) $this->settings['limit']);
704 686
         if (empty($documentsToProcess)) {
705 687
             $this->error = 'noRecordsMatch';
@@ -752,8 +734,7 @@  discard block
 block discarded – undo
752 734
      *
753 735
      * @return void
754 736
      */
755
-    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments)
756
-    {
737
+    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) {
757 738
         // The cursor specifies how many elements have already been returned in previous requests
758 739
         // See http://www.openarchives.org/OAI/openarchivesprotocol.html#FlowControl
759 740
         $currentCursor = $documentListSet['metadata']['cursor'];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     protected function getMetsData(array $record)
236 236
     {
237
-        $mets = null;
237
+        $mets = NULL;
238 238
         // Load METS file.
239 239
         $xml = new \DOMDocument();
240 240
         if ($xml->load($record['location'])) {
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         } else {
314 314
             // No resumption token found or resumption token expired.
315 315
             $this->error = 'badResumptionToken';
316
-            return null;
316
+            return NULL;
317 317
         }
318 318
     }
319 319
 
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
     protected function verbListSets()
575 575
     {
576 576
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
577
-        $this->settings['hideEmptyOaiNames'] = true;
577
+        $this->settings['hideEmptyOaiNames'] = TRUE;
578 578
 
579 579
         $oaiSets = $this->collectionRepository->findCollectionsBySettings($this->settings);
580 580
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
                 }
607 607
             } else {
608 608
                 $this->error = 'noSetHierarchy';
609
-                return null;
609
+                return NULL;
610 610
             }
611 611
         } else {
612 612
             // If no set is specified we have to query for all collections
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
         $currentCursor = $documentListSet['metadata']['cursor'];
760 760
 
761 761
         if (count($documentListSet['elements']) !== 0) {
762
-            $resumptionToken = uniqid('', false);
762
+            $resumptionToken = uniqid('', FALSE);
763 763
 
764 764
             $documentListSet['metadata']['cursor'] += $numShownDocuments;
765 765
 
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                 if ($this->document) {
126 126
                     $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true);
127 127
                 } else {
128
-                    $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
128
+                    $this->logger->error('Invalid UID "'.$requestData['id'].'" or PID "'.$this->settings['storagePid'].'" for document loading');
129 129
                 }
130 130
             } else if (GeneralUtility::isValidUrl($requestData['id'])) {
131 131
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
                     $this->document->setLocation($requestData['id']);
145 145
                 } else {
146
-                    $this->logger->error('Invalid location given "' . $requestData['id'] . '" for document loading');
146
+                    $this->logger->error('Invalid location given "'.$requestData['id'].'" for document loading');
147 147
                 }
148 148
             }
149 149
 
@@ -160,11 +160,11 @@  discard block
 block discarded – undo
160 160
                 if ($this->document !== null && $doc !== null) {
161 161
                     $this->document->setDoc($doc);
162 162
                 } else {
163
-                    $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"');
163
+                    $this->logger->error('Failed to load document with record ID "'.$requestData['recordId'].'"');
164 164
                 }
165 165
             }
166 166
         } else {
167
-            $this->logger->error('Invalid ID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
167
+            $this->logger->error('Invalid ID "'.$requestData['id'].'" or PID "'.$this->settings['storagePid'].'" for document loading');
168 168
         }
169 169
     }
170 170
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -117,26 +117,26 @@  discard block
 block discarded – undo
117 117
         // Try to get document format from database
118 118
         if (!empty($requestData['id'])) {
119 119
 
120
-            $doc = null;
120
+            $doc = NULL;
121 121
 
122 122
             if (MathUtility::canBeInterpretedAsInteger($requestData['id'])) {
123 123
                 // find document from repository by uid
124 124
                 $this->document = $this->documentRepository->findOneByIdAndSettings((int) $requestData['id']);
125 125
                 if ($this->document) {
126
-                    $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true);
126
+                    $doc = Doc::getInstance($this->document->getLocation(), $this->settings, TRUE);
127 127
                 } else {
128 128
                     $this->logger->error('Invalid UID "' . $requestData['id'] . '" or PID "' . $this->settings['storagePid'] . '" for document loading');
129 129
                 }
130 130
             } else if (GeneralUtility::isValidUrl($requestData['id'])) {
131 131
 
132
-                $doc = Doc::getInstance($requestData['id'], $this->settings, true);
132
+                $doc = Doc::getInstance($requestData['id'], $this->settings, TRUE);
133 133
 
134
-                if ($doc !== null) {
134
+                if ($doc !== NULL) {
135 135
                     if ($doc->recordId) {
136 136
                         $this->document = $this->documentRepository->findOneByRecordId($doc->recordId);
137 137
                     }
138 138
 
139
-                    if ($this->document === null) {
139
+                    if ($this->document === NULL) {
140 140
                         // create new dummy Document object
141 141
                         $this->document = GeneralUtility::makeInstance(Document::class);
142 142
                     }
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                 }
148 148
             }
149 149
 
150
-            if ($this->document !== null && $doc !== null) {
150
+            if ($this->document !== NULL && $doc !== NULL) {
151 151
                 $this->document->setDoc($doc);
152 152
             }
153 153
 
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
 
156 156
             $this->document = $this->documentRepository->findOneByRecordId($requestData['recordId']);
157 157
 
158
-            if ($this->document !== null) {
159
-                $doc = Doc::getInstance($this->document->getLocation(), $this->settings, true);
160
-                if ($this->document !== null && $doc !== null) {
158
+            if ($this->document !== NULL) {
159
+                $doc = Doc::getInstance($this->document->getLocation(), $this->settings, TRUE);
160
+                if ($this->document !== NULL && $doc !== NULL) {
161 161
                     $this->document->setDoc($doc);
162 162
                 } else {
163 163
                     $this->logger->error('Failed to load document with record ID "' . $requestData['recordId'] . '"');
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         if ($this->request->hasArgument($parameterName)) {
192 192
             return $this->request->getArgument($parameterName);
193 193
         }
194
-        return null;
194
+        return NULL;
195 195
     }
196 196
 
197 197
     /**
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
     /**
45 45
      * @param DocumentRepository $documentRepository
46 46
      */
47
-    public function injectDocumentRepository(DocumentRepository $documentRepository)
48
-    {
47
+    public function injectDocumentRepository(DocumentRepository $documentRepository) {
49 48
         $this->documentRepository = $documentRepository;
50 49
     }
51 50
 
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
      * @access protected
86 85
      * @return void
87 86
      */
88
-    protected function initialize()
89
-    {
87
+    protected function initialize() {
90 88
         $this->requestData = GeneralUtility::_GPmerged('tx_dlf');
91 89
         if (empty($this->requestData['page'])) {
92 90
             $this->requestData['page'] = 1;
@@ -112,8 +110,7 @@  discard block
 block discarded – undo
112 110
      *
113 111
      * @return void
114 112
      */
115
-    protected function loadDocument($requestData)
116
-    {
113
+    protected function loadDocument($requestData) {
117 114
         // Try to get document format from database
118 115
         if (!empty($requestData['id'])) {
119 116
 
@@ -186,8 +183,7 @@  discard block
 block discarded – undo
186 183
      *
187 184
      * @return null|string|array
188 185
      */
189
-    protected function getParametersSafely($parameterName)
190
-    {
186
+    protected function getParametersSafely($parameterName) {
191 187
         if ($this->request->hasArgument($parameterName)) {
192 188
             return $this->request->getArgument($parameterName);
193 189
         }
@@ -201,8 +197,7 @@  discard block
 block discarded – undo
201 197
      *
202 198
      * @return void
203 199
      */
204
-    public function __construct()
205
-    {
200
+    public function __construct() {
206 201
         $this->initialize();
207 202
     }
208 203
 }
Please login to merge, or discard this patch.
Classes/Controller/CollectionController.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -96,14 +96,14 @@
 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
-            $params['query'] = $solr_query . ' AND partof:0 AND toplevel:true';
103
+            $params['query'] = $solr_query.' AND partof:0 AND toplevel:true';
104 104
             $partOfNothing = $solr->search_raw($params);
105 105
 
106
-            $params['query'] = $solr_query . ' AND NOT partof:0 AND toplevel:true';
106
+            $params['query'] = $solr_query.' AND NOT partof:0 AND toplevel:true';
107 107
             $partOfSomething = $solr->search_raw($params);
108 108
             // Titles are all documents that are "root" elements i.e. partof == 0
109 109
             $collectionInfo['titles'] = [];
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 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 CollectionController extends AbstractController
33
-{
32
+class CollectionController 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
 
@@ -62,8 +59,7 @@  discard block
 block discarded – undo
62 59
      *
63 60
      * @return void
64 61
      */
65
-    public function listAction()
66
-    {
62
+    public function listAction() {
67 63
         $solr = Solr::getInstance($this->settings['solrcore']);
68 64
 
69 65
         if (!$solr->ready) {
@@ -146,8 +142,7 @@  discard block
 block discarded – undo
146 142
      *
147 143
      * @return void
148 144
      */
149
-    public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection)
150
-    {
145
+    public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection) {
151 146
         $searchParams = $this->getParametersSafely('searchParameter');
152 147
 
153 148
         // Instaniate the Solr. Without Solr present, we can't do anything.
@@ -199,8 +194,7 @@  discard block
 block discarded – undo
199 194
      *
200 195
      * @return void
201 196
      */
202
-    public function showSortedAction()
203
-    {
197
+    public function showSortedAction() {
204 198
         // if search was triggered, get search parameters from POST variables
205 199
         $searchParams = $this->getParametersSafely('searchParameter');
206 200
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
 
89 89
         if (count($collections) == 1 && empty($this->settings['dont_show_single']) && is_array($collections)) {
90
-            $this->forward('show', null, null, ['collection' => array_pop($collections)]);
90
+            $this->forward('show', NULL, NULL, ['collection' => array_pop($collections)]);
91 91
         }
92 92
 
93 93
         $processedCollections = [];
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $searchParams['collection'] = $collection;
167 167
         // If a targetPid is given, the results will be shown by ListView on the target page.
168 168
         if (!empty($this->settings['targetPid'])) {
169
-            $this->redirect('main', 'ListView', null,
169
+            $this->redirect('main', 'ListView', NULL,
170 170
                 [
171 171
                     'searchParameter' => $searchParams,
172 172
                     'widgetPage' => $widgetPage
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         }
176 176
 
177 177
         // get all metadata records to be shown in results
178
-        $listedMetadata = $this->metadataRepository->findByIsListed(true);
178
+        $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
179 179
 
180 180
         // get all sortable metadata records
181
-        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
181
+        $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
182 182
 
183 183
         // get all documents of given collection
184 184
         $solrResults = $this->documentRepository->findSolrByCollection($collection, $this->settings, $searchParams, $listedMetadata);
@@ -204,13 +204,13 @@  discard block
 block discarded – undo
204 204
         // if search was triggered, get search parameters from POST variables
205 205
         $searchParams = $this->getParametersSafely('searchParameter');
206 206
 
207
-        $collection = null;
207
+        $collection = NULL;
208 208
         if ($searchParams['collection']['__identity'] && MathUtility::canBeInterpretedAsInteger($searchParams['collection']['__identity'])) {
209 209
             $collection = $this->collectionRepository->findByUid($searchParams['collection']['__identity']);
210 210
         }
211 211
 
212 212
         // output is done by show action
213
-        $this->forward('show', null, null, ['searchParameter' => $searchParams, 'collection' => $collection]);
213
+        $this->forward('show', NULL, NULL, ['searchParameter' => $searchParams, 'collection' => $collection]);
214 214
 
215 215
     }
216 216
 }
Please login to merge, or discard this patch.
Classes/Controller/AudioPlayerController.php 3 patches
Braces   +3 added lines, -6 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 AudioplayerController extends AbstractController
29
-{
28
+class AudioplayerController extends AbstractController {
30 29
     /**
31 30
      * Holds the current audio file's URL, MIME type and optional label
32 31
      *
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return void
44 43
      */
45
-    protected function addPlayerJS()
46
-    {
44
+    protected function addPlayerJS() {
47 45
         // Inline CSS.
48 46
         $inlineCSS = '#tx-dlf-audio { width: 100px; height: 100px; }';
49 47
 
@@ -72,8 +70,7 @@  discard block
 block discarded – undo
72 70
      *
73 71
      * @return void
74 72
      */
75
-    public function mainAction()
76
-    {
73
+    public function mainAction() {
77 74
         // Load current document.
78 75
         $this->loadDocument($this->requestData);
79 76
         if (
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,8 +77,8 @@
 block discarded – undo
77 77
         // Load current document.
78 78
         $this->loadDocument($this->requestData);
79 79
         if (
80
-            $this->document === null
81
-            || $this->document->getDoc() === null
80
+            $this->document === NULL
81
+            || $this->document->getDoc() === NULL
82 82
             || $this->document->getDoc()->numPages < 1
83 83
         ) {
84 84
             // Quit without doing anything if required variables are not set.
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,12 +52,12 @@
 block discarded – undo
52 52
             $(document).ready(function() {
53 53
                 AudioPlayer = new dlfAudioPlayer({
54 54
                     audio: {
55
-                        mimeType: "' . $this->audio['mimetype'] . '",
56
-                        title: "' . $this->audio['label'] . '",
57
-                        url:  "' . $this->audio['url'] . '"
55
+                        mimeType: "' . $this->audio['mimetype'].'",
56
+                        title: "' . $this->audio['label'].'",
57
+                        url:  "' . $this->audio['url'].'"
58 58
                     },
59 59
                     parentElId: "tx-dlf-audio",
60
-                    swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')) . 'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf"
60
+                    swfPath: "' . PathUtility::stripPathSitePrefix(ExtensionManagementUtility::extPath('dlf')).'Resources/Public/JavaScript/jPlayer/jquery.jplayer.swf"
61 61
                 });
62 62
             });
63 63
         ';
Please login to merge, or discard this patch.
Classes/Controller/ListViewController.php 2 patches
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
         $collection = null;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     {
73 73
         $this->searchParams = $this->getParametersSafely('searchParameter');
74 74
 
75
-        $collection = null;
75
+        $collection = NULL;
76 76
         if ($this->searchParams['collection'] && MathUtility::canBeInterpretedAsInteger($this->searchParams['collection'])) {
77 77
             $collection = $this->collectionRepository->findByUid($this->searchParams['collection']);
78 78
         }
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
         $GLOBALS['TSFE']->fe_user->setKey('ses', 'widgetPage', $widgetPage);
85 85
 
86 86
         // get all sortable metadata records
87
-        $sortableMetadata = $this->metadataRepository->findByIsSortable(true);
87
+        $sortableMetadata = $this->metadataRepository->findByIsSortable(TRUE);
88 88
 
89 89
         // get all metadata records to be shown in results
90
-        $listedMetadata = $this->metadataRepository->findByIsListed(true);
90
+        $listedMetadata = $this->metadataRepository->findByIsListed(TRUE);
91 91
 
92 92
         $solrResults = [];
93 93
         $numResults = 0;
94 94
         if (is_array($this->searchParams) && !empty($this->searchParams)) {
95
-            $solrResults = $this->documentRepository->findSolrByCollection($collection ? : null, $this->settings, $this->searchParams, $listedMetadata);
95
+            $solrResults = $this->documentRepository->findSolrByCollection($collection ? : NULL, $this->settings, $this->searchParams, $listedMetadata);
96 96
             $numResults = $solrResults->getNumFound();
97 97
         }
98 98
 
Please login to merge, or discard this patch.
Classes/Controller/PageGridController.php 2 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,15 +22,13 @@  discard block
 block discarded – undo
22 22
  * @subpackage dlf
23 23
  * @access public
24 24
  */
25
-class PageGridController extends AbstractController
26
-{
25
+class PageGridController extends AbstractController {
27 26
     /**
28 27
      * The main method of the plugin
29 28
      *
30 29
      * @return void
31 30
      */
32
-    public function mainAction()
33
-    {
31
+    public function mainAction() {
34 32
         $this->loadDocument($this->requestData);
35 33
         if (
36 34
             $this->document === null
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      *
66 64
      * @return array The rendered entry ready for fluid
67 65
      */
68
-    protected function getEntry($number, $fileGrpThumbs)
69
-    {
66
+    protected function getEntry($number, $fileGrpThumbs) {
70 67
         // Set pagination.
71 68
         $entry['pagination'] = htmlspecialchars($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[$number]]['orderlabel']);
72 69
         $entry['page'] = $number;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         $this->loadDocument($this->requestData);
35 35
         if (
36
-            $this->document === null
36
+            $this->document === NULL
37 37
             || $this->document->getDoc()->numPages < 1
38 38
             || empty($this->extConf['fileGrpThumbs'])
39 39
         ) {
Please login to merge, or discard this patch.