TinyMCE style formats for different post types

I’m making a website with a “portfolio” post type and I need different style formats for that post type. I know how I can add style formats for all post in functions.php:

add_filter( 'tiny_mce_before_init', 'mce_before_init' );
function mce_before_init( $settings ) {    
    $style_formats = array(
        array(
            'title'   => '.code-snippet',
            'block'   => 'div',
            'classes' => 'code'
        ),
        array(
            'title'   => '.left',
            'block'   => 'aside',
            'classes' => 'inset-left'
        )
    );    
    $settings['style_formats'] = json_encode( $style_formats );    
    return $settings;
}

How can I add different style formats for “portfolio” and not for all entries?

Solutions Collecting From Web of "TinyMCE style formats for different post types"