private function withAttributeHelper(string $collection, string $key, string $value)
    {
        $newAttributes = $this->$collection->withAttribute($key, $value);

        $that = clone($this);
        $that->$collection = $newAttributes;

        return $that;
    }
private function withAttributeHelper(string $collection, string $key, string $value)
    {
        $newAttributes = $this->$collection->withAttribute($key, $value);

        $that = clone($this);
        $that->$collection = $newAttributes;

        return $that;
    }
private function withAttributeHelper ( string $ collection , string $ key , string $ value ) { $ newAttributes = $ this -> $ collection -> withAttribute ( $ key , $ value ) ; $ that = clone ( $ this ) ; $ that -> $ collection = $ newAttributes ; return $ that ; }
Return a new object with the particular attribute on the specified collection set.

This is just a helper to collapse HTML and BODY handling.

@param string $collection
Either htmlAttributes or bodyAttributes.
@param string $key
The attribute to set.
@param string $value
The value to which to set it.

@return static
Return a new object with the particular attribute on the specified collection set .