Skip to content

Migrate to mapper 3.0.0 and extend the HTTP client and server.#59

Merged
gustavofreze merged 8 commits into
mainfrom
feature/mapper
Jun 6, 2026
Merged

Migrate to mapper 3.0.0 and extend the HTTP client and server.#59
gustavofreze merged 8 commits into
mainfrom
feature/mapper

Conversation

@gustavofreze
Copy link
Copy Markdown
Member

Please follow the contributing guidelines.

Summary

What this pull request does.

Related issue

Closes #...

Checklist

  • Tests added or updated.
  • Documentation updated when applicable.
  • composer review passes.
  • composer tests passes.

Replace the local path repository with the published 3.0.0 release and
adopt its renamed API (Serializable, Mappable, IterableMappable,
ElementType). Bump guzzlehttp/guzzle and phpstan/phpstan in the same
dependency pass.
- Add HttpBuilder::withDefaultHeaders, merged under per-request headers.
- Add typed header, query, and raw-body accessors on server requests.
- Add Code timeout predicates and ContentType media-type accessors.
Copilot AI review requested due to automatic review settings June 6, 2026 15:54
@gustavofreze gustavofreze merged commit 5c86a69 into main Jun 6, 2026
8 checks passed
@gustavofreze gustavofreze deleted the feature/mapper branch June 6, 2026 15:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the library to work with tiny-blocks/mapper 3.x and expands the HTTP surface with additional typed helpers for both server-side request handling and client-side request/response ergonomics.

Changes:

  • Migrate mapper integration from Mapper/*Mapper APIs to the new Serializable/Mappable APIs.
  • Extend server request decoding with query/header/raw-body access and add route-attribute selection via Uri::only(...).
  • Extend client ergonomics with default headers support, Response::orFail(), RFC 8288 Link headers, and ContentType helpers.

Reviewed changes

Copilot reviewed 64 out of 65 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Unit/Server/ResponseTest.php Update mapper wording in test.
tests/Unit/Server/RequestTest.php Add tests for query/headers/raw body and Uri::only.
tests/Unit/LinkTest.php Add tests for RFC 8288 Link header.
tests/Unit/HttpTest.php Add tests for default header precedence.
tests/Unit/HttpBuilderTest.php Add tests for builder immutability and default headers.
tests/Unit/HeadersTest.php Add tests for Headers::attribute.
tests/Unit/CookieTest.php Refine BDD annotations and immutability assertion.
tests/Unit/ContentTypeTest.php Add tests for ContentType::toString() and mimeType().
tests/Unit/CodeTest.php Add tests for tryFromNullable and isTimeout.
tests/Unit/Client/ResponseTest.php Add tests for Response::orFail().
tests/Models/Products.php Migrate iterable model to mapper v3 APIs.
tests/Models/Product.php Migrate object model to Mappable.
tests/Models/Order.php Migrate object model to Mappable.
src/Server/Request.php Add query/header/headers/rawBody helpers.
src/Server/Decoded/Uri.php Add only(keys: ...) route extraction.
src/LinkRelation.php Add link-relation enum.
src/Link.php Add RFC 8288 Link header value object.
src/Internal/Server/Stream/StreamFactory.php Switch body serialization to Serializable.
src/Internal/Client/RequestResolver.php Add default headers merging before JSON defaults.
src/HttpBuilder.php Add default headers support to builder.
src/Http.php Add optional default headers to Http::with(...).
src/Headers.php Simplify canonical header replacement and add attribute().
src/Exceptions/LinkUriIsInvalid.php Add exception for invalid Link URIs.
src/Exceptions/HttpResponseUnsuccessful.php Add exception used by Response::orFail().
src/Exceptions/BodyTypeIsUnsupported.php Update wording to Serializable.
src/ContentType.php Add toString(), mimeType(), and fix toArray().
src/Code.php Add tryFromNullable() and isTimeout().
src/Client/Transports/NetworkTransport.php Minor PSR-17 call cleanup.
src/Client/Response.php Add orFail() helper.
README.md Document new APIs: only, raw body, pagination links, default headers, orFail, ContentType.
composer.json Bump mapper to ^3.0 and update dev deps.
CLAUDE.md Add repo conventions index at root.
.gitignore Ignore local PHPStan/Infection overrides and Claude local settings.
.github/workflows/ci.yml Adjust concurrency group prefix.
.github/copilot-instructions.md Point mandatory step to root CLAUDE.md.
.gitattributes Align export-ignore list with repo contents.
.claude/skills/tiny-blocks-create/SKILL.md Add/refresh scaffolding skill docs.
.claude/skills/tiny-blocks-create/assets/github/workflows/ci.yml Add canonical CI asset.
.claude/skills/tiny-blocks-create/assets/github/PULL_REQUEST_TEMPLATE.md Add canonical PR template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/feature_request.md Add canonical feature template asset.
.claude/skills/tiny-blocks-create/assets/github/ISSUE_TEMPLATE/bug_report.md Add canonical bug template asset.
.claude/skills/tiny-blocks-create/assets/docs/SECURITY.md Add canonical security policy asset.
.claude/skills/tiny-blocks-create/assets/config/phpunit.xml Add canonical PHPUnit config asset.
.claude/skills/tiny-blocks-create/assets/config/phpstan.neon.dist Add canonical PHPStan config asset.
.claude/skills/tiny-blocks-create/assets/config/phpcs.xml Add canonical PHPCS config asset.
.claude/skills/tiny-blocks-create/assets/config/Makefile Add canonical Makefile asset.
.claude/skills/tiny-blocks-create/assets/config/infection.json.dist Add canonical Infection config asset.
.claude/skills/tiny-blocks-create/assets/config/composer.json Add canonical composer.json asset.
.claude/skills/tiny-blocks-create/assets/config/.gitignore Add canonical gitignore asset.
.claude/skills/tiny-blocks-create/assets/config/.gitattributes Add canonical gitattributes asset.
.claude/skills/tiny-blocks-create/assets/config/.editorconfig Add canonical editorconfig asset.
.claude/skills/tiny-blocks-consume/SKILL.md Add dependency discovery/reuse skill.
.claude/skills/tiny-blocks-consume/scripts/refresh-catalog.py Add Packagist catalog refresh script.
.claude/skills/tiny-blocks-consume/references/catalog.md Add generated tiny-blocks catalog.
.claude/skills/commit-message/SKILL.md Move commit-message guidance into a skill.
.claude/settings.json Add Claude settings baseline.
.claude/rules/php-library-tooling.md Update tooling invariants documentation.
.claude/rules/php-library-testing.md Tighten/clarify testing conventions.
.claude/rules/php-library-modeling.md Clarify modeling rules and enum guidance.
.claude/rules/php-library-github-workflows.md Update workflow conventions and invariants.
.claude/rules/php-library-documentation.md Narrow scope to README/docs and required files.
.claude/rules/php-library-architecture.md Clarify drivers test location conventions.
.claude/rules/php-library-code-style.md Expand formatting/code-style rules.
.claude/rules/php-library-commits.md Remove (superseded by commit-message skill).
.claude/CLAUDE.md Remove (replaced by root CLAUDE.md).

Comment thread src/HttpBuilder.php
Comment thread src/HttpBuilder.php
Comment thread src/Exceptions/HttpResponseUnsuccessful.php
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.

2 participants