| Conditions | 2 |
| Paths | 1 |
| Total Lines | 6 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function __construct(ProfileContainer $profileContainer, IEnvironmentDetector $detector, IProfileStorage $profileStorage) |
||
| 18 | { |
||
| 19 | $profile = $detector->detect($profileContainer); |
||
| 20 | $this->profileStorage = $profileStorage; |
||
| 21 | $this->profileStorage->setProfile($profile instanceof Profile ? $profile : $profileContainer->getDefaultProfile()); |
||
|
|
|||
| 22 | } |
||
| 23 | |||
| 32 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: