src/Container.php
protected function getSingleton($class) {
		if (isset($this->singletons[$class])) {
			return $this->singletons[$class];
		}

		$instance = $this->getNewInstance($class);
		$this->singletons[$class] = $instance;
		return $instance;
	}
protected function getSingleton($class) {
		if (isset($this->singletons[$class])) {
			return $this->singletons[$class];
		}

		$instance = $this->getNewInstance($class);
		$this->singletons[$class] = $instance;
		return $instance;
	}
protected function getSingleton ( $ class ) { if ( isset ( $ this -> singletons [ $ class ] ) ) { return $ this -> singletons [ $ class ] ; } $ instance = $ this -> getNewInstance ( $ class ) ; $ this -> singletons [ $ class ] = $ instance ; return $ instance ; }
Get singleton of a class.

@param string $class
@param string $method Optional
@return object|array
Get singleton of a class .