Completed
Push — 2.x-dev-kit ( 971030 )
by
unknown
07:52
created

BaseTwitterButtonBlockService   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 4
Bugs 1 Features 0
Metric Value
wmc 1
c 4
b 1
f 0
lcom 0
cbo 2
dl 0
loc 61
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 9 1
1
<?php
2
3
/*
4
 * This file is part of the Sonata Project package.
5
 *
6
 * (c) Thomas Rabaix <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sonata\SeoBundle\Block\Social;
13
14
use Sonata\BlockBundle\Block\BaseBlockService;
15
use Sonata\BlockBundle\Block\BlockContextInterface;
16
use Symfony\Component\HttpFoundation\Response;
17
18
/**
19
 * Abstract class for Twitter Buttons blocks services.
20
 *
21
 * @author Sylvain Deloux <[email protected]>
22
 */
23
abstract class BaseTwitterButtonBlockService extends BaseBlockService
24
{
25
    /**
26
     * @var string[]
27
     */
28
    protected $languageList = array(
29
        'fr' => 'fr',
30
        'en' => 'en',
31
        'ar' => 'ar',
32
        'ja' => 'ja',
33
        'es' => 'es',
34
        'de' => 'de',
35
        'it' => 'it',
36
        'id' => 'id',
37
        'pt' => 'pt',
38
        'ko' => 'ko',
39
        'tr' => 'tr',
40
        'ru' => 'ru',
41
        'nl' => 'nl',
42
        'fil' => 'fil',
43
        'msa' => 'msa',
44
        'zh-tw' => 'zh-tw',
45
        'zh-cn' => 'zh-cn',
46
        'hi' => 'hi',
47
        'no' => 'no',
48
        'sv' => 'sv',
49
        'fi' => 'fi',
50
        'da' => 'da',
51
        'pl' => 'pl',
52
        'hu' => 'hu',
53
        'fa' => 'fa',
54
        'he' => 'he',
55
        'ur' => 'ur',
56
        'th' => 'th',
57
        'uk' => 'uk',
58
        'ca' => 'ca',
59
        'el' => 'el',
60
        'eu' => 'eu',
61
        'cs' => 'cs',
62
        'af' => 'af',
63
        'xx-lc' => 'xx-lc',
64
        'gl' => 'gl',
65
        'ro' => 'ro',
66
        'hr' => 'hr',
67
        'ckb' => 'ckb',
68
        'en-gb' => 'en-gb',
69
    );
70
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function execute(BlockContextInterface $blockContext, Response $response = null)
75
    {
76
        $settings = $blockContext->getSettings();
77
78
        return $this->renderResponse($blockContext->getTemplate(), array(
79
            'block' => $blockContext->getBlock(),
80
            'settings' => $settings,
81
        ), $response);
82
    }
83
}
84