Passed
Pull Request — master (#195)
by
unknown
08:41
created
src/Classes/Services/ElasticSearch/QueryBuilder.php 3 patches
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $query = [
139 139
                 'bool' => [
140 140
                     'must' => [
141
-                        'match_all' => (object)[]
141
+                        'match_all' => (object) []
142 142
                     ],
143 143
                     'filter' => $queryFilter
144 144
                 ]
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
                             'script' => [
181 181
                                 'lang' => 'painless',
182 182
                                 'source' =>
183
-                                    "for (int i = 0; i < doc['collections'].length; ++i) {".
184
-                                    "    if(doc['collections'][i] =='".$this->getSettings()['universityCollection']."') {".
185
-                                    "        return 'true';".
186
-                                    "    }".
187
-                                    "}".
183
+                                    "for (int i = 0; i < doc['collections'].length; ++i) {" .
184
+                                    "    if(doc['collections'][i] =='" . $this->getSettings()['universityCollection'] . "') {" .
185
+                                    "        return 'true';" .
186
+                                    "    }" .
187
+                                    "}" .
188 188
                                     "return 'false';"
189 189
                             ]
190 190
                         ]
@@ -200,23 +200,23 @@  discard block
 block discarded – undo
200 200
                             'script' => [
201 201
                                 'lang' => 'painless',
202 202
                                 'source' =>
203
-                                    "if (".
204
-                                    "    doc['creator'].size() > 0 &&".
205
-                                    "    doc['creator'].value == '".$this->security->getUser()->getUid()."') {".
206
-                                    "    return 'self';".
207
-                                    "}".
208
-                                    "if (".
209
-                                    "    doc['creatorRole'].size() > 0 &&".
210
-                                    "    doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."'".
211
-                                    ") {".
212
-                                    "    return 'librarian';".
213
-                                    "}".
214
-                                    "if (".
215
-                                    "    doc['creatorRole'].size() > 0 &&".
216
-                                    "    doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."'".
217
-                                    ") {".
218
-                                    "    return 'user';".
219
-                                    "}".
203
+                                    "if (" .
204
+                                    "    doc['creator'].size() > 0 &&" .
205
+                                    "    doc['creator'].value == '" . $this->security->getUser()->getUid() . "') {" .
206
+                                    "    return 'self';" .
207
+                                    "}" .
208
+                                    "if (" .
209
+                                    "    doc['creatorRole'].size() > 0 &&" .
210
+                                    "    doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "'" .
211
+                                    ") {" .
212
+                                    "    return 'librarian';" .
213
+                                    "}" .
214
+                                    "if (" .
215
+                                    "    doc['creatorRole'].size() > 0 &&" .
216
+                                    "    doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "'" .
217
+                                    ") {" .
218
+                                    "    return 'user';" .
219
+                                    "}" .
220 220
                                     "return 'unknown';"
221 221
                             ]
222 222
                         ]
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
      */
430 430
     protected function buildSortQueryPart($sortField, $sortOrder) {
431 431
 
432
-        $sortField = ($sortField)? $sortField : 'title';
433
-        $sortOrder = ($sortOrder)? $sortOrder : 'asc';
432
+        $sortField = ($sortField) ? $sortField : 'title';
433
+        $sortOrder = ($sortOrder) ? $sortOrder : 'asc';
434 434
 
435 435
         // Build the sorting part.
436 436
         $script = "";
@@ -460,11 +460,11 @@  discard block
 block discarded – undo
460 460
             ];
461 461
         } else {
462 462
             if ($sortField == 'title') {
463
-                $sortField.= ".keyword";
463
+                $sortField .= ".keyword";
464 464
             }
465 465
 
466 466
             if ($sortField == 'personsSort') {
467
-                $sortField.= ".keyword";
467
+                $sortField .= ".keyword";
468 468
             }
469 469
 
470 470
             $sort = [
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
     protected function getSortScriptUniversityCollection($collection)
482 482
     {
483 483
         $script  = "for (int i = 0; i < doc['collections'].length; ++i) {";
484
-        $script .= "    if (doc['collections'][i] == '".$collection."') {";
484
+        $script .= "    if (doc['collections'][i] == '" . $collection . "') {";
485 485
         $script .= "        return '1';";
486 486
         $script .= "    }";
487 487
         $script .= "}";
@@ -502,13 +502,13 @@  discard block
 block discarded – undo
502 502
 
503 503
     protected function getSortScriptCreatorRole($feUserUid)
504 504
     {
505
-        $script = "if (doc['creator'].value == '".$feUserUid."') {";
505
+        $script = "if (doc['creator'].value == '" . $feUserUid . "') {";
506 506
         $script .= "    return '1';";
507 507
         $script .= "}";
508
-        $script .= "if (doc['creatorRole'].value == '".Security::ROLE_LIBRARIAN."') {";
508
+        $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_LIBRARIAN . "') {";
509 509
         $script .= "return '2';";
510 510
         $script .= "}";
511
-        $script .= "if (doc['creatorRole'].value == '".Security::ROLE_RESEARCHER."') {";
511
+        $script .= "if (doc['creatorRole'].value == '" . Security::ROLE_RESEARCHER . "') {";
512 512
         $script .= "    return '3';";
513 513
         $script .= "}";
514 514
         $script .= "return '4';";
@@ -523,15 +523,15 @@  discard block
 block discarded – undo
523 523
         foreach (DocumentWorkflow::PLACES as $state) {
524 524
             if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) {
525 525
                 $aliasState = DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING[$state];
526
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.'.$aliasState;
526
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:manager.documentList.state.' . $aliasState;
527 527
                 $stateName = LocalizationUtility::translate($key, 'dpf');
528
-                $sortStates[] = "if (doc['state'].value == '".$state."') return '".$stateName."';";
528
+                $sortStates[] = "if (doc['state'].value == '" . $state . "') return '" . $stateName . "';";
529 529
             }
530 530
         }
531 531
 
532 532
         $sortStates = implode(" ", $sortStates);
533 533
 
534
-        return $sortStates." return '';";
534
+        return $sortStates . " return '';";
535 535
     }
536 536
 
537 537
 
@@ -540,14 +540,14 @@  discard block
 block discarded – undo
540 540
         $sortDoctypes = [];
541 541
         foreach ($this->documentTypeRepository->findAll() as $documentType) {
542 542
             if ($documentType->getName() && $documentType->getDisplayname()) {
543
-                $sortDoctypes[] = "if (doc['doctype'].value == '".$documentType->getName()."')"
544
-                    ." return '".$documentType->getDisplayname()."';";
543
+                $sortDoctypes[] = "if (doc['doctype'].value == '" . $documentType->getName() . "')"
544
+                    ." return '" . $documentType->getDisplayname() . "';";
545 545
             }
546 546
         }
547 547
 
548 548
         $sortDoctypes = implode(" ", $sortDoctypes);
549 549
 
550
-        return $sortDoctypes." return '';";
550
+        return $sortDoctypes . " return '';";
551 551
     }
552 552
 
553 553
 }
Please login to merge, or discard this patch.
Braces   +8 added lines, -16 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 \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
@@ -51,8 +50,7 @@  discard block
 block discarded – undo
51 50
      *
52 51
      * @return mixed
53 52
      */
54
-    public function getSettings()
55
-    {
53
+    public function getSettings() {
56 54
         $frameworkConfiguration = $this->configurationManager->getConfiguration(
57 55
             \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
58 56
         );
@@ -78,8 +76,7 @@  discard block
 block discarded – undo
78 76
     public function buildQuery(
79 77
         $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [],
80 78
         $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null
81
-    )
82
-    {
79
+    ) {
83 80
 
84 81
         if ($workspaceFilter) {
85 82
             $workspaceFilter = [0 => $workspaceFilter];
@@ -478,8 +475,7 @@  discard block
 block discarded – undo
478 475
     }
479 476
 
480 477
 
481
-    protected function getSortScriptUniversityCollection($collection)
482
-    {
478
+    protected function getSortScriptUniversityCollection($collection) {
483 479
         $script  = "for (int i = 0; i < doc['collections'].length; ++i) {";
484 480
         $script .= "    if (doc['collections'][i] == '".$collection."') {";
485 481
         $script .= "        return '1';";
@@ -490,8 +486,7 @@  discard block
 block discarded – undo
490 486
         return $script;
491 487
     }
492 488
 
493
-    protected function getSortScriptHasFiles()
494
-    {
489
+    protected function getSortScriptHasFiles() {
495 490
         $script = "if (doc['hasFiles'].value == 'true') {";
496 491
         $script .= "    return '1';";
497 492
         $script .= "}";
@@ -500,8 +495,7 @@  discard block
 block discarded – undo
500 495
         return $script;
501 496
     }
502 497
 
503
-    protected function getSortScriptCreatorRole($feUserUid)
504
-    {
498
+    protected function getSortScriptCreatorRole($feUserUid) {
505 499
         $script = "if (doc['creator'].value == '".$feUserUid."') {";
506 500
         $script .= "    return '1';";
507 501
         $script .= "}";
@@ -517,8 +511,7 @@  discard block
 block discarded – undo
517 511
     }
518 512
 
519 513
 
520
-    protected function getSortScriptState()
521
-    {
514
+    protected function getSortScriptState() {
522 515
         $sortStates = [];
523 516
         foreach (DocumentWorkflow::PLACES as $state) {
524 517
             if (array_key_exists($state, DocumentWorkflow::STATE_TO_ALIASSTATE_MAPPING)) {
@@ -535,8 +528,7 @@  discard block
 block discarded – undo
535 528
     }
536 529
 
537 530
 
538
-    protected function getSortScriptDoctype()
539
-    {
531
+    protected function getSortScriptDoctype() {
540 532
         $sortDoctypes = [];
541 533
         foreach ($this->documentTypeRepository->findAll() as $documentType) {
542 534
             if ($documentType->getName() && $documentType->getDisplayname()) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository
36 36
      * @inject
37 37
      */
38
-    protected $documentTypeRepository = null;
38
+    protected $documentTypeRepository = NULL;
39 39
 
40 40
     /**
41 41
      * security
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @var \EWW\Dpf\Security\Security
44 44
      * @inject
45 45
      */
46
-    protected $security = null;
46
+    protected $security = NULL;
47 47
 
48 48
 
49 49
     /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function buildQuery(
79 79
         $itemsPerPage, $workspaceFilter, $from = 0, $bookmarkIdentifiers = [], $filters = [],
80
-        $excludeFilters = [], $sortField = null, $sortOrder = null, $queryString = null
80
+        $excludeFilters = [], $sortField = NULL, $sortOrder = NULL, $queryString = NULL
81 81
     )
82 82
     {
83 83
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
             foreach ($filters as $key => $filterValues) {
255 255
                 $queryFilterPart = [];
256
-                if (in_array($key, $validKeys, true)) {
256
+                if (in_array($key, $validKeys, TRUE)) {
257 257
                     if ($key == 'universityCollection') {
258 258
                         if ($filterValues && is_array($filterValues)) {
259 259
                             if (in_array("true", $filterValues)) {
Please login to merge, or discard this patch.
src/Classes/Services/ElasticSearch/ElasticSearch.php 2 patches
Upper-Lower-Casing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository
38 38
      * @inject
39 39
      */
40
-    protected $frontendUserRepository = null;
40
+    protected $frontendUserRepository = NULL;
41 41
 
42 42
     protected $client;
43 43
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 ],
141 141
                 'mappings' => [
142 142
                     '_source' => [
143
-                        'enabled' => true
143
+                        'enabled' => TRUE
144 144
                     ],
145 145
                     //'dynamic' => 'strict',
146 146
                     'properties' => [
@@ -203,11 +203,11 @@  discard block
 block discarded – undo
203 203
                                 ],
204 204
                                 'fobId' => [
205 205
                                     //'type' => 'keyword'
206
-                                    'enabled' => false
206
+                                    'enabled' => FALSE
207 207
                                 ],
208 208
                                 'index' => [
209 209
                                     //'type' => 'integer'
210
-                                    'enabled' => false
210
+                                    'enabled' => FALSE
211 211
                                 ]
212 212
                             ]
213 213
                         ],
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             if ($document->getCreator()) {
262 262
                 $data->creator = $document->getCreator();
263 263
             } else {
264
-                $data->creator = null;
264
+                $data->creator = NULL;
265 265
             }
266 266
 
267 267
 
@@ -289,9 +289,9 @@  discard block
 block discarded – undo
289 289
 
290 290
             $files = $document->getFile();
291 291
             if ($files->count() > 0) {
292
-                $data->hasFiles = true;
292
+                $data->hasFiles = TRUE;
293 293
             } else {
294
-                $data->hasFiles = false;
294
+                $data->hasFiles = FALSE;
295 295
             }
296 296
 
297 297
 
@@ -328,11 +328,11 @@  discard block
 block discarded – undo
328 328
 
329 329
             $data->source = $document->getSourceDetails();
330 330
 
331
-            $data->universityCollection = false;
331
+            $data->universityCollection = FALSE;
332 332
             if ($data->collections && is_array($data->collections)) {
333 333
                 foreach ($data->collections as $collection) {
334 334
                     if ($collection == $this->getSettings()['universityCollection']) {
335
-                        $data->universityCollection = true;
335
+                        $data->universityCollection = TRUE;
336 336
                         break;
337 337
                     }
338 338
                 }
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
             if ($embargoDate instanceof \DateTime) {
343 343
                 $data->embargoDate = $embargoDate->format("Y-m-d");
344 344
             } else {
345
-                $data->embargoDate = null;
345
+                $data->embargoDate = NULL;
346 346
             }
347 347
 
348 348
             $data->originalSourceTitle = $internalFormat->getOriginalSourceTitle();
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
      * @param  array $query search query
410 410
      * @return array        result list
411 411
      */
412
-    public function search($query, $type = null)
412
+    public function search($query, $type = NULL)
413 413
     {
414 414
         try {
415 415
             // define type and index
Please login to merge, or discard this patch.
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
 use TYPO3\CMS\Core\Log\LogManager;
24 24
 use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
25 25
 
26
-class ElasticSearch
27
-{
26
+class ElasticSearch {
28 27
     /**
29 28
      *
30 29
      * @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
@@ -60,8 +59,7 @@  discard block
 block discarded – undo
60 59
     /**
61 60
      * elasticsearch client constructor
62 61
      */
63
-    public function __construct()
64
-    {
62
+    public function __construct() {
65 63
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
66 64
 
67 65
         $this->elasticsearchMapper = $objectManager->get(ElasticsearchMapper::class);
@@ -94,8 +92,7 @@  discard block
 block discarded – undo
94 92
      *
95 93
      * @return mixed
96 94
      */
97
-    public function getSettings()
98
-    {
95
+    public function getSettings() {
99 96
         $frameworkConfiguration = $this->configurationManager->getConfiguration(
100 97
             \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK
101 98
         );
@@ -108,8 +105,7 @@  discard block
 block discarded – undo
108 105
      *
109 106
      * @param $indexName
110 107
      */
111
-    protected function initializeIndex($indexName)
112
-    {
108
+    protected function initializeIndex($indexName) {
113 109
         $paramsIndex = [
114 110
             'index' => $indexName,
115 111
             'body' => [
@@ -247,8 +243,7 @@  discard block
 block discarded – undo
247 243
      *
248 244
      * @param Document $document
249 245
      */
250
-    public function index($document)
251
-    {
246
+    public function index($document) {
252 247
         try {
253 248
             $data = json_decode($this->elasticsearchMapper->getElasticsearchJson($document));
254 249
         } catch (\Throwable $throwable) {
@@ -381,8 +376,7 @@  discard block
 block discarded – undo
381 376
      *
382 377
      * @param string $identifier
383 378
      */
384
-    public function delete($identifier)
385
-    {
379
+    public function delete($identifier) {
386 380
         try {
387 381
 
388 382
             $params = [
@@ -408,8 +402,7 @@  discard block
 block discarded – undo
408 402
     /**
409 403
      * @param $identifier
410 404
      */
411
-    public function getDocument($identifier)
412
-    {
405
+    public function getDocument($identifier) {
413 406
         $params = [
414 407
             'index' => $this->indexName,
415 408
             'id'    => $identifier
@@ -424,8 +417,7 @@  discard block
 block discarded – undo
424 417
      * @param  array $query search query
425 418
      * @return array        result list
426 419
      */
427
-    public function search($query, $type = null)
428
-    {
420
+    public function search($query, $type = null) {
429 421
         try {
430 422
             // define type and index
431 423
             if (empty($query['index'])) {
@@ -457,8 +449,7 @@  discard block
 block discarded – undo
457 449
      * Get the results
458 450
      * @return mixed
459 451
      */
460
-    public function getResults()
461
-    {
452
+    public function getResults() {
462 453
         // return results from the last search request
463 454
         return $this->results;
464 455
     }
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/UnpaywallDataService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
     public function searchRequest($searchTerm) {
26 26
         $mail = $this->clientConfigurationManager->getSetting("adminEmail");
27
-        $response = Request::get($this->apiUrl . '' . $searchTerm .'?email=' . $mail)
27
+        $response = Request::get($this->apiUrl . '' . $searchTerm . '?email=' . $mail)
28 28
             ->send();
29 29
         if ($response->body->HTTP_status_code == 404) {
30 30
             return ['entries' => ''];
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
     public function getDataRequest($id) {
39 39
         $mail = $this->clientConfigurationManager->getSetting("adminEmail");
40
-        $response = Request::get($this->apiUrl . '' . $id .'?email=' . $mail)
40
+        $response = Request::get($this->apiUrl . '' . $id . '?email=' . $mail)
41 41
             ->send();
42 42
 
43 43
         if ($response->body->HTTP_status_code == 404) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
 use TYPO3\CMS\Extbase\Object\ObjectManager;
6 6
 use \Httpful\Request;
7 7
 
8
-class UnpaywallDataService
9
-{
8
+class UnpaywallDataService {
10 9
     /**
11 10
      * clientConfigurationManager
12 11
      *
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/FisDataService.php 3 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     protected function getPersonRequestBody($id) {
48 48
         $graphQl = '{
49
-            person (id:"'.$id.'") 
49
+            person (id:"'.$id . '") 
50 50
             {
51 51
                 _createDate
52 52
                 _createUser
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
     protected function getSearchPersonBody($searchTerm) {
74 74
         $graphQl = '{   
75
-            staff(filter: {fullName: "'.$searchTerm.'"}, pageSize: 100) 
75
+            staff(filter: {fullName: "'.$searchTerm . '"}, pageSize: 100) 
76 76
             {     
77 77
                 entries 
78 78
                 {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
     protected function getOrgaRequestBody($id) {
99 99
         $graphQl = '{   
100
-            organisationalUnit(id:'.$id.') {
100
+            organisationalUnit(id:'.$id . ') {
101 101
                 titleDe
102 102
                 id
103 103
             }
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
     protected function getSearchOrgaBody($searchTerm) {
110 110
         $graphQl = '{   
111
-            organisationalUnits(filter: {text: "'.$searchTerm.'"}) 
111
+            organisationalUnits(filter: {text: "'.$searchTerm . '"}) 
112 112
             {     
113 113
                 entries 
114 114
                 {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,7 @@
 block discarded – undo
5 5
 use TYPO3\CMS\Core\Utility\GeneralUtility;
6 6
 use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
7 7
 
8
-class FisDataService
9
-{
8
+class FisDataService {
10 9
     /**
11 10
      * @var string
12 11
      */
Please login to merge, or discard this patch.
Upper-Lower-Casing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 
36 36
             return $response->body->data->person;
37 37
         } catch (\Throwable $e) {
38
-            return null;
38
+            return NULL;
39 39
         }
40 40
     }
41 41
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
             return $response->body->data->staff;
49 49
         } catch (\Throwable $e) {
50
-            return null;
50
+            return NULL;
51 51
         }
52 52
     }
53 53
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
             return $response->body->data->organisationalUnit;
61 61
         } catch (\Throwable $e) {
62
-            return null;
62
+            return NULL;
63 63
         }
64 64
     }
65 65
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
             return $response->body->data->organisationalUnits;
73 73
         } catch (\Throwable $e) {
74
-            return null;
74
+            return NULL;
75 75
         }
76 76
     }
77 77
 
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/ZdbDataService.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     }
31 31
 
32 32
     public function getDataRequest($zdbId) {
33
-        $response = Request::get($this->apiUrl . 'resource/' . $zdbId .'/')
33
+        $response = Request::get($this->apiUrl . 'resource/' . $zdbId . '/')
34 34
             ->send();
35 35
         
36 36
         return $response->body;
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use \Httpful\Request;
5 5
 
6
-class ZdbDataService
7
-{
6
+class ZdbDataService {
8 7
 
9 8
     protected $apiUrl = 'https://www.zeitschriftendatenbank.de/api/hydra/';
10 9
 
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/OrcidDataService.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function searchPersonRequest($searchTerm) {
21 21
         $response = Request::get($this->apiUrl . '/expanded-search/?q=' . $this->searchTermReplacement($searchTerm))
22 22
             ->expectsJson()
23
-            ->addHeader('Accept','*/*')
23
+            ->addHeader('Accept', '*/*')
24 24
             ->addHeader('Content-Type', 'application/vnd.orcid+json')
25 25
             ->send();
26 26
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function getPersonData($orcidId) {
31 31
         $response = Request::get($this->apiUrl . '/expanded-search/?q=orcid:' . $orcidId)
32 32
             ->expectsJson()
33
-            ->addHeader('Accept','*/*')
33
+            ->addHeader('Accept', '*/*')
34 34
             ->addHeader('Content-Type', 'application/vnd.orcid+json')
35 35
             ->send();
36 36
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use \Httpful\Request;
5 5
 
6
-class OrcidDataService
7
-{
6
+class OrcidDataService {
8 7
     protected $apiUrl = 'https://pub.orcid.org/v3.0';
9 8
 
10 9
     protected $params = '&start=0&rows=20';
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/RorDataService.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use \Httpful\Request;
5 5
 
6
-class RorDataService
7
-{
6
+class RorDataService {
8 7
 
9 8
     protected $apiUrl = 'https://api.ror.org/organizations';
10 9
 
Please login to merge, or discard this patch.
src/Classes/Services/FeUser/GndDataService.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@
 block discarded – undo
3 3
 
4 4
 use \Httpful\Request;
5 5
 
6
-class GndDataService
7
-{
6
+class GndDataService {
8 7
 
9 8
     protected $apiUrl = 'http://lobid.org/gnd/';
10 9
 
Please login to merge, or discard this patch.
src/Classes/Services/ParserGenerator.php 4 patches
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -23,8 +23,7 @@  discard block
 block discarded – undo
23 23
 /**
24 24
  * ParserGenerator
25 25
  */
26
-class ParserGenerator
27
-{
26
+class ParserGenerator {
28 27
     /**
29 28
      * clientConfigurationManager
30 29
      *
@@ -93,8 +92,7 @@  discard block
 block discarded – undo
93 92
     /**
94 93
      * Constructor
95 94
      */
96
-    public function __construct()
97
-    {
95
+    public function __construct() {
98 96
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(ObjectManager::class);
99 97
         $this->clientConfigurationManager = $objectManager->get(ClientConfigurationManager::class);
100 98
 
@@ -123,16 +121,14 @@  discard block
 block discarded – undo
123 121
      * returns the mods xml string
124 122
      * @return string mods xml
125 123
      */
126
-    public function getXMLData()
127
-    {
124
+    public function getXMLData() {
128 125
         $xml = $this->xmlData->saveXML();
129 126
         $xml = preg_replace("/eww=\"\d-\d-\d\"/", '${1}${2}${3}', $xml);
130 127
 
131 128
         return $xml;
132 129
     }
133 130
 
134
-    public function transformInputXML($xml)
135
-    {
131
+    public function transformInputXML($xml) {
136 132
         $XSLTransformator = new XSLTransformator();
137 133
         return $XSLTransformator->transformInputXML($xml);
138 134
     }
@@ -141,8 +137,7 @@  discard block
 block discarded – undo
141 137
      * @param $document
142 138
      * @return string The transformed xml
143 139
      */
144
-    public function getTransformedOutputXML($document)
145
-    {
140
+    public function getTransformedOutputXML($document) {
146 141
         $XSLTransformator = new XSLTransformator();
147 142
         return $XSLTransformator->getTransformedOutputXML($document);
148 143
     }
@@ -152,8 +147,7 @@  discard block
 block discarded – undo
152 147
      * build mods from form array
153 148
      * @param array $array structured form data array
154 149
      */
155
-    public function buildXmlFromForm($array)
156
-    {
150
+    public function buildXmlFromForm($array) {
157 151
         $this->xmlData = $this->xmlData;
158 152
         // Build xml mods from form fields
159 153
         // loop each group
@@ -234,8 +228,7 @@  discard block
 block discarded – undo
234 228
      * @param  xpath $xPath xPath expression
235 229
      * @return xml
236 230
      */
237
-    public function parseXPath($xPath)
238
-    {
231
+    public function parseXPath($xPath) {
239 232
 
240 233
         $this->parser->generateXmlFromXPath($xPath);
241 234
         $xml = $this->parser->getXML();
@@ -243,8 +236,7 @@  discard block
 block discarded – undo
243 236
         return $xml;
244 237
     }
245 238
 
246
-    public function parseXPathWrapped($xPath)
247
-    {
239
+    public function parseXPathWrapped($xPath) {
248 240
         $this->parser->generateXmlFromXPath($xPath);
249 241
         $xml = $this->parser->getXML();
250 242
 
@@ -259,8 +251,7 @@  discard block
 block discarded – undo
259 251
      * @param  string $value form value
260 252
      * @return xml    created xml
261 253
      */
262
-    public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false)
263
-    {
254
+    public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false) {
264 255
         if (!$attributeOnly) {
265 256
             // Explode xPath
266 257
             $newPath = explode('%', $xPath);
@@ -443,8 +434,7 @@  discard block
 block discarded – undo
443 434
      * sets the file data and generates file xml
444 435
      * @param string $value
445 436
      */
446
-    public function setFileData($value = '')
447
-    {
437
+    public function setFileData($value = '') {
448 438
         $this->files = $value;
449 439
         $this->generateFileXML();
450 440
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository
40 40
      */
41
-    protected $documentTypeRepository = null;
41
+    protected $documentTypeRepository = NULL;
42 42
 
43 43
     /**
44 44
      * formData
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * xPathXMLGenerator
77 77
      * @var object
78 78
      */
79
-    protected $parser = null;
79
+    protected $parser = NULL;
80 80
 
81 81
     /**
82 82
      * ref id counter
@@ -181,28 +181,28 @@  discard block
 block discarded – undo
181 181
                 $attributeXPath .= '[@ID="QUCOSA_' . $counter . '"]';
182 182
             }
183 183
 
184
-            $existsExtensionFlag = false;
184
+            $existsExtensionFlag = FALSE;
185 185
             $i                   = 0;
186 186
             // loop each object
187 187
             if (!empty($values)) {
188 188
                 foreach ($values as $value) {
189 189
 
190 190
                     if ($value['modsExtension']) {
191
-                        $existsExtensionFlag = true;
191
+                        $existsExtensionFlag = TRUE;
192 192
                         // mods extension
193 193
                         $counter            = sprintf("%'03d", $this->counter);
194 194
                         $referenceAttribute = $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="QUCOSA_' . $counter . '"]';
195 195
 
196 196
                         $path = $group['modsExtensionMapping'] . $referenceAttribute . '%/' . $value['mapping'];
197 197
 
198
-                        $xml = $this->customXPath($path, false, $value['value']);
198
+                        $xml = $this->customXPath($path, FALSE, $value['value']);
199 199
                     } else {
200 200
                         $path = $mapping . $attributeXPath . '%/' . $value['mapping'];
201 201
 
202 202
                         if ($i == 0) {
203
-                            $newGroupFlag = true;
203
+                            $newGroupFlag = TRUE;
204 204
                         } else {
205
-                            $newGroupFlag = false;
205
+                            $newGroupFlag = FALSE;
206 206
                         }
207 207
 
208 208
                     $this->customXPath($path, $newGroupFlag, $value['value']);
@@ -214,12 +214,12 @@  discard block
 block discarded – undo
214 214
             } else {
215 215
                 if (!empty($attributeXPath)) {
216 216
                     $path = $mapping . $attributeXPath;
217
-                    $this->customXPath($path, true, '', true);
217
+                    $this->customXPath($path, TRUE, '', TRUE);
218 218
                 }
219 219
             }
220 220
             if (!$existsExtensionFlag && $group['modsExtensionMapping']) {
221 221
                 $xPath = $group['modsExtensionMapping'] . $extensionAttribute . '[@' . $group['modsExtensionReference'] . '="QUCOSA_' . $counter . '"]';
222
-                $xml   = $this->customXPath($xPath, true, '', true);
222
+                $xml   = $this->customXPath($xPath, TRUE, '', TRUE);
223 223
             }
224 224
             if ($group['modsExtensionMapping']) {
225 225
                 $this->counter++;
@@ -259,13 +259,13 @@  discard block
 block discarded – undo
259 259
      * @param  string $value form value
260 260
      * @return xml    created xml
261 261
      */
262
-    public function customXPath($xPath, $newGroupFlag = false, $value = '', $attributeOnly = false)
262
+    public function customXPath($xPath, $newGroupFlag = FALSE, $value = '', $attributeOnly = FALSE)
263 263
     {
264 264
         if (!$attributeOnly) {
265 265
             // Explode xPath
266 266
             $newPath = explode('%', $xPath);
267 267
 
268
-            $praedicateFlag = false;
268
+            $praedicateFlag = FALSE;
269 269
             $explodedXPath  = explode('[', $newPath[0]);
270 270
             if (count($explodedXPath) > 1) {
271 271
                 // praedicate is given
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
                     $path = $explodedXPath[0];
278 278
                 }
279 279
 
280
-                $praedicateFlag = true;
280
+                $praedicateFlag = TRUE;
281 281
             } else {
282 282
                 $path = $newPath[0];
283 283
             }
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
                 // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces,
315 315
                 // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here,
316 316
                 // since it is about child elements that are then added to the overall XML.
317
-                libxml_use_internal_errors(true);
317
+                libxml_use_internal_errors(TRUE);
318 318
                 $docXML = new \DOMDocument();
319 319
                 $docXML->loadXML($xml);
320
-                libxml_use_internal_errors(false);
320
+                libxml_use_internal_errors(FALSE);
321 321
 
322 322
                 $domXPath = \EWW\Dpf\Helper\XPath::create($this->xmlData);
323 323
 
@@ -328,17 +328,17 @@  discard block
 block discarded – undo
328 328
                     // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces,
329 329
                     // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here,
330 330
                     // since it is about child elements that are then added to the overall XML.
331
-                    libxml_use_internal_errors(true);
331
+                    libxml_use_internal_errors(TRUE);
332 332
                     $docXMLNested = new \DOMDocument();
333 333
                     $docXMLNested->loadXML($nestedXml);
334
-                    libxml_use_internal_errors(false);
334
+                    libxml_use_internal_errors(FALSE);
335 335
 
336 336
                     $xPath = \EWW\Dpf\Helper\XPath::create($docXML);
337 337
 
338 338
                     $nodeList = $xPath->query($match[1]);
339 339
                     $node = $nodeList->item(0);
340 340
 
341
-                    $importNode = $docXML->importNode($docXMLNested->getElementsByTagName("mods")->item(0)->firstChild, true);
341
+                    $importNode = $docXML->importNode($docXMLNested->getElementsByTagName("mods")->item(0)->firstChild, TRUE);
342 342
 
343 343
                     $node->appendChild($importNode);
344 344
                 }
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 $domNode = $domXPath->query('/data/' . $path);
347 347
                 $node = $docXML->documentElement;
348 348
 
349
-                $nodeAppendModsData = $this->xmlData->importNode($node, true);
349
+                $nodeAppendModsData = $this->xmlData->importNode($node, TRUE);
350 350
                 $domNode->item($domNode->length - 1)->appendChild($nodeAppendModsData);
351 351
             } else {
352 352
                 // first xpath doesn't exist
@@ -395,14 +395,14 @@  discard block
 block discarded – undo
395 395
                     $nodeList = $xPath->query('//' . $path . $match[1]);
396 396
                     $node = $nodeList->item(0);
397 397
 
398
-                    $importNode = $doc2->importNode($docXMLNested->documentElement, true);
398
+                    $importNode = $doc2->importNode($docXMLNested->documentElement, TRUE);
399 399
 
400 400
                     $node->appendChild($importNode);
401 401
                 }
402 402
                 $domNode2 = $domXPath2->query('//' . $path)->item(0)->childNodes->item(0);
403 403
 
404 404
                 // merge xml nodes
405
-                $nodeToBeAppended = $doc1->importNode($domNode2, true);
405
+                $nodeToBeAppended = $doc1->importNode($domNode2, TRUE);
406 406
                 $domNode->item(0)->appendChild($nodeToBeAppended);
407 407
 
408 408
                 // add to modsData (merge not required)
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
                 }
417 417
                 //$firstChild = $this->xmlData->childNodes->item(0);
418 418
                 $firstItem = $doc1->documentElement->firstChild;
419
-                $nodeAppendModsData = $this->xmlData->importNode($firstItem, true);
419
+                $nodeAppendModsData = $this->xmlData->importNode($firstItem, TRUE);
420 420
                 $firstChild->appendChild($nodeAppendModsData);
421 421
 
422 422
                 return $doc1->saveXML();
@@ -428,17 +428,17 @@  discard block
 block discarded – undo
428 428
             // FIXME: XPATHXmlGenerator XPATH does not generate any namespaces,
429 429
             // which DOMDocument cannot cope with. Actually, namespaces should not be necessary here,
430 430
             // since it is about child elements that are then added to the overall XML.
431
-            libxml_use_internal_errors(true);
431
+            libxml_use_internal_errors(TRUE);
432 432
             $docXML = new \DOMDocument();
433 433
             $docXML->loadXML($xml);
434
-            libxml_use_internal_errors(false);
434
+            libxml_use_internal_errors(FALSE);
435 435
 
436 436
             $domXPath = \EWW\Dpf\Helper\XPath::create($this->xmlData);
437 437
             $domNode  = $domXPath->query('/data');
438 438
 
439 439
             $node = $docXML->documentElement;
440 440
 
441
-            $nodeAppendModsData = $this->xmlData->importNode($node, true);
441
+            $nodeAppendModsData = $this->xmlData->importNode($node, TRUE);
442 442
             $domNode->item($domNode->length - 1)->appendChild($nodeAppendModsData);
443 443
 
444 444
             return $docXML->saveXML();
@@ -475,14 +475,14 @@  discard block
 block discarded – undo
475 475
         foreach ($this->files as $key => $fileGrp) {
476 476
             foreach ($fileGrp as $file) {
477 477
 
478
-                $this->customXPath($fileXpathConfiguration . '/href', true, $file["path"]);
479
-                $this->customXPath($fileXpathConfiguration . '%mimetype', false, $file["type"]);
480
-                $this->customXPath($fileXpathConfiguration . '%title', false, $file["title"]);
481
-                $this->customXPath($fileXpathConfiguration . '%download', false, $file["download"]);
482
-                $this->customXPath($fileXpathConfiguration . '%archive', false, $file["archive"]);
483
-                $this->customXPath($fileXpathConfiguration . '%use', false, $file["use"]);
484
-                $this->customXPath($fileXpathConfiguration . '%id', false, $file["id"]);
485
-                $this->customXPath($fileXpathConfiguration . '%hasFLocat', false, $file["hasFLocat"]);
478
+                $this->customXPath($fileXpathConfiguration . '/href', TRUE, $file["path"]);
479
+                $this->customXPath($fileXpathConfiguration . '%mimetype', FALSE, $file["type"]);
480
+                $this->customXPath($fileXpathConfiguration . '%title', FALSE, $file["title"]);
481
+                $this->customXPath($fileXpathConfiguration . '%download', FALSE, $file["download"]);
482
+                $this->customXPath($fileXpathConfiguration . '%archive', FALSE, $file["archive"]);
483
+                $this->customXPath($fileXpathConfiguration . '%use', FALSE, $file["use"]);
484
+                $this->customXPath($fileXpathConfiguration . '%id', FALSE, $file["id"]);
485
+                $this->customXPath($fileXpathConfiguration . '%hasFLocat', FALSE, $file["hasFLocat"]);
486 486
 
487 487
             }
488 488
         }
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                                 $namespace = explode("=", $value);
108 108
                                 $this->namespaceString .= ' xmlns:' . $namespace[0] . '="' . $namespace[1] . '"';
109 109
                             }
110
-         }
110
+            }
111 111
 
112 112
         $this->xmlHeader = '<data' . $this->namespaceString . '></data>';
113 113
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
                 $domXPath2 = \EWW\Dpf\Helper\XPath::create($doc2);
388 388
 
389
-                  // second part nested xpath
389
+                    // second part nested xpath
390 390
                 if ($match[2] && $secondMatch[2]) {
391 391
                     // import node from nested
392 392
                     $docXMLNested = new \DOMDocument();
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
      *
46 46
      * @var array
47 47
      */
48
-    protected $formData = array();
48
+    protected $formData = array ();
49 49
 
50 50
     /**
51 51
      * files from form
52 52
      * @var array
53 53
      */
54
-    protected $files = array();
54
+    protected $files = array ();
55 55
 
56 56
     /**
57 57
      * metsData
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $this->xmlHeader = '<data' . $this->namespaceString . '></data>';
113 113
 
114
-        $this->xmlData =  new \DOMDocument();
114
+        $this->xmlData = new \DOMDocument();
115 115
         $this->xmlData->loadXML($this->xmlHeader);
116 116
 
117 117
         // Parser
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                     $nestedXml = $this->parseXPath($nested);
307 307
 
308 308
                     // object xpath without nested element []
309
-                    $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]);
309
+                    $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]);
310 310
 
311 311
                     $xml = $this->parseXPath($newPath[1]);
312 312
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                     $nestedXml = $this->parseXPathWrapped($nested);
377 377
 
378 378
                     // object xpath without nested element []
379
-                    $newPath[1] = str_replace('['.$match[2].']', '', $newPath[1]);
379
+                    $newPath[1] = str_replace('[' . $match[2] . ']', '', $newPath[1]);
380 380
 
381 381
                     $xml2 = $this->parseXPathWrapped($path . $newPath[1]);
382 382
                 }
Please login to merge, or discard this patch.