yii\di\Container::hasSingleton PHP Method

hasSingleton() public method

Returns a value indicating whether the given name corresponds to a registered singleton.
public hasSingleton ( string $class, boolean $checkInstance = false ) : boolean
$class string class name, interface name or alias name
$checkInstance boolean whether to check if the singleton has been instantiated.
return boolean whether the given name corresponds to a registered singleton. If `$checkInstance` is true, the method should return a value indicating whether the singleton has been instantiated.
    public function hasSingleton($class, $checkInstance = false)
    {
        return $checkInstance ? isset($this->_singletons[$class]) : array_key_exists($class, $this->_singletons);
    }