fix: deduplicate PHP version and profiler lists#1026
Merged
Conversation
74c9356 to
1c7f69c
Compare
ca13554 to
40da87f
Compare
- Move profiler constants (ProfilerBlackfire, ProfilerTideways, etc.)
and Profilers list to internal/docker where they belong (Docker dev env concern)
- Add docker.ProfilerNeedsCredentials() replacing duplicate logic in setup_guide.go
- Remove wrapper profilerNeedsCreds() from setup_guide.go, callers now
use dockerpkg.ProfilerNeedsCredentials() directly
- Replace hardcoded phpVersions list in tab_config.go with
packagist.SupportedPHPVersions (single source of truth)
- Replace hardcoded profilers list in tab_config.go with dockerpkg.Profilers
- Replace hardcoded profilerChoices in setup_guide.go with constants from
dockerpkg ("none" kept as UI display label, maps to "" in config)
- Move TestProfilerNeedsCredentials from devtui to docker/compose_test.go
where it belongs (testing docker package's own function)
40da87f to
e743041
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PHP version and profiler lists were duplicated across 3 files:
Adding a new PHP version or profiler required updating multiple places with inconsistent sentinel values (empty string vs none).
Changes
New canonical source: internal/docker/
Updated consumers
Single source of truth
Related: Issues #5 and #6 in CODE_IMPROVEMENTS.md