-
Notifications
You must be signed in to change notification settings - Fork 2
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
Modernize codebase (v2.x) and QA #22
base: 2.x
Are you sure you want to change the base?
Conversation
- Require PHP 7.4+ and WP 5.5+ (so we can rely on wp_get_environment_type()) - Update all dependencies' requirements - Update code to be compliant with latest coding standards and Psalm - Deprecate "Spaces" hosting
private const ENV_ALIASES = [ | ||
'local' => self::LOCAL, | ||
'development' => self::DEVELOPMENT, | ||
'dev' => self::DEVELOPMENT, | ||
'develop' => self::DEVELOPMENT, | ||
'staging' => self::STAGING, | ||
'stage' => self::STAGING, | ||
'preprod' => self::STAGING, | ||
'pre-prod' => self::STAGING, | ||
'pre-production' => self::STAGING, | ||
'test' => self::STAGING, | ||
'uat' => self::STAGING, | ||
'production' => self::PRODUCTION, | ||
'prod' => self::PRODUCTION, | ||
'live' => self::PRODUCTION, | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was replaced by using wp_get_environmen_type()
. Will this affect current systems which are using the non-defined WordPress env types (local, development, staging, production)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The replaced code was still reducing the env names to the one supported by WP. Because after being obtained, the environment was "normalized" to one of the class constants which are exactly the values returned by wp_get_environmen_type()
.
Moreover, if you were using a WP version that has wp_get_environment_type()
available (and considering that's 5.5+ chances are you are) the class was already using wp_get_environment_type()
.
In short, this change is just removing a good amount of complexity that was there just to account for WP < 5.5, which we don't want to care anymore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me so far. Only have 1 question regarding the replacment of our ENV_ALIAS with the wp_get_enviornment_type()
core function.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Maintenance.
What is the current behavior? (You can also link to an open issue here)
N/A
What is the new behavior (if this is a feature change)?
No new behavior.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Other information:
wp_get_environment_type()
)