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 — master ( bca83a...1ac405 )
by François
03:36
created

CaModule::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Copyright 2015 François Kooman <[email protected]>.
4
 *
5
 * Licensed under the Apache License, Version 2.0 (the "License");
6
 * you may not use this file except in compliance with the License.
7
 * You may obtain a copy of the License at
8
 *
9
 * http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
namespace fkooman\VPN\Server\Ca;
18
19
use fkooman\Http\Request;
20
use fkooman\Rest\Service;
21
use fkooman\Rest\ServiceModuleInterface;
22
use fkooman\Rest\Plugin\Authentication\UserInfoInterface;
23
use fkooman\Http\JsonResponse;
24
25
class CaModule implements ServiceModuleInterface
26
{
27
    /** @var CrlFetcher */
28
    private $crlFetcher;
29
30
    public function __construct(CrlFetcher $crlFetcher)
31
    {
32
        $this->crlFetcher = $crlFetcher;
33
    }
34
35
    public function init(Service $service)
36
    {
37
        $service->post(
38
            '/crl/fetch',
39
            function (Request $request, UserInfoInterface $userInfo) {
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $userInfo is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
40
41
                //$this->logInfo('fetching CRL', array('api_user' => $userInfo->getUserId()));
0 ignored issues
show
Unused Code Comprehensibility introduced by
77% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
42
43
                $response = new JsonResponse();
44
                $response->setBody($this->crlFetcher->fetch());
45
46
                return $response;
47
            }
48
        );
49
    }
50
}
51