Passed
Pull Request — master (#166)
by
unknown
21:05
created
Classes/Controller/SearchController.php 2 patches
Braces   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 /**
27 27
  * SearchController
28 28
  */
29
-class SearchController extends \EWW\Dpf\Controller\AbstractSearchController
30
-{
29
+class SearchController extends \EWW\Dpf\Controller\AbstractSearchController {
31 30
 
32 31
     /**
33 32
      * documentRepository
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      *
82 81
      * @return void
83 82
      */
84
-    public function listAction()
85
-    {
83
+    public function listAction() {
86 84
         $workingCopies['noneTemporary'] = $this->documentRepository->getObjectIdentifiers(FALSE);
87 85
         $workingCopies['temporary'] = $this->documentRepository->getObjectIdentifiers(TRUE);
88 86
         $this->view->assign('workingCopies', $workingCopies);
@@ -107,8 +105,7 @@  discard block
 block discarded – undo
107 105
      * get next search results
108 106
      * @return array ElasticSearch results
109 107
      */
110
-    public function nextResultsAction()
111
-    {
108
+    public function nextResultsAction() {
112 109
         try {
113 110
             $sessionVars = $GLOBALS["TSFE"]->getSessionData("tx_dpf");
114 111
             if (!$sessionVars['resultCount']) {
@@ -155,8 +152,7 @@  discard block
 block discarded – undo
155 152
     /**
156 153
      * extended search action
157 154
      */
158
-    public function extendedSearchAction()
159
-    {
155
+    public function extendedSearchAction() {
160 156
         // show extended search template
161 157
         $objectIdentifiers = $this->documentRepository->getObjectIdentifiers();
162 158
 
@@ -174,8 +170,7 @@  discard block
 block discarded – undo
174 170
     /**
175 171
      * gets a list of latest documents
176 172
      */
177
-    public function latestAction()
178
-    {
173
+    public function latestAction() {
179 174
         try {
180 175
             $query = $this->searchLatest();
181 176
 
@@ -210,8 +205,7 @@  discard block
 block discarded – undo
210 205
      * action search
211 206
      * @return void
212 207
      */
213
-    public function searchAction()
214
-    {
208
+    public function searchAction() {
215 209
         $this->session->setListAction($this->getCurrentAction(), $this->getCurrentController());
216 210
 
217 211
         try {
@@ -286,8 +280,7 @@  discard block
 block discarded – undo
286 280
      * @param  string $documentObjectIdentifier
287 281
      * @return void
288 282
      */
289
-    public function importForEditingAction($documentObjectIdentifier)
290
-    {
283
+    public function importForEditingAction($documentObjectIdentifier) {
291 284
         $this->session->setListAction($this->getCurrentAction(), $this->getCurrentController());
292 285
 
293 286
         /** @var \EWW\Dpf\Services\Transfer\DocumentTransferManager $documentTransferManager */
@@ -325,8 +318,7 @@  discard block
 block discarded – undo
325 318
      * @param  string $documentObjectIdentifier
326 319
      * @return void
327 320
      */
328
-    public function showDetailsAction($documentObjectIdentifier)
329
-    {
321
+    public function showDetailsAction($documentObjectIdentifier) {
330 322
         if ($documentObjectIdentifier) {
331 323
             /** @var  \EWW\Dpf\Domain\Model\Document $document */
332 324
             $document = $this->documentRepository->findWorkingCopyByObjectIdentifier($documentObjectIdentifier);
@@ -346,8 +338,7 @@  discard block
 block discarded – undo
346 338
      * @param  string $documentObjectIdentifier
347 339
      * @return void
348 340
      */
349
-    public function importAction($documentObjectIdentifier)
350
-    {
341
+    public function importAction($documentObjectIdentifier) {
351 342
         $documentTransferManager = $this->objectManager->get(DocumentTransferManager::class);
352 343
         $remoteRepository        = $this->objectManager->get(FedoraRepository::class);
353 344
         $documentTransferManager->setRemoteRepository($remoteRepository);
@@ -390,8 +381,7 @@  discard block
 block discarded – undo
390 381
      * @param  string $documentObjectIdentifier
391 382
      * @return void
392 383
      */
393
-    public function updateIndexAction($documentObjectIdentifier)
394
-    {
384
+    public function updateIndexAction($documentObjectIdentifier) {
395 385
         $document = $this->documentRepository->findByObjectIdentifier($documentObjectIdentifier);
396 386
 
397 387
         if (is_a($document, Document::class)) {
@@ -411,8 +401,7 @@  discard block
 block discarded – undo
411 401
      * @param  \EWW\Dpf\Domain\Model\Document $document
412 402
      * @return void
413 403
      */
414
-    public function doubletCheckAction(\EWW\Dpf\Domain\Model\Document $document)
415
-    {
404
+    public function doubletCheckAction(\EWW\Dpf\Domain\Model\Document $document) {
416 405
         $this->authorizationChecker->denyAccessUnlessGranted(DocumentVoter::DOUBLET_CHECK, $document);
417 406
 
418 407
         try {
@@ -495,8 +484,7 @@  discard block
 block discarded – undo
495 484
      * returns the query to get latest documents
496 485
      * @return mixed
497 486
      */
498
-    public function searchLatest()
499
-    {
487
+    public function searchLatest() {
500 488
         $client = $this->clientRepository->findAll()->current();
501 489
 
502 490
         // get the latest documents /CREATED_DATE
Please login to merge, or discard this patch.
Upper-Lower-Casing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
36 36
      * @inject
37 37
      */
38
-    protected $documentRepository = null;
38
+    protected $documentRepository = NULL;
39 39
 
40 40
     /**
41 41
      * clientRepository
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      * @var \EWW\Dpf\Domain\Repository\ClientRepository
44 44
      * @inject
45 45
      */
46
-    protected $clientRepository = null;
46
+    protected $clientRepository = NULL;
47 47
 
48 48
 
49 49
     /**
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @var \EWW\Dpf\Services\ElasticSearch\ElasticSearch
53 53
      * @inject
54 54
      */
55
-    protected $elasticSearch = null;
55
+    protected $elasticSearch = NULL;
56 56
 
57 57
 
58 58
     /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @var \EWW\Dpf\Domain\Repository\BookmarkRepository
71 71
      * @inject
72 72
      */
73
-    protected $bookmarkRepository = null;
73
+    protected $bookmarkRepository = NULL;
74 74
 
75 75
 
76 76
     const RESULT_COUNT      = 500;
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 $message,
147 147
                 '',
148 148
                 $severity,
149
-                true
149
+                TRUE
150 150
             );
151 151
         }
152 152
 
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
                 $message,
199 199
                 '',
200 200
                 $severity,
201
-                true
201
+                TRUE
202 202
             );
203 203
 
204 204
         }
205 205
 
206
-        $this->forward("list", null, null, array('results' => $results));
206
+        $this->forward("list", NULL, NULL, array('results' => $results));
207 207
     }
208 208
 
209 209
     /**
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             $sessionVars['resultCount'] = self::RESULT_COUNT;
224 224
             $this->setSessionData('tx_dpf', $sessionVars);
225 225
 
226
-            $extSearch = ($args['query']['extSearch']) ? true : false;
226
+            $extSearch = ($args['query']['extSearch']) ? TRUE : FALSE;
227 227
 
228 228
             // set sorting
229 229
             if ($extSearch) {
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
                 $message,
268 268
                 '',
269 269
                 $severity,
270
-                true
270
+                TRUE
271 271
             );
272 272
         }
273 273
 
274 274
         if ($extSearch) {
275 275
             // redirect to extended search view
276
-            $this->forward("extendedSearch", null, null, array('results' => $results, 'query' => $args['query']));
276
+            $this->forward("extendedSearch", NULL, NULL, array('results' => $results, 'query' => $args['query']));
277 277
         } else {
278 278
             // redirect to list view
279
-            $this->forward("list", null, null, array('results' => $results, 'query' => $args['query']));
279
+            $this->forward("list", NULL, NULL, array('results' => $results, 'query' => $args['query']));
280 280
         }
281 281
     }
282 282
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             $document = $documentTransferManager->retrieve($documentObjectIdentifier, $this->security->getUser()->getUid());
312 312
 
313 313
             if ($document) {
314
-                $this->redirect('showDetails', 'Document', null, ['document' => $document]);
314
+                $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
315 315
             }
316 316
         }
317 317
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
             $document = $this->documentRepository->findWorkingCopyByObjectIdentifier($documentObjectIdentifier);
333 333
 
334 334
             if ($document) {
335
-                $this->redirect('showDetails', 'Document', null, ['document'=>$document]);
335
+                $this->redirect('showDetails', 'Document', NULL, ['document'=>$document]);
336 336
             }
337 337
         }
338 338
 
@@ -379,10 +379,10 @@  discard block
 block discarded – undo
379 379
             $message,
380 380
             '',
381 381
             $severity,
382
-            true
382
+            TRUE
383 383
         );
384 384
 
385
-        $this->forward('updateIndex', null, null, array('documentObjectIdentifier' => $documentObjectIdentifier));
385
+        $this->forward('updateIndex', NULL, NULL, array('documentObjectIdentifier' => $documentObjectIdentifier));
386 386
     }
387 387
 
388 388
     /**
@@ -483,10 +483,10 @@  discard block
 block discarded – undo
483 483
                 $message,
484 484
                 '',
485 485
                 $severity,
486
-                true
486
+                TRUE
487 487
             );
488 488
 
489
-            $this->redirect('list', 'Document', null);
489
+            $this->redirect('list', 'Document', NULL);
490 490
         }
491 491
 
492 492
     }
Please login to merge, or discard this patch.
Classes/Controller/AbstractDocumentFormController.php 2 patches
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@  discard block
 block discarded – undo
25 25
 /**
26 26
  * DocumentFormController
27 27
  */
28
-abstract class AbstractDocumentFormController extends AbstractController
29
-{
28
+abstract class AbstractDocumentFormController extends AbstractController {
30 29
 
31 30
     /**
32 31
      * documentRepository
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
      *
82 81
      * @return void
83 82
      */
84
-    public function listAction()
85
-    {
83
+    public function listAction() {
86 84
         $documents = $this->documentRepository->findAll();
87 85
 
88 86
         $documentTypes = $this->documentTypeRepository->findAll();
@@ -127,8 +125,7 @@  discard block
 block discarded – undo
127 125
      *
128 126
      * @return void
129 127
      */
130
-    public function initializeNewAction()
131
-    {
128
+    public function initializeNewAction() {
132 129
 
133 130
         $requestArguments = $this->request->getArguments();
134 131
 
@@ -156,13 +153,11 @@  discard block
 block discarded – undo
156 153
      * @ignorevalidation $newDocumentForm
157 154
      * @return void
158 155
      */
159
-    public function newAction(DocumentForm $newDocumentForm = null)
160
-    {
156
+    public function newAction(DocumentForm $newDocumentForm = null) {
161 157
         $this->view->assign('documentForm', $newDocumentForm);
162 158
     }
163 159
 
164
-    public function initializeCreateAction()
165
-    {
160
+    public function initializeCreateAction() {
166 161
 
167 162
         $requestArguments = $this->request->getArguments();
168 163
 
@@ -196,8 +191,7 @@  discard block
 block discarded – undo
196 191
      * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm
197 192
      * @return void
198 193
      */
199
-    public function createAction(DocumentForm $newDocumentForm)
200
-    {
194
+    public function createAction(DocumentForm $newDocumentForm) {
201 195
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
202 196
 
203 197
         /* @var $newDocument \EWW\Dpf\Domain\Model\Document */
@@ -246,8 +240,7 @@  discard block
 block discarded – undo
246 240
 
247 241
     }
248 242
 
249
-    public function initializeEditAction()
250
-    {
243
+    public function initializeEditAction() {
251 244
         $requestArguments = $this->request->getArguments();
252 245
 
253 246
         if (array_key_exists('document', $requestArguments)) {
@@ -277,13 +270,11 @@  discard block
 block discarded – undo
277 270
      * @ignorevalidation $documentForm
278 271
      * @return void
279 272
      */
280
-    public function editAction(DocumentForm $documentForm)
281
-    {
273
+    public function editAction(DocumentForm $documentForm) {
282 274
         $this->view->assign('documentForm', $documentForm);
283 275
     }
284 276
 
285
-    public function initializeUpdateAction()
286
-    {
277
+    public function initializeUpdateAction() {
287 278
         $requestArguments = $this->request->getArguments();
288 279
 
289 280
         if ($this->request->hasArgument('documentData')) {
@@ -316,8 +307,7 @@  discard block
 block discarded – undo
316 307
      * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm
317 308
      * @return void
318 309
      */
319
-    public function updateAction(DocumentForm $documentForm)
320
-    {
310
+    public function updateAction(DocumentForm $documentForm) {
321 311
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
322 312
 
323 313
         /* @var $updateDocument \EWW\Dpf\Domain\Model\Document */
@@ -358,18 +348,15 @@  discard block
 block discarded – undo
358 348
      *
359 349
      * @return void
360 350
      */
361
-    public function cancelAction()
362
-    {
351
+    public function cancelAction() {
363 352
         $this->redirectToList();
364 353
     }
365 354
 
366
-    protected function redirectAfterUpdate()
367
-    {
355
+    protected function redirectAfterUpdate() {
368 356
         $this->redirect('list');
369 357
     }
370 358
 
371
-    protected function redirectToList($message = null)
372
-    {
359
+    protected function redirectToList($message = null) {
373 360
         $this->redirect('list');
374 361
     }
375 362
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
35 35
      * @inject
36 36
      */
37
-    protected $documentRepository = null;
37
+    protected $documentRepository = NULL;
38 38
 
39 39
     /**
40 40
      * fileRepository
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      * @var \EWW\Dpf\Domain\Repository\FileRepository
43 43
      * @inject
44 44
      */
45
-    protected $fileRepository = null;
45
+    protected $fileRepository = NULL;
46 46
 
47 47
     /**
48 48
      * documentTypeRepository
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository
51 51
      * @inject
52 52
      */
53
-    protected $documentTypeRepository = null;
53
+    protected $documentTypeRepository = NULL;
54 54
 
55 55
     /**
56 56
      * metadataGroupRepository
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository
59 59
      * @inject
60 60
      */
61
-    protected $metadataGroupRepository = null;
61
+    protected $metadataGroupRepository = NULL;
62 62
 
63 63
     /**
64 64
      * metadataObjectRepository
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository
67 67
      * @inject
68 68
      */
69
-    protected $metadataObjectRepository = null;
69
+    protected $metadataObjectRepository = NULL;
70 70
 
71 71
     /**
72 72
      * persistence manager
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      * @ignorevalidation $newDocumentForm
157 157
      * @return void
158 158
      */
159
-    public function newAction(DocumentForm $newDocumentForm = null)
159
+    public function newAction(DocumentForm $newDocumentForm = NULL)
160 160
     {
161 161
         $this->view->assign('documentForm', $newDocumentForm);
162 162
     }
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
             $documentType = $this->documentTypeRepository->findByUid($docTypeUid);
180 180
             $virtual = $documentType->getVirtual();
181 181
 
182
-            if (!$formDataReader->uploadError() || $virtual === true) {
182
+            if (!$formDataReader->uploadError() || $virtual === TRUE) {
183 183
                 $this->request->setArguments($requestArguments);
184 184
             } else {
185 185
                 $t = $docForm->getNewFileNames();
186
-                $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
186
+                $this->redirect('list', 'DocumentForm', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
187 187
             }
188 188
         } else {
189 189
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -299,11 +299,11 @@  discard block
 block discarded – undo
299 299
             $documentType = $this->documentTypeRepository->findByUid($docTypeUid);
300 300
             $virtual = $documentType->getVirtual();
301 301
 
302
-            if (!$formDataReader->uploadError() || $virtual === true) {
302
+            if (!$formDataReader->uploadError() || $virtual === TRUE) {
303 303
                 $this->request->setArguments($requestArguments);
304 304
             } else {
305 305
                 $t = $docForm->getNewFileNames();
306
-                $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
306
+                $this->redirect('list', 'Document', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
307 307
             }
308 308
         } else {
309 309
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             throw new \EWW\Dpf\Exceptions\DocumentMaxSizeErrorException("Maximum document size exceeded.");
329 329
         }
330 330
 
331
-        $updateDocument->setChanged(true);
331
+        $updateDocument->setChanged(TRUE);
332 332
         $this->documentRepository->update($updateDocument);
333 333
 
334 334
 
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         $this->redirect('list');
369 369
     }
370 370
 
371
-    protected function redirectToList($message = null)
371
+    protected function redirectToList($message = NULL)
372 372
     {
373 373
         $this->redirect('list');
374 374
     }
Please login to merge, or discard this patch.
Classes/Controller/DocumentController.php 3 patches
Braces   +17 added lines, -34 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
 /**
36 36
  * DocumentController
37 37
  */
38
-class DocumentController extends AbstractController
39
-{
38
+class DocumentController extends AbstractController {
40 39
 
41 40
     /**
42 41
      * documentRepository
@@ -135,8 +134,7 @@  discard block
 block discarded – undo
135 134
     /**
136 135
      * DocumentController constructor.
137 136
      */
138
-    public function __construct()
139
-    {
137
+    public function __construct() {
140 138
         parent::__construct();
141 139
 
142 140
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
@@ -151,8 +149,7 @@  discard block
 block discarded – undo
151 149
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
152 150
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
153 151
      */
154
-    public function logoutAction()
155
-    {
152
+    public function logoutAction() {
156 153
         $cObj = GeneralUtility::makeInstance(ContentObjectRenderer::class);
157 154
         $uri = $cObj->typolink_URL([
158 155
             'parameter' => $this->settings['loginPage'],
@@ -390,8 +387,7 @@  discard block
 block discarded – undo
390 387
      * @param string $reason
391 388
      * @return void
392 389
      */
393
-    public function discardAction(Document $document, $tstamp, $reason = NULL)
394
-    {
390
+    public function discardAction(Document $document, $tstamp, $reason = NULL) {
395 391
         if (!$this->authorizationChecker->isGranted(DocumentVoter::DISCARD, $document)) {
396 392
             if (
397 393
                 $this->editingLockService->isLocked(
@@ -419,8 +415,7 @@  discard block
 block discarded – undo
419 415
      * @param string $reason
420 416
      * @return void
421 417
      */
422
-    public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL)
423
-    {
418
+    public function postponeAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp, $reason = NULL) {
424 419
         if (!$this->authorizationChecker->isGranted(DocumentVoter::POSTPONE, $document)) {
425 420
             if (
426 421
                 $this->editingLockService->isLocked(
@@ -449,8 +444,7 @@  discard block
 block discarded – undo
449 444
      * @param integer $tstamp
450 445
      * @return void
451 446
      */
452
-    public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp)
453
-    {
447
+    public function deleteLocallyAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) {
454 448
         if ($document->getObjectIdentifier()) {
455 449
             $voterAttribute = DocumentVoter::DELETE_WORKING_COPY;
456 450
         } else {
@@ -527,8 +521,7 @@  discard block
 block discarded – undo
527 521
      * @param \EWW\Dpf\Domain\Model\Document $document
528 522
      * @return void
529 523
      */
530
-    public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document)
531
-    {
524
+    public function duplicateAction(\EWW\Dpf\Domain\Model\Document $document) {
532 525
         if (!$this->authorizationChecker->isGranted(DocumentVoter::DUPLICATE, $document)) {
533 526
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_duplicate.accessDenied';
534 527
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
@@ -595,8 +588,7 @@  discard block
 block discarded – undo
595 588
      * @param integer $tstamp
596 589
      * @return void
597 590
      */
598
-    public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp)
599
-    {
591
+    public function releasePublishAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) {
600 592
         if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_PUBLISH, $document)) {
601 593
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_ingest.accessDenied';
602 594
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
@@ -616,8 +608,7 @@  discard block
 block discarded – undo
616 608
      * @param integer $tstamp
617 609
      * @return void
618 610
      */
619
-    public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp)
620
-    {
611
+    public function releaseActivateAction(\EWW\Dpf\Domain\Model\Document $document, $tstamp) {
621 612
         if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_ACTIVATE, $document)) {
622 613
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_activate.accessDenied';
623 614
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
@@ -635,8 +626,7 @@  discard block
 block discarded – undo
635 626
      * @param \EWW\Dpf\Domain\Model\Document $document
636 627
      * @return void
637 628
      */
638
-    public function registerAction(\EWW\Dpf\Domain\Model\Document $document)
639
-    {
629
+    public function registerAction(\EWW\Dpf\Domain\Model\Document $document) {
640 630
         if (!$this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) {
641 631
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.accessDenied';
642 632
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
@@ -674,8 +664,7 @@  discard block
 block discarded – undo
674 664
      * @param \EWW\Dpf\Domain\Model\Document $document
675 665
      * @return void
676 666
      */
677
-    public function showDetailsAction(Document $document)
678
-    {
667
+    public function showDetailsAction(Document $document) {
679 668
         if (!$this->authorizationChecker->isGranted(DocumentVoter::SHOW_DETAILS, $document)) {
680 669
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_showDetails.accessDenied';
681 670
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
@@ -701,8 +690,7 @@  discard block
 block discarded – undo
701 690
     }
702 691
 
703 692
 
704
-    public function cancelListTaskAction()
705
-    {
693
+    public function cancelListTaskAction() {
706 694
         $this->redirectToDocumentList();
707 695
     }
708 696
     
@@ -745,8 +733,7 @@  discard block
 block discarded – undo
745 733
     /**
746 734
      * initializeAction
747 735
      */
748
-    public function initializeAction()
749
-    {
736
+    public function initializeAction() {
750 737
         $this->authorizationChecker->denyAccessUnlessLoggedIn();
751 738
 
752 739
         parent::initializeAction();
@@ -772,8 +759,7 @@  discard block
 block discarded – undo
772 759
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
773 760
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
774 761
      */
775
-    protected function redirectToDocumentList($message = null)
776
-    {
762
+    protected function redirectToDocumentList($message = null) {
777 763
         list($action, $controller, $redirectUri) = $this->session->getListAction();
778 764
 
779 765
         if ($redirectUri) {
@@ -788,8 +774,7 @@  discard block
 block discarded – undo
788 774
      *
789 775
      * @return mixed
790 776
      */
791
-    protected function getStoragePID()
792
-    {
777
+    protected function getStoragePID() {
793 778
         return $this->settings['persistence']['classes']['EWW\Dpf\Domain\Model\Document']['newRecordStoragePid'];
794 779
     }
795 780
 
@@ -800,8 +785,7 @@  discard block
 block discarded – undo
800 785
      * @param string $severity
801 786
      * @param string $defaultMessage
802 787
      */
803
-    protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "")
804
-    {
788
+    protected function flashMessage(\EWW\Dpf\Domain\Model\Document $document, $key, $severity, $defaultMessage = "") {
805 789
         // Show success or failure of the action in a flash message
806 790
         if ($document) {
807 791
             $args[] = $document->getTitle();
@@ -828,8 +812,7 @@  discard block
 block discarded – undo
828 812
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
829 813
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
830 814
      */
831
-    protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason)
832
-    {
815
+    protected function updateDocument(\EWW\Dpf\Domain\Model\Document $document, $workflowTransition, $reason) {
833 816
         switch ($workflowTransition) {
834 817
             case DocumentWorkflow::TRANSITION_DISCARD:
835 818
                 $messageKeyPart = 'document_discard';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
45 45
      * @inject
46 46
      */
47
-    protected $documentRepository = null;
47
+    protected $documentRepository = NULL;
48 48
 
49 49
     /**
50 50
      * inputOptionListRepository
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @var \EWW\Dpf\Domain\Repository\InputOptionListRepository
53 53
      * @inject
54 54
      */
55
-    protected $inputOptionListRepository = null;
55
+    protected $inputOptionListRepository = NULL;
56 56
 
57 57
     /**
58 58
      * persistence manager
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      * @var \EWW\Dpf\Services\Document\EditingLockService
69 69
      * @inject
70 70
      */
71
-    protected $editingLockService = null;
71
+    protected $editingLockService = NULL;
72 72
 
73 73
     /**
74 74
      * documentValidator
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * @var \EWW\Dpf\Domain\Repository\FileRepository
106 106
      * @inject
107 107
      */
108
-    protected $fileRepository = null;
108
+    protected $fileRepository = NULL;
109 109
 
110 110
 
111 111
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository
115 115
      * @inject
116 116
      */
117
-    protected $frontendUserRepository = null;
117
+    protected $frontendUserRepository = NULL;
118 118
 
119 119
     /**
120 120
      * documentManager
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      * @var \EWW\Dpf\Services\Document\DocumentManager
123 123
      * @inject
124 124
      */
125
-    protected $documentManager = null;
125
+    protected $documentManager = NULL;
126 126
 
127 127
     /**
128 128
      * bookmarkRepository
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
      * @var \EWW\Dpf\Domain\Repository\BookmarkRepository
131 131
      * @inject
132 132
      */
133
-    protected $bookmarkRepository = null;
133
+    protected $bookmarkRepository = NULL;
134 134
 
135 135
     /**
136 136
      * DocumentController constructor.
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
      * @param Document $document
197 197
      * @param bool $acceptAll
198 198
      */
199
-    public function acceptSuggestionAction(\EWW\Dpf\Domain\Model\Document $document, bool $acceptAll = true) {
199
+    public function acceptSuggestionAction(\EWW\Dpf\Domain\Model\Document $document, bool $acceptAll = TRUE) {
200 200
 
201 201
         $args = $this->request->getArguments();
202 202
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         if ($acceptAll) {
220 220
             // all changes are confirmed
221 221
             // copy suggest to origin document
222
-            $originDocument->copy($document, true);
222
+            $originDocument->copy($document, TRUE);
223 223
 
224 224
             if ($originDocument->getTransferStatus() == 'RESTORE') {
225 225
                 if ($originDocument->getObjectIdentifier()) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             $this->documentRepository->remove($document);
244 244
 
245 245
             // redirect to document
246
-            $this->redirect('showDetails', 'Document', null, ['document' => $originDocument]);
246
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $originDocument]);
247 247
         }
248 248
 
249 249
         $this->redirectToDocumentList();
@@ -294,11 +294,11 @@  discard block
 block discarded – undo
294 294
                 // groups
295 295
                 foreach ($valueRepeatPage->getItems() as $keyGroup => $valueGroup) {
296 296
 
297
-                    $checkFieldsForAdding = false;
297
+                    $checkFieldsForAdding = FALSE;
298 298
                     $valueGroupCounter = count($valueGroup);
299 299
 
300 300
                     if ($valueGroupCounter < count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup])) {
301
-                        $checkFieldsForAdding = true;
301
+                        $checkFieldsForAdding = TRUE;
302 302
                     }
303 303
 
304 304
                     foreach ($valueGroup as $keyRepeatGroup => $valueRepeatGroup) {
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                                 $valueFieldCounter = count($valueField);
312 312
 
313 313
                                 // check if group or field is not existing
314
-                                $notExisting = false;
314
+                                $notExisting = FALSE;
315 315
                                 try {
316 316
                                     $flag = 'page';
317 317
                                     $value2 = $docForm2->getItems()[$keyPage];
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                                     $value2 = $value2[$keyRepeatGroup]->getItems()[$keyField];
322 322
                                     $flag = 'field';
323 323
                                 } catch (\Throwable $t) {
324
-                                    $notExisting = true;
324
+                                    $notExisting = TRUE;
325 325
                                 }
326 326
 
327 327
                                 $item = NULL;
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
                 $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_discard.accessDenied';
405 405
             }
406 406
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
407
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
407
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
408 408
             return FALSE;
409 409
         }
410 410
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                 $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_postpone.accessDenied';
434 434
             }
435 435
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
436
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
436
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
437 437
             return FALSE;
438 438
         }
439 439
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
                 $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_deleteLocally.accessDenied';
470 470
             }
471 471
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
472
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
472
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
473 473
             return FALSE;
474 474
         }
475 475
 
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
         } else {
518 518
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_deleteLocally.failureNewVersion';
519 519
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
520
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
520
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
521 521
         }
522 522
     }
523 523
 
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
         if (!$this->authorizationChecker->isGranted(DocumentVoter::DUPLICATE, $document)) {
533 533
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_duplicate.accessDenied';
534 534
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
535
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
535
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
536 536
             return FALSE;
537 537
         }
538 538
 
@@ -600,11 +600,11 @@  discard block
 block discarded – undo
600 600
         if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_PUBLISH, $document)) {
601 601
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_ingest.accessDenied';
602 602
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
603
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
603
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
604 604
             return FALSE;
605 605
         }
606 606
 
607
-        $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_PUBLISH, null);
607
+        $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_PUBLISH, NULL);
608 608
 
609 609
     }
610 610
 
@@ -621,11 +621,11 @@  discard block
 block discarded – undo
621 621
         if (!$this->authorizationChecker->isGranted(DocumentVoter::RELEASE_ACTIVATE, $document)) {
622 622
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_activate.accessDenied';
623 623
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
624
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
624
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
625 625
             return FALSE;
626 626
         }
627 627
 
628
-        $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_ACTIVATE, null);
628
+        $this->updateDocument($document, DocumentWorkflow::TRANSITION_RELEASE_ACTIVATE, NULL);
629 629
 
630 630
     }
631 631
 
@@ -640,13 +640,13 @@  discard block
 block discarded – undo
640 640
         if (!$this->authorizationChecker->isGranted(DocumentVoter::REGISTER, $document)) {
641 641
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.accessDenied';
642 642
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
643
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
643
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
644 644
         }
645 645
 
646
-        if (!$this->documentValidator->validate($document, false)) {
646
+        if (!$this->documentValidator->validate($document, FALSE)) {
647 647
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.missingValues';
648 648
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
649
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
649
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
650 650
         }
651 651
 
652 652
         $this->workflow->apply($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER);
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
 
666 666
         $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_register.success';
667 667
         $this->flashMessage($document, $key, AbstractMessage::OK);
668
-        $this->redirect('showDetails', 'Document', null, ['document' => $document]);
668
+        $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
669 669
     }
670 670
 
671 671
     /**
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
         if (!$this->authorizationChecker->isGranted(DocumentVoter::SUGGEST_RESTORE, $document)) {
718 718
             $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_suggestRestore.accessDenied';
719 719
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
720
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
720
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
721 721
             return FALSE;
722 722
         }
723 723
 
@@ -737,8 +737,8 @@  discard block
 block discarded – undo
737 737
         /* @var $newDocument \EWW\Dpf\Domain\Model\Document */
738 738
         $documentForm = $documentMapper->getDocumentForm($document);
739 739
 
740
-        $this->view->assign('suggestMod', true);
741
-        $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => true]);
740
+        $this->view->assign('suggestMod', TRUE);
741
+        $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => TRUE]);
742 742
     }
743 743
 
744 744
 
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
773 773
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
774 774
      */
775
-    protected function redirectToDocumentList($message = null)
775
+    protected function redirectToDocumentList($message = NULL)
776 776
     {
777 777
         list($action, $controller, $redirectUri) = $this->session->getListAction();
778 778
 
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
             $message,
816 816
             '',
817 817
             $severity,
818
-            true
818
+            TRUE
819 819
         );
820 820
     }
821 821
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                             // check if new document form has more field items as the existing form
354 354
                             if ($valueFieldCounter < $fieldCounter && !$checkFieldsForAdding) {
355 355
                                 // field added
356
-                                for ($i = count($valueField); $i < $fieldCounter;$i++) {
356
+                                for ($i = count($valueField); $i < $fieldCounter; $i++) {
357 357
                                     $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$keyRepeatGroup]->getItems()[$keyField][$i];
358 358
 
359 359
                                 }
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
                     if ($valueGroupCounter < count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup])) {
366 366
                         // group added
367 367
                         $counter = count($docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup]);
368
-                        for ($i = $valueGroupCounter; $i < $counter;$i++) {
368
+                        for ($i = $valueGroupCounter; $i < $counter; $i++) {
369 369
                             $returnArray['added'][] = $docForm2->getItems()[$keyPage][$keyRepeatPage]->getItems()[$keyGroup][$i];
370 370
                         }
371 371
                     }
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
         }
684 684
 
685 685
         $this->editingLockService->lock(
686
-            ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()),
686
+            ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()),
687 687
             $this->security->getUser()->getUid()
688 688
         );
689 689
 
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
         $documentForm = $documentMapper->getDocumentForm($document);
739 739
 
740 740
         $this->view->assign('suggestMod', true);
741
-        $this->forward('edit','DocumentFormBackoffice',NULL, ['documentForm' => $documentForm, 'suggestMod' => true]);
741
+        $this->forward('edit', 'DocumentFormBackoffice', NULL, ['documentForm' => $documentForm, 'suggestMod' => true]);
742 742
     }
743 743
 
744 744
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 
871 871
             if ($this->documentManager->update($document, $workflowTransition)) {
872 872
 
873
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.success';
873
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.success';
874 874
                 $this->flashMessage($document, $key, AbstractMessage::OK);
875 875
 
876 876
                 if ($this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN) {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
 
900 900
                 $this->redirectToDocumentList();
901 901
             } else {
902
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure';
902
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure';
903 903
                 $this->flashMessage($document, $key, AbstractMessage::ERROR);
904 904
                 $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
905 905
             }
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
             if ($exception instanceof DPFExceptionInterface) {
911 911
                 $key = $exception->messageLanguageKey();
912 912
             } else {
913
-                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:'.$messageKeyPart.'.failure';
913
+                $key = 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:' . $messageKeyPart . '.failure';
914 914
             }
915 915
             $this->flashMessage($document, $key, AbstractMessage::ERROR);
916 916
             $this->redirectToDocumentList();
Please login to merge, or discard this patch.
Classes/Controller/AbstractSearchController.php 4 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@
 block discarded – undo
180 180
         // document must be active
181 181
         if($showDeleted == false) {
182 182
 
183
-          //  $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A';
183
+            //  $queryFilter['body']['query']['bool']['must'][]['term']['STATE'] = 'A';
184 184
 
185 185
         };
186 186
 
Please login to merge, or discard this 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.
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 18
 use EWW\Dpf\Services\ElasticSearch\ElasticSearch;
19 19
 
20
-abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController
21
-{
20
+abstract class AbstractSearchController extends \EWW\Dpf\Controller\AbstractController {
22 21
     // search terms
23 22
     private static $terms   = ['_id', 'OWNER_ID', 'submitter', 'project'];
24 23
 
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
      * @param  array $query elasticsearch search query
32 31
      * @return array        results
33 32
      */
34
-    public function getResultList($query, $type)
35
-    {
33
+    public function getResultList($query, $type) {
36 34
 
37 35
         $elasticSearch = $this->objectManager->get(ElasticSearch::class);
38 36
         $results = $elasticSearch->search($query, $type);
@@ -45,8 +43,7 @@  discard block
 block discarded – undo
45 43
      * @param  string $searchString
46 44
      * @return array query
47 45
      */
48
-    public function searchFulltext($searchString)
49
-    {
46
+    public function searchFulltext($searchString) {
50 47
         // don't return query if searchString is empty
51 48
         if (empty($searchString)) {
52 49
             return null;
@@ -71,8 +68,7 @@  discard block
 block discarded – undo
71 68
      * build array for elasticsearch
72 69
      * @return array Elasticsearch query array
73 70
      */
74
-    public function extendedSearch($searchArray = array())
75
-    {
71
+    public function extendedSearch($searchArray = array()) {
76 72
 
77 73
         $query  = array();
78 74
         $filter = array();
@@ -119,8 +115,7 @@  discard block
 block discarded – undo
119 115
      * @param array Elasticsearch query array
120 116
      * @return array Elasticsearch queryFilter array
121 117
      */
122
-    public function resultsFilter($query, $showDeleted = false)
123
-    {
118
+    public function resultsFilter($query, $showDeleted = false) {
124 119
 
125 120
         $queryFilter = array();
126 121
 
@@ -209,8 +204,7 @@  discard block
 block discarded – undo
209 204
      * @param  bool      $intervalEnd Fills missing values with the maximum possible date if true
210 205
      * @return DateTime               Determined date
211 206
      */
212
-    public function convertFormDate($dateString, $intervalEnd = false)
213
-    {
207
+    public function convertFormDate($dateString, $intervalEnd = false) {
214 208
         try {
215 209
             if (strlen($dateString) == 4) {
216 210
                 // assuming year
@@ -231,8 +225,7 @@  discard block
 block discarded – undo
231 225
      * @param $string
232 226
      * @return mixed
233 227
      */
234
-    private function escapeQuery($string)
235
-    {
228
+    private function escapeQuery($string) {
236 229
         $luceneReservedCharacters = preg_quote('+-&|!(){}[]^"~?:\\');
237 230
         $string                   = preg_replace_callback(
238 231
             '/([' . $luceneReservedCharacters . '])/',
@@ -252,8 +245,7 @@  discard block
 block discarded – undo
252 245
      * @param $date
253 246
      * @return string
254 247
      */
255
-    public function formatDate($date)
256
-    {
248
+    public function formatDate($date) {
257 249
         // convert date from dd.mm.yyy to yyyy-dd-mm
258 250
         $date = explode(".", $date);
259 251
         return $date[2] . '-' . $date[1] . '-' . $date[0];
Please login to merge, or discard this patch.
Upper-Lower-Casing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         // don't return query if searchString is empty
51 51
         if (empty($searchString)) {
52
-            return null;
52
+            return NULL;
53 53
         }
54 54
 
55 55
         $searchString = $this->escapeQuery(trim($searchString));
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         // child_type is invalid in elasticsearch 7.5
62 62
         //$query['body']['query']['bool']['should'][1]['has_child']['type'] = "datastream"; // 1
63 63
 
64
-        $query = $this->resultsFilter($query, false);
64
+        $query = $this->resultsFilter($query, FALSE);
65 65
 
66 66
         return $query;
67 67
 
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
 
90 90
             } elseif (!empty($qry) && $key == 'from') {
91 91
 
92
-                if ($dateTime = $this->convertFormDate($qry, false)) {
92
+                if ($dateTime = $this->convertFormDate($qry, FALSE)) {
93 93
                     $filter['gte'] = $dateTime->format('Y-m-d');
94 94
                 }
95 95
 
96 96
             } elseif (!empty($qry) && $key == 'till') {
97 97
 
98
-                if ($dateTime = $this->convertFormDate($qry, true)) {
98
+                if ($dateTime = $this->convertFormDate($qry, TRUE)) {
99 99
                     $filter['lte'] = $dateTime->format('Y-m-d');
100 100
                 }
101 101
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         }
110 110
 
111
-        $showDeleted = ($searchArray['showDeleted'] == 'true') ? true : false;
111
+        $showDeleted = ($searchArray['showDeleted'] == 'true') ? TRUE : FALSE;
112 112
         $query = $this->resultsFilter($query, $showDeleted);
113 113
         return $query;
114 114
 
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      * @param array Elasticsearch query array
120 120
      * @return array Elasticsearch queryFilter array
121 121
      */
122
-    public function resultsFilter($query, $showDeleted = false)
122
+    public function resultsFilter($query, $showDeleted = FALSE)
123 123
     {
124 124
 
125 125
         $queryFilter = array();
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             if ($searchResultsFilter['from']) {
147 147
 
148 148
                 $from     = date('d.m.Y', $searchResultsFilter['from']);
149
-                $dateTime = $this->convertFormDate($from, false);
149
+                $dateTime = $this->convertFormDate($from, FALSE);
150 150
                 $dateFilter['gte'] = $dateTime->format('Y-m-d');
151 151
                 unset($searchResultsFilter['from']);
152 152
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             if ($searchResultsFilter['till']) {
156 156
 
157 157
                 $till          = date('d.m.Y', $searchResultsFilter['till']);
158
-                $dateTime = $this->convertFormDate($till, true);
158
+                $dateTime = $this->convertFormDate($till, TRUE);
159 159
                 $dateFilter['lte'] = $dateTime->format('Y-m-d');
160 160
                 unset($searchResultsFilter['till']);
161 161
 
@@ -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
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
      * @param  bool      $intervalEnd Fills missing values with the maximum possible date if true
210 210
      * @return DateTime               Determined date
211 211
      */
212
-    public function convertFormDate($dateString, $intervalEnd = false)
212
+    public function convertFormDate($dateString, $intervalEnd = FALSE)
213 213
     {
214 214
         try {
215 215
             if (strlen($dateString) == 4) {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 return new \DateTime($dateString);
223 223
             }
224 224
         } catch (\Exception $_) {
225
-            return false;
225
+            return FALSE;
226 226
         }
227 227
     }
228 228
 
Please login to merge, or discard this patch.
Classes/Controller/AjaxBackofficeController.php 2 patches
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 /**
20 20
  * AjaxBackofficeController
21 21
  */
22
-class AjaxBackofficeController extends \EWW\Dpf\Controller\AbstractController
23
-{
22
+class AjaxBackofficeController extends \EWW\Dpf\Controller\AbstractController {
24 23
     /**
25 24
      * bookmarkRepository
26 25
      *
@@ -36,8 +35,7 @@  discard block
 block discarded – undo
36 35
      * @param string $identifier
37 36
      * @return bool
38 37
      */
39
-    public function addBookmarkAction($identifier)
40
-    {
38
+    public function addBookmarkAction($identifier) {
41 39
         /** @var \EWW\Dpf\Domain\Model\Bookmark $bookmark */
42 40
         $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier);
43 41
         if (!$bookmark) {
@@ -57,8 +55,7 @@  discard block
 block discarded – undo
57 55
      * @param string $identifier
58 56
      * @return bool
59 57
      */
60
-    public function removeBookmarkAction($identifier)
61
-    {
58
+    public function removeBookmarkAction($identifier) {
62 59
         /** @var \EWW\Dpf\Domain\Model\Bookmark $bookmark */
63 60
         $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier);
64 61
         if ($bookmark) {
@@ -75,8 +72,7 @@  discard block
 block discarded – undo
75 72
      * @param string $name
76 73
      * @param array $values
77 74
      */
78
-    public function addWorkspaceFilterAction($name, $values = [])
79
-    {
75
+    public function addWorkspaceFilterAction($name, $values = []) {
80 76
         if ($name && $values && is_array($values)) {
81 77
             $workspaceFilters = $this->getSessionData('workspaceFilters');
82 78
             if ($workspaceFilters && is_array($workspaceFilters)) {
@@ -103,8 +99,7 @@  discard block
 block discarded – undo
103 99
      * @param string $field
104 100
      * @param string $order
105 101
      */
106
-    public function addWorkspaceSortAction($field, $order)
107
-    {
102
+    public function addWorkspaceSortAction($field, $order) {
108 103
         $this->session->setWorkspaceSort($field, $order);
109 104
         return;
110 105
     }
@@ -113,8 +108,7 @@  discard block
 block discarded – undo
113 108
      * Toggles the filter to exclude discarded documents.
114 109
      *
115 110
      */
116
-    public function toggleWorkspaceExcludeDiscardedAction()
117
-    {
111
+    public function toggleWorkspaceExcludeDiscardedAction() {
118 112
         $this->session->toggleWorkspaceExcludeDiscardedFilter();
119 113
         return;
120 114
     }
@@ -123,8 +117,7 @@  discard block
 block discarded – undo
123 117
      * Toggles the filter to hide bookmarked documents.
124 118
      *
125 119
      */
126
-    public function toggleWorkspaceBookmarksOnlyAction()
127
-    {
120
+    public function toggleWorkspaceBookmarksOnlyAction() {
128 121
         $this->session->toggleWorkspaceBookmarksOnlyFilter();
129 122
         return;
130 123
     }
@@ -134,8 +127,7 @@  discard block
 block discarded – undo
134 127
      *
135 128
      * @param int $itemsPerPage
136 129
      */
137
-    public function setWorkspaceItemsPerPageAction($itemsPerPage)
138
-    {
130
+    public function setWorkspaceItemsPerPageAction($itemsPerPage) {
139 131
         $this->session->setWorkspaceItemsPerPage($itemsPerPage);
140 132
         return;
141 133
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @var \EWW\Dpf\Domain\Repository\BookmarkRepository
28 28
      * @inject
29 29
      */
30
-    protected $bookmarkRepository = null;
30
+    protected $bookmarkRepository = NULL;
31 31
 
32 32
 
33 33
     /**
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
             $bookmark->setDocumentIdentifier($identifier);
46 46
             $bookmark->setFeUserUid($this->security->getUser()->getUid());
47 47
             $this->bookmarkRepository->add($bookmark);
48
-            return true;
48
+            return TRUE;
49 49
         }
50 50
 
51
-        return false;
51
+        return FALSE;
52 52
     }
53 53
 
54 54
     /**
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
         $bookmark = $this->bookmarkRepository->findBookmark($this->security->getUser()->getUid(), $identifier);
64 64
         if ($bookmark) {
65 65
             $this->bookmarkRepository->remove($bookmark);
66
-            return true;
66
+            return TRUE;
67 67
         }
68 68
 
69
-        return false;
69
+        return FALSE;
70 70
     }
71 71
 
72 72
     /**
Please login to merge, or discard this patch.
Classes/Controller/AbstractController.php 2 patches
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
 use TYPO3\CMS\Core\Utility\GeneralUtility;
18 18
 use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
19 19
 
20
-abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
21
-{
20
+abstract class AbstractController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
22 21
     /**
23 22
      * authorizationChecker
24 23
      *
@@ -60,8 +59,7 @@  discard block
 block discarded – undo
60 59
     protected $session = null;
61 60
 
62 61
 
63
-    protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
64
-    {
62
+    protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view) {
65 63
         parent::initializeView($view);
66 64
 
67 65
         $client = $this->clientRepository->findAll()->current();
@@ -87,8 +85,7 @@  discard block
 block discarded – undo
87 85
      * @param string $key
88 86
      * @param string $data
89 87
      */
90
-    public function setSessionData($key, $data)
91
-    {
88
+    public function setSessionData($key, $data) {
92 89
         if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) {
93 90
 
94 91
             $userGlobals = $GLOBALS['TSFE']->fe_user;
@@ -111,8 +108,7 @@  discard block
 block discarded – undo
111 108
      *
112 109
      * @return
113 110
      */
114
-    public function getSessionData($key)
115
-    {
111
+    public function getSessionData($key) {
116 112
         if (!empty($GLOBALS['TSFE']) && is_object($GLOBALS['TSFE'])) {
117 113
 
118 114
             $userGlobals = $GLOBALS['TSFE']->fe_user;
@@ -133,8 +129,7 @@  discard block
 block discarded – undo
133 129
      *
134 130
      * @return null|string
135 131
      */
136
-    protected function getParametersSafely($parameterName)
137
-    {
132
+    protected function getParametersSafely($parameterName) {
138 133
         if ($this->request->hasArgument($parameterName)) {
139 134
             return $this->filterSafelyParameters($this->request->getArgument($parameterName));
140 135
         }
@@ -148,8 +143,7 @@  discard block
 block discarded – undo
148 143
      *
149 144
      * @return string
150 145
      */
151
-    protected function filterSafelyParameters($param)
152
-    {
146
+    protected function filterSafelyParameters($param) {
153 147
         if (is_array($param)) {
154 148
             foreach ($param as $key => $item) {
155 149
                 $param[$key] = $this->filterSafelyParameters($item);
@@ -160,8 +154,7 @@  discard block
 block discarded – undo
160 154
         }
161 155
     }
162 156
 
163
-    public function initializeAction()
164
-    {
157
+    public function initializeAction() {
165 158
         parent::initializeAction();
166 159
 
167 160
         $signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
@@ -169,13 +162,11 @@  discard block
 block discarded – undo
169 162
     }
170 163
 
171 164
 
172
-    public function getCurrentAction()
173
-    {
165
+    public function getCurrentAction() {
174 166
         return str_replace('Action', '', $this->actionMethodName);
175 167
     }
176 168
 
177
-    public function getCurrentController()
178
-    {
169
+    public function getCurrentController() {
179 170
         $controllerName = end(explode('\\', get_Class($this)));
180 171
         return str_replace('Controller', '', $controllerName);
181 172
     }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @var \EWW\Dpf\Security\AuthorizationChecker
26 26
      * @inject
27 27
      */
28
-    protected $authorizationChecker = null;
28
+    protected $authorizationChecker = NULL;
29 29
 
30 30
     /**
31 31
      * security
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @var \EWW\Dpf\Security\Security
34 34
      * @inject
35 35
      */
36
-    protected $security = null;
36
+    protected $security = NULL;
37 37
 
38 38
     /**
39 39
      * clientRepository
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @var \EWW\Dpf\Domain\Repository\ClientRepository
42 42
      * @inject
43 43
      */
44
-    protected $clientRepository = null;
44
+    protected $clientRepository = NULL;
45 45
 
46 46
     /**
47 47
      * signalSlotDispatcher
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @var \TYPO3\CMS\Extbase\SignalSlot\Dispatcher
50 50
      * @inject
51 51
      */
52
-    protected $signalSlotDispatcher = null;
52
+    protected $signalSlotDispatcher = NULL;
53 53
 
54 54
     /**
55 55
      * session
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @var \EWW\Dpf\Helper\Session
58 58
      * @inject
59 59
      */
60
-    protected $session = null;
60
+    protected $session = NULL;
61 61
 
62 62
 
63 63
     protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                 $message,
75 75
                 $messageTitle = '',
76 76
                 $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::WARNING,
77
-                $storeInSession = true
77
+                $storeInSession = TRUE
78 78
             );
79 79
         } else {
80 80
             $view->assign('client', $client);
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         if ($this->request->hasArgument($parameterName)) {
139 139
             return $this->filterSafelyParameters($this->request->getArgument($parameterName));
140 140
         }
141
-        return null;
141
+        return NULL;
142 142
     }
143 143
 
144 144
     /**
Please login to merge, or discard this patch.
Classes/Controller/DocumentFormBackofficeController.php 3 patches
Braces   +10 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
 
29 29
 use TYPO3\CMS\Extbase\Persistence\ObjectStorage;
30 30
 
31
-class DocumentFormBackofficeController extends AbstractDocumentFormController
32
-{
31
+class DocumentFormBackofficeController extends AbstractDocumentFormController {
33 32
     /**
34 33
      * documentTransferManager
35 34
      *
@@ -71,8 +70,7 @@  discard block
 block discarded – undo
71 70
     /**
72 71
      * DocumentController constructor.
73 72
      */
74
-    public function __construct()
75
-    {
73
+    public function __construct() {
76 74
         parent::__construct();
77 75
 
78 76
         $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
@@ -113,8 +111,7 @@  discard block
 block discarded – undo
113 111
      */
114 112
     public function editAction(
115 113
         \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = false, $activeFileTab = false
116
-    )
117
-    {
114
+    ) {
118 115
         /** @var \EWW\Dpf\Domain\Model\Document $document */
119 116
         $document = $this->documentRepository->findByUid($documentForm->getDocumentUid());
120 117
 
@@ -161,8 +158,7 @@  discard block
 block discarded – undo
161 158
      * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm
162 159
      * @param bool $restore
163 160
      */
164
-    public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE)
165
-    {
161
+    public function createSuggestionDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $restore = FALSE) {
166 162
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
167 163
 
168 164
         $hasFilesFlag = true;
@@ -234,8 +230,7 @@  discard block
 block discarded – undo
234 230
     }
235 231
 
236 232
 
237
-    public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm)
238
-    {
233
+    public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) {
239 234
         if ($this->request->getArgument('documentData')['suggestMod']) {
240 235
             $restore = $this->request->getArgument('documentData')['suggestRestore'];
241 236
             $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]);
@@ -268,8 +263,7 @@  discard block
 block discarded – undo
268 263
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
269 264
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
270 265
      */
271
-    public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null)
272
-    {
266
+    public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null) {
273 267
         try {
274 268
             /** @var \EWW\Dpf\Domain\Model\Document $document */
275 269
             $document = $this->documentRepository->findByUid($documentForm->getDocumentUid());
@@ -406,8 +400,7 @@  discard block
 block discarded – undo
406 400
         }
407 401
     }
408 402
 
409
-    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm)
410
-    {
403
+    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) {
411 404
         /** @var \EWW\Dpf\Helper\DocumentMapper $documentMapper */
412 405
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
413 406
 
@@ -473,8 +466,7 @@  discard block
 block discarded – undo
473 466
      *
474 467
      * @return void
475 468
      */
476
-    public function cancelEditAction($documentUid = 0, $documentList = false)
477
-    {
469
+    public function cancelEditAction($documentUid = 0, $documentList = false) {
478 470
         if ($documentList) {
479 471
             $this->redirectToDocumentList();
480 472
         }
@@ -487,8 +479,7 @@  discard block
 block discarded – undo
487 479
         }
488 480
     }
489 481
 
490
-    public function initializeAction()
491
-    {
482
+    public function initializeAction() {
492 483
         $this->authorizationChecker->denyAccessUnlessLoggedIn();
493 484
 
494 485
         parent::initializeAction();
@@ -502,8 +493,7 @@  discard block
 block discarded – undo
502 493
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
503 494
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
504 495
      */
505
-    protected function redirectToDocumentList($message = null)
506
-    {
496
+    protected function redirectToDocumentList($message = null) {
507 497
         list($action, $controller, $redirectUri) = $this->session->getListAction();
508 498
 
509 499
         if ($redirectUri) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      * @var \EWW\Dpf\Services\Document\EditingLockService
51 51
      * @inject
52 52
      */
53
-    protected $editingLockService = null;
53
+    protected $editingLockService = NULL;
54 54
 
55 55
     /**
56 56
      * documentManager
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      * @var \EWW\Dpf\Services\Document\DocumentManager
59 59
      * @inject
60 60
      */
61
-    protected $documentManager = null;
61
+    protected $documentManager = NULL;
62 62
 
63 63
     /**
64 64
      * bookmarkRepository
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @var \EWW\Dpf\Domain\Repository\BookmarkRepository
67 67
      * @inject
68 68
      */
69
-    protected $bookmarkRepository = null;
69
+    protected $bookmarkRepository = NULL;
70 70
 
71 71
     /**
72 72
      * DocumentController constructor.
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      * @return void
113 113
      */
114 114
     public function editAction(
115
-        \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = false, $activeFileTab = false
115
+        \EWW\Dpf\Domain\Model\DocumentForm $documentForm, bool $suggestMod = FALSE, $activeFileTab = FALSE
116 116
     )
117 117
     {
118 118
         /** @var \EWW\Dpf\Domain\Model\Document $document */
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             }
142 142
 
143 143
             $this->addFlashMessage($message, '', AbstractMessage::ERROR);
144
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
144
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
145 145
             return FALSE;
146 146
         }
147 147
 
@@ -165,18 +165,18 @@  discard block
 block discarded – undo
165 165
     {
166 166
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
167 167
 
168
-        $hasFilesFlag = true;
168
+        $hasFilesFlag = TRUE;
169 169
 
170 170
         $workingCopy = $this->documentRepository->findByUid($documentForm->getDocumentUid());
171 171
 
172 172
         if ($workingCopy->isTemporary()) {
173
-            $workingCopy->setTemporary(false);
173
+            $workingCopy->setTemporary(FALSE);
174 174
             // +++delete+++ $workingCopy->setEditorUid(0);
175 175
         }
176 176
 
177 177
         if (empty($workingCopy->getFileData())) {
178 178
             // no files are linked to the document
179
-            $hasFilesFlag = false;
179
+            $hasFilesFlag = FALSE;
180 180
         }
181 181
 
182 182
         $newDocument = $this->objectManager->get(Document::class);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
             $newDocument->setLinkedUid($document->getUid());
197 197
         }
198 198
 
199
-        $newDocument->setSuggestion(true);
199
+        $newDocument->setSuggestion(TRUE);
200 200
         $newDocument->setComment($document->getComment());
201 201
 
202 202
         if ($restore) {
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
             $newDocument->setCreator($this->security->getUser()->getUid());
225 225
             $this->documentRepository->add($newDocument);
226 226
             $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS;
227
-            $this->addFlashMessage("Success", '', $severity,false);
227
+            $this->addFlashMessage("Success", '', $severity,FALSE);
228 228
         } catch (\Throwable $t) {
229 229
             $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR;
230
-            $this->addFlashMessage("Failed", '', $severity,false);
230
+            $this->addFlashMessage("Failed", '', $severity,FALSE);
231 231
         }
232 232
 
233 233
         $this->redirectToDocumentList();
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
     {
239 239
         if ($this->request->getArgument('documentData')['suggestMod']) {
240 240
             $restore = $this->request->getArgument('documentData')['suggestRestore'];
241
-            $this->forward('createSuggestionDocument', null, null, ['documentForm' => $documentForm, 'restore' => $restore]);
241
+            $this->forward('createSuggestionDocument', NULL, NULL, ['documentForm' => $documentForm, 'restore' => $restore]);
242 242
         }
243 243
 
244 244
         if ($this->request->hasArgument('saveAndUpdate')) {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         } elseif ($this->request->hasArgument('saveWorkingCopy')) {
247 247
             $saveMode = 'saveWorkingCopy';
248 248
         } else {
249
-            $saveMode = null;
249
+            $saveMode = NULL;
250 250
         }
251 251
 
252 252
         $this->forward(
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
269 269
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
270 270
      */
271
-    public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = null)
271
+    public function updateDocumentAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm, $saveMode = NULL)
272 272
     {
273 273
         try {
274 274
             /** @var \EWW\Dpf\Domain\Model\Document $document */
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
                 $this->addFlashMessage($message, '', AbstractMessage::ERROR);
287 287
                 $this->redirect(
288 288
                     'showDetails', 'Document',
289
-                    null, ['document' => $document]
289
+                    NULL, ['document' => $document]
290 290
                 );
291 291
             }
292 292
 
@@ -296,13 +296,13 @@  discard block
 block discarded – undo
296 296
             /** @var \EWW\Dpf\Domain\Model\Document $updateDocument */
297 297
             $updateDocument = $documentMapper->getDocument($documentForm);
298 298
 
299
-            $saveWorkingCopy = false;
300
-            $workflowTransition = null;
299
+            $saveWorkingCopy = FALSE;
300
+            $workflowTransition = NULL;
301 301
 
302 302
             // Convert the temporary copy into a local working copy if needed.
303 303
             if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') {
304
-                $saveWorkingCopy = true;
305
-                $updateDocument->setTemporary(false);
304
+                $saveWorkingCopy = TRUE;
305
+                $updateDocument->setTemporary(FALSE);
306 306
                 $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS;
307 307
             } elseif ($updateDocument->isTemporaryCopy() && $saveMode == 'saveAndUpdate') {
308 308
                 $workflowTransition = DocumentWorkflow::TRANSITION_REMOTE_UPDATE;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
             if ($workflowTransition && $workflowTransition === DocumentWorkflow::TRANSITION_REMOTE_UPDATE) {
379 379
                 $this->redirectToDocumentList();
380 380
             } else {
381
-                $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]);
381
+                $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]);
382 382
             }
383 383
         } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) {
384 384
             // A redirect always throws this exception, but in this case, however,
@@ -401,8 +401,8 @@  discard block
 block discarded – undo
401 401
 
402 402
             $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf');
403 403
 
404
-            $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,true);
405
-            $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]);
404
+            $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,TRUE);
405
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $updateDocument]);
406 406
         }
407 407
     }
408 408
 
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
             $args[] = $document->getTitle();
420 420
             $message = LocalizationUtility::translate($key, 'dpf', $args);
421 421
             $this->addFlashMessage($message, '', AbstractMessage::ERROR);
422
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
422
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
423 423
             return FALSE;
424 424
         }
425 425
 
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
                 $message,
434 434
                 '',
435 435
                 $severity,
436
-                true
436
+                TRUE
437 437
             );
438 438
 
439 439
         } catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
                 implode(" ", $message),
456 456
                 '',
457 457
                 $severity,
458
-                true
458
+                TRUE
459 459
             );
460 460
         }
461 461
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      *
474 474
      * @return void
475 475
      */
476
-    public function cancelEditAction($documentUid = 0, $documentList = false)
476
+    public function cancelEditAction($documentUid = 0, $documentList = FALSE)
477 477
     {
478 478
         if ($documentList) {
479 479
             $this->redirectToDocumentList();
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
             /** @var $document \EWW\Dpf\Domain\Model\Document */
484 484
             $document = $this->documentRepository->findByUid($documentUid);
485 485
 
486
-            $this->redirect('showDetails', 'Document', null, ['document' => $document]);
486
+            $this->redirect('showDetails', 'Document', NULL, ['document' => $document]);
487 487
         }
488 488
     }
489 489
 
@@ -502,14 +502,14 @@  discard block
 block discarded – undo
502 502
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
503 503
      * @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
504 504
      */
505
-    protected function redirectToDocumentList($message = null)
505
+    protected function redirectToDocumentList($message = NULL)
506 506
     {
507 507
         list($action, $controller, $redirectUri) = $this->session->getListAction();
508 508
 
509 509
         if ($redirectUri) {
510 510
             $this->redirectToUri($redirectUri);
511 511
         } else {
512
-            $this->redirect($action, $controller, null, array('message' => $message));;
512
+            $this->redirect($action, $controller, NULL, array('message' => $message));;
513 513
         }
514 514
     }
515 515
 
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     }
83 83
 
84 84
     public function arrayRecursiveDiff($aArray1, $aArray2) {
85
-        $aReturn = array();
85
+        $aReturn = array ();
86 86
 
87 87
         foreach ($aArray1 as $mKey => $mValue) {
88 88
             if (array_key_exists($mKey, $aArray2)) {
@@ -130,13 +130,13 @@  discard block
 block discarded – undo
130 130
                 $message = LocalizationUtility::translate(
131 131
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.accessDenied',
132 132
                     'dpf',
133
-                    array($document->getTitle())
133
+                    array ($document->getTitle())
134 134
                 );
135 135
             } else {
136 136
                 $message = LocalizationUtility::translate(
137 137
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_edit.failureBlocked',
138 138
                     'dpf',
139
-                    array($document->getTitle())
139
+                    array ($document->getTitle())
140 140
                 );
141 141
             }
142 142
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $this->view->assign('suggestMod', $suggestMod);
150 150
 
151 151
         $this->editingLockService->lock(
152
-            ($document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid()),
152
+            ($document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid()),
153 153
             $this->security->getUser()->getUid()
154 154
         );
155 155
 
@@ -224,10 +224,10 @@  discard block
 block discarded – undo
224 224
             $newDocument->setCreator($this->security->getUser()->getUid());
225 225
             $this->documentRepository->add($newDocument);
226 226
             $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::SUCCESS;
227
-            $this->addFlashMessage("Success", '', $severity,false);
227
+            $this->addFlashMessage("Success", '', $severity, false);
228 228
         } catch (\Throwable $t) {
229 229
             $severity = \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR;
230
-            $this->addFlashMessage("Failed", '', $severity,false);
230
+            $this->addFlashMessage("Failed", '', $severity, false);
231 231
         }
232 232
 
233 233
         $this->redirectToDocumentList();
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 $message = LocalizationUtility::translate(
285 285
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.accessDenied',
286 286
                     'dpf',
287
-                    array($document->getTitle())
287
+                    array ($document->getTitle())
288 288
                 );
289 289
                 $this->addFlashMessage($message, '', AbstractMessage::ERROR);
290 290
                 $this->redirect(
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
             $workflowTransition = null;
304 304
 
305 305
             // Convert the temporary copy into a local working copy if needed.
306
-            if ( $updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') {
306
+            if ($updateDocument->isTemporaryCopy() && $saveMode == 'saveWorkingCopy') {
307 307
                 $saveWorkingCopy = true;
308 308
                 $updateDocument->setTemporary(false);
309 309
                 $workflowTransition = DocumentWorkflow::TRANSITION_IN_PROGRESS;
@@ -326,19 +326,19 @@  discard block
 block discarded – undo
326 326
                 $message = LocalizationUtility::translate(
327 327
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.success',
328 328
                     'dpf',
329
-                    array($updateDocument->getTitle())
329
+                    array ($updateDocument->getTitle())
330 330
                 );
331 331
                 $this->addFlashMessage($message, '', AbstractMessage::OK);
332 332
 
333 333
                 if ($this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN) {
334 334
                     if ($saveWorkingCopy) {
335
-                        if(
335
+                        if (
336 336
                             $this->bookmarkRepository->addBookmark(
337 337
                                 $this->security->getUser()->getUid(), $updateDocument
338 338
                             )
339 339
                         ) {
340 340
                             $this->addFlashMessage(
341
-                                LocalizationUtility::translate("manager.workspace.bookmarkAdded","dpf"), '',
341
+                                LocalizationUtility::translate("manager.workspace.bookmarkAdded", "dpf"), '',
342 342
                                 AbstractMessage::INFO
343 343
                             );
344 344
                         }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                                     )
358 358
                                 ) {
359 359
                                     $this->addFlashMessage(
360
-                                        LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular","dpf"), '',
360
+                                        LocalizationUtility::translate("manager.workspace.bookmarkRemoved.singular", "dpf"), '',
361 361
                                         AbstractMessage::INFO
362 362
                                     );
363 363
                                 }
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
                 $message = LocalizationUtility::translate(
374 374
                     'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure',
375 375
                     'dpf',
376
-                    array($updateDocument->getTitle())
376
+                    array ($updateDocument->getTitle())
377 377
                 );
378 378
                 $this->addFlashMessage($message, '', AbstractMessage::ERROR);
379 379
             }
@@ -399,12 +399,12 @@  discard block
 block discarded – undo
399 399
             $exceptionMsg[] = LocalizationUtility::translate(
400 400
                 'LLL:EXT:dpf/Resources/Private/Language/locallang.xlf:document_update.failure',
401 401
                 'dpf',
402
-                array($updateDocument->getTitle())
402
+                array ($updateDocument->getTitle())
403 403
             );
404 404
 
405 405
             $exceptionMsg[] = LocalizationUtility::translate($key, 'dpf');
406 406
 
407
-            $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity,true);
407
+            $this->addFlashMessage(implode(" ", $exceptionMsg), '', $severity, true);
408 408
             $this->redirect('showDetails', 'Document', null, ['document' => $updateDocument]);
409 409
         }
410 410
     }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
         if ($redirectUri) {
513 513
             $this->redirectToUri($redirectUri);
514 514
         } else {
515
-            $this->redirect($action, $controller, null, array('message' => $message));;
515
+            $this->redirect($action, $controller, null, array ('message' => $message)); ;
516 516
         }
517 517
     }
518 518
 
Please login to merge, or discard this patch.
Classes/Security/Security.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@  discard block
 block discarded – undo
14 14
  * The TYPO3 project - inspiring people to share!
15 15
  */
16 16
 
17
-class Security
18
-{
17
+class Security {
19 18
     /**
20 19
      * frontendUserRepository
21 20
      *
@@ -43,8 +42,7 @@  discard block
 block discarded – undo
43 42
      *
44 43
      * @return null|\EWW\Dpf\Domain\Model\FrontendUser
45 44
      */
46
-    public function getUser()
47
-    {
45
+    public function getUser() {
48 46
         $user = $GLOBALS['TSFE']->fe_user->user;
49 47
         if (!empty($user) && is_array($user) && array_key_exists('uid', $user)) {
50 48
             return $this->frontendUserRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
      * @var \EWW\Dpf\Domain\Repository\FrontendUserRepository
23 23
      * @inject
24 24
      */
25
-    protected $frontendUserRepository = null;
25
+    protected $frontendUserRepository = NULL;
26 26
 
27 27
     const ROLE_ANONYMOUS = "ROLE_ANONYMOUS";
28 28
     const ROLE_RESEARCHER = "ROLE_RESEARCHER";
Please login to merge, or discard this patch.
Classes/Security/DocumentVoter.php 4 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
     public function __construct()
66 66
     {
67
-       $this->workflow = DocumentWorkflow::getWorkflow();
67
+        $this->workflow = DocumentWorkflow::getWorkflow();
68 68
     }
69 69
 
70 70
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) &&
310 310
             $document->getCreator() === $this->security->getUser()->getUid()
311 311
         ) {
312
-           return TRUE;
312
+            return TRUE;
313 313
         }
314 314
 
315 315
         return FALSE;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     const CREATE = "DOCUMENT_CREATE";
26 26
     const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER";
27 27
     const UPDATE = "DOCUMENT_UPDATE";
28
-    const LIST = "DOCUMENT_LIST";
28
+    const list = "DOCUMENT_LIST";
29 29
     const LIST_REGISTERED = "DOCUMENT_LIST_REGISTERED";
30 30
     const LIST_IN_PROGRESS = "DOCUMENT_LIST_IN_PROGRESS";
31 31
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      * @var \EWW\Dpf\Services\Document\EditingLockService
54 54
      * @inject
55 55
      */
56
-    protected $editingLockService = null;
56
+    protected $editingLockService = NULL;
57 57
 
58 58
     /**
59 59
      * workflow
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             self::CREATE,
80 80
             self::CREATE_REGISTER,
81 81
             self::UPDATE,
82
-            self::LIST,
82
+            self::list,
83 83
             self::LIST_REGISTERED,
84 84
             self::LIST_IN_PROGRESS,
85 85
             self::DISCARD,
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                 return $this->canUpdate($subject);
150 150
                 break;
151 151
 
152
-            case self::LIST:
152
+            case self::list:
153 153
                 return $this->defaultAccess();
154 154
                 break;
155 155
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             );
451 451
         }
452 452
 
453
-        return false;
453
+        return FALSE;
454 454
     }
455 455
 
456 456
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      */
76 76
     protected static function getAttributes()
77 77
     {
78
-        return array(
78
+        return array (
79 79
             self::CREATE,
80 80
             self::CREATE_REGISTER,
81 81
             self::UPDATE,
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
     {
462 462
         if ($this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER) {
463 463
 
464
-            $objectManager =GeneralUtility::makeInstance(ObjectManager::class);
464
+            $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
465 465
             $documentRepository = $objectManager->get(DocumentRepository::class);
466 466
 
467 467
             $linkedDocument = $documentRepository->findOneByLinkedUid($document->getUid());
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
      */
562 562
     protected function isDocumentLocked($document)
563 563
     {
564
-        $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid();
564
+        $identifier = $document->getObjectIdentifier() ? $document->getObjectIdentifier() : $document->getUid();
565 565
         return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid());
566 566
     }
567 567
 
Please login to merge, or discard this patch.
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
 use TYPO3\CMS\Core\Utility\GeneralUtility;
21 21
 use EWW\Dpf\Domain\Repository\DocumentRepository;
22 22
 
23
-class DocumentVoter extends Voter
24
-{
23
+class DocumentVoter extends Voter {
25 24
     const CREATE = "DOCUMENT_CREATE";
26 25
     const CREATE_REGISTER = "DOCUMENT_CREATE_REGISTER";
27 26
     const UPDATE = "DOCUMENT_UPDATE";
@@ -62,8 +61,7 @@  discard block
 block discarded – undo
62 61
      */
63 62
     protected $workflow;
64 63
 
65
-    public function __construct()
66
-    {
64
+    public function __construct() {
67 65
        $this->workflow = DocumentWorkflow::getWorkflow();
68 66
     }
69 67
 
@@ -73,8 +71,7 @@  discard block
 block discarded – undo
73 71
      *
74 72
      * @return array
75 73
      */
76
-    protected static function getAttributes()
77
-    {
74
+    protected static function getAttributes() {
78 75
         return array(
79 76
             self::CREATE,
80 77
             self::CREATE_REGISTER,
@@ -109,8 +106,7 @@  discard block
 block discarded – undo
109 106
      * @param mixed $subject
110 107
      * @return mixed
111 108
      */
112
-    public static function supports($attribute, $subject = NULL)
113
-    {
109
+    public static function supports($attribute, $subject = NULL) {
114 110
         if (!in_array($attribute, self::getAttributes())) {
115 111
             return FALSE;
116 112
         }
@@ -129,8 +125,7 @@  discard block
 block discarded – undo
129 125
      * @param mixed $subject
130 126
      * @return mixed
131 127
      */
132
-    public function voteOnAttribute($attribute, $subject = NULL)
133
-    {
128
+    public function voteOnAttribute($attribute, $subject = NULL) {
134 129
         if (!$subject instanceof Document) {
135 130
             return FALSE;
136 131
         }
@@ -232,8 +227,7 @@  discard block
 block discarded – undo
232 227
     /**
233 228
      * @return bool
234 229
      */
235
-    protected function defaultAccess()
236
-    {
230
+    protected function defaultAccess() {
237 231
         return (
238 232
             $this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN ||
239 233
             $this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER
@@ -243,8 +237,7 @@  discard block
 block discarded – undo
243 237
     /**
244 238
      * @return bool
245 239
      */
246
-    protected function librarianOnly()
247
-    {
240
+    protected function librarianOnly() {
248 241
         return $this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN;
249 242
     }
250 243
 
@@ -252,8 +245,7 @@  discard block
 block discarded – undo
252 245
      * @param \EWW\Dpf\Domain\Model\Document $document
253 246
      * @return bool
254 247
      */
255
-    protected function canDiscard($document)
256
-    {
248
+    protected function canDiscard($document) {
257 249
         if ($this->isDocumentLocked($document)) {
258 250
             return FALSE;
259 251
         }
@@ -276,8 +268,7 @@  discard block
 block discarded – undo
276 268
      * @param \EWW\Dpf\Domain\Model\Document $document
277 269
      * @return bool
278 270
      */
279
-    protected function canShowDetails($document)
280
-    {
271
+    protected function canShowDetails($document) {
281 272
         if ($this->security->getUser()->getUserRole() === Security::ROLE_LIBRARIAN) {
282 273
             return (
283 274
                 $document->getState() !== DocumentWorkflow::STATE_NEW_NONE ||
@@ -303,8 +294,7 @@  discard block
 block discarded – undo
303 294
      * @param \EWW\Dpf\Domain\Model\Document $document
304 295
      * @return bool
305 296
      */
306
-    protected function canRegister($document)
307
-    {
297
+    protected function canRegister($document) {
308 298
         if (
309 299
             $this->workflow->can($document, \EWW\Dpf\Domain\Workflow\DocumentWorkflow::TRANSITION_REGISTER) &&
310 300
             $document->getCreator() === $this->security->getUser()->getUid()
@@ -320,8 +310,7 @@  discard block
 block discarded – undo
320 310
      * @param \EWW\Dpf\Domain\Model\Document $document
321 311
      * @return bool
322 312
      */
323
-    protected function canReleasePublish($document)
324
-    {
313
+    protected function canReleasePublish($document) {
325 314
         if ($this->isDocumentLocked($document)) {
326 315
             return FALSE;
327 316
         }
@@ -339,8 +328,7 @@  discard block
 block discarded – undo
339 328
      * @param \EWW\Dpf\Domain\Model\Document $document
340 329
      * @return bool
341 330
      */
342
-    protected function canReleaseActivate($document)
343
-    {
331
+    protected function canReleaseActivate($document) {
344 332
         if ($this->isDocumentLocked($document)) {
345 333
             return FALSE;
346 334
         }
@@ -357,8 +345,7 @@  discard block
 block discarded – undo
357 345
      * @param \EWW\Dpf\Domain\Model\Document $document
358 346
      * @return bool
359 347
      */
360
-    protected function canDeleteLocally($document)
361
-    {
348
+    protected function canDeleteLocally($document) {
362 349
         if ($this->isDocumentLocked($document)) {
363 350
             return FALSE;
364 351
         }
@@ -383,8 +370,7 @@  discard block
 block discarded – undo
383 370
      * @param \EWW\Dpf\Domain\Model\Document $document
384 371
      * @return bool
385 372
      */
386
-    protected function canDeleteWorkingCopy($document)
387
-    {
373
+    protected function canDeleteWorkingCopy($document) {
388 374
         if ($document->isTemporary() || $this->isDocumentLocked($document)) {
389 375
             return FALSE;
390 376
         }
@@ -401,8 +387,7 @@  discard block
 block discarded – undo
401 387
      * @param \EWW\Dpf\Domain\Model\Document $document
402 388
      * @return bool
403 389
      */
404
-    protected function canEdit($document)
405
-    {
390
+    protected function canEdit($document) {
406 391
         if ($this->isDocumentLocked($document)) {
407 392
             return FALSE;
408 393
         }
@@ -429,8 +414,7 @@  discard block
 block discarded – undo
429 414
      * @param \EWW\Dpf\Domain\Model\Document $document
430 415
      * @return bool
431 416
      */
432
-    protected function canUpdate($document)
433
-    {
417
+    protected function canUpdate($document) {
434 418
         if ($this->isDocumentLocked($document)) {
435 419
             return FALSE;
436 420
         }
@@ -457,8 +441,7 @@  discard block
 block discarded – undo
457 441
      * @param \EWW\Dpf\Domain\Model\Document $document
458 442
      * @return bool
459 443
      */
460
-    protected function canSuggestRestore($document)
461
-    {
444
+    protected function canSuggestRestore($document) {
462 445
         if ($this->security->getUser()->getUserRole() === Security::ROLE_RESEARCHER) {
463 446
 
464 447
             $objectManager =GeneralUtility::makeInstance(ObjectManager::class);
@@ -483,8 +466,7 @@  discard block
 block discarded – undo
483 466
      * @param \EWW\Dpf\Domain\Model\Document $document
484 467
      * @return bool
485 468
      */
486
-    protected function canSuggestModification($document)
487
-    {
469
+    protected function canSuggestModification($document) {
488 470
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
489 471
         $documentRepository = $objectManager->get(DocumentRepository::class);
490 472
 
@@ -513,8 +495,7 @@  discard block
 block discarded – undo
513 495
      * @param \EWW\Dpf\Domain\Model\Document $document
514 496
      * @return bool
515 497
      */
516
-    protected function canSuggestionAccept($document)
517
-    {
498
+    protected function canSuggestionAccept($document) {
518 499
         // TODO: What if a document should be restored?
519 500
 
520 501
         return $this->librarianOnly();
@@ -524,8 +505,7 @@  discard block
 block discarded – undo
524 505
      * @param \EWW\Dpf\Domain\Model\Document $document
525 506
      * @return bool
526 507
      */
527
-    protected function canPostpone($document)
528
-    {
508
+    protected function canPostpone($document) {
529 509
         if ($this->isDocumentLocked($document)) {
530 510
             return FALSE;
531 511
         }
@@ -542,8 +522,7 @@  discard block
 block discarded – undo
542 522
      * @param \EWW\Dpf\Domain\Model\Document $document
543 523
      * @return bool
544 524
      */
545
-    protected function canCreateRegister($document)
546
-    {
525
+    protected function canCreateRegister($document) {
547 526
         if ($this->security->getUser()->getUserRole()) {
548 527
             return FALSE;
549 528
         }
@@ -559,8 +538,7 @@  discard block
 block discarded – undo
559 538
      * @param \EWW\Dpf\Domain\Model\Document $document
560 539
      * @return bool
561 540
      */
562
-    protected function isDocumentLocked($document)
563
-    {
541
+    protected function isDocumentLocked($document) {
564 542
         $identifier = $document->getObjectIdentifier()? $document->getObjectIdentifier() : $document->getUid();
565 543
         return $this->editingLockService->isLocked($identifier, $this->security->getUser()->getUid());
566 544
     }
Please login to merge, or discard this patch.