Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (64c81c)
by Sebastian
04:54
created
Classes/Plugin/ListView.php 2 patches
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.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -161,11 +161,14 @@  discard block
 block discarded – undo
161 161
                             'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
162 162
                         ];
163 163
                         $value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
164
-                    } elseif ($index_name == 'owner' && !empty($value)) { // Translate name of holding library.
164
+                    } elseif ($index_name == 'owner' && !empty($value)) {
165
+// Translate name of holding library.
165 166
                         $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
166
-                    } elseif ($index_name == 'type' && !empty($value)) { // Translate document type.
167
+                    } elseif ($index_name == 'type' && !empty($value)) {
168
+// Translate document type.
167 169
                         $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
168
-                    } elseif ($index_name == 'language' && !empty($value)) { // Translate ISO 639 language code.
170
+                    } elseif ($index_name == 'language' && !empty($value)) {
171
+// Translate ISO 639 language code.
169 172
                         $value = htmlspecialchars(Helper::getLanguageName($value));
170 173
                     } elseif (!empty($value)) {
171 174
                         $value = htmlspecialchars($value);
@@ -327,16 +330,19 @@  discard block
 block discarded – undo
327 330
                             'additionalParams' => \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl($this->prefixId, $additionalParams, '', TRUE, FALSE)
328 331
                         ];
329 332
                         $value = $this->cObj->typoLink(htmlspecialchars($value), $conf);
330
-                    } elseif ($index_name == 'owner' && !empty($value)) { // Translate name of holding library.
333
+                    } elseif ($index_name == 'owner' && !empty($value)) {
334
+// Translate name of holding library.
331 335
                         $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_libraries', $this->conf['pages']));
332
-                    } elseif ($index_name == 'type' && !empty($value)) { // Translate document type.
336
+                    } elseif ($index_name == 'type' && !empty($value)) {
337
+// Translate document type.
333 338
                         $_value = $value;
334 339
                         $value = htmlspecialchars(Helper::translate($value, 'tx_dlf_structures', $this->conf['pages']));
335 340
                         // Add page number for single pages.
336 341
                         if ($_value == 'page') {
337 342
                             $value .= ' '.intval($subpart['page']);
338 343
                         }
339
-                    } elseif ($index_name == 'language' && !empty($value)) { // Translate ISO 639 language code.
344
+                    } elseif ($index_name == 'language' && !empty($value)) {
345
+// Translate ISO 639 language code.
340 346
                         $value = htmlspecialchars(Helper::getLanguageName($value));
341 347
                     } elseif (!empty($value)) {
342 348
                         $value = htmlspecialchars($value);
Please login to merge, or discard this patch.
Classes/Common/Helper.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -580,18 +580,18 @@
 block discarded – undo
580 580
         return $original;
581 581
     }
582 582
 
583
-     /**
584
-     * Process a data and/or command map with TYPO3 core engine as admin.
585
-     *
586
-     * @access public
587
-     *
588
-     * @param array $data: Data map
589
-     * @param array $cmd: Command map
590
-     * @param boolean $reverseOrder: Should the data map be reversed?
591
-     * @param boolean $cmdFirst: Should the command map be processed first?
592
-     *
593
-     * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
594
-     */
583
+        /**
584
+         * Process a data and/or command map with TYPO3 core engine as admin.
585
+         *
586
+         * @access public
587
+         *
588
+         * @param array $data: Data map
589
+         * @param array $cmd: Command map
590
+         * @param boolean $reverseOrder: Should the data map be reversed?
591
+         * @param boolean $cmdFirst: Should the command map be processed first?
592
+         *
593
+         * @return array Array of substituted "NEW..." identifiers and their actual UIDs.
594
+         */
595 595
     public static function processDBasAdmin(array $data = [], array $cmd = [], $reverseOrder = FALSE, $cmdFirst = FALSE) {
596 596
         if (TYPO3_MODE === 'BE'
597 597
             && $GLOBALS['BE_USER']->isAdmin()) {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -789,11 +789,11 @@  discard block
 block discarded – undo
789 789
         if (empty($labels[$table][$pid][$GLOBALS['TSFE']->sys_language_content][$index_name])) {
790 790
             // Check if this table is allowed for translation.
791 791
             if (in_array($table, ['tx_dlf_collections', 'tx_dlf_libraries', 'tx_dlf_metadata', 'tx_dlf_structures'])) {
792
-                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', array(-1, 0));
792
+                $additionalWhere = $queryBuilder->expr()->in($table.'.sys_language_uid', array (-1, 0));
793 793
                 if ($GLOBALS['TSFE']->sys_language_content > 0) {
794 794
                     $additionalWhere = $queryBuilder->expr()->andX(
795 795
                         $queryBuilder->expr()->orX(
796
-                            $queryBuilder->expr()->in($table.'.sys_language_uid', array(-1, 0)),
796
+                            $queryBuilder->expr()->in($table.'.sys_language_uid', array (-1, 0)),
797 797
                             $queryBuilder->expr()->eq($table.'.sys_language_uid', intval($GLOBALS['TSFE']->sys_language_content))
798 798
                         ),
799 799
                         $queryBuilder->expr()->eq($table.'.l18n_parent', 0)
@@ -892,7 +892,7 @@  discard block
 block discarded – undo
892 892
         if (TYPO3_MODE === 'FE') {
893 893
             // Table "tx_dlf_formats" always has PID 0.
894 894
             if ($table == 'tx_dlf_formats') {
895
-                return $expressionBuilder->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
895
+                return $expressionBuilder->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
896 896
             }
897 897
 
898 898
             // Should we ignore the record's hidden flag?
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
             }
915 915
             return $expression;
916 916
         } elseif (TYPO3_MODE === 'BE') {
917
-            return $expressionBuilder->eq($table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
917
+            return $expressionBuilder->eq($table.'.'.$GLOBALS['TCA'][$table]['ctrl']['delete'], 0);
918 918
         } else {
919 919
             self::devLog('Unexpected TYPO3_MODE "'.TYPO3_MODE.'"', DEVLOG_SEVERITY_ERROR);
920 920
             return '1=-1';
Please login to merge, or discard this patch.
class.ext_update.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@
 block discarded – undo
422 422
                 $GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesOkay', TRUE),
423 423
                 $GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntries', TRUE),
424 424
                 \TYPO3\CMS\Core\Messaging\FlashMessage::OK
425
-               );
425
+                );
426 426
         } else {
427 427
             Helper::addMessage(
428 428
                 $GLOBALS['LANG']->getLL('update.documentSetFormatForOldEntriesNotOkay', TRUE),
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -364,10 +364,10 @@
 block discarded – undo
364 364
         );
365 365
         while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
366 366
             if ($resArray['COLUMN_NAME'] == 'document_format') {
367
-                return false;
367
+                return FALSE;
368 368
             }
369 369
         }
370
-        return true;
370
+        return TRUE;
371 371
     }
372 372
 
373 373
     protected function updateDocumentAddFormat() {
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 3 patches
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.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -138,11 +138,11 @@  discard block
 block discarded – undo
138 138
             IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
139 139
             IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
140 140
             $service = IiifHelper::loadIiifResource($fileLocation);
141
-            if ($service != null && $service instanceof AbstractImageService) {
141
+            if ($service != NULL && $service instanceof AbstractImageService) {
142 142
                 return $service->getImageUrl();
143 143
             }
144 144
         } elseif ($fileMimeType = "application/vnd.netfpx") {
145
-            $baseURL = $fileLocation.(strpos($fileLocation, "?") === false ? "?" : "");
145
+            $baseURL = $fileLocation.(strpos($fileLocation, "?") === FALSE ? "?" : "");
146 146
             // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server'
147 147
             return $baseURL."&CVT=jpeg";
148 148
         }
@@ -580,9 +580,9 @@  discard block
 block discarded – undo
580 580
         
581 581
         if ($preloadedDocument instanceof \SimpleXMLElement) {
582 582
             $this->xml = $preloadedDocument;
583
-            return true;
583
+            return TRUE;
584 584
         }
585
-        return false;
585
+        return FALSE;
586 586
     }
587 587
 
588 588
     /**
Please login to merge, or discard this patch.
Braces   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
  * @subpackage	tx_dlf
24 24
  * @access	public
25 25
  */
26
-final class MetsDocument extends Document
27
-{
26
+final class MetsDocument extends Document {
28 27
     /**
29 28
      * This holds the whole XML file as string for serialization purposes
30 29
      * @see __sleep() / __wakeup()
@@ -259,14 +258,16 @@  discard block
 block discarded – undo
259 258
             // Yes. Get the file reference.
260 259
             $details['points'] = (string) $structure->children('http://www.loc.gov/METS/')->mptr[0]->attributes('http://www.w3.org/1999/xlink')->href;
261 260
         } elseif (!empty($this->physicalStructure)
262
-            && array_key_exists($details['id'], $this->smLinks['l2p'])) { // Are there any physical elements and is this logical unit linked to at least one of them?
261
+            && array_key_exists($details['id'], $this->smLinks['l2p'])) {
262
+// Are there any physical elements and is this logical unit linked to at least one of them?
263 263
             $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1);
264 264
             if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']])) {
265 265
                 $details['thumbnailId'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$extConf['fileGrpThumbs']];
266 266
             }
267 267
             // Get page/track number of the first page/track related to this structure element.
268 268
             $details['pagination'] = $this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['orderlabel'];
269
-        } elseif ($details['id'] == $this->_getToplevelId()) { // Is this the toplevel structure element?
269
+        } elseif ($details['id'] == $this->_getToplevelId()) {
270
+// Is this the toplevel structure element?
270 271
             // Yes. Point to itself.
271 272
             $details['points'] = 1;
272 273
             if (!empty($this->physicalStructure)
@@ -491,8 +492,7 @@  discard block
 block discarded – undo
491 492
      * {@inheritDoc}
492 493
      * @see Document::getStructureDepth()
493 494
      */
494
-    public function getStructureDepth($logId)
495
-    {
495
+    public function getStructureDepth($logId) {
496 496
         return count($this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$logId.'"]/ancestor::*'));
497 497
     }
498 498
 
@@ -551,8 +551,7 @@  discard block
 block discarded – undo
551 551
      * {@inheritDoc}
552 552
      * @see Document::getParentDocumentUid()
553 553
      */
554
-    protected function getParentDocumentUidForSaving($pid, $core)
555
-    {
554
+    protected function getParentDocumentUidForSaving($pid, $core) {
556 555
         $partof = 0;
557 556
         // Get the closest ancestor of the current document which has a MPTR child.
558 557
         $parentMptr = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="'.$this->_getToplevelId().'"]/ancestor::mets:div[./mets:mptr][1]/mets:mptr');
Please login to merge, or discard this patch.
Classes/Plugin/Tools/AnnotationTool.php 2 patches
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.
Upper-Lower-Casing   +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.
Classes/Plugin/PageView.php 3 patches
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             if ($iiif instanceof ManifestInterface) {
248 248
                 $canvas = $iiif->getContainedResourceById($canvasId);
249 249
                 /* @var $canvas \Ubl\Iiif\Presentation\Common\Model\Resources\CanvasInterface */
250
-                if ($canvas!=null && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
250
+                if ($canvas!=NULL && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
251 251
                     $annotationContainers = array();
252 252
                     /*
253 253
                      *  TODO Analyzing the annotations on the server side requires loading the annotation lists / pages
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
                      *  On the other hand, server connections are potentially better than client connections. Downloading annotation lists
258 258
                      */
259 259
                     foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
260
-                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
260
+                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
261 261
                             foreach ($textAnnotations as $annotation) {
262 262
                                 if ($annotation->getBody()->getFormat() == "text/plain"
263
-                                    && $annotation->getBody()->getChars() != null) {
263
+                                    && $annotation->getBody()->getChars() != NULL) {
264 264
                                     $annotationListData = [];
265 265
                                     $annotationListData["uri"] = $annotationContainer->getId();
266 266
                                     $annotationListData["label"] = $annotationContainer->getLabelForDisplay();
Please login to merge, or discard this 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.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -242,8 +242,7 @@
 block discarded – undo
242 242
      * @return array     An array containing the IRIs of the AnnotationLists / AnnotationPages as well as
243 243
      *                   some information about the canvas.
244 244
      */
245
-    protected function getAnnotationContainers($page)
246
-    {
245
+    protected function getAnnotationContainers($page) {
247 246
         if ($this->doc instanceof IiifManifest) {
248 247
             $canvasId = $this->doc->physicalStructure[$page];
249 248
             $iiif = $this->doc->getIiif();
Please login to merge, or discard this patch.
Classes/Common/IiifManifest.php 3 patches
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.
Braces   +18 added lines, -36 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
  * @subpackage	tx_dlf
38 38
  * @access	public
39 39
  */
40
-final class IiifManifest extends Document
41
-{
40
+final class IiifManifest extends Document {
42 41
     /**
43 42
      * This holds the manifest file as string for serialization purposes
44 43
      * @see __sleep() / __wakeup()
@@ -99,8 +98,7 @@  discard block
 block discarded – undo
99 98
      * {@inheritDoc}
100 99
      * @see Document::establishRecordId()
101 100
      */
102
-    protected function establishRecordId($pid)
103
-    {
101
+    protected function establishRecordId($pid) {
104 102
         if ($this->iiif !== null) {
105 103
             /*
106 104
              *  FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss
@@ -141,8 +139,7 @@  discard block
 block discarded – undo
141 139
      * {@inheritDoc}
142 140
      * @see Document::getDocument()
143 141
      */
144
-    protected function getDocument()
145
-    {
142
+    protected function getDocument() {
146 143
         return $this->iiif;
147 144
     }
148 145
 
@@ -196,8 +193,7 @@  discard block
 block discarded – undo
196 193
      *
197 194
      * @return array|string
198 195
      */
199
-    protected function getUseGroups($use)
200
-    {
196
+    protected function getUseGroups($use) {
201 197
         if (!$this->useGrpsLoaded) {
202 198
             // Get configured USE attributes.
203 199
             $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
@@ -224,8 +220,7 @@  discard block
 block discarded – undo
224 220
      * {@inheritDoc}
225 221
      * @see Document::_getPhysicalStructure()
226 222
      */
227
-    protected function _getPhysicalStructure()
228
-    {
223
+    protected function _getPhysicalStructure() {
229 224
         // Is there no physical structure array yet?
230 225
         if (!$this->physicalStructureLoaded) {
231 226
             if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) {
@@ -359,8 +354,7 @@  discard block
 block discarded – undo
359 354
      * {@inheritDoc}
360 355
      * @see Document::getFileLocation()
361 356
      */
362
-    public function getFileLocation($id)
363
-    {
357
+    public function getFileLocation($id) {
364 358
         if ($id == null) {
365 359
             return null;
366 360
         }
@@ -384,8 +378,7 @@  discard block
 block discarded – undo
384 378
      * {@inheritDoc}
385 379
      * @see Document::getFileMimeType()
386 380
      */
387
-    public function getFileMimeType($id)
388
-    {
381
+    public function getFileMimeType($id) {
389 382
         $fileResource = $this->iiif->getContainedResourceById($id);
390 383
         if ($fileResource instanceof CanvasInterface) {
391 384
             $format = "application/vnd.kitodo.iiif";
@@ -410,8 +403,7 @@  discard block
 block discarded – undo
410 403
      * {@inheritDoc}
411 404
      * @see Document::getLogicalStructure()
412 405
      */
413
-    public function getLogicalStructure($id, $recursive = FALSE)
414
-    {
406
+    public function getLogicalStructure($id, $recursive = FALSE) {
415 407
         $details = array ();
416 408
         if (!$recursive && !empty($this->logicalUnits[$id])) {
417 409
             return $this->logicalUnits[$id];
@@ -580,8 +572,7 @@  discard block
 block discarded – undo
580 572
      * {@inheritDoc}
581 573
      * @see Document::getMetadata()
582 574
      */
583
-    public function getMetadata($id, $cPid = 0)
584
-    {
575
+    public function getMetadata($id, $cPid = 0) {
585 576
         if (!empty($this->metadataArray[$id]) && $this->metadataArray[0] == $cPid) {
586 577
             return $this->metadataArray[$id];
587 578
         }
@@ -704,8 +695,7 @@  discard block
 block discarded – undo
704 695
      * @param CanvasInterface $canvas
705 696
      * @param IiifResourceInterface $resource
706 697
      */
707
-    private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource)
708
-    {
698
+    private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) {
709 699
         $this->smLinks['l2p'][$resource->getId()][] = $canvas->getId();
710 700
         if (!is_array($this->smLinks['p2l'][$canvas->getId()]) || !in_array($resource->getId(), $this->smLinks['p2l'][$canvas->getId()])) {
711 701
             $this->smLinks['p2l'][$canvas->getId()][] = $resource->getId();
@@ -720,8 +710,7 @@  discard block
 block discarded – undo
720 710
      *
721 711
      * @see Document::getParentDocumentUidForSaving()
722 712
      */
723
-    protected function getParentDocumentUidForSaving($pid, $core)
724
-    {
713
+    protected function getParentDocumentUidForSaving($pid, $core) {
725 714
         // Do nothing.
726 715
     }
727 716
 
@@ -780,8 +769,7 @@  discard block
 block discarded – undo
780 769
      *
781 770
      * @return IiifResourceInterface
782 771
      */
783
-    public function getIiif()
784
-    {
772
+    public function getIiif() {
785 773
         return $this->iiif;
786 774
     }
787 775
 
@@ -789,8 +777,7 @@  discard block
 block discarded – undo
789 777
      * {@inheritDoc}
790 778
      * @see Document::init()
791 779
      */
792
-    protected function init()
793
-    {
780
+    protected function init() {
794 781
         // Nothing to do here, at the moment
795 782
     }
796 783
 
@@ -798,8 +785,7 @@  discard block
 block discarded – undo
798 785
      * {@inheritDoc}
799 786
      * @see Document::loadLocation()
800 787
      */
801
-    protected function loadLocation($location)
802
-    {
788
+    protected function loadLocation($location) {
803 789
         $content = GeneralUtility::getUrl($location);
804 790
         $conf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
805 791
         IiifHelper::setUrlReader(IiifUrlReader::getInstance());
@@ -820,8 +806,7 @@  discard block
 block discarded – undo
820 806
      * {@inheritDoc}
821 807
      * @see \Kitodo\Dlf\Common\Document::prepareMetadataArray()
822 808
      */
823
-    protected function prepareMetadataArray($cPid)
824
-    {
809
+    protected function prepareMetadataArray($cPid) {
825 810
         $id = $this->iiif->getId();
826 811
         $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid);
827 812
     }
@@ -842,8 +827,7 @@  discard block
 block discarded – undo
842 827
      * {@inheritDoc}
843 828
      * @see Document::ensureHasFulltextIsSet()
844 829
      */
845
-    protected function ensureHasFulltextIsSet()
846
-    {
830
+    protected function ensureHasFulltextIsSet() {
847 831
         /*
848 832
          *  TODO Check annotations and annotation lists of canvas for ALTO documents.
849 833
          *  Example:
@@ -885,8 +869,7 @@  discard block
 block discarded – undo
885 869
      * {@inheritDoc}
886 870
      * @see \Kitodo\Dlf\Common\Document::_getThumbnail()
887 871
      */
888
-    protected function _getThumbnail($forceReload = FALSE)
889
-    {
872
+    protected function _getThumbnail($forceReload = FALSE) {
890 873
         return $this->iiif->getThumbnailUrl();
891 874
     }
892 875
 
@@ -894,8 +877,7 @@  discard block
 block discarded – undo
894 877
      * {@inheritDoc}
895 878
      * @see \Kitodo\Dlf\Common\Document::_getToplevelId()
896 879
      */
897
-    protected function _getToplevelId()
898
-    {
880
+    protected function _getToplevelId() {
899 881
         if (empty($this->toplevelId)) {
900 882
             if (isset($this->iiif)) {
901 883
                 $this->toplevelId = $this->iiif->getId();
Please login to merge, or discard this patch.
Upper-Lower-Casing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @var boolean
69 69
      * @access protected
70 70
      */
71
-    protected $hasFulltextSet = false;
71
+    protected $hasFulltextSet = FALSE;
72 72
 
73 73
     /**
74 74
      * This holds the original manifest's parsed metadata array with their corresponding
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     protected function establishRecordId($pid)
103 103
     {
104
-        if ($this->iiif !== null) {
104
+        if ($this->iiif !== NULL) {
105 105
             /*
106 106
              *  FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss
107 107
              *  if the plugin that actually loads the manifest allows content from other pages.
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
     {
229 229
         // Is there no physical structure array yet?
230 230
         if (!$this->physicalStructureLoaded) {
231
-            if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) {
232
-                return null;
231
+            if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) {
232
+                return NULL;
233 233
             }
234 234
             $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
235 235
             $iiifId = $this->iiif->getId();
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             $this->physicalStructureInfo[$physSeq[0]]['label'] = $this->iiif->getLabelForDisplay();
240 240
             $this->physicalStructureInfo[$physSeq[0]]['orderlabel'] = $this->iiif->getLabelForDisplay();
241 241
             $this->physicalStructureInfo[$physSeq[0]]['type'] = 'physSequence';
242
-            $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = null;
242
+            $this->physicalStructureInfo[$physSeq[0]]['contentIds'] = NULL;
243 243
             $fileUseDownload = $this->getUseGroups('fileGrpDownload');
244 244
             $fileUseFulltext = $this->getUseGroups('fileGrpFulltext');
245 245
             $fileUseThumbs = $this->getUseGroups('fileGrpThumbs');
@@ -253,14 +253,14 @@  discard block
 block discarded – undo
253 253
             if (isset($fileUseFulltext)) {
254 254
                 $iiifAlto = $this->iiif->getSeeAlsoUrlsForFormat("application/alto+xml");
255 255
                 if (empty($iiifAlto)) {
256
-                    $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true);
256
+                    $iiifAlto = $this->iiif->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE);
257 257
                 }
258 258
                 if (!empty($iiifAlto)) {
259 259
                     // TODO use multiple possible alto files?
260 260
                     $this->mimeTypes[$iiifAlto[0]] = "application/alto+xml";
261 261
                     $this->physicalStructureInfo[$physSeq[0]]['files'][$fileUseFulltext] = $iiifAlto[0];
262
-                    $this->hasFulltext = true;
263
-                    $this->hasFulltextSet = true;
262
+                    $this->hasFulltext = TRUE;
263
+                    $this->hasFulltextSet = TRUE;
264 264
                 }
265 265
             }
266 266
             if (!empty($this->iiif->getDefaultCanvases())) {
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                     // put images in all non specific filegroups
278 278
                     if (isset($fileUses)) {
279 279
                         foreach ($fileUses as $fileUse) {
280
-                            if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) {
280
+                            if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) {
281 281
                                 $this->physicalStructureInfo[$physSeq[0]]['files'][$fileUse] = $image->getBody()->getId();
282 282
                             }
283 283
                         }
@@ -285,40 +285,40 @@  discard block
 block discarded – undo
285 285
                     // populate structural metadata info
286 286
                     $elements[$canvasOrder] = $canvas->getId();
287 287
                     $this->physicalStructureInfo[$elements[$canvasOrder]]['id']=$canvas->getId();
288
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId']=null;
288
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId']=NULL;
289 289
                     $this->physicalStructureInfo[$elements[$canvasOrder]]['label']=$canvas->getLabelForDisplay();
290 290
                     $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel']=$canvas->getLabelForDisplay();
291 291
                     // assume that a canvas always represents a page
292 292
                     $this->physicalStructureInfo[$elements[$canvasOrder]]['type']='page';
293
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds']=null;
294
-                    $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null;
293
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds']=NULL;
294
+                    $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = NULL;
295 295
                     if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
296 296
                         $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = array();
297 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']) {
301
-                                $this->hasFulltext = true;
302
-                                $this->hasFulltextSet = true;
301
+                                $this->hasFulltext = TRUE;
302
+                                $this->hasFulltextSet = TRUE;
303 303
                             }
304 304
                         }
305 305
                     }
306 306
                     if (isset($fileUseFulltext)) {
307 307
                         $alto = $canvas->getSeeAlsoUrlsForFormat("application/alto+xml");
308 308
                         if (empty($alto)) {
309
-                            $alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", true);
309
+                            $alto = $canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/", TRUE);
310 310
                         }
311 311
                         if (!empty($alto)) {
312 312
                             // TODO use all possible alto files?
313 313
                             $this->mimeTypes[$alto[0]] = "application/alto+xml";
314 314
                             $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUseFulltext] = $alto[0];
315
-                            $this->hasFulltext = true;
316
-                            $this->hasFulltextSet = true;
315
+                            $this->hasFulltext = TRUE;
316
+                            $this->hasFulltextSet = TRUE;
317 317
                         }
318 318
                     }
319 319
                     if (isset($fileUses)) {
320 320
                         foreach ($fileUses as $fileUse) {
321
-                            if ($image->getBody() != null && $image->getBody() instanceof ContentResourceInterface) {
321
+                            if ($image->getBody() != NULL && $image->getBody() instanceof ContentResourceInterface) {
322 322
                                 $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUse] = $image->getBody()->getId();
323 323
                             }
324 324
                         }
@@ -361,15 +361,15 @@  discard block
 block discarded – undo
361 361
      */
362 362
     public function getFileLocation($id)
363 363
     {
364
-        if ($id == null) {
365
-            return null;
364
+        if ($id == NULL) {
365
+            return NULL;
366 366
         }
367 367
         $resource = $this->iiif->getContainedResourceById($id);
368 368
         if (isset($resource)) {
369 369
             if ($resource instanceof CanvasInterface) {
370
-                return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != null) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id;
370
+                return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != NULL) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id;
371 371
             } elseif ($resource instanceof ContentResourceInterface) {
372
-                return $resource->getSingleService() != null && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id;
372
+                return $resource->getSingleService() != NULL && $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id;
373 373
             } elseif ($resource instanceof AbstractImageService) {
374 374
                 return $resource->getId();
375 375
             } elseif ($resource instanceof AnnotationContainerInterface) {
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
         } elseif ($fileResource instanceof AnnotationInterface) {
393 393
             $format = "application/vnd.kitodo.iiif";
394 394
         } elseif ($fileResource instanceof ContentResourceInterface) {
395
-            if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == null || !($fileResource->getSingleService() instanceof AbstractImageService))) {
395
+            if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == NULL || !($fileResource->getSingleService() instanceof AbstractImageService))) {
396 396
                 // Support static images without an image service
397 397
                 return $fileResource->getFormat();
398 398
             }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                 // cache the ranges - they might occure multiple times in the structures "tree" - with full data as well as referenced as id
428 428
                 $processedStructures = array();
429 429
                 foreach ($logUnits as $logUnit) {
430
-                    if (array_search($logUnit->getId(), $processedStructures) == false) {
430
+                    if (array_search($logUnit->getId(), $processedStructures) == FALSE) {
431 431
                         $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures);
432 432
                     }
433 433
                 }
@@ -446,12 +446,12 @@  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'] = '';
453
-        $details['label'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : '';
454
-        $details['orderlabel'] = $resource->getLabelForDisplay() !== null ? $resource->getLabelForDisplay() : '';
453
+        $details['label'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : '';
454
+        $details['orderlabel'] = $resource->getLabelForDisplay() !== NULL ? $resource->getLabelForDisplay() : '';
455 455
         $details['contentIds'] = '';
456 456
         $details['volume'] = '';
457 457
         $details['pagination'] = '';
@@ -476,10 +476,10 @@  discard block
 block discarded – undo
476 476
             $startCanvas = $resource->getStartCanvasOrFirstCanvas();
477 477
             $canvases = $resource->getAllCanvases();
478 478
         }
479
-        if ($startCanvas != null) {
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
         }
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
         if ($recursive) {
494 494
             $processedStructures[] = $resource->getId();
495 495
             $details['children'] = array ();
496
-            if ($resource instanceof ManifestInterface && $resource->getRootRanges() != null) {
496
+            if ($resource instanceof ManifestInterface && $resource->getRootRanges() != NULL) {
497 497
                 $rangesToAdd = [];
498 498
                 $rootRanges = [];
499 499
                 if (sizeof($this->iiif->getRootRanges()) == 1 && $this->iiif->getRootRanges()[0]->isTopRange()) {
@@ -505,14 +505,14 @@  discard block
 block discarded – undo
505 505
                     $rootRanges[] = $range;
506 506
                 }
507 507
                 foreach ($rootRanges as $range) {
508
-                    if ((array_search($range->getId(), $processedStructures) == false)) {
508
+                    if ((array_search($range->getId(), $processedStructures) == FALSE)) {
509 509
                         $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures);
510 510
                     }
511 511
                 }
512 512
             } elseif ($resource instanceof RangeInterface) {
513 513
                 if (!empty($resource->getAllRanges())) {
514 514
                     foreach ($resource->getAllRanges() as $range) {
515
-                        if ((array_search($range->getId(), $processedStructures) == false)) {
515
+                        if ((array_search($range->getId(), $processedStructures) == FALSE)) {
516 516
                             $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures);
517 517
                         }
518 518
                     }
@@ -538,14 +538,14 @@  discard block
 block discarded – undo
538 538
      *
539 539
      * @todo This method is still in experimental; the method signature may change.
540 540
      */
541
-    public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true) {
541
+    public function getManifestMetadata($id, $cPid = 0, $withDescription = TRUE, $withRights = TRUE, $withRelated = TRUE) {
542 542
         if (!empty($this->originalMetadataArray[$id])) {
543 543
             return $this->originalMetadataArray[$id];
544 544
         }
545 545
         $iiifResource = $this->iiif->getContainedResourceById($id);
546 546
         $result = array();
547
-        if ($iiifResource != null) {
548
-            if ($iiifResource->getLabel()!=null && $iiifResource->getLabel() != "") {
547
+        if ($iiifResource != NULL) {
548
+            if ($iiifResource->getLabel()!=NULL && $iiifResource->getLabel() != "") {
549 549
                 $result['label'] = $iiifResource->getLabel();
550 550
             }
551 551
             if (!empty($iiifResource->getMetadata())) {
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
         $iiifResource = $this->iiif->getContainedResourceById($id);
619 619
         while ($resArray = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
620 620
             // Set metadata field's value(s).
621
-            if ($resArray['format'] > 0 && !empty($resArray['xpath']) && ($values = $iiifResource->jsonPath($resArray['xpath'])) != null) {
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 624
                 } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data())>1 ) {
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             // Set sorting value if applicable.
636 636
             if (!empty($metadata[$resArray['index_name']]) && $resArray['is_sortable']) {
637 637
                 if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])
638
-                    && ($values = $iiifResource->jsonPath($resArray['xpath_sorting']) != null)) {
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 641
                     } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()>1 )) {
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
                     $this->smLinkRangeCanvasesRecursively($range);
670 670
                 }
671 671
             }
672
-            $this->smLinksLoaded = true;
672
+            $this->smLinksLoaded = TRUE;
673 673
         }
674 674
         return $this->smLinks;
675 675
     }
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
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,10 +806,10 @@  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
-                return true;
812
+                return TRUE;
813 813
             }
814 814
         } else {
815 815
             Helper::devLog('Could not load IIIF manifest from "'.$location.'"', self::$extKey, SYSLOG_SEVERITY_ERROR);
@@ -833,9 +833,9 @@  discard block
 block discarded – undo
833 833
     protected function setPreloadedDocument($preloadedDocument) {
834 834
         if ($preloadedDocument instanceof ManifestInterface) {
835 835
             $this->iiif = $preloadedDocument;
836
-            return true;
836
+            return TRUE;
837 837
         }
838
-        return false;
838
+        return FALSE;
839 839
     }
840 840
 
841 841
     /**
@@ -856,20 +856,20 @@  discard block
 block discarded – undo
856 856
             foreach ($canvases as $canvas) {
857 857
                 if (!empty($canvas->getSeeAlsoUrlsForFormat("application/alto+xml")) ||
858 858
                     !empty($canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/"))) {
859
-                    $this->hasFulltextSet = true;
860
-                    $this->hasFulltext = true;
859
+                    $this->hasFulltextSet = TRUE;
860
+                    $this->hasFulltext = TRUE;
861 861
                     return;
862 862
                 }
863 863
                 $extConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][self::$extKey]);
864 864
                 if ($extConf['indexAnnotations'] == 1 && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) {
865 865
                     foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) {
866
-                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != null) {
866
+                        if (($textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING)) != NULL) {
867 867
                             foreach ($textAnnotations as $annotation) {
868
-                                if ($annotation->getBody() != null &&
868
+                                if ($annotation->getBody() != NULL &&
869 869
                                     $annotation->getBody()->getFormat() == "text/plain" &&
870
-                                    $annotation->getBody()->getChars() != null) {
871
-                                    $this->hasFulltextSet = true;
872
-                                    $this->hasFulltext = true;
870
+                                    $annotation->getBody()->getChars() != NULL) {
871
+                                    $this->hasFulltextSet = TRUE;
872
+                                    $this->hasFulltext = TRUE;
873 873
                                     return;
874 874
                                 }
875 875
                             }
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
                     }
878 878
                 }
879 879
             }
880
-            $this->hasFulltextSet = true;
880
+            $this->hasFulltextSet = TRUE;
881 881
         }
882 882
     }
883 883
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
         IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']);
919 919
         IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']);
920 920
         $resource = IiifHelper::loadIiifResource($this->asJson);
921
-        if ($resource != null && $resource instanceof ManifestInterface) {
921
+        if ($resource != NULL && $resource instanceof ManifestInterface) {
922 922
             $this->asJson='';
923 923
             $this->iiif = $resource;
924 924
             $this->init();
Please login to merge, or discard this patch.
Configuration/TCA/tx_dlf_collections.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -156,14 +156,14 @@
 block discarded – undo
156 156
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_collections.description',
157 157
             'config' => [
158 158
                 'behaviour' => [
159
-                    'allowLanguageSynchronization' => true
159
+                    'allowLanguageSynchronization' => TRUE
160 160
                 ],
161 161
                 'type' => 'text',
162 162
                 'cols' => 30,
163 163
                 'rows' => 10,
164 164
                 'wrap' => 'virtual',
165 165
                 'default' => '',
166
-                'enableRichtext' => true,
166
+                'enableRichtext' => TRUE,
167 167
             ],
168 168
         ],
169 169
         'thumbnail' => [
Please login to merge, or discard this patch.
Configuration/TCA/tx_dlf_metadata.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             'label' => 'LLL:EXT:dlf/Resources/Private/Language/Labels.xml:tx_dlf_metadata.wrap',
144 144
             'config' => [
145 145
                 'behaviour' => [
146
-                    'allowLanguageSynchronization' => true
146
+                    'allowLanguageSynchronization' => TRUE
147 147
                 ],
148 148
                 'type' => 'text',
149 149
                 'cols' => 48,
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
                 'wrap' => 'off',
152 152
                 'eval' => 'trim',
153 153
                 'default' => "key.wrap = <dt>|</dt>\nvalue.required = 1\nvalue.wrap = <dd>|</dd>",
154
-                'fixedFont' => true,
155
-                'enableTabulator' => true
154
+                'fixedFont' => TRUE,
155
+                'enableTabulator' => TRUE
156 156
             ],
157 157
         ],
158 158
         'index_tokenized' => [
Please login to merge, or discard this patch.