@@ -24,8 +24,7 @@ discard block |
||
| 24 | 24 | * @subpackage dlf |
| 25 | 25 | * @access public |
| 26 | 26 | */ |
| 27 | -class ResultDocument |
|
| 28 | -{ |
|
| 27 | +class ResultDocument { |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * The identifier |
@@ -134,8 +133,7 @@ discard block |
||
| 134 | 133 | * |
| 135 | 134 | * @return void |
| 136 | 135 | */ |
| 137 | - public function __construct($record, $highlighting, $fields) |
|
| 138 | - { |
|
| 136 | + public function __construct($record, $highlighting, $fields) { |
|
| 139 | 137 | $this->id = $record[$fields['id']]; |
| 140 | 138 | $this->uid = $record[$fields['uid']]; |
| 141 | 139 | $this->page = $record[$fields['page']]; |
@@ -160,8 +158,7 @@ discard block |
||
| 160 | 158 | * |
| 161 | 159 | * @return string The result's record identifier |
| 162 | 160 | */ |
| 163 | - public function getId() |
|
| 164 | - { |
|
| 161 | + public function getId() { |
|
| 165 | 162 | return $this->id; |
| 166 | 163 | } |
| 167 | 164 | |
@@ -172,8 +169,7 @@ discard block |
||
| 172 | 169 | * |
| 173 | 170 | * @return string|null The result's record unified identifier |
| 174 | 171 | */ |
| 175 | - public function getUid() |
|
| 176 | - { |
|
| 172 | + public function getUid() { |
|
| 177 | 173 | return $this->uid; |
| 178 | 174 | } |
| 179 | 175 | |
@@ -184,8 +180,7 @@ discard block |
||
| 184 | 180 | * |
| 185 | 181 | * @return int The result's record page |
| 186 | 182 | */ |
| 187 | - public function getPage() |
|
| 188 | - { |
|
| 183 | + public function getPage() { |
|
| 189 | 184 | return $this->page; |
| 190 | 185 | } |
| 191 | 186 | |
@@ -196,8 +191,7 @@ discard block |
||
| 196 | 191 | * |
| 197 | 192 | * @return string All result's record snippets imploded to one string |
| 198 | 193 | */ |
| 199 | - public function getSnippets() |
|
| 200 | - { |
|
| 194 | + public function getSnippets() { |
|
| 201 | 195 | return $this->snippets; |
| 202 | 196 | } |
| 203 | 197 | |
@@ -208,8 +202,7 @@ discard block |
||
| 208 | 202 | * |
| 209 | 203 | * @return string |
| 210 | 204 | */ |
| 211 | - public function getThumbnail() |
|
| 212 | - { |
|
| 205 | + public function getThumbnail() { |
|
| 213 | 206 | return $this->thumbnail; |
| 214 | 207 | } |
| 215 | 208 | |
@@ -220,8 +213,7 @@ discard block |
||
| 220 | 213 | * |
| 221 | 214 | * @return string |
| 222 | 215 | */ |
| 223 | - public function getTitle() |
|
| 224 | - { |
|
| 216 | + public function getTitle() { |
|
| 225 | 217 | return $this->title; |
| 226 | 218 | } |
| 227 | 219 | |
@@ -232,8 +224,7 @@ discard block |
||
| 232 | 224 | * |
| 233 | 225 | * @return boolean |
| 234 | 226 | */ |
| 235 | - public function getToplevel() |
|
| 236 | - { |
|
| 227 | + public function getToplevel() { |
|
| 237 | 228 | return $this->toplevel; |
| 238 | 229 | } |
| 239 | 230 | |
@@ -244,8 +235,7 @@ discard block |
||
| 244 | 235 | * |
| 245 | 236 | * @return string |
| 246 | 237 | */ |
| 247 | - public function getType() |
|
| 248 | - { |
|
| 238 | + public function getType() { |
|
| 249 | 239 | return $this->type; |
| 250 | 240 | } |
| 251 | 241 | |
@@ -256,8 +246,7 @@ discard block |
||
| 256 | 246 | * |
| 257 | 247 | * @return array(Page) All result's pages which contain search phrase |
| 258 | 248 | */ |
| 259 | - public function getPages() |
|
| 260 | - { |
|
| 249 | + public function getPages() { |
|
| 261 | 250 | return $this->pages; |
| 262 | 251 | } |
| 263 | 252 | |
@@ -268,8 +257,7 @@ discard block |
||
| 268 | 257 | * |
| 269 | 258 | * @return array(Region) All result's regions which contain search phrase |
| 270 | 259 | */ |
| 271 | - public function getRegions() |
|
| 272 | - { |
|
| 260 | + public function getRegions() { |
|
| 273 | 261 | return $this->regions; |
| 274 | 262 | } |
| 275 | 263 | |
@@ -280,8 +268,7 @@ discard block |
||
| 280 | 268 | * |
| 281 | 269 | * @return array(Highlight) All result's highlights of search phrase |
| 282 | 270 | */ |
| 283 | - public function getHighlights() |
|
| 284 | - { |
|
| 271 | + public function getHighlights() { |
|
| 285 | 272 | return $this->highlights; |
| 286 | 273 | } |
| 287 | 274 | |
@@ -292,8 +279,7 @@ discard block |
||
| 292 | 279 | * |
| 293 | 280 | * @return array(string) All result's highlights of search phrase |
| 294 | 281 | */ |
| 295 | - public function getHighlightsIds() |
|
| 296 | - { |
|
| 282 | + public function getHighlightsIds() { |
|
| 297 | 283 | $highlightsIds = []; |
| 298 | 284 | foreach ($this->highlights as $highlight) { |
| 299 | 285 | array_push($highlightsIds, $highlight->getId()); |
@@ -309,8 +295,7 @@ discard block |
||
| 309 | 295 | * |
| 310 | 296 | * @return void |
| 311 | 297 | */ |
| 312 | - private function parseSnippets() |
|
| 313 | - { |
|
| 298 | + private function parseSnippets() { |
|
| 314 | 299 | $snippetArray = $this->getArrayByIndex('text'); |
| 315 | 300 | |
| 316 | 301 | $this->snippets = !empty($snippetArray) ? implode(' [...] ', $snippetArray) : ''; |
@@ -324,8 +309,7 @@ discard block |
||
| 324 | 309 | * |
| 325 | 310 | * @return void |
| 326 | 311 | */ |
| 327 | - private function parsePages() |
|
| 328 | - { |
|
| 312 | + private function parsePages() { |
|
| 329 | 313 | $pageArray = $this->getArrayByIndex('pages'); |
| 330 | 314 | |
| 331 | 315 | $i = 0; |
@@ -345,8 +329,7 @@ discard block |
||
| 345 | 329 | * |
| 346 | 330 | * @return void |
| 347 | 331 | */ |
| 348 | - private function parseRegions() |
|
| 349 | - { |
|
| 332 | + private function parseRegions() { |
|
| 350 | 333 | $regionArray = $this->getArrayByIndex('regions'); |
| 351 | 334 | |
| 352 | 335 | $i = 0; |
@@ -366,8 +349,7 @@ discard block |
||
| 366 | 349 | * |
| 367 | 350 | * @return void |
| 368 | 351 | */ |
| 369 | - private function parseHighlights() |
|
| 370 | - { |
|
| 352 | + private function parseHighlights() { |
|
| 371 | 353 | $highlightArray = $this->getArrayByIndex('highlights'); |
| 372 | 354 | |
| 373 | 355 | foreach ($highlightArray as $highlights) { |
@@ -388,8 +370,7 @@ discard block |
||
| 388 | 370 | * |
| 389 | 371 | * @return array |
| 390 | 372 | */ |
| 391 | - private function getArrayByIndex($index) |
|
| 392 | - { |
|
| 373 | + private function getArrayByIndex($index) { |
|
| 393 | 374 | $objectArray = []; |
| 394 | 375 | foreach ($this->snippetsForRecord as $snippet) { |
| 395 | 376 | if (!empty($snippet[$index])) { |
@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | * @subpackage dlf |
| 33 | 33 | * @access public |
| 34 | 34 | */ |
| 35 | -class Indexer |
|
| 36 | -{ |
|
| 35 | +class Indexer { |
|
| 37 | 36 | /** |
| 38 | 37 | * The extension key |
| 39 | 38 | * |
@@ -93,8 +92,7 @@ discard block |
||
| 93 | 92 | * |
| 94 | 93 | * @return bool true on success or false on failure |
| 95 | 94 | */ |
| 96 | - public static function add(Document $document) |
|
| 97 | - { |
|
| 95 | + public static function add(Document $document) { |
|
| 98 | 96 | if (in_array($document->getUid(), self::$processedDocs)) { |
| 99 | 97 | return true; |
| 100 | 98 | } elseif (self::solrConnect($document->getSolrcore(), $document->getPid())) { |
@@ -209,8 +207,7 @@ discard block |
||
| 209 | 207 | * |
| 210 | 208 | * @return string The field's dynamic index name |
| 211 | 209 | */ |
| 212 | - public static function getIndexFieldName($index_name, $pid = 0) |
|
| 213 | - { |
|
| 210 | + public static function getIndexFieldName($index_name, $pid = 0) { |
|
| 214 | 211 | // Sanitize input. |
| 215 | 212 | $pid = max(intval($pid), 0); |
| 216 | 213 | if (!$pid) { |
@@ -236,8 +233,7 @@ discard block |
||
| 236 | 233 | * |
| 237 | 234 | * @return void |
| 238 | 235 | */ |
| 239 | - protected static function loadIndexConf($pid) |
|
| 240 | - { |
|
| 236 | + protected static function loadIndexConf($pid) { |
|
| 241 | 237 | if (!self::$fieldsLoaded) { |
| 242 | 238 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
| 243 | 239 | ->getQueryBuilderForTable('tx_dlf_metadata'); |
@@ -307,8 +303,7 @@ discard block |
||
| 307 | 303 | * |
| 308 | 304 | * @return bool true on success or false on failure |
| 309 | 305 | */ |
| 310 | - protected static function processLogical(Document $document, array $logicalUnit) |
|
| 311 | - { |
|
| 306 | + protected static function processLogical(Document $document, array $logicalUnit) { |
|
| 312 | 307 | $success = true; |
| 313 | 308 | $doc = $document->getDoc(); |
| 314 | 309 | $doc->cPid = $document->getPid(); |
@@ -436,8 +431,7 @@ discard block |
||
| 436 | 431 | * |
| 437 | 432 | * @return bool true on success or false on failure |
| 438 | 433 | */ |
| 439 | - protected static function processPhysical(Document $document, $page, array $physicalUnit) |
|
| 440 | - { |
|
| 434 | + protected static function processPhysical(Document $document, $page, array $physicalUnit) { |
|
| 441 | 435 | $doc = $document->getDoc(); |
| 442 | 436 | $doc->cPid = $document->getPid(); |
| 443 | 437 | if ($doc->hasFulltext && $fullText = $doc->getFullText($physicalUnit['id'])) { |
@@ -525,8 +519,7 @@ discard block |
||
| 525 | 519 | * |
| 526 | 520 | * @return bool true on success or false on failure |
| 527 | 521 | */ |
| 528 | - protected static function solrConnect($core, $pid = 0) |
|
| 529 | - { |
|
| 522 | + protected static function solrConnect($core, $pid = 0) { |
|
| 530 | 523 | // Get Solr instance. |
| 531 | 524 | if (!self::$solr) { |
| 532 | 525 | // Connect to Solr server. |
@@ -549,8 +542,7 @@ discard block |
||
| 549 | 542 | * |
| 550 | 543 | * @access private |
| 551 | 544 | */ |
| 552 | - private function __construct() |
|
| 553 | - { |
|
| 545 | + private function __construct() { |
|
| 554 | 546 | // This is a static class, thus no instances should be created. |
| 555 | 547 | } |
| 556 | 548 | } |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | * @subpackage dlf |
| 39 | 39 | * @access public |
| 40 | 40 | */ |
| 41 | -class BaseCommand extends Command |
|
| 42 | -{ |
|
| 41 | +class BaseCommand extends Command { |
|
| 43 | 42 | /** |
| 44 | 43 | * @var CollectionRepository |
| 45 | 44 | */ |
@@ -79,8 +78,7 @@ discard block |
||
| 79 | 78 | * |
| 80 | 79 | * @return bool |
| 81 | 80 | */ |
| 82 | - protected function initializeRepositories($storagePid) |
|
| 83 | - { |
|
| 81 | + protected function initializeRepositories($storagePid) { |
|
| 84 | 82 | if (MathUtility::canBeInterpretedAsInteger($storagePid)) { |
| 85 | 83 | $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class); |
| 86 | 84 | $frameworkConfiguration = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); |
@@ -159,8 +157,7 @@ discard block |
||
| 159 | 157 | * |
| 160 | 158 | * @return bool true on success |
| 161 | 159 | */ |
| 162 | - protected function saveToDatabase(Document $document) |
|
| 163 | - { |
|
| 160 | + protected function saveToDatabase(Document $document) { |
|
| 164 | 161 | $success = false; |
| 165 | 162 | |
| 166 | 163 | $doc = $document->getDoc(); |
@@ -268,8 +265,7 @@ discard block |
||
| 268 | 265 | * |
| 269 | 266 | * @return int The parent document's id. |
| 270 | 267 | */ |
| 271 | - protected function getParentDocumentUidForSaving(Document $document) |
|
| 272 | - { |
|
| 268 | + protected function getParentDocumentUidForSaving(Document $document) { |
|
| 273 | 269 | $doc = $document->getDoc(); |
| 274 | 270 | |
| 275 | 271 | if ($doc !== null) { |
@@ -33,16 +33,14 @@ discard block |
||
| 33 | 33 | * @subpackage dlf |
| 34 | 34 | * @access public |
| 35 | 35 | */ |
| 36 | -class IndexCommand extends BaseCommand |
|
| 37 | -{ |
|
| 36 | +class IndexCommand extends BaseCommand { |
|
| 38 | 37 | |
| 39 | 38 | /** |
| 40 | 39 | * Configure the command by defining the name, options and arguments |
| 41 | 40 | * |
| 42 | 41 | * @return void |
| 43 | 42 | */ |
| 44 | - public function configure() |
|
| 45 | - { |
|
| 43 | + public function configure() { |
|
| 46 | 44 | $this |
| 47 | 45 | ->setDescription('Index single document into database and Solr.') |
| 48 | 46 | ->setHelp('') |
@@ -86,8 +84,7 @@ discard block |
||
| 86 | 84 | * |
| 87 | 85 | * @return int |
| 88 | 86 | */ |
| 89 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 90 | - { |
|
| 87 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 91 | 88 | $dryRun = $input->getOption('dry-run') != false ? true : false; |
| 92 | 89 | |
| 93 | 90 | $io = new SymfonyStyle($input, $output); |
@@ -32,15 +32,13 @@ discard block |
||
| 32 | 32 | * @subpackage dlf |
| 33 | 33 | * @access public |
| 34 | 34 | */ |
| 35 | -class ReindexCommand extends BaseCommand |
|
| 36 | -{ |
|
| 35 | +class ReindexCommand extends BaseCommand { |
|
| 37 | 36 | /** |
| 38 | 37 | * Configure the command by defining the name, options and arguments |
| 39 | 38 | * |
| 40 | 39 | * @return void |
| 41 | 40 | */ |
| 42 | - public function configure() |
|
| 43 | - { |
|
| 41 | + public function configure() { |
|
| 44 | 42 | $this |
| 45 | 43 | ->setDescription('Reindex a collection into database and Solr.') |
| 46 | 44 | ->setHelp('') |
@@ -90,8 +88,7 @@ discard block |
||
| 90 | 88 | * |
| 91 | 89 | * @return int |
| 92 | 90 | */ |
| 93 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 94 | - { |
|
| 91 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 95 | 92 | $dryRun = $input->getOption('dry-run') != false ? true : false; |
| 96 | 93 | |
| 97 | 94 | $io = new SymfonyStyle($input, $output); |
@@ -36,15 +36,13 @@ discard block |
||
| 36 | 36 | * @subpackage dlf |
| 37 | 37 | * @access public |
| 38 | 38 | */ |
| 39 | -class HarvestCommand extends BaseCommand |
|
| 40 | -{ |
|
| 39 | +class HarvestCommand extends BaseCommand { |
|
| 41 | 40 | /** |
| 42 | 41 | * Configure the command by defining the name, options and arguments |
| 43 | 42 | * |
| 44 | 43 | * @return void |
| 45 | 44 | */ |
| 46 | - public function configure() |
|
| 47 | - { |
|
| 45 | + public function configure() { |
|
| 48 | 46 | $this |
| 49 | 47 | ->setDescription('Harvest OAI-PMH contents into database and Solr.') |
| 50 | 48 | ->setHelp('') |
@@ -100,8 +98,7 @@ discard block |
||
| 100 | 98 | * |
| 101 | 99 | * @return int |
| 102 | 100 | */ |
| 103 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 104 | - { |
|
| 101 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 105 | 102 | $dryRun = $input->getOption('dry-run') != false ? true : false; |
| 106 | 103 | |
| 107 | 104 | $io = new SymfonyStyle($input, $output); |
@@ -265,8 +262,7 @@ discard block |
||
| 265 | 262 | * |
| 266 | 263 | * @return void |
| 267 | 264 | */ |
| 268 | - protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io) |
|
| 269 | - { |
|
| 265 | + protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io) { |
|
| 270 | 266 | $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:' . "\n " . $exception->getMessage()); |
| 271 | 267 | } |
| 272 | 268 | } |
@@ -23,8 +23,7 @@ |
||
| 23 | 23 | * Class MigrateSettings |
| 24 | 24 | * @internal |
| 25 | 25 | */ |
| 26 | -class MigrateSettings implements UpgradeWizardInterface |
|
| 27 | -{ |
|
| 26 | +class MigrateSettings implements UpgradeWizardInterface { |
|
| 28 | 27 | |
| 29 | 28 | /** |
| 30 | 29 | * Return the identifier for this wizard |
@@ -153,8 +153,7 @@ discard block |
||
| 153 | 153 | * @return array|int |
| 154 | 154 | * @throws \RuntimeException |
| 155 | 155 | */ |
| 156 | - protected function getRecordsFromTable($countOnly = false) |
|
| 157 | - { |
|
| 156 | + protected function getRecordsFromTable($countOnly = false) { |
|
| 158 | 157 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
| 159 | 158 | $allResults = []; |
| 160 | 159 | $numResults = 0; |
@@ -234,8 +233,7 @@ discard block |
||
| 234 | 233 | * @param array $row |
| 235 | 234 | * @throws \Exception |
| 236 | 235 | */ |
| 237 | - protected function migrateField($table, $row) |
|
| 238 | - { |
|
| 236 | + protected function migrateField($table, $row) { |
|
| 239 | 237 | $fieldItem = trim($row[$this->fieldsToMigrate[$table]]); |
| 240 | 238 | |
| 241 | 239 | if (empty($fieldItem) || is_numeric($fieldItem)) { |
@@ -19,13 +19,11 @@ |
||
| 19 | 19 | /** |
| 20 | 20 | * Add inline JavaScript code to footer * |
| 21 | 21 | */ |
| 22 | -class JsFooterViewHelper extends AbstractViewHelper |
|
| 23 | -{ |
|
| 22 | +class JsFooterViewHelper extends AbstractViewHelper { |
|
| 24 | 23 | /** |
| 25 | 24 | * Initialize arguments. |
| 26 | 25 | */ |
| 27 | - public function initializeArguments() |
|
| 28 | - { |
|
| 26 | + public function initializeArguments() { |
|
| 29 | 27 | parent::initializeArguments(); |
| 30 | 28 | $this->registerArgument('inlineCode', 'string', 'Inline JavaScript', true); |
| 31 | 29 | } |