Change record status: 
Project: 
Introduced in branch: 
8.0.x
Description: 

Added helper method to the Attribute class to help test existence of CSS class in PHP and Twig templates.

Twig before:

{% if 'node' in attributes.class.value %}

Twig after:

{% if attributes.hasClass('node') %}

PHP before:

<?php
  $classes = $variables['attributes']['class']->value();
  if(in_array('node', $classes))
  {
    // write your code
  }
?>

PHP after:

<?php
  if($variables['attributes']->hasClass('node'))
  {
    // write your code
  }
?>
Impacts: 
Module developers
Themers