@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class TeiHeader implements MetadataInterface |
|
26 | -{ |
|
25 | +class TeiHeader implements MetadataInterface { |
|
27 | 26 | /** |
28 | 27 | * This extracts the essential TEIHDR metadata from XML |
29 | 28 | * |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * |
36 | 36 | * @return void |
37 | 37 | */ |
38 | - public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = false): void |
|
38 | + public function extractMetadata(\SimpleXMLElement $xml, array &$metadata, bool $useExternalApis = FALSE): void |
|
39 | 39 | { |
40 | 40 | $xml->registerXPathNamespace('teihdr', 'http://www.tei-c.org/ns/1.0'); |
41 | 41 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function __construct(string $viaf, RequestFactory $requestFactory) |
66 | 66 | { |
67 | 67 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | - $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
|
68 | + $this->viafUrl = 'http://viaf.org/viaf/'.$viaf; |
|
69 | 69 | $this->requestFactory = $requestFactory; |
70 | 70 | } |
71 | 71 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | try { |
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
98 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
@@ -110,6 +110,6 @@ discard block |
||
110 | 110 | **/ |
111 | 111 | private function getApiEndpoint(): string |
112 | 112 | { |
113 | - return $this->viafUrl . '/' . $this->endpoint; |
|
113 | + return $this->viafUrl.'/'.$this->endpoint; |
|
114 | 114 | } |
115 | 115 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Client |
|
30 | -{ |
|
29 | +class Client { |
|
31 | 30 | /** |
32 | 31 | * @access protected |
33 | 32 | * @var Logger This holds the logger |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | * |
63 | 62 | * @return void |
64 | 63 | **/ |
65 | - public function __construct(string $viaf, RequestFactory $requestFactory) |
|
66 | - { |
|
64 | + public function __construct(string $viaf, RequestFactory $requestFactory) { |
|
67 | 65 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
68 | 66 | $this->viafUrl = 'http://viaf.org/viaf/' . $viaf; |
69 | 67 | $this->requestFactory = $requestFactory; |
@@ -89,8 +87,7 @@ discard block |
||
89 | 87 | * |
90 | 88 | * @return object|bool |
91 | 89 | **/ |
92 | - public function getData() |
|
93 | - { |
|
90 | + public function getData() { |
|
94 | 91 | $url = $this->getApiEndpoint(); |
95 | 92 | try { |
96 | 93 | $response = $this->requestFactory->request($url); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | 98 | $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
102 | 102 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Profile |
|
30 | -{ |
|
29 | +class Profile { |
|
31 | 30 | /** |
32 | 31 | * @access private |
33 | 32 | * @var Logger This holds the logger |
@@ -55,8 +54,7 @@ discard block |
||
55 | 54 | * |
56 | 55 | * @return void |
57 | 56 | **/ |
58 | - public function __construct(string $viaf) |
|
59 | - { |
|
57 | + public function __construct(string $viaf) { |
|
60 | 58 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
61 | 59 | $this->client = new Client($viaf, GeneralUtility::makeInstance(RequestFactory::class)); |
62 | 60 | } |
@@ -68,8 +66,7 @@ discard block |
||
68 | 66 | * |
69 | 67 | * @return array|false |
70 | 68 | **/ |
71 | - public function getData() |
|
72 | - { |
|
69 | + public function getData() { |
|
73 | 70 | $this->getRaw(); |
74 | 71 | if ($this->raw !== false && !empty($this->raw)) { |
75 | 72 | $data = []; |
@@ -89,8 +86,7 @@ discard block |
||
89 | 86 | * |
90 | 87 | * @return string|false |
91 | 88 | **/ |
92 | - public function getAddress() |
|
93 | - { |
|
89 | + public function getAddress() { |
|
94 | 90 | $this->getRaw(); |
95 | 91 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
96 | 92 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
@@ -107,8 +103,7 @@ discard block |
||
107 | 103 | * |
108 | 104 | * @return string|false |
109 | 105 | **/ |
110 | - public function getFullName() |
|
111 | - { |
|
106 | + public function getFullName() { |
|
112 | 107 | $this->getRaw(); |
113 | 108 | if ($this->raw !== false && !empty($this->raw->asXML())) { |
114 | 109 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @access private |
45 | 45 | * @var \SimpleXmlElement|false The raw VIAF profile or false if not found |
46 | 46 | **/ |
47 | - private $raw = false; |
|
47 | + private $raw = FALSE; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Constructs client instance |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | public function getData() |
72 | 72 | { |
73 | 73 | $this->getRaw(); |
74 | - if ($this->raw !== false && !empty($this->raw)) { |
|
74 | + if ($this->raw !== FALSE && !empty($this->raw)) { |
|
75 | 75 | $data = []; |
76 | 76 | $data['address'] = $this->getAddress(); |
77 | 77 | $data['fullName'] = $this->getFullName(); |
78 | 78 | return $data; |
79 | 79 | } else { |
80 | 80 | $this->logger->warning('No data found for given VIAF URL'); |
81 | - return false; |
|
81 | + return FALSE; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | public function getAddress() |
93 | 93 | { |
94 | 94 | $this->getRaw(); |
95 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
95 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
96 | 96 | return (string) $this->raw->xpath('./ns1:nationalityOfEntity/ns1:data/ns1:text')[0]; |
97 | 97 | } else { |
98 | 98 | $this->logger->warning('No address found for given VIAF URL'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | |
@@ -110,14 +110,14 @@ discard block |
||
110 | 110 | public function getFullName() |
111 | 111 | { |
112 | 112 | $this->getRaw(); |
113 | - if ($this->raw !== false && !empty($this->raw->asXML())) { |
|
113 | + if ($this->raw !== FALSE && !empty($this->raw->asXML())) { |
|
114 | 114 | $rawName = $this->raw->xpath('./ns1:mainHeadings/ns1:data/ns1:text'); |
115 | 115 | $name = (string) $rawName[0]; |
116 | 116 | $name = trim(trim(trim($name), ','), '.'); |
117 | 117 | return $name; |
118 | 118 | } else { |
119 | 119 | $this->logger->warning('No name found for given VIAF URL'); |
120 | - return false; |
|
120 | + return FALSE; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
@@ -131,9 +131,9 @@ discard block |
||
131 | 131 | private function getRaw(): void |
132 | 132 | { |
133 | 133 | $data = $this->client->getData(); |
134 | - if ($data != false) { |
|
134 | + if ($data != FALSE) { |
|
135 | 135 | $this->raw = Helper::getXmlFileAsString($data); |
136 | - if ($this->raw != false && !empty($this->raw->asXML())) { |
|
136 | + if ($this->raw != FALSE && !empty($this->raw->asXML())) { |
|
137 | 137 | $this->raw->registerXPathNamespace('ns1', 'http://viaf.org/viaf/terms#'); |
138 | 138 | } |
139 | 139 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | try { |
112 | 112 | $response = $this->requestFactory->request($url); |
113 | 113 | } catch (\Exception $e) { |
114 | - $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
|
114 | + $this->logger->warning('Could not fetch data from URL "'.$url.'". Error: '.$e->getMessage().'.'); |
|
115 | 115 | return false; |
116 | 116 | } |
117 | 117 | return $response->getBody()->getContents(); |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | **/ |
127 | 127 | private function getApiEndpoint(): string |
128 | 128 | { |
129 | - $url = 'https://' . $this->level . '.' . self::HOSTNAME; |
|
130 | - $url .= '/v' . self::VERSION . '/'; |
|
129 | + $url = 'https://'.$this->level.'.'.self::HOSTNAME; |
|
130 | + $url .= '/v'.self::VERSION.'/'; |
|
131 | 131 | $url .= $this->orcid; |
132 | - $url .= '/' . $this->endpoint; |
|
132 | + $url .= '/'.$this->endpoint; |
|
133 | 133 | return $url; |
134 | 134 | } |
135 | 135 | } |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | **/ |
29 | -class Client |
|
30 | -{ |
|
29 | +class Client { |
|
31 | 30 | /** |
32 | 31 | * @var string constant for API hostname |
33 | 32 | **/ |
@@ -78,8 +77,7 @@ discard block |
||
78 | 77 | * |
79 | 78 | * @return void |
80 | 79 | **/ |
81 | - public function __construct(string $orcid, RequestFactory $requestFactory) |
|
82 | - { |
|
80 | + public function __construct(string $orcid, RequestFactory $requestFactory) { |
|
83 | 81 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
84 | 82 | $this->orcid = $orcid; |
85 | 83 | $this->requestFactory = $requestFactory; |
@@ -105,8 +103,7 @@ discard block |
||
105 | 103 | * |
106 | 104 | * @return object|bool |
107 | 105 | **/ |
108 | - public function getData() |
|
109 | - { |
|
106 | + public function getData() { |
|
110 | 107 | $url = $this->getApiEndpoint(); |
111 | 108 | try { |
112 | 109 | $response = $this->requestFactory->request($url); |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $response = $this->requestFactory->request($url); |
97 | 97 | } catch (\Exception $e) { |
98 | 98 | $this->logger->warning('Could not fetch data from URL "' . $url . '". Error: ' . $e->getMessage() . '.'); |
99 | - return false; |
|
99 | + return FALSE; |
|
100 | 100 | } |
101 | 101 | return $response->getBody()->getContents(); |
102 | 102 | } |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class StdWrapViewHelper extends AbstractViewHelper |
|
27 | -{ |
|
26 | +class StdWrapViewHelper extends AbstractViewHelper { |
|
28 | 27 | /** |
29 | 28 | * @access protected |
30 | 29 | * @var bool |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | * @access protected |
30 | 30 | * @var bool |
31 | 31 | */ |
32 | - protected $escapeOutput = false; |
|
32 | + protected $escapeOutput = FALSE; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Initializes arguments. |
@@ -41,8 +41,8 @@ discard block |
||
41 | 41 | public function initializeArguments(): void |
42 | 42 | { |
43 | 43 | parent::initializeArguments(); |
44 | - $this->registerArgument('wrap', 'string', 'The wrap information', true); |
|
45 | - $this->registerArgument('data', 'array', 'Data for the content object', false); |
|
44 | + $this->registerArgument('wrap', 'string', 'The wrap information', TRUE); |
|
45 | + $this->registerArgument('data', 'array', 'Data for the content object', FALSE); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -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 | */ |
@@ -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 | } |