# ReapplySummary

> Counts the outcomes of a reapply run and formats its summary line.

[API reference](/docs/api/index.md) › [Scaffold](/docs/extensions/scaffold/reference/index.md) › [Services](/docs/extensions/scaffold/reference/services/index.md) › ReapplySummary

| final class | `PHPForge\Scaffold\Services\ReapplySummary` |
| --- | --- |
| Source | [`src/Services/ReapplySummary.php`](https://github.com/php-forge/scaffold/blob/main/src/Services/ReapplySummary.php#L15) |

Counts the outcomes of a `reapply` run and formats its summary line.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-errors"></span>`$errors` | `int` | Number of entries skipped for an error. Default: `0`. | `ReapplySummary` |
| <span id="property-skipped"></span>`$skipped` | `array<string, int>` | Number of entries skipped without an error, keyed by reason (`ejected`, `orphaned`, `preserve`, `user-modified`), in first-seen order. Default: `[]`. | `ReapplySummary` |
| <span id="property-unchanged"></span>`$unchanged` | `int` | Number of entries whose destination already matched. Default: `0`. | `ReapplySummary` |
| <span id="property-written"></span>`$written` | `int` | Number of entries written, or that a dry run would write. Default: `0`. | `ReapplySummary` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`line()`](#method-line) | Returns the summary line, such as `[scaffold] reapply: 3 written, 7 unchanged, 1 skipped (user-modified), 0 errors.`. | `ReapplySummary` |
| [`skip()`](#method-skip) | Counts an entry skipped without an error. | `ReapplySummary` |

## Method details

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

```php
public function line(bool $dryRun = false): string
```

Returns the summary line, such as `[scaffold] reapply: 3 written, 7 unchanged, 1 skipped (user-modified), 0
errors.`.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$dryRun` | `bool` | Whether the run only previewed the changes. |

**Returns**

`string`: Summary line prefixed with `[scaffold]`.

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

```php
public function skip(string $reason): void
```

Counts an entry skipped without an error.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$reason` | `string` | Skip reason: `ejected`, `orphaned`, `preserve` or `user-modified`. |