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

PfxStrategy::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
use Kinedu\Traits\HasFiles;
15
16
class PfxStrategy
17
{
18
    use HasFiles;
19
20
    /** @var string */
21
    protected $keyFile;
22
23
    /** @var string */
24
    protected $cerFile;
25
26
    /** @var string */
27
    protected $password;
28
29
    /** @var string */
30
    protected $extension = 'pfx';
31
32
    /**
33
     * Create a new pfx strategy instance.
34
     *
35
     * @param array $params
36
     * @param string $keyFile
0 ignored issues
show
Bug introduced by
There is no parameter named $keyFile. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
37
     * @param string $cerFile
0 ignored issues
show
Bug introduced by
There is no parameter named $cerFile. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
38
     * @param string $password
0 ignored issues
show
Bug introduced by
There is no parameter named $password. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
39
     */
40
    public function __construct(array $params)
41
    {
42
        $this->keyFile = $keyFile;
0 ignored issues
show
Bug introduced by
The variable $keyFile does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
43
44
        $this->cerFile = $cerFile;
0 ignored issues
show
Bug introduced by
The variable $cerFile does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
45
        $this->password = $this->getParam($params, 3);
46
    }
47
48
    public function decode()
49
    {
50
        return shell_exec(sprintf(
51
            'openssl pkcs12 -export -in %s -inkey %s -passout pass:%s',
52
            $this->cerFile,
53
            $this->keyFile,
54
            $this->password
55
        ));
56
    }
57
}
58