Skip to content

Move all classes to the Jschaedl\ApiClient namespace (0.2.0) - #3

Merged
jschaedl merged 1 commit into
mainfrom
feature/0.2.0-namespace
Oct 25, 2026
Merged

jschaedl merged 1 commit into
mainfrom
feature/0.2.0-namespace

Conversation

@jschaedl

Copy link
Copy Markdown
Owner

Summary

Breaking: every class moves from Api\ to Jschaedl\ApiClient\, and the sources from src/Api/ to src/. Class names, sub-namespaces and behaviour are unchanged. Released as 0.2.0.

Api\ is too generic for a library namespace: any application or package can claim it too. In the first consuming app (api-platform), eight test files already declare namespace Api\Match;. Jschaedl\ApiClient\ follows the usual Vendor\Package pattern and maps to the Packagist name jschaedl/api-client.

  • PSR-4 autoload is now "Jschaedl\\ApiClient\\": "src/"
  • 58 files moved with git mv, so history follows them
  • examples, README and a new CHANGELOG entry updated
  • UPGRADE-0.2.md has a one-liner for consumers. It was tested on PHP and YAML with BSD (macOS) and GNU grep: it rewrites use statements (group use included), fully qualified names, strings and YAML service IDs, and leaves MyApi\ / App\ApiResource\ alone. Rector isn't recommended: RenameNamespaceRector no longer exists in Rector 2, and RenameClassRector leaves use statements unchanged for classes that no longer exist.

Verification

  • No Api\ references left outside UPGRADE-0.1.md, which documents 0.1 and stays as it was
  • make tests on PHP 8.5: unit 64, integration 13, e2e 2
  • make cs-check, make analyse and rector --dry-run are clean

🤖 Generated with Claude Code

Api\ was too generic for a library: any application or package could
claim it as well. Every class moves to Jschaedl\ApiClient\ and the
sources from src/Api/ to src/; class names, sub-namespaces and
behaviour are unchanged. UPGRADE-0.2.md has a tested one-liner for
the migration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jschaedl
jschaedl merged commit aa558f0 into main Oct 25, 2026
20 checks passed
@jschaedl
jschaedl deleted the feature/0.2.0-namespace branch October 25, 2026 12:14
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