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

Environment   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 24
rs 10
c 1
b 0
f 0
ccs 0
cts 5
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
A getProfile() 0 4 1
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