chore(composer): drop the dead src/ PSR-4 autoload mapping - #27
Merged
Conversation
composer.json mapped UCSC\UcscCommunicationsFunctionality\ to src/, but the mapping was inert: no src/ directory, no namespaced classes, and plugin.php never requires vendor/autoload.php. vendor/ is gitignored and `npm run zip` does not ship it, so nothing autoloaded could have survived packaging either. Removes the `autoload` block only. `autoload-dev` (…\Tests\ -> tests/) stays, since the PHPUnit suite genuinely uses it. Building into src/ was the alternative and is out of scope here — it means restructuring all current procedural code, requiring the autoloader at runtime, and shipping vendor/ or a production autoloader in the release zip. If classes land later, the autoload block returns in the same commit as the first class. Docs updated to match: the CLAUDE.md "Namespace / autoloading" section now describes the procedural reality, and the stale quirk/deferred entries in CLAUDE.md and ROADMAP.md are replaced with a resolution record. Closes #24 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #24.
What
Removes the
autoloadblock fromcomposer.json:autoload-dev(UCSC\UcscCommunicationsFunctionality\Tests\→tests/) is kept — the PHPUnit suite genuinely uses it.Why
Option A from the issue, which is the one it recommends. The mapping was inert on three counts:
src/directory exists.require_oncefromplugin.php.plugin.phpnever requiresvendor/autoload.php, andvendor/is gitignored and not shipped bynpm run zip.So it loaded nothing and broke nothing, but advertised an architecture the plugin doesn't have.
Option B (build into
src/) was rejected as out of scope: it means restructuring all current procedural code, requiring the autoloader at runtime, and shippingvendor/or a generated production autoloader in the release zip — otherwise the plugin fatals on activation. If classes land later, theautoloadblock comes back in the same commit as the first class, along with that packaging work.Docs
CLAUDE.md— the "Namespace / autoloading" section now describes the procedural reality and records what re-adding autoloading would require; the stale Known quirks entry is removed.ROADMAP.md— the Deferred / not planned entry is replaced with a "Resolved after the audit" record carrying the cause and fix, matching how the other nine items are kept.Acceptance criteria
composer.jsonand the on-disk layout agree — the mapping is gone.composer run lintstill exits 0 (4/4 files, zero errors, zero warnings).CLAUDE.mdandROADMAP.mdentries updated.Verification
PHPUnit was run via the container fallback documented in
CLAUDE.md, since the localphp8.5lacksext-mbstring.🤖 Generated with Claude Code