Config: remove code related to the now unsupported PEAR installation #1102
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.
Description
PR #4 dropped support for installing PHPCS via PEAR. This commit removes code related to a PEAR placeholder called
@data_dir@
as it is not necessary anymore.The original version of this code was added in 980c835#diff-36ecedca179eab0b3cd245e872a96ab26fa08e567437e167f4eda1779c15c89R1370-R1372. Two methods were added that use the
@data_dir@
placeholder in that commit:setConfigData()
andgetAllConfigData()
. A subsequent commit changedsetConfigData()
to only use the PEAR path for the config file if the@data_dir@
placeholder was replaced with something else: 7bb7383. A later commit did the same forgetAllConfigData()
together with other unrelated changes: 9392185.It seems that the PEAR file package.xml was responsible for replacing
@data_dir@
with an actual path:PHP_CodeSniffer/package.xml
Lines 293 to 295 in 6d22f38
PR #4 removed the
@data_dir@
related code fromsetConfigData()
, but not fromgetAllConfigData()
.Regarding this question asked in the issue, from all that I can see, it is safe to remove this code in 3.x. The removed if condition only evaluates to
true
and thus changes the value of the$configFile
variable if the@data_dir@
placeholder is modified in the code, which should not happen under supported circumstances. That being said, I'm happy to change the base branch of this PR to4.x
if you prefer.Suggested changelog entry
N/A
Related issues/external references
Fixes #1101
Types of changes
PR checklist