Passed
Pull Request — master (#123)
by Sebastian
03:12
created
Classes/Common/StdOutStream.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
 {
24 24
     use StreamDecoratorTrait;
25 25
 
26
-    public function emit()
27
-    {
26
+    public function emit() {
28 27
         // Disable output buffering
29 28
         ob_end_flush();
30 29
 
Please login to merge, or discard this patch.
Build/Documentation/dbdocs/RstSection.php 1 patch
Braces   +9 added lines, -18 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 RstSection
24
-{
23
+class RstSection {
25 24
     /** @var string */
26 25
     protected $header = '';
27 26
 
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
     /** @var RstSection[] */
32 31
     protected $subsections = [];
33 32
 
34
-    public static function format(string $text, array $format = [])
35
-    {
33
+    public static function format(string $text, array $format = []) {
36 34
         if (!empty($text)) {
37 35
             if ($format['bold'] ?? false) {
38 36
                 $text = '**' . $text . '**';
@@ -44,8 +42,7 @@  discard block
 block discarded – undo
44 42
         return $text;
45 43
     }
46 44
 
47
-    public static function paragraphs(array $paragraphs)
48
-    {
45
+    public static function paragraphs(array $paragraphs) {
49 46
         $paragraphs = array_values(array_filter($paragraphs, function ($entry) {
50 47
             return !empty($entry);
51 48
         }));
@@ -53,27 +50,23 @@  discard block
 block discarded – undo
53 50
         return implode("\n\n", $paragraphs);
54 51
     }
55 52
 
56
-    public function subsection()
57
-    {
53
+    public function subsection() {
58 54
         $section = new static();
59 55
         $this->subsections[] = $section;
60 56
         return $section;
61 57
     }
62 58
 
63
-    public function setHeader(string $text)
64
-    {
59
+    public function setHeader(string $text) {
65 60
         $this->header = $text;
66 61
     }
67 62
 
68
-    public function addText(string $text)
69
-    {
63
+    public function addText(string $text) {
70 64
         if (!empty($text)) {
71 65
             $this->text .= $text . "\n\n";
72 66
         }
73 67
     }
74 68
 
75
-    public function addTable(array $rows, array $headerRows)
76
-    {
69
+    public function addTable(array $rows, array $headerRows) {
77 70
         $numHeaderRows = count($headerRows);
78 71
 
79 72
         $tableRst = <<<RST
@@ -115,8 +108,7 @@  discard block
 block discarded – undo
115 108
         $this->addText($tableRst);
116 109
     }
117 110
 
118
-    public function render(int $level = 0)
119
-    {
111
+    public function render(int $level = 0) {
120 112
         $result = '';
121 113
 
122 114
         $result .= $this->renderHeader($level);
@@ -130,8 +122,7 @@  discard block
 block discarded – undo
130 122
         return $result;
131 123
     }
132 124
 
133
-    protected function renderHeader(int $level)
134
-    {
125
+    protected function renderHeader(int $level) {
135 126
         $result = '';
136 127
 
137 128
         $headerChar = ['=', '=', '-', '~', '"'][$level];
Please login to merge, or discard this patch.
Classes/ViewHelpers/MetadataWrapVariableViewHelper.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,13 +35,11 @@
 block discarded – undo
35 35
  *     {typoscript -> kitodo:metadataWrapVariable(name: 'wrapInfo')}
36 36
  *
37 37
  */
38
-class MetadataWrapVariableViewHelper extends AbstractViewHelper
39
-{
38
+class MetadataWrapVariableViewHelper extends AbstractViewHelper {
40 39
     /**
41 40
      * @return void
42 41
      */
43
-    public function initializeArguments()
44
-    {
42
+    public function initializeArguments() {
45 43
         $this->registerArgument('name', 'string', 'Name of variable to create', true);
46 44
     }
47 45
 
Please login to merge, or discard this patch.
Classes/Controller/FeedsController.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 FeedsController extends AbstractController
29
-{
28
+class FeedsController extends AbstractController {
30 29
 
31 30
     /**
32 31
      * @var LibraryRepository
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
     /**
37 36
      * @param LibraryRepository $libraryRepository
38 37
      */
39
-    public function injectLibraryRepository(LibraryRepository $libraryRepository)
40
-    {
38
+    public function injectLibraryRepository(LibraryRepository $libraryRepository) {
41 39
         $this->libraryRepository = $libraryRepository;
42 40
     }
43 41
 
@@ -46,8 +44,7 @@  discard block
 block discarded – undo
46 44
      *
47 45
      * @return void
48 46
      */
49
-    public function initializeAction()
50
-    {
47
+    public function initializeAction() {
51 48
         $this->request->setFormat('xml');
52 49
     }
53 50
 
@@ -56,8 +53,7 @@  discard block
 block discarded – undo
56 53
      *
57 54
      * @return void
58 55
      */
59
-    public function mainAction()
60
-    {
56
+    public function mainAction() {
61 57
         // access to GET parameter tx_dlf_feeds['collection']
62 58
         $requestData = $this->request->getArguments();
63 59
 
Please login to merge, or discard this patch.
Classes/Controller/OaiPmhController.php 1 patch
Braces   +19 added lines, -38 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 OaiPmhController extends AbstractController
31
-{
30
+class OaiPmhController extends AbstractController {
32 31
     /**
33 32
      * @var TokenRepository
34 33
      */
@@ -37,8 +36,7 @@  discard block
 block discarded – undo
37 36
     /**
38 37
      * @param TokenRepository $tokenRepository
39 38
      */
40
-    public function injectTokenRepository(TokenRepository $tokenRepository)
41
-    {
39
+    public function injectTokenRepository(TokenRepository $tokenRepository) {
42 40
         $this->tokenRepository = $tokenRepository;
43 41
     }
44 42
 
@@ -50,8 +48,7 @@  discard block
 block discarded – undo
50 48
     /**
51 49
      * @param CollectionRepository $collectionRepository
52 50
      */
53
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
54
-    {
51
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
55 52
         $this->collectionRepository = $collectionRepository;
56 53
     }
57 54
 
@@ -63,8 +60,7 @@  discard block
 block discarded – undo
63 60
     /**
64 61
      * @param LibraryRepository $libraryRepository
65 62
      */
66
-    public function injectLibraryRepository(LibraryRepository $libraryRepository)
67
-    {
63
+    public function injectLibraryRepository(LibraryRepository $libraryRepository) {
68 64
         $this->libraryRepository = $libraryRepository;
69 65
     }
70 66
 
@@ -73,8 +69,7 @@  discard block
 block discarded – undo
73 69
      *
74 70
      * @return void
75 71
      */
76
-    public function initializeAction()
77
-    {
72
+    public function initializeAction() {
78 73
         $this->request->setFormat('xml');
79 74
     }
80 75
 
@@ -122,8 +117,7 @@  discard block
 block discarded – undo
122 117
      *
123 118
      * @return void
124 119
      */
125
-    protected function deleteExpiredTokens()
126
-    {
120
+    protected function deleteExpiredTokens() {
127 121
         // Delete expired resumption tokens.
128 122
         $this->tokenRepository->deleteExpiredTokens($this->settings['expired']);
129 123
     }
@@ -135,8 +129,7 @@  discard block
 block discarded – undo
135 129
      *
136 130
      * @return void
137 131
      */
138
-    protected function getUrlParams()
139
-    {
132
+    protected function getUrlParams() {
140 133
         $allowedParams = [
141 134
             'verb',
142 135
             'identifier',
@@ -166,8 +159,7 @@  discard block
 block discarded – undo
166 159
      *
167 160
      * @return array $metadata: The mapped metadata array
168 161
      */
169
-    protected function getDcData(array $record)
170
-    {
162
+    protected function getDcData(array $record) {
171 163
         $metadata = [];
172 164
 
173 165
         $metadata[] = ['dc:identifier' => $record['record_id']];
@@ -232,8 +224,7 @@  discard block
 block discarded – undo
232 224
      *
233 225
      * @return string: The fetched METS XML
234 226
      */
235
-    protected function getMetsData(array $record)
236
-    {
227
+    protected function getMetsData(array $record) {
237 228
         $mets = null;
238 229
         // Load METS file.
239 230
         $xml = new \DOMDocument();
@@ -256,8 +247,7 @@  discard block
 block discarded – undo
256 247
      *
257 248
      * @return void
258 249
      */
259
-    public function mainAction()
260
-    {
250
+    public function mainAction() {
261 251
         // Get allowed GET and POST variables.
262 252
         $this->getUrlParams();
263 253
 
@@ -324,8 +314,7 @@  discard block
 block discarded – undo
324 314
      *
325 315
      * @return void
326 316
      */
327
-    protected function verbGetRecord()
328
-    {
317
+    protected function verbGetRecord() {
329 318
         if (count($this->parameters) !== 3 || empty($this->parameters['metadataPrefix']) || empty($this->parameters['identifier'])) {
330 319
             $this->error = 'badArgument';
331 320
             return;
@@ -377,8 +366,7 @@  discard block
 block discarded – undo
377 366
      *
378 367
      * @return void
379 368
      */
380
-    protected function verbIdentify()
381
-    {
369
+    protected function verbIdentify() {
382 370
         $library = $this->libraryRepository->findByUid($this->settings['library']);
383 371
 
384 372
         $oaiIdentifyInfo = [];
@@ -427,8 +415,7 @@  discard block
 block discarded – undo
427 415
      *
428 416
      * @return void
429 417
      */
430
-    protected function verbListIdentifiers()
431
-    {
418
+    protected function verbListIdentifiers() {
432 419
         // If we have a resumption token we can continue our work
433 420
         if (!empty($this->parameters['resumptionToken'])) {
434 421
             // "resumptionToken" is an exclusive argument.
@@ -482,8 +469,7 @@  discard block
 block discarded – undo
482 469
      *
483 470
      * @return void
484 471
      */
485
-    protected function verbListMetadataFormats()
486
-    {
472
+    protected function verbListMetadataFormats() {
487 473
         $resArray = [];
488 474
         // check for the optional "identifier" parameter
489 475
         if (isset($this->parameters['identifier'])) {
@@ -515,8 +501,7 @@  discard block
 block discarded – undo
515 501
      *
516 502
      * @return void
517 503
      */
518
-    protected function verbListRecords()
519
-    {
504
+    protected function verbListRecords() {
520 505
         // Check for invalid arguments.
521 506
         if (!empty($this->parameters['resumptionToken'])) {
522 507
             // "resumptionToken" is an exclusive argument.
@@ -571,8 +556,7 @@  discard block
 block discarded – undo
571 556
      *
572 557
      * @return void
573 558
      */
574
-    protected function verbListSets()
575
-    {
559
+    protected function verbListSets() {
576 560
         // It is required to set a oai_name inside the collection record to be shown in oai-pmh plugin.
577 561
         $this->settings['hideEmptyOaiNames'] = true;
578 562
 
@@ -588,8 +572,7 @@  discard block
 block discarded – undo
588 572
      *
589 573
      * @return array|null Array of matching records
590 574
      */
591
-    protected function fetchDocumentUIDs()
592
-    {
575
+    protected function fetchDocumentUIDs() {
593 576
         $solr_query = '';
594 577
         // Check "set" for valid value.
595 578
         if (!empty($this->parameters['set'])) {
@@ -698,8 +681,7 @@  discard block
 block discarded – undo
698 681
      *
699 682
      * @return array of enriched records
700 683
      */
701
-    protected function generateOutputForDocumentList(array $documentListSet)
702
-    {
684
+    protected function generateOutputForDocumentList(array $documentListSet) {
703 685
         $documentsToProcess = array_splice($documentListSet['elements'], 0, (int) $this->settings['limit']);
704 686
         if (empty($documentsToProcess)) {
705 687
             $this->error = 'noRecordsMatch';
@@ -752,8 +734,7 @@  discard block
 block discarded – undo
752 734
      *
753 735
      * @return void
754 736
      */
755
-    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments)
756
-    {
737
+    protected function generateResumptionTokenForDocumentListSet(array $documentListSet, int $numShownDocuments) {
757 738
         // The cursor specifies how many elements have already been returned in previous requests
758 739
         // See http://www.openarchives.org/OAI/openarchivesprotocol.html#FlowControl
759 740
         $currentCursor = $documentListSet['metadata']['cursor'];
Please login to merge, or discard this patch.
Classes/Controller/CollectionController.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @subpackage dlf
30 30
  * @access public
31 31
  */
32
-class CollectionController extends AbstractController
33
-{
32
+class CollectionController extends AbstractController {
34 33
     /**
35 34
      * @var CollectionRepository
36 35
      */
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
     /**
40 39
      * @param CollectionRepository $collectionRepository
41 40
      */
42
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
43
-    {
41
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
44 42
         $this->collectionRepository = $collectionRepository;
45 43
     }
46 44
 
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
     /**
53 51
      * @param MetadataRepository $metadataRepository
54 52
      */
55
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
56
-    {
53
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
57 54
         $this->metadataRepository = $metadataRepository;
58 55
     }
59 56
 
@@ -62,8 +59,7 @@  discard block
 block discarded – undo
62 59
      *
63 60
      * @return void
64 61
      */
65
-    public function listAction()
66
-    {
62
+    public function listAction() {
67 63
         $solr = Solr::getInstance($this->settings['solrcore']);
68 64
 
69 65
         if (!$solr->ready) {
@@ -146,8 +142,7 @@  discard block
 block discarded – undo
146 142
      *
147 143
      * @return void
148 144
      */
149
-    public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection)
150
-    {
145
+    public function showAction(\Kitodo\Dlf\Domain\Model\Collection $collection) {
151 146
         $searchParams = $this->getParametersSafely('searchParameter');
152 147
 
153 148
         // Instaniate the Solr. Without Solr present, we can't do anything.
@@ -199,8 +194,7 @@  discard block
 block discarded – undo
199 194
      *
200 195
      * @return void
201 196
      */
202
-    public function showSortedAction()
203
-    {
197
+    public function showSortedAction() {
204 198
         // if search was triggered, get search parameters from POST variables
205 199
         $searchParams = $this->getParametersSafely('searchParameter');
206 200
 
Please login to merge, or discard this patch.
Classes/Controller/AudioPlayerController.php 1 patch
Braces   +3 added lines, -6 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 AudioplayerController extends AbstractController
29
-{
28
+class AudioplayerController extends AbstractController {
30 29
     /**
31 30
      * Holds the current audio file's URL, MIME type and optional label
32 31
      *
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
      *
43 42
      * @return void
44 43
      */
45
-    protected function addPlayerJS()
46
-    {
44
+    protected function addPlayerJS() {
47 45
         // Inline CSS.
48 46
         $inlineCSS = '#tx-dlf-audio { width: 100px; height: 100px; }';
49 47
 
@@ -72,8 +70,7 @@  discard block
 block discarded – undo
72 70
      *
73 71
      * @return void
74 72
      */
75
-    public function mainAction()
76
-    {
73
+    public function mainAction() {
77 74
         // Load current document.
78 75
         $this->loadDocument($this->requestData);
79 76
         if (
Please login to merge, or discard this patch.
Classes/Controller/ListViewController.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
  * @subpackage dlf
30 30
  * @access public
31 31
  */
32
-class ListViewController extends AbstractController
33
-{
32
+class ListViewController extends AbstractController {
34 33
     /**
35 34
      * @var CollectionRepository
36 35
      */
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
     /**
40 39
      * @param CollectionRepository $collectionRepository
41 40
      */
42
-    public function injectCollectionRepository(CollectionRepository $collectionRepository)
43
-    {
41
+    public function injectCollectionRepository(CollectionRepository $collectionRepository) {
44 42
         $this->collectionRepository = $collectionRepository;
45 43
     }
46 44
 
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
     /**
53 51
      * @param MetadataRepository $metadataRepository
54 52
      */
55
-    public function injectMetadataRepository(MetadataRepository $metadataRepository)
56
-    {
53
+    public function injectMetadataRepository(MetadataRepository $metadataRepository) {
57 54
         $this->metadataRepository = $metadataRepository;
58 55
     }
59 56
 
@@ -68,8 +65,7 @@  discard block
 block discarded – undo
68 65
      *
69 66
      * @return void
70 67
      */
71
-    public function mainAction()
72
-    {
68
+    public function mainAction() {
73 69
         $this->searchParams = $this->getParametersSafely('searchParameter');
74 70
 
75 71
         $collection = null;
Please login to merge, or discard this patch.
Classes/Controller/PageGridController.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,15 +22,13 @@  discard block
 block discarded – undo
22 22
  * @subpackage dlf
23 23
  * @access public
24 24
  */
25
-class PageGridController extends AbstractController
26
-{
25
+class PageGridController extends AbstractController {
27 26
     /**
28 27
      * The main method of the plugin
29 28
      *
30 29
      * @return void
31 30
      */
32
-    public function mainAction()
33
-    {
31
+    public function mainAction() {
34 32
         $this->loadDocument($this->requestData);
35 33
         if (
36 34
             $this->document === null
@@ -65,8 +63,7 @@  discard block
 block discarded – undo
65 63
      *
66 64
      * @return array The rendered entry ready for fluid
67 65
      */
68
-    protected function getEntry($number, $fileGrpThumbs)
69
-    {
66
+    protected function getEntry($number, $fileGrpThumbs) {
70 67
         // Set pagination.
71 68
         $entry['pagination'] = htmlspecialchars($this->document->getDoc()->physicalStructureInfo[$this->document->getDoc()->physicalStructure[$number]]['orderlabel']);
72 69
         $entry['page'] = $number;
Please login to merge, or discard this patch.