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 — 3.0 ( ec7cbd...c3085b )
by Vermeulen
02:42
created

Http::redirection()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 7
nc 2
nop 2
1
<?php
2
3
namespace BFW\Helpers;
4
5
/**
6
 * Helpers for http requests/responses
7
 */
8
class Http
9
{
10
    /**
11
     * Create a http redirect and kill the script
12
     * 
13
     * @param string $page The page where is the redirect
14
     * @param boolean $permanent (default false) If the redirect is permanent
15
     * 
16
     * @return void
17
     */
18
    public static function redirection($page, $permanent = false)
19
    {
20
        $httpStatus = 302;
21
        if ($permanent === true) {
22
            $httpStatus = 301;
23
        }
24
25
        http_response_code($httpStatus);
26
        header('Location: '.$page);
27
        exit;
28
    }
29
}
30