Passed
Pull Request — master (#70)
by Alexander
03:07
created
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
 
@@ -951,8 +935,7 @@  discard block
 block discarded – undo
951 935
      *
952 936
      * @return \DOMElement XML of enriched records
953 937
      */
954
-    protected function generateOutputForDocumentList(DocumentList $documentListSet)
955
-    {
938
+    protected function generateOutputForDocumentList(DocumentList $documentListSet) {
956 939
         $documentsToProcess = $documentListSet->removeRange(0, (int)$this->conf['limit']);
957 940
         $verb = $this->piVars['verb'];
958 941
 
@@ -1055,8 +1038,7 @@  discard block
 block discarded – undo
1055 1038
      *
1056 1039
      * @return \DOMElement XML for resumption token
1057 1040
      */
1058
-    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet)
1059
-    {
1041
+    protected function generateResumptionTokenForDocumentListSet(DocumentList $documentListSet) {
1060 1042
         if ($documentListSet->count() !== 0) {
1061 1043
             $token = uniqid('', false);
1062 1044
 
Please login to merge, or discard this patch.
Classes/Plugin/Eid/PageViewProxy.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
  * @subpackage dlf
25 25
  * @access public
26 26
  */
27
-class PageViewProxy
28
-{
27
+class PageViewProxy {
29 28
 
30 29
     /**
31 30
      * The main method of the eID script
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
      * @param ServerRequestInterface $request
36 35
      * @return ResponseInterface
37 36
      */
38
-    public function main(ServerRequestInterface $request)
39
-    {
37
+    public function main(ServerRequestInterface $request) {
40 38
         // header parameter for getUrl(); allowed values 0,1,2; default 0
41 39
         $header = (int) $request->getQueryParams()['header'];
42 40
         $header = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($header, 0, 2, 0);
Please login to merge, or discard this patch.
Classes/ExpressionLanguage/DocumentTypeProvider.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,10 +23,8 @@
 block discarded – undo
23 23
  * @subpackage dlf
24 24
  * @access public
25 25
  */
26
-class DocumentTypeProvider extends AbstractProvider
27
-{
28
-    public function __construct()
29
-    {
26
+class DocumentTypeProvider extends AbstractProvider {
27
+    public function __construct() {
30 28
         $this->expressionLanguageProviders = [
31 29
             DocumentTypeFunctionProvider::class
32 30
         ];
Please login to merge, or discard this patch.
Classes/Plugin/Tools/FulltextDownloadTool.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
  * @subpackage dlf
23 23
  * @access public
24 24
  */
25
-class FulltextDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin
26
-{
25
+class FulltextDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin {
27 26
     public $scriptRelPath = 'Classes/Plugin/Tools/FulltextDownloadTool.php';
28 27
 
29 28
     /**
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
      *
37 36
      * @return string The content that is displayed on the website
38 37
      */
39
-    public function main($content, $conf)
40
-    {
38
+    public function main($content, $conf) {
41 39
         $this->init($conf);
42 40
         // Merge configuration with conf array of toolbox.
43 41
         if (!empty($this->cObj->data['conf'])) {
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.
Classes/Hooks/Form/FieldInformation/SolrCoreStatus.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
  * @subpackage dlf
25 25
  * @access public
26 26
  */
27
-class SolrCoreStatus extends AbstractNode
28
-{
27
+class SolrCoreStatus extends AbstractNode {
29 28
     /**
30 29
      * Shows Solr core status for given 'index_name'
31 30
      *
Please login to merge, or discard this patch.
Classes/Hooks/Form/FieldInformation/EditInProductionWarning.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@
 block discarded – undo
23 23
  * @subpackage dlf
24 24
  * @access public
25 25
  */
26
-class EditInProductionWarning extends AbstractNode
27
-{
26
+class EditInProductionWarning extends AbstractNode {
28 27
     /**
29 28
      * Generates warning message when editing 'index_name' field
30 29
      *
Please login to merge, or discard this patch.
Classes/Plugin/Tools/PdfDownloadTool.php 1 patch
Braces   +4 added lines, -8 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 PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin
29
-{
28
+class PdfDownloadTool extends \Kitodo\Dlf\Common\AbstractPlugin {
30 29
     public $scriptRelPath = 'Classes/Plugin/Tools/PdfDownloadTool.php';
31 30
 
32 31
     /**
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
      *
40 39
      * @return string The content that is displayed on the website
41 40
      */
42
-    public function main($content, $conf)
43
-    {
41
+    public function main($content, $conf) {
44 42
         $this->init($conf);
45 43
         // Merge configuration with conf array of toolbox.
46 44
         if (!empty($this->cObj->data['conf'])) {
@@ -90,8 +88,7 @@  discard block
 block discarded – undo
90 88
      *
91 89
      * @return string Link to downloadable page
92 90
      */
93
-    protected function getPageLink()
94
-    {
91
+    protected function getPageLink() {
95 92
         $page1Link = '';
96 93
         $page2Link = '';
97 94
         $pageNumber = $this->piVars['page'];
@@ -147,8 +144,7 @@  discard block
 block discarded – undo
147 144
      *
148 145
      * @return string Link to downloadable work
149 146
      */
150
-    protected function getWorkLink()
151
-    {
147
+    protected function getWorkLink() {
152 148
         $workLink = '';
153 149
         $fileGrpsDownload = GeneralUtility::trimExplode(',', $this->conf['fileGrpDownload']);
154 150
         // Get work link.
Please login to merge, or discard this patch.