public static function register( $type, $class_name )
    {
        if( !in_array($type, self::$registered_components) )
        {
            self::$registered_components[$type] = $class_name;
        }
        else throw new \RuntimeException("A component of type '$type' has already been registered.");
    }
public static function register( $type, $class_name )
    {
        if( !in_array($type, self::$registered_components) )
        {
            self::$registered_components[$type] = $class_name;
        }
        else throw new \RuntimeException("A component of type '$type' has already been registered.");
    }
public static function register ( $ type , $ class_name ) { if ( ! in_array ( $ type , self :: $ registered_components ) ) { self :: $ registered_components [ $ type ] = $ class_name ; } else throw new \ RuntimeException ( "A component of type '$type' has already been registered." ) ; }
Register a custom component class. If the given component name is similar
to the name of one of the core components, it will override it. If a
custom component with a similar name has already been registered, an
exception will be thrown.

@param string $type
@param string $class_name
@throws \RuntimeException
Register a custom component class . If the given component name is similar to the name of one of the core components it will override it . If a custom component with a similar name has already been registered an exception will be thrown .