From 364a9ba2ff641f7a92dde753241f2d1be183049f Mon Sep 17 00:00:00 2001 From: Witold Wasiczko Date: Mon, 19 Mar 2018 23:21:27 +0100 Subject: [PATCH] Use null coalescing operator --- src/ServiceManager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ServiceManager.php b/src/ServiceManager.php index e4d0c48f..28a239c6 100644 --- a/src/ServiceManager.php +++ b/src/ServiceManager.php @@ -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. @@ -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]);