private static function getBundleContentType(\stdClass $bundle): string
    {
        $mimeType = null;
        switch ($bundle->type) {
            case 'sass':
            case 'scss':
            case 'css':
            case 'stylesheet':
                $mimeType = 'text/css';
                break;
            case 'javascript':
            case 'js':
                $mimeType = 'application/javascript';
                break;
            default:
                if (isset($bundle->files[0])) { // first file in the list determines content-type
                    $firstFileMeta = $bundle->files[0];
                    $mimeType = mime_content_type($firstFileMeta->path);
                }
                break;
        }
        
        return $mimeType;
    }
private static function getBundleContentType(\stdClass $bundle): string
    {
        $mimeType = null;
        switch ($bundle->type) {
            case 'sass':
            case 'scss':
            case 'css':
            case 'stylesheet':
                $mimeType = 'text/css';
                break;
            case 'javascript':
            case 'js':
                $mimeType = 'application/javascript';
                break;
            default:
                if (isset($bundle->files[0])) { // first file in the list determines content-type
                    $firstFileMeta = $bundle->files[0];
                    $mimeType = mime_content_type($firstFileMeta->path);
                }
                break;
        }
        
        return $mimeType;
    }
private static function getBundleContentType ( \ stdClass $ bundle ) : string { $ mimeType = null ; switch ( $ bundle -> type ) { case 'sass' : case 'scss' : case 'css' : case 'stylesheet' : $ mimeType = 'text/css' ; break ; case 'javascript' : case 'js' : $ mimeType = 'application/javascript' ; break ; default : if ( isset ( $ bundle -> files [ 0 ] ) ) { // first file in the list determines content-type $ firstFileMeta = $ bundle -> files [ 0 ] ; $ mimeType = mime_content_type ( $ firstFileMeta -> path ) ; } break ; } return $ mimeType ; }
Get the content-type of a bundle.
There are default content-types for the type specified for a bundle.
If no type is recognized this function will lookup the mime-content-type of the first file in the bundle's list.

@param \stdClass $bundle
The bundle to get the content-type of.

@return string The content-type of the bundle.
Get the content - type of a bundle . There are default content - types for the type specified for a bundle . If no type is recognized this function will lookup the mime - content - type of the first file in the bundle s list .