We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -14,19 +14,19 @@ |
||
| 14 | 14 | } |
| 15 | 15 | // Define constants. |
| 16 | 16 | if (!defined('DEVLOG_SEVERITY_OK')) { |
| 17 | - define ('DEVLOG_SEVERITY_OK', -1); |
|
| 17 | + define('DEVLOG_SEVERITY_OK', -1); |
|
| 18 | 18 | } |
| 19 | 19 | if (!defined('DEVLOG_SEVERITY_INFO')) { |
| 20 | - define ('DEVLOG_SEVERITY_INFO', 0); |
|
| 20 | + define('DEVLOG_SEVERITY_INFO', 0); |
|
| 21 | 21 | } |
| 22 | 22 | if (!defined('DEVLOG_SEVERITY_NOTICE')) { |
| 23 | - define ('DEVLOG_SEVERITY_NOTICE', 1); |
|
| 23 | + define('DEVLOG_SEVERITY_NOTICE', 1); |
|
| 24 | 24 | } |
| 25 | 25 | if (!defined('DEVLOG_SEVERITY_WARNING')) { |
| 26 | - define ('DEVLOG_SEVERITY_WARNING', 2); |
|
| 26 | + define('DEVLOG_SEVERITY_WARNING', 2); |
|
| 27 | 27 | } |
| 28 | 28 | if (!defined('DEVLOG_SEVERITY_ERROR')) { |
| 29 | - define ('DEVLOG_SEVERITY_ERROR', 3); |
|
| 29 | + define('DEVLOG_SEVERITY_ERROR', 3); |
|
| 30 | 30 | } |
| 31 | 31 | // Register plugins. |
| 32 | 32 | \Kitodo\Dlf\Hooks\ExtensionManagementUtility::addPItoST43($_EXTKEY, \Kitodo\Dlf\Plugin\AudioPlayer::class, '_audioplayer', 'list_type', TRUE); |
@@ -27,13 +27,11 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * Reindex a collection into database and solr. |
| 29 | 29 | */ |
| 30 | -class ReindexCommand extends Command |
|
| 31 | -{ |
|
| 30 | +class ReindexCommand extends Command { |
|
| 32 | 31 | /** |
| 33 | 32 | * Configure the command by defining the name, options and arguments |
| 34 | 33 | */ |
| 35 | - public function configure() |
|
| 36 | - { |
|
| 34 | + public function configure() { |
|
| 37 | 35 | $this |
| 38 | 36 | ->setDescription('Reindex a collection into database and solr.') |
| 39 | 37 | ->setHelp('') |
@@ -75,8 +73,7 @@ discard block |
||
| 75 | 73 | * @param InputInterface $input |
| 76 | 74 | * @param OutputInterface $output |
| 77 | 75 | */ |
| 78 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 79 | - { |
|
| 76 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 80 | 77 | // Make sure the _cli_ user is loaded |
| 81 | 78 | Bootstrap::getInstance()->initializeBackendAuthentication(); |
| 82 | 79 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | ->setHelp('') |
| 40 | 40 | ->addOption( |
| 41 | 41 | 'dry-run', |
| 42 | - null, |
|
| 42 | + NULL, |
|
| 43 | 43 | InputOption::VALUE_NONE, |
| 44 | 44 | 'If this option is set, the files will not actually be processed but the location URI is shown.' |
| 45 | 45 | ) |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | // Make sure the _cli_ user is loaded |
| 81 | 81 | Bootstrap::getInstance()->initializeBackendAuthentication(); |
| 82 | 82 | |
| 83 | - $dryRun = $input->getOption('dry-run') != false ? true : false; |
|
| 83 | + $dryRun = $input->getOption('dry-run') != FALSE ? TRUE : FALSE; |
|
| 84 | 84 | |
| 85 | 85 | $io = new SymfonyStyle($input, $output); |
| 86 | 86 | $io->title($this->getDescription()); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $documents = $this->getAllDocuments($startingPoint); |
| 126 | 126 | } else { |
| 127 | 127 | // coll may be a single integer, a list of integer |
| 128 | - if (empty(array_filter(GeneralUtility::intExplode(',', $input->getOption('coll'), true)))) { |
|
| 128 | + if (empty(array_filter(GeneralUtility::intExplode(',', $input->getOption('coll'), TRUE)))) { |
|
| 129 | 129 | $io->error('ERROR: "' . $input->getOption('coll') . '" is not a valid list of collection UIDs for --coll|-c.'); |
| 130 | 130 | exit(1); |
| 131 | 131 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $queryBuilder->expr()->in( |
| 231 | 231 | 'tx_dlf_collections_join.uid', |
| 232 | 232 | $queryBuilder->createNamedParameter( |
| 233 | - GeneralUtility::intExplode(',', $collIds, true), |
|
| 233 | + GeneralUtility::intExplode(',', $collIds, TRUE), |
|
| 234 | 234 | Connection::PARAM_INT_ARRAY |
| 235 | 235 | ) |
| 236 | 236 | ), |
@@ -226,23 +226,23 @@ discard block |
||
| 226 | 226 | ) |
| 227 | 227 | ) |
| 228 | 228 | -> where( |
| 229 | - $queryBuilder->expr()->andX( |
|
| 230 | - $queryBuilder->expr()->in( |
|
| 231 | - 'tx_dlf_collections_join.uid', |
|
| 232 | - $queryBuilder->createNamedParameter( |
|
| 233 | - GeneralUtility::intExplode(',', $collIds, true), |
|
| 234 | - Connection::PARAM_INT_ARRAY |
|
| 235 | - ) |
|
| 236 | - ), |
|
| 237 | - $queryBuilder->expr()->eq( |
|
| 238 | - 'tx_dlf_collections_join.pid', |
|
| 239 | - $queryBuilder->createNamedParameter($pageId, Connection::PARAM_INT) |
|
| 240 | - ), |
|
| 241 | - $queryBuilder->expr()->eq( |
|
| 242 | - 'tx_dlf_relations_joins.ident', |
|
| 243 | - $queryBuilder->createNamedParameter('docs_colls') |
|
| 244 | - ) |
|
| 245 | - ) |
|
| 229 | + $queryBuilder->expr()->andX( |
|
| 230 | + $queryBuilder->expr()->in( |
|
| 231 | + 'tx_dlf_collections_join.uid', |
|
| 232 | + $queryBuilder->createNamedParameter( |
|
| 233 | + GeneralUtility::intExplode(',', $collIds, true), |
|
| 234 | + Connection::PARAM_INT_ARRAY |
|
| 235 | + ) |
|
| 236 | + ), |
|
| 237 | + $queryBuilder->expr()->eq( |
|
| 238 | + 'tx_dlf_collections_join.pid', |
|
| 239 | + $queryBuilder->createNamedParameter($pageId, Connection::PARAM_INT) |
|
| 240 | + ), |
|
| 241 | + $queryBuilder->expr()->eq( |
|
| 242 | + 'tx_dlf_relations_joins.ident', |
|
| 243 | + $queryBuilder->createNamedParameter('docs_colls') |
|
| 244 | + ) |
|
| 245 | + ) |
|
| 246 | 246 | ) |
| 247 | 247 | ->groupBy('tx_dlf_documents.uid') |
| 248 | 248 | ->orderBy('tx_dlf_documents.uid', 'ASC') |
@@ -274,10 +274,10 @@ discard block |
||
| 274 | 274 | ->select('uid') |
| 275 | 275 | ->from('tx_dlf_documents') |
| 276 | 276 | -> where( |
| 277 | - $queryBuilder->expr()->eq( |
|
| 278 | - 'tx_dlf_documents.pid', |
|
| 279 | - $queryBuilder->createNamedParameter($pageId, Connection::PARAM_INT) |
|
| 280 | - ) |
|
| 277 | + $queryBuilder->expr()->eq( |
|
| 278 | + 'tx_dlf_documents.pid', |
|
| 279 | + $queryBuilder->createNamedParameter($pageId, Connection::PARAM_INT) |
|
| 280 | + ) |
|
| 281 | 281 | ) |
| 282 | 282 | ->orderBy('tx_dlf_documents.uid', 'ASC') |
| 283 | 283 | ->execute(); |
@@ -87,17 +87,17 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $startingPoint = 0; |
| 89 | 89 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('pid'))) { |
| 90 | - $startingPoint = MathUtility::forceIntegerInRange((int)$input->getOption('pid'), 0); |
|
| 90 | + $startingPoint = MathUtility::forceIntegerInRange((int) $input->getOption('pid'), 0); |
|
| 91 | 91 | } |
| 92 | 92 | if ($startingPoint == 0) { |
| 93 | - $io->error('ERROR: No valid PID (' . $startingPoint . ') given.'); |
|
| 93 | + $io->error('ERROR: No valid PID ('.$startingPoint.') given.'); |
|
| 94 | 94 | exit(1); |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if ($input->getOption('solr')) { |
| 98 | 98 | $allSolrCores = $this->getSolrCores($startingPoint); |
| 99 | 99 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('solr'))) { |
| 100 | - $solrCoreUid = MathUtility::forceIntegerInRange((int)$input->getOption('solr'), 0); |
|
| 100 | + $solrCoreUid = MathUtility::forceIntegerInRange((int) $input->getOption('solr'), 0); |
|
| 101 | 101 | } else { |
| 102 | 102 | $solrCoreName = $input->getOption('solr'); |
| 103 | 103 | $solrCoreUid = $allSolrCores[$solrCoreName]; |
@@ -105,13 +105,13 @@ discard block |
||
| 105 | 105 | // Abort if solrCoreUid is empty or not in the array of allowed solr cores. |
| 106 | 106 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 107 | 107 | foreach ($allSolrCores as $index_name => $uid) { |
| 108 | - $output_solrCores .= ' ' . $uid . ' : ' . $index_name ."\n"; |
|
| 108 | + $output_solrCores .= ' '.$uid.' : '.$index_name."\n"; |
|
| 109 | 109 | } |
| 110 | 110 | if (empty($output_solrCores)) { |
| 111 | - $io->error('ERROR: No valid solr core ("'. $input->getOption('solr') . '") given. ' . "No valid cores found on PID " . $startingPoint .".\n" . $output_solrCores); |
|
| 111 | + $io->error('ERROR: No valid solr core ("'.$input->getOption('solr').'") given. '."No valid cores found on PID ".$startingPoint.".\n".$output_solrCores); |
|
| 112 | 112 | exit(1); |
| 113 | 113 | } else { |
| 114 | - $io->error('ERROR: No valid solr core ("'. $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . $output_solrCores); |
|
| 114 | + $io->error('ERROR: No valid solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".$output_solrCores); |
|
| 115 | 115 | exit(1); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | } else { |
| 127 | 127 | // coll may be a single integer, a list of integer |
| 128 | 128 | if (empty(array_filter(GeneralUtility::intExplode(',', $input->getOption('coll'), true)))) { |
| 129 | - $io->error('ERROR: "' . $input->getOption('coll') . '" is not a valid list of collection UIDs for --coll|-c.'); |
|
| 129 | + $io->error('ERROR: "'.$input->getOption('coll').'" is not a valid list of collection UIDs for --coll|-c.'); |
|
| 130 | 130 | exit(1); |
| 131 | 131 | } |
| 132 | 132 | $documents = $this->getDocumentsToProceed($input->getOption('coll'), $startingPoint); |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | $doc = Document::getInstance($document, $startingPoint, TRUE); |
| 137 | 137 | if ($doc->ready) { |
| 138 | 138 | if ($dryRun) { |
| 139 | - $io->writeln('DRY RUN: Would index ' . $id . '/' . count($documents) . ' ' . $doc->uid . ' ' . $doc->location . ' on UID ' . $startingPoint . ' and solr core ' . $solrCoreUid .'.'); |
|
| 139 | + $io->writeln('DRY RUN: Would index '.$id.'/'.count($documents).' '.$doc->uid.' '.$doc->location.' on UID '.$startingPoint.' and solr core '.$solrCoreUid.'.'); |
|
| 140 | 140 | } else { |
| 141 | 141 | if ($io->isVerbose()) { |
| 142 | - $io->writeln(date('Y-m-d H:i:s') . ' ' . $id . '/' . count($documents) . ' ' . $doc->uid . ' ' . $doc->location . ' on UID ' . $startingPoint . ' and solr core ' . $solrCoreUid .'.'); |
|
| 142 | + $io->writeln(date('Y-m-d H:i:s').' '.$id.'/'.count($documents).' '.$doc->uid.' '.$doc->location.' on UID '.$startingPoint.' and solr core '.$solrCoreUid.'.'); |
|
| 143 | 143 | } |
| 144 | 144 | // ...and save it to the database... |
| 145 | 145 | if (!$doc->save($startingPoint, $solrCoreUid)) { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | ->getQueryBuilderForTable('tx_dlf_solrcores'); |
| 170 | 170 | |
| 171 | 171 | $solrCores = []; |
| 172 | - $pageId = (int)$pageId; |
|
| 172 | + $pageId = (int) $pageId; |
|
| 173 | 173 | $result = $queryBuilder |
| 174 | 174 | ->select('uid', 'index_name') |
| 175 | 175 | ->from('tx_dlf_solrcores') |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | ->getQueryBuilderForTable('tx_dlf_documents'); |
| 204 | 204 | |
| 205 | 205 | $documents = []; |
| 206 | - $pageId = (int)$pageId; |
|
| 206 | + $pageId = (int) $pageId; |
|
| 207 | 207 | $result = $queryBuilder |
| 208 | 208 | ->select('tx_dlf_documents.uid') |
| 209 | 209 | ->from('tx_dlf_documents') |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | ->getQueryBuilderForTable('tx_dlf_documents'); |
| 270 | 270 | |
| 271 | 271 | $documents = []; |
| 272 | - $pageId = (int)$pageId; |
|
| 272 | + $pageId = (int) $pageId; |
|
| 273 | 273 | $result = $queryBuilder |
| 274 | 274 | ->select('uid') |
| 275 | 275 | ->from('tx_dlf_documents') |
@@ -26,13 +26,11 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * Index single document into database and solr. |
| 28 | 28 | */ |
| 29 | -class IndexCommand extends Command |
|
| 30 | -{ |
|
| 29 | +class IndexCommand extends Command { |
|
| 31 | 30 | /** |
| 32 | 31 | * Configure the command by defining the name, options and arguments |
| 33 | 32 | */ |
| 34 | - public function configure() |
|
| 35 | - { |
|
| 33 | + public function configure() { |
|
| 36 | 34 | $this |
| 37 | 35 | ->setDescription('Index single document into database and solr.') |
| 38 | 36 | ->setHelp('') |
@@ -68,8 +66,7 @@ discard block |
||
| 68 | 66 | * @param InputInterface $input |
| 69 | 67 | * @param OutputInterface $output |
| 70 | 68 | */ |
| 71 | - protected function execute(InputInterface $input, OutputInterface $output) |
|
| 72 | - { |
|
| 69 | + protected function execute(InputInterface $input, OutputInterface $output) { |
|
| 73 | 70 | // Make sure the _cli_ user is loaded |
| 74 | 71 | Bootstrap::getInstance()->initializeBackendAuthentication(); |
| 75 | 72 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | ->setHelp('') |
| 39 | 39 | ->addOption( |
| 40 | 40 | 'dry-run', |
| 41 | - null, |
|
| 41 | + NULL, |
|
| 42 | 42 | InputOption::VALUE_NONE, |
| 43 | 43 | 'If this option is set, the files will not actually be processed but the location URI is shown.' |
| 44 | 44 | ) |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | // Make sure the _cli_ user is loaded |
| 74 | 74 | Bootstrap::getInstance()->initializeBackendAuthentication(); |
| 75 | 75 | |
| 76 | - $dryRun = $input->getOption('dry-run') != false ? true : false; |
|
| 76 | + $dryRun = $input->getOption('dry-run') != FALSE ? TRUE : FALSE; |
|
| 77 | 77 | |
| 78 | 78 | $io = new SymfonyStyle($input, $output); |
| 79 | 79 | $io->title($this->getDescription()); |
@@ -80,17 +80,17 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $startingPoint = 0; |
| 82 | 82 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('pid'))) { |
| 83 | - $startingPoint = MathUtility::forceIntegerInRange((int)$input->getOption('pid'), 0); |
|
| 83 | + $startingPoint = MathUtility::forceIntegerInRange((int) $input->getOption('pid'), 0); |
|
| 84 | 84 | } |
| 85 | 85 | if ($startingPoint == 0) { |
| 86 | - $io->error('ERROR: No valid PID (' . $startingPoint . ') given.'); |
|
| 86 | + $io->error('ERROR: No valid PID ('.$startingPoint.') given.'); |
|
| 87 | 87 | exit(1); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if ($input->getOption('solr')) { |
| 91 | 91 | $allSolrCores = $this->getSolrCores($startingPoint); |
| 92 | 92 | if (MathUtility::canBeInterpretedAsInteger($input->getOption('solr'))) { |
| 93 | - $solrCoreUid = MathUtility::forceIntegerInRange((int)$input->getOption('solr'), 0); |
|
| 93 | + $solrCoreUid = MathUtility::forceIntegerInRange((int) $input->getOption('solr'), 0); |
|
| 94 | 94 | } else { |
| 95 | 95 | $solrCoreName = $input->getOption('solr'); |
| 96 | 96 | $solrCoreUid = $allSolrCores[$solrCoreName]; |
@@ -98,13 +98,13 @@ discard block |
||
| 98 | 98 | // Abort if solrCoreUid is empty or not in the array of allowed solr cores. |
| 99 | 99 | if (empty($solrCoreUid) || !in_array($solrCoreUid, $allSolrCores)) { |
| 100 | 100 | foreach ($allSolrCores as $index_name => $uid) { |
| 101 | - $output_solrCores .= ' ' . $uid . ' : ' . $index_name ."\n"; |
|
| 101 | + $output_solrCores .= ' '.$uid.' : '.$index_name."\n"; |
|
| 102 | 102 | } |
| 103 | 103 | if (empty($output_solrCores)) { |
| 104 | - $io->error('ERROR: No valid solr core ("'. $input->getOption('solr') . '") given. ' . "No valid cores found on PID " . $startingPoint .".\n" . $output_solrCores); |
|
| 104 | + $io->error('ERROR: No valid solr core ("'.$input->getOption('solr').'") given. '."No valid cores found on PID ".$startingPoint.".\n".$output_solrCores); |
|
| 105 | 105 | exit(1); |
| 106 | 106 | } else { |
| 107 | - $io->error('ERROR: No valid solr core ("'. $input->getOption('solr') . '") given. ' . "Valid cores are (<uid>:<index_name>):\n" . $output_solrCores); |
|
| 107 | + $io->error('ERROR: No valid solr core ("'.$input->getOption('solr').'") given. '."Valid cores are (<uid>:<index_name>):\n".$output_solrCores); |
|
| 108 | 108 | exit(1); |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | if (!MathUtility::canBeInterpretedAsInteger($input->getOption('doc')) |
| 117 | 117 | && !GeneralUtility::isValidUrl($input->getOption('doc'))) { |
| 118 | - $io->error('ERROR: "' . $input->getOption('doc') . '" is not a valid document UID or URL for --doc|-d.'); |
|
| 118 | + $io->error('ERROR: "'.$input->getOption('doc').'" is not a valid document UID or URL for --doc|-d.'); |
|
| 119 | 119 | exit(1); |
| 120 | 120 | } |
| 121 | 121 | |
@@ -123,10 +123,10 @@ discard block |
||
| 123 | 123 | $doc = Document::getInstance($input->getOption('doc'), $startingPoint, TRUE); |
| 124 | 124 | if ($doc->ready) { |
| 125 | 125 | if ($dryRun) { |
| 126 | - $io->section('DRY RUN: Would index ' . $doc->uid . ' '. $doc->location . ' on UID ' . $startingPoint . ' and solr core ' . $solrCoreUid .'.'); |
|
| 126 | + $io->section('DRY RUN: Would index '.$doc->uid.' '.$doc->location.' on UID '.$startingPoint.' and solr core '.$solrCoreUid.'.'); |
|
| 127 | 127 | } else { |
| 128 | 128 | if ($io->isVerbose()) { |
| 129 | - $io->section('Will index ' . $doc->uid . ' ' . $doc->location . ' on UID ' . $startingPoint . ' and solr core ' . $solrCoreUid .'.'); |
|
| 129 | + $io->section('Will index '.$doc->uid.' '.$doc->location.' on UID '.$startingPoint.' and solr core '.$solrCoreUid.'.'); |
|
| 130 | 130 | } |
| 131 | 131 | // ...and save it to the database... |
| 132 | 132 | if (!$doc->save($startingPoint, $solrCoreUid)) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ->getQueryBuilderForTable('tx_dlf_solrcores'); |
| 158 | 158 | |
| 159 | 159 | $solrCores = []; |
| 160 | - $pageId = (int)$pageId; |
|
| 160 | + $pageId = (int) $pageId; |
|
| 161 | 161 | $result = $queryBuilder |
| 162 | 162 | ->select('uid', 'index_name') |
| 163 | 163 | ->from('tx_dlf_solrcores') |