OpeningTimesProviderTrait::getOpeningTimes()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
namespace Germania\OpeningTimes;
3
4
trait OpeningTimesProviderTrait
5
{
6
7
	public $opening_times;
8
9
10
	/**
11
	 * @inheritDoc
12
	 * @return OpeningTimes
13
	 */
14 4
	public function getOpeningTimes() : OpeningTimesInterface
15
	{
16 4
		if (!$this->opening_times)		
17 4
			$this->opening_times = new OpeningTimes;
18
19 4
		return $this->opening_times;
20
	}
21
22
23
}