commando icon indicating copy to clipboard operation
commando copied to clipboard

Refactor (Option::type) More consistant constants

Open NeoVance opened this issue 6 years ago • 1 comments

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

NeoVance avatar Jul 19 '18 21:07 NeoVance

I created a PHP 5.4-7.1 version of this and then a PHP 7.2 version: https://github.com/tolidano/commandox/releases

tolidano avatar Jun 13 '19 01:06 tolidano