StatisticBlockService   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 8
dl 0
loc 30
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A execute() 0 9 1
A getName() 0 3 1
A getDefaultSettings() 0 3 1
1
<?php
2
3
namespace Application\Bundle\DefaultBundle\Service;
4
5
use Sonata\BlockBundle\Block\Service\AbstractBlockService;
6
use Symfony\Component\HttpFoundation\Response;
7
use Sonata\BlockBundle\Block\BlockContextInterface;
8
9
/**
10
 * StatisticBlockService.
11
 */
12
class StatisticBlockService extends AbstractBlockService
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function getName()
18
    {
19
        return 'statistic';
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function getDefaultSettings()
26
    {
27
        return [];
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function execute(BlockContextInterface $blockContext, Response $response = null)
34
    {
35
        return $this->renderResponse(
36
            '@ApplicationDefault/Statistic/block_admin_list.html.twig',
37
            [
38
                'block' => $blockContext->getBlock(),
39
                'block_context' => $blockContext,
40
            ],
41
            $response
42
        );
43
    }
44
}
45