Completed
Push — master ( aedf9a...cd6bf0 )
by Erik
35s queued 10s
created
Classes/Plugin/ListView.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
             if ((!empty($this->piVars['order']) && $this->piVars['order'] != $listMetadata['options']['order'])
448 448
                 || (isset($this->piVars['asc']) && $this->piVars['asc'] != $listMetadata['options']['order.asc'])) {
449 449
                 // Update list's metadata.
450
-                $listMetadata['options']['params']['sort'] = [$this->piVars['order']."_sorting" => (boolean) $this->piVars['asc']?'asc':'desc'];
450
+                $listMetadata['options']['params']['sort'] = [$this->piVars['order']."_sorting" => (boolean) $this->piVars['asc'] ? 'asc' : 'desc'];
451 451
                 $listMetadata['options']['order'] = $this->piVars['order'];
452 452
                 $listMetadata['options']['order.asc'] = (boolean) $this->piVars['asc'];
453 453
                 // Reset pointer.
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                     return $content;
466 466
                 }
467 467
                 // Set search parameters.
468
-                $solr->cPid =  $listMetadata['options']['pid'];
468
+                $solr->cPid = $listMetadata['options']['pid'];
469 469
                 $solr->params = $listMetadata['options']['params'];
470 470
                 // Perform search.
471 471
                 $this->list = $solr->search();
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
             $markerArray['###LISTTHUMBNAIL###'] = '';
506 506
         }
507 507
         if ($currentEntry) {
508
-            $currentEntry =  ($this->piVars['pointer'] * $this->conf['limit']) + 1;
508
+            $currentEntry = ($this->piVars['pointer'] * $this->conf['limit']) + 1;
509 509
             $lastEntry = ($this->piVars['pointer'] * $this->conf['limit']) + $this->conf['limit'];
510 510
             $markerArray['###COUNT###'] = htmlspecialchars(sprintf($this->pi_getLL('count'), $currentEntry, $lastEntry < $this->list->metadata['options']['numberOfToplevelHits'] ? $lastEntry : $this->list->metadata['options']['numberOfToplevelHits'], $this->list->metadata['options']['numberOfToplevelHits']));
511 511
         } else {
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@
 block discarded – undo
131 131
         $fileMimeType = $this->getFileMimeType($id);
132 132
         $fileLocation = $this->getFileLocation($id);
133 133
         if ($fileMimeType == "application/vnd.kitodo.iiif") {
134
-            $fileLocation = strrpos($fileLocation, "info.json") == strlen($fileLocation) - 9 ? $fileLocation :
135
-            strrpos($fileLocation, "/") == strlen($fileLocation) ? $fileLocation."info.json" : $fileLocation."/info.json";
134
+            $fileLocation = strrpos($fileLocation, "info.json") == strlen($fileLocation) - 9 ? $fileLocation : strrpos($fileLocation, "/") == strlen($fileLocation) ? $fileLocation."info.json" : $fileLocation."/info.json";
136 135
             $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
137 136
             IiifHelper::setUrlReader(IiifUrlReader::getInstance());
138 137
             IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
Please login to merge, or discard this patch.
Classes/Plugin/Tools/AnnotationTool.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         // Load template file.
66 66
         $this->getTemplate();
67 67
         $annotationContainers = $this->doc->physicalStructureInfo[$this->doc->physicalStructure[$this->piVars['page']]]['annotationContainers'];
68
-        if ($annotationContainers != null && sizeof($annotationContainers)>0) {
68
+        if ($annotationContainers != null && sizeof($annotationContainers) > 0) {
69 69
             $markerArray['###ANNOTATION_SELECT###'] = '<a class="select switchoff" id="tx-dlf-tools-annotations" title="" data-dic="annotations-on:'
70 70
                 .$this->pi_getLL('annotations-on', '', TRUE).';annotations-off:'
71 71
                     .$this->pi_getLL('annotations-off', '', TRUE).'">&nbsp;</a>';
Please login to merge, or discard this patch.
ext_localconf.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,19 +14,19 @@  discard block
 block discarded – undo
14 14
 }
15 15
 // Define constants.
16 16
 if (!defined('DEVLOG_SEVERITY_OK')) {
17
-    define ('DEVLOG_SEVERITY_OK', -1);
17
+    define('DEVLOG_SEVERITY_OK', -1);
18 18
 }
19 19
 if (!defined('DEVLOG_SEVERITY_INFO')) {
20
-    define ('DEVLOG_SEVERITY_INFO', 0);
20
+    define('DEVLOG_SEVERITY_INFO', 0);
21 21
 }
22 22
 if (!defined('DEVLOG_SEVERITY_NOTICE')) {
23
-    define ('DEVLOG_SEVERITY_NOTICE', 1);
23
+    define('DEVLOG_SEVERITY_NOTICE', 1);
24 24
 }
25 25
 if (!defined('DEVLOG_SEVERITY_WARNING')) {
26
-    define ('DEVLOG_SEVERITY_WARNING', 2);
26
+    define('DEVLOG_SEVERITY_WARNING', 2);
27 27
 }
28 28
 if (!defined('DEVLOG_SEVERITY_ERROR')) {
29
-    define ('DEVLOG_SEVERITY_ERROR', 3);
29
+    define('DEVLOG_SEVERITY_ERROR', 3);
30 30
 }
31 31
 // Register plugins.
32 32
 \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\AudioPlayer::class, '_audioplayer', 'list_type', TRUE);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Common/MetsDocument.php']['hookClass'][] = \Kitodo\Dlf\Hooks\KitodoProductionHacks::class;
63 63
 // Register command line scripts.
64 64
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][$_EXTKEY] = [
65
-    function () {
65
+    function() {
66 66
         $SOBE = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\Kitodo\Dlf\Cli\CommandLineIndexer::class);
67 67
         $SOBE->main();
68 68
     },
Please login to merge, or discard this patch.
Classes/Plugin/Metadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
                 $iiifwrap['value.']['required'] = 1;
166 166
                 $iiifwrap['value.']['wrap'] = '<dd>|</dd>';
167 167
             }
168
-            $iiifLink=[];
168
+            $iiifLink = [];
169 169
             $iiifLink['key.']['wrap'] = '<dt>|</dt>';
170 170
             $iiifLink['value.']['required'] = 1;
171 171
             $iiifLink['value.']['setContentToCurrent'] = 1;
Please login to merge, or discard this patch.
Classes/Common/Document.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
                     /* @var $xml \SimpleXMLElement */
449 449
                     $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/');
450 450
                     $xpathResult = $xml->xpath('//mets:mets');
451
-                    $documentFormat = ($xpathResult !== false && count($xpathResult)>0) ? 'METS' : null;
451
+                    $documentFormat = ($xpathResult !== false && count($xpathResult) > 0) ? 'METS' : null;
452 452
                 } else {
453 453
                     // Try to load file as IIIF resource instead.
454 454
                     $contentAsJsonArray = json_decode($content, true);
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
                 return $depth;
683 683
             } elseif (array_key_exists('children', $element)) {
684 684
                 $foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId);
685
-                if ($foundInChildren!==false) {
685
+                if ($foundInChildren !== false) {
686 686
                     return $foundInChildren;
687 687
                 }
688 688
             }
Please login to merge, or discard this patch.
Classes/Plugin/PageView.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @var array
58 58
      * @access protected
59 59
      */
60
-    protected $annotationContainers = array();
60
+    protected $annotationContainers = array ();
61 61
 
62 62
     /**
63 63
      * Adds Viewer javascript
@@ -250,8 +250,8 @@  discard block
 block discarded – undo
250 250
             if ($iiif instanceof ManifestInterface) {
251 251
                 $canvas = $iiif->getContainedResourceById($canvasId);
252 252
                 /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */
253
-                if ($canvas!=null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
254
-                    $annotationContainers = array();
253
+                if ($canvas != null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
254
+                    $annotationContainers = array ();
255 255
                     /*
256 256
                      *  TODO Analyzing the annotations on the server side requires loading the annotation lists / pages
257 257
                      *  just to determine wether they contain text annotations for painting. This will take time and lead to a bad user experience.
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                 }
286 286
             }
287 287
         }
288
-        return array();
288
+        return array ();
289 289
     }
290 290
 
291 291
     /**
Please login to merge, or discard this patch.
Classes/Common/IiifManifest.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -284,17 +284,17 @@  discard block
 block discarded – undo
284 284
                     }
285 285
                     // populate structural metadata info
286 286
                     $elements[$canvasOrder] = $canvas->getId();
287
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['id']=$canvas->getId();
288
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId']=null;
289
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['label']=$canvas->getLabelForDisplay();
290
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel']=$canvas->getLabelForDisplay();
287
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['id'] = $canvas->getId();
288
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = null;
289
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['label'] = $canvas->getLabelForDisplay();
290
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel'] = $canvas->getLabelForDisplay();
291 291
                     // assume that a canvas always represents a page
292
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['type']='page';
293
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds']=null;
292
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['type'] = 'page';
293
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = null;
294 294
                     $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null;
295 295
                     if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
296
-                        $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = array();
297
-                        $this->physicalStructureInfo[$physSeq[0]]['annotationContainers'] = array();
296
+                        $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = array ();
297
+                        $this->physicalStructureInfo[$physSeq[0]]['annotationContainers'] = array ();
298 298
                         foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
299 299
                             $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'][] = $annotationContainer->getId();
300 300
                             if ($extConf['indexAnnotations']) {
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
                 $details = $this->getLogicalStructureInfo($logUnits[0]);
426 426
             } else {
427 427
                 // cache the ranges - they might occure multiple times in the structures "tree" - with full data as well as referenced as id
428
-                $processedStructures = array();
428
+                $processedStructures = array ();
429 429
                 foreach ($logUnits as $logUnit) {
430 430
                     if (array_search($logUnit->getId(), $processedStructures) == false) {
431 431
                         $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures);
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      * @param array $processedStructures: IIIF resources that already have been processed
447 447
      * @return array Logical structure array
448 448
      */
449
-    protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = array()) {
449
+    protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = array ()) {
450 450
         $details = array ();
451 451
         $details['id'] = $resource->getId();
452 452
         $details['dmdId'] = '';
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
         $this->_getSmLinks();
469 469
         // Load physical structure.
470 470
         $this-> _getPhysicalStructure();
471
-        $canvases = array();
471
+        $canvases = array ();
472 472
         if ($resource instanceof ManifestInterface) {
473 473
             $startCanvas = $resource->getStartCanvasOrFirstCanvas();
474 474
             $canvases = $resource->getDefaultCanvases();
@@ -479,13 +479,13 @@  discard block
 block discarded – undo
479 479
         if ($startCanvas != null) {
480 480
             $details['pagination'] = $startCanvas->getLabel();
481 481
             $startCanvasIndex = array_search($startCanvas, $this->iiif->getDefaultCanvases());
482
-            if ($startCanvasIndex!==false) {
482
+            if ($startCanvasIndex !== false) {
483 483
                 $details['points'] = $startCanvasIndex + 1;
484 484
             }
485 485
         }
486 486
         $useGroups = $this->getUseGroups('fileGrps');
487 487
         if (is_string($useGroups)) {
488
-            $useGroups = array($useGroups);
488
+            $useGroups = array ($useGroups);
489 489
         }
490 490
         // Keep for later usage.
491 491
         $this->logicalUnits[$details['id']] = $details;
@@ -543,9 +543,9 @@  discard block
 block discarded – undo
543 543
             return $this->originalMetadataArray[$id];
544 544
         }
545 545
         $iiifResource = $this->iiif->getContainedResourceById($id);
546
-        $result = array();
546
+        $result = array ();
547 547
         if ($iiifResource != null) {
548
-            if ($iiifResource->getLabel()!=null && $iiifResource->getLabel() != "") {
548
+            if ($iiifResource->getLabel() != null && $iiifResource->getLabel() != "") {
549 549
                 $result['label'] = $iiifResource->getLabel();
550 550
             }
551 551
             if (!empty($iiifResource->getMetadata())) {
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
             if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != null) {
622 622
                 if (is_string($values)) {
623 623
                     $metadata[$resArray['index_name']] = array (trim((string) $values));
624
-                } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data())>1 ) {
624
+                } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) {
625 625
                     $metadata[$resArray['index_name']] = array ();
626 626
                     foreach ($values->data() as $value) {
627 627
                         $metadata[$resArray['index_name']][] = trim((string) $value);
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
                     && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null)) {
639 639
                     if ($values instanceof string) {
640 640
                         $metadata[$resArray['index_name'].'_sorting'][0] = array (trim((string) $values));
641
-                    } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()>1 )) {
641
+                    } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data() > 1)) {
642 642
                         $metadata[$resArray['index_name']] = array ();
643 643
                         foreach ($values->data() as $value) {
644 644
                             $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value);
@@ -750,13 +750,13 @@  discard block
 block discarded – undo
750 750
                     // Get annotation containers
751 751
                     $annotationContainerIds = $this->physicalStructureInfo[$id]['annotationContainers'];
752 752
                     if (!empty($annotationContainerIds)) {
753
-                        $annotationTexts = array();
753
+                        $annotationTexts = array ();
754 754
                         foreach ($annotationContainerIds as $annotationListId) {
755 755
                             $annotationContainer = $this->iiif->getContainedResourceById($annotationListId);
756 756
                             /* @var $annotationContainer \Ubl\Iiif\Presentation\Common\Model\Resources\AnnotationContainerInterface */
757 757
                             foreach ($annotationContainer->getTextAnnotations(Motivation::PAINTING) as $annotation) {
758 758
                                 if ($annotation->getTargetResourceId() == $iiifResource->getId() &&
759
-                                    $annotation->getBody()!=null && $annotation->getBody()->getChars()!=null) {
759
+                                    $annotation->getBody() != null && $annotation->getBody()->getChars() != null) {
760 760
                                     $annotationTexts[] = $annotation->getBody()->getChars();
761 761
                                 }
762 762
                             }
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
807 807
         IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
808 808
         $resource = IiifHelper::loadIiifResource($content);
809
-        if ($resource != null ) {
809
+        if ($resource != null) {
810 810
             if ($resource instanceof ManifestInterface) {
811 811
                 $this->iiif = $resource;
812 812
                 return true;
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
         IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
920 920
         $resource = IiifHelper::loadIiifResource($this->asJson);
921 921
         if ($resource != null && $resource instanceof ManifestInterface) {
922
-            $this->asJson='';
922
+            $this->asJson = '';
923 923
             $this->iiif = $resource;
924 924
             $this->init();
925 925
         } else {
Please login to merge, or discard this patch.
Classes/Plugin/Search.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -552,14 +552,14 @@
 block discarded – undo
552 552
         $results = $solr->service->select($selectQuery);
553 553
         $facet = $results->getFacetSet();
554 554
 
555
-        $facetCollectionArray = array();
555
+        $facetCollectionArray = array ();
556 556
 
557 557
         // replace everything expect numbers and comma
558 558
         $facetCollections = preg_replace('/[^0-9,]/', '', $this->conf['facetCollections']);
559 559
         $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
560 560
             'tx_dlf_collections.index_name AS index_name',
561 561
             'tx_dlf_collections',
562
-            'tx_dlf_collections.uid IN (' . $facetCollections . ')'
562
+            'tx_dlf_collections.uid IN ('.$facetCollections.')'
563 563
                 .Helper::whereClause('tx_dlf_collections')
564 564
         );
565 565
 
Please login to merge, or discard this patch.