# CellMore

> Wraps long grid-cell content in a collapsible clamp with an expand/collapse pill toggle.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Helper](/docs/extensions/debug-core/reference/helper/index.md) › CellMore

| final class | `PHPForge\Debug\Helper\CellMore` |
| --- | --- |
| Source | [`src/Helper/CellMore.php`](https://github.com/php-forge/debug-core/blob/main/src/Helper/CellMore.php#L17) |

Wraps long grid-cell content in a collapsible clamp with an expand/collapse pill toggle.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`clamp()`](#method-clamp) static | Wraps the content only when its source payload is long enough to be worth collapsing. | `CellMore` |
| [`wrap()`](#method-wrap) static | Wraps the rendered cell content in the collapsible clamp container. | `CellMore` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-ROW_THRESHOLD"></span>`ROW_THRESHOLD` | `12` | Row count beyond which a table is worth collapsing. | `CellMore` |
| <span id="const-THRESHOLD"></span>`THRESHOLD` | `600` | Source length (bytes) beyond which a cell is worth collapsing. | `CellMore` |

## Method details

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

```php
public static function clamp(string $content, string $source): string
```

Wraps the content only when its source payload is long enough to be worth collapsing.

The decision reads the raw source rather than the rendered markup, so highlighting or trace lists never tip a
short value over the threshold.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$content` | `string` | Rendered cell HTML. |
| `$source` | `string` | Raw payload the content was rendered from. |

**Returns**

`string`: Original content or collapsible markup when the source exceeds the threshold.

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

```php
public static function wrap(string $content): string
```

Wraps the rendered cell content in the collapsible clamp container.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$content` | `string` | Rendered cell HTML to clamp; emitted verbatim inside the body container. |

**Returns**

`string`: Collapsible cell markup.