refactor(config): drop Repository::getEnvironment() (task 2.7) - #48
Merged
agissept merged 2 commits intoSep 16, 2026
Merged
Conversation
Remove getEnvironment(); the only fork-internal caller (the package afterLoading closure) now reads $me->environment directly. Loader/cascade/ ctor unchanged (minimal scope — evaporates at Wave 4 swap). Enforcement is runtime fatal: facade + injected callers become method-not-found. App-side conform (getEnvironment → App::environment()/app()->environment()) ships in a separate dicoding branch. Co-Authored-By: Claude <noreply@anthropic.com>
…task 0.2) Task 2.7 removed Config\Repository::getEnvironment() from the fork with no shim, so any surviving call is method-not-found (PHP+Psalm catches it). The grep-ratchet pattern is redundant with that type enforcement and, worse, false-positives on Queue\Listener::getEnvironment() — an unrelated worker method — keeping the count stuck at 1. Prune the pattern from the ratchet + baseline and move the row to a new "already type-enforced" section of the divergence ledger. First concrete slice of framework-first task 0.2 (demote ratchet to non-type patterns as components get type-tightened). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Sep 15, 2026
Base automatically changed from
migration/2.11-hashing-contracts
to
pre-release/4.2.93
September 16, 2026 02:58
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
Task 2.7 (minimal scope). Removes
Illuminate\Config\Repository::getEnvironment(). Loader/cascade/ctor unchanged (minimal scope — they evaporate at Wave 4 swap; see plan rationale).getEnvironment()deleted (~8 lines).package()afterLoadingclosure — now reads$me->environmentdirectly (closure bound to Repository scope).$environmentproperty + ctor(LoaderInterface, $env)+ loader/package-cascade kept intentionally.Why minimal scope
Doc 2.7 Steps also ask to remove the loader/package-cascade + change ctor to
(array). That would require re-implementing the L4.2 env-subdir cascade (config/local/,config/testing/) + package-namespace cascade (config/packages/...) in a new eager loader — code that gets deleted at swap (Repository is inreplace→ wholesale-replaced in Wave 4). High risk, zero convergence value. Done-when doc only requiresgrep getEnvironment( app = 0.getEnvironment()is the sole app-facing surface whose enforcement matters.Enforcement = runtime fatal (method removed → facade
Config::getEnvironment()+ injected$config->getEnvironment()become method-not-found), not grep. App-side guard is belt-and-suspenders.Verification
php vendor/bin/phpunit→ 1645 tests, 0 fail (21 skip baseline). Config\Repository boot via suite.grep getEnvironment( src/Illuminate/Config/= 0.App-side
Separate
dicodingbranchimprovement/l13-migration/config-getenvironment-conformmigrates ~37 callers →App::environment()/app()->environment()+ grep guard.🤖 Generated with Claude Code