src/Milky/Binding/UniversalBuilder.php
public static function resolveClass( $class, $buildOnFailure = false, $parameters = [] )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		if ( $class == Framework::class )
			return Framework::fw();
		if ( $class == Configuration::class )
			return Framework::config();
		if ( $class == Logger::class )
			return Framework::log();

		// TODO Add a few more basic classes

		foreach ( static::$resolvers as $resolver )
			if ( false !== ( $result = $resolver->resolveClass( $class ) ) )
				return $result;

		if ( $buildOnFailure )
			return static::buildClass( $class, $parameters );

		return null;
	}
public static function resolveClass( $class, $buildOnFailure = false, $parameters = [] )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		if ( $class == Framework::class )
			return Framework::fw();
		if ( $class == Configuration::class )
			return Framework::config();
		if ( $class == Logger::class )
			return Framework::log();

		// TODO Add a few more basic classes

		foreach ( static::$resolvers as $resolver )
			if ( false !== ( $result = $resolver->resolveClass( $class ) ) )
				return $result;

		if ( $buildOnFailure )
			return static::buildClass( $class, $parameters );

		return null;
	}
public static function resolveClass ( $ class , $ buildOnFailure = false , $ parameters = [ ] ) { if ( ! is_string ( $ class ) ) throw new ResolverException ( "Class must be a string" ) ; if ( $ class == Framework :: class ) return Framework :: fw ( ) ; if ( $ class == Configuration :: class ) return Framework :: config ( ) ; if ( $ class == Logger :: class ) return Framework :: log ( ) ; // TODO Add a few more basic classes foreach ( static :: $ resolvers as $ resolver ) if ( false !== ( $ result = $ resolver -> resolveClass ( $ class ) ) ) return $ result ; if ( $ buildOnFailure ) return static :: buildClass ( $ class , $ parameters ) ; return null ; }
Attempts to locate a class within the registered resolvers.
Optionally will build the class on failure.

@param string $class
@param bool $buildOnFailure
@param array $parameters
@return mixed|null|object
Attempts to locate a class within the registered resolvers . Optionally will build the class on failure .