Foreachh Class

class Foreachh

Represents a foreach loop

Implements ItemInterface

__construct(string $condition)

Create a new Foreachh

Parameters:
  • $condition (string) – The loop condition

Returns:

A new Foreachh instance

Return type:

Foreachh

addItem(ItemInterface ...$interface)

Add item(s)

Parameters:
Returns:

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

Return type:

Foreachh

withComment(string $comment)

Sets a comment for the Foreachh

Parameters:
  • $comment (string) – The comment

Returns:

A new instance of Foreachh with the comment

Return type:

Foreachh

withItem(ItemInterface ...$interface)

Set item(s)

Parameters:
Returns:

A new instance of Foreachh with the item(s)

Return type:

Foreachh