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 ( 11b52a...ce507f )
by Joni
04:03
created

X509CertificateChainParameter::fromJSONValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

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