@@ -27,8 +27,7 @@ discard block |
||
27 | 27 | * |
28 | 28 | * @access public |
29 | 29 | */ |
30 | -class DocumentValidator |
|
31 | -{ |
|
30 | +class DocumentValidator { |
|
32 | 31 | /** |
33 | 32 | * @access protected |
34 | 33 | * @var Logger This holds the logger |
@@ -63,8 +62,7 @@ discard block |
||
63 | 62 | * |
64 | 63 | * @return void |
65 | 64 | */ |
66 | - public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = null) |
|
67 | - { |
|
65 | + public function __construct(array $metadata = [], array $requiredMetadataFields = [], ?\SimpleXMLElement $xml = null) { |
|
68 | 66 | $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(static::class); |
69 | 67 | $this->metadata = $metadata; |
70 | 68 | $this->requiredMetadataFields = $requiredMetadataFields; |
@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | use SimpleXMLElement; |
16 | 16 | use TYPO3\TestingFramework\Core\Unit\UnitTestCase; |
17 | 17 | |
18 | -class DocumentValidatorTest extends UnitTestCase |
|
19 | -{ |
|
18 | +class DocumentValidatorTest extends UnitTestCase { |
|
20 | 19 | public function setUp(): void |
21 | 20 | { |
22 | 21 | parent::setUp(); |
@@ -27,8 +26,7 @@ discard block |
||
27 | 26 | /** |
28 | 27 | * @test |
29 | 28 | */ |
30 | - public function passesHasAllMandatoryMetadataFields() |
|
31 | - { |
|
29 | + public function passesHasAllMandatoryMetadataFields() { |
|
32 | 30 | $metadata = [ |
33 | 31 | 'record_id' => [ |
34 | 32 | 'xyz' |
@@ -41,8 +39,7 @@ discard block |
||
41 | 39 | /** |
42 | 40 | * @test |
43 | 41 | */ |
44 | - public function notPassesHasAllMandatoryMetadataFields() |
|
45 | - { |
|
42 | + public function notPassesHasAllMandatoryMetadataFields() { |
|
46 | 43 | $metadata = [ |
47 | 44 | 'document_format' => [ |
48 | 45 | 'METS' |
@@ -55,8 +52,7 @@ discard block |
||
55 | 52 | /** |
56 | 53 | * @test |
57 | 54 | */ |
58 | - public function passesHasCorrectLogicalStructure() |
|
59 | - { |
|
55 | + public function passesHasCorrectLogicalStructure() { |
|
60 | 56 | $xml = $this->getXml('av_beispiel.xml'); |
61 | 57 | |
62 | 58 | $documentValidator = new DocumentValidator([], [], $xml); |
@@ -66,8 +62,7 @@ discard block |
||
66 | 62 | /** |
67 | 63 | * @test |
68 | 64 | */ |
69 | - public function notPassesHasCorrectLogicalStructure() |
|
70 | - { |
|
65 | + public function notPassesHasCorrectLogicalStructure() { |
|
71 | 66 | $xml = $this->getXml('av_beispiel.xml'); |
72 | 67 | |
73 | 68 | $documentValidator = new DocumentValidator([], [], $xml); |
@@ -77,8 +72,7 @@ discard block |
||
77 | 72 | /** |
78 | 73 | * @test |
79 | 74 | */ |
80 | - public function passesHasCorrectPhysicalStructure() |
|
81 | - { |
|
75 | + public function passesHasCorrectPhysicalStructure() { |
|
82 | 76 | $xml = $this->getXml('av_beispiel.xml'); |
83 | 77 | |
84 | 78 | $documentValidator = new DocumentValidator([], [], $xml); |
@@ -88,8 +82,7 @@ discard block |
||
88 | 82 | /** |
89 | 83 | * @test |
90 | 84 | */ |
91 | - public function notPassesHasCorrectPhysicalStructure() |
|
92 | - { |
|
85 | + public function notPassesHasCorrectPhysicalStructure() { |
|
93 | 86 | $xml = $this->getXml('two_dmdsec.xml'); |
94 | 87 | |
95 | 88 | $documentValidator = new DocumentValidator([], [], $xml); |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @access public |
38 | 38 | */ |
39 | -class DocumentRepository extends Repository |
|
40 | -{ |
|
39 | +class DocumentRepository extends Repository { |
|
41 | 40 | /** |
42 | 41 | * @access protected |
43 | 42 | * @var array The controller settings passed to the repository for some special actions. |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | * |
62 | 61 | * @return Document|null |
63 | 62 | */ |
64 | - public function findOneByParameters($parameters) |
|
65 | - { |
|
63 | + public function findOneByParameters($parameters) { |
|
66 | 64 | $doc = null; |
67 | 65 | $document = null; |
68 | 66 | |
@@ -108,8 +106,7 @@ discard block |
||
108 | 106 | * |
109 | 107 | * @return Document|null |
110 | 108 | */ |
111 | - public function findOldestDocument() |
|
112 | - { |
|
109 | + public function findOldestDocument() { |
|
113 | 110 | $query = $this->createQuery(); |
114 | 111 | |
115 | 112 | $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]); |
@@ -126,8 +123,7 @@ discard block |
||
126 | 123 | * |
127 | 124 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
128 | 125 | */ |
129 | - public function getChildrenOfYearAnchor($partOf, $structure) |
|
130 | - { |
|
126 | + public function getChildrenOfYearAnchor($partOf, $structure) { |
|
131 | 127 | $query = $this->createQuery(); |
132 | 128 | |
133 | 129 | $query->matching($query->equals('structure', $structure)); |
@@ -150,8 +146,7 @@ discard block |
||
150 | 146 | * |
151 | 147 | * @return Document|null |
152 | 148 | */ |
153 | - public function findOneByIdAndSettings($uid, $settings = []) |
|
154 | - { |
|
149 | + public function findOneByIdAndSettings($uid, $settings = []) { |
|
155 | 150 | $settings = ['documentSets' => $uid]; |
156 | 151 | |
157 | 152 | return $this->findDocumentsBySettings($settings)->getFirst(); |
@@ -166,8 +161,7 @@ discard block |
||
166 | 161 | * |
167 | 162 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
168 | 163 | */ |
169 | - public function findDocumentsBySettings($settings = []) |
|
170 | - { |
|
164 | + public function findDocumentsBySettings($settings = []) { |
|
171 | 165 | $query = $this->createQuery(); |
172 | 166 | |
173 | 167 | $constraints = []; |
@@ -200,8 +194,7 @@ discard block |
||
200 | 194 | * |
201 | 195 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
202 | 196 | */ |
203 | - public function findAllByCollectionsLimited($collections, int $limit = 50, int $offset = 0) |
|
204 | - { |
|
197 | + public function findAllByCollectionsLimited($collections, int $limit = 50, int $offset = 0) { |
|
205 | 198 | $query = $this->createQuery(); |
206 | 199 | |
207 | 200 | // order by start_date -> start_time... |
@@ -241,8 +234,7 @@ discard block |
||
241 | 234 | * |
242 | 235 | * @return array |
243 | 236 | */ |
244 | - public function getStatisticsForSelectedCollection($settings) |
|
245 | - { |
|
237 | + public function getStatisticsForSelectedCollection($settings) { |
|
246 | 238 | if ($settings['collections']) { |
247 | 239 | // Include only selected collections. |
248 | 240 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -378,8 +370,7 @@ discard block |
||
378 | 370 | * |
379 | 371 | * @return Result |
380 | 372 | */ |
381 | - public function getTableOfContentsFromDb($uid, $pid, $settings) |
|
382 | - { |
|
373 | + public function getTableOfContentsFromDb($uid, $pid, $settings) { |
|
383 | 374 | // Build table of contents from database. |
384 | 375 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
385 | 376 | ->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -429,8 +420,7 @@ discard block |
||
429 | 420 | * |
430 | 421 | * @return array The found document object |
431 | 422 | */ |
432 | - public function getOaiRecord($settings, $parameters) |
|
433 | - { |
|
423 | + public function getOaiRecord($settings, $parameters) { |
|
434 | 424 | $where = ''; |
435 | 425 | |
436 | 426 | if (!$settings['show_userdefined']) { |
@@ -507,8 +497,7 @@ discard block |
||
507 | 497 | * |
508 | 498 | * @return array |
509 | 499 | */ |
510 | - public function findAllByUids($uids, $checkPartof = false) |
|
511 | - { |
|
500 | + public function findAllByUids($uids, $checkPartof = false) { |
|
512 | 501 | // get all documents from db we are talking about |
513 | 502 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
514 | 503 | $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -557,8 +546,7 @@ discard block |
||
557 | 546 | * |
558 | 547 | * @return array |
559 | 548 | */ |
560 | - public function findChildrenOfEach(array $uids) |
|
561 | - { |
|
549 | + public function findChildrenOfEach(array $uids) { |
|
562 | 550 | $allDocuments = $this->findAllByUids($uids, true); |
563 | 551 | |
564 | 552 | $result = []; |
@@ -583,8 +571,7 @@ discard block |
||
583 | 571 | * |
584 | 572 | * @return SolrSearch |
585 | 573 | */ |
586 | - public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null) |
|
587 | - { |
|
574 | + public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null) { |
|
588 | 575 | return $this->findSolr([$collection], $settings, $searchParams, $listedMetadata, $indexedMetadata); |
589 | 576 | } |
590 | 577 |
@@ -96,8 +96,7 @@ discard block |
||
96 | 96 | * |
97 | 97 | * @return void |
98 | 98 | */ |
99 | - public function __construct(DocumentRepository $documentRepository, $collections, array $settings, array $searchParams, QueryResult $listedMetadata = null, QueryResult $indexedMetadata = null) |
|
100 | - { |
|
99 | + public function __construct(DocumentRepository $documentRepository, $collections, array $settings, array $searchParams, QueryResult $listedMetadata = null, QueryResult $indexedMetadata = null) { |
|
101 | 100 | $this->documentRepository = $documentRepository; |
102 | 101 | $this->collections = $collections; |
103 | 102 | $this->settings = $settings; |
@@ -217,8 +216,7 @@ discard block |
||
217 | 216 | * @return mixed |
218 | 217 | */ |
219 | 218 | #[\ReturnTypeWillChange] |
220 | - public function offsetGet($offset) |
|
221 | - { |
|
219 | + public function offsetGet($offset) { |
|
222 | 220 | $idx = $this->result['document_keys'][$offset]; |
223 | 221 | $document = $this->result['documents'][$idx] ?? null; |
224 | 222 | |
@@ -286,8 +284,7 @@ discard block |
||
286 | 284 | * |
287 | 285 | * @return mixed |
288 | 286 | */ |
289 | - public function getSolrResults() |
|
290 | - { |
|
287 | + public function getSolrResults() { |
|
291 | 288 | return $this->result['solrResults']; |
292 | 289 | } |
293 | 290 | |
@@ -300,8 +297,7 @@ discard block |
||
300 | 297 | * |
301 | 298 | * @return mixed |
302 | 299 | */ |
303 | - public function getByUid($uid) |
|
304 | - { |
|
300 | + public function getByUid($uid) { |
|
305 | 301 | return $this->result['documents'][$uid]; |
306 | 302 | } |
307 | 303 | |
@@ -312,8 +308,7 @@ discard block |
||
312 | 308 | * |
313 | 309 | * @return SolrSearchQuery |
314 | 310 | */ |
315 | - public function getQuery() |
|
316 | - { |
|
311 | + public function getQuery() { |
|
317 | 312 | return new SolrSearchQuery($this); |
318 | 313 | } |
319 | 314 | |
@@ -324,8 +319,7 @@ discard block |
||
324 | 319 | * |
325 | 320 | * @return SolrSearch |
326 | 321 | */ |
327 | - public function getFirst() |
|
328 | - { |
|
322 | + public function getFirst() { |
|
329 | 323 | return $this[0]; |
330 | 324 | } |
331 | 325 | |
@@ -336,8 +330,7 @@ discard block |
||
336 | 330 | * |
337 | 331 | * @return array |
338 | 332 | */ |
339 | - public function toArray() |
|
340 | - { |
|
333 | + public function toArray() { |
|
341 | 334 | return array_values($this->result['documents']); |
342 | 335 | } |
343 | 336 | |
@@ -350,8 +343,7 @@ discard block |
||
350 | 343 | * |
351 | 344 | * @return int |
352 | 345 | */ |
353 | - public function getNumFound() |
|
354 | - { |
|
346 | + public function getNumFound() { |
|
355 | 347 | return $this->result['numFound']; |
356 | 348 | } |
357 | 349 | |
@@ -362,8 +354,7 @@ discard block |
||
362 | 354 | * |
363 | 355 | * @return void |
364 | 356 | */ |
365 | - public function prepare() |
|
366 | - { |
|
357 | + public function prepare() { |
|
367 | 358 | // Prepare query parameters. |
368 | 359 | $params = []; |
369 | 360 | $matches = []; |
@@ -479,8 +470,7 @@ discard block |
||
479 | 470 | * |
480 | 471 | * @return void |
481 | 472 | */ |
482 | - public function submit($start, $rows, $processResults = true) |
|
483 | - { |
|
473 | + public function submit($start, $rows, $processResults = true) { |
|
484 | 474 | $params = $this->params; |
485 | 475 | $params['start'] = $start; |
486 | 476 | $params['rows'] = $rows; |
@@ -638,8 +628,7 @@ discard block |
||
638 | 628 | * |
639 | 629 | * @return array The Apache Solr Documents that were fetched |
640 | 630 | */ |
641 | - protected function searchSolr($parameters = [], $enableCache = true) |
|
642 | - { |
|
631 | + protected function searchSolr($parameters = [], $enableCache = true) { |
|
643 | 632 | // Set query. |
644 | 633 | $parameters['query'] = isset($parameters['query']) ? $parameters['query'] : '*'; |
645 | 634 | $parameters['filterquery'] = isset($parameters['filterquery']) ? $parameters['filterquery'] : []; |
@@ -20,8 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @access public |
22 | 22 | */ |
23 | -class Region |
|
24 | -{ |
|
23 | +class Region { |
|
25 | 24 | |
26 | 25 | /** |
27 | 26 | * @access private |
@@ -87,8 +86,7 @@ discard block |
||
87 | 86 | * |
88 | 87 | * @return void |
89 | 88 | */ |
90 | - public function __construct(int $id, array $region) |
|
91 | - { |
|
89 | + public function __construct(int $id, array $region) { |
|
92 | 90 | $this->id = $id; |
93 | 91 | $this->pageId = $region['pageIdx'] ?? null; |
94 | 92 | $this->xBeginPosition = $region['ulx']; |
@@ -38,8 +38,7 @@ discard block |
||
38 | 38 | * |
39 | 39 | * @access public |
40 | 40 | */ |
41 | -class Helper |
|
42 | -{ |
|
41 | +class Helper { |
|
43 | 42 | /** |
44 | 43 | * @access public |
45 | 44 | * @static |
@@ -199,8 +198,7 @@ discard block |
||
199 | 198 | * |
200 | 199 | * @return mixed The decrypted value or false on error |
201 | 200 | */ |
202 | - public static function decrypt(string $encrypted) |
|
203 | - { |
|
201 | + public static function decrypt(string $encrypted) { |
|
204 | 202 | if ( |
205 | 203 | !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true)) |
206 | 204 | || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true)) |
@@ -240,8 +238,7 @@ discard block |
||
240 | 238 | * |
241 | 239 | * @return \SimpleXMLElement|false |
242 | 240 | */ |
243 | - public static function getXmlFileAsString($content) |
|
244 | - { |
|
241 | + public static function getXmlFileAsString($content) { |
|
245 | 242 | // Don't make simplexml_load_string throw (when $content is an array |
246 | 243 | // or object) |
247 | 244 | if (!is_string($content)) { |
@@ -313,8 +310,7 @@ discard block |
||
313 | 310 | * |
314 | 311 | * @return mixed Hashed string or false on error |
315 | 312 | */ |
316 | - public static function digest(string $string) |
|
317 | - { |
|
313 | + public static function digest(string $string) { |
|
318 | 314 | if (!in_array(self::$hashAlgorithm, openssl_get_md_methods(true))) { |
319 | 315 | self::log('OpenSSL library doesn\'t support hash algorithm', LOG_SEVERITY_ERROR); |
320 | 316 | return false; |
@@ -334,8 +330,7 @@ discard block |
||
334 | 330 | * |
335 | 331 | * @return mixed Encrypted string or false on error |
336 | 332 | */ |
337 | - public static function encrypt(string $string) |
|
338 | - { |
|
333 | + public static function encrypt(string $string) { |
|
339 | 334 | if ( |
340 | 335 | !in_array(self::$cipherAlgorithm, openssl_get_cipher_methods(true)) |
341 | 336 | || !in_array(self::$hashAlgorithm, openssl_get_md_methods(true)) |
@@ -578,8 +573,7 @@ discard block |
||
578 | 573 | * |
579 | 574 | * @return array Array of substituted "NEW..." identifiers and their actual UIDs. |
580 | 575 | */ |
581 | - public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false) |
|
582 | - { |
|
576 | + public static function processDatabaseAsAdmin(array $data = [], array $cmd = [], $reverseOrder = false, $cmdFirst = false) { |
|
583 | 577 | $context = GeneralUtility::makeInstance(Context::class); |
584 | 578 | |
585 | 579 | if ( |
@@ -818,8 +812,7 @@ discard block |
||
818 | 812 | * |
819 | 813 | * @return void |
820 | 814 | */ |
821 | - private function __construct() |
|
822 | - { |
|
815 | + private function __construct() { |
|
823 | 816 | // This is a static class, thus no instances should be created. |
824 | 817 | } |
825 | 818 | |
@@ -850,8 +843,7 @@ discard block |
||
850 | 843 | * |
851 | 844 | * @return string|bool |
852 | 845 | */ |
853 | - public static function getUrl(string $url) |
|
854 | - { |
|
846 | + public static function getUrl(string $url) { |
|
855 | 847 | if (!Helper::isValidHttpUrl($url)) { |
856 | 848 | return false; |
857 | 849 | } |
@@ -932,8 +924,7 @@ discard block |
||
932 | 924 | * |
933 | 925 | * @return mixed |
934 | 926 | */ |
935 | - private static function getLocalConfigurationByPath(string $path) |
|
936 | - { |
|
927 | + private static function getLocalConfigurationByPath(string $path) { |
|
937 | 928 | $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); |
938 | 929 | |
939 | 930 | if (array_key_exists(strtok($path, '/'), $configurationManager->getLocalConfiguration())) { |
@@ -23,8 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class IndexAdditionalFieldProvider extends BaseAdditionalFieldProvider |
|
27 | -{ |
|
26 | +class IndexAdditionalFieldProvider extends BaseAdditionalFieldProvider { |
|
28 | 27 | /** |
29 | 28 | * Gets additional fields to render in the form to add/edit a task |
30 | 29 | * |
@@ -33,8 +32,7 @@ discard block |
||
33 | 32 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
34 | 33 | * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) |
35 | 34 | */ |
36 | - public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) |
|
37 | - { |
|
35 | + public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { |
|
38 | 36 | $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); |
39 | 37 | |
40 | 38 | /** @var BaseTask $task */ |
@@ -25,8 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * @access public |
27 | 27 | */ |
28 | -class HarvestAdditionalFieldProvider extends BaseAdditionalFieldProvider |
|
29 | -{ |
|
28 | +class HarvestAdditionalFieldProvider extends BaseAdditionalFieldProvider { |
|
30 | 29 | /** |
31 | 30 | * Gets additional fields to render in the form to add/edit a task |
32 | 31 | * |
@@ -35,8 +34,7 @@ discard block |
||
35 | 34 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
36 | 35 | * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) |
37 | 36 | */ |
38 | - public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) |
|
39 | - { |
|
37 | + public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { |
|
40 | 38 | $currentSchedulerModuleAction = $schedulerModule->getCurrentAction(); |
41 | 39 | |
42 | 40 | /** @var BaseTask $task */ |
@@ -23,10 +23,8 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class ReindexTask extends BaseTask |
|
27 | -{ |
|
28 | - public function execute() |
|
29 | - { |
|
26 | +class ReindexTask extends BaseTask { |
|
27 | + public function execute() { |
|
30 | 28 | $inputArray = []; |
31 | 29 | if ($this->dryRun) { |
32 | 30 | $inputArray['--dry-run'] = true; |