php-cooper-config

Cli
in package

FinalYes

`vendor/bin/cooper-config`: the `cooper:*` commands (see `JOetjen\CooperConfig\Command`) as a standalone Symfony Console application, for a project with no `bin/console` or artisan to register them with.

  • cooper:init (alias init) -- scaffolds config/.
  • cooper:check (alias check) -- loads and reports; exit 1 on error.
  • cooper:cache:clear (alias cache:clear) -- removes every compiled file.

The aliases are the names the script had before it was a Symfony Console application, so deploy scripts keep working. They are set here and not on the commands, where they would land in a framework's shared command namespace (bin/console init).

The script itself is Cli::application()->run(Cli::input($argv)): built here rather than in the script so tests drive exactly what it runs.

Table of Contents

Methods

application()  : Application
The application, every `cooper:*` command registered with its old name as an alias.
input()  : ArgvInput
`$argv` as the application's input. `help`, `--help` or `-h` alone means `list`: before this was a Symfony Console application each listed the commands, where Symfony's own would describe `help` itself. `help <command>` is Symfony's, unchanged.
__construct()  : mixed

Methods

application()

The application, every `cooper:*` command registered with its old name as an alias.

public static application([string|null $projectRoot = null ]) : Application
Parameters
$projectRoot : string|null = null

the project root, or null for the Composer root package's directory

Return values
Application —

ready to run()

input()

`$argv` as the application's input. `help`, `--help` or `-h` alone means `list`: before this was a Symfony Console application each listed the commands, where Symfony's own would describe `help` itself. `help <command>` is Symfony's, unchanged.

public static input(array<int, string> $argv) : ArgvInput
Parameters
$argv : array<int, string>

the script's arguments, its own name first

Return values
ArgvInput

__construct()

private __construct() : mixed
On this page

Search results