@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | use TYPO3\CMS\Core\Log\LogManager; |
| 29 | 29 | use TYPO3\CMS\Extbase\Utility\LocalizationUtility; |
| 30 | 30 | |
| 31 | -class ElasticSearch |
|
| 32 | -{ |
|
| 31 | +class ElasticSearch { |
|
| 33 | 32 | /** |
| 34 | 33 | * @var \EWW\Dpf\Configuration\ClientConfigurationManager |
| 35 | 34 | */ |
@@ -61,8 +60,7 @@ discard block |
||
| 61 | 60 | * @param int|null $clientPid |
| 62 | 61 | * @throws ElasticSearchMissingIndexNameException |
| 63 | 62 | */ |
| 64 | - public function __construct($clientPid = null) |
|
| 65 | - { |
|
| 63 | + public function __construct($clientPid = null) { |
|
| 66 | 64 | $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
| 67 | 65 | |
| 68 | 66 | $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class); |
@@ -103,8 +101,7 @@ discard block |
||
| 103 | 101 | /** |
| 104 | 102 | * @return string|null |
| 105 | 103 | */ |
| 106 | - protected function getIndexName() |
|
| 107 | - { |
|
| 104 | + protected function getIndexName() { |
|
| 108 | 105 | return $this->indexName; |
| 109 | 106 | } |
| 110 | 107 | |
@@ -113,8 +110,7 @@ discard block |
||
| 113 | 110 | * |
| 114 | 111 | * @param $indexName |
| 115 | 112 | */ |
| 116 | - protected function initializeIndex($indexName) |
|
| 117 | - { |
|
| 113 | + protected function initializeIndex($indexName) { |
|
| 118 | 114 | $paramsIndex = [ |
| 119 | 115 | 'index' => $indexName, |
| 120 | 116 | 'body' => [ |
@@ -252,8 +248,7 @@ discard block |
||
| 252 | 248 | * |
| 253 | 249 | * @param Document $document |
| 254 | 250 | */ |
| 255 | - public function index($document) |
|
| 256 | - { |
|
| 251 | + public function index($document) { |
|
| 257 | 252 | try { |
| 258 | 253 | $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document)); |
| 259 | 254 | } catch (\Throwable $throwable) { |
@@ -391,8 +386,7 @@ discard block |
||
| 391 | 386 | * |
| 392 | 387 | * @param string $identifier |
| 393 | 388 | */ |
| 394 | - public function delete($identifier) |
|
| 395 | - { |
|
| 389 | + public function delete($identifier) { |
|
| 396 | 390 | try { |
| 397 | 391 | |
| 398 | 392 | $params = [ |
@@ -418,8 +412,7 @@ discard block |
||
| 418 | 412 | /** |
| 419 | 413 | * @param $identifier |
| 420 | 414 | */ |
| 421 | - public function getDocument($identifier) |
|
| 422 | - { |
|
| 415 | + public function getDocument($identifier) { |
|
| 423 | 416 | $params = [ |
| 424 | 417 | 'index' => $this->getIndexName(), |
| 425 | 418 | 'id' => $identifier |
@@ -434,8 +427,7 @@ discard block |
||
| 434 | 427 | * @param array $query search query |
| 435 | 428 | * @return array result list |
| 436 | 429 | */ |
| 437 | - public function search($query, $type = null) |
|
| 438 | - { |
|
| 430 | + public function search($query, $type = null) { |
|
| 439 | 431 | try { |
| 440 | 432 | // define type and index |
| 441 | 433 | if (empty($query['index'])) { |
@@ -467,8 +459,7 @@ discard block |
||
| 467 | 459 | * Get the results |
| 468 | 460 | * @return mixed |
| 469 | 461 | */ |
| 470 | - public function getResults() |
|
| 471 | - { |
|
| 462 | + public function getResults() { |
|
| 472 | 463 | // return results from the last search request |
| 473 | 464 | return $this->results; |
| 474 | 465 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | use EWW\Dpf\Security\Security; |
| 20 | 20 | use TYPO3\CMS\Extbase\Utility\LocalizationUtility; |
| 21 | 21 | |
| 22 | -class QueryBuilder |
|
| 23 | -{ |
|
| 22 | +class QueryBuilder { |
|
| 24 | 23 | /** |
| 25 | 24 | * |
| 26 | 25 | * @var \EWW\Dpf\Configuration\ClientConfigurationManager |
@@ -62,8 +61,7 @@ discard block |
||
| 62 | 61 | public function buildQuery( |
| 63 | 62 | $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [], |
| 64 | 63 | $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null |
| 65 | - ) |
|
| 66 | - { |
|
| 64 | + ) { |
|
| 67 | 65 | |
| 68 | 66 | if ($workspaceFilter) { |
| 69 | 67 | $workspaceFilter = [0 => $workspaceFilter]; |
@@ -464,8 +462,7 @@ discard block |
||
| 464 | 462 | } |
| 465 | 463 | |
| 466 | 464 | |
| 467 | - protected function getSortScriptUniversityCollection($collection) |
|
| 468 | - { |
|
| 465 | + protected function getSortScriptUniversityCollection($collection) { |
|
| 469 | 466 | $script = "for (int i = 0; i < doc['collections'].length; ++i) {"; |
| 470 | 467 | $script .= " if (doc['collections'][i] == '".$collection."') {"; |
| 471 | 468 | $script .= " return '1';"; |
@@ -476,8 +473,7 @@ discard block |
||
| 476 | 473 | return $script; |
| 477 | 474 | } |
| 478 | 475 | |
| 479 | - protected function getSortScriptHasFiles() |
|
| 480 | - { |
|
| 476 | + protected function getSortScriptHasFiles() { |
|
| 481 | 477 | $script = "if (doc['hasFiles'].value == 'true') {"; |
| 482 | 478 | $script .= " return '1';"; |
| 483 | 479 | $script .= "}"; |
@@ -486,8 +482,7 @@ discard block |
||
| 486 | 482 | return $script; |
| 487 | 483 | } |
| 488 | 484 | |
| 489 | - protected function getSortScriptCreatorRole($feUserUid) |
|
| 490 | - { |
|
| 485 | + protected function getSortScriptCreatorRole($feUserUid) { |
|
| 491 | 486 | $script = "if (doc['creator'].value == '".$feUserUid."') {"; |
| 492 | 487 | $script .= " return '1';"; |
| 493 | 488 | $script .= "}"; |
@@ -503,8 +498,7 @@ discard block |
||
| 503 | 498 | } |
| 504 | 499 | |
| 505 | 500 | |
| 506 | - protected function getSortScriptState() |
|
| 507 | - { |
|
| 501 | + protected function getSortScriptState() { |
|
| 508 | 502 | $sortStates = []; |
| 509 | 503 | foreach (DocumentWorkflow::PLACES as $state) { |
| 510 | 504 | if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) { |
@@ -521,8 +515,7 @@ discard block |
||
| 521 | 515 | } |
| 522 | 516 | |
| 523 | 517 | |
| 524 | - protected function getSortScriptDoctype() |
|
| 525 | - { |
|
| 518 | + protected function getSortScriptDoctype() { |
|
| 526 | 519 | $sortDoctypes = []; |
| 527 | 520 | foreach ($this->documentTypeRepository->findAll() as $documentType) { |
| 528 | 521 | if ($documentType->getName() && $documentType->getDisplayname()) { |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * ParserGenerator |
| 25 | 25 | */ |
| 26 | -class ParserGenerator |
|
| 27 | -{ |
|
| 26 | +class ParserGenerator { |
|
| 28 | 27 | /** |
| 29 | 28 | * clientConfigurationManager |
| 30 | 29 | * |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * ParserGenerator constructor. |
| 94 | 93 | * @param int $clientPid |
| 95 | 94 | */ |
| 96 | - public function __construct($clientPid = 0) |
|
| 97 | - { |
|
| 95 | + public function __construct($clientPid = 0) { |
|
| 98 | 96 | $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class); |
| 99 | 97 | $this->clientConfigurationManager = $objectManager->get(ClientConfigurationManager::class); |
| 100 | 98 | |
@@ -128,16 +126,14 @@ discard block |
||
| 128 | 126 | * returns the mods xml string |
| 129 | 127 | * @return string mods xml |
| 130 | 128 | */ |
| 131 | - public function getXMLData() |
|
| 132 | - { |
|
| 129 | + public function getXMLData() { |
|
| 133 | 130 | $xml = $this->xmlData->saveXML(); |
| 134 | 131 | $xml = preg_replace("/eww=\"\d-\d-\d\"/", '${1}${2}${3}', $xml); |
| 135 | 132 | |
| 136 | 133 | return $xml; |
| 137 | 134 | } |
| 138 | 135 | |
| 139 | - public function transformInputXML($xml) |
|
| 140 | - { |
|
| 136 | + public function transformInputXML($xml) { |
|
| 141 | 137 | $XSLTransformator = new XSLTransformator(); |
| 142 | 138 | return $XSLTransformator->transformInputXML($xml); |
| 143 | 139 | } |
@@ -146,8 +142,7 @@ discard block |
||
| 146 | 142 | * @param $document |
| 147 | 143 | * @return string The transformed xml |
| 148 | 144 | */ |
| 149 | - public function getTransformedOutputXML($document) |
|
| 150 | - { |
|
| 145 | + public function getTransformedOutputXML($document) { |
|
| 151 | 146 | $XSLTransformator = new XSLTransformator(); |
| 152 | 147 | return $XSLTransformator->getTransformedOutputXML($document); |
| 153 | 148 | } |
@@ -157,8 +152,7 @@ discard block |
||
| 157 | 152 | * build mods from form array |
| 158 | 153 | * @param array $array structured form data array |
| 159 | 154 | */ |
| 160 | - public function buildXmlFromForm($array) |
|
| 161 | - { |
|
| 155 | + public function buildXmlFromForm($array) { |
|
| 162 | 156 | $fedoraNamespace = $this->clientConfigurationManager->getFedoraNamespace(); |
| 163 | 157 | |
| 164 | 158 | $this->xmlData = $this->xmlData; |
@@ -241,8 +235,7 @@ discard block |
||
| 241 | 235 | * @param xpath $xPath xPath expression |
| 242 | 236 | * @return xml |
| 243 | 237 | */ |
| 244 | - public function parseXPath($xPath) |
|
| 245 | - { |
|
| 238 | + public function parseXPath($xPath) { |
|
| 246 | 239 | |
| 247 | 240 | $this->parser->generateXmlFromXPath($xPath); |
| 248 | 241 | $xml = $this->parser->getXML(); |
@@ -250,8 +243,7 @@ discard block |
||
| 250 | 243 | return $xml; |
| 251 | 244 | } |
| 252 | 245 | |
| 253 | - public function parseXPathWrapped($xPath) |
|
| 254 | - { |
|
| 246 | + public function parseXPathWrapped($xPath) { |
|
| 255 | 247 | $this->parser->generateXmlFromXPath($xPath); |
| 256 | 248 | $xml = $this->parser->getXML(); |
| 257 | 249 | |
@@ -266,8 +258,7 @@ discard block |
||
| 266 | 258 | * @param string $value form value |
| 267 | 259 | * @return xml created xml |
| 268 | 260 | */ |
| 269 | - public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) |
|
| 270 | - { |
|
| 261 | + public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) { |
|
| 271 | 262 | if (!$attributeOnly) { |
| 272 | 263 | // Explode xPath |
| 273 | 264 | $newPath = explode('%', $xPath); |
@@ -466,8 +457,7 @@ discard block |
||
| 466 | 457 | * sets the file data and generates file xml |
| 467 | 458 | * @param string $value |
| 468 | 459 | */ |
| 469 | - public function setFileData($value = '') |
|
| 470 | - { |
|
| 460 | + public function setFileData($value = '') { |
|
| 471 | 461 | $this->files = $value; |
| 472 | 462 | $this->generateFileXML(); |
| 473 | 463 | } |