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.
Passed
Branch php72 (880eb0)
by Joni
05:58
created

X509CertificateChainParameter::__construct()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
cc 3
nc 3
nop 1
crap 3
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Sop\JWX\JWK\Parameter;
6
7
use Sop\JWX\Parameter\Feature\ArrayParameterValue;
8
use Sop\JWX\Util\Base64;
9
10
/**
11
 * Implements 'X.509 Certificate Chain' parameter.
12
 *
13
 * @see https://tools.ietf.org/html/rfc7517#section-4.7
14
 */
15
class X509CertificateChainParameter extends JWKParameter
16
{
17
    use ArrayParameterValue;
18
19
    /**
20
     * Constructor.
21
     *
22
     * @param string ...$certs Base64 encoded DER certificates
23
     */
24 3
    public function __construct(string ...$certs)
25
    {
26 3
        foreach ($certs as $cert) {
27 3
            if (!Base64::isValid($cert)) {
28 1
                throw new \UnexpectedValueException(
29 3
                    'Certificate must be base64 encoded.');
30
            }
31
        }
32 2
        parent::__construct(self::PARAM_X509_CERTIFICATE_CHAIN, $certs);
33 2
    }
34
}
35