Inline If statement to echo CSS [closed]

It may helpful to you…

$video = (in_category ( 42 )) ? 'has-video' : '';

echo '<section id="cooked-recipe-list-' . $list_id_counter . '" class="cooked-clearfix cooked-recipe-' . $list_style . ' cooked-recipe-loader' . ( in_array( $list_style, $masonry_layouts ) ? ' cooked-masonry' : '' ) . ( isset($atts['columns']) && $atts['columns'] ? ' cooked-columns-' . $atts['columns'] : '' ) . ' ' . $video. '">';

Try this and let me know..