Passed
Pull Request — master (#91)
by Alexander
02:40
created
Classes/Common/SolrSearchResult/Page.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
  * @subpackage dlf
21 21
  * @access public
22 22
  */
23
-class Page
24
-{
23
+class Page {
25 24
 
26 25
     /**
27 26
      * The identifier of the page
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
      *
66 65
      * @return void
67 66
      */
68
-    public function __construct($id, $page)
69
-    {
67
+    public function __construct($id, $page) {
70 68
         $this->id = $id;
71 69
         $this->name = $page['id'];
72 70
         $this->width = $page['width'];
@@ -80,8 +78,7 @@  discard block
 block discarded – undo
80 78
      *
81 79
      * @return int The page's identifier
82 80
      */
83
-    public function getId()
84
-    {
81
+    public function getId() {
85 82
         return $this->id;
86 83
     }
87 84
 
@@ -92,8 +89,7 @@  discard block
 block discarded – undo
92 89
      *
93 90
      * @return string The page's name
94 91
      */
95
-    public function getName()
96
-    {
92
+    public function getName() {
97 93
         return $this->name;
98 94
     }
99 95
 
@@ -104,8 +100,7 @@  discard block
 block discarded – undo
104 100
      *
105 101
      * @return int The page's width
106 102
      */
107
-    public function getWidth()
108
-    {
103
+    public function getWidth() {
109 104
         return $this->width;
110 105
     }
111 106
 
@@ -116,8 +111,7 @@  discard block
 block discarded – undo
116 111
      *
117 112
      * @return int The page's height
118 113
      */
119
-    public function getHeight()
120
-    {
114
+    public function getHeight() {
121 115
         return $this->height;
122 116
     }
123 117
 }
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/OaiPmh.php 1 patch
Braces   +18 added lines, -36 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 OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin
31
-{
30
+class OaiPmh extends \Kitodo\Dlf\Common\AbstractPlugin {
32 31
     public $scriptRelPath = 'Classes/Plugin/OaiPmh.php';
33 32
 
34 33
     /**
@@ -78,8 +77,7 @@  discard block
 block discarded – undo
78 77
      *
79 78
      * @return void
80 79
      */
81
-    protected function deleteExpiredTokens()
82
-    {
80
+    protected function deleteExpiredTokens() {
83 81
         // Delete expired resumption tokens.
84 82
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tx_dlf_tokens');
85 83
 
@@ -106,8 +104,7 @@  discard block
 block discarded – undo
106 104
      *
107 105
      * @return \DOMElement XML node to add to the OAI response
108 106
      */
109
-    protected function error($type)
110
-    {
107
+    protected function error($type) {
111 108
         $this->error = true;
112 109
         $error = $this->oai->createElementNS('http://www.openarchives.org/OAI/2.0/', 'error', htmlspecialchars($this->pi_getLL($type, $type), ENT_NOQUOTES, 'UTF-8'));
113 110
         $error->setAttribute('code', $type);
@@ -121,8 +118,7 @@  discard block
 block discarded – undo
121 118
      *
122 119
      * @return void
123 120
      */
124
-    protected function getUrlParams()
125
-    {
121
+    protected function getUrlParams() {
126 122
         $allowedParams = [
127 123
             'verb',
128 124
             'identifier',
@@ -152,8 +148,7 @@  discard block
 block discarded – undo
152 148
      *
153 149
      * @return \DOMElement XML node to add to the OAI response
154 150
      */
155
-    protected function getDcData(array $metadata)
156
-    {
151
+    protected function getDcData(array $metadata) {
157 152
         $oai_dc = $this->oai->createElementNS($this->formats['oai_dc']['namespace'], 'oai_dc:dc');
158 153
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:dc', 'http://purl.org/dc/elements/1.1/');
159 154
         $oai_dc->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
@@ -231,8 +226,7 @@  discard block
 block discarded – undo
231 226
      *
232 227
      * @return \DOMElement XML node to add to the OAI response
233 228
      */
234
-    protected function getEpicurData(array $metadata)
235
-    {
229
+    protected function getEpicurData(array $metadata) {
236 230
         // Define all XML elements with or without qualified namespace.
237 231
         if (empty($this->conf['unqualified_epicur'])) {
238 232
             $epicur = $this->oai->createElementNS($this->formats['epicur']['namespace'], 'epicur:epicur');
@@ -295,8 +289,7 @@  discard block
 block discarded – undo
295 289
      *
296 290
      * @return \DOMElement XML node to add to the OAI response
297 291
      */
298
-    protected function getMetsData(array $metadata)
299
-    {
292
+    protected function getMetsData(array $metadata) {
300 293
         $mets = null;
301 294
         // Load METS file.
302 295
         $xml = new \DOMDocument();
@@ -328,8 +321,7 @@  discard block
 block discarded – undo
328 321
      *
329 322
      * @return void
330 323
      */
331
-    public function main($content, $conf)
332
-    {
324
+    public function main($content, $conf) {
333 325
         // Initialize plugin.
334 326
         $this->init($conf);
335 327
         // Turn cache off.
@@ -420,8 +412,7 @@  discard block
 block discarded – undo
420 412
      *
421 413
      * @return \DOMElement XML node to add to the OAI response
422 414
      */
423
-    protected function resume()
424
-    {
415
+    protected function resume() {
425 416
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
426 417
             ->getQueryBuilderForTable('tx_dlf_tokens');
427 418
 
@@ -454,8 +445,7 @@  discard block
 block discarded – undo
454 445
      *
455 446
      * @return \DOMElement XML node to add to the OAI response
456 447
      */
457
-    protected function verbGetRecord()
458
-    {
448
+    protected function verbGetRecord() {
459 449
         if (count($this->piVars) !== 3 || empty($this->piVars['metadataPrefix']) || empty($this->piVars['identifier'])) {
460 450
             return $this->error('badArgument');
461 451
         }
@@ -548,8 +538,7 @@  discard block
 block discarded – undo
548 538
      *
549 539
      * @return \DOMElement XML node to add to the OAI response
550 540
      */
551
-    protected function verbIdentify()
552
-    {
541
+    protected function verbIdentify() {
553 542
         // Check for invalid arguments.
554 543
         if (count($this->piVars) > 1) {
555 544
             return $this->error('badArgument');
@@ -632,8 +621,7 @@  discard block
 block discarded – undo
632 621
      *
633 622
      * @return \DOMElement XML node to add to the OAI response
634 623
      */
635
-    protected function verbListIdentifiers()
636
-    {
624
+    protected function verbListIdentifiers() {
637 625
         // If we have a resumption token we can continue our work
638 626
         if (!empty($this->piVars['resumptionToken'])) {
639 627
             // "resumptionToken" is an exclusive argument.
@@ -672,8 +660,7 @@  discard block
 block discarded – undo
672 660
      *
673 661
      * @return \DOMElement XML node to add to the OAI response
674 662
      */
675
-    protected function verbListMetadataFormats()
676
-    {
663
+    protected function verbListMetadataFormats() {
677 664
         $resArray = [];
678 665
         // Check for invalid arguments.
679 666
         if (count($this->piVars) > 1) {
@@ -731,8 +718,7 @@  discard block
 block discarded – undo
731 718
      *
732 719
      * @return \DOMElement XML node to add to the OAI response
733 720
      */
734
-    protected function verbListRecords()
735
-    {
721
+    protected function verbListRecords() {
736 722
         // Check for invalid arguments.
737 723
         if (!empty($this->piVars['resumptionToken'])) {
738 724
             // "resumptionToken" is an exclusive argument.
@@ -772,8 +758,7 @@  discard block
 block discarded – undo
772 758
      *
773 759
      * @return \DOMElement XML node to add to the OAI response
774 760
      */
775
-    protected function verbListSets()
776
-    {
761
+    protected function verbListSets() {
777 762
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
778 763
             ->getQueryBuilderForTable('tx_dlf_collections');
779 764
 
@@ -829,8 +814,7 @@  discard block
 block discarded – undo
829 814
      * @return array Array of matching records
830 815
      * @throws \Exception
831 816
      */
832
-    protected function fetchDocumentUIDs()
833
-    {
817
+    protected function fetchDocumentUIDs() {
834 818
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
835 819
             ->getQueryBuilderForTable('tx_dlf_collections');
836 820
 
@@ -955,8 +939,7 @@  discard block
 block discarded – undo
955 939
      *
956 940
      * @return \DOMElement XML of enriched records
957 941
      */
958
-    protected function generateOutputForDocumentList(DocumentList $documentListSet)
959
-    {
942
+    protected function generateOutputForDocumentList(DocumentList $documentListSet) {
960 943
         $documentsToProcess = $documentListSet->removeRange(0, (int) $this->conf['limit']);
961 944
         $verb = $this->piVars['verb'];
962 945
 
@@ -1059,8 +1042,7 @@  discard block
 block discarded – undo
1059 1042
      *
1060 1043
      * @return \DOMElement XML for resumption token
1061 1044
      */
1062
-    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet)
1063
-    {
1045
+    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) {
1064 1046
         if ($documentListSet->count() !== 0) {
1065 1047
             $token = uniqid('', false);
1066 1048
 
Please login to merge, or discard this patch.
Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
     /**
47 47
      * @return ExpressionFunction[] An array of Function instances
48 48
      */
49
-    public function getFunctions()
50
-    {
49
+    public function getFunctions() {
51 50
         return [
52 51
             $this->getDocumentTypeFunction(),
53 52
         ];
@@ -62,12 +61,10 @@  discard block
 block discarded – undo
62 61
     {
63 62
         return new ExpressionFunction(
64 63
             'getDocumentType',
65
-            function()
66
-            {
64
+            function() {
67 65
                 // Not implemented, we only use the evaluator
68 66
             },
69
-            function($arguments, $cPid)
70
-            {
67
+            function($arguments, $cPid) {
71 68
                 /** @var RequestWrapper $requestWrapper */
72 69
                 $requestWrapper = $arguments['request'];
73 70
                 $queryParams = $requestWrapper->getQueryParams();
@@ -107,8 +104,7 @@  discard block
 block discarded – undo
107 104
      *
108 105
      * @return \Kitodo\Dlf\Common\Document Instance of the current document
109 106
      */
110
-    protected function loadDocument(array $piVars)
111
-    {
107
+    protected function loadDocument(array $piVars) {
112 108
         // Check for required variable.
113 109
         if (!empty($piVars['id'])) {
114 110
             // Get instance of document.
Please login to merge, or discard this patch.
Classes/Plugin/Navigation.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
  * @subpackage dlf
26 26
  * @access public
27 27
  */
28
-class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin
29
-{
28
+class Navigation extends \Kitodo\Dlf\Common\AbstractPlugin {
30 29
     public $scriptRelPath = 'Classes/Plugin/Navigation.php';
31 30
 
32 31
     /**
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
      *
37 36
      * @return string Link to the list view ready to output
38 37
      */
39
-    protected function getLinkToListview()
40
-    {
38
+    protected function getLinkToListview() {
41 39
         if (!empty($this->conf['targetPid'])) {
42 40
             // Load the list.
43 41
             $list = GeneralUtility::makeInstance(DocumentList::class);
@@ -63,8 +61,7 @@  discard block
 block discarded – undo
63 61
      *
64 62
      * @return string Page selector ready to output
65 63
      */
66
-    protected function getPageSelector()
67
-    {
64
+    protected function getPageSelector() {
68 65
         // Configure @action URL for form.
69 66
         $linkConf = [
70 67
             'parameter' => $GLOBALS['TSFE']->id,
@@ -98,8 +95,7 @@  discard block
 block discarded – undo
98 95
      *
99 96
      * @return string The content that is displayed on the website
100 97
      */
101
-    public function main($content, $conf)
102
-    {
98
+    public function main($content, $conf) {
103 99
         $this->init($conf);
104 100
         // Turn cache on.
105 101
         $this->setCache(true);
@@ -214,8 +210,7 @@  discard block
 block discarded – undo
214 210
      *
215 211
      * @return string Typolink ready to output
216 212
      */
217
-    protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '')
218
-    {
213
+    protected function makeLink($label, array $overrulePIvars = [], $aTagParams = '') {
219 214
         // Merge plugin variables with new set of values.
220 215
         if (is_array($this->piVars)) {
221 216
             $piVars = $this->piVars;
Please login to merge, or discard this patch.
Classes/Command/BaseCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
  * @subpackage dlf
27 27
  * @access public
28 28
  */
29
-class BaseCommand extends Command
30
-{
29
+class BaseCommand extends Command {
31 30
     /**
32 31
      * Return starting point for indexing command.
33 32
      *
Please login to merge, or discard this patch.
Classes/Command/ReindexCommand.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,15 +32,13 @@  discard block
 block discarded – undo
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('')
@@ -84,8 +82,7 @@  discard block
 block discarded – undo
84 82
      *
85 83
      * @return void
86 84
      */
87
-    protected function execute(InputInterface $input, OutputInterface $output)
88
-    {
85
+    protected function execute(InputInterface $input, OutputInterface $output) {
89 86
         // Make sure the _cli_ user is loaded
90 87
         Bootstrap::getInstance()->initializeBackendAuthentication();
91 88
 
Please login to merge, or discard this patch.
Classes/Command/IndexCommand.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,15 +31,13 @@  discard block
 block discarded – undo
31 31
  * @subpackage dlf
32 32
  * @access public
33 33
  */
34
-class IndexCommand extends BaseCommand
35
-{
34
+class IndexCommand extends BaseCommand {
36 35
     /**
37 36
      * Configure the command by defining the name, options and arguments
38 37
      *
39 38
      * @return void
40 39
      */
41
-    public function configure()
42
-    {
40
+    public function configure() {
43 41
         $this
44 42
             ->setDescription('Index single document into database and Solr.')
45 43
             ->setHelp('')
@@ -77,8 +75,7 @@  discard block
 block discarded – undo
77 75
      *
78 76
      * @return void
79 77
      */
80
-    protected function execute(InputInterface $input, OutputInterface $output)
81
-    {
78
+    protected function execute(InputInterface $input, OutputInterface $output) {
82 79
         // Make sure the _cli_ user is loaded
83 80
         Bootstrap::getInstance()->initializeBackendAuthentication();
84 81
 
Please login to merge, or discard this patch.
Classes/Command/HarvestCommand.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,15 +34,13 @@  discard block
 block discarded – undo
34 34
  * @subpackage dlf
35 35
  * @access public
36 36
  */
37
-class HarvestCommand extends BaseCommand
38
-{
37
+class HarvestCommand extends BaseCommand {
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('Harvest OAI-PMH contents into database and Solr.')
48 46
             ->setHelp('')
@@ -98,8 +96,7 @@  discard block
 block discarded – undo
98 96
      *
99 97
      * @return void
100 98
      */
101
-    protected function execute(InputInterface $input, OutputInterface $output)
102
-    {
99
+    protected function execute(InputInterface $input, OutputInterface $output) {
103 100
         // Make sure the _cli_ user is loaded
104 101
         Bootstrap::getInstance()->initializeBackendAuthentication();
105 102
 
@@ -268,8 +265,7 @@  discard block
 block discarded – undo
268 265
      *
269 266
      * @return void
270 267
      */
271
-    protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io)
272
-    {
268
+    protected function handleOaiError(BaseoaipmhException $exception, SymfonyStyle $io) {
273 269
         $io->error('ERROR: Trying to retrieve data from OAI interface resulted in error:' . "\n    " . $exception->getMessage());
274 270
     }
275 271
 }
Please login to merge, or discard this patch.