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.

XLS::initBasePath()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Nip\View;
4
5
use Nip\View;
6
7
/**
8
 * Class XLS
9
 * @package Nip\View
10
 */
11
class XLS extends View
12
{
13
14
    /**
15
     * Singleton
16
     *
17
     * @return self
18
     */
19
    public static function instance()
20
    {
21
        static $instance;
22
        if (!($instance instanceof self)) {
23
            $instance = new self();
24
        }
25
        return $instance;
26
    }
27
28
    public function initBasePath()
29
    {
30
        $this->setBasePath(MODULES_PATH . request()->getModuleName() . '/views/');
31
    }
32
33
    /**
34
     * @param $view
35
     * @param $name
36
     */
37
    public function output($view, $name)
38
    {
39
        header("Content-type: application/vnd.ms-excel");
40
        header("Content-Disposition: attachment; filename=\"$name\"");
41
        header("Cache-Control: private, max-age=1, pre-check=1", true);
42
        header("Pragma: none", true);
43
44
        echo $this->load($view);
45
        exit();
0 ignored issues
show
Coding Style Compatibility introduced by
The method output() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
46
    }
47
}
48
49