GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 85c96d...29fd5f )
by Eoghan
12:06
created

getRecaptchaId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * Studioforty9_Recaptcha
4
 *
5
 * @category  Studioforty9
6
 * @package   Studioforty9_Recaptcha
7
 * @author    StudioForty9 <[email protected]>
8
 * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
 * @license   https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
 * @version   1.5.0
11
 * @link      https://github.com/studioforty9/recaptcha
12
 */
13
14
/**
15
 * Studioforty9_Recaptcha_Block_Explicit
16
 *
17
 * @category   Studioforty9
18
 * @package    Studioforty9_Recaptcha
19
 * @subpackage Block
20
 */
21
class Studioforty9_Recaptcha_Block_Explicit extends Mage_Core_Block_Template
22
{
23
    protected $_languages = array(
24
        'ar_DZ|ar_SA|ar_KW|ar_MA|ar_EG|az_AZ|' => 'ar',
25
        'bg_BG' => 'bg',
26
        'ca_ES' => 'ca',
27
        'zh_CN' => 'zh-CN',
28
        'zh_HK|zh_TW' => 'zh-TW',
29
        'hr_HR' => 'hr',
30
        'cs_CZ' => 'cs',
31
        'da_DK' => 'da',
32
        'nl_NL' => 'nl',
33
        'en_GB|en_AU|en_NZ|en_IE|cy_GB' => 'en-GB',
34
        'en_US|en_CA' => 'en',
35
        'fil_PH' => 'fil',
36
        'fi_FI' => 'fi',
37
        'fr_FR' => 'fr',
38
        'fr_CA' => 'fr-CA',
39
        'de_DE' => 'de',
40
        'de_AT)' => 'de-AT',
41
        'de_CH' => 'de-CH',
42
        'el_GR' => 'el',
43
        'he_IL' => 'iw',
44
        'hi_IN' => 'hi',
45
        'hu_HU' => 'hu',
46
        'gu_IN|id_ID' => 'id',
47
        'it_IT|it_CH' => 'it',
48
        'ja_JP' => 'ja',
49
        'ko_KR' => 'ko',
50
        'lv_LV' => 'lv',
51
        'lt_LT' => 'lt',
52
        'nb_NO' => 'no',
53
        'fa_IR' => 'fa',
54
        'pl_PL' => 'pl',
55
        'pt_BR' => 'pt-BR',
56
        'pt_PT' => 'pt-PT',
57
        'ro_RO' => 'ro',
58
        'ru_RU' => 'ru',
59
        'sr_RS' => 'sr',
60
        'sk_SK' => 'sk',
61
        'sl_SI' => 'sl',
62
        'es_ES|gl_ES' => 'es',
63
        'es_AR|es_CL|es_CO|es_CR|es_MX|es_PA|es_PE|es_VE' => 'es-419',
64
        'sv_SE' => 'sv',
65
        'th_TH' => 'th',
66
        'tr_TR' => 'tr',
67
        'uk_UA' => 'uk',
68
        'vi_VN' => 'vi'
69
    );
70
    
71
    /**
72
     * Get the reCAPTACHA javascript code.
73
     *
74
     * @param string $id
0 ignored issues
show
Bug introduced by
There is no parameter named $id. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
75
     * @return string
76
     */
77
    public function getRecaptchaScript()
78
    {
79
        if (! Mage::helper('studioforty9_recaptcha')->isEnabled()) {
80
            return '';
81
        }
82
83
        $language = Mage::app()->getLocale()->getLocale()->toString();
84
        $lang = 'en';
85
86
        foreach ($this->_languages as $options => $_lang) {
87
            if (stristr($options, $language)) {
88
                $lang = $_lang;
89
            }
90
        }
91
92
        $query = array(
93
            'onload' => 'onloadCallback',
94
            'render' => 'explicit',
95
            'hl'     => $lang
96
        );
97
98
        return sprintf(
99
            '<script src="https://www.google.com/recaptcha/api.js?%s" async defer></script>',
100
            http_build_query($query)
101
        );
102
    }
103
104
    /**
105
     * Get the recaptcha site key.
106
     *
107
     * @codeCoverageIgnore
108
     * @return string
109
     */
110
    public function getSiteKey()
111
    {
112
        return Mage::helper('studioforty9_recaptcha')->getSiteKey();
113
    }
114
115
    /**
116
     * Get the recaptcha theme setting.
117
     *
118
     * @codeCoverageIgnore
119
     * @return string
120
     */
121
    public function getTheme()
122
    {
123
        return Mage::helper('studioforty9_recaptcha')->getTheme();
124
    }
125
126
    /**
127
     * Get the recaptcha type setting.
128
     *
129
     * @codeCoverageIgnore
130
     * @return string
131
     */
132
    public function getType()
133
    {
134
        return Mage::helper('studioforty9_recaptcha')->getType();
135
    }
136
137
    /**
138
     * Get the recaptcha size setting.
139
     *
140
     * @codeCoverageIgnore
141
     * @return string
142
     */
143
    public function getSize()
144
    {
145
        return Mage::helper('studioforty9_recaptcha')->getSize();
146
    }
147
148
    /**
149
     * Get a unique ID for the recaptcha block.
150
     *
151
     * @return string
152
     */
153
    public function getRecaptchaId()
154
    {
155
        return uniqid();
156
    }
157
}
158