Passed
Pull Request — master (#44)
by
unknown
02:34
created
Classes/Hooks/ConfigurationForm.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
  * @subpackage dlf
28 28
  * @access public
29 29
  */
30
-class ConfigurationForm
31
-{
30
+class ConfigurationForm {
32 31
     /**
33 32
      * This holds the current configuration
34 33
      *
@@ -44,8 +43,7 @@  discard block
 block discarded – undo
44 43
      *
45 44
      * @return string Message informing the user of success or failure
46 45
      */
47
-    public function checkSolrConnection()
48
-    {
46
+    public function checkSolrConnection() {
49 47
         $solr = Solr::getInstance();
50 48
         if ($solr->ready) {
51 49
             Helper::addMessage(
@@ -70,8 +68,7 @@  discard block
 block discarded – undo
70 68
      *
71 69
      * @return string Message informing the user of success or failure
72 70
      */
73
-    public function checkMetadataFormats()
74
-    {
71
+    public function checkMetadataFormats() {
75 72
         // We need to do some bootstrapping manually as of TYPO3 9.
76 73
         if (version_compare(\TYPO3\CMS\Core\Utility\VersionNumberUtility::getNumericTypo3Version(), '9.0.0', '>=')) {
77 74
             // Load table configuration array into $GLOBALS['TCA'].
@@ -202,8 +199,7 @@  discard block
 block discarded – undo
202 199
      *
203 200
      * @return void
204 201
      */
205
-    public function __construct()
206
-    {
202
+    public function __construct() {
207 203
         // Load localization file.
208 204
         $GLOBALS['LANG']->includeLLFile('EXT:dlf/Resources/Private/Language/FlashMessages.xml');
209 205
         // Get current configuration.
Please login to merge, or discard this patch.
Classes/Common/Solr.php 1 patch
Braces   +21 added lines, -42 removed lines patch added patch discarded remove patch
@@ -33,8 +33,7 @@  discard block
 block discarded – undo
33 33
  * @property-read bool $ready Is the Solr service instantiated successfully?
34 34
  * @property-read \Solarium\Client $service This holds the Solr service object
35 35
  */
36
-class Solr
37
-{
36
+class Solr {
38 37
     /**
39 38
      * This holds the Solr configuration
40 39
      *
@@ -124,8 +123,7 @@  discard block
 block discarded – undo
124 123
      *
125 124
      * @return string The name of the new core
126 125
      */
127
-    public static function createCore($core = '')
128
-    {
126
+    public static function createCore($core = '') {
129 127
         // Get next available core name if none given.
130 128
         if (empty($core)) {
131 129
             $core = 'dlfCore' . self::getNextCoreNumber();
@@ -172,8 +170,7 @@  discard block
 block discarded – undo
172 170
      *
173 171
      * @return string The escaped query string
174 172
      */
175
-    public static function escapeQuery($query)
176
-    {
173
+    public static function escapeQuery($query) {
177 174
         $helper = GeneralUtility::makeInstance(\Solarium\Core\Query\Helper::class);
178 175
         // Escape query phrase or term.
179 176
         if (preg_match('/^".*"$/', $query)) {
@@ -196,8 +193,7 @@  discard block
 block discarded – undo
196 193
      *
197 194
      * @return string The escaped query string
198 195
      */
199
-    public static function escapeQueryKeepField($query, $pid)
200
-    {
196
+    public static function escapeQueryKeepField($query, $pid) {
201 197
         // Is there a field query?
202 198
         if (preg_match('/^[[:alnum:]]+_[tu][su]i:\(?.*\)?$/', $query)) {
203 199
             $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
@@ -249,8 +245,7 @@  discard block
 block discarded – undo
249 245
      *
250 246
      * @return \Kitodo\Dlf\Common\Solr Instance of this class
251 247
      */
252
-    public static function getInstance($core = null)
253
-    {
248
+    public static function getInstance($core = null) {
254 249
         // Get core name if UID is given.
255 250
         if (MathUtility::canBeInterpretedAsInteger($core)) {
256 251
             $core = Helper::getIndexNameFromUid($core, 'tx_dlf_solrcores');
@@ -290,8 +285,7 @@  discard block
 block discarded – undo
290 285
      *
291 286
      * @return int First unused core number found
292 287
      */
293
-    public static function getNextCoreNumber($number = 0)
294
-    {
288
+    public static function getNextCoreNumber($number = 0) {
295 289
         $number = max(intval($number), 0);
296 290
         // Check if core already exists.
297 291
         $solr = self::getInstance('dlfCore' . $number);
@@ -309,8 +303,7 @@  discard block
 block discarded – undo
309 303
      *
310 304
      * @return void
311 305
      */
312
-    protected function loadSolrConnectionInfo()
313
-    {
306
+    protected function loadSolrConnectionInfo() {
314 307
         if (empty($this->config)) {
315 308
             $config = [];
316 309
             // Extract extension configuration.
@@ -343,8 +336,7 @@  discard block
 block discarded – undo
343 336
      *
344 337
      * @return \Kitodo\Dlf\Common\DocumentList The result list
345 338
      */
346
-    public function search()
347
-    {
339
+    public function search() {
348 340
         $toplevel = [];
349 341
         // Take over query parameters.
350 342
         $params = $this->params;
@@ -419,8 +411,7 @@  discard block
 block discarded – undo
419 411
      *
420 412
      * @return array The Apache Solr Documents that were fetched
421 413
      */
422
-    public function search_raw($query = '', $parameters = [])
423
-    {
414
+    public function search_raw($query = '', $parameters = []) {
424 415
         // Set additional query parameters.
425 416
         $parameters['start'] = 0;
426 417
         $parameters['rows'] = $this->limit;
@@ -454,8 +445,7 @@  discard block
 block discarded – undo
454 445
      *
455 446
      * @return string|null The core name of the current query endpoint or null if core admin endpoint
456 447
      */
457
-    protected function _getCore()
458
-    {
448
+    protected function _getCore() {
459 449
         return $this->core;
460 450
     }
461 451
 
@@ -466,8 +456,7 @@  discard block
 block discarded – undo
466 456
      *
467 457
      * @return int The max number of results
468 458
      */
469
-    protected function _getLimit()
470
-    {
459
+    protected function _getLimit() {
471 460
         return $this->limit;
472 461
     }
473 462
 
@@ -478,8 +467,7 @@  discard block
 block discarded – undo
478 467
      *
479 468
      * @return int Total number of hits for last search
480 469
      */
481
-    protected function _getNumberOfHits()
482
-    {
470
+    protected function _getNumberOfHits() {
483 471
         return $this->numberOfHits;
484 472
     }
485 473
 
@@ -490,8 +478,7 @@  discard block
 block discarded – undo
490 478
      *
491 479
      * @return bool Is the search instantiated successfully?
492 480
      */
493
-    protected function _getReady()
494
-    {
481
+    protected function _getReady() {
495 482
         return $this->ready;
496 483
     }
497 484
 
@@ -502,8 +489,7 @@  discard block
 block discarded – undo
502 489
      *
503 490
      * @return \Solarium\Client Apache Solr service object
504 491
      */
505
-    protected function _getService()
506
-    {
492
+    protected function _getService() {
507 493
         return $this->service;
508 494
     }
509 495
 
@@ -516,8 +502,7 @@  discard block
 block discarded – undo
516 502
      *
517 503
      * @return void
518 504
      */
519
-    protected function _setCPid($value)
520
-    {
505
+    protected function _setCPid($value) {
521 506
         $this->cPid = max(intval($value), 0);
522 507
     }
523 508
 
@@ -530,8 +515,7 @@  discard block
 block discarded – undo
530 515
      *
531 516
      * @return void
532 517
      */
533
-    protected function _setLimit($value)
534
-    {
518
+    protected function _setLimit($value) {
535 519
         $this->limit = max(intval($value), 0);
536 520
     }
537 521
 
@@ -544,8 +528,7 @@  discard block
 block discarded – undo
544 528
      *
545 529
      * @return void
546 530
      */
547
-    protected function _setParams(array $value)
548
-    {
531
+    protected function _setParams(array $value) {
549 532
         $this->params = $value;
550 533
     }
551 534
 
@@ -558,8 +541,7 @@  discard block
 block discarded – undo
558 541
      *
559 542
      * @return mixed Value of $this->$var
560 543
      */
561
-    public function __get($var)
562
-    {
544
+    public function __get($var) {
563 545
         $method = '_get' . ucfirst($var);
564 546
         if (
565 547
             !property_exists($this, $var)
@@ -581,8 +563,7 @@  discard block
 block discarded – undo
581 563
      *
582 564
      * @return bool true if variable is set and not empty, false otherwise
583 565
      */
584
-    public function __isset($var)
585
-    {
566
+    public function __isset($var) {
586 567
         return !empty($this->__get($var));
587 568
     }
588 569
 
@@ -596,8 +577,7 @@  discard block
 block discarded – undo
596 577
      *
597 578
      * @return void
598 579
      */
599
-    public function __set($var, $value)
600
-    {
580
+    public function __set($var, $value) {
601 581
         $method = '_set' . ucfirst($var);
602 582
         if (
603 583
             !property_exists($this, $var)
@@ -618,8 +598,7 @@  discard block
 block discarded – undo
618 598
      *
619 599
      * @return void
620 600
      */
621
-    protected function __construct($core)
622
-    {
601
+    protected function __construct($core) {
623 602
         // Get Solr connection parameters from configuration.
624 603
         $this->loadSolrConnectionInfo();
625 604
         // Configure connection adapter.
Please login to merge, or discard this patch.
Classes/Plugin/Eid/SearchSuggest.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,16 +28,14 @@
 block discarded – undo
28 28
  * @subpackage dlf
29 29
  * @access public
30 30
  */
31
-class SearchSuggest
32
-{
31
+class SearchSuggest {
33 32
     /**
34 33
      * The main method of the eID script
35 34
      *
36 35
     *  @param ServerRequestInterface $request
37 36
      * @return ResponseInterface XML response of search suggestions
38 37
      */
39
-    public function main(ServerRequestInterface $request)
40
-    {
38
+    public function main(ServerRequestInterface $request) {
41 39
         $output = [];
42 40
         // Get input parameters and decrypt core name.
43 41
         $parameters = $request->getParsedBody();
Please login to merge, or discard this patch.
Classes/Plugin/Eid/SearchInDocument.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,16 +27,14 @@
 block discarded – undo
27 27
  * @subpackage dlf
28 28
  * @access public
29 29
  */
30
-class SearchInDocument
31
-{
30
+class SearchInDocument {
32 31
     /**
33 32
      * The main method of the eID script
34 33
      *
35 34
      * @param ServerRequestInterface $request
36 35
      * @return ResponseInterface JSON response of search suggestions
37 36
      */
38
-    public function main(ServerRequestInterface $request)
39
-    {
37
+    public function main(ServerRequestInterface $request) {
40 38
         $output = [
41 39
             'documents' => [],
42 40
             'numFound' => 0
Please login to merge, or discard this patch.