commando
commando copied to clipboard
Refactor (Option::type) More consistant constants
Add class for holding constants which are common accross classes and performing simple value operations and comparisons. DEPRECATE the current constants, which are similar but use different naming and values to mean the same thing in other classes.
BREAKING: The original constant values used in the Command class have changed.
- Add enumerator class to contain Option type constant values along with some utility functions for comparing types.
- Replace constant values with those from TypeEnum in Option
- Replace constant values with those from TypeEnum in Command
- Add dependency for systems without SplTypes PECL extension
- Tests for new class
Deprecated:
- Option::TYPE_SHORT
- Option::TYPE_VERBOSE
- Option::TYPE_NAMED
- Option::TYPE_ANONYMOUS
- Command::OPTION_TYPE_SHORT
- Command::OPTION_TYPE_VERBOSE
- Command::OPTION_TYPE_ARGUMENT
I created a PHP 5.4-7.1 version of this and then a PHP 7.2 version: https://github.com/tolidano/commandox/releases