Passed
Pull Request — master (#209)
by
unknown
10:39
created
Classes/Configuration/ClientConfigurationManager.php 1 patch
Braces   +58 added lines, -116 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 use EWW\Dpf\Domain\Repository\ClientRepository;
23 23
 use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
24 24
 
25
-class ClientConfigurationManager
26
-{
25
+class ClientConfigurationManager {
27 26
     /**
28 27
      * settings
29 28
      *
@@ -46,8 +45,7 @@  discard block
 block discarded – undo
46 45
      */
47 46
     protected $extensionConfiguration = array();
48 47
 
49
-    public function __construct()
50
-    {
48
+    public function __construct() {
51 49
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
52 50
         $clientRepository = $objectManager->get(ClientRepository::class);
53 51
 
@@ -77,8 +75,7 @@  discard block
 block discarded – undo
77 75
 
78 76
     }
79 77
 
80
-    public function setConfigurationPid($pid)
81
-    {
78
+    public function setConfigurationPid($pid) {
82 79
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
83 80
         $clientRepository = $objectManager->get(ClientRepository::class);
84 81
 
@@ -88,8 +85,7 @@  discard block
 block discarded – undo
88 85
     /**
89 86
      * @return int|null
90 87
      */
91
-    public function getClientPid()
92
-    {
88
+    public function getClientPid() {
93 89
         return $this->client->getPid();
94 90
     }
95 91
 
@@ -98,8 +94,7 @@  discard block
 block discarded – undo
98 94
      *
99 95
      * @var array
100 96
      */
101
-    public function getSetting($settingName, $extConfig = null)
102
-    {
97
+    public function getSetting($settingName, $extConfig = null) {
103 98
         $setting = null;
104 99
         if ($this->client) {
105 100
             $setting = trim($this->client->{"get" . ucfirst($settingName)}());
@@ -114,270 +109,217 @@  discard block
 block discarded – undo
114 109
     }
115 110
 
116 111
 
117
-    public function getOwnerId()
118
-    {
112
+    public function getOwnerId() {
119 113
         return $this->getSetting("ownerId");
120 114
     }
121 115
 
122
-    public function getSwordHost()
123
-    {
116
+    public function getSwordHost() {
124 117
         return $this->getSetting("swordHost", "swordHost");
125 118
     }
126 119
 
127
-    public function getSwordUser()
128
-    {
120
+    public function getSwordUser() {
129 121
         return $this->getSetting("swordUser", "swordUser");
130 122
     }
131 123
 
132
-    public function getSwordPassword()
133
-    {
124
+    public function getSwordPassword() {
134 125
         return $this->getSetting("swordPassword", "swordPassword");
135 126
     }
136 127
 
137
-    public function getSwordCollectionNamespace()
138
-    {
128
+    public function getSwordCollectionNamespace() {
139 129
         return $this->getSetting("swordCollectionNamespace", "swordCollectionNamespace");
140 130
     }
141 131
 
142
-    public function getFedoraHost()
143
-    {
132
+    public function getFedoraHost() {
144 133
         return $this->getSetting("fedoraHost", "fedoraHost");
145 134
     }
146 135
 
147
-    public function getFedoraUser()
148
-    {
136
+    public function getFedoraUser() {
149 137
         return $this->getSetting("fedoraUser", "fedoraUser");
150 138
     }
151 139
 
152
-    public function getFedoraPassword()
153
-    {
140
+    public function getFedoraPassword() {
154 141
         return $this->getSetting("fedoraPassword", "fedoraPassword");
155 142
     }
156 143
 
157
-    public function getElasticSearchHost()
158
-    {
144
+    public function getElasticSearchHost() {
159 145
         return $this->getSetting("elasticSearchHost", "elasticSearchHost");
160 146
     }
161 147
 
162
-    public function getElasticSearchPort()
163
-    {
148
+    public function getElasticSearchPort() {
164 149
         return $this->getSetting("elasticSearchPort", "elasticSearchPort");
165 150
     }
166 151
 
167
-    public function getElasticSearchIndexName()
168
-    {
152
+    public function getElasticSearchIndexName() {
169 153
         return $this->getSetting("elasticSearchIndexName", "elasticSearchIndexName");
170 154
     }
171 155
 
172
-    public function getUploadDirectory()
173
-    {
156
+    public function getUploadDirectory() {
174 157
         return $this->getSetting("uploadDirectory", "uploadDirectory");
175 158
     }
176 159
 
177
-    public function getUploadDomain()
178
-    {
160
+    public function getUploadDomain() {
179 161
         return $this->getSetting("uploadDomain", "uploadDomain");
180 162
     }
181 163
 
182
-    public function getSuggestionFlashMessage()
183
-    {
164
+    public function getSuggestionFlashMessage() {
184 165
         return $this->getSetting("suggestionFlashmessage", "suggestionFlashmessage");
185 166
     }
186 167
 
187
-    public function getFileXpath()
188
-    {
168
+    public function getFileXpath() {
189 169
         return $this->getSetting("fileXpath", "fileXpath");
190 170
     }
191 171
 
192
-    public function getStateXpath()
193
-    {
172
+    public function getStateXpath() {
194 173
         return $this->getSetting("stateXpath", "stateXpath");
195 174
     }
196 175
 
197
-    public function getTypeXpath()
198
-    {
176
+    public function getTypeXpath() {
199 177
         return $this->getSetting("typeXpath", "typeXpath");
200 178
     }
201 179
 
202
-    public function getTypeXpathInput()
203
-    {
180
+    public function getTypeXpathInput() {
204 181
         return $this->getSetting("typeXpathInput", "typeXpathInput");
205 182
     }
206 183
 
207
-    public function getUrnXpath()
208
-    {
184
+    public function getUrnXpath() {
209 185
         return $this->getSetting("urnXpath", "urnXpath");
210 186
     }
211 187
 
212
-    public function getPrimaryUrnXpath()
213
-    {
188
+    public function getPrimaryUrnXpath() {
214 189
         return $this->getSetting("primaryUrnXpath", "primaryUrnXpath");
215 190
     }
216 191
 
217
-    public function getDateXpath()
218
-    {
192
+    public function getDateXpath() {
219 193
         return $this->getSetting("dateXpath", "dateXpath");
220 194
     }
221 195
 
222
-    public function getPublishingYearXpath()
223
-    {
196
+    public function getPublishingYearXpath() {
224 197
         return $this->getSetting("publishingYearXpath", "publishingYearXpath");
225 198
     }
226 199
 
227
-    public function getNamespaces()
228
-    {
200
+    public function getNamespaces() {
229 201
         return $this->getSetting("namespaces", "namespaces");
230 202
     }
231 203
 
232
-    public function getTitleXpath()
233
-    {
204
+    public function getTitleXpath() {
234 205
         return $this->getSetting("titleXpath", "titleXpath");
235 206
     }
236 207
 
237
-    public function getOriginalSourceTitleXpath()
238
-    {
208
+    public function getOriginalSourceTitleXpath() {
239 209
         return $this->getSetting("originalSourceTitleXpath", "originalSourceTitleXpath");
240 210
     }
241 211
 
242
-    public function getProcessNumberXpath()
243
-    {
212
+    public function getProcessNumberXpath() {
244 213
         return $this->getSetting("processnumberXpath", "processnumberXpath");
245 214
     }
246 215
 
247
-    public function getSubmitterNameXpath()
248
-    {
216
+    public function getSubmitterNameXpath() {
249 217
         return $this->getSetting("submitterNameXpath", "submitterNameXpath");
250 218
     }
251 219
 
252
-    public function getSubmitterEmailXpath()
253
-    {
220
+    public function getSubmitterEmailXpath() {
254 221
         return $this->getSetting("submitterEmailXpath", "submitterEmailXpath");
255 222
     }
256 223
 
257
-    public function getSubmitterNoticeXpath()
258
-    {
224
+    public function getSubmitterNoticeXpath() {
259 225
         return $this->getSetting("submitterNoticeXpath", "submitterNoticeXpath");
260 226
     }
261 227
 
262
-    public function getCreatorXpath()
263
-    {
228
+    public function getCreatorXpath() {
264 229
         return $this->getSetting("creatorXpath", "creatorXpath");
265 230
     }
266 231
 
267
-    public function getCreationDateXpath()
268
-    {
232
+    public function getCreationDateXpath() {
269 233
         return $this->getSetting("creationDateXpath", "creationDateXpath");
270 234
     }
271 235
 
272
-    public function getRepositoryCreationDateXpath()
273
-    {
236
+    public function getRepositoryCreationDateXpath() {
274 237
         return $this->getSetting("repositoryCreationDateXpath", "repositoryCreationDateXpath");
275 238
     }
276 239
 
277
-    public function getRepositoryLastModDateXpath()
278
-    {
240
+    public function getRepositoryLastModDateXpath() {
279 241
         return $this->getSetting("repositoryLastModDateXpath", "repositoryLastModDateXpath");
280 242
     }
281 243
 
282
-    public function getDepositLicenseXpath()
283
-    {
244
+    public function getDepositLicenseXpath() {
284 245
         return $this->getSetting("depositLicenseXpath", "depositLicenseXpath");
285 246
     }
286 247
 
287
-    public function getAllNotesXpath()
288
-    {
248
+    public function getAllNotesXpath() {
289 249
         return $this->getSetting("allNotesXpath", "allNotesXpath");
290 250
     }
291 251
 
292
-    public function getPrivateNotesXpath()
293
-    {
252
+    public function getPrivateNotesXpath() {
294 253
         return $this->getSetting("privateNotesXpath", "privateNotesXpath");
295 254
     }
296 255
 
297
-    public function getInputTransformation()
298
-    {
256
+    public function getInputTransformation() {
299 257
         return $this->client->getInputTransformation()->current();
300 258
     }
301 259
 
302
-    public function getOutputTransformation()
303
-    {
260
+    public function getOutputTransformation() {
304 261
         return $this->client->getOutputTransformation()->current();
305 262
     }
306 263
 
307
-    public function getPersonXpath()
308
-    {
264
+    public function getPersonXpath() {
309 265
         return $this->getSetting("personXpath", "personXpath");
310 266
     }
311 267
 
312
-    public function getPersonFamilyXpath()
313
-    {
268
+    public function getPersonFamilyXpath() {
314 269
         return $this->getSetting("personFamilyXpath", "personFamilyXpath");
315 270
     }
316 271
 
317
-    public function getPersonGivenXpath()
318
-    {
272
+    public function getPersonGivenXpath() {
319 273
         return $this->getSetting("personGivenXpath", "personGivenXpath");
320 274
     }
321 275
 
322
-    public function getPersonRoleXpath()
323
-    {
276
+    public function getPersonRoleXpath() {
324 277
         return $this->getSetting("personRoleXpath", "personRoleXpath");
325 278
     }
326 279
 
327
-    public function getPersonFisIdentifierXpath()
328
-    {
280
+    public function getPersonFisIdentifierXpath() {
329 281
         return $this->getSetting("personFisIdentifierXpath", "personFisIdentifierXpath");
330 282
     }
331 283
 
332
-    public function getPersonAffiliationXpath()
333
-    {
284
+    public function getPersonAffiliationXpath() {
334 285
         return $this->getSetting("personAffiliationXpath", "personAffiliationXpath");
335 286
     }
336 287
 
337
-    public function getPersonAffiliationIdentifierXpath()
338
-    {
288
+    public function getPersonAffiliationIdentifierXpath() {
339 289
         return $this->getSetting("personAffiliationIdentifierXpath", "personAffiliationIdentifierXpath");
340 290
     }
341 291
 
342
-    public function getPersonAuthorRole()
343
-    {
292
+    public function getPersonAuthorRole() {
344 293
         return $this->getSetting("personAuthorRole", "personAuthorRole");
345 294
     }
346 295
 
347
-    public function getPersonPublisherRole()
348
-    {
296
+    public function getPersonPublisherRole() {
349 297
         return $this->getSetting("personPublisherRole", "personPublisherRole");
350 298
     }
351 299
 
352
-    public function getValidationXpath()
353
-    {
300
+    public function getValidationXpath() {
354 301
         return $this->getSetting("validationXpath", "validationXpath");
355 302
     }
356 303
 
357
-    public function fisIdXpath()
358
-    {
304
+    public function fisIdXpath() {
359 305
         return $this->getSetting("fisIdXpath", "fisIdXpath");
360 306
     }
361 307
 
362
-    public function getSourceDetailsXpaths()
363
-    {
308
+    public function getSourceDetailsXpaths() {
364 309
         return $this->getSetting("sourceDetailsXpaths", "sourceDetailsXpaths");
365 310
     }
366 311
 
367
-    public function getFedoraNamespace()
368
-    {
312
+    public function getFedoraNamespace() {
369 313
         $settings = $this->getTypoScriptSettings();
370 314
         return $settings['fedoraNamespace'];
371 315
     }
372 316
 
373
-    public function getUniversityCollection()
374
-    {
317
+    public function getUniversityCollection() {
375 318
         $settings = $this->getTypoScriptSettings();
376 319
         return $settings['universityCollection'];
377 320
     }
378 321
 
379
-    public function getTypoScriptSettings()
380
-    {
322
+    public function getTypoScriptSettings() {
381 323
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
382 324
         $configurationManager = $objectManager->get(ConfigurationManager::class);
383 325
         $settings = $configurationManager->getConfiguration(
Please login to merge, or discard this patch.
Classes/Helper/InternalFormat.php 1 patch
Braces   +43 added lines, -82 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@  discard block
 block discarded – undo
18 18
 use EWW\Dpf\Services\ParserGenerator;
19 19
 use TYPO3\CMS\Extbase\Object\ObjectManager;
20 20
 
21
-class InternalFormat
22
-{
21
+class InternalFormat {
23 22
     const rootNode = '//data/';
24 23
 
25 24
     /**
@@ -46,8 +45,7 @@  discard block
 block discarded – undo
46 45
      * @param string $xml
47 46
      * @param int $clientPid
48 47
      */
49
-    public function __construct(string $xml, int $clientPid = 0)
50
-    {
48
+    public function __construct(string $xml, int $clientPid = 0) {
51 49
         $this->clientPid = $clientPid;
52 50
 
53 51
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
@@ -60,8 +58,7 @@  discard block
 block discarded – undo
60 58
         $this->setXml($xml);
61 59
     }
62 60
 
63
-    public function setXml($xml)
64
-    {
61
+    public function setXml($xml) {
65 62
         if (empty($xml)) {
66 63
             $xml = "<data></data>";
67 64
         }
@@ -71,8 +68,7 @@  discard block
 block discarded – undo
71 68
         $this->xml = $dom;
72 69
     }
73 70
 
74
-    public function getXml()
75
-    {
71
+    public function getXml() {
76 72
         return $this->xml->saveXML();
77 73
     }
78 74
 
@@ -80,37 +76,31 @@  discard block
 block discarded – undo
80 76
         return $this->xml;
81 77
     }
82 78
 
83
-    public function getXpath()
84
-    {
79
+    public function getXpath() {
85 80
         return $domXPath = \EWW\Dpf\Helper\XPath::create($this->xml);
86 81
     }
87 82
 
88
-    public function getDocumentType()
89
-    {
83
+    public function getDocumentType() {
90 84
         $typeXpath = $this->clientConfigurationManager->getTypeXpath();
91 85
         return $this->getValue($typeXpath);
92 86
     }
93 87
 
94
-    public function setDocumentType($type)
95
-    {
88
+    public function setDocumentType($type) {
96 89
         $typeXpath = $this->clientConfigurationManager->getTypeXpath();
97 90
         $this->setValue($typeXpath, $type);
98 91
     }
99 92
 
100
-    public function getRepositoryState()
101
-    {
93
+    public function getRepositoryState() {
102 94
         $stateXpath = $this->clientConfigurationManager->getStateXpath();
103 95
         return $this->getValue($stateXpath);
104 96
     }
105 97
 
106
-    public function setRepositoryState($state)
107
-    {
98
+    public function setRepositoryState($state) {
108 99
         $stateXpath = $this->clientConfigurationManager->getStateXpath();
109 100
         $this->setValue($stateXpath,$state);
110 101
     }
111 102
 
112
-    public function getProcessNumber()
113
-    {
103
+    public function getProcessNumber() {
114 104
         $processNumberXpath = $this->clientConfigurationManager->getProcessNumberXpath();
115 105
         if ($processNumberXpath) {
116 106
             return $this->getValue($processNumberXpath);
@@ -119,14 +109,12 @@  discard block
 block discarded – undo
119 109
         }
120 110
     }
121 111
 
122
-    public function setProcessNumber($processNumber)
123
-    {
112
+    public function setProcessNumber($processNumber) {
124 113
         $processNumberXpath = $this->clientConfigurationManager->getProcessNumberXpath();
125 114
         $this->setValue($processNumberXpath, $processNumber);
126 115
     }
127 116
 
128
-    public function getTitle()
129
-    {
117
+    public function getTitle() {
130 118
         $titleXpath = $this->clientConfigurationManager->getTitleXpath();
131 119
         $xpath = $this->getXpath();
132 120
 
@@ -141,14 +129,12 @@  discard block
 block discarded – undo
141 129
     /**
142 130
      * @param string $title
143 131
      */
144
-    public function setTitle($title)
145
-    {
132
+    public function setTitle($title) {
146 133
         $titleXpath = $this->clientConfigurationManager->getTitleXpath();
147 134
         $this->setValue($titleXpath, $title);
148 135
     }
149 136
 
150
-    public function getFiles()
151
-    {
137
+    public function getFiles() {
152 138
         $xpath = $this->getXpath();
153 139
 
154 140
         $fileXpath = $this->clientConfigurationManager->getFileXpath();
@@ -178,8 +164,7 @@  discard block
 block discarded – undo
178 164
         return $this->getValue($dateXpath);
179 165
     }
180 166
 
181
-    public function removeDateIssued()
182
-    {
167
+    public function removeDateIssued() {
183 168
         $xpath = $this->getXpath();
184 169
         $dateXpath = $this->clientConfigurationManager->getDateXpath();
185 170
 
@@ -190,8 +175,7 @@  discard block
 block discarded – undo
190 175
 
191 176
     }
192 177
 
193
-    public function hasPrimaryUrn()
194
-    {
178
+    public function hasPrimaryUrn() {
195 179
         $xpath = $this->getXpath();
196 180
         $primaryUrnXpath = $this->clientConfigurationManager->getPrimaryUrnXpath();
197 181
 
@@ -203,8 +187,7 @@  discard block
 block discarded – undo
203 187
         }
204 188
     }
205 189
 
206
-    public function getPrimaryUrn()
207
-    {
190
+    public function getPrimaryUrn() {
208 191
         $xpath = $this->getXpath();
209 192
         $primaryUrnXpath = $this->clientConfigurationManager->getPrimaryUrnXpath();
210 193
 
@@ -216,14 +199,12 @@  discard block
 block discarded – undo
216 199
         }
217 200
     }
218 201
 
219
-    public function setPrimaryUrn($urn)
220
-    {
202
+    public function setPrimaryUrn($urn) {
221 203
         $primaryUrnXpath = $this->clientConfigurationManager->getPrimaryUrnXpath();
222 204
         $this->setValue($primaryUrnXpath, $urn);
223 205
     }
224 206
 
225
-    public function clearAllUrn()
226
-    {
207
+    public function clearAllUrn() {
227 208
         $xpath = $this->getXpath();
228 209
         $urnXpath = $this->clientConfigurationManager->getUrnXpath();
229 210
         $primaryUrnXpath = $this->clientConfigurationManager->getPrimaryUrnXpath();
@@ -278,50 +259,42 @@  discard block
 block discarded – undo
278 259
         }
279 260
     }
280 261
 
281
-    public function getCreator()
282
-    {
262
+    public function getCreator() {
283 263
         $creatorXpath = $this->clientConfigurationManager->getCreatorXpath();
284 264
         return $this->getValue($creatorXpath);
285 265
     }
286 266
 
287
-    public function setCreator($creator)
288
-    {
267
+    public function setCreator($creator) {
289 268
         $creatorXpath = $this->clientConfigurationManager->getCreatorXpath();
290 269
         $this->setValue($creatorXpath, $creator);
291 270
     }
292 271
 
293
-    public function getCreationDate()
294
-    {
272
+    public function getCreationDate() {
295 273
         $xpath = $this->clientConfigurationManager->getCreationDateXpath();
296 274
         return $this->getValue($xpath);
297 275
     }
298 276
 
299
-    public function setCreationDate($creationDate)
300
-    {
277
+    public function setCreationDate($creationDate) {
301 278
         $xpath = $this->clientConfigurationManager->getCreationDateXpath();
302 279
         $this->setValue($xpath, $creationDate);
303 280
     }
304 281
 
305
-    public function getRepositoryCreationDate()
306
-    {
282
+    public function getRepositoryCreationDate() {
307 283
         $xpath = $this->clientConfigurationManager->getRepositoryCreationDateXpath();
308 284
         return $this->getValue($xpath);
309 285
     }
310 286
 
311
-    public function getRepositoryLastModDate()
312
-    {
287
+    public function getRepositoryLastModDate() {
313 288
         $xpath = $this->clientConfigurationManager->getRepositoryLastModDateXpath();
314 289
         return $this->getValue($xpath);
315 290
     }
316 291
 
317
-    public function getPublishingYear()
318
-    {
292
+    public function getPublishingYear() {
319 293
         $publishingYearXpath = $this->clientConfigurationManager->getPublishingYearXpath();
320 294
         return $this->getValue($publishingYearXpath);
321 295
     }
322 296
 
323
-    public function getOriginalSourceTitle()
324
-    {
297
+    public function getOriginalSourceTitle() {
325 298
         $originalSourceTitleXpath = $this->clientConfigurationManager->getOriginalSourceTitleXpath();
326 299
         return $this->getValue($originalSourceTitleXpath);
327 300
     }
@@ -329,8 +302,7 @@  discard block
 block discarded – undo
329 302
     /**
330 303
      * @return string
331 304
      */
332
-    public function getSourceDetails()
333
-    {
305
+    public function getSourceDetails() {
334 306
         if (empty($sourceDetailsXpaths)) {
335 307
             return '';
336 308
         }
@@ -389,8 +361,7 @@  discard block
 block discarded – undo
389 361
     /**
390 362
      * @return string
391 363
      */
392
-    public function getDepositLicense()
393
-    {
364
+    public function getDepositLicense() {
394 365
         $depositLicenseXpath = $this->clientConfigurationManager->getDepositLicenseXpath();
395 366
         return $this->getValue($depositLicenseXpath);
396 367
     }
@@ -398,8 +369,7 @@  discard block
 block discarded – undo
398 369
     /**
399 370
      * @return array
400 371
      */
401
-    public function getNotes()
402
-    {
372
+    public function getNotes() {
403 373
         $notesXpath = $this->clientConfigurationManager->getAllNotesXpath();
404 374
 
405 375
         $xpath = $this->getXpath();
@@ -407,16 +377,14 @@  discard block
 block discarded – undo
407 377
 
408 378
         $notes = array();
409 379
 
410
-        for ($i=0; $i < $notesNodes->length; $i++)
411
-        {
380
+        for ($i=0; $i < $notesNodes->length; $i++) {
412 381
             $notes[] = $notesNodes->item($i)->nodeValue;
413 382
         }
414 383
 
415 384
         return $notes;
416 385
     }
417 386
 
418
-    public function addNote($noteContent)
419
-    {
387
+    public function addNote($noteContent) {
420 388
         $notesXpath = $this->clientConfigurationManager->getPrivateNotesXpath();
421 389
 
422 390
         $parserGenerator = new ParserGenerator($this->clientPid);
@@ -426,13 +394,11 @@  discard block
 block discarded – undo
426 394
         $this->xml->loadXML($parserGenerator->getXMLData());
427 395
     }
428 396
 
429
-    public function getAuthors()
430
-    {
397
+    public function getAuthors() {
431 398
         return $this->getPersons($this->clientConfigurationManager->getPersonAuthorRole());
432 399
     }
433 400
 
434
-    public function getPublishers()
435
-    {
401
+    public function getPublishers() {
436 402
         return $this->getPersons($this->clientConfigurationManager->getPersonPublisherRole());
437 403
     }
438 404
 
@@ -442,8 +408,7 @@  discard block
 block discarded – undo
442 408
      * @param string $role
443 409
      * @return array
444 410
      */
445
-    public function getPersons($role = '')
446
-    {
411
+    public function getPersons($role = '') {
447 412
         $personXpath = $this->clientConfigurationManager->getPersonXpath();
448 413
         $familyXpath = $this->clientConfigurationManager->getPersonFamilyXpath();
449 414
         $givenXpath = $this->clientConfigurationManager->getPersonGivenXpath();
@@ -516,8 +481,9 @@  discard block
 block discarded – undo
516 481
         if ($role) {
517 482
             $result = [];
518 483
             foreach ($persons as $person) {
519
-                if ($person['role'] == $role)
520
-                    $result[] = $person;
484
+                if ($person['role'] == $role) {
485
+                                    $result[] = $person;
486
+                }
521 487
             }
522 488
             return $result;
523 489
         } else {
@@ -528,8 +494,7 @@  discard block
 block discarded – undo
528 494
     /**
529 495
      * @return bool
530 496
      */
531
-    public function getValidation()
532
-    {
497
+    public function getValidation() {
533 498
         $validationXpath =  $this->clientConfigurationManager->getValidationXpath();
534 499
         $validation = $this->getValue($validationXpath);
535 500
         return (strtolower($validation) === 'true')? true : false;
@@ -538,8 +503,7 @@  discard block
 block discarded – undo
538 503
     /**
539 504
      * @param bool $validated
540 505
      */
541
-    public function setValidation($validated)
542
-    {
506
+    public function setValidation($validated) {
543 507
         $validationXpath =  $this->clientConfigurationManager->getValidationXpath();
544 508
         $this->setValue($validationXpath, ($validated? 'true' : 'false'));
545 509
     }
@@ -547,8 +511,7 @@  discard block
 block discarded – undo
547 511
     /**
548 512
      * @param string $fisId
549 513
      */
550
-    public function setFisId($fisId)
551
-    {
514
+    public function setFisId($fisId) {
552 515
         $fisIdXpath =  $this->clientConfigurationManager->getFisIdXpath();
553 516
         $this->setValue($fisIdXpath, $fisId);
554 517
     }
@@ -557,8 +520,7 @@  discard block
 block discarded – undo
557 520
      * @param string $xpathString
558 521
      * @return string
559 522
      */
560
-    protected function getValue($xpathString)
561
-    {
523
+    protected function getValue($xpathString) {
562 524
         $xpath = $this->getXpath();
563 525
         $nodeList = $xpath->query(self::rootNode . $xpathString);
564 526
         if ($nodeList->length > 0) {
@@ -571,8 +533,7 @@  discard block
 block discarded – undo
571 533
      * @param string $xpathString
572 534
      * @param string $value
573 535
      */
574
-    protected function setValue($xpathString, $value)
575
-    {
536
+    protected function setValue($xpathString, $value) {
576 537
         $xpath = $this->getXpath();
577 538
         $nodes = $xpath->query(self::rootNode . $xpathString);
578 539
         if ($nodes->length > 0) {
Please login to merge, or discard this patch.
Classes/Domain/Repository/BookmarkRepository.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,15 +22,13 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * The repository for Bookmarks
24 24
  */
25
-class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository
26
-{
25
+class BookmarkRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository {
27 26
     /**
28 27
      * @param int $feUserUid
29 28
      * @param string $identifier
30 29
      * @return object
31 30
      */
32
-    public function findBookmark($feUserUid, $identifier)
33
-    {
31
+    public function findBookmark($feUserUid, $identifier) {
34 32
         $query = $this->createQuery();
35 33
 
36 34
         $query->matching(
@@ -49,8 +47,7 @@  discard block
 block discarded – undo
49 47
      * @return bool
50 48
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
51 49
      */
52
-    public function removeBookmark($document, $feUserUid)
53
-    {
50
+    public function removeBookmark($document, $feUserUid) {
54 51
         $query = $this->createQuery();
55 52
 
56 53
         if ($document instanceof Document) {
@@ -88,8 +85,7 @@  discard block
 block discarded – undo
88 85
      * @return bool
89 86
      * @throws \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
90 87
      */
91
-    public function addBookmark($document, $feUserUid)
92
-    {
88
+    public function addBookmark($document, $feUserUid) {
93 89
         if ($document instanceof Document) {
94 90
             // The returned documentIdentifier is either a PID or the document UID (TYPO3 db), see also
95 91
             // the above method removeBookmark().
@@ -115,8 +111,7 @@  discard block
 block discarded – undo
115 111
      * @param Document $document
116 112
      * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
117 113
      */
118
-    public function findDocumentBookmarks(Document $document)
119
-    {
114
+    public function findDocumentBookmarks(Document $document) {
120 115
         $query = $this->createQuery();
121 116
 
122 117
         $constraintsAnd[] = $query->logicalOr(
Please login to merge, or discard this patch.
Classes/Domain/Repository/AbstractRepository.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * The abstract repository
19 19
  */
20
-class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository
21
-{
20
+class AbstractRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
22 21
     /**
23 22
      * Finds all records of all clients.
24 23
      *
@@ -34,8 +33,7 @@  discard block
 block discarded – undo
34 33
         return $query->execute($returnRawQueryResult);
35 34
     }
36 35
 
37
-    public function crossClient($active = false)
38
-    {
36
+    public function crossClient($active = false) {
39 37
         /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
40 38
         $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
41 39
         $querySettings->setRespectStoragePage(!$active);
Please login to merge, or discard this patch.
Classes/Domain/Repository/ClientRepository.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,16 +17,14 @@
 block discarded – undo
17 17
 /**
18 18
  * The repository for Clients
19 19
  */
20
-class ClientRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository
21
-{
20
+class ClientRepository extends \EWW\Dpf\Domain\Repository\AbstractRepository {
22 21
 
23 22
     /**
24 23
      * findAllByPid
25 24
      *
26 25
      * @return
27 26
      */
28
-    public function findAllByPid($pid)
29
-    {
27
+    public function findAllByPid($pid) {
30 28
         $query = $this->createQuery();
31 29
         $query->getQuerySettings()->setRespectStoragePage(false);
32 30
         $query->matching($query->equals('pid', $pid));
Please login to merge, or discard this patch.
Classes/Domain/Repository/FrontendUserRepository.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,15 +4,13 @@
 block discarded – undo
4 4
 use EWW\Dpf\Domain\Model\Document;
5 5
 use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
6 6
 
7
-class FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
8
-{
7
+class FrontendUserRepository extends \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository {
9 8
     /**
10 9
      * @param $feUserUid
11 10
      * @param $clientPid
12 11
      * @return bool
13 12
      */
14
-    public function isUserInClient($feUserUid, $clientPid)
15
-    {
13
+    public function isUserInClient($feUserUid, $clientPid) {
16 14
         /** @var $querySettings \TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings */
17 15
         $querySettings = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Typo3QuerySettings');
18 16
         $querySettings->setRespectStoragePage(false);
Please login to merge, or discard this patch.
Classes/Exceptions/ElasticSearchMissingIndexNameException.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,10 +14,8 @@
 block discarded – undo
14 14
  * The TYPO3 project - inspiring people to share!
15 15
  */
16 16
 
17
-class ElasticSearchMissingIndexNameException extends \Exception implements DPFExceptionInterface
18
-{
19
-    public function messageLanguageKey()
20
-    {
17
+class ElasticSearchMissingIndexNameException extends \Exception implements DPFExceptionInterface {
18
+    public function messageLanguageKey() {
21 19
         return 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_transfer.elasticsearch_indexname_error';
22 20
     }
23 21
 }
Please login to merge, or discard this patch.
Classes/Services/ElasticSearch/ElasticSearch.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
 use TYPO3\CMS\Core\Log\LogManager;
29 29
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
30 30
 
31
-class ElasticSearch
32
-{
31
+class ElasticSearch {
33 32
     /**
34 33
      * @var \EWW\Dpf\Configuration\ClientConfigurationManager
35 34
      */
@@ -61,8 +60,7 @@  discard block
 block discarded – undo
61 60
      * @param int|null $clientPid
62 61
      * @throws ElasticSearchMissingIndexNameException
63 62
      */
64
-    public function __construct($clientPid = null)
65
-    {
63
+    public function __construct($clientPid = null) {
66 64
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
67 65
 
68 66
         $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class);
@@ -103,8 +101,7 @@  discard block
 block discarded – undo
103 101
     /**
104 102
      * @return string|null
105 103
      */
106
-    protected function getIndexName()
107
-    {
104
+    protected function getIndexName() {
108 105
         return $this->indexName;
109 106
     }
110 107
 
@@ -113,8 +110,7 @@  discard block
 block discarded – undo
113 110
      *
114 111
      * @param $indexName
115 112
      */
116
-    protected function initializeIndex($indexName)
117
-    {
113
+    protected function initializeIndex($indexName) {
118 114
         $paramsIndex = [
119 115
             'index' => $indexName,
120 116
             'body' => [
@@ -252,8 +248,7 @@  discard block
 block discarded – undo
252 248
      *
253 249
      * @param Document $document
254 250
      */
255
-    public function index($document)
256
-    {
251
+    public function index($document) {
257 252
         try {
258 253
             $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document));
259 254
         } catch (\Throwable $throwable) {
@@ -391,8 +386,7 @@  discard block
 block discarded – undo
391 386
      *
392 387
      * @param string $identifier
393 388
      */
394
-    public function delete($identifier)
395
-    {
389
+    public function delete($identifier) {
396 390
         try {
397 391
 
398 392
             $params = [
@@ -418,8 +412,7 @@  discard block
 block discarded – undo
418 412
     /**
419 413
      * @param $identifier
420 414
      */
421
-    public function getDocument($identifier)
422
-    {
415
+    public function getDocument($identifier) {
423 416
         $params = [
424 417
             'index' => $this->getIndexName(),
425 418
             'id'    => $identifier
@@ -434,8 +427,7 @@  discard block
 block discarded – undo
434 427
      * @param  array $query search query
435 428
      * @return array        result list
436 429
      */
437
-    public function search($query, $type = null)
438
-    {
430
+    public function search($query, $type = null) {
439 431
         try {
440 432
             // define type and index
441 433
             if (empty($query['index'])) {
@@ -467,8 +459,7 @@  discard block
 block discarded – undo
467 459
      * Get the results
468 460
      * @return mixed
469 461
      */
470
-    public function getResults()
471
-    {
462
+    public function getResults() {
472 463
         // return results from the last search request
473 464
         return $this->results;
474 465
     }
Please login to merge, or discard this patch.
Classes/Services/ElasticSearch/QueryBuilder.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 use EWW\Dpf\Security\Security;
20 20
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
21 21
 
22
-class QueryBuilder
23
-{
22
+class QueryBuilder {
24 23
     /**
25 24
      *
26 25
      * @var \EWW\Dpf\Configuration\ClientConfigurationManager
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
     public function buildQuery(
63 62
         $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [],
64 63
         $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null
65
-    )
66
-    {
64
+    ) {
67 65
 
68 66
         if ($workspaceFilter) {
69 67
             $workspaceFilter = [0 => $workspaceFilter];
@@ -464,8 +462,7 @@  discard block
 block discarded – undo
464 462
     }
465 463
 
466 464
 
467
-    protected function getSortScriptUniversityCollection($collection)
468
-    {
465
+    protected function getSortScriptUniversityCollection($collection) {
469 466
         $script  = "for (int i = 0; i < doc['collections'].length; ++i) {";
470 467
         $script .= "    if (doc['collections'][i] == '".$collection."') {";
471 468
         $script .= "        return '1';";
@@ -476,8 +473,7 @@  discard block
 block discarded – undo
476 473
         return $script;
477 474
     }
478 475
 
479
-    protected function getSortScriptHasFiles()
480
-    {
476
+    protected function getSortScriptHasFiles() {
481 477
         $script = "if (doc['hasFiles'].value == 'true') {";
482 478
         $script .= "    return '1';";
483 479
         $script .= "}";
@@ -486,8 +482,7 @@  discard block
 block discarded – undo
486 482
         return $script;
487 483
     }
488 484
 
489
-    protected function getSortScriptCreatorRole($feUserUid)
490
-    {
485
+    protected function getSortScriptCreatorRole($feUserUid) {
491 486
         $script = "if (doc['creator'].value == '".$feUserUid."') {";
492 487
         $script .= "    return '1';";
493 488
         $script .= "}";
@@ -503,8 +498,7 @@  discard block
 block discarded – undo
503 498
     }
504 499
 
505 500
 
506
-    protected function getSortScriptState()
507
-    {
501
+    protected function getSortScriptState() {
508 502
         $sortStates = [];
509 503
         foreach (DocumentWorkflow::PLACES as $state) {
510 504
             if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) {
@@ -521,8 +515,7 @@  discard block
 block discarded – undo
521 515
     }
522 516
 
523 517
 
524
-    protected function getSortScriptDoctype()
525
-    {
518
+    protected function getSortScriptDoctype() {
526 519
         $sortDoctypes = [];
527 520
         foreach ($this->documentTypeRepository->findAll() as $documentType) {
528 521
             if ($documentType->getName() && $documentType->getDisplayname()) {
Please login to merge, or discard this patch.