@@ -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; |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @access public |
| 31 | 31 | */ |
| 32 | -class BaseAdditionalFieldProvider implements AdditionalFieldProviderInterface |
|
| 33 | -{ |
|
| 32 | +class BaseAdditionalFieldProvider implements AdditionalFieldProviderInterface { |
|
| 34 | 33 | /** |
| 35 | 34 | * Gets additional fields to render in the form to add/edit a task |
| 36 | 35 | * |
@@ -39,8 +38,7 @@ discard block |
||
| 39 | 38 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
| 40 | 39 | * @return array A two dimensional array, array('Identifier' => array('fieldId' => array('code' => '', 'label' => '', 'cshKey' => '', 'cshLabel' => '')) |
| 41 | 40 | */ |
| 42 | - public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) |
|
| 43 | - { |
|
| 41 | + public function getAdditionalFields(array &$taskInfo, $task, SchedulerModuleController $schedulerModule) { |
|
| 44 | 42 | return []; |
| 45 | 43 | } |
| 46 | 44 | |
@@ -51,8 +49,7 @@ discard block |
||
| 51 | 49 | * @param \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $schedulerModule Reference to the scheduler backend module |
| 52 | 50 | * @return bool TRUE if validation was ok (or selected class is not relevant), FALSE otherwise |
| 53 | 51 | */ |
| 54 | - public function validateAdditionalFields(array &$submittedData, SchedulerModuleController $schedulerModule) |
|
| 55 | - { |
|
| 52 | + public function validateAdditionalFields(array &$submittedData, SchedulerModuleController $schedulerModule) { |
|
| 56 | 53 | $fieldsValid = true; |
| 57 | 54 | |
| 58 | 55 | Helper::getLanguageService()->includeLLFile('EXT:dlf/Resources/Private/Language/locallang_tasks.xlf'); |
@@ -130,8 +127,7 @@ discard block |
||
| 130 | 127 | * @param BaseTask $task Reference to the scheduler backend module |
| 131 | 128 | * @return void |
| 132 | 129 | */ |
| 133 | - public function saveAdditionalFields(array $submittedData, AbstractTask $task) |
|
| 134 | - { |
|
| 130 | + public function saveAdditionalFields(array $submittedData, AbstractTask $task) { |
|
| 135 | 131 | /** @var BaseTask $task */ |
| 136 | 132 | $task->setDryRun(!empty($submittedData['dryRun'])); |
| 137 | 133 | if (isset($submittedData['doc'])) { |
@@ -23,10 +23,8 @@ |
||
| 23 | 23 | * |
| 24 | 24 | * @access public |
| 25 | 25 | */ |
| 26 | -class HarvestTask extends BaseTask |
|
| 27 | -{ |
|
| 28 | - public function execute() |
|
| 29 | - { |
|
| 26 | +class HarvestTask extends BaseTask { |
|
| 27 | + public function execute() { |
|
| 30 | 28 | $inputArray = []; |
| 31 | 29 | if ($this->dryRun) { |
| 32 | 30 | $inputArray['--dry-run'] = true; |