Download the PHP package waffle-commons/console without Composer
On this page you can find all versions of the php package waffle-commons/console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download waffle-commons/console
More information about waffle-commons/console
Files in waffle-commons/console
Package console
Short Description Console component for Waffle framework.
License MIT
Informations about the package console
Waffle Console Component
Release:
0.1.0-beta5|CHANGELOG.md
A minimalist, zero-magic CLI runtime for the Waffle Framework (RFC-012). Commands are registered explicitly at boot โ no auto-discovery โ and resolve their dependencies through constructor injection.
๐ฆ Installation
๐งฑ Surface
| Class | Role |
|---|---|
Waffle\Commons\Console\ConsoleApplication |
final implementation of ConsoleApplicationInterface. Owns the command registry and the run loop. |
Waffle\Commons\Console\Command\AbstractCommand |
Base class โ implements CommandInterface with shared helpers. |
Waffle\Commons\Console\Command\CacheClearCommand |
cache:clear โ flushes the configured CacheInterface backend. |
Waffle\Commons\Console\Command\RouteListCommand |
route:list โ renders the compiled route table. |
Waffle\Commons\Console\Command\SecurityAuditCommand |
security:audit โ walks controllers and prints the resolved access ladder (#[Rule] / #[Voter]). |
Waffle\Commons\Console\Command\MigrateCommand |
db:migrate โ applies pending SQL migrations through the contracts MigrationRunnerInterface, then resets the pool. |
Waffle\Commons\Console\Command\MemoryAuditCommand |
igor:audit โ streams the monorepo-wide Igor memory-leak audit through the contracts AuditRunnerInterface. |
Waffle\Commons\Console\Command\DataWarmupCommand |
data:warmup โ pre-compiles SQR trees / routing tables into OPcache shared memory through the contracts DataWarmerInterface (Beta-3). |
Waffle\Commons\Console\Maker\Command\Make*Command |
The nine Waffle Maker scaffolders (RFC-020): make:controller, make:dto, make:entity, make:repository, make:middleware, make:voter, make:command, make:http-client, make:event-pair. |
Waffle\Commons\Console\Input\ArgvInput |
InputInterface implementation parsing argv. |
Waffle\Commons\Console\Output\StreamOutput |
Default OutputInterface writing to STDOUT / STDERR. |
Waffle\Commons\Console\Output\NullOutput |
Silent OutputInterface for tests / quiet runs. |
Waffle\Commons\Console\Exception\ConsoleException |
Base exception (implements ConsoleExceptionInterface). |
Waffle\Commons\Console\Exception\CommandNotFoundException |
Thrown when find($name) cannot resolve. |
Waffle\Commons\Console\Exception\InvalidArgumentException |
Thrown on invalid CLI argument shape. |
๐ Quick start
The exact signature of ConsoleApplication::__construct, verbatim from src/ConsoleApplication.php:
And the run loop:
๐ช Public API
run():
- With no arguments, prints the available-commands listing and exits with
ExitCode::USAGE. - The built-in
listcommand name reprints the same listing withExitCode::SUCCESS. -v/-vv/-vvv/--verbose/--very-verbose/--debug/--quietflags adjust output verbosity viaOutputInterface::setVerbosity(Verbosity).- Dispatches to the resolved command's
execute(InputInterface, OutputInterface): int. ConsoleExceptionInterfaceand any otherThrowableare caught and returned asExitCode::FAILURE, with the message printed to stderr.
๐ PHP 8.5 features used
final class ConsoleApplication.- Constructor property promotion +
private readonlyon every dependency. - Default
OutputInterface $output = new StreamOutput()โ PHP 8.1new in initializers. enum ExitCode: intandenum Verbosity(from contracts) for typed exit codes / verbosity levels.- Typed constants via
Waffle\Commons\Contracts\Console\Constant.
๐งญ Architectural boundary (mago guard)
An active dependency perimeter is enforced on every CI run by vendor/bin/mago guard (bundled into composer mago; zero baselines). The rules live in mago.toml under [guard.perimeter] โ a forbidden use statement fails the build, not a reviewer.
Production code under Waffle\Commons\Console may depend only on:
Waffle\Commons\Console\**โ itselfWaffle\Commons\Contracts\**โ the shared contracts package, the only Waffle dependency permittedPsr\**โ PSR interfaces@global+Psl\**โ PHP core and the PHP Standard Library
Test code under WaffleTests\Commons\Console is unrestricted (@all). Structural rules are guarded too: interfaces must be named *Interface, Exception\** classes must end in *Exception, and any Enum\** namespace may hold only enum declarations.
Contract-first, component-agnostic by construction: components compose through waffle-commons/contracts, never directly through one another.
๐งช Testing
๐ License
MIT โ see LICENSE.md.
All versions of console with dependencies
waffle-commons/contracts Version self.version
waffle-commons/utils Version self.version