Passed
Pull Request — master (#209)
by
unknown
33:50 queued 24:56
created
Classes/Services/Document/EditingLockService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@
 block discarded – undo
123 123
 
124 124
     public function getLockedDocumentIdentifiersByUserUid($userUid)
125 125
     {
126
-        $identifiers = array();
126
+        $identifiers = array ();
127 127
 
128 128
         $locks = $this->editingLockRepository->findByEditorUid($userUid);
129 129
         /** @var  \EWW\Dpf\Domain\Model\EditingLock $lock */
Please login to merge, or discard this patch.
Classes/Domain/Model/FrontendUser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     public function getUserRole()
39 39
     {
40 40
         // Get frontend user groups of the client.
41
-        $clientFrontendGroups = array();
41
+        $clientFrontendGroups = array ();
42 42
         foreach ($this->frontendUserGroupRepository->findAll() as $clientGroup) {
43 43
             if ($clientGroup->getKitodoRole()) {
44 44
                 $clientFrontendGroups[$clientGroup->getUid()] = $clientGroup;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         // Get frontend user groups of the user.
49
-        $frontendUserGroups = array();
49
+        $frontendUserGroups = array ();
50 50
         foreach ($this->getUsergroup() as $userGroup) {
51 51
             // Because getUsergroup() does not return objects of the class
52 52
             // \EWW\Dpf\Domain\Model\FrontendUserRepository
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         }
56 56
 
57 57
         // Get the roles the user has in the current client.
58
-        $roles = array();
58
+        $roles = array ();
59 59
         foreach ($frontendUserGroups as $uid => $group) {
60 60
             if (array_key_exists($uid, $clientFrontendGroups)) {
61 61
                 $roles[$uid] = $group->getKitodoRole();
Please login to merge, or discard this patch.
Classes/Controller/AbstractSearchController.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         $searchString = $this->escapeQuery(trim($searchString));
56 56
 
57
-        $query['body']['query']['bool']['should'][0]['query_string']['query']                       = $searchString;
57
+        $query['body']['query']['bool']['should'][0]['query_string']['query'] = $searchString;
58 58
         //$query['body']['query']['bool']['should'][1]['has_child']['query']['query_string']['query'] = $searchString;
59 59
         $query['body']['query']['bool']['minimum_should_match'] = "1"; // 1
60 60
 
@@ -71,21 +71,21 @@  discard block
 block discarded – undo
71 71
      * build array for elasticsearch
72 72
      * @return array Elasticsearch query array
73 73
      */
74
-    public function extendedSearch($searchArray = array())
74
+    public function extendedSearch($searchArray = array ())
75 75
     {
76 76
 
77
-        $query  = array();
78
-        $filter = array();
77
+        $query  = array ();
78
+        $filter = array ();
79 79
         foreach ($searchArray as $key => $qry) {
80 80
             $qry = trim($qry);
81 81
 
82 82
             if (!empty($qry) && in_array($key, self::$matches)) {
83 83
 
84
-                $query['body']['query']['bool']['must'][] = array('match' => array($key => $qry));
84
+                $query['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry));
85 85
 
86 86
             } elseif (!empty($qry) && in_array($key, self::$terms)) {
87 87
 
88
-                $query['body']['query']['bool']['must'][] = array('term' => array($key => $qry));
88
+                $query['body']['query']['bool']['must'][] = array ('term' => array ($key => $qry));
89 89
 
90 90
             } elseif (!empty($qry) && $key == 'from') {
91 91
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
         if (isset($filter['gte']) || isset($filter['lte'])) {
106 106
 
107
-            $query['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $filter));
107
+            $query['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $filter));
108 108
 
109 109
         }
110 110
 
@@ -122,19 +122,19 @@  discard block
 block discarded – undo
122 122
     public function resultsFilter($query, $showDeleted = false)
123 123
     {
124 124
 
125
-        $queryFilter = array();
125
+        $queryFilter = array ();
126 126
 
127 127
         // Frontend only
128 128
         $searchResultsFilter = $this->settings['searchResultsFilter'];
129
-        if(!empty($searchResultsFilter)) {
129
+        if (!empty($searchResultsFilter)) {
130 130
 
131 131
             // add doctypes
132
-            if($searchResultsFilter['doctype']) {
132
+            if ($searchResultsFilter['doctype']) {
133 133
 
134 134
                 $uids = GeneralUtility::trimExplode(',', $searchResultsFilter['doctype']);
135 135
                 $documentTypeRepository = $this->documentTypeRepository;
136
-                $documentTypes = array();
137
-                foreach($uids as $uid) {
136
+                $documentTypes = array ();
137
+                foreach ($uids as $uid) {
138 138
                     $documentType = $documentTypeRepository->findByUid($uid);
139 139
                     $documentTypes[] = $documentType->getName();
140 140
                 };
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             }
143 143
 
144 144
             // add date filter
145
-            $dateFilter = array();
145
+            $dateFilter = array ();
146 146
             if ($searchResultsFilter['from']) {
147 147
 
148 148
                 $from     = date('d.m.Y', $searchResultsFilter['from']);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
             if ($searchResultsFilter['till']) {
156 156
 
157
-                $till          = date('d.m.Y', $searchResultsFilter['till']);
157
+                $till = date('d.m.Y', $searchResultsFilter['till']);
158 158
                 $dateTime = $this->convertFormDate($till, true);
159 159
                 $dateFilter['lte'] = $dateTime->format('Y-m-d');
160 160
                 unset($searchResultsFilter['till']);
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 
164 164
             if (isset($dateFilter['gte']) || isset($dateFilter['lte'])) {
165 165
 
166
-                $queryFilter['body']['query']['bool']['must'][] = array('range' => array('distribution_date' => $dateFilter));
166
+                $queryFilter['body']['query']['bool']['must'][] = array ('range' => array ('distribution_date' => $dateFilter));
167 167
 
168 168
             }
169 169
 
170 170
             foreach ($searchResultsFilter as $key => $qry) {
171 171
 
172
-                if(!empty($qry)) {
173
-                    $queryFilter['body']['query']['bool']['must'][] = array('match' => array($key => $qry));
172
+                if (!empty($qry)) {
173
+                    $queryFilter['body']['query']['bool']['must'][] = array ('match' => array ($key => $qry));
174 174
                 }
175 175
 
176 176
             }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
 
180 180
         // document must be active
181
-        if($showDeleted == false) {
181
+        if ($showDeleted == false) {
182 182
 
183 183
             //  $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A';
184 184
 
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\');
237 237
         $string                   = preg_replace_callback(
238 238
             '/([' . $luceneReservedCharacters . '])/',
239
-            function ($matches) {
239
+            function($matches) {
240 240
                 return '\\' . $matches[0];
241 241
             },
242 242
             $string
Please login to merge, or discard this patch.
class.ext_update.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 
31 31
     public function access() {
32 32
         $registry = GeneralUtility::makeInstance(Registry::class);
33
-        $version = $registry->get('tx_dpf','updatescript-'.self::VERSION);
33
+        $version = $registry->get('tx_dpf', 'updatescript-' . self::VERSION);
34 34
 
35 35
         // If the version has already been registered in the table sys_register the updatscript will be blocked.
36 36
         if ($version) {
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     public function main() {
44 44
         // This script registers itself into the sys_registry table to prevent a re-run with the same version number.
45 45
         $registry = GeneralUtility::makeInstance(Registry::class);
46
-        $version = $registry->get('tx_dpf','updatescript-'.self::VERSION);
46
+        $version = $registry->get('tx_dpf', 'updatescript-' . self::VERSION);
47 47
         if ($version) {
48 48
             return FALSE;
49 49
         } else {
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
                 (new UpdateVirtualType)->execute();
56 56
                 //$GLOBALS['TYPO3_DB']->sql_query("update tx_dpf_domain_model_document set creator = owner");
57 57
             } catch (\Throwable $throwable) {
58
-                return "Error while updating the extension: ".($throwable->getMessage());
58
+                return "Error while updating the extension: " . ($throwable->getMessage());
59 59
             }
60 60
 
61
-            $registry->set('tx_dpf','updatescript-'.self::VERSION,TRUE);
61
+            $registry->set('tx_dpf', 'updatescript-' . self::VERSION, TRUE);
62 62
         }
63 63
 
64 64
         return "The extension has been successfully updated.";
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             foreach ($repository->crossClientFindAll() as $record) {
124 124
                 if ($record['backend_only']) {
125 125
                     $recordObject = $repository->findByUid($record['uid']);
126
-                    $recordObject->setAccessRestrictionRoles(array(Security::ROLE_LIBRARIAN, Security::ROLE_RESEARCHER));
126
+                    $recordObject->setAccessRestrictionRoles(array (Security::ROLE_LIBRARIAN, Security::ROLE_RESEARCHER));
127 127
                     $repository->update($recordObject);
128 128
                 }
129 129
             }
Please login to merge, or discard this patch.
Configuration/TCA/Overrides/fe_users.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,28 +86,28 @@
 block discarded – undo
86 86
             ),
87 87
         )
88 88
     ),
89
-    'fis_pers_id' => array(
89
+    'fis_pers_id' => array (
90 90
         'exclude' => 0,
91 91
         'label'   => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.fis_pers_id',
92
-        'config'  => array(
92
+        'config'  => array (
93 93
             'type' => 'input',
94 94
             'size' => '30',
95 95
             'eval' => 'trim',
96 96
         ),
97 97
     ),
98
-    'orga_name' => array(
98
+    'orga_name' => array (
99 99
         'exclude' => 0,
100 100
         'label'   => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.orga_name',
101
-        'config'  => array(
101
+        'config'  => array (
102 102
             'type' => 'input',
103 103
             'size' => '30',
104 104
             'eval' => 'trim',
105 105
         ),
106 106
     ),
107
-    'api_token' => array(
107
+    'api_token' => array (
108 108
         'exclude' => 0,
109 109
         'label'   => 'LLL:EXT:dpf/Resources/Private/Language/locallang_db.xlf:tx_dpf_domain_model_feuser.api_token',
110
-        'config'  => array(
110
+        'config'  => array (
111 111
             'type' => 'input',
112 112
             'size' => '30',
113 113
             'eval' => 'trim',
Please login to merge, or discard this patch.
Classes/ViewHelpers/ShowStatusViewHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         }
35 35
 
36 36
         return \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate(
37
-            "manager.documentList.state.".$aliasState,
37
+            "manager.documentList.state." . $aliasState,
38 38
             'dpf',
39 39
             $arguments = null
40 40
         );
Please login to merge, or discard this patch.
Classes/Controller/DocumentController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
                             // check if new document form has more field items as the existing form
403 403
                             if ($valueFieldCounter < $fieldCounter && !$checkFieldsForAdding) {
404 404
                                 // field added
405
-                                for ($i = count($valueField); $i < $fieldCounter;$i++) {
405
+                                for ($i = count($valueField); $i < $fieldCounter; $i++) {
406 406
                                     $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$keyRepeatGroup]->getItems()[$keyField][$i];
407 407
 
408 408
                                 }
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                     if ($valueGroupCounter < count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup])) {
415 415
                         // group added
416 416
                         $counter = count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup]);
417
-                        for ($i = $valueGroupCounter; $i < $counter;$i++) {
417
+                        for ($i = $valueGroupCounter; $i < $counter; $i++) {
418 418
                             $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$i];
419 419
                         }
420 420
                     }
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
 
664 664
         $newDocument->setState(DocumentWorkflow::STATE_NEW_NONE);
665 665
 
666
-        $copyTitle = LocalizationUtility::translate("manager.workspace.title.copy", "dpf").$document->getTitle();
666
+        $copyTitle = LocalizationUtility::translate("manager.workspace.title.copy", "dpf") . $document->getTitle();
667 667
 
668 668
         $newDocument->setTitle($copyTitle);
669 669
 
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
         }
805 805
 
806 806
         $this->editingLockService->lock(
807
-            ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()),
807
+            ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()),
808 808
             $this->security->getUser()->getUid()
809 809
         );
810 810
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
         $documentForm = $documentMapper->getDocumentForm($document);
872 872
 
873 873
         $this->view->assign('suggestMod', true);
874
-        $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => true]);
874
+        $this->forward('edit', 'DocumentFormBackoffice', NULL, ['documentForm' => $documentForm, 'suggestMod' => true]);
875 875
     }
876 876
 
877 877
 
@@ -1008,7 +1008,7 @@  discard block
 block discarded – undo
1008 1008
 
1009 1009
             if ($this->documentManager->update($document, $workflowTransition)) {
1010 1010
 
1011
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.success';
1011
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.success';
1012 1012
                 $this->flashMessage($document, $key, AbstractMessage::OK);
1013 1013
 
1014 1014
                 if ($this->security->getUserRole() === Security::ROLE_LIBRARIAN) {
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
 
1038 1038
                 $this->redirectToDocumentList();
1039 1039
             } else {
1040
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure';
1040
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure';
1041 1041
                 $this->flashMessage($document, $key, AbstractMessage::ERROR);
1042 1042
                 $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
1043 1043
             }
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
             if ($exception instanceof DPFExceptionInterface) {
1049 1049
                 $key = $exception->messageLanguageKey();
1050 1050
             } else {
1051
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure';
1051
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure';
1052 1052
             }
1053 1053
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
1054 1054
             $this->redirectToDocumentList();
Please login to merge, or discard this patch.
Classes/Controller/DocumentFormBackofficeController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     }
93 93
 
94 94
     public function arrayRecursiveDiff($aArray1, $aArray2) {
95
-        $aReturn = array();
95
+        $aReturn = array ();
96 96
 
97 97
         foreach ($aArray1 as $mKey => $mValue) {
98 98
             if (array_key_exists($mKey, $aArray2)) {
@@ -146,13 +146,13 @@  discard block
 block discarded – undo
146 146
                 $message = LocalizationUtility::translate(
147 147
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.accessDenied',
148 148
                     'dpf',
149
-                    array($document->getTitle())
149
+                    array ($document->getTitle())
150 150
                 );
151 151
             } else {
152 152
                 $message = LocalizationUtility::translate(
153 153
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.failureBlocked',
154 154
                     'dpf',
155
-                    array($document->getTitle())
155
+                    array ($document->getTitle())
156 156
                 );
157 157
             }
158 158
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $this->view->assign('suggestMod', $suggestMod);
166 166
 
167 167
         $this->editingLockService->lock(
168
-            ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()),
168
+            ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()),
169 169
             $this->security->getUser()->getUid()
170 170
         );
171 171
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
         } catch (\Throwable $t) {
288 288
             $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR;
289
-            $this->addFlashMessage("Failed", '', $severity,false);
289
+            $this->addFlashMessage("Failed", '', $severity, false);
290 290
         }
291 291
 
292 292
         $this->redirectToDocumentList();
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 $message = LocalizationUtility::translate(
349 349
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.accessDenied',
350 350
                     'dpf',
351
-                    array($document->getTitle())
351
+                    array ($document->getTitle())
352 352
                 );
353 353
                 $this->addFlashMessage($message, '', AbstractMessage::ERROR);
354 354
 
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
             $workflowTransition = null;
377 377
 
378 378
             // Convert the temporary copy into a local working copy if needed.
379
-            if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') {
379
+            if ($updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') {
380 380
                 $saveWorkingCopy = true;
381 381
                 $updateDocument->setTemporary(false);
382 382
                 $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS;
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
                 $message = LocalizationUtility::translate(
429 429
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.success',
430 430
                     'dpf',
431
-                    array($updateDocument->getTitle())
431
+                    array ($updateDocument->getTitle())
432 432
                 );
433 433
                 $this->addFlashMessage($message, '', AbstractMessage::OK);
434 434
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
                 $message = LocalizationUtility::translate(
483 483
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure',
484 484
                     'dpf',
485
-                    array($updateDocument->getTitle())
485
+                    array ($updateDocument->getTitle())
486 486
                 );
487 487
                 $this->addFlashMessage($message, '', AbstractMessage::ERROR);
488 488
             }
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
             $exceptionMsg[] = LocalizationUtility::translate(
517 517
                 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure',
518 518
                 'dpf',
519
-                array($updateDocument->getTitle())
519
+                array ($updateDocument->getTitle())
520 520
             );
521 521
 
522 522
             $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf');
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         if ($redirectUri) {
646 646
             $this->redirectToUri($redirectUri);
647 647
         } else {
648
-            $this->redirect($action, $controller, null, array('message' => $message));
648
+            $this->redirect($action, $controller, null, array ('message' => $message));
649 649
         }
650 650
     }
651 651
 }
Please login to merge, or discard this patch.
Classes/Controller/UserController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 $this->addFlashMessage(
52 52
                     LocalizationUtility::translate("manager.locallang.user.settings.message.invalidFisId", "dpf"),
53 53
                     '',
54
-                    $severity,false
54
+                    $severity, false
55 55
                 );
56 56
             }
57 57
         }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $this->addFlashMessage(
62 62
             LocalizationUtility::translate("manager.locallang.user.settings.message.successfullySaved", "dpf"),
63 63
             '',
64
-            $severity,false
64
+            $severity, false
65 65
         );
66 66
 
67 67
         $this->forward('settings');
Please login to merge, or discard this patch.