Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
[lhc/web/wiklou.git] / includes / services / ServiceContainer.php
index bad0ef9..4c52693 100644 (file)
@@ -56,7 +56,7 @@ class ServiceContainer implements DestructibleService {
        private $serviceInstantiators = [];
 
        /**
-        * @var boolean[] disabled status, per service name
+        * @var bool[] disabled status, per service name
         */
        private $disabled = [];
 
@@ -66,7 +66,7 @@ class ServiceContainer implements DestructibleService {
        private $extraInstantiationParams;
 
        /**
-        * @var boolean
+        * @var bool
         */
        private $destroyed = false;
 
@@ -185,7 +185,7 @@ class ServiceContainer implements DestructibleService {
                        throw new NoSuchServiceException( $name );
                }
 
-               return isset( $this->services[$name] ) ? $this->services[$name] : null;
+               return $this->services[$name] ?? null;
        }
 
        /**
@@ -303,7 +303,7 @@ class ServiceContainer implements DestructibleService {
 
                $instance = $this->peekService( $name );
 
-               if ( $destroy && $instance instanceof DestructibleService )  {
+               if ( $destroy && $instance instanceof DestructibleService ) {
                        $instance->destroy();
                }