Skip to content

Shape classes to surface the public and internal contracts#26

Merged
stixx merged 1 commit into
mainfrom
public-api-surface
May 9, 2026
Merged

Shape classes to surface the public and internal contracts#26
stixx merged 1 commit into
mainfrom
public-api-surface

Conversation

@stixx
Copy link
Copy Markdown
Owner

@stixx stixx commented May 9, 2026

Mark the bundle's public API surface with @api and everything else with @internal, ahead of tagging 1.0.0. Tag-only change — no code or behavior is touched.

Public API surface (@api, 10 items)

Type Class / Interface Why
Bundle StixxOpenApiCommandBundle Registration entry point
Attribute Attribute\CommandObject Marks command arguments on controllers
Exception Exception\ApiProblemException Thrown by user code to express RFC 7807 problems
Interface Exception\ExceptionToApiProblemTransformerInterface Extension point — custom exception → problem mapping
Interface Responder\ResponderInterface Extension point — custom response shapes
Interface Response\StatusResolverInterface Extension point — custom status code resolution
Interface Validator\ValidatorInterface Extension point — custom request validators
Schema Model\ProblemDetails Referenced from user OpenAPI annotations
Schema Model\ProblemDetailsInvalidRequestBody Referenced from user OpenAPI annotations
Schema Model\Violation Referenced from user OpenAPI annotations

Everything else in src/ (controllers, DI extension/compiler passes, subscribers, route loaders/descriptors, normalizers, internal validator/responder chains, default implementations of the @api interfaces, the messenger unwrapper helper) is marked @internal.

What this commits us to

After 1.0:

  • Anything tagged @api is BC-protected. Breaking it requires a major version bump.
  • Anything tagged @internal can change in any release without notice.

Default implementations like JsonResponder, DefaultExceptionToApiProblemTransformer, RequestValidator are intentionally @internal — users replace them via the @api interfaces, not by extending the implementations.

Test plan

  • composer test — 181 tests pass
  • composer phpstan — clean
  • composer cs-fixer --dry-run — clean

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Warning

Rate limit exceeded

@stixx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 30 minutes and 5 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bcc61457-098c-4379-810b-3bba67bf62c4

📥 Commits

Reviewing files that changed from the base of the PR and between 70ef687 and df8533f.

📒 Files selected for processing (36)
  • src/Attribute/CommandObject.php
  • src/Controller/ArgumentResolver/CommandValueResolver.php
  • src/Controller/CommandController.php
  • src/DependencyInjection/Compiler/CollectControllerClassesPass.php
  • src/DependencyInjection/Compiler/CollectNelmioApiDocRoutesPass.php
  • src/DependencyInjection/Configuration.php
  • src/DependencyInjection/StixxOpenApiCommandExtension.php
  • src/EventSubscriber/ApiExceptionSubscriber.php
  • src/EventSubscriber/RequestValidatorSubscriber.php
  • src/Exception/ApiProblemException.php
  • src/Exception/DefaultExceptionToApiProblemTransformer.php
  • src/Exception/ExceptionToApiProblemTransformerInterface.php
  • src/Exception/WrappedExceptionUnwrapper.php
  • src/Model/ProblemDetails.php
  • src/Model/ProblemDetailsInvalidRequestBody.php
  • src/Model/Violation.php
  • src/Responder/JsonResponder.php
  • src/Responder/JsonSerializedResponder.php
  • src/Responder/NullableResponder.php
  • src/Responder/ResponderChain.php
  • src/Responder/ResponderInterface.php
  • src/Responder/ScalarResponder.php
  • src/Response/ResponseStatusResolver.php
  • src/Response/StatusResolverInterface.php
  • src/RouteDescriber/CommandRouteDescriber.php
  • src/Routing/Loader/AttributeDirectoryLoaderDecorator.php
  • src/Routing/Loader/CommandRouteClassLoader.php
  • src/Routing/Loader/CommandRouteDirectoryLoader.php
  • src/Routing/NelmioAreaRoutesChecker.php
  • src/Serializer/Normalizer/ApiProblemNormalizer.php
  • src/Serializer/Normalizer/ConstraintViolationListNormalizer.php
  • src/Serializer/Normalizer/ConstraintViolationNormalizer.php
  • src/StixxOpenApiCommandBundle.php
  • src/Validator/RequestValidator.php
  • src/Validator/RequestValidatorChain.php
  • src/Validator/ValidatorInterface.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch public-api-surface

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stixx stixx merged commit bd15297 into main May 9, 2026
6 checks passed
@stixx stixx deleted the public-api-surface branch May 9, 2026 23:28
@stixx stixx added the documentation Improvements or additions to documentation label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant