Completed
Push — master ( a7fff6...5ea170 )
by Jeroen
18:57 queued 10s
created

IconFontController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 28
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A iconFontChooserAction() 0 17 2
1
<?php
2
3
namespace Kunstmaan\MediaBundle\Controller;
4
5
use Symfony\Component\Routing\Annotation\Route;
6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
7
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8
use Symfony\Component\HttpFoundation\Request;
9
10
/**
11
 * IconFontController
12
 */
13
class IconFontController extends Controller
0 ignored issues
show
Deprecated Code introduced by
The class Symfony\Bundle\Framework...e\Controller\Controller has been deprecated with message: since Symfony 4.2, use "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
14
{
15
    /**
16
     * @param Request $request
17
     *
18
     * @Route("/chooser", name="KunstmaanMediaBundle_icon_font_chooser")
19
     * @Template("@KunstmaanMedia/IconFont/iconFontChooser.html.twig")
20
     *
21
     * @return array
22
     */
23
    public function iconFontChooserAction(Request $request)
24
    {
25
        $loader = $request->query->get('loader');
26
        $loaderData = json_decode($request->query->get('loader_data'), true);
27
28
        $iconFontManager = $this->get('kunstmaan_media.icon_font_manager');
29
        if (empty($loader)) {
30
            $loader = $iconFontManager->getDefaultLoader();
31
        } else {
32
            $loader = $iconFontManager->getLoader($loader);
33
        }
34
        $loader->setData($loaderData);
35
36
        return array(
37
            'loader' => $loader,
38
        );
39
    }
40
}
41