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.

ErrorHandler   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
A register() 0 4 1
1
<?php
2
/**
3
 * This file is part of the ramsey/uuid-console application
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @copyright Copyright (c) Ben Ramsey <[email protected]>
9
 * @license http://opensource.org/licenses/MIT MIT
10
 * @link https://packagist.org/packages/ramsey/uuid-console Packagist
11
 * @link https://github.com/ramsey/uuid-console GitHub
12
 */
13
14
namespace Ramsey\Uuid\Console\Util;
15
16
/**
17
 * Convert PHP errors into exceptions
18
 */
19
class ErrorHandler
20
{
21
    /**
22
     * Error handler
23
     *
24
     * @param int    $level   Level of the error raised
25
     * @param string $message Error message
26
     * @param string $file    Filename that the error was raised in
27
     * @param int    $line    Line number the error was raised at
28
     *
29
     * @static
30
     * @throws \ErrorException
31
     */
32
    public static function handle($level, $message, $file, $line)
33
    {
34
        // respect error_reporting being disabled
35
        if (!error_reporting()) {
36
            return;
37
        }
38
39
        throw new \ErrorException($message, 0, $level, $file, $line);
40
    }
41
42
    /**
43
     * Register error handler
44
     *
45
     * @static
46
     */
47
    public static function register()
48
    {
49
        set_error_handler(array(__CLASS__, 'handle'));
50
    }
51
}
52