@@ -44,8 +44,7 @@ discard block |
||
| 44 | 44 | * @subpackage dlf |
| 45 | 45 | * @access public |
| 46 | 46 | */ |
| 47 | -class NewTenantController extends AbstractController |
|
| 48 | -{ |
|
| 47 | +class NewTenantController extends AbstractController { |
|
| 49 | 48 | /** |
| 50 | 49 | * @var int |
| 51 | 50 | */ |
@@ -85,8 +84,7 @@ discard block |
||
| 85 | 84 | /** |
| 86 | 85 | * @param FormatRepository $formatRepository |
| 87 | 86 | */ |
| 88 | - public function injectFormatRepository(FormatRepository $formatRepository) |
|
| 89 | - { |
|
| 87 | + public function injectFormatRepository(FormatRepository $formatRepository) { |
|
| 90 | 88 | $this->formatRepository = $formatRepository; |
| 91 | 89 | } |
| 92 | 90 | |
@@ -98,8 +96,7 @@ discard block |
||
| 98 | 96 | /** |
| 99 | 97 | * @param MetadataRepository $metadataRepository |
| 100 | 98 | */ |
| 101 | - public function injectMetadataRepository(MetadataRepository $metadataRepository) |
|
| 102 | - { |
|
| 99 | + public function injectMetadataRepository(MetadataRepository $metadataRepository) { |
|
| 103 | 100 | $this->metadataRepository = $metadataRepository; |
| 104 | 101 | } |
| 105 | 102 | |
@@ -111,8 +108,7 @@ discard block |
||
| 111 | 108 | /** |
| 112 | 109 | * @param StructureRepository $structureRepository |
| 113 | 110 | */ |
| 114 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
| 115 | - { |
|
| 111 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
| 116 | 112 | $this->structureRepository = $structureRepository; |
| 117 | 113 | } |
| 118 | 114 | |
@@ -124,8 +120,7 @@ discard block |
||
| 124 | 120 | /** |
| 125 | 121 | * @param SolrCoreRepository $solrCoreRepository |
| 126 | 122 | */ |
| 127 | - public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) |
|
| 128 | - { |
|
| 123 | + public function injectSolrCoreRepository(SolrCoreRepository $solrCoreRepository) { |
|
| 129 | 124 | $this->solrCoreRepository = $solrCoreRepository; |
| 130 | 125 | } |
| 131 | 126 | |
@@ -133,8 +128,7 @@ discard block |
||
| 133 | 128 | * Initialization for all actions |
| 134 | 129 | * |
| 135 | 130 | */ |
| 136 | - protected function initializeAction() |
|
| 137 | - { |
|
| 131 | + protected function initializeAction() { |
|
| 138 | 132 | $this->pid = (int) GeneralUtility::_GP('id'); |
| 139 | 133 | |
| 140 | 134 | $frameworkConfiguration = $this->configurationManager->getConfiguration($this->configurationManager::CONFIGURATION_TYPE_FRAMEWORK); |
@@ -155,8 +149,7 @@ discard block |
||
| 155 | 149 | /** |
| 156 | 150 | * Action adding formats records |
| 157 | 151 | */ |
| 158 | - public function addFormatAction() |
|
| 159 | - { |
|
| 152 | + public function addFormatAction() { |
|
| 160 | 153 | // Include formats definition file. |
| 161 | 154 | $formatsDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/FormatDefaults.php'); |
| 162 | 155 | |
@@ -193,8 +186,7 @@ discard block |
||
| 193 | 186 | /** |
| 194 | 187 | * Action adding metadata records |
| 195 | 188 | */ |
| 196 | - public function addMetadataAction() |
|
| 197 | - { |
|
| 189 | + public function addMetadataAction() { |
|
| 198 | 190 | // Include metadata definition file. |
| 199 | 191 | $metadataDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/MetadataDefaults.php'); |
| 200 | 192 | |
@@ -268,8 +260,7 @@ discard block |
||
| 268 | 260 | /** |
| 269 | 261 | * Action adding Solr core records |
| 270 | 262 | */ |
| 271 | - public function addSolrCoreAction() |
|
| 272 | - { |
|
| 263 | + public function addSolrCoreAction() { |
|
| 273 | 264 | $doPersist = false; |
| 274 | 265 | |
| 275 | 266 | // load language file in own array |
@@ -298,8 +289,7 @@ discard block |
||
| 298 | 289 | /** |
| 299 | 290 | * Action adding structure records |
| 300 | 291 | */ |
| 301 | - public function addStructureAction() |
|
| 302 | - { |
|
| 292 | + public function addStructureAction() { |
|
| 303 | 293 | // Include structure definition file. |
| 304 | 294 | $structureDefaults = include(ExtensionManagementUtility::extPath('dlf') . 'Resources/Private/Data/StructureDefaults.php'); |
| 305 | 295 | |
@@ -351,8 +341,7 @@ discard block |
||
| 351 | 341 | * @param ViewInterface $view |
| 352 | 342 | * @return void |
| 353 | 343 | */ |
| 354 | - protected function initializeView(ViewInterface $view) |
|
| 355 | - { |
|
| 344 | + protected function initializeView(ViewInterface $view) { |
|
| 356 | 345 | /** @var BackendTemplateView $view */ |
| 357 | 346 | parent::initializeView($view); |
| 358 | 347 | if ($this->actionMethodName == 'indexAction') { |
@@ -370,8 +359,7 @@ discard block |
||
| 370 | 359 | * @access public |
| 371 | 360 | * |
| 372 | 361 | */ |
| 373 | - public function indexAction() |
|
| 374 | - { |
|
| 362 | + public function indexAction() { |
|
| 375 | 363 | $recordInfos = []; |
| 376 | 364 | |
| 377 | 365 | if ($this->pageInfo['doktype'] != 254) { |
@@ -401,8 +389,7 @@ discard block |
||
| 401 | 389 | * @access public |
| 402 | 390 | * |
| 403 | 391 | */ |
| 404 | - public function errorAction() |
|
| 405 | - { |
|
| 392 | + public function errorAction() { |
|
| 406 | 393 | } |
| 407 | 394 | |
| 408 | 395 | /** |
@@ -414,8 +401,7 @@ discard block |
||
| 414 | 401 | * |
| 415 | 402 | * @access public |
| 416 | 403 | */ |
| 417 | - protected function getLLL($index, $lang, $langArray) |
|
| 418 | - { |
|
| 404 | + protected function getLLL($index, $lang, $langArray) { |
|
| 419 | 405 | if (isset($langArray[$lang][$index][0]['target'])) { |
| 420 | 406 | return $langArray[$lang][$index][0]['target']; |
| 421 | 407 | } else { |
@@ -28,16 +28,14 @@ discard block |
||
| 28 | 28 | * @subpackage dlf |
| 29 | 29 | * @access public |
| 30 | 30 | */ |
| 31 | -class SearchInDocument |
|
| 32 | -{ |
|
| 31 | +class SearchInDocument { |
|
| 33 | 32 | /** |
| 34 | 33 | * The main method of the eID script |
| 35 | 34 | * |
| 36 | 35 | * @param ServerRequestInterface $request |
| 37 | 36 | * @return ResponseInterface JSON response of search suggestions |
| 38 | 37 | */ |
| 39 | - public function main(ServerRequestInterface $request) |
|
| 40 | - { |
|
| 38 | + public function main(ServerRequestInterface $request) { |
|
| 41 | 39 | $output = [ |
| 42 | 40 | 'documents' => [], |
| 43 | 41 | 'numFound' => 0 |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | * |
| 119 | 117 | * @return string SOLR query |
| 120 | 118 | */ |
| 121 | - private function getQuery($fields, $parameters) |
|
| 122 | - { |
|
| 119 | + private function getQuery($fields, $parameters) { |
|
| 123 | 120 | return $fields['fulltext'] . ':(' . Solr::escapeQuery((string) $parameters['q']) . ') AND ' . $fields['uid'] . ':' . $this->getUid($parameters['uid']); |
| 124 | 121 | } |
| 125 | 122 | |
@@ -133,8 +130,7 @@ discard block |
||
| 133 | 130 | * |
| 134 | 131 | * @return int|string uid of the document |
| 135 | 132 | */ |
| 136 | - private function getUid($uid) |
|
| 137 | - { |
|
| 133 | + private function getUid($uid) { |
|
| 138 | 134 | return is_numeric($uid) ? intval($uid) : $uid; |
| 139 | 135 | } |
| 140 | 136 | } |
@@ -34,8 +34,7 @@ discard block |
||
| 34 | 34 | * @subpackage dlf |
| 35 | 35 | * @access public |
| 36 | 36 | */ |
| 37 | -class PageViewProxy |
|
| 38 | -{ |
|
| 37 | +class PageViewProxy { |
|
| 39 | 38 | /** |
| 40 | 39 | * @var RequestFactory |
| 41 | 40 | */ |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | */ |
| 47 | 46 | protected $extConf; |
| 48 | 47 | |
| 49 | - public function __construct() |
|
| 50 | - { |
|
| 48 | + public function __construct() { |
|
| 51 | 49 | $this->requestFactory = GeneralUtility::makeInstance(RequestFactory::class); |
| 52 | 50 | $this->extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('dlf'); |
| 53 | 51 | } |
@@ -173,8 +171,7 @@ discard block |
||
| 173 | 171 | * @param ServerRequestInterface $request |
| 174 | 172 | * @return ResponseInterface |
| 175 | 173 | */ |
| 176 | - public function main(ServerRequestInterface $request) |
|
| 177 | - { |
|
| 174 | + public function main(ServerRequestInterface $request) { |
|
| 178 | 175 | switch ($request->getMethod()) { |
| 179 | 176 | case 'OPTIONS': |
| 180 | 177 | return $this->handleOptions($request); |
@@ -30,16 +30,14 @@ |
||
| 30 | 30 | * @subpackage dlf |
| 31 | 31 | * @access public |
| 32 | 32 | */ |
| 33 | -class SearchSuggest |
|
| 34 | -{ |
|
| 33 | +class SearchSuggest { |
|
| 35 | 34 | /** |
| 36 | 35 | * The main method of the eID script |
| 37 | 36 | * |
| 38 | 37 | * @param ServerRequestInterface $request |
| 39 | 38 | * @return ResponseInterface XML response of search suggestions |
| 40 | 39 | */ |
| 41 | - public function main(ServerRequestInterface $request) |
|
| 42 | - { |
|
| 40 | + public function main(ServerRequestInterface $request) { |
|
| 43 | 41 | $output = []; |
| 44 | 42 | // Get input parameters and decrypt core name. |
| 45 | 43 | $parameters = $request->getParsedBody(); |
@@ -21,15 +21,13 @@ |
||
| 21 | 21 | * @subpackage dlf |
| 22 | 22 | * @access public |
| 23 | 23 | */ |
| 24 | -class StatisticsController extends AbstractController |
|
| 25 | -{ |
|
| 24 | +class StatisticsController extends AbstractController { |
|
| 26 | 25 | /** |
| 27 | 26 | * The main method of the plugin |
| 28 | 27 | * |
| 29 | 28 | * @return void |
| 30 | 29 | */ |
| 31 | - public function mainAction() |
|
| 32 | - { |
|
| 30 | + public function mainAction() { |
|
| 33 | 31 | $foundNumbers = $this->documentRepository->getStatisticsForSelectedCollection($this->settings); |
| 34 | 32 | |
| 35 | 33 | // Set replacements. |
@@ -15,12 +15,10 @@ discard block |
||
| 15 | 15 | use TYPO3\CMS\Extbase\Configuration\ConfigurationManager; |
| 16 | 16 | use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; |
| 17 | 17 | |
| 18 | -class StdWrapViewHelper extends AbstractViewHelper |
|
| 19 | -{ |
|
| 18 | +class StdWrapViewHelper extends AbstractViewHelper { |
|
| 20 | 19 | protected $escapeOutput = false; |
| 21 | 20 | |
| 22 | - public function initializeArguments() |
|
| 23 | - { |
|
| 21 | + public function initializeArguments() { |
|
| 24 | 22 | parent::initializeArguments(); |
| 25 | 23 | $this->registerArgument('wrap', 'string', 'The wrap information', true); |
| 26 | 24 | $this->registerArgument('data', 'array', 'Data for the content object', false); |
@@ -31,8 +29,7 @@ discard block |
||
| 31 | 29 | * |
| 32 | 30 | * @return string |
| 33 | 31 | */ |
| 34 | - public function render() |
|
| 35 | - { |
|
| 32 | + public function render() { |
|
| 36 | 33 | $wrap = $this->arguments['wrap']; |
| 37 | 34 | $data = $this->arguments['data'] ?? []; |
| 38 | 35 | |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | use SimpleXMLElement; |
| 13 | 13 | use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; |
| 14 | 14 | |
| 15 | -class OaiPmhTest extends FunctionalTestCase |
|
| 16 | -{ |
|
| 15 | +class OaiPmhTest extends FunctionalTestCase { |
|
| 17 | 16 | protected $disableJsonWrappedResponse = true; |
| 18 | 17 | |
| 19 | 18 | protected $coreExtensionsToLoad = [ |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | $this->setUpOaiSolr(); |
| 54 | 53 | } |
| 55 | 54 | |
| 56 | - protected function setUpOaiSolr() |
|
| 57 | - { |
|
| 55 | + protected function setUpOaiSolr() { |
|
| 58 | 56 | // Setup Solr only once for all tests in this suite |
| 59 | 57 | static $solr = null; |
| 60 | 58 | |
@@ -74,8 +72,7 @@ discard block |
||
| 74 | 72 | /** |
| 75 | 73 | * @test |
| 76 | 74 | */ |
| 77 | - public function correctlyRespondsOnBadVerb() |
|
| 78 | - { |
|
| 75 | + public function correctlyRespondsOnBadVerb() { |
|
| 79 | 76 | $client = new HttpClient(); |
| 80 | 77 | $response = $client->get($this->baseUrl, [ |
| 81 | 78 | 'query' => [ |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | /** |
| 101 | 98 | * @test |
| 102 | 99 | */ |
| 103 | - public function canIdentify() |
|
| 104 | - { |
|
| 100 | + public function canIdentify() { |
|
| 105 | 101 | $oai = Endpoint::build($this->oaiUrl); |
| 106 | 102 | $identity = $oai->identify(); |
| 107 | 103 | |
@@ -114,8 +110,7 @@ discard block |
||
| 114 | 110 | /** |
| 115 | 111 | * @test |
| 116 | 112 | */ |
| 117 | - public function identifyGivesFallbackDatestampWhenNoDocuments() |
|
| 118 | - { |
|
| 113 | + public function identifyGivesFallbackDatestampWhenNoDocuments() { |
|
| 119 | 114 | $oai = Endpoint::build($this->oaiUrlNoStoragePid); |
| 120 | 115 | $identity = $oai->identify(); |
| 121 | 116 | |
@@ -125,8 +120,7 @@ discard block |
||
| 125 | 120 | /** |
| 126 | 121 | * @test |
| 127 | 122 | */ |
| 128 | - public function canListMetadataFormats() |
|
| 129 | - { |
|
| 123 | + public function canListMetadataFormats() { |
|
| 130 | 124 | $oai = Endpoint::build($this->oaiUrl); |
| 131 | 125 | $formats = $oai->listMetadataFormats(); |
| 132 | 126 | |
@@ -141,8 +135,7 @@ discard block |
||
| 141 | 135 | /** |
| 142 | 136 | * @test |
| 143 | 137 | */ |
| 144 | - public function canListRecords() |
|
| 145 | - { |
|
| 138 | + public function canListRecords() { |
|
| 146 | 139 | $oai = Endpoint::build($this->oaiUrl); |
| 147 | 140 | $result = $oai->listRecords('mets'); |
| 148 | 141 | |
@@ -155,8 +148,7 @@ discard block |
||
| 155 | 148 | /** |
| 156 | 149 | * @test |
| 157 | 150 | */ |
| 158 | - public function noRecordsUntil1900() |
|
| 159 | - { |
|
| 151 | + public function noRecordsUntil1900() { |
|
| 160 | 152 | $this->expectException(OaipmhException::class); |
| 161 | 153 | $this->expectExceptionMessage('empty list'); |
| 162 | 154 | |
@@ -169,8 +161,7 @@ discard block |
||
| 169 | 161 | /** |
| 170 | 162 | * @test |
| 171 | 163 | */ |
| 172 | - public function canUseResumptionToken() |
|
| 173 | - { |
|
| 164 | + public function canUseResumptionToken() { |
|
| 174 | 165 | // NOTE: cursor and expirationDate are optional by the specification, |
| 175 | 166 | // but we include them in our implementation |
| 176 | 167 | |
@@ -228,8 +219,7 @@ discard block |
||
| 228 | 219 | /** |
| 229 | 220 | * @test |
| 230 | 221 | */ |
| 231 | - public function noResumptionTokenForCompleteList() |
|
| 232 | - { |
|
| 222 | + public function noResumptionTokenForCompleteList() { |
|
| 233 | 223 | $client = new HttpClient(); |
| 234 | 224 | |
| 235 | 225 | foreach (['ListIdentifiers', 'ListRecords'] as $verb) { |
@@ -251,8 +241,7 @@ discard block |
||
| 251 | 241 | /** |
| 252 | 242 | * @test |
| 253 | 243 | */ |
| 254 | - public function canListAndResumeIdentifiers() |
|
| 255 | - { |
|
| 244 | + public function canListAndResumeIdentifiers() { |
|
| 256 | 245 | $oai = Endpoint::build($this->oaiUrl); |
| 257 | 246 | $result = $oai->listIdentifiers('mets'); |
| 258 | 247 | |
@@ -265,18 +254,15 @@ discard block |
||
| 265 | 254 | $this->assertEquals('oai:de:slub-dresden:db:id-476248086', $record->identifier); |
| 266 | 255 | } |
| 267 | 256 | |
| 268 | - protected function parseUtc(string $dateTime) |
|
| 269 | - { |
|
| 257 | + protected function parseUtc(string $dateTime) { |
|
| 270 | 258 | return DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $dateTime); |
| 271 | 259 | } |
| 272 | 260 | |
| 273 | - protected function assertUtcDateString(string $dateTime) |
|
| 274 | - { |
|
| 261 | + protected function assertUtcDateString(string $dateTime) { |
|
| 275 | 262 | $this->assertInstanceOf(DateTime::class, $this->parseUtc($dateTime)); |
| 276 | 263 | } |
| 277 | 264 | |
| 278 | - protected function assertInFuture(string $dateTime) |
|
| 279 | - { |
|
| 265 | + protected function assertInFuture(string $dateTime) { |
|
| 280 | 266 | $this->assertGreaterThan(new DateTime(), $this->parseUtc($dateTime)); |
| 281 | 267 | } |
| 282 | 268 | } |
@@ -16,8 +16,7 @@ discard block |
||
| 16 | 16 | use TYPO3\CMS\Extbase\Object\ObjectManager; |
| 17 | 17 | use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; |
| 18 | 18 | |
| 19 | -class SolrIndexingTest extends FunctionalTestCase |
|
| 20 | -{ |
|
| 19 | +class SolrIndexingTest extends FunctionalTestCase { |
|
| 21 | 20 | /** @var PersistenceManager */ |
| 22 | 21 | protected $persistenceManager; |
| 23 | 22 | |
@@ -51,8 +50,7 @@ discard block |
||
| 51 | 50 | /** |
| 52 | 51 | * @test |
| 53 | 52 | */ |
| 54 | - public function canCreateCore() |
|
| 55 | - { |
|
| 53 | + public function canCreateCore() { |
|
| 56 | 54 | $coreName = uniqid('testCore'); |
| 57 | 55 | $solr = Solr::getInstance($coreName); |
| 58 | 56 | $this->assertNull($solr->core); |
@@ -67,8 +65,7 @@ discard block |
||
| 67 | 65 | /** |
| 68 | 66 | * @test |
| 69 | 67 | */ |
| 70 | - public function canIndexAndSearchDocument() |
|
| 71 | - { |
|
| 68 | + public function canIndexAndSearchDocument() { |
|
| 72 | 69 | $core = $this->createSolrCore(); |
| 73 | 70 | |
| 74 | 71 | $document = $this->documentRepository->findByUid(1001); |
@@ -108,8 +105,7 @@ discard block |
||
| 108 | 105 | /** |
| 109 | 106 | * @test |
| 110 | 107 | */ |
| 111 | - public function canSearchInCollections() |
|
| 112 | - { |
|
| 108 | + public function canSearchInCollections() { |
|
| 113 | 109 | $core = $this->createSolrCore(); |
| 114 | 110 | |
| 115 | 111 | $this->importDataSet(__DIR__ . '/../../Fixtures/Common/documents_fulltext.xml'); |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | * @subpackage dlf |
| 27 | 27 | * @access public |
| 28 | 28 | */ |
| 29 | -class CalendarController extends AbstractController |
|
| 30 | -{ |
|
| 29 | +class CalendarController extends AbstractController { |
|
| 31 | 30 | /** |
| 32 | 31 | * @var StructureRepository |
| 33 | 32 | */ |
@@ -36,8 +35,7 @@ discard block |
||
| 36 | 35 | /** |
| 37 | 36 | * @param StructureRepository $structureRepository |
| 38 | 37 | */ |
| 39 | - public function injectStructureRepository(StructureRepository $structureRepository) |
|
| 40 | - { |
|
| 38 | + public function injectStructureRepository(StructureRepository $structureRepository) { |
|
| 41 | 39 | $this->structureRepository = $structureRepository; |
| 42 | 40 | } |
| 43 | 41 | |
@@ -54,8 +52,7 @@ discard block |
||
| 54 | 52 | * |
| 55 | 53 | * @return void |
| 56 | 54 | */ |
| 57 | - public function mainAction() |
|
| 58 | - { |
|
| 55 | + public function mainAction() { |
|
| 59 | 56 | // Set initial document (anchor or year file) if configured. |
| 60 | 57 | if (empty($this->requestData['id']) && !empty($this->settings['initialDocument'])) { |
| 61 | 58 | $this->requestData['id'] = $this->settings['initialDocument']; |
@@ -100,8 +97,7 @@ discard block |
||
| 100 | 97 | * |
| 101 | 98 | * @return void |
| 102 | 99 | */ |
| 103 | - public function calendarAction() |
|
| 104 | - { |
|
| 100 | + public function calendarAction() { |
|
| 105 | 101 | // access arguments passed by the mainAction() |
| 106 | 102 | $mainrequestData = $this->request->getArguments(); |
| 107 | 103 | |
@@ -206,8 +202,7 @@ discard block |
||
| 206 | 202 | * |
| 207 | 203 | * @return void |
| 208 | 204 | */ |
| 209 | - public function yearsAction() |
|
| 210 | - { |
|
| 205 | + public function yearsAction() { |
|
| 211 | 206 | // access arguments passed by the mainAction() |
| 212 | 207 | $mainrequestData = $this->request->getArguments(); |
| 213 | 208 | |
@@ -262,8 +257,7 @@ discard block |
||
| 262 | 257 | * |
| 263 | 258 | * @return string Content for template subpart |
| 264 | 259 | */ |
| 265 | - protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) |
|
| 266 | - { |
|
| 260 | + protected function getCalendarYear(&$calendarData, $calendarIssuesByMonth, $year, $firstMonth = 1, $lastMonth = 12) { |
|
| 267 | 261 | for ($i = $firstMonth; $i <= $lastMonth; $i++) { |
| 268 | 262 | $key = $year . '-' . $i; |
| 269 | 263 | |