Skip to content
This repository has been archived by the owner on Feb 6, 2020. It is now read-only.

Use null coalescing operator #264

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ServiceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function get($name)
}

// Determine if the service should be shared.
$sharedService = isset($this->shared[$name]) ? $this->shared[$name] : $this->sharedByDefault;
$sharedService = $this->shared[$name] ?? $this->sharedByDefault;

// We achieve better performance if we can let all alias
// considerations out.
Expand All @@ -206,7 +206,7 @@ public function get($name)
}

// We now deal with requests which may be aliases.
$resolvedName = isset($this->aliases[$name]) ? $this->aliases[$name] : $name;
$resolvedName = $this->aliases[$name] ?? $name;

// The following is only true if the requested service is a shared alias.
$sharedAlias = $sharedService && isset($this->services[$resolvedName]);
Expand Down