src/DI.php
public function single($alias)
	{
		$alias = strtolower($alias);

		// Return the existing object if it exists.
		if (! empty($this->instances[$alias]) && is_object($this->instances[$alias]))
		{
			return $this->instances[$alias];
		}

		// Die if we don't know what class to use.
		if (empty($this->services[$alias]))
		{
			throw new \InvalidArgumentException('Unable to find class with alias: '. $alias);
		}

		$instance = $this->make($alias, true);

		$this->instances[$alias] =& $instance;

		return $this->instances[$alias];
	}
public function single($alias)
	{
		$alias = strtolower($alias);

		// Return the existing object if it exists.
		if (! empty($this->instances[$alias]) && is_object($this->instances[$alias]))
		{
			return $this->instances[$alias];
		}

		// Die if we don't know what class to use.
		if (empty($this->services[$alias]))
		{
			throw new \InvalidArgumentException('Unable to find class with alias: '. $alias);
		}

		$instance = $this->make($alias, true);

		$this->instances[$alias] =& $instance;

		return $this->instances[$alias];
	}
public function single ( $ alias ) { $ alias = strtolower ( $ alias ) ; // Return the existing object if it exists. if ( ! empty ( $ this -> instances [ $ alias ] ) && is_object ( $ this -> instances [ $ alias ] ) ) { return $ this -> instances [ $ alias ] ; } // Die if we don't know what class to use. if ( empty ( $ this -> services [ $ alias ] ) ) { throw new \ InvalidArgumentException ( 'Unable to find class with alias: ' . $ alias ) ; } $ instance = $ this -> make ( $ alias , true ) ; $ this -> instances [ $ alias ] = & $ instance ; return $ this -> instances [ $ alias ] ; }
Allows you to create a new instance of an object as a singleton,
passing in arguments.

@param $alias
@return mixed
Allows you to create a new instance of an object as a singleton passing in arguments .