# Cookbook

> Stores an ordered immutable collection of config calls.

[API reference](/docs/api/index.md) › [HTML Core](/docs/extensions/html-core/reference/index.md) › [Config](/docs/extensions/html-core/reference/config/index.md) › Cookbook

| final readonly class | `UIAwesome\Html\Core\Config\Cookbook` |
| --- | --- |
| Implements | [`Countable`](https://www.php.net/manual/en/class.countable.php), [`IteratorAggregate`](https://www.php.net/manual/en/class.iteratoraggregate.php) |
| Source | [`src/Config/Cookbook.php`](https://github.com/ui-awesome/html-core/blob/main/src/Config/Cookbook.php#L21) |

Stores an ordered immutable collection of config calls.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-calls"></span>`$calls` readonly | `list<`[`Call`](/docs/extensions/html-core/reference/config/call/index.md)`>` | Ordered config calls. | `Cookbook` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates a cookbook of ordered calls. | `Cookbook` |
| [`count()`](#method-count) | Returns the number of config calls. | `Cookbook` |
| [`getIterator()`](#method-getIterator) | Returns an iterator over the ordered config calls. | `Cookbook` |
| [`isEmpty()`](#method-isEmpty) | Whether the cookbook contains no config calls. | `Cookbook` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(UIAwesome\Html\Core\Config\Call ...$calls)
```

Creates a cookbook of ordered calls.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `...$calls` | [`Call`](/docs/extensions/html-core/reference/config/call/index.md) | Ordered config calls stored by the cookbook. |

**Throws**

- [`InvalidArgumentException`](https://www.php.net/manual/en/class.invalidargumentexception.php): If the calls are passed by name.

### count() <span id="method-count"></span>

```php
public function count(): int<0, max>
```

Returns the number of config calls.

**Returns**

`int<0, max>`: Number of config calls.

### getIterator() <span id="method-getIterator"></span>

```php
public function getIterator(): Traversable<int, UIAwesome\Html\Core\Config\Call>
```

Returns an iterator over the ordered config calls.

**Returns**

[`Traversable`](https://www.php.net/manual/en/class.traversable.php)`<int,` [`Call`](/docs/extensions/html-core/reference/config/call/index.md)`>`

### isEmpty() <span id="method-isEmpty"></span>

```php
public function isEmpty(): bool
```

Whether the cookbook contains no config calls.

**Returns**

`bool`: `true` if the cookbook has no calls, `false` otherwise.