# StatusCommand

> Displays the state of every scaffold-tracked file against the disk and the current provider stubs.

[API reference](/docs/api/index.md) › [Scaffold](/docs/extensions/scaffold/reference/index.md) › [Console](/docs/extensions/scaffold/reference/console/index.md) › [Command](/docs/extensions/scaffold/reference/console/command/index.md) › StatusCommand

| final class | `PHPForge\Scaffold\Console\Command\StatusCommand` |
| --- | --- |
| Extends | [`AbstractScaffoldCommand`](/docs/extensions/scaffold/reference/console/command/abstractscaffoldcommand/index.md) » `Symfony\Component\Console\Command\Command` |
| Source | [`src/Console/Command/StatusCommand.php`](https://github.com/php-forge/scaffold/blob/main/src/Console/Command/StatusCommand.php#L19) |

Displays the state of every scaffold-tracked file against the disk and the current provider stubs.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`configure()`](#method-configure) protected | Declares the `--format` and `--exit-code` options. | `StatusCommand` |
| <span id="method-execute"></span>[`execute()`](/docs/extensions/scaffold/reference/console/command/abstractscaffoldcommand/index.md#method-execute) protected final | Validates the input, resolves the project root and runs [`AbstractScaffoldCommand::handle()`](/docs/extensions/scaffold/reference/console/command/abstractscaffoldcommand/index.md#method-handle). | [`AbstractScaffoldCommand`](/docs/extensions/scaffold/reference/console/command/abstractscaffoldcommand/index.md) |
| [`handle()`](#method-handle) protected | Prints the status of the tracked files. | `StatusCommand` |
| [`validate()`](#method-validate) protected | Returns whether `--format` is `table` or `json`. | `StatusCommand` |

## Method details

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

```php
protected function configure(): void
```

Declares the `--format` and `--exit-code` options.

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

```php
protected function handle(Symfony\Component\Console\Input\InputInterface $input, PHPForge\Scaffold\Console\SymfonyOutputWriter $out, string $projectRoot): int
```

Prints the status of the tracked files.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$input` | `Symfony\Component\Console\Input\InputInterface` | Input with the `--format` and `--exit-code` options. |
| `$out` | [`PHPForge\Scaffold\Console\SymfonyOutputWriter`](/docs/extensions/scaffold/reference/console/symfonyoutputwriter/index.md) | Output sink that receives the status table or JSON document and the error messages. |
| `$projectRoot` | `string` | Absolute path of the project root. |

**Returns**

`int`: Exit code of [`StatusService::run()`](/docs/extensions/scaffold/reference/services/statusservice/index.md#method-run).

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

```php
protected function validate(Symfony\Component\Console\Input\InputInterface $input, PHPForge\Scaffold\Console\SymfonyOutputWriter $out): bool
```

Returns whether `--format` is `table` or `json`.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$input` | `Symfony\Component\Console\Input\InputInterface` | Input with the `--format` option. |
| `$out` | [`PHPForge\Scaffold\Console\SymfonyOutputWriter`](/docs/extensions/scaffold/reference/console/symfonyoutputwriter/index.md) | Output sink that receives the error message. |

**Returns**

`bool`: `true` when the format is known, `false` otherwise.