# Application

> Runs the status, providers, diff, eject, reapply, prune and sync commands as the vendor/bin/scaffold console application.

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

| final class | `PHPForge\Scaffold\Console\Application` |
| --- | --- |
| Extends | `Symfony\Component\Console\Application` |
| Source | [`src/Console/Application.php`](https://github.com/php-forge/scaffold/blob/main/src/Console/Application.php#L26) |

Runs the `status`, `providers`, `diff`, `eject`, `reapply`, `prune` and `sync` commands as the
`vendor/bin/scaffold` console application.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the application and registers the scaffold commands. | `Application` |
| [`resolveVersion()`](#method-resolveVersion) static | Returns the installed version of `$package` from Composer's runtime metadata, or [`Application::FALLBACK_VERSION`](/docs/extensions/scaffold/reference/console/application/index.md#const-FALLBACK_VERSION) when the metadata does not list it. | `Application` |
| [`getDefaultInputDefinition()`](#method-getDefaultInputDefinition) protected | Returns the default input definition with the global `--working-dir` (`-d`) option added. | `Application` |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-FALLBACK_VERSION"></span>`FALLBACK_VERSION` | `'0.3.x-dev'` | Version reported when Composer's runtime metadata does not list the package. | `Application` |
| <span id="const-NAME"></span>`NAME` | `'php-forge/scaffold'` | Application / Composer package name. | `Application` |

## Method details

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

```php
public function __construct()
```

Creates the application and registers the scaffold commands.

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

```php
public static function resolveVersion(string $package = \self::NAME): string
```

Returns the installed version of `$package` from Composer's runtime metadata, or [`Application::FALLBACK_VERSION`](/docs/extensions/scaffold/reference/console/application/index.md#const-FALLBACK_VERSION)
when the metadata does not list it.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$package` | `string` | Composer package name to query; defaults to this application's package. |

**Returns**

`string`: Installed pretty version (for example, `1.2.0` or `dev-main`), or the fallback version.

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

```php
protected function getDefaultInputDefinition(): Symfony\Component\Console\Input\InputDefinition
```

Returns the default input definition with the global `--working-dir` (`-d`) option added.

**Returns**

`Symfony\Component\Console\Input\InputDefinition`: Symfony's default definition extended with `--working-dir`.