@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @var bool |
104 | 104 | * @access protected |
105 | 105 | */ |
106 | - protected $formatsLoaded = false; |
|
106 | + protected $formatsLoaded = FALSE; |
|
107 | 107 | |
108 | 108 | /** |
109 | 109 | * Are there any fulltext files available? This also includes IIIF text annotations |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | * @var bool |
114 | 114 | * @access protected |
115 | 115 | */ |
116 | - protected $hasFulltext = false; |
|
116 | + protected $hasFulltext = FALSE; |
|
117 | 117 | |
118 | 118 | /** |
119 | 119 | * Last searched logical and physical page |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * @var array |
122 | 122 | * @access protected |
123 | 123 | */ |
124 | - protected $lastSearchedPhysicalPage = ['logicalPage' => null, 'physicalPage' => null]; |
|
124 | + protected $lastSearchedPhysicalPage = ['logicalPage' => NULL, 'physicalPage' => NULL]; |
|
125 | 125 | |
126 | 126 | /** |
127 | 127 | * This holds the documents location |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | * @var bool |
156 | 156 | * @access protected |
157 | 157 | */ |
158 | - protected $metadataArrayLoaded = false; |
|
158 | + protected $metadataArrayLoaded = FALSE; |
|
159 | 159 | |
160 | 160 | /** |
161 | 161 | * The holds the total number of pages |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | * @var bool |
197 | 197 | * @access protected |
198 | 198 | */ |
199 | - protected $physicalStructureLoaded = false; |
|
199 | + protected $physicalStructureLoaded = FALSE; |
|
200 | 200 | |
201 | 201 | /** |
202 | 202 | * This holds the PID of the document or zero if not in database |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @var bool |
222 | 222 | * @access protected |
223 | 223 | */ |
224 | - protected $ready = false; |
|
224 | + protected $ready = FALSE; |
|
225 | 225 | |
226 | 226 | /** |
227 | 227 | * The METS file's / IIIF manifest's record identifier |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @var bool |
256 | 256 | * @access protected |
257 | 257 | */ |
258 | - protected $rootIdLoaded = false; |
|
258 | + protected $rootIdLoaded = FALSE; |
|
259 | 259 | |
260 | 260 | /** |
261 | 261 | * This holds the smLinks between logical and physical structMap |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @var bool |
273 | 273 | * @access protected |
274 | 274 | */ |
275 | - protected $smLinksLoaded = false; |
|
275 | + protected $smLinksLoaded = FALSE; |
|
276 | 276 | |
277 | 277 | /** |
278 | 278 | * This holds the logical structure |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @var bool |
290 | 290 | * @access protected |
291 | 291 | */ |
292 | - protected $tableOfContentsLoaded = false; |
|
292 | + protected $tableOfContentsLoaded = FALSE; |
|
293 | 293 | |
294 | 294 | /** |
295 | 295 | * This holds the document's thumbnail location |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | * @var bool |
307 | 307 | * @access protected |
308 | 308 | */ |
309 | - protected $thumbnailLoaded = false; |
|
309 | + protected $thumbnailLoaded = FALSE; |
|
310 | 310 | |
311 | 311 | /** |
312 | 312 | * This holds the toplevel structure's @ID (METS) or the manifest's @id (IIIF) |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | * |
424 | 424 | * @return \Kitodo\Dlf\Common\Document Instance of this class, either MetsDocument or IiifManifest |
425 | 425 | */ |
426 | - public static function &getInstance($uid, $pid = 0, $forceReload = false) |
|
426 | + public static function &getInstance($uid, $pid = 0, $forceReload = FALSE) |
|
427 | 427 | { |
428 | 428 | // Sanitize input. |
429 | 429 | $pid = max(intval($pid), 0); |
@@ -463,10 +463,10 @@ discard block |
||
463 | 463 | } |
464 | 464 | } |
465 | 465 | // Create new instance depending on format (METS or IIIF) ... |
466 | - $instance = null; |
|
467 | - $documentFormat = null; |
|
468 | - $xml = null; |
|
469 | - $iiif = null; |
|
466 | + $instance = NULL; |
|
467 | + $documentFormat = NULL; |
|
468 | + $xml = NULL; |
|
469 | + $iiif = NULL; |
|
470 | 470 | // Try to get document format from database |
471 | 471 | if (MathUtility::canBeInterpretedAsInteger($uid)) { |
472 | 472 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -515,17 +515,17 @@ discard block |
||
515 | 515 | @ini_set('user_agent', $extConf['useragent']); |
516 | 516 | } |
517 | 517 | $content = GeneralUtility::getUrl($location); |
518 | - if ($content !== false) { |
|
518 | + if ($content !== FALSE) { |
|
519 | 519 | $xml = Helper::getXmlFileAsString($content); |
520 | - if ($xml !== false) { |
|
520 | + if ($xml !== FALSE) { |
|
521 | 521 | /* @var $xml \SimpleXMLElement */ |
522 | 522 | $xml->registerXPathNamespace('mets', 'http://www.loc.gov/METS/'); |
523 | 523 | $xpathResult = $xml->xpath('//mets:mets'); |
524 | - $documentFormat = !empty($xpathResult) ? 'METS' : null; |
|
524 | + $documentFormat = !empty($xpathResult) ? 'METS' : NULL; |
|
525 | 525 | } else { |
526 | 526 | // Try to load file as IIIF resource instead. |
527 | - $contentAsJsonArray = json_decode($content, true); |
|
528 | - if ($contentAsJsonArray !== null) { |
|
527 | + $contentAsJsonArray = json_decode($content, TRUE); |
|
528 | + if ($contentAsJsonArray !== NULL) { |
|
529 | 529 | // Load plugin configuration. |
530 | 530 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
531 | 531 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | * |
581 | 581 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
582 | 582 | */ |
583 | - public abstract function getLogicalStructure($id, $recursive = false); |
|
583 | + public abstract function getLogicalStructure($id, $recursive = FALSE); |
|
584 | 584 | |
585 | 585 | /** |
586 | 586 | * This extracts all the metadata for a logical structure node |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | } else { |
618 | 618 | $physicalPage = 0; |
619 | 619 | foreach ($this->physicalStructureInfo as $page) { |
620 | - if (strpos($page['orderlabel'], $logicalPage) !== false) { |
|
620 | + if (strpos($page['orderlabel'], $logicalPage) !== FALSE) { |
|
621 | 621 | $this->lastSearchedPhysicalPage['logicalPage'] = $logicalPage; |
622 | 622 | $this->lastSearchedPhysicalPage['physicalPage'] = $physicalPage; |
623 | 623 | return $physicalPage; |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | if (!empty($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])) { |
669 | 669 | // Get full text file. |
670 | 670 | $fileContent = GeneralUtility::getUrl($this->getFileLocation($this->physicalStructureInfo[$id]['files'][$fileGrpFulltext])); |
671 | - if ($fileContent !== false) { |
|
671 | + if ($fileContent !== FALSE) { |
|
672 | 672 | $textFormat = $this->getTextFormat($fileContent); |
673 | 673 | } else { |
674 | 674 | $this->logger->warning('Couldn\'t load full text file for structure node @ID "' . $id . '"'); |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | { |
721 | 721 | $xml = Helper::getXmlFileAsString($fileContent); |
722 | 722 | |
723 | - if ($xml !== false) { |
|
723 | + if ($xml !== FALSE) { |
|
724 | 724 | // Get the root element's name as text format. |
725 | 725 | return strtoupper($xml->getName()); |
726 | 726 | } else { |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | * |
741 | 741 | * @return string The title of the document itself or a parent document |
742 | 742 | */ |
743 | - public static function getTitle($uid, $recursive = false) |
|
743 | + public static function getTitle($uid, $recursive = FALSE) |
|
744 | 744 | { |
745 | 745 | $title = ''; |
746 | 746 | // Sanitize input. |
@@ -773,7 +773,7 @@ discard block |
||
773 | 773 | && intval($partof) |
774 | 774 | && $partof != $uid |
775 | 775 | ) { |
776 | - $title = self::getTitle($partof, true); |
|
776 | + $title = self::getTitle($partof, TRUE); |
|
777 | 777 | } |
778 | 778 | } else { |
779 | 779 | Helper::log('No document with UID ' . $uid . ' found or document not accessible', LOG_SEVERITY_WARNING); |
@@ -834,12 +834,12 @@ discard block |
||
834 | 834 | return $depth; |
835 | 835 | } elseif (array_key_exists('children', $element)) { |
836 | 836 | $foundInChildren = $this->getTreeDepth($element['children'], $depth + 1, $logId); |
837 | - if ($foundInChildren !== false) { |
|
837 | + if ($foundInChildren !== FALSE) { |
|
838 | 838 | return $foundInChildren; |
839 | 839 | } |
840 | 840 | } |
841 | 841 | } |
842 | - return false; |
|
842 | + return FALSE; |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | /** |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | } else { |
917 | 917 | $this->logger->error('Invalid file location "' . $location . '" for document loading'); |
918 | 918 | } |
919 | - return false; |
|
919 | + return FALSE; |
|
920 | 920 | } |
921 | 921 | |
922 | 922 | /** |
@@ -963,7 +963,7 @@ discard block |
||
963 | 963 | 'class' => $resArray['class'] |
964 | 964 | ]; |
965 | 965 | } |
966 | - $this->formatsLoaded = true; |
|
966 | + $this->formatsLoaded = TRUE; |
|
967 | 967 | } |
968 | 968 | } |
969 | 969 | |
@@ -1006,11 +1006,11 @@ discard block |
||
1006 | 1006 | * |
1007 | 1007 | * @return bool true on success or false on failure |
1008 | 1008 | */ |
1009 | - public function save($pid = 0, $core = 0, $owner = null) |
|
1009 | + public function save($pid = 0, $core = 0, $owner = NULL) |
|
1010 | 1010 | { |
1011 | 1011 | if (\TYPO3_MODE !== 'BE') { |
1012 | 1012 | $this->logger->error('Saving a document is only allowed in the backend'); |
1013 | - return false; |
|
1013 | + return FALSE; |
|
1014 | 1014 | } |
1015 | 1015 | // Make sure $pid is a non-negative integer. |
1016 | 1016 | $pid = max(intval($pid), 0); |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | $pid = $this->pid; |
1026 | 1026 | } elseif (!$pid) { |
1027 | 1027 | $this->logger->error('Invalid PID ' . $pid . ' for document saving'); |
1028 | - return false; |
|
1028 | + return FALSE; |
|
1029 | 1029 | } |
1030 | 1030 | // Set PID for metadata definitions. |
1031 | 1031 | $this->cPid = $pid; |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | // Check for record identifier. |
1039 | 1039 | if (empty($metadata['record_id'][0])) { |
1040 | 1040 | $this->logger->error('No record identifier found to avoid duplication'); |
1041 | - return false; |
|
1041 | + return FALSE; |
|
1042 | 1042 | } |
1043 | 1043 | // Load plugin configuration. |
1044 | 1044 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | $structure = $resArray['uid']; |
1063 | 1063 | } else { |
1064 | 1064 | $this->logger->error('Could not identify document/structure type "' . $queryBuilder->expr()->literal($metadata['type'][0]) . '"'); |
1065 | - return false; |
|
1065 | + return FALSE; |
|
1066 | 1066 | } |
1067 | 1067 | $metadata['type'][0] = $structure; |
1068 | 1068 | |
@@ -1122,9 +1122,9 @@ discard block |
||
1122 | 1122 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
1123 | 1123 | Helper::addMessage( |
1124 | 1124 | htmlspecialchars(sprintf(Helper::getMessage('flash.newCollection'), $collection, $substUid[$collNewUid])), |
1125 | - Helper::getMessage('flash.attention', true), |
|
1125 | + Helper::getMessage('flash.attention', TRUE), |
|
1126 | 1126 | \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
1127 | - true |
|
1127 | + TRUE |
|
1128 | 1128 | ); |
1129 | 1129 | } |
1130 | 1130 | } |
@@ -1175,9 +1175,9 @@ discard block |
||
1175 | 1175 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
1176 | 1176 | Helper::addMessage( |
1177 | 1177 | htmlspecialchars(sprintf(Helper::getMessage('flash.newLibrary'), $owner, $ownerUid)), |
1178 | - Helper::getMessage('flash.attention', true), |
|
1178 | + Helper::getMessage('flash.attention', TRUE), |
|
1179 | 1179 | \TYPO3\CMS\Core\Messaging\FlashMessage::INFO, |
1180 | - true |
|
1180 | + TRUE |
|
1181 | 1181 | ); |
1182 | 1182 | } |
1183 | 1183 | } |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | 'author' => implode('; ', $metadata['author']), |
1266 | 1266 | 'year' => implode('; ', $metadata['year']), |
1267 | 1267 | 'place' => implode('; ', $metadata['place']), |
1268 | - 'thumbnail' => $this->_getThumbnail(true), |
|
1268 | + 'thumbnail' => $this->_getThumbnail(TRUE), |
|
1269 | 1269 | 'metadata' => serialize($listed), |
1270 | 1270 | 'metadata_sorting' => serialize($sortable), |
1271 | 1271 | 'structure' => $metadata['type'][0], |
@@ -1301,9 +1301,9 @@ discard block |
||
1301 | 1301 | if (!(\TYPO3_REQUESTTYPE & \TYPO3_REQUESTTYPE_CLI)) { |
1302 | 1302 | Helper::addMessage( |
1303 | 1303 | htmlspecialchars(sprintf(Helper::getMessage('flash.documentSaved'), $metadata['title'][0], $this->uid)), |
1304 | - Helper::getMessage('flash.done', true), |
|
1304 | + Helper::getMessage('flash.done', TRUE), |
|
1305 | 1305 | \TYPO3\CMS\Core\Messaging\FlashMessage::OK, |
1306 | - true |
|
1306 | + TRUE |
|
1307 | 1307 | ); |
1308 | 1308 | } |
1309 | 1309 | // Add document to index. |
@@ -1311,7 +1311,7 @@ discard block |
||
1311 | 1311 | return Indexer::add($this, $core); |
1312 | 1312 | } else { |
1313 | 1313 | $this->logger->notice('Invalid UID "' . $core . '" for Solr core'); |
1314 | - return false; |
|
1314 | + return FALSE; |
|
1315 | 1315 | } |
1316 | 1316 | } |
1317 | 1317 | |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | ) { |
1398 | 1398 | $this->prepareMetadataArray($cPid); |
1399 | 1399 | $this->metadataArray[0] = $cPid; |
1400 | - $this->metadataArrayLoaded = true; |
|
1400 | + $this->metadataArrayLoaded = TRUE; |
|
1401 | 1401 | } |
1402 | 1402 | return $this->metadataArray; |
1403 | 1403 | } |
@@ -1506,7 +1506,7 @@ discard block |
||
1506 | 1506 | $parent = self::getInstance($this->parentId, $this->pid); |
1507 | 1507 | $this->rootId = $parent->rootId; |
1508 | 1508 | } |
1509 | - $this->rootIdLoaded = true; |
|
1509 | + $this->rootIdLoaded = TRUE; |
|
1510 | 1510 | } |
1511 | 1511 | return $this->rootId; |
1512 | 1512 | } |
@@ -1535,8 +1535,8 @@ discard block |
||
1535 | 1535 | // Is there no logical structure array yet? |
1536 | 1536 | if (!$this->tableOfContentsLoaded) { |
1537 | 1537 | // Get all logical structures. |
1538 | - $this->getLogicalStructure('', true); |
|
1539 | - $this->tableOfContentsLoaded = true; |
|
1538 | + $this->getLogicalStructure('', TRUE); |
|
1539 | + $this->tableOfContentsLoaded = TRUE; |
|
1540 | 1540 | } |
1541 | 1541 | return $this->tableOfContents; |
1542 | 1542 | } |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | * |
1553 | 1553 | * @return string The document's thumbnail location |
1554 | 1554 | */ |
1555 | - protected abstract function _getThumbnail($forceReload = false); |
|
1555 | + protected abstract function _getThumbnail($forceReload = FALSE); |
|
1556 | 1556 | |
1557 | 1557 | /** |
1558 | 1558 | * This returns the ID of the toplevel logical structure node |
@@ -1634,7 +1634,7 @@ discard block |
||
1634 | 1634 | && $this->load($uid))) { |
1635 | 1635 | // Initialize core METS object. |
1636 | 1636 | $this->init(); |
1637 | - if ($this->getDocument() !== null) { |
|
1637 | + if ($this->getDocument() !== NULL) { |
|
1638 | 1638 | // Cast to string for safety reasons. |
1639 | 1639 | $location = (string) $uid; |
1640 | 1640 | $this->establishRecordId($pid); |
@@ -1692,30 +1692,30 @@ discard block |
||
1692 | 1692 | $this->parentId = $resArray['partof']; |
1693 | 1693 | $this->thumbnail = $resArray['thumbnail']; |
1694 | 1694 | $this->location = $resArray['location']; |
1695 | - $this->thumbnailLoaded = true; |
|
1695 | + $this->thumbnailLoaded = TRUE; |
|
1696 | 1696 | // Load XML file if necessary... |
1697 | 1697 | if ( |
1698 | - $this->getDocument() === null |
|
1698 | + $this->getDocument() === NULL |
|
1699 | 1699 | && $this->load($this->location) |
1700 | 1700 | ) { |
1701 | 1701 | // ...and set some basic properties. |
1702 | 1702 | $this->init(); |
1703 | 1703 | } |
1704 | 1704 | // Do we have a METS / IIIF object now? |
1705 | - if ($this->getDocument() !== null) { |
|
1705 | + if ($this->getDocument() !== NULL) { |
|
1706 | 1706 | // Set new location if necessary. |
1707 | 1707 | if (!empty($location)) { |
1708 | 1708 | $this->location = $location; |
1709 | 1709 | } |
1710 | 1710 | // Document ready! |
1711 | - $this->ready = true; |
|
1711 | + $this->ready = TRUE; |
|
1712 | 1712 | } |
1713 | - } elseif ($this->getDocument() !== null) { |
|
1713 | + } elseif ($this->getDocument() !== NULL) { |
|
1714 | 1714 | // Set location as UID for documents not in database. |
1715 | 1715 | $this->uid = $location; |
1716 | 1716 | $this->location = $location; |
1717 | 1717 | // Document ready! |
1718 | - $this->ready = true; |
|
1718 | + $this->ready = TRUE; |
|
1719 | 1719 | } else { |
1720 | 1720 | $this->logger->error('No document with UID ' . $uid . ' found or document not accessible'); |
1721 | 1721 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * @var bool |
75 | 75 | * @access protected |
76 | 76 | */ |
77 | - protected $dmdSecLoaded = false; |
|
77 | + protected $dmdSecLoaded = FALSE; |
|
78 | 78 | |
79 | 79 | /** |
80 | 80 | * The extension key |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @var bool |
101 | 101 | * @access protected |
102 | 102 | */ |
103 | - protected $fileGrpsLoaded = false; |
|
103 | + protected $fileGrpsLoaded = FALSE; |
|
104 | 104 | |
105 | 105 | /** |
106 | 106 | * This holds the XML file's METS part as \SimpleXMLElement object |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
176 | 176 | IiifHelper::setMaxThumbnailWidth($conf['iiifThumbnailWidth']); |
177 | 177 | $service = IiifHelper::loadIiifResource($fileLocation); |
178 | - if ($service !== null && $service instanceof AbstractImageService) { |
|
178 | + if ($service !== NULL && $service instanceof AbstractImageService) { |
|
179 | 179 | return $service->getImageUrl(); |
180 | 180 | } |
181 | 181 | } elseif ($fileMimeType === 'application/vnd.netfpx') { |
182 | - $baseURL = $fileLocation . (strpos($fileLocation, '?') === false ? '?' : ''); |
|
182 | + $baseURL = $fileLocation . (strpos($fileLocation, '?') === FALSE ? '?' : ''); |
|
183 | 183 | // TODO CVT is an optional IIP server capability; in theory, capabilities should be determined in the object request with '&obj=IIP-server' |
184 | 184 | return $baseURL . '&CVT=jpeg'; |
185 | 185 | } |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * {@inheritDoc} |
227 | 227 | * @see \Kitodo\Dlf\Common\Document::getLogicalStructure() |
228 | 228 | */ |
229 | - public function getLogicalStructure($id, $recursive = false) |
|
229 | + public function getLogicalStructure($id, $recursive = FALSE) |
|
230 | 230 | { |
231 | 231 | $details = []; |
232 | 232 | // Is the requested logical unit already loaded? |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * |
268 | 268 | * @return array Array of the element's id, label, type and physical page indexes/mptr link |
269 | 269 | */ |
270 | - protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = false) |
|
270 | + protected function getLogicalStructureInfo(\SimpleXMLElement $structure, $recursive = FALSE) |
|
271 | 271 | { |
272 | 272 | // Get attributes. |
273 | 273 | foreach ($structure->attributes() as $attribute => $value) { |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | && array_key_exists($details['id'], $this->smLinks['l2p']) |
313 | 313 | ) { |
314 | 314 | // Link logical structure to the first corresponding physical page/track. |
315 | - $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, true)), 1); |
|
315 | + $details['points'] = max(intval(array_search($this->smLinks['l2p'][$details['id']][0], $this->physicalStructure, TRUE)), 1); |
|
316 | 316 | $fileGrpsThumb = GeneralUtility::trimExplode(',', $extConf['fileGrpThumbs']); |
317 | 317 | while ($fileGrpThumb = array_shift($fileGrpsThumb)) { |
318 | 318 | if (!empty($this->physicalStructureInfo[$this->smLinks['l2p'][$details['id']][0]]['files'][$fileGrpThumb])) { |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $details['children'] = []; |
357 | 357 | foreach ($structure->children('http://www.loc.gov/METS/')->div as $child) { |
358 | 358 | // Repeat for all children. |
359 | - $details['children'][] = $this->getLogicalStructureInfo($child, true); |
|
359 | + $details['children'][] = $this->getLogicalStructureInfo($child, TRUE); |
|
360 | 360 | } |
361 | 361 | } |
362 | 362 | return $details; |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | if (!empty($dmdIds)) { |
426 | 426 | // Handle multiple DMDIDs separately. |
427 | 427 | $dmdIds = explode(' ', $dmdIds); |
428 | - $hasSupportedMetadata = false; |
|
428 | + $hasSupportedMetadata = FALSE; |
|
429 | 429 | } else { |
430 | 430 | // There is no dmdSec for this structure node. |
431 | 431 | return []; |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | } |
661 | 661 | } |
662 | 662 | // Extract metadata only from first supported dmdSec. |
663 | - $hasSupportedMetadata = true; |
|
663 | + $hasSupportedMetadata = TRUE; |
|
664 | 664 | break; |
665 | 665 | } |
666 | 666 | if ($hasSupportedMetadata) { |
@@ -726,16 +726,16 @@ discard block |
||
726 | 726 | protected function loadLocation($location) |
727 | 727 | { |
728 | 728 | $fileResource = GeneralUtility::getUrl($location); |
729 | - if ($fileResource !== false) { |
|
729 | + if ($fileResource !== FALSE) { |
|
730 | 730 | $xml = Helper::getXmlFileAsString($fileResource); |
731 | 731 | // Set some basic properties. |
732 | - if ($xml !== false) { |
|
732 | + if ($xml !== FALSE) { |
|
733 | 733 | $this->xml = $xml; |
734 | - return true; |
|
734 | + return TRUE; |
|
735 | 735 | } |
736 | 736 | } |
737 | 737 | $this->logger->error('Could not load XML file from "' . $location . '"'); |
738 | - return false; |
|
738 | + return FALSE; |
|
739 | 739 | } |
740 | 740 | |
741 | 741 | /** |
@@ -783,9 +783,9 @@ discard block |
||
783 | 783 | |
784 | 784 | if ($preloadedDocument instanceof \SimpleXMLElement) { |
785 | 785 | $this->xml = $preloadedDocument; |
786 | - return true; |
|
786 | + return TRUE; |
|
787 | 787 | } |
788 | - return false; |
|
788 | + return FALSE; |
|
789 | 789 | } |
790 | 790 | |
791 | 791 | /** |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | } |
832 | 832 | } |
833 | 833 | } |
834 | - $this->dmdSecLoaded = true; |
|
834 | + $this->dmdSecLoaded = TRUE; |
|
835 | 835 | } |
836 | 836 | return $this->dmdSec; |
837 | 837 | } |
@@ -878,9 +878,9 @@ discard block |
||
878 | 878 | !empty($extConf['fileGrpFulltext']) |
879 | 879 | && array_intersect(GeneralUtility::trimExplode(',', $extConf['fileGrpFulltext']), $this->fileGrps) !== [] |
880 | 880 | ) { |
881 | - $this->hasFulltext = true; |
|
881 | + $this->hasFulltext = TRUE; |
|
882 | 882 | } |
883 | - $this->fileGrpsLoaded = true; |
|
883 | + $this->fileGrpsLoaded = TRUE; |
|
884 | 884 | } |
885 | 885 | return $this->fileGrps; |
886 | 886 | } |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | $this->physicalStructure = array_merge($physSeq, $elements); |
970 | 970 | } |
971 | 971 | } |
972 | - $this->physicalStructureLoaded = true; |
|
972 | + $this->physicalStructureLoaded = TRUE; |
|
973 | 973 | } |
974 | 974 | return $this->physicalStructure; |
975 | 975 | } |
@@ -988,7 +988,7 @@ discard block |
||
988 | 988 | $this->smLinks['p2l'][(string) $smLink->attributes('http://www.w3.org/1999/xlink')->to][] = (string) $smLink->attributes('http://www.w3.org/1999/xlink')->from; |
989 | 989 | } |
990 | 990 | } |
991 | - $this->smLinksLoaded = true; |
|
991 | + $this->smLinksLoaded = TRUE; |
|
992 | 992 | } |
993 | 993 | return $this->smLinks; |
994 | 994 | } |
@@ -997,7 +997,7 @@ discard block |
||
997 | 997 | * {@inheritDoc} |
998 | 998 | * @see \Kitodo\Dlf\Common\Document::_getThumbnail() |
999 | 999 | */ |
1000 | - protected function _getThumbnail($forceReload = false) |
|
1000 | + protected function _getThumbnail($forceReload = FALSE) |
|
1001 | 1001 | { |
1002 | 1002 | if ( |
1003 | 1003 | !$this->thumbnailLoaded |
@@ -1007,14 +1007,14 @@ discard block |
||
1007 | 1007 | $cPid = ($this->cPid ? $this->cPid : $this->pid); |
1008 | 1008 | if (!$cPid) { |
1009 | 1009 | $this->logger->error('Invalid PID ' . $cPid . ' for structure definitions'); |
1010 | - $this->thumbnailLoaded = true; |
|
1010 | + $this->thumbnailLoaded = TRUE; |
|
1011 | 1011 | return $this->thumbnail; |
1012 | 1012 | } |
1013 | 1013 | // Load extension configuration. |
1014 | 1014 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
1015 | 1015 | if (empty($extConf['fileGrpThumbs'])) { |
1016 | 1016 | $this->logger->warning('No fileGrp for thumbnails specified'); |
1017 | - $this->thumbnailLoaded = true; |
|
1017 | + $this->thumbnailLoaded = TRUE; |
|
1018 | 1018 | return $this->thumbnail; |
1019 | 1019 | } |
1020 | 1020 | $strctId = $this->_getToplevelId(); |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | } else { |
1069 | 1069 | $this->logger->error('No structure of type "' . $metadata['type'][0] . '" found in database'); |
1070 | 1070 | } |
1071 | - $this->thumbnailLoaded = true; |
|
1071 | + $this->thumbnailLoaded = TRUE; |
|
1072 | 1072 | } |
1073 | 1073 | return $this->thumbnail; |
1074 | 1074 | } |
@@ -1127,8 +1127,8 @@ discard block |
||
1127 | 1127 | public function __toString() |
1128 | 1128 | { |
1129 | 1129 | $xml = new \DOMDocument('1.0', 'utf-8'); |
1130 | - $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), true)); |
|
1131 | - $xml->formatOutput = true; |
|
1130 | + $xml->appendChild($xml->importNode(dom_import_simplexml($this->mets), TRUE)); |
|
1131 | + $xml->formatOutput = TRUE; |
|
1132 | 1132 | return $xml->saveXML(); |
1133 | 1133 | } |
1134 | 1134 | |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | public function __wakeup() |
1144 | 1144 | { |
1145 | 1145 | $xml = Helper::getXmlFileAsString($this->asXML); |
1146 | - if ($xml !== false) { |
|
1146 | + if ($xml !== FALSE) { |
|
1147 | 1147 | $this->asXML = ''; |
1148 | 1148 | $this->xml = $xml; |
1149 | 1149 | // Rebuild the unserializable properties. |