static public function formatDefinition($name, $definition)
	{
	    if (empty($definition)) {
	        return ['class' => $name];
	    } elseif (is_callable($definition, false) || is_object($definition)) {
	        return $definition;
	    } elseif (is_string($definition)) {
	        if (strpos($definition, ':') !== false) {
	            return $definition;
	        }
	        return ['class' => $definition];
	    } elseif (is_array($definition)) {
	        if (!isset($definition['class'])) {
	            if (strpos($name, '\\') !== false) {
	                $definition['class'] = $name;
	            } else {
	                throw new InvalidConfigException("A class definition requires a \"class\" member.");
	            }
	        }
	        return $definition;
	    } else {
	        throw new InvalidConfigException("Unsupported definition type for \"$name\": " . gettype($definition));
	    }
	}
static public function formatDefinition($name, $definition)
	{
	    if (empty($definition)) {
	        return ['class' => $name];
	    } elseif (is_callable($definition, false) || is_object($definition)) {
	        return $definition;
	    } elseif (is_string($definition)) {
	        if (strpos($definition, ':') !== false) {
	            return $definition;
	        }
	        return ['class' => $definition];
	    } elseif (is_array($definition)) {
	        if (!isset($definition['class'])) {
	            if (strpos($name, '\\') !== false) {
	                $definition['class'] = $name;
	            } else {
	                throw new InvalidConfigException("A class definition requires a \"class\" member.");
	            }
	        }
	        return $definition;
	    } else {
	        throw new InvalidConfigException("Unsupported definition type for \"$name\": " . gettype($definition));
	    }
	}
static public function formatDefinition ( $ name , $ definition ) { if ( empty ( $ definition ) ) { return [ 'class' => $ name ] ; } elseif ( is_callable ( $ definition , false ) || is_object ( $ definition ) ) { return $ definition ; } elseif ( is_string ( $ definition ) ) { if ( strpos ( $ definition , ':' ) !== false ) { return $ definition ; } return [ 'class' => $ definition ] ; } elseif ( is_array ( $ definition ) ) { if ( ! isset ( $ definition [ 'class' ] ) ) { if ( strpos ( $ name , '\\' ) !== false ) { $ definition [ 'class' ] = $ name ; } else { throw new InvalidConfigException ( "A class definition requires a \"class\" member." ) ; } } return $ definition ; } else { throw new InvalidConfigException ( "Unsupported definition type for \"$name\": " . gettype ( $ definition ) ) ; } }
format the definition.
@param  string $name class name
@param  string|array|callable $definition the class definition
@return array the formated class definition
@throws InvalidConfigException if the definition is invalid.
format the definition .