Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor (Option::type) More consistant constants #94

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

NeoVance
Copy link
Contributor

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

Devon Bagley added 3 commits July 19, 2018 14:01
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
 - Replace ::class since this was introduced in 5.5
 - Constants could not be declared with expressions until 5.6
Use explicit class name as string for is_subclass_of
@tolidano
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants