public static function get_class_component(string $fullclassname) : ?string {

        // Strip out leading backslash.
        $fullclassname = ltrim($fullclassname, '\\');

        $nextbackslash = strpos($fullclassname, '\\');
        if ($nextbackslash === false) {
            // Global space.
            return 'core';
        }
        $component = substr($fullclassname, 0, $nextbackslash);

        // All core subsystems use core's version.php.
        if (strpos($component, 'core_') === 0) {
            $component = 'core';
        }

        return $component;
    }
public static function get_class_component(string $fullclassname) : ?string {

        // Strip out leading backslash.
        $fullclassname = ltrim($fullclassname, '\\');

        $nextbackslash = strpos($fullclassname, '\\');
        if ($nextbackslash === false) {
            // Global space.
            return 'core';
        }
        $component = substr($fullclassname, 0, $nextbackslash);

        // All core subsystems use core's version.php.
        if (strpos($component, 'core_') === 0) {
            $component = 'core';
        }

        return $component;
    }
public static function get_class_component ( string $ fullclassname ) : ? string { // Strip out leading backslash. $ fullclassname = ltrim ( $ fullclassname , '\\' ) ; $ nextbackslash = strpos ( $ fullclassname , '\\' ) ; if ( $ nextbackslash === false ) { // Global space. return 'core' ; } $ component = substr ( $ fullclassname , 0 , $ nextbackslash ) ; // All core subsystems use core's version.php. if ( strpos ( $ component , 'core_' ) === 0 ) { $ component = 'core' ; } return $ component ; }
Returns the component the class belongs to.

Note that this method does not work for global space classes.

@param  string $fullclassname Qualified name including the namespace.
@return string|null Frankenstyle component
Returns the component the class belongs to .