Repository navigation
feat(dev:mode): add --clear-cache - #38
Merged
Merged
Conversation
Dropping the aggregated config cache meant toggling development mode off and on again, or reaching for the application's own clear-config-cache script. The new action removes the cache and changes nothing else. The reference has no cache-only action, so this is an addition beyond parity and is recorded as one in docs/v1/dev-mode.md. Three outcomes are reported separately: removed, nothing to remove, and present but unremovable. The last exits 1, matching the skeleton script the console replaces. Signed-off-by: Joey Smith <jsmith@webinertia.net>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
What
dev:mode --clear-cacheremoves the aggregated configuration cache and changes nothing else.Until now that meant toggling development mode off and on again, or reaching for the application's
own
bin/clear-config-cache.php.It is listed in the usage text beside the other actions, so it appears as a toggle in the menu too.
An addition, not parity
The reference has no cache-only action: it clears the cache as a side effect of enable/disable, and
the Mezzio skeleton ships a separate script for the standalone case. Recorded as row 13 in
docs/v1/dev-mode.mdwith the reason, so it does not read as an accidental divergence.Three outcomes, reported distinctly
Removed the config cache at "...".There is no config cache to remove.Unable to remove the config cache.The third matches the skeleton script, which also exits 1, and it is reachable: a directory at the
cache path satisfies
file_exists()while defeatingunlink(). Related,clearConfigCache()nolonger reports a removal that did not happen — it returned the path regardless of
unlink()'s result.error()stays as the single place the error markup is written; the metric was not worked around byduplicating it.
Gates
mago fmt --check/lint/analyze/guardtoo-many-methodsonDevelopmentModeCommandis suppressed with@mago-expectrather thanrestructured: the class is the flag plumbing for five actions, and splitting it further would spread
that plumbing across more types than the separation is worth.
One escaped mutant was found by the gate and killed rather than ignored — dropping the success return
in
clearCache()falls through to the "nothing to remove" branch, which also exits 0, so the test nowasserts that message's absence.