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.

AuthUtils::requireUser()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 2
1
<?php
2
3
/**
4
 * eduVPN - End-user friendly VPN.
5
 *
6
 * Copyright: 2016-2017, The Commons Conservancy eduVPN Programme
7
 * SPDX-License-Identifier: AGPL-3.0+
8
 */
9
10
namespace SURFnet\VPN\Common\Http;
11
12
use SURFnet\VPN\Common\Http\Exception\HttpException;
13
14
class AuthUtils
15
{
16
    public static function requireUser(array $hookData, array $userList)
17
    {
18
        if (!in_array($hookData['auth'], $userList)) {
19
            throw new HttpException(
20
                sprintf(
21
                    'user "%s" is not allowed to perform this operation',
22
                    $hookData['auth']
23
                ),
24
                403
25
            );
26
        }
27
    }
28
}
29