Rectangle Class

class Rectangle

Represents a Rectangle block

__construct(array|string $colour)

Create a new Rectangle block

Parameters:
  • $condition (?string) –

    The block colour

    • array - RGB(A) where RGB values are 0 <= value <= 255, and A is 0 <= value <= 1

    • string - HTML colour

Returns:

A new instance of Rectangle

Return type:

Rectangle

addItem(ItemInterface ...$item)

Add item(s)

Parameters:
  • ...$item (ItemInterface) – The item(s)

Returns:

A new instance of Rectangle with the item(s) added

Return type:

Rectangle

withComment(string $comment)

Sets a comment for the Rectangle

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Rectangle with the comment

Return type:

Rectangle

withItem(ItemInterface ...$item)

Set item(s)

Parameters:
  • ...$item (ItemInterface) – The item(s)

Returns:

A new instance of Rectangle with the item(s)

Return type:

Rectangle