View   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getView() 0 4 1
A renderOne() 0 4 1
A renderMany() 0 4 1
1
<?php
2
3
namespace Thruster\Bundle\ViewBundle\View;
4
5
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
6
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
7
8
/**
9
 * Class View
10
 *
11
 * @package Thruster\Bundle\ViewsBundle
12
 * @author  Aurimas Niekis <[email protected]>
13
 */
14
class View implements ContainerAwareInterface
15
{
16
    use ContainerAwareTrait;
17
18
    /**
19
     * @param string $view A short notation view (a:b:c) AppBundle:Default:homepage
20
     *
21
     * @return callable
22
     */
23
    public function getView($view)
24
    {
25
        return $this->container->get('thruster_views.view_resolver')->getView($view);
26
    }
27
28
    /**
29
     * @param string $view A short notation view (a:b:c) AppBundle:Default:homepage
30
     * @param mixed  $data
31
     *
32
     * @return mixed
33
     */
34
    public function renderOne($view, $data)
35
    {
36
        return $this->container->get('thruster_views.view_resolver')->renderOne($view, $data);
37
    }
38
39
    /**
40
     * @param string $view A short notation view (a:b:c) AppBundle:Default:homepage
41
     * @param array  $data
42
     * @param bool   $preserveKeys
43
     *
44
     * @return array
45
     */
46
    public function renderMany($view, $data, $preserveKeys = false)
47
    {
48
        return $this->container->get('thruster_views.view_resolver')->renderMany($view, $data, $preserveKeys);
49
    }
50
}
51