@@ -5,12 +5,10 @@ |
||
5 | 5 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
6 | 6 | use TYPO3\CMS\Core\Utility\GeneralUtility; |
7 | 7 | |
8 | -class PageViewProxyDisabledTest extends FunctionalTestCase |
|
9 | -{ |
|
8 | +class PageViewProxyDisabledTest extends FunctionalTestCase { |
|
10 | 9 | protected $disableJsonWrappedResponse = true; |
11 | 10 | |
12 | - protected function queryProxy(array $query, string $method = 'GET') |
|
13 | - { |
|
11 | + protected function queryProxy(array $query, string $method = 'GET') { |
|
14 | 12 | $query['eID'] = 'tx_dlf_pageview_proxy'; |
15 | 13 | |
16 | 14 | return $this->httpClient->request($method, '', [ |
@@ -8,8 +8,7 @@ |
||
8 | 8 | use Kitodo\Dlf\Tests\Functional\FunctionalTestCase; |
9 | 9 | use TYPO3\CMS\Extbase\Persistence\Generic\LazyObjectStorage; |
10 | 10 | |
11 | -class DocumentRepositoryTest extends FunctionalTestCase |
|
12 | -{ |
|
11 | +class DocumentRepositoryTest extends FunctionalTestCase { |
|
13 | 12 | /** |
14 | 13 | * @var DocumentRepository |
15 | 14 | */ |
@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @property-read string $thumbnail This holds the document's thumbnail location |
57 | 57 | * @property-read string $toplevelId This holds the toplevel manifest's @id |
58 | 58 | */ |
59 | -final class IiifManifest extends Doc |
|
60 | -{ |
|
59 | +final class IiifManifest extends Doc { |
|
61 | 60 | /** |
62 | 61 | * This holds the manifest file as string for serialization purposes |
63 | 62 | * @see __sleep() / __wakeup() |
@@ -118,8 +117,7 @@ discard block |
||
118 | 117 | * {@inheritDoc} |
119 | 118 | * @see Doc::establishRecordId() |
120 | 119 | */ |
121 | - protected function establishRecordId($pid) |
|
122 | - { |
|
120 | + protected function establishRecordId($pid) { |
|
123 | 121 | if ($this->iiif !== null) { |
124 | 122 | /* |
125 | 123 | * FIXME This will not consistently work because we can not be sure to have the pid at hand. It may miss |
@@ -174,8 +172,7 @@ discard block |
||
174 | 172 | * {@inheritDoc} |
175 | 173 | * @see Doc::getDocument() |
176 | 174 | */ |
177 | - protected function getDocument() |
|
178 | - { |
|
175 | + protected function getDocument() { |
|
179 | 176 | return $this->iiif; |
180 | 177 | } |
181 | 178 | |
@@ -188,8 +185,7 @@ discard block |
||
188 | 185 | * @return string 'IIIF1' if the resource is a Metadata API 1 resource, 'IIIF2' / 'IIIF3' if |
189 | 186 | * the resource is a Presentation API 2 / 3 resource |
190 | 187 | */ |
191 | - public function getIiifVersion() |
|
192 | - { |
|
188 | + public function getIiifVersion() { |
|
193 | 189 | if (!isset($this->iiifVersion)) { |
194 | 190 | if ($this->iiif instanceof AbstractIiifResource1) { |
195 | 191 | $this->iiifVersion = 'IIIF1'; |
@@ -230,8 +226,7 @@ discard block |
||
230 | 226 | * |
231 | 227 | * @return array|string |
232 | 228 | */ |
233 | - protected function getUseGroups($use) |
|
234 | - { |
|
229 | + protected function getUseGroups($use) { |
|
235 | 230 | if (!$this->useGrpsLoaded) { |
236 | 231 | // Get configured USE attributes. |
237 | 232 | $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
@@ -259,8 +254,7 @@ discard block |
||
259 | 254 | * {@inheritDoc} |
260 | 255 | * @see Doc::_getPhysicalStructure() |
261 | 256 | */ |
262 | - protected function _getPhysicalStructure() |
|
263 | - { |
|
257 | + protected function _getPhysicalStructure() { |
|
264 | 258 | // Is there no physical structure array yet? |
265 | 259 | if (!$this->physicalStructureLoaded) { |
266 | 260 | if ($this->iiif == null || !($this->iiif instanceof ManifestInterface)) { |
@@ -373,8 +367,7 @@ discard block |
||
373 | 367 | * {@inheritDoc} |
374 | 368 | * @see Doc::getDownloadLocation() |
375 | 369 | */ |
376 | - public function getDownloadLocation($id) |
|
377 | - { |
|
370 | + public function getDownloadLocation($id) { |
|
378 | 371 | $fileLocation = $this->getFileLocation($id); |
379 | 372 | $resource = $this->iiif->getContainedResourceById($fileLocation); |
380 | 373 | if ($resource instanceof AbstractImageService) { |
@@ -387,8 +380,7 @@ discard block |
||
387 | 380 | * {@inheritDoc} |
388 | 381 | * @see Doc::getFileLocation() |
389 | 382 | */ |
390 | - public function getFileLocation($id) |
|
391 | - { |
|
383 | + public function getFileLocation($id) { |
|
392 | 384 | if ($id == null) { |
393 | 385 | return null; |
394 | 386 | } |
@@ -412,8 +404,7 @@ discard block |
||
412 | 404 | * {@inheritDoc} |
413 | 405 | * @see Doc::getFileMimeType() |
414 | 406 | */ |
415 | - public function getFileMimeType($id) |
|
416 | - { |
|
407 | + public function getFileMimeType($id) { |
|
417 | 408 | $fileResource = $this->iiif->getContainedResourceById($id); |
418 | 409 | if ($fileResource instanceof CanvasInterface) { |
419 | 410 | $format = "application/vnd.kitodo.iiif"; |
@@ -438,8 +429,7 @@ discard block |
||
438 | 429 | * {@inheritDoc} |
439 | 430 | * @see Doc::getLogicalStructure() |
440 | 431 | */ |
441 | - public function getLogicalStructure($id, $recursive = false) |
|
442 | - { |
|
432 | + public function getLogicalStructure($id, $recursive = false) { |
|
443 | 433 | $details = []; |
444 | 434 | if (!$recursive && !empty($this->logicalUnits[$id])) { |
445 | 435 | return $this->logicalUnits[$id]; |
@@ -474,8 +464,7 @@ discard block |
||
474 | 464 | * @param array $processedStructures: IIIF resources that already have been processed |
475 | 465 | * @return array Logical structure array |
476 | 466 | */ |
477 | - protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = []) |
|
478 | - { |
|
467 | + protected function getLogicalStructureInfo(IiifResourceInterface $resource, $recursive = false, &$processedStructures = []) { |
|
479 | 468 | $details = []; |
480 | 469 | $details['id'] = $resource->getId(); |
481 | 470 | $details['dmdId'] = ''; |
@@ -567,8 +556,7 @@ discard block |
||
567 | 556 | * |
568 | 557 | * @todo This method is still in experimental; the method signature may change. |
569 | 558 | */ |
570 | - public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true) |
|
571 | - { |
|
559 | + public function getManifestMetadata($id, $cPid = 0, $withDescription = true, $withRights = true, $withRelated = true) { |
|
572 | 560 | if (!empty($this->originalMetadataArray[$id])) { |
573 | 561 | return $this->originalMetadataArray[$id]; |
574 | 562 | } |
@@ -610,8 +598,7 @@ discard block |
||
610 | 598 | * {@inheritDoc} |
611 | 599 | * @see Doc::getMetadata() |
612 | 600 | */ |
613 | - public function getMetadata($id, $cPid = 0) |
|
614 | - { |
|
601 | + public function getMetadata($id, $cPid = 0) { |
|
615 | 602 | if (!empty($this->metadataArray[$id]) && $this->metadataArray[0] == $cPid) { |
616 | 603 | return $this->metadataArray[$id]; |
617 | 604 | } |
@@ -718,8 +705,7 @@ discard block |
||
718 | 705 | * {@inheritDoc} |
719 | 706 | * @see Doc::_getSmLinks() |
720 | 707 | */ |
721 | - protected function _getSmLinks() |
|
722 | - { |
|
708 | + protected function _getSmLinks() { |
|
723 | 709 | if (!$this->smLinksLoaded && isset($this->iiif) && $this->iiif instanceof ManifestInterface) { |
724 | 710 | if (!empty($this->iiif->getDefaultCanvases())) { |
725 | 711 | foreach ($this->iiif->getDefaultCanvases() as $canvas) { |
@@ -743,8 +729,7 @@ discard block |
||
743 | 729 | * |
744 | 730 | * @param RangeInterface $range: Current range whose canvases shall be linked |
745 | 731 | */ |
746 | - private function smLinkRangeCanvasesRecursively(RangeInterface $range) |
|
747 | - { |
|
732 | + private function smLinkRangeCanvasesRecursively(RangeInterface $range) { |
|
748 | 733 | // map range's canvases including all child ranges' canvases |
749 | 734 | if (!$range->isTopRange()) { |
750 | 735 | foreach ($range->getAllCanvasesRecursively() as $canvas) { |
@@ -767,8 +752,7 @@ discard block |
||
767 | 752 | * @param CanvasInterface $canvas |
768 | 753 | * @param IiifResourceInterface $resource |
769 | 754 | */ |
770 | - private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) |
|
771 | - { |
|
755 | + private function smLinkCanvasToResource(CanvasInterface $canvas, IiifResourceInterface $resource) { |
|
772 | 756 | $this->smLinks['l2p'][$resource->getId()][] = $canvas->getId(); |
773 | 757 | if (!is_array($this->smLinks['p2l'][$canvas->getId()]) || !in_array($resource->getId(), $this->smLinks['p2l'][$canvas->getId()])) { |
774 | 758 | $this->smLinks['p2l'][$canvas->getId()][] = $resource->getId(); |
@@ -780,8 +764,7 @@ discard block |
||
780 | 764 | * @see Doc::getFullText() |
781 | 765 | */ |
782 | 766 | //TODO: rewrite it to get full OCR |
783 | - public function getFullText($id) |
|
784 | - { |
|
767 | + public function getFullText($id) { |
|
785 | 768 | $rawText = ''; |
786 | 769 | // Get text from raw text array if available. |
787 | 770 | if (!empty($this->rawTextArray[$id])) { |
@@ -838,8 +821,7 @@ discard block |
||
838 | 821 | * |
839 | 822 | * @return IiifResourceInterface |
840 | 823 | */ |
841 | - public function getIiif() |
|
842 | - { |
|
824 | + public function getIiif() { |
|
843 | 825 | return $this->iiif; |
844 | 826 | } |
845 | 827 | |
@@ -847,8 +829,7 @@ discard block |
||
847 | 829 | * {@inheritDoc} |
848 | 830 | * @see Doc::init() |
849 | 831 | */ |
850 | - protected function init($location) |
|
851 | - { |
|
832 | + protected function init($location) { |
|
852 | 833 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
853 | 834 | } |
854 | 835 | |
@@ -856,8 +837,7 @@ discard block |
||
856 | 837 | * {@inheritDoc} |
857 | 838 | * @see Doc::loadLocation() |
858 | 839 | */ |
859 | - protected function loadLocation($location) |
|
860 | - { |
|
840 | + protected function loadLocation($location) { |
|
861 | 841 | $fileResource = GeneralUtility::getUrl($location); |
862 | 842 | if ($fileResource !== false) { |
863 | 843 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
@@ -880,8 +860,7 @@ discard block |
||
880 | 860 | * {@inheritDoc} |
881 | 861 | * @see \Kitodo\Dlf\Common\Doc::prepareMetadataArray() |
882 | 862 | */ |
883 | - protected function prepareMetadataArray($cPid) |
|
884 | - { |
|
863 | + protected function prepareMetadataArray($cPid) { |
|
885 | 864 | $id = $this->iiif->getId(); |
886 | 865 | $this->metadataArray[(string) $id] = $this->getMetadata((string) $id, $cPid); |
887 | 866 | } |
@@ -890,8 +869,7 @@ discard block |
||
890 | 869 | * {@inheritDoc} |
891 | 870 | * @see Doc::setPreloadedDocument() |
892 | 871 | */ |
893 | - protected function setPreloadedDocument($preloadedDocument) |
|
894 | - { |
|
872 | + protected function setPreloadedDocument($preloadedDocument) { |
|
895 | 873 | if ($preloadedDocument instanceof ManifestInterface) { |
896 | 874 | $this->iiif = $preloadedDocument; |
897 | 875 | return true; |
@@ -903,8 +881,7 @@ discard block |
||
903 | 881 | * {@inheritDoc} |
904 | 882 | * @see Docu::ensureHasFulltextIsSet() |
905 | 883 | */ |
906 | - protected function ensureHasFulltextIsSet() |
|
907 | - { |
|
884 | + protected function ensureHasFulltextIsSet() { |
|
908 | 885 | /* |
909 | 886 | * TODO Check annotations and annotation lists of canvas for ALTO documents. |
910 | 887 | * Example: |
@@ -950,8 +927,7 @@ discard block |
||
950 | 927 | * {@inheritDoc} |
951 | 928 | * @see \Kitodo\Dlf\Common\Doc::_getThumbnail() |
952 | 929 | */ |
953 | - protected function _getThumbnail($forceReload = false) |
|
954 | - { |
|
930 | + protected function _getThumbnail($forceReload = false) { |
|
955 | 931 | return $this->iiif->getThumbnailUrl(); |
956 | 932 | } |
957 | 933 | |
@@ -959,8 +935,7 @@ discard block |
||
959 | 935 | * {@inheritDoc} |
960 | 936 | * @see \Kitodo\Dlf\Common\Doc::_getToplevelId() |
961 | 937 | */ |
962 | - protected function _getToplevelId() |
|
963 | - { |
|
938 | + protected function _getToplevelId() { |
|
964 | 939 | if (empty($this->toplevelId)) { |
965 | 940 | if (isset($this->iiif)) { |
966 | 941 | $this->toplevelId = $this->iiif->getId(); |
@@ -977,8 +952,7 @@ discard block |
||
977 | 952 | * |
978 | 953 | * @return void |
979 | 954 | */ |
980 | - public function __wakeup() |
|
981 | - { |
|
955 | + public function __wakeup() { |
|
982 | 956 | $conf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey); |
983 | 957 | IiifHelper::setUrlReader(IiifUrlReader::getInstance()); |
984 | 958 | IiifHelper::setMaxThumbnailHeight($conf['iiifThumbnailHeight']); |
@@ -998,8 +972,7 @@ discard block |
||
998 | 972 | * |
999 | 973 | * @return string[] |
1000 | 974 | */ |
1001 | - public function __sleep() |
|
1002 | - { |
|
975 | + public function __sleep() { |
|
1003 | 976 | // TODO implement serializiation in IIIF library |
1004 | 977 | $jsonArray = $this->iiif->getOriginalJsonArray(); |
1005 | 978 | $this->asJson = json_encode($jsonArray); |
@@ -32,8 +32,7 @@ discard block |
||
32 | 32 | * @subpackage dlf |
33 | 33 | * @access public |
34 | 34 | */ |
35 | -class Generator |
|
36 | -{ |
|
35 | +class Generator { |
|
37 | 36 | /** |
38 | 37 | * @var ObjectManager |
39 | 38 | */ |
@@ -49,8 +48,7 @@ discard block |
||
49 | 48 | */ |
50 | 49 | protected $dataMapper; |
51 | 50 | |
52 | - public function __construct() |
|
53 | - { |
|
51 | + public function __construct() { |
|
54 | 52 | $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
55 | 53 | $this->languageService = $this->objectManager->get(LanguageService::class); |
56 | 54 | $this->dataMapper = $this->objectManager->get(DataMapper::class); |
@@ -167,8 +165,7 @@ discard block |
||
167 | 165 | return $result; |
168 | 166 | } |
169 | 167 | |
170 | - protected function parseDocComment($docComment) |
|
171 | - { |
|
168 | + protected function parseDocComment($docComment) { |
|
172 | 169 | // TODO: Consider using phpDocumentor (though that splits the docblock into summary and description) |
173 | 170 | |
174 | 171 | // Adopted from DocCommentParser in TYPO3 v9 |
@@ -193,8 +190,7 @@ discard block |
||
193 | 190 | /** |
194 | 191 | * Transform table structure into .rst page. |
195 | 192 | */ |
196 | - public function generatePage(array $tables) |
|
197 | - { |
|
193 | + public function generatePage(array $tables) { |
|
198 | 194 | $page = new RstSection(); |
199 | 195 | $page->setHeader('Database Tables'); |
200 | 196 | $page->addText(<<<RST |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
27 | 27 | */ |
28 | - public function findBySettings($settings = []) |
|
29 | - { |
|
28 | + public function findBySettings($settings = []) { |
|
30 | 29 | $query = $this->createQuery(); |
31 | 30 | |
32 | 31 | $constraints = []; |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | * |
36 | 36 | * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
37 | 37 | */ |
38 | - public function findAllByUids($uids) |
|
39 | - { |
|
38 | + public function findAllByUids($uids) { |
|
40 | 39 | $query = $this->createQuery(); |
41 | 40 | |
42 | 41 | $constraints = []; |
@@ -49,8 +48,7 @@ discard block |
||
49 | 48 | return $query->execute(); |
50 | 49 | } |
51 | 50 | |
52 | - public function getCollectionForMetadata($pages) |
|
53 | - { |
|
51 | + public function getCollectionForMetadata($pages) { |
|
54 | 52 | // Get list of collections to show. |
55 | 53 | $query = $this->createQuery(); |
56 | 54 | |
@@ -66,8 +64,7 @@ discard block |
||
66 | 64 | * |
67 | 65 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
68 | 66 | */ |
69 | - public function findCollectionsBySettings($settings = []) |
|
70 | - { |
|
67 | + public function findCollectionsBySettings($settings = []) { |
|
71 | 68 | $query = $this->createQuery(); |
72 | 69 | |
73 | 70 | $constraints = []; |
@@ -104,8 +101,7 @@ discard block |
||
104 | 101 | return $query->execute(); |
105 | 102 | } |
106 | 103 | |
107 | - public function getIndexNameForSolr($settings, $set) |
|
108 | - { |
|
104 | + public function getIndexNameForSolr($settings, $set) { |
|
109 | 105 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
110 | 106 | ->getQueryBuilderForTable('tx_dlf_collections'); |
111 | 107 |
@@ -25,8 +25,7 @@ |
||
25 | 25 | * |
26 | 26 | * @return void |
27 | 27 | */ |
28 | - public function deleteExpiredTokens($expireTime) |
|
29 | - { |
|
28 | + public function deleteExpiredTokens($expireTime) { |
|
30 | 29 | $query = $this->createQuery(); |
31 | 30 | |
32 | 31 | $constraints = []; |
@@ -18,8 +18,7 @@ |
||
18 | 18 | class MailRepository extends \TYPO3\CMS\Extbase\Persistence\Repository |
19 | 19 | { |
20 | 20 | |
21 | - public function findAllWithPid($pid) |
|
22 | - { |
|
21 | + public function findAllWithPid($pid) { |
|
23 | 22 | /** @var Typo3QuerySettings $querySettings */ |
24 | 23 | $querySettings = GeneralUtility::makeInstance(Typo3QuerySettings::class); |
25 | 24 |
@@ -109,14 +109,12 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * constructor |
111 | 111 | */ |
112 | - public function __construct() |
|
113 | - { |
|
112 | + public function __construct() { |
|
114 | 113 | // Do not remove the next line: It would break the functionality |
115 | 114 | $this->initStorageObjects(); |
116 | 115 | } |
117 | 116 | |
118 | - protected function initStorageObjects() |
|
119 | - { |
|
117 | + protected function initStorageObjects() { |
|
120 | 118 | $this->format = new ObjectStorage(); |
121 | 119 | } |
122 | 120 | |
@@ -187,8 +185,7 @@ discard block |
||
187 | 185 | /** |
188 | 186 | * @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Kitodo\Dlf\Domain\Model\MetadataFormat> $format |
189 | 187 | */ |
190 | - public function getFormat() |
|
191 | - { |
|
188 | + public function getFormat() { |
|
192 | 189 | return $this->format; |
193 | 190 | } |
194 | 191 | |
@@ -207,8 +204,7 @@ discard block |
||
207 | 204 | * |
208 | 205 | * @return void |
209 | 206 | */ |
210 | - public function addFormat(MetadataFormat $format) |
|
211 | - { |
|
207 | + public function addFormat(MetadataFormat $format) { |
|
212 | 208 | $this->format->attach($format); |
213 | 209 | } |
214 | 210 | |
@@ -219,8 +215,7 @@ discard block |
||
219 | 215 | * |
220 | 216 | * @return void |
221 | 217 | */ |
222 | - public function removeFormat(MetadataFormat $formatToRemove) |
|
223 | - { |
|
218 | + public function removeFormat(MetadataFormat $formatToRemove) { |
|
224 | 219 | $this->format->detach($formatToRemove); |
225 | 220 | } |
226 | 221 |