Add required CSS classes to the attributes.

@param array $attributes
@param NodeInterface $node
@param array $initialClasses
@return array
329382
protected function addCssClasses(array $attributes, NodeInterface $node, array $initialClasses = [])
    {
        $classNames = $initialClasses;
        // FIXME: The `dimensionsAreMatchingTargetDimensionValues` method should become part of the NodeInterface if it is used here .
        if ($node instanceof Node && !$node->dimensionsAreMatchingTargetDimensionValues()) {
            $classNames[] = 'neos-contentelement-shine-through';
        }

        if ($classNames !== []) {
            $attributes['class'] = implode(' ', $classNames);
        }

        return $attributes;
    }
686120
public function addNodes($nodes, $attributes = [])
    {
        foreach ($nodes as $pattern => $answers) {
            $this->addNode($pattern, $answers, $attributes);
        }
    }
293564
public function setDefaultValues(NodeInterface $node)
    {
        $nodeType = $node->getNodeType();
        foreach ($nodeType->getDefaultValuesForProperties() as $propertyName => $defaultValue) {
            $value = $node->getProperty($propertyName);
            if ((is_scalar($value) && trim($value) === '') || $value === null) {
                $node->setProperty($propertyName, $defaultValue);
            }
        }
    }
154387
public function afterNodeCreate(NodeInterface $node)
    {
        if (!($nodeType = $node->getNodeType())) {
            return;
        }
        // array with [beforeNodes, childNodes, afterNodes] keys
        $config = $this->getAssistanceConfigForNodeType($nodeType->getName());

        switch ($nodeType->getName()) {
            case 'TYPO3.Neos.NodeTypes:Image':
                $this->configureImage($node, $nodeType, $config);
                break;

            case 'M12.Foundation:GridRow1Col':
            case 'M12.Foundation:GridRow2Col':
            case 'M12.Foundation:GridRow3Col':
            case 'M12.Foundation:GridRow4Col':
                $this->configureGridRow($node, $nodeType);
                break;

            case 'M12.Foundation:GridColumn':
                break; // assistance text nodes are created from $this->configureGridRow()

            case 'M12.Foundation:RevealModal':
                $this->configureLinkingButton($node, $nodeType, $config, 'htmlDataRevealId');
                break;

            case 'M12.Foundation:Dropdown':
            case 'M12.Foundation:DropdownContent':
                $this->configureLinkingButton($node, $nodeType, $config, 'htmlDataDropdownId');
                break;

            default:
                $this->configureCreateAssistanceChildNodes($node, $nodeType, $config);
                break;
        }
    }
1036881
protected function markingClasses($node)
    {
        $classes = [];
        if (!$this->isExpanded($node)) {
            $classes[] = 'unexpanded';
        }

        // Set jstree open state, or mark it as a leaf (closed) if there are no children
        if (!$this->getNumChildren($node)) {
            // No children
            $classes[] = "jstree-leaf closed";
        } elseif ($this->isTreeOpened($node)) {
            // Open with children
            $classes[] = "jstree-open";
        } else {
            // Closed with children
            $classes[] = "jstree-closed closed";
        }
        return implode(' ', $classes);
    }
522375
public function setClasses( $classes )
	{
		$this->attributes['class']	= array();
		if( is_string( $classes ) )
			$classes	= explode( " ", $classes );
		if( !is_array( $classes ) && !( $classes instanceof ArrayIterator ) )
			throw new InvalidArgumentException( 'Class attribute must be string, array or iterator' );
		foreach( $classes as $class )
			$this->addClass( $class );
	}
1018265
protected function addAttributes(&$html, array $attributes)
	{
		if ( count($attributes) > 0 )
		{
			$attributes = Html::arrayToAttributes($attributes);

			$html .= ' ' . $attributes;
		}
	}
269726
public function initialize($attributes, $id = null)
    {
        if ($this->started) {
            return $this;
        }
        
        $this->id = $id ?: $this->id;
        $this->attributes = $attributes;
        $this->started = true;
        
        return $this;
    }
1331885
public function getNodeAttributes(Node $node) {
        // Extract the properties of the node
        $attributes = $node->getProperties();

        // Add the node id to the attributes since \\Orientdb\Node
        // does not consider it to be a property, it is treated differently
        // and available through the getId() method.
        $attributes[$this->model->getKeyName()] = $node->getId();

        return $attributes;
    }
655818
protected function addAttribute(AttributeInterface $attribute)
    {
        if (\in_array($attribute->getCode(), static::$reservedCodes, true)) {
            throw new AttributeConfigurationException("Attribute code '{$attribute->getCode()}' is a reserved code");
        }
        $this->attributes[$attribute->getCode()] = $attribute;
    }
1077278
public static function div($content, $class = '', array $attributes = null) {
        return self::tag('div', $content, self::add_class($class, $attributes));
    }
675661
protected function addClass($cssClass, &$attributes)
    {
        $class = array_get($attributes, 'class', '');
        if (!str_contains($class, $cssClass)) {
            $class .= ' ' . $cssClass;
        }
        return array_set($attributes, 'class', $class);
    }
394433
final public function addProfileSection(ArrayNodeDefinition $node, $defaults = true)
    {
        if ($defaults) {
            $node
                ->children()
                    ->arrayNode('profile')
                        ->canBeUnset()
                        ->children()
                            ->arrayNode('form')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->scalarNode('type')->defaultValue('fos_user_profile')->end()
                                    ->scalarNode('class')->defaultValue('FOS\UserBundle\Form\Type\ProfileFormType')->end()
                                    ->scalarNode('name')->defaultValue('fos_user_profile_form')->end()
                                    ->arrayNode('validation_groups')
                                        ->prototype('scalar')->end()
                                        ->defaultValue(array('Profile', 'Default'))
                                    ->end()
                                ->end()
                            ->end()
                            ->arrayNode('template')
                                ->addDefaultsIfNotSet()
                                ->children()
                                    ->scalarNode('edit')->defaultValue('RollerworksMultiUserBundle:UserBundle/Profile:edit.html.twig')->end()
                                    ->scalarNode('show')->defaultValue('RollerworksMultiUserBundle:UserBundle/Profile:show.html.twig')->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ;
        } else {
            $node
                ->children()
                    ->arrayNode('profile')
                        ->canBeUnset()
                        ->children()
                            ->arrayNode('form')
                                ->children()
                                    ->scalarNode('type')->end()
                                    ->scalarNode('class')->end()
                                    ->scalarNode('name')->end()
                                    ->arrayNode('validation_groups')
                                        ->prototype('scalar')->end()
                                    ->end()
                                ->end()
                            ->end()
                            ->arrayNode('template')
                                ->children()
                                    ->scalarNode('edit')->end()
                                    ->scalarNode('show')->end()
                                ->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ;
        }
    }
887280
public function addAttributeClass($classes)
    {
        if (is_string($classes)) {
            $classes = explode(',', $classes);
        }

        $classes = array_map('trim', $classes);
        $classes = array_filter($classes);

        if ( ! $this->offsetExists('class')) {
            $this->storage[ 'class' ] = [];
        }

        $this->storage[ 'class' ] = array_merge($this->storage[ 'class' ], $classes);
        $this->storage[ 'class' ] = array_unique($this->storage[ 'class' ]);

        if (in_array('disabled', $this->storage[ 'class' ])) {
            $this->removeAttributeClass('active');
        }

        return $this;
    }
1032725
public function init($attributes) 
    {
        $this->autoresize_types = array(  
            _('Fit to Width')      => 'max_width',
            _('Fit to Height')     => 'max_height',
            _('Scale')          => 'scale',
            _('Crop and Scale') => 'crop_and_scale',
        );

        parent::init($attributes);
        $this->fileInput = new FileInput( $this->name, $attributes);

        $this->imageCover = new Div(array('class' => 'formkit-image-cover'));
        $this->imageCover->setAttributeValue('data-width', $this->dataWidth ?: 200);
        $this->imageCover->setAttributeValue('data-height', $this->dataHeight);

        $this->inputWrapper = new Div;
        $this->inputWrapper
            ->addClass('formkit-widget-thumbimagefile')
            ->addClass('formkit-image-wrapper');

        // if it has a value, generate img
        if ($this->renderImageTag && $this->value) {
            $this->image = new Element('img',array(
                'src' => $this->prefix . $this->value,
            ));
            $this->imageCover->append($this->image);
        }

        if ($this->value) {
            $this->fileInput->setAttributeValue('data-image-src', $this->prefix . $this->value);
        }
        if ($this->exif) {
            $this->fileInput->setAttributeValue('data-exif', 'true');
        }
        if ($this->autoresize) {
            $this->fileInput->setAttributeValue('data-autoresize','true');
        }
        if ($this->droppreview) {
            $this->fileInput->setAttributeValue('data-droppreview','true');
        }
        if ($this->dropupload) {
            $this->fileInput->setAttributeValue('data-dropupload','true');
        }

        $this->fileInput->setAttributeValue('data-width', $this->dataWidth);
        $this->fileInput->setAttributeValue('data-height', $this->dataHeight);


        $this->inputWrapper->append($this->imageCover);
        $this->inputWrapper->append($this->fileInput);

        if ($this->autoresize && $this->autoresize_input) {
            $this->fileInput->setAttributeValue('data-autoresize-input','true');
            $checkbox = new CheckboxInput($this->name . '_autoresize');
            $checkbox->addClass('autoresize-checkbox');

            if( $this->autoresize_input_check ) {
                $checkbox->check();
            }

            $checkboxId = $checkbox->getSerialId();

            $label    = new Label(_("Use auto-resize"));
            $label->for($checkboxId);
            $resizeWrapper = new Div;
            $resizeWrapper->append($checkbox);
            $resizeWrapper->append($label);
            $resizeWrapper->addClass("autoresize");
            $this->inputWrapper->append($resizeWrapper);

            if ($this->autoresize_type_input) {
                $resizeTypeWrapper = new Div;
                $resizeTypeWrapper->addClass('autoresize-type');
                $typeSelector = new SelectInput($this->name . '_autoresize_type', [
                    'options' => $this->autoresize_types,
                    'value'   => $this->autoresize_type,
                ]);
                $typeSelector->addClass('autoresize-type-selector');
                $resizeTypeWrapper->append($typeSelector);
                $this->inputWrapper->append($resizeTypeWrapper);
            }

        }
    }
47794
public function addNode(NodeInterface $node): NodeInterface
    {
        $this->_nodes[$node->getId()] = $node;

        if ($this->getParent()) {
            $this->getParent()->addNode($node);
        }

        return $this;
    }
1331195
protected static function DOMNodeAttributes(DOMNode $node)
    {
        $attributes = array();

        foreach ($node->attributes as $attribute) {
            $attributes[$attribute->name] = $attribute->value;
        }

        return $attributes;
    }