Passed
Push — master ( c8bbb4...290e8c )
by Ralf
02:24 queued 10s
created
Classes/Controller/DocumentFormBEController.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -16,17 +16,14 @@  discard block
 block discarded – undo
16 16
 
17 17
 use EWW\Dpf\Services\Transfer\ElasticsearchRepository;
18 18
 
19
-class DocumentFormBEController extends AbstractDocumentFormController
20
-{
19
+class DocumentFormBEController extends AbstractDocumentFormController {
21 20
 
22
-    public function __construct()
23
-    {
21
+    public function __construct() {
24 22
         parent::__construct();
25 23
 
26 24
     }
27 25
 
28
-    protected function redirectToList($message = null)
29
-    {
26
+    protected function redirectToList($message = null) {
30 27
         $this->redirect('list', 'Document', null, array('message' => $message));
31 28
     }
32 29
 
@@ -36,8 +33,7 @@  discard block
 block discarded – undo
36 33
      * @param array $documentData
37 34
      * @throws \Exception
38 35
      */
39
-    public function deleteAction($documentData)
40
-    {
36
+    public function deleteAction($documentData) {
41 37
 
42 38
         if (!$GLOBALS['BE_USER']) {
43 39
             throw new \Exception('Access denied');
@@ -55,8 +51,7 @@  discard block
 block discarded – undo
55 51
         $this->redirectToList();
56 52
     }
57 53
 
58
-    public function editAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm)
59
-    {
54
+    public function editAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) {
60 55
 
61 56
         $document = $this->documentRepository->findByUid($documentForm->getDocumentUid());
62 57
         $this->view->assign('document', $document);
@@ -64,8 +59,7 @@  discard block
 block discarded – undo
64 59
     }
65 60
 
66 61
 
67
-    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm)
68
-    {
62
+    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) {
69 63
         parent::createAction($newDocumentForm);
70 64
         $this->redirectToList('CREATE_OK');
71 65
     }
Please login to merge, or discard this patch.
Classes/Controller/DocumentFormController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     protected function redirectToList($message = null)
21 21
     {
22
-        $this->redirect('list', 'DocumentForm', null, array('message' => $message));
22
+        $this->redirect('list', 'DocumentForm', null, array ('message' => $message));
23 23
     }
24 24
 
25 25
     /**
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
         parent::createAction($newDocumentForm);
44 44
 
45
-        if (key_exists('afterDocSavedRedirectPage',$this->settings) && $this->settings['afterDocSavedRedirectPage']) {
45
+        if (key_exists('afterDocSavedRedirectPage', $this->settings) && $this->settings['afterDocSavedRedirectPage']) {
46 46
             $uri = $this->uriBuilder
47 47
                 ->setTargetPageUid($this->settings['afterDocSavedRedirectPage'])
48 48
                 ->build();
Please login to merge, or discard this patch.
Classes/Controller/AbstractDocumentFormController.php 3 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -87,13 +87,13 @@  discard block
 block discarded – undo
87 87
 
88 88
         $documentTypes = $this->documentTypeRepository->findAll();
89 89
 
90
-        $data = array();
91
-        $docTypes = array();
92
-        $name = array();
93
-        $type = array();
90
+        $data = array ();
91
+        $docTypes = array ();
92
+        $name = array ();
93
+        $type = array ();
94 94
 
95 95
         foreach ($documentTypes as $docType) {
96
-            $data[] = array(
96
+            $data[] = array (
97 97
                 "name" => $docType->getDisplayName(),
98 98
                 "type" => $docType,
99 99
             );
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
                 $this->request->setArguments($requestArguments);
198 198
             } else {
199 199
                 $t = $docForm->getNewFileNames();
200
-                $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
200
+                $this->redirect('list', 'DocumentForm', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
201 201
             }
202 202
         } else {
203 203
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             $tmpDocument->setSlubInfoData($newDocument->getSlubInfoData());
254 254
             $tmpDocument->setDocumentType($newDocument->getDocumentType());
255 255
 
256
-            $this->forward('new', null, null, array('newDocumentForm' => $documentMapper->getDocumentForm($tmpDocument)));
256
+            $this->forward('new', null, null, array ('newDocumentForm' => $documentMapper->getDocumentForm($tmpDocument)));
257 257
         }
258 258
 
259 259
     }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
                 $this->request->setArguments($requestArguments);
310 310
             } else {
311 311
                 $t = $docForm->getNewFileNames();
312
-                $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
312
+                $this->redirect('list', 'Document', null, array ('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
313 313
             }
314 314
         } else {
315 315
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $elasticsearchRepository->add($updateDocument, $json);
363 363
 
364 364
         if (array_key_exists('savecontinue', $requestArguments)) {
365
-            $this->forward('edit', null, null, array('documentForm' => $documentForm));
365
+            $this->forward('edit', null, null, array ('documentForm' => $documentForm));
366 366
         }
367 367
 
368 368
         $this->redirectToList();
Please login to merge, or discard this patch.
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
 /**
25 25
  * DocumentFormController
26 26
  */
27
-abstract class AbstractDocumentFormController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
28
-{
27
+abstract class AbstractDocumentFormController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
29 28
 
30 29
     /**
31 30
      * documentRepository
@@ -80,8 +79,7 @@  discard block
 block discarded – undo
80 79
      *
81 80
      * @return void
82 81
      */
83
-    public function listAction()
84
-    {
82
+    public function listAction() {
85 83
 
86 84
         $documents = $this->documentRepository->findAll();
87 85
 
@@ -130,8 +128,7 @@  discard block
 block discarded – undo
130 128
      * @param \EWW\Dpf\Domain\Model\Document $document
131 129
      * @return void
132 130
      */
133
-    public function showAction(\EWW\Dpf\Domain\Model\Document $document)
134
-    {
131
+    public function showAction(\EWW\Dpf\Domain\Model\Document $document) {
135 132
 
136 133
         $this->view->assign('document', $document);
137 134
     }
@@ -141,8 +138,7 @@  discard block
 block discarded – undo
141 138
      *
142 139
      * @return void
143 140
      */
144
-    public function initializeNewAction()
145
-    {
141
+    public function initializeNewAction() {
146 142
 
147 143
         $requestArguments = $this->request->getArguments();
148 144
 
@@ -170,13 +166,11 @@  discard block
 block discarded – undo
170 166
      * @ignorevalidation $newDocumentForm
171 167
      * @return void
172 168
      */
173
-    public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null)
174
-    {
169
+    public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null) {
175 170
         $this->view->assign('documentForm', $newDocumentForm);
176 171
     }
177 172
 
178
-    public function initializeCreateAction()
179
-    {
173
+    public function initializeCreateAction() {
180 174
 
181 175
         $requestArguments = $this->request->getArguments();
182 176
 
@@ -210,8 +204,7 @@  discard block
 block discarded – undo
210 204
      * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm
211 205
      * @return void
212 206
      */
213
-    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm)
214
-    {
207
+    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm) {
215 208
 
216 209
         $documentMapper = $this->objectManager->get(DocumentMapper::class);
217 210
         $newDocument    = $documentMapper->getDocument($newDocumentForm);
@@ -258,8 +251,7 @@  discard block
 block discarded – undo
258 251
 
259 252
     }
260 253
 
261
-    public function initializeEditAction()
262
-    {
254
+    public function initializeEditAction() {
263 255
 
264 256
         $requestArguments = $this->request->getArguments();
265 257
 
@@ -283,13 +275,11 @@  discard block
 block discarded – undo
283 275
      * @ignorevalidation $documentForm
284 276
      * @return void
285 277
      */
286
-    public function editAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm)
287
-    {
278
+    public function editAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) {
288 279
         $this->view->assign('documentForm', $documentForm);
289 280
     }
290 281
 
291
-    public function initializeUpdateAction()
292
-    {
282
+    public function initializeUpdateAction() {
293 283
         $requestArguments = $this->request->getArguments();
294 284
 
295 285
         if ($this->request->hasArgument('documentData')) {
@@ -322,8 +312,7 @@  discard block
 block discarded – undo
322 312
      * @param \EWW\Dpf\Domain\Model\DocumentForm $documentForm
323 313
      * @return void
324 314
      */
325
-    public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm)
326
-    {
315
+    public function updateAction(\EWW\Dpf\Domain\Model\DocumentForm $documentForm) {
327 316
 
328 317
         $requestArguments = $this->request->getArguments();
329 318
 
@@ -373,18 +362,15 @@  discard block
 block discarded – undo
373 362
      *
374 363
      * @return void
375 364
      */
376
-    public function cancelAction()
377
-    {
365
+    public function cancelAction() {
378 366
         $this->redirectToList();
379 367
     }
380 368
 
381
-    public function initializeAction()
382
-    {
369
+    public function initializeAction() {
383 370
         parent::initializeAction();
384 371
     }
385 372
 
386
-    protected function redirectToList($message = null)
387
-    {
373
+    protected function redirectToList($message = null) {
388 374
         $this->redirect('list');
389 375
     }
390 376
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @var \EWW\Dpf\Domain\Repository\DocumentRepository
34 34
      * @inject
35 35
      */
36
-    protected $documentRepository = null;
36
+    protected $documentRepository = NULL;
37 37
 
38 38
     /**
39 39
      * fileRepository
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @var \EWW\Dpf\Domain\Repository\FileRepository
42 42
      * @inject
43 43
      */
44
-    protected $fileRepository = null;
44
+    protected $fileRepository = NULL;
45 45
 
46 46
     /**
47 47
      * documentTypeRepository
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
      * @var \EWW\Dpf\Domain\Repository\DocumentTypeRepository
50 50
      * @inject
51 51
      */
52
-    protected $documentTypeRepository = null;
52
+    protected $documentTypeRepository = NULL;
53 53
 
54 54
     /**
55 55
      * metadataGroupRepository
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @var \EWW\Dpf\Domain\Repository\MetadataGroupRepository
58 58
      * @inject
59 59
      */
60
-    protected $metadataGroupRepository = null;
60
+    protected $metadataGroupRepository = NULL;
61 61
 
62 62
     /**
63 63
      * metadataObjectRepository
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      * @var \EWW\Dpf\Domain\Repository\MetadataObjectRepository
66 66
      * @inject
67 67
      */
68
-    protected $metadataObjectRepository = null;
68
+    protected $metadataObjectRepository = NULL;
69 69
 
70 70
     /**
71 71
      * persistence manager
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
      * @ignorevalidation $newDocumentForm
171 171
      * @return void
172 172
      */
173
-    public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = null)
173
+    public function newAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm = NULL)
174 174
     {
175 175
         $this->view->assign('documentForm', $newDocumentForm);
176 176
     }
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
             $documentType = $this->documentTypeRepository->findByUid($docTypeUid);
194 194
             $virtual = $documentType->getVirtual();
195 195
 
196
-            if (!$formDataReader->uploadError() || $virtual === true) {
196
+            if (!$formDataReader->uploadError() || $virtual === TRUE) {
197 197
                 $this->request->setArguments($requestArguments);
198 198
             } else {
199 199
                 $t = $docForm->getNewFileNames();
200
-                $this->redirect('list', 'DocumentForm', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
200
+                $this->redirect('list', 'DocumentForm', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
201 201
             }
202 202
         } else {
203 203
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
             $tmpDocument->setSlubInfoData($newDocument->getSlubInfoData());
254 254
             $tmpDocument->setDocumentType($newDocument->getDocumentType());
255 255
 
256
-            $this->forward('new', null, null, array('newDocumentForm' => $documentMapper->getDocumentForm($tmpDocument)));
256
+            $this->forward('new', NULL, NULL, array('newDocumentForm' => $documentMapper->getDocumentForm($tmpDocument)));
257 257
         }
258 258
 
259 259
     }
@@ -305,11 +305,11 @@  discard block
 block discarded – undo
305 305
             $documentType = $this->documentTypeRepository->findByUid($docTypeUid);
306 306
             $virtual = $documentType->getVirtual();
307 307
 
308
-            if (!$formDataReader->uploadError() || $virtual === true) {
308
+            if (!$formDataReader->uploadError() || $virtual === TRUE) {
309 309
                 $this->request->setArguments($requestArguments);
310 310
             } else {
311 311
                 $t = $docForm->getNewFileNames();
312
-                $this->redirect('list', 'Document', null, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
312
+                $this->redirect('list', 'Document', NULL, array('message' => 'UPLOAD_MAX_FILESIZE_ERROR', 'errorFiles' => $t));
313 313
             }
314 314
         } else {
315 315
             $this->redirectToList("UPLOAD_POST_SIZE_ERROR");
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
         $objectIdentifier = $updateDocument->getObjectIdentifier();
334 334
 
335
-        $updateDocument->setChanged(true);
335
+        $updateDocument->setChanged(TRUE);
336 336
 
337 337
         $this->documentRepository->update($updateDocument);
338 338
 
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
         $elasticsearchRepository->add($updateDocument, $json);
363 363
 
364 364
         if (array_key_exists('savecontinue', $requestArguments)) {
365
-            $this->forward('edit', null, null, array('documentForm' => $documentForm));
365
+            $this->forward('edit', NULL, NULL, array('documentForm' => $documentForm));
366 366
         }
367 367
 
368 368
         $this->redirectToList();
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         parent::initializeAction();
384 384
     }
385 385
 
386
-    protected function redirectToList($message = null)
386
+    protected function redirectToList($message = NULL)
387 387
     {
388 388
         $this->redirect('list');
389 389
     }
Please login to merge, or discard this patch.