Annotation Reference

Below you find a list of all available annotations.

Developers Note

The following use-statements apply throughout the list.

<?php
use MCStreetguy\SmartConsole\Annotations\Application as App;
use MCStreetguy\SmartConsole\Annotations\Command as CLI;

Command Annotations

The following annotations apply to command handler action methods only.

CLI\DefaultCommand

Marks an action-method as the default command of the handler. This means it gets executed when no sub-command identifier has been specified.

This annotation gets ignored if only one action-method is present in the handler.

CLI\AnonymousCommand

Marks the default subcommand as anonymous, preventing it from beeing called by it's name.

This annotation depends on the CLI\DefaultCommand and gets silently ignored if the dependency is not present.

CLI\ShortName

Defines a short name for an option.

This annotation gets silently ignored if the given target name is not defined or not an option.

CLI\OptionalArgument

Enforces an parameter to be turned into an optional argument instead of an option.

If the target parameter is not present or not optional this annotation will be silently ignored.

CLI\Aliases

Defines a list of names that shall be registered as aliases for the (sub)command.

All aliases must only contain letters, digits and hyphens. Otherwise an exception is thrown.


Global Annotations

The following annotations apply to the configuration class instance only.

App\Version

Sets the application version string.

App\DebugMode

Run the application in debug-mode. This results in more detailled error output including stack traces and some more debugging-related features.

App\DisplayName

Sets the readable form of the application name. This gets used on the help page for example.