Passed
Pull Request — master (#92)
by
unknown
03:41
created

DocumentFormController::createAction()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 13
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 3
nop 1
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
1
<?php
2
namespace EWW\Dpf\Controller;
3
4
/*
5
 * This file is part of the TYPO3 CMS project.
6
 *
7
 * It is free software; you can redistribute it and/or modify it under
8
 * the terms of the GNU General Public License, either version 2
9
 * of the License, or any later version.
10
 *
11
 * For the full copyright and license information, please read the
12
 * LICENSE.txt file that was distributed with this source code.
13
 *
14
 * The TYPO3 project - inspiring people to share!
15
 */
16
17
class DocumentFormController extends AbstractDocumentFormController
18
{
19
20
    protected function redirectToList($message = null)
21
    {
22
        $this->redirect('list', 'DocumentForm', null, array('message' => $message));
23
    }
24
25
    /**
26
     * action create
27
     *
28
     * @param \EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm
29
     * @return void
30
     */
31
    public function createAction(\EWW\Dpf\Domain\Model\DocumentForm $newDocumentForm)
32
    {
33
        foreach ($newDocumentForm->getNewFiles() as $newFile) {
34
            $uid = $newFile->getUID();
35
            if (empty($uid)) {
36
                $newFile->setDownload(true);
37
            }
38
            $files[] = $newFile;
39
        }
40
41
        $newDocumentForm->setNewFiles($files);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $files seems to be defined by a foreach iteration on line 33. Are you sure the iterator is never empty, otherwise this variable is not defined?
Loading history...
42
43
        parent::createAction($newDocumentForm);
44
    }
45
}
46