Skip to content

Fix/classmap Autoloading#1

Merged
jasperf merged 8 commits into
mainfrom
fix/classmap-autoloading
May 22, 2026
Merged

Fix/classmap Autoloading#1
jasperf merged 8 commits into
mainfrom
fix/classmap-autoloading

Conversation

@jasperf
Copy link
Copy Markdown
Contributor

@jasperf jasperf commented May 22, 2026

This branch resolves a classmap autoloading issue in the Waygate plugin and establishes foundational developer documentation for AI-assisted contributions. The autoloader was switched from PSR-4 to classmap in composer.json, which corrects class resolution failures that arose from the plugin's file naming convention (class-*.php) not aligning with PSR-4's strict file-to-class-name mapping requirements. Alongside the fix, a CLAUDE.md file was introduced to document project architecture, commands, and contribution conventions for Claude Code sessions. The changelog was updated to record these changes under v0.3.0.

Autoloader Fix:

  • Replaced the PSR-4 autoloader definition in composer.json with a classmap entry targeting the includes/ directory, ensuring all class-*.php files are correctly discovered regardless of naming convention.
  • This resolves class-not-found errors at runtime caused by the mismatch between WordPress-style file names and PSR-4's file-path-to-namespace mapping requirements.

Developer Documentation:

  • Added CLAUDE.md with comprehensive guidance covering project overview, required commands (Composer, PHPUnit, PHPCS, PHP lint), class responsibilities, initialization order, and external dependencies.
  • Refined the atomic commit guidance in CLAUDE.md to clarify how to group and split commits by logical change, using the v0.3.0 patch itself as a worked example.

Repository Hygiene:

  • Updated .gitignore to exclude the PR creation shell script, preventing ephemeral tooling files from being tracked in version history.
  • CHANGELOG.md updated to document the v0.3.0 release, covering the autoloader fix and documentation additions.

Files Changed:

jasperf and others added 8 commits May 22, 2026 09:34
WordPress-style class-hyphenated-name.php filenames do not comply with
PSR-4, causing Composer to skip all four plugin classes during autoload
generation. classmap scans files and maps classes regardless of filename.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jasperf jasperf merged commit 4b06afc into main May 22, 2026
4 checks passed
@jasperf jasperf deleted the fix/classmap-autoloading branch May 22, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant