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.

OneTimeJsProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getOneTimeWidgetJs() 0 11 1
1
<?php
2
/*
3
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
5
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
6
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
7
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
8
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9
 */
10
11
namespace TwitterWidgets\Assets;
12
13
class OneTimeJsProvider
14
{
15
    /**
16
     * @return string
17
     *
18
     * Adds this before your </body> for performance instead of relying on getSingleWidgetJs() for each widget
19
     * @link https://dev.twitter.com/web/javascript/loading
20
     */
21
    public function getOneTimeWidgetJs()
22
    {
23
        return 'window.twttr = (function (d, s, id) {
24
                    var t, js, fjs = d.getElementsByTagName(s)[0];
25
                    if (d.getElementById(id)) return;
26
                    js = d.createElement(s); js.id = id;
27
                    js.src= "https://platform.twitter.com/widgets.js";
28
                    fjs.parentNode.insertBefore(js, fjs);
29
                    return window.twttr || (t = { _e: [], ready: function (f) { t._e.push(f) } });
30
                }(document, "script", "twitter-wjs"));';
31
    }
32
}
33