Completed
Push — master ( dacc40...01610c )
by Vojtěch
8s
created

Environment::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
rs 9.4285
c 1
b 0
f 0
ccs 0
cts 0
cp 0
cc 2
eloc 3
nc 2
nop 2
crap 6
1
<?php
2
3
namespace SixtyEightPublishers\Application;
4
5
6
class Environment
7
{
8
	/** @var null|Profile */
9
	private $profile;
10
11
	/**
12
	 * @param \SixtyEightPublishers\Application\ProfileContainer            $profileContainer
13
	 * @param \SixtyEightPublishers\Application\IEnvironmentDetector        $detector
14
	 */
15
	public function __construct(ProfileContainer $profileContainer, IEnvironmentDetector $detector)
16
	{
17
		$profile = $detector->detect($profileContainer);
18
		$this->profile = $profile instanceof Profile ? $profile : $profileContainer->getDefaultProfile();
19
	}
20
21
	/**
22
	 * @return \SixtyEightPublishers\Application\Profile
23
	 */
24
	public function getProfile()
25
	{
26
		return $this->profile;
27
	}
28
29
}
30