Completed
Push — master ( 1253ac...bfdcd2 )
by
unknown
16s queued 13s
created
Classes/Format/Mods.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@
 block discarded – undo
32 32
      *
33 33
      * @return void
34 34
      */
35
-    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata)
36
-    {
35
+    public function extractMetadata(\SimpleXMLElement $xml, array &$metadata) {
37 36
         $xml->registerXPathNamespace('mods', 'http://www.loc.gov/mods/v3');
38 37
         // Get "author" and "author_sorting".
39 38
         $authors = $xml->xpath('./mods:name[./mods:role/mods:roleTerm[@type="code" and @authority="marcrelator"]="aut"]');
Please login to merge, or discard this patch.
Classes/Controller/Backend/NewTenantController.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 {
Please login to merge, or discard this patch.
Classes/Eid/SearchInDocument.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,16 +28,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Classes/Eid/PageViewProxy.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Classes/Eid/SearchSuggest.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,16 +30,14 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
Classes/Controller/StatisticsController.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,15 +21,13 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Classes/Domain/Repository/DocumentRepository.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
50 50
      *
51 51
      * @return \Kitodo\Dlf\Domain\Model\Document|null
52 52
      */
53
-    public function findOneByParameters($parameters)
54
-    {
53
+    public function findOneByParameters($parameters) {
55 54
         $doc = null;
56 55
         $document = null;
57 56
 
@@ -95,8 +94,7 @@  discard block
 block discarded – undo
95 94
      *
96 95
      * @return \Kitodo\Dlf\Domain\Model\Document|null
97 96
      */
98
-    public function findOldestDocument()
99
-    {
97
+    public function findOldestDocument() {
100 98
         $query = $this->createQuery();
101 99
 
102 100
         $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]);
@@ -110,8 +108,7 @@  discard block
 block discarded – undo
110 108
      * @param  \Kitodo\Dlf\Domain\Model\Structure $structure
111 109
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
112 110
      */
113
-    public function getChildrenOfYearAnchor($partOf, $structure)
114
-    {
111
+    public function getChildrenOfYearAnchor($partOf, $structure) {
115 112
         $query = $this->createQuery();
116 113
 
117 114
         $query->matching($query->equals('structure', $structure));
@@ -132,8 +129,7 @@  discard block
 block discarded – undo
132 129
      *
133 130
      * @return \Kitodo\Dlf\Domain\Model\Document|null
134 131
      */
135
-    public function findOneByIdAndSettings($uid, $settings = [])
136
-    {
132
+    public function findOneByIdAndSettings($uid, $settings = []) {
137 133
         $settings = ['documentSets' => $uid];
138 134
 
139 135
         return $this->findDocumentsBySettings($settings)->getFirst();
@@ -146,8 +142,7 @@  discard block
 block discarded – undo
146 142
      *
147 143
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
148 144
      */
149
-    public function findDocumentsBySettings($settings = [])
150
-    {
145
+    public function findDocumentsBySettings($settings = []) {
151 146
         $query = $this->createQuery();
152 147
 
153 148
         $constraints = [];
@@ -177,8 +172,7 @@  discard block
 block discarded – undo
177 172
      *
178 173
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
179 174
      */
180
-    public function findAllByCollectionsLimited($collections, $limit = 50)
181
-    {
175
+    public function findAllByCollectionsLimited($collections, $limit = 50) {
182 176
         $query = $this->createQuery();
183 177
 
184 178
         // order by start_date -> start_time...
@@ -215,8 +209,7 @@  discard block
 block discarded – undo
215 209
      *
216 210
      * @return array
217 211
      */
218
-    public function getStatisticsForSelectedCollection($settings)
219
-    {
212
+    public function getStatisticsForSelectedCollection($settings) {
220 213
         if ($settings['collections']) {
221 214
             // Include only selected collections.
222 215
             $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
@@ -350,8 +343,7 @@  discard block
 block discarded – undo
350 343
      *
351 344
      * @return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface
352 345
      */
353
-    public function getTableOfContentsFromDb($uid, $pid, $settings)
354
-    {
346
+    public function getTableOfContentsFromDb($uid, $pid, $settings) {
355 347
         // Build table of contents from database.
356 348
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
357 349
             ->getQueryBuilderForTable('tx_dlf_documents');
@@ -399,8 +391,7 @@  discard block
 block discarded – undo
399 391
      *
400 392
      * @return array The found document object
401 393
      */
402
-    public function getOaiRecord($settings, $parameters)
403
-    {
394
+    public function getOaiRecord($settings, $parameters) {
404 395
         $where = '';
405 396
 
406 397
         if (!$settings['show_userdefined']) {
@@ -440,8 +431,7 @@  discard block
 block discarded – undo
440 431
      *
441 432
      * @return array The found document objects
442 433
      */
443
-    public function getOaiDocumentList($settings, $documentsToProcess)
444
-    {
434
+    public function getOaiDocumentList($settings, $documentsToProcess) {
445 435
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
446 436
             ->getConnectionForTable('tx_dlf_documents');
447 437
 
@@ -475,8 +465,7 @@  discard block
 block discarded – undo
475 465
      *
476 466
      * @return array
477 467
      */
478
-    private function findAllByUids($uids)
479
-    {
468
+    private function findAllByUids($uids) {
480 469
         // get all documents from db we are talking about
481 470
         $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
482 471
         $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_documents');
@@ -520,8 +509,7 @@  discard block
 block discarded – undo
520 509
      * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata
521 510
      * @return array
522 511
      */
523
-    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null)
524
-    {
512
+    public function findSolrByCollection($collection, $settings, $searchParams, $listedMetadata = null) {
525 513
         // set settings global inside this repository
526 514
         $this->settings = $settings;
527 515
 
@@ -730,8 +718,7 @@  discard block
 block discarded – undo
730 718
      * @param \TYPO3\CMS\Extbase\Persistence\Generic\QueryResult $listedMetadata
731 719
      * @return array
732 720
      */
733
-    protected function fetchMetadataFromSolr($uid, $listedMetadata = [])
734
-    {
721
+    protected function fetchMetadataFromSolr($uid, $listedMetadata = []) {
735 722
         // Prepare query parameters.
736 723
         $params = [];
737 724
         $metadataArray = [];
@@ -780,8 +767,7 @@  discard block
 block discarded – undo
780 767
      *
781 768
      * @return array The Apache Solr Documents that were fetched
782 769
      */
783
-    protected function searchSolr($parameters = [], $enableCache = true)
784
-    {
770
+    protected function searchSolr($parameters = [], $enableCache = true) {
785 771
         // Set additional query parameters.
786 772
         $parameters['start'] = 0;
787 773
         // Set query.
Please login to merge, or discard this patch.
Classes/ViewHelpers/StdWrapViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Tests/Functional/FunctionalTestCase.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,8 +64,7 @@  discard block
 block discarded – undo
64 64
      */
65 65
     protected $httpClient;
66 66
 
67
-    public function __construct()
68
-    {
67
+    public function __construct() {
69 68
         parent::__construct();
70 69
 
71 70
         $this->configurationToUseInTestInstance['EXTENSIONS']['dlf'] = $this->getDlfConfiguration();
@@ -92,8 +91,7 @@  discard block
 block discarded – undo
92 91
         $this->addSiteConfig('dlf-testing', $this->baseUrl);
93 92
     }
94 93
 
95
-    protected function getDlfConfiguration()
96
-    {
94
+    protected function getDlfConfiguration() {
97 95
         return [
98 96
             'solrFieldAutocomplete' => 'autocomplete',
99 97
             'solrFieldCollection' => 'collection',
@@ -125,8 +123,7 @@  discard block
 block discarded – undo
125 123
         ];
126 124
     }
127 125
 
128
-    protected function addSiteConfig($identifier, $baseUrl)
129
-    {
126
+    protected function addSiteConfig($identifier, $baseUrl) {
130 127
         $siteConfig = Yaml::parseFile(__DIR__ . '/../Fixtures/siteconfig.yaml');
131 128
         $siteConfig['base'] = $baseUrl;
132 129
         $siteConfig['languages'][0]['base'] = $baseUrl;
@@ -136,8 +133,7 @@  discard block
 block discarded – undo
136 133
         file_put_contents($siteConfigPath . '/config.yaml', Yaml::dump($siteConfig));
137 134
     }
138 135
 
139
-    protected function initializeRepository(string $className, int $storagePid)
140
-    {
136
+    protected function initializeRepository(string $className, int $storagePid) {
141 137
         $repository = $this->objectManager->get($className);
142 138
 
143 139
         $querySettings = $this->objectManager->get(Typo3QuerySettings::class);
@@ -147,8 +143,7 @@  discard block
 block discarded – undo
147 143
         return $repository;
148 144
     }
149 145
 
150
-    protected function importSolrDocuments(Solr $solr, string $path)
151
-    {
146
+    protected function importSolrDocuments(Solr $solr, string $path) {
152 147
         $jsonDocuments = json_decode(file_get_contents($path), true);
153 148
 
154 149
         $updateQuery = $solr->service->createUpdate();
Please login to merge, or discard this patch.