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

SchemaPart   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 60%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 2
c 2
b 1
f 0
lcom 1
cbo 2
dl 0
loc 17
ccs 3
cts 5
cp 0.6
rs 10
1
<?php
2
namespace gossi\swagger\parts;
3
4
use gossi\swagger\Schema;
5
use gossi\swagger\util\MergeHelper;
6
use phootwork\collection\Map;
7
8
trait SchemaPart {
9
10
	/** @var Schema */
11
	private $schema;
12 8
13 8
	private function parseSchema(Map $data) {
14 8
		$this->schema = new Schema($data->get('schema'));
15
	}
16
17
	private function mergeSchema(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...
18
		$this->schema->merge($model->schema, $overwrite);
19
	}
20
21
	/**
22
	 *
23
	 * @return Schema
24
	 */
25
	public function getSchema() {
26
		return $this->schema;
27
	}
28
}
29