# ConsoleUtil

> Helper for console.

[API reference](/docs/api/index.md) › [Foxy](/docs/extensions/foxy/reference/index.md) › [Util](/docs/extensions/foxy/reference/util/index.md) › ConsoleUtil

| final class | `Foxy\Util\ConsoleUtil` |
| --- | --- |
| Source | [`src/Util/ConsoleUtil.php`](https://github.com/php-forge/foxy/blob/main/src/Util/ConsoleUtil.php#L15) |

Helper for console.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`getInput()`](#method-getInput) static | Get the console input. | `ConsoleUtil` |
| [`getPreferredInstallOptions()`](#method-getPreferredInstallOptions) static | Returns preferSource and preferDist values based on the configuration. | `ConsoleUtil` |

## Method details

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

```php
public static function getInput(Composer\IO\IOInterface $io): Symfony\Component\Console\Input\InputInterface
```

Get the console input.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$io` | `Composer\IO\IOInterface` | The IO |

**Returns**

`Symfony\Component\Console\Input\InputInterface`

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

```php
public static function getPreferredInstallOptions(Composer\Config $config, Symfony\Component\Console\Input\InputInterface $input): array
```

Returns preferSource and preferDist values based on the configuration.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$config` | `Composer\Config` | The composer config. |
| `$input` | `Symfony\Component\Console\Input\InputInterface` | The console input |

**Returns**

`array`