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.

ContentType::asTextHTML()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Util
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
namespace Pimf\Util\Header;
9
10
/**
11
 * Manages a raw HTTP header ContentType sending.
12
 *
13
 * @package Util_Header
14
 * @author  Gjero Krsteski <[email protected]>
15
 */
16
abstract class ContentType extends ResponseStatus
17
{
18
    public static function asJSON()
19
    {
20
        self::type('application/json; charset=utf-8');
21
    }
22
23
    public static function asPDF()
24
    {
25
        self::type('application/pdf');
26
    }
27
28
    public static function asCSV()
29
    {
30
        self::type('text/csv');
31
    }
32
33
    public static function asTextPlain()
34
    {
35
        self::type('text/plain');
36
    }
37
38
    public static function asTextHTML()
39
    {
40
        self::type('text/html');
41
    }
42
43
    public static function asZIP()
44
    {
45
        self::type('application/zip');
46
    }
47
48
    public static function asXZIP()
49
    {
50
        self::type('application/x-zip');
51
    }
52
53
    public static function asMSWord()
54
    {
55
        self::type('application/msword');
56
    }
57
58
    public static function asOctetStream()
59
    {
60
        self::type('application/octet-stream');
61
    }
62
63
    /**
64
     * @param string $definition
65
     */
66
    public static function type($definition)
67
    {
68
        header('Content-Type: ' . $definition, true);
69
    }
70
}
71