Skip to content

Conversation

@rvtraveller
Copy link
Collaborator

Let's introduce the Version Tool package into Build Tools so we can leverage it in other PRs or work we're doing.

This includes a build:project:version command which is largely available just for testing purposes.

@sugaroverflow
Copy link
Contributor

@rvtraveller made some changes - @greg-1-anderson could you review if this is good to be merged now? Thank you!

@greg-1-anderson greg-1-anderson changed the base branch from master to main August 27, 2020 01:43
$application = $info->application();
$version = $info->version();
$major_version = explode(".", $version);
$framework = $application == "WordPress" ? "empty-wordpress" : (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a little more verbose for readability. Maybe break it out into its own function where you can use the pattern if (cond) { return } to avoid nesting and ternary operators.

$data = [
'application' => $info['application'],
'version' => $info['version'],
'major-version' => $info['major_version'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we used $info['major-version'] instead of major_version throughout the code, then we could just return $info here without having to create a mapping like this.

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.

4 participants