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 ( e30b6b...94d2c2 )
by Orlando
01:37
created

KeyStrategy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/*
4
 * This file is part of the cfdi-certificate project.
5
 *
6
 * (c) Kinedu
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Kinedu\CFDI\Certificate\Strategies;
13
14
class KeyStrategy
15
{
16
    /**
17
     * File to decode.
18
     *
19
     * @var string
20
     */
21
    protected $file;
22
23
    /**
24
     * Password to decode the file.
25
     *
26
     * @var string
27
     */
28
    protected $password;
29
30
    /**
31
     * Create a new key strategy instance.
32
     *
33
     * @param string $file
34
     * @param string $password
35
     */
36
    public function __construct(string $file, string $password)
37
    {
38
        $this->file = $file;
39
40
        $this->password = $password;
41
    }
42
43
    public function decode(): string
44
    {
45
        return shell_exec(sprintf(
46
            "openssl pkcs8 -inform DER -in %s -passin pass:%s",
47
            $this->file,
48
            $this->password
49
        ));
50
51
        return $pem;
0 ignored issues
show
Unused Code introduced by
return $pem; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
52
    }
53
}
54