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

ArrayParameterValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
__construct() 0 1 ?
A fromJSONValue() 0 7 2
1
<?php
2
3
namespace JWX\Parameter\Feature;
4
5
6
/**
7
 * Trait for parameters having an array value.
8
 */
9
trait ArrayParameterValue
10
{
11
	/**
12
	 * Constructor.
13
	 *
14
	 * @param mixed ...$values
15
	 */
16
	abstract public function __construct(...$values);
17
	
18
	/**
19
	 * Initialize from a JSON value.
20
	 *
21
	 * @param array $value
22
	 * @return static
23
	 */
24 5
	public static function fromJSONValue($value) {
25 5
		if (!is_array($value)) {
26 2
			throw new \UnexpectedValueException(
27 2
				get_called_class() . " expects an array parameter.");
28
		}
29 3
		return new static(...$value);
30
	}
31
}
32