How to add tags (custom taxonomy) to post class css?

Ok I figured out how to add the terms to div’s class –

In the code I have first the category, then the post type, then a custom taxonomy tag term assigned to it –

<?php $terms = get_the_terms( $post->ID, 'YOUR CUSTOM TAXONOMY CAT' ); ?>
 <?php $post_type = get_post_type($post->ID); ?>
<div class="box<?php foreach( $terms as $term ) echo ' ' . $term->slug; ?><?php echo ' '.get_post_type( $post->ID ); ?> <?php  $terms = wp_get_post_terms($post->ID,'YOUR CUSTOM TAXONOMY TAGS');  
foreach ($terms as $term) {  
    echo $term->slug;  
}  
 ?>">