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 ( 86dce3...98cf71 )
by Nur
02:40
created

Environment   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 18 3
1
<?php
2
/**
3
 * This file is part of the O2System PHP 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\Reactor\Http\Middleware;
15
16
// ------------------------------------------------------------------------
17
18
use O2System\Psr\Http\Message\ServerRequestInterface;
19
use O2System\Psr\Http\Server\RequestHandlerInterface;
20
21
/**
22
 * Class Environment
23
 *
24
 * @package O2System\Reactor\Http\Middleware
25
 */
26
class Environment implements RequestHandlerInterface
27
{
28
    /**
29
     * Environment::handle
30
     *
31
     * Handles a request and produces a response
32
     *
33
     * May call other collaborating code to generate the response.
34
     */
35
    public function handle(ServerRequestInterface $request)
36
    {
37
        $clientIpAddress = $request->getClientIpAddress();
38
        $debugIpAddresses = config('ipAddresses')->offsetGet('debug');
39
40
        if (in_array($clientIpAddress, $debugIpAddresses)) {
0 ignored issues
show
Bug introduced by
It seems like $debugIpAddresses can also be of type false; however, parameter $haystack of in_array() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

40
        if (in_array($clientIpAddress, /** @scrutinizer ignore-type */ $debugIpAddresses)) {
Loading history...
41
            $_ENV[ 'DEBUG_STAGE' ] = 'DEVELOPER';
42
43
            error_reporting(-1);
44
            ini_set('display_errors', 1);
45
46
            if (isset($_REQUEST[ 'PHP_INFO' ])) {
47
                phpinfo();
48
                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...
49
            }
50
        } else {
51
            ini_set('display_errors', 0);
52
            error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
53
        }
54
    }
55
}