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.
Passed
Push — master ( d1b136...44a49b )
by
unknown
02:02
created

ServiceWorker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 9 2
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Framework\Http\Controllers;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Framework\Http\Controller;
19
20
/**
21
 * Class ServiceWorker
22
 * @package O2System\Framework\Http\Controllers
23
 */
24
class ServiceWorker extends Controller
25
{
26
    /**
27
     * ServiceWorker::index
28
     */
29
    public function index()
30
    {
31
        if($javascript = file_get_contents(PATH_PUBLIC . 'assets/sw.js')) {
32
            $javascript = str_replace(['{{$theme}}', '{{ $theme }}'], 'default', $javascript);
33
34
            header("Content-type: application/x-javascript");
35
            echo $javascript;
36
37
            exit(EXIT_SUCCESS);
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
38
        }
39
    }
40
}