public function resolveClass( $class )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		// Check if a class has been mapped to a key
		if ( array_key_exists( $class, $this->classAlias ) )
			try
			{
				return $this->resolve( null, $this->classAlias[$class] );
			}
			catch ( ResolverException $e )
			{
				// Ignore
			}

		// Check if the class has been initialized
		foreach ( $this->instances as $instance )
			if ( get_class( $instance ) == $class )
				return $instance;

		// TODO Other methods to check?

		return false;
	}
public function resolveClass( $class )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		// Check if a class has been mapped to a key
		if ( array_key_exists( $class, $this->classAlias ) )
			try
			{
				return $this->resolve( null, $this->classAlias[$class] );
			}
			catch ( ResolverException $e )
			{
				// Ignore
			}

		// Check if the class has been initialized
		foreach ( $this->instances as $instance )
			if ( get_class( $instance ) == $class )
				return $instance;

		// TODO Other methods to check?

		return false;
	}
public function resolveClass ( $ class ) { if ( ! is_string ( $ class ) ) throw new ResolverException ( "Class must be a string" ) ; // Check if a class has been mapped to a key if ( array_key_exists ( $ class , $ this -> classAlias ) ) try { return $ this -> resolve ( null , $ this -> classAlias [ $ class ] ) ; } catch ( ResolverException $ e ) { // Ignore } // Check if the class has been initialized foreach ( $ this -> instances as $ instance ) if ( get_class ( $ instance ) == $ class ) return $ instance ; // TODO Other methods to check? return false ; }
Called the a class needs resolving.
Each registered resolver will be called for this purpose, the first to return non-false will succeed.

@param string $class
Called the a class needs resolving . Each registered resolver will be called for this purpose the first to return non - false will succeed .