@@ -39,8 +39,7 @@ |
||
| 39 | 39 | * |
| 40 | 40 | * @access public |
| 41 | 41 | */ |
| 42 | -class MetadataWrapVariableViewHelper extends AbstractViewHelper |
|
| 43 | -{ |
|
| 42 | +class MetadataWrapVariableViewHelper extends AbstractViewHelper { |
|
| 44 | 43 | /** |
| 45 | 44 | * @access public |
| 46 | 45 | * |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | public function initializeArguments(): void |
| 50 | 50 | { |
| 51 | - $this->registerArgument('name', 'string', 'Name of variable to create', true); |
|
| 51 | + $this->registerArgument('name', 'string', 'Name of variable to create', TRUE); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -25,8 +25,7 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class JsFooterViewHelper extends AbstractViewHelper |
|
| 29 | -{ |
|
| 28 | +class JsFooterViewHelper extends AbstractViewHelper { |
|
| 30 | 29 | /** |
| 31 | 30 | * Initialize arguments. |
| 32 | 31 | * |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | public function initializeArguments(): void |
| 36 | 36 | { |
| 37 | 37 | parent::initializeArguments(); |
| 38 | - $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', true); |
|
| 38 | + $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', TRUE); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -15,8 +15,7 @@ |
||
| 15 | 15 | use Kitodo\Dlf\Common\Solr\SolrSearch; |
| 16 | 16 | use TYPO3\CMS\Core\Pagination\AbstractPaginator; |
| 17 | 17 | |
| 18 | -class SolrPaginator extends AbstractPaginator |
|
| 19 | -{ |
|
| 18 | +class SolrPaginator extends AbstractPaginator { |
|
| 20 | 19 | /** |
| 21 | 20 | * @var SolrSearch |
| 22 | 21 | */ |
@@ -27,8 +27,7 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @access public |
| 29 | 29 | */ |
| 30 | -class KitodoFlashMessageRenderer implements FlashMessageRendererInterface |
|
| 31 | -{ |
|
| 30 | +class KitodoFlashMessageRenderer implements FlashMessageRendererInterface { |
|
| 32 | 31 | /** |
| 33 | 32 | * @var array The message severity class names |
| 34 | 33 | */ |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * |
| 26 | 26 | * @access public |
| 27 | 27 | */ |
| 28 | -class IiifUrlReader implements UrlReaderInterface |
|
| 29 | -{ |
|
| 28 | +class IiifUrlReader implements UrlReaderInterface { |
|
| 30 | 29 | /** |
| 31 | 30 | * @access protected |
| 32 | 31 | * @var IiifUrlReader Singleton instance of the class |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | /** |
| 37 | 36 | * @see UrlReaderInterface::getContent() |
| 38 | 37 | */ |
| 39 | - public function getContent($url) |
|
| 40 | - { |
|
| 38 | + public function getContent($url) { |
|
| 41 | 39 | $fileContents = GeneralUtility::getUrl($url); |
| 42 | 40 | if ($fileContents !== false) { |
| 43 | 41 | return $fileContents; |
@@ -653,16 +653,16 @@ discard block |
||
| 653 | 653 | if ($resArray['format'] > 0 && !empty($resArray['xpath_sorting'])) { |
| 654 | 654 | $values = $iiifResource->jsonPath($resArray['xpath_sorting']); |
| 655 | 655 | if (is_string($values)) { |
| 656 | - $metadata[$resArray['index_name'] . '_sorting'][0] = [trim((string) $values)]; |
|
| 656 | + $metadata[$resArray['index_name'].'_sorting'][0] = [trim((string) $values)]; |
|
| 657 | 657 | } elseif ($values instanceof JSONPath && is_array($values->data()) && count($values->data()) > 1) { |
| 658 | 658 | $metadata[$resArray['index_name']] = []; |
| 659 | 659 | foreach ($values->data() as $value) { |
| 660 | - $metadata[$resArray['index_name'] . '_sorting'][0] = trim((string) $value); |
|
| 660 | + $metadata[$resArray['index_name'].'_sorting'][0] = trim((string) $value); |
|
| 661 | 661 | } |
| 662 | 662 | } |
| 663 | 663 | } |
| 664 | - if (empty($metadata[$resArray['index_name'] . '_sorting'][0])) { |
|
| 665 | - $metadata[$resArray['index_name'] . '_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 664 | + if (empty($metadata[$resArray['index_name'].'_sorting'][0])) { |
|
| 665 | + $metadata[$resArray['index_name'].'_sorting'][0] = $metadata[$resArray['index_name']][0]; |
|
| 666 | 666 | } |
| 667 | 667 | } |
| 668 | 668 | } |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | } else { |
| 775 | - $this->logger->warning('Invalid structure resource @id "' . $id . '"'); |
|
| 775 | + $this->logger->warning('Invalid structure resource @id "'.$id.'"'); |
|
| 776 | 776 | return $rawText; |
| 777 | 777 | } |
| 778 | 778 | $this->rawTextArray[$id] = $rawText; |
@@ -817,7 +817,7 @@ discard block |
||
| 817 | 817 | return true; |
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | - $this->logger->error('Could not load IIIF manifest from "' . $location . '"'); |
|
| 820 | + $this->logger->error('Could not load IIIF manifest from "'.$location.'"'); |
|
| 821 | 821 | return false; |
| 822 | 822 | } |
| 823 | 823 | |
@@ -75,8 +75,7 @@ discard block |
||
| 75 | 75 | * @property array $mimeTypes this holds the mime types of linked resources in the manifest (extracted during parsing) for later us |
| 76 | 76 | * |
| 77 | 77 | */ |
| 78 | -final class IiifManifest extends AbstractDocument |
|
| 79 | -{ |
|
| 78 | +final class IiifManifest extends AbstractDocument { |
|
| 80 | 79 | /** |
| 81 | 80 | * @access protected |
| 82 | 81 | * @var string This holds the manifest file as string for serialization purposes |
@@ -229,8 +228,7 @@ discard block |
||
| 229 | 228 | * |
| 230 | 229 | * @return array|string |
| 231 | 230 | */ |
| 232 | - protected function getUseGroups(string $use) |
|
| 233 | - { |
|
| 231 | + protected function getUseGroups(string $use) { |
|
| 234 | 232 | if (!$this->useGrpsLoaded) { |
| 235 | 233 | // Get configured USE attributes. |
| 236 | 234 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'files'); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @access protected |
| 102 | 102 | * @var bool Document has already been analyzed if it contains fulltext for the Solr index |
| 103 | 103 | */ |
| 104 | - protected bool $hasFulltextSet = false; |
|
| 104 | + protected bool $hasFulltextSet = FALSE; |
|
| 105 | 105 | |
| 106 | 106 | /** |
| 107 | 107 | * @access protected |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | protected function establishRecordId(int $pid): void |
| 122 | 122 | { |
| 123 | - if ($this->iiif !== null) { |
|
| 123 | + if ($this->iiif !== NULL) { |
|
| 124 | 124 | /* |
| 125 | 125 | * FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss |
| 126 | 126 | * if the plugin that actually loads the manifest allows content from other pages. |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @var bool |
| 208 | 208 | * @access protected |
| 209 | 209 | */ |
| 210 | - protected bool $useGrpsLoaded = false; |
|
| 210 | + protected bool $useGrpsLoaded = FALSE; |
|
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * Holds the configured useGrps as array. |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | if (!empty($extConf['fileGrpAudio'])) { |
| 250 | 250 | $this->useGrps['fileGrpAudio'] = GeneralUtility::trimExplode(',', $extConf['fileGrpAudio']); |
| 251 | 251 | } |
| 252 | - $this->useGrpsLoaded = true; |
|
| 252 | + $this->useGrpsLoaded = TRUE; |
|
| 253 | 253 | } |
| 254 | 254 | return array_key_exists($use, $this->useGrps) ? $this->useGrps[$use] : []; |
| 255 | 255 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | { |
| 262 | 262 | // Is there no physical structure array yet? |
| 263 | 263 | if (!$this->physicalStructureLoaded) { |
| 264 | - if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) { |
|
| 264 | + if ($this->iiif == NULL || !($this->iiif instanceof ManifestInterface)) { |
|
| 265 | 265 | return []; |
| 266 | 266 | } |
| 267 | 267 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $this->physicalStructureInfo[$iiifId]['label'] = $this->iiif->getLabelForDisplay(); |
| 272 | 272 | $this->physicalStructureInfo[$iiifId]['orderlabel'] = $this->iiif->getLabelForDisplay(); |
| 273 | 273 | $this->physicalStructureInfo[$iiifId]['type'] = 'physSequence'; |
| 274 | - $this->physicalStructureInfo[$iiifId]['contentIds'] = null; |
|
| 274 | + $this->physicalStructureInfo[$iiifId]['contentIds'] = NULL; |
|
| 275 | 275 | |
| 276 | 276 | $this->setFileUseDownload($iiifId, $this->iiif); |
| 277 | 277 | $this->setFileUseFulltext($iiifId, $this->iiif); |
@@ -296,20 +296,20 @@ discard block |
||
| 296 | 296 | // populate structural metadata info |
| 297 | 297 | $elements[$canvasOrder] = $canvas->getId(); |
| 298 | 298 | $this->physicalStructureInfo[$elements[$canvasOrder]]['id'] = $canvas->getId(); |
| 299 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = null; |
|
| 299 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['dmdId'] = NULL; |
|
| 300 | 300 | $this->physicalStructureInfo[$elements[$canvasOrder]]['label'] = $canvas->getLabelForDisplay(); |
| 301 | 301 | $this->physicalStructureInfo[$elements[$canvasOrder]]['orderlabel'] = $canvas->getLabelForDisplay(); |
| 302 | 302 | // assume that a canvas always represents a page |
| 303 | 303 | $this->physicalStructureInfo[$elements[$canvasOrder]]['type'] = 'page'; |
| 304 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = null; |
|
| 305 | - $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = null; |
|
| 304 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['contentIds'] = NULL; |
|
| 305 | + $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = NULL; |
|
| 306 | 306 | if (!empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
| 307 | 307 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'] = []; |
| 308 | 308 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 309 | 309 | $this->physicalStructureInfo[$elements[$canvasOrder]]['annotationContainers'][] = $annotationContainer->getId(); |
| 310 | 310 | if ($extConf['indexAnnotations']) { |
| 311 | - $this->hasFulltext = true; |
|
| 312 | - $this->hasFulltextSet = true; |
|
| 311 | + $this->hasFulltext = TRUE; |
|
| 312 | + $this->hasFulltextSet = TRUE; |
|
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | 315 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if (!empty($fileUses)) { |
| 320 | 320 | $image = $canvas->getImageAnnotations()[0]; |
| 321 | 321 | foreach ($fileUses as $fileUse) { |
| 322 | - if ($image->getBody() !== null && $image->getBody() instanceof ContentResourceInterface) { |
|
| 322 | + if ($image->getBody() !== NULL && $image->getBody() instanceof ContentResourceInterface) { |
|
| 323 | 323 | $this->physicalStructureInfo[$elements[$canvasOrder]]['files'][$fileUse] = $image->getBody()->getId(); |
| 324 | 324 | } |
| 325 | 325 | } |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | array_unshift($elements, $iiifId); |
| 336 | 336 | $this->physicalStructure = $elements; |
| 337 | 337 | } |
| 338 | - $this->physicalStructureLoaded = true; |
|
| 338 | + $this->physicalStructureLoaded = TRUE; |
|
| 339 | 339 | } |
| 340 | 340 | return $this->physicalStructure; |
| 341 | 341 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | $this->fileInfos[$id]['mimeType'] = $this->getFileMimeType($id); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - return $this->fileInfos[$id] ?? null; |
|
| 369 | + return $this->fileInfos[$id] ?? NULL; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | /** |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function getFileLocation(string $id): string |
| 376 | 376 | { |
| 377 | - if ($id == null) { |
|
| 377 | + if ($id == NULL) { |
|
| 378 | 378 | return ''; |
| 379 | 379 | } |
| 380 | 380 | $resource = $this->iiif->getContainedResourceById($id); |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | if ($resource instanceof CanvasInterface) { |
| 383 | 383 | // TODO: Cannot call method getSingleService() on array<Ubl\Iiif\Presentation\Common\Model\Resources\AnnotationInterface>. |
| 384 | 384 | // @phpstan-ignore-next-line |
| 385 | - return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != null) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
| 385 | + return (!empty($resource->getImageAnnotations()) && $resource->getImageAnnotations()->getSingleService() != NULL) ? $resource->getImageAnnotations()[0]->getSingleService()->getId() : $id; |
|
| 386 | 386 | } elseif ($resource instanceof ContentResourceInterface) { |
| 387 | 387 | return $resource->getSingleService() instanceof Service ? $resource->getSingleService()->getId() : $id; |
| 388 | 388 | } elseif ($resource instanceof AbstractImageService) { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | } elseif ($fileResource instanceof AnnotationInterface) { |
| 406 | 406 | $format = "application/vnd.kitodo.iiif"; |
| 407 | 407 | } elseif ($fileResource instanceof ContentResourceInterface) { |
| 408 | - if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == null || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
| 408 | + if ($fileResource->isText() || $fileResource->isImage() && ($fileResource->getSingleService() == NULL || !($fileResource->getSingleService() instanceof AbstractImageService))) { |
|
| 409 | 409 | // Support static images without an image service |
| 410 | 410 | return $fileResource->getFormat(); |
| 411 | 411 | } |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | /** |
| 423 | 423 | * @see AbstractDocument::getLogicalStructure() |
| 424 | 424 | */ |
| 425 | - public function getLogicalStructure(string $id, bool $recursive = false): array |
|
| 425 | + public function getLogicalStructure(string $id, bool $recursive = FALSE): array |
|
| 426 | 426 | { |
| 427 | 427 | $details = []; |
| 428 | 428 | if (!$recursive && !empty($this->logicalUnits[$id])) { |
@@ -441,8 +441,8 @@ discard block |
||
| 441 | 441 | // cache the ranges - they might occur multiple times in the structures "tree" - with full data as well as referenced as id |
| 442 | 442 | $processedStructures = []; |
| 443 | 443 | foreach ($logUnits as $logUnit) { |
| 444 | - if (array_search($logUnit->getId(), $processedStructures) == false) { |
|
| 445 | - $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, true, $processedStructures); |
|
| 444 | + if (array_search($logUnit->getId(), $processedStructures) == FALSE) { |
|
| 445 | + $this->tableOfContents[] = $this->getLogicalStructureInfo($logUnit, TRUE, $processedStructures); |
|
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | * |
| 462 | 462 | * @return array Logical structure array |
| 463 | 463 | */ |
| 464 | - protected function getLogicalStructureInfo(IiifResourceInterface $resource, bool $recursive = false, array &$processedStructures = []): array |
|
| 464 | + protected function getLogicalStructureInfo(IiifResourceInterface $resource, bool $recursive = FALSE, array &$processedStructures = []): array |
|
| 465 | 465 | { |
| 466 | 466 | $details = []; |
| 467 | 467 | $details['id'] = $resource->getId(); |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | if (isset($startCanvas)) { |
| 492 | 492 | $details['pagination'] = $startCanvas->getLabel(); |
| 493 | 493 | $startCanvasIndex = array_search($startCanvas, $this->iiif->getDefaultCanvases()); |
| 494 | - if ($startCanvasIndex !== false) { |
|
| 494 | + if ($startCanvasIndex !== FALSE) { |
|
| 495 | 495 | $details['points'] = $startCanvasIndex + 1; |
| 496 | 496 | } |
| 497 | 497 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | if ($recursive) { |
| 506 | 506 | $processedStructures[] = $resource->getId(); |
| 507 | 507 | $details['children'] = []; |
| 508 | - if ($resource instanceof ManifestInterface && $resource->getRootRanges() != null) { |
|
| 508 | + if ($resource instanceof ManifestInterface && $resource->getRootRanges() != NULL) { |
|
| 509 | 509 | $rangesToAdd = []; |
| 510 | 510 | $rootRanges = []; |
| 511 | 511 | if (count($this->iiif->getRootRanges()) == 1 && $this->iiif->getRootRanges()[0]->isTopRange()) { |
@@ -517,15 +517,15 @@ discard block |
||
| 517 | 517 | $rootRanges[] = $range; |
| 518 | 518 | } |
| 519 | 519 | foreach ($rootRanges as $range) { |
| 520 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
| 521 | - $details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures); |
|
| 520 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
| 521 | + $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
|
| 522 | 522 | } |
| 523 | 523 | } |
| 524 | 524 | } elseif ($resource instanceof RangeInterface) { |
| 525 | 525 | if (!empty($resource->getAllRanges())) { |
| 526 | 526 | foreach ($resource->getAllRanges() as $range) { |
| 527 | - if ((array_search($range->getId(), $processedStructures) == false)) { |
|
| 528 | - $details['children'][] = $this->getLogicalStructureInfo($range, true, $processedStructures); |
|
| 527 | + if ((array_search($range->getId(), $processedStructures) == FALSE)) { |
|
| 528 | + $details['children'][] = $this->getLogicalStructureInfo($range, TRUE, $processedStructures); |
|
| 529 | 529 | } |
| 530 | 530 | } |
| 531 | 531 | } |
@@ -549,14 +549,14 @@ discard block |
||
| 549 | 549 | * |
| 550 | 550 | * @todo This method is still in experimental; the method signature may change. |
| 551 | 551 | */ |
| 552 | - public function getManifestMetadata(string $id, bool $withDescription = true, bool $withRights = true, bool $withRelated = true): array |
|
| 552 | + public function getManifestMetadata(string $id, bool $withDescription = TRUE, bool $withRights = TRUE, bool $withRelated = TRUE): array |
|
| 553 | 553 | { |
| 554 | 554 | if (!empty($this->originalMetadataArray[$id])) { |
| 555 | 555 | return $this->originalMetadataArray[$id]; |
| 556 | 556 | } |
| 557 | 557 | $iiifResource = $this->iiif->getContainedResourceById($id); |
| 558 | 558 | $result = []; |
| 559 | - if ($iiifResource != null) { |
|
| 559 | + if ($iiifResource != NULL) { |
|
| 560 | 560 | if (!empty($iiifResource->getLabel())) { |
| 561 | 561 | $result['label'] = $iiifResource->getLabel(); |
| 562 | 562 | } |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | $this->smLinkRangeCanvasesRecursively($range); |
| 690 | 690 | } |
| 691 | 691 | } |
| 692 | - $this->smLinksLoaded = true; |
|
| 692 | + $this->smLinksLoaded = TRUE; |
|
| 693 | 693 | } |
| 694 | 694 | return $this->smLinks; |
| 695 | 695 | } |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | protected function loadLocation(string $location): bool |
| 807 | 807 | { |
| 808 | 808 | $fileResource = GeneralUtility::getUrl($location); |
| 809 | - if ($fileResource !== false) { |
|
| 809 | + if ($fileResource !== FALSE) { |
|
| 810 | 810 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
| 811 | 811 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
| 812 | 812 | IiifHelper::setMaxThumbnailHeight($conf['thumbnailHeight']); |
@@ -814,11 +814,11 @@ discard block |
||
| 814 | 814 | $resource = IiifHelper::loadIiifResource($fileResource); |
| 815 | 815 | if ($resource instanceof ManifestInterface) { |
| 816 | 816 | $this->iiif = $resource; |
| 817 | - return true; |
|
| 817 | + return TRUE; |
|
| 818 | 818 | } |
| 819 | 819 | } |
| 820 | 820 | $this->logger->error('Could not load IIIF manifest from "' . $location . '"'); |
| 821 | - return false; |
|
| 821 | + return FALSE; |
|
| 822 | 822 | } |
| 823 | 823 | |
| 824 | 824 | /** |
@@ -837,9 +837,9 @@ discard block |
||
| 837 | 837 | { |
| 838 | 838 | if ($preloadedDocument instanceof ManifestInterface) { |
| 839 | 839 | $this->iiif = $preloadedDocument; |
| 840 | - return true; |
|
| 840 | + return TRUE; |
|
| 841 | 841 | } |
| 842 | - return false; |
|
| 842 | + return FALSE; |
|
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | /** |
@@ -861,23 +861,23 @@ discard block |
||
| 861 | 861 | !empty($canvas->getSeeAlsoUrlsForFormat("application/alto+xml")) || |
| 862 | 862 | !empty($canvas->getSeeAlsoUrlsForProfile("http://www.loc.gov/standards/alto/")) |
| 863 | 863 | ) { |
| 864 | - $this->hasFulltextSet = true; |
|
| 865 | - $this->hasFulltext = true; |
|
| 864 | + $this->hasFulltextSet = TRUE; |
|
| 865 | + $this->hasFulltext = TRUE; |
|
| 866 | 866 | return; |
| 867 | 867 | } |
| 868 | 868 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'iiif'); |
| 869 | 869 | if ($extConf['indexAnnotations'] == 1 && !empty($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING))) { |
| 870 | 870 | foreach ($canvas->getPossibleTextAnnotationContainers(Motivation::PAINTING) as $annotationContainer) { |
| 871 | 871 | $textAnnotations = $annotationContainer->getTextAnnotations(Motivation::PAINTING); |
| 872 | - if ($textAnnotations != null) { |
|
| 872 | + if ($textAnnotations != NULL) { |
|
| 873 | 873 | foreach ($textAnnotations as $annotation) { |
| 874 | 874 | if ( |
| 875 | - $annotation->getBody() != null && |
|
| 875 | + $annotation->getBody() != NULL && |
|
| 876 | 876 | $annotation->getBody()->getFormat() == "text/plain" && |
| 877 | - $annotation->getBody()->getChars() != null |
|
| 877 | + $annotation->getBody()->getChars() != NULL |
|
| 878 | 878 | ) { |
| 879 | - $this->hasFulltextSet = true; |
|
| 880 | - $this->hasFulltext = true; |
|
| 879 | + $this->hasFulltextSet = TRUE; |
|
| 880 | + $this->hasFulltext = TRUE; |
|
| 881 | 881 | return; |
| 882 | 882 | } |
| 883 | 883 | } |
@@ -885,14 +885,14 @@ discard block |
||
| 885 | 885 | } |
| 886 | 886 | } |
| 887 | 887 | } |
| 888 | - $this->hasFulltextSet = true; |
|
| 888 | + $this->hasFulltextSet = TRUE; |
|
| 889 | 889 | } |
| 890 | 890 | } |
| 891 | 891 | |
| 892 | 892 | /** |
| 893 | 893 | * @see AbstractDocument::magicGetThumbnail() |
| 894 | 894 | */ |
| 895 | - protected function magicGetThumbnail(bool $forceReload = false): string |
|
| 895 | + protected function magicGetThumbnail(bool $forceReload = FALSE): string |
|
| 896 | 896 | { |
| 897 | 897 | return $this->iiif->getThumbnailUrl(); |
| 898 | 898 | } |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | foreach ($annotationContainer->getTextAnnotations(Motivation::PAINTING) as $annotation) { |
| 930 | 930 | if ( |
| 931 | 931 | $annotation->getTargetResourceId() == $iiifId && |
| 932 | - $annotation->getBody() != null && $annotation->getBody()->getChars() != null |
|
| 932 | + $annotation->getBody() != NULL && $annotation->getBody()->getChars() != NULL |
|
| 933 | 933 | ) { |
| 934 | 934 | $annotationTexts[] = $annotation->getBody()->getChars(); |
| 935 | 935 | } |
@@ -977,13 +977,13 @@ discard block |
||
| 977 | 977 | if (!empty($fileUseFulltext)) { |
| 978 | 978 | $alto = $iiif->getSeeAlsoUrlsForFormat('application/alto+xml'); |
| 979 | 979 | if (empty($alto)) { |
| 980 | - $alto = $iiif->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', true); |
|
| 980 | + $alto = $iiif->getSeeAlsoUrlsForProfile('http://www.loc.gov/standards/alto/', TRUE); |
|
| 981 | 981 | } |
| 982 | 982 | if (!empty($alto)) { |
| 983 | 983 | $this->mimeTypes[$alto[0]] = 'application/alto+xml'; |
| 984 | 984 | $this->physicalStructureInfo[$iiifId]['files'][$fileUseFulltext[0]] = $alto[0]; |
| 985 | - $this->hasFulltext = true; |
|
| 986 | - $this->hasFulltextSet = true; |
|
| 985 | + $this->hasFulltext = TRUE; |
|
| 986 | + $this->hasFulltextSet = TRUE; |
|
| 987 | 987 | } |
| 988 | 988 | } |
| 989 | 989 | } |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Page |
|
| 24 | -{ |
|
| 23 | +class Page { |
|
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * @access private |
@@ -57,8 +56,7 @@ discard block |
||
| 57 | 56 | * |
| 58 | 57 | * @return void |
| 59 | 58 | */ |
| 60 | - public function __construct(int $id, array $page) |
|
| 61 | - { |
|
| 59 | + public function __construct(int $id, array $page) { |
|
| 62 | 60 | $this->id = $id; |
| 63 | 61 | $this->name = $page['id']; |
| 64 | 62 | $this->width = $page['width']; |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | $this->xEndPosition = $highlight['lrx']; |
| 88 | 88 | $this->yBeginPosition = $highlight['uly']; |
| 89 | 89 | $this->yEndPosition = $highlight['lry']; |
| 90 | - $this->id = $this->xBeginPosition . '_' . $this->yBeginPosition; |
|
| 90 | + $this->id = $this->xBeginPosition.'_'.$this->yBeginPosition; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /** |
@@ -20,8 +20,7 @@ discard block |
||
| 20 | 20 | * |
| 21 | 21 | * @access public |
| 22 | 22 | */ |
| 23 | -class Highlight |
|
| 24 | -{ |
|
| 23 | +class Highlight { |
|
| 25 | 24 | |
| 26 | 25 | /** |
| 27 | 26 | * @access private |
@@ -62,8 +61,7 @@ discard block |
||
| 62 | 61 | * |
| 63 | 62 | * @return void |
| 64 | 63 | */ |
| 65 | - public function __construct(array $highlight) |
|
| 66 | - { |
|
| 64 | + public function __construct(array $highlight) { |
|
| 67 | 65 | // there is also possibility to access parentRegionIdx |
| 68 | 66 | // $this->parentRegionId = $highlight['parentRegionIdx']; |
| 69 | 67 | $this->xBeginPosition = $highlight['ulx']; |
@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | * |
| 23 | 23 | * @access public |
| 24 | 24 | */ |
| 25 | -class ResultDocument |
|
| 26 | -{ |
|
| 25 | +class ResultDocument { |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * @access private |
@@ -108,8 +107,7 @@ discard block |
||
| 108 | 107 | * |
| 109 | 108 | * @return void |
| 110 | 109 | */ |
| 111 | - public function __construct(Document $record, array $highlighting, array $fields) |
|
| 112 | - { |
|
| 110 | + public function __construct(Document $record, array $highlighting, array $fields) { |
|
| 113 | 111 | $this->id = $record[$fields['id']]; |
| 114 | 112 | $this->uid = $record[$fields['uid']]; |
| 115 | 113 | $this->page = $record[$fields['page']]; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * @access private |
| 66 | 66 | * @var bool It's a toplevel element? |
| 67 | 67 | */ |
| 68 | - private bool $toplevel = false; |
|
| 68 | + private bool $toplevel = FALSE; |
|
| 69 | 69 | |
| 70 | 70 | /** |
| 71 | 71 | * @access private |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $this->page = $record[$fields['page']]; |
| 116 | 116 | $this->thumbnail = $record[$fields['thumbnail']]; |
| 117 | 117 | $this->title = $record[$fields['title']]; |
| 118 | - $this->toplevel = $record[$fields['toplevel']] ?? false; |
|
| 118 | + $this->toplevel = $record[$fields['toplevel']] ?? FALSE; |
|
| 119 | 119 | $this->type = $record[$fields['type']]; |
| 120 | 120 | |
| 121 | 121 | if (!empty($highlighting[$this->id])) { |