RefPart::hasRef()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
namespace gossi\swagger\parts;
3
4
use phootwork\collection\Map;
5
6
trait RefPart {
7
8
	/** @var string */
9
	private $ref;
10
11
	/** @var bool */
12
	private $hasRef = false;
13
14 13
	private function parseRef(Map $data) {
15 13
		$this->ref = $data->get('$ref');
16 13
		$this->hasRef = $data->has('$ref');
17 13
	}
18
19
	/**
20
	 *
21
	 * @return string
22
	 */
23 1
	public function getRef() {
24 1
		return $this->ref;
25
	}
26
27
	/**
28
	 *
29
	 * @param
30
	 *        	$ref
31
	 */
32 1
	public function setRef($ref) {
33 1
		$this->ref = $ref;
34 1
		$this->hasRef = $ref !== null;
35 1
		return $this;
36
	}
37
38 13
	public function hasRef() {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
39 13
		return $this->hasRef;
40
	}
41
42
}
43