Passed
Pull Request — master (#123)
by
unknown
05:25
created
Classes/Domain/Model/AnnotationTarget.php 1 patch
Braces   +11 added lines, -22 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  * LICENSE.txt file that was distributed with this source code.
13 13
  */
14 14
 
15
-class AnnotationTarget
16
-{
15
+class AnnotationTarget {
17 16
     /**
18 17
      * @var string
19 18
      */
@@ -39,8 +38,7 @@  discard block
 block discarded – undo
39 38
      */
40 39
     protected $rangeValue;
41 40
 
42
-    public function __construct($url)
43
-    {
41
+    public function __construct($url) {
44 42
         $this->url = $url;
45 43
 
46 44
         $path = parse_url($url, PHP_URL_PATH);
@@ -65,40 +63,35 @@  discard block
 block discarded – undo
65 63
     /**
66 64
      * @return string
67 65
      */
68
-    public function getObjectId()
69
-    {
66
+    public function getObjectId() {
70 67
         return $this->objectId;
71 68
     }
72 69
 
73 70
     /**
74 71
      * @return string
75 72
      */
76
-    public function getId()
77
-    {
73
+    public function getId() {
78 74
         return $this->id;
79 75
     }
80 76
 
81 77
     /**
82 78
      * @return string
83 79
      */
84
-    public function getRangeParameterName()
85
-    {
80
+    public function getRangeParameterName() {
86 81
         return $this->rangeParameterName;
87 82
     }
88 83
 
89 84
     /**
90 85
      * @return string
91 86
      */
92
-    public function getRangeValue()
93
-    {
87
+    public function getRangeValue() {
94 88
         return $this->rangeValue;
95 89
     }
96 90
 
97 91
     /**
98 92
      * @return bool
99 93
      */
100
-    public function isValid()
101
-    {
94
+    public function isValid() {
102 95
         if (empty($this->getObjectId())) {
103 96
             return false;
104 97
         }
@@ -113,8 +106,7 @@  discard block
 block discarded – undo
113 106
     /**
114 107
      * @return bool
115 108
      */
116
-    public function isValidRange()
117
-    {
109
+    public function isValidRange() {
118 110
         if (empty($this->rangeParameterName) && empty($this->rangeValue)) {
119 111
             return true;
120 112
         } elseif ($this->isFacsimileRange()) {
@@ -131,24 +123,21 @@  discard block
 block discarded – undo
131 123
     /**
132 124
      * @return bool
133 125
      */
134
-    public function isScoreRange()
135
-    {
126
+    public function isScoreRange() {
136 127
         return $this->getRangeParameterName() === 'measureRanges';
137 128
     }
138 129
 
139 130
     /**
140 131
      * @return bool
141 132
      */
142
-    public function isAudioRange()
143
-    {
133
+    public function isAudioRange() {
144 134
         return $this->getRangeParameterName() === 't';
145 135
     }
146 136
 
147 137
     /**
148 138
      * @return bool
149 139
      */
150
-    public function isFacsimileRange()
151
-    {
140
+    public function isFacsimileRange() {
152 141
         return $this->getRangeParameterName() === 'xywh';
153 142
     }
154 143
 }
Please login to merge, or discard this patch.
Classes/Domain/Model/Annotation.php 1 patch
Braces   +18 added lines, -36 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  * LICENSE.txt file that was distributed with this source code.
13 13
  */
14 14
 
15
-class Annotation
16
-{
15
+class Annotation {
17 16
     /**
18 17
      * The complete data of the annotation
19 18
      *
@@ -30,8 +29,7 @@  discard block
 block discarded – undo
30 29
     /**
31 30
      * @param array $data
32 31
      */
33
-    public function __construct($data)
34
-    {
32
+    public function __construct($data) {
35 33
         $this->data = $data;
36 34
     }
37 35
 
@@ -40,8 +38,7 @@  discard block
 block discarded – undo
40 38
      *
41 39
      * @return array
42 40
      */
43
-    public function getRawData()
44
-    {
41
+    public function getRawData() {
45 42
         return $this->data;
46 43
     }
47 44
 
@@ -50,8 +47,7 @@  discard block
 block discarded – undo
50 47
      *
51 48
      * @return string
52 49
      */
53
-    public function getId()
54
-    {
50
+    public function getId() {
55 51
         return $this->data['id'] ?? '';
56 52
     }
57 53
 
@@ -60,8 +56,7 @@  discard block
 block discarded – undo
60 56
      *
61 57
      * @return string
62 58
      */
63
-    public function getTitle()
64
-    {
59
+    public function getTitle() {
65 60
         return $this->data['title'] ?? '';
66 61
     }
67 62
 
@@ -70,8 +65,7 @@  discard block
 block discarded – undo
70 65
      *
71 66
      * @return array
72 67
      */
73
-    public function getBody()
74
-    {
68
+    public function getBody() {
75 69
         $body = $this->data['body'] ?? '';
76 70
 
77 71
         if (is_array($body)) {
@@ -85,8 +79,7 @@  discard block
 block discarded – undo
85 79
      * Gets the name of the annotation creator
86 80
      * @return string
87 81
      */
88
-    public function getCreatorName()
89
-    {
82
+    public function getCreatorName() {
90 83
         return $this->data['creator']['displayName'] ?? '';
91 84
     }
92 85
 
@@ -94,8 +87,7 @@  discard block
 block discarded – undo
94 87
      * Gets the creation date of the annotation
95 88
      * @return string
96 89
      */
97
-    public function getCreated()
98
-    {
90
+    public function getCreated() {
99 91
         return $this->data['created'] ?? '';
100 92
     }
101 93
 
@@ -103,8 +95,7 @@  discard block
 block discarded – undo
103 95
      * Gets the modification date of the annotation
104 96
      * @return string
105 97
      */
106
-    public function getModified()
107
-    {
98
+    public function getModified() {
108 99
         return $this->data['modified'] ?? '';
109 100
     }
110 101
 
@@ -113,8 +104,7 @@  discard block
 block discarded – undo
113 104
      *
114 105
      * @return AnnotationTarget[]
115 106
      */
116
-    public function getTargets()
117
-    {
107
+    public function getTargets() {
118 108
         if (is_string($this->data['target'])) {
119 109
             return [new AnnotationTarget($this->data['target'])];
120 110
         }
@@ -133,8 +123,7 @@  discard block
 block discarded – undo
133 123
      * @param array $targetPages
134 124
      * @return void
135 125
      */
136
-    public function setTargetPages($targetPages)
137
-    {
126
+    public function setTargetPages($targetPages) {
138 127
         $this->targetPages = $targetPages;
139 128
     }
140 129
 
@@ -143,8 +132,7 @@  discard block
 block discarded – undo
143 132
      *
144 133
      * @return array
145 134
      */
146
-    public function getTargetPages()
147
-    {
135
+    public function getTargetPages() {
148 136
         return $this->targetPages;
149 137
     }
150 138
 
@@ -153,8 +141,7 @@  discard block
 block discarded – undo
153 141
      *
154 142
      * @return array
155 143
      */
156
-    public function getPageNumbers()
157
-    {
144
+    public function getPageNumbers() {
158 145
         $pages = [];
159 146
         if (is_array($this->targetPages)) {
160 147
             foreach ($this->targetPages as $target) {
@@ -170,8 +157,7 @@  discard block
 block discarded – undo
170 157
      *
171 158
      * @return array
172 159
      */
173
-    public function getPageTargets()
174
-    {
160
+    public function getPageTargets() {
175 161
         $pageTargets = [];
176 162
         if (is_array($this->targetPages)) {
177 163
             foreach ($this->targetPages as $target) {
@@ -189,8 +175,7 @@  discard block
 block discarded – undo
189 175
      *
190 176
      * @return array
191 177
      */
192
-    public function getPageAudioRanges()
193
-    {
178
+    public function getPageAudioRanges() {
194 179
         $ranges = [];
195 180
         if (is_array($this->getPageTargets())) {
196 181
             foreach ($this->getPageTargets() as $pageNumber => $targets) {
@@ -209,8 +194,7 @@  discard block
 block discarded – undo
209 194
      *
210 195
      * @return array
211 196
      */
212
-    public function getPageScoreRanges()
213
-    {
197
+    public function getPageScoreRanges() {
214 198
         $ranges = [];
215 199
         if (is_array($this->getPageTargets())) {
216 200
             foreach ($this->getPageTargets() as $pageNumber => $targets) {
@@ -229,8 +213,7 @@  discard block
 block discarded – undo
229 213
      *
230 214
      * @return array
231 215
      */
232
-    public function getPageFacsimileRanges()
233
-    {
216
+    public function getPageFacsimileRanges() {
234 217
         $ranges = [];
235 218
         if (is_array($this->getPageTargets())) {
236 219
             foreach ($this->getPageTargets() as $pageNumber => $targets) {
@@ -250,8 +233,7 @@  discard block
 block discarded – undo
250 233
      *
251 234
      * @return bool
252 235
      */
253
-    public function isVerovioRelevant()
254
-    {
236
+    public function isVerovioRelevant() {
255 237
         foreach ($this->targetPages as $target) {
256 238
             if (array_key_exists('verovioRelevant', $target) && $target['verovioRelevant']) {
257 239
                     return true;
Please login to merge, or discard this patch.
Classes/Domain/Model/MetadataFormat.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@  discard block
 block discarded – undo
30 30
  *
31 31
  * @access public
32 32
  */
33
-class MetadataFormat extends AbstractEntity
34
-{
33
+class MetadataFormat extends AbstractEntity {
35 34
     /**
36 35
      * @access protected
37 36
      * @var int UID of the ``tx_dlf_metadata`` that is encoded by this metadata entry.
@@ -76,14 +75,12 @@  discard block
 block discarded – undo
76 75
     /**
77 76
      * constructor
78 77
      */
79
-    public function __construct()
80
-    {
78
+    public function __construct() {
81 79
         // Do not remove the next line: It would break the functionality
82 80
         $this->initStorageObjects();
83 81
     }
84 82
 
85
-    protected function initStorageObjects()
86
-    {
83
+    protected function initStorageObjects() {
87 84
         $this->subentries = new ObjectStorage();
88 85
     }
89 86
 
@@ -151,8 +148,7 @@  discard block
 block discarded – undo
151 148
         $this->xpathSorting = $xpathSorting;
152 149
     }
153 150
 
154
-    public function getSubentries()
155
-    {
151
+    public function getSubentries() {
156 152
         return $this->subentries;
157 153
     }
158 154
 
@@ -168,8 +164,7 @@  discard block
 block discarded – undo
168 164
      *
169 165
      * @return void
170 166
      */
171
-    public function addSubentry(MetadataSubentry $subentry)
172
-    {
167
+    public function addSubentry(MetadataSubentry $subentry) {
173 168
         $this->subentries->attach($subentry);
174 169
     }
175 170
 
@@ -180,8 +175,7 @@  discard block
 block discarded – undo
180 175
      *
181 176
      * @return void
182 177
      */
183
-    public function removeSubentry(MetadataSubentry $subentryToRemove)
184
-    {
178
+    public function removeSubentry(MetadataSubentry $subentryToRemove) {
185 179
         $this->subentries->detach($subentryToRemove);
186 180
     }
187 181
 
Please login to merge, or discard this patch.
Classes/Controller/ToolboxController.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
  *
25 25
  * @access public
26 26
  */
27
-class ToolboxController extends AbstractController
28
-{
27
+class ToolboxController extends AbstractController {
29 28
 
30 29
     /**
31 30
      * @access private
@@ -208,8 +207,7 @@  discard block
 block discarded – undo
208 207
      *
209 208
      * @return void
210 209
      */
211
-    public function renderScoreTool()
212
-    {
210
+    public function renderScoreTool() {
213 211
         if (
214 212
             $this->isDocMissingOrEmpty()
215 213
             || empty($this->extConf['files']['fileGrpScore'])
Please login to merge, or discard this patch.
Classes/ViewHelpers/IsArrayViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,10 +18,8 @@  discard block
 block discarded – undo
18 18
 /**
19 19
  * Checks if the given subject is an array.
20 20
  */
21
-class IsArrayViewHelper extends AbstractViewHelper
22
-{
23
-    public function initializeArguments()
24
-    {
21
+class IsArrayViewHelper extends AbstractViewHelper {
22
+    public function initializeArguments() {
25 23
         parent::initializeArguments();
26 24
         $this->registerArgument('subject', 'string', 'The subject');
27 25
     }
@@ -29,8 +27,7 @@  discard block
 block discarded – undo
29 27
     /**
30 28
      * @return bool
31 29
      */
32
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
33
-    {
30
+    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext) {
34 31
         $subject = $arguments['subject'];
35 32
         if ($subject === null) {
36 33
             $subject = $renderChildrenClosure();
Please login to merge, or discard this patch.
Classes/ViewHelpers/IsInArrayViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,10 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15 15
 
16
-class IsInArrayViewHelper extends AbstractViewHelper
17
-{
18
-    public function initializeArguments()
19
-    {
16
+class IsInArrayViewHelper extends AbstractViewHelper {
17
+    public function initializeArguments() {
20 18
         parent::initializeArguments();
21 19
         $this->registerArgument('needle', 'mixed', 'The searched value', true);
22 20
         $this->registerArgument('haystack', 'array', 'The array', true);
@@ -27,8 +25,7 @@  discard block
 block discarded – undo
27 25
      *
28 26
      * @return bool
29 27
      */
30
-    public function render()
31
-    {
28
+    public function render() {
32 29
         $needle = $this->arguments['needle'];
33 30
         $haystack = $this->arguments['haystack'];
34 31
 
Please login to merge, or discard this patch.
Classes/ViewHelpers/ImplodeViewHelper.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,10 +13,8 @@  discard block
 block discarded – undo
13 13
 
14 14
 use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
15 15
 
16
-class ImplodeViewHelper extends AbstractViewHelper
17
-{
18
-    public function initializeArguments()
19
-    {
16
+class ImplodeViewHelper extends AbstractViewHelper {
17
+    public function initializeArguments() {
20 18
         parent::initializeArguments();
21 19
         $this->registerArgument('value', 'array', 'The array to be imploded', true);
22 20
         $this->registerArgument('delimiter', 'string', 'The delimiter ', true);
@@ -27,8 +25,7 @@  discard block
 block discarded – undo
27 25
      *
28 26
      * @return string
29 27
      */
30
-    public function render()
31
-    {
28
+    public function render() {
32 29
         $value = $this->arguments['value'];
33 30
         $delimiter = $this->arguments['delimiter'];
34 31
 
Please login to merge, or discard this patch.
Classes/Common/AnnotationRequest.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
  * LICENSE.txt file that was distributed with this source code.
13 13
  */
14 14
 
15
-class AnnotationRequest
16
-{
15
+class AnnotationRequest {
17 16
     /**
18 17
      * @var string
19 18
      */
@@ -22,8 +21,7 @@  discard block
 block discarded – undo
22 21
     /**
23 22
      * @param string $apiUrl The url of the annotation server api.
24 23
      */
25
-    public function __construct($apiUrl)
26
-    {
24
+    public function __construct($apiUrl) {
27 25
         $this->apiUrl =  trim($apiUrl, "/ ");
28 26
     }
29 27
 
@@ -55,8 +53,7 @@  discard block
 block discarded – undo
55 53
      * @param string $id Document id (purl)
56 54
      * @return array
57 55
      */
58
-    public function getAll($id)
59
-    {
56
+    public function getAll($id) {
60 57
         $annotations = [];
61 58
 
62 59
         $annotationData = $this->requestAnnotions($this->apiUrl . '?target=' . urlencode($id . '/*'));
Please login to merge, or discard this patch.
Classes/Common/MetsDocument.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@  discard block
 block discarded – undo
72 72
  * @property-read SimpleXMLElement $mets this holds the XML file's METS part as SimpleXMLElement object
73 73
  * @property-read string $parentHref URL of the parent document (determined via mptr element), or empty string if none is available
74 74
  */
75
-final class MetsDocument extends AbstractDocument
76
-{
75
+final class MetsDocument extends AbstractDocument {
77 76
     /**
78 77
      * @access protected
79 78
      * @var string[] Subsections / tags that may occur within `<mets:amdSec>`
@@ -286,8 +285,7 @@  discard block
 block discarded – undo
286 285
     /**
287 286
      * This gets the measure beginning of a page
288 287
      */
289
-    public function getPageBeginning($pageId, $fileId)
290
-    {
288
+    public function getPageBeginning($pageId, $fileId) {
291 289
         $mets = $this->mets
292 290
             ->xpath(
293 291
                 './mets:structMap[@TYPE="PHYSICAL"]' .
@@ -482,8 +480,7 @@  discard block
 block discarded – undo
482 480
      *
483 481
      * @return ?string thumbnail or null if not found
484 482
      */
485
-    private function getThumbnail(string $id = '')
486
-    {
483
+    private function getThumbnail(string $id = '') {
487 484
         // Load plugin configuration.
488 485
         $extConf = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(self::$extKey, 'files');
489 486
         $fileGrpsThumb = GeneralUtility::trimExplode(',', $extConf['fileGrpThumbs']);
@@ -624,8 +621,7 @@  discard block
 block discarded – undo
624 621
      * @param DOMNode $parentNode
625 622
      * @return array|false
626 623
      */
627
-    private function getSubentries($allSubentries, string $parentIndex, DOMNode $parentNode)
628
-    {
624
+    private function getSubentries($allSubentries, string $parentIndex, DOMNode $parentNode) {
629 625
         $domXPath = new DOMXPath($parentNode->ownerDocument);
630 626
         $this->registerNamespaces($domXPath);
631 627
         $theseSubentries = [];
@@ -655,8 +651,7 @@  discard block
 block discarded – undo
655 651
      * @param $subentry
656 652
      * @return array
657 653
      */
658
-    private function getSubentryValue($values, $subentry)
659
-    {
654
+    private function getSubentryValue($values, $subentry) {
660 655
         $theseSubentries = [];
661 656
         if (
662 657
             ($values instanceof DOMNodeList
@@ -906,8 +901,7 @@  discard block
 block discarded – undo
906 901
      *
907 902
      * @return bool true if extraction successful, false otherwise
908 903
      */
909
-    private function extractMetadataIfTypeSupported(string $dmdId, string $mdSectionType, array &$metadata)
910
-    {
904
+    private function extractMetadataIfTypeSupported(string $dmdId, string $mdSectionType, array &$metadata) {
911 905
         // Is this metadata format supported?
912 906
         if (!empty($this->formats[$this->mdSec[$dmdId]['type']])) {
913 907
             if (!empty($this->formats[$this->mdSec[$dmdId]['type']]['class'])) {
@@ -939,8 +933,7 @@  discard block
 block discarded – undo
939 933
      *
940 934
      * @return array additional metadata data queried from database
941 935
      */
942
-    private function getAdditionalMetadataFromDatabase(int $cPid, string $dmdId)
943
-    {
936
+    private function getAdditionalMetadataFromDatabase(int $cPid, string $dmdId) {
944 937
         $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
945 938
             ->getQueryBuilderForTable('tx_dlf_metadata');
946 939
         // Get hidden records, too.
@@ -1131,8 +1124,7 @@  discard block
 block discarded – undo
1131 1124
     /**
1132 1125
      * @see AbstractDocument::getStructureDepth()
1133 1126
      */
1134
-    public function getStructureDepth(string $logId)
1135
-    {
1127
+    public function getStructureDepth(string $logId) {
1136 1128
         $ancestors = $this->mets->xpath('./mets:structMap[@TYPE="LOGICAL"]//mets:div[@ID="' . $logId . '"]/ancestor::*');
1137 1129
         if (!empty($ancestors)) {
1138 1130
             return count($ancestors);
Please login to merge, or discard this patch.