Items   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 6
dl 0
loc 26
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A parse() 0 9 1
A toArray() 0 3 1
1
<?php
2
namespace gossi\swagger;
3
4
use gossi\swagger\parts\ExtensionPart;
5
use gossi\swagger\parts\ItemsPart;
6
use gossi\swagger\parts\RefPart;
7
use gossi\swagger\parts\TypePart;
8
use phootwork\collection\CollectionUtils;
9
use phootwork\lang\Arrayable;
10
11
class Items extends AbstractModel implements Arrayable {
12
13
	use RefPart;
14
	use TypePart;
15
	use ItemsPart;
16
	use ExtensionPart;
17
18 6
	public function __construct($contents = []) {
19 6
		$this->parse($contents);
20 6
	}
21
22 6
	private function parse($contents = []) {
23 6
		$data = CollectionUtils::toMap($contents);
24
25
		// parts
26 6
		$this->parseRef($data);
27 6
		$this->parseType($data);
28 6
		$this->parseItems($data);
29 6
		$this->parseExtensions($data);
30 6
	}
31
32 6
	public function toArray() {
33 6
		return $this->export($this->getTypeExportFields(), 'items');
34
	}
35
36
}
37