Completed
Pull Request — master (#6)
by Guilh
04:05
created

ConsumesPart   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 60%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 2
c 3
b 1
f 0
lcom 1
cbo 2
dl 0
loc 18
ccs 3
cts 5
cp 0.6
rs 10
1
<?php
2
namespace gossi\swagger\parts;
3
4
use gossi\swagger\util\MergeHelper;
5
use phootwork\collection\Map;
6
use phootwork\collection\Set;
7
8
trait ConsumesPart {
9
10
	private $consumes;
11 12
12 12
	private function parseConsumes(Map $data) {
13 12
		$this->consumes = $data->get('consumes', new Set());
14
	}
15
16
	private function mergeConsumes(static $model, $overwrite = false) {
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STATIC, expecting T_VARIABLE
Loading history...
17
		MergeHelper::mergeFields($this->consumes, $model->consumes, $overwrite);
18
	}
19
20
	/**
21
	 * Return consumes
22
	 *
23
	 * @return Set
24
	 */
25
	public function getConsumes() {
26
		return $this->consumes;
27
	}
28
29
}
30