Completed
Push — master ( a18085...d4249c )
by Fabien
03:34
created

LinkCreatorController::initializeAction()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 5

Duplication

Lines 13
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 13
rs 9.4285
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
namespace Fab\Media\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
use TYPO3\CMS\Core\Resource\File;
18
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
19
20
/**
21
 * Controller which handles actions related to Link Creator.
22
 */
23
class LinkCreatorController extends ActionController
24
{
25
26
    /**
27
     * Initializes the controller before invoking an action method.
28
     */
29 View Code Duplication
    public function initializeAction()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
32
        // Configure property mapping to retrieve the file object.
33
        if ($this->arguments->hasArgument('file')) {
34
35
            /** @var \Fab\Media\TypeConverter\FileConverter $typeConverter */
36
            $typeConverter = $this->objectManager->get('Fab\Media\TypeConverter\FileConverter');
37
38
            $propertyMappingConfiguration = $this->arguments->getArgument('file')->getPropertyMappingConfiguration();
39
            $propertyMappingConfiguration->setTypeConverter($typeConverter);
40
        }
41
    }
42
43
    /**
44
     * Handle GUI for creating a link in the RTE.
45
     *
46
     * @param File $file
47
     * @return void
48
     */
49
    public function showAction(File $file)
50
    {
51
        $this->view->assign('file', $file);
52
    }
53
54
}
55