Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Http Client Implementation Laravel Package

psr-mock/http-client-implementation

Tiny PSR-18 HTTP client implementation intended for mocking and testing. Provides a simple client you can plug into PSR-7/PSR-17 workflows to return predefined responses without real network calls.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-Driven Development (TDD) & CI/CD Optimization: Enables faster, more reliable unit/integration tests for HTTP client interactions, reducing flakiness in pipelines and accelerating feedback loops.
  • Decoupling External Dependencies: Facilitates mocking third-party APIs (e.g., payment gateways, SaaS services) to isolate core logic from network variability, improving test stability.
  • Build vs. Buy: Avoids reinventing mocking infrastructure, reducing dev time and maintenance overhead compared to custom solutions.
  • Roadmap for Scalability: Supports future-proofing by aligning with PSR-18 standards and now enforcing PHP 8.1+, ensuring compatibility with modern PHP ecosystems (e.g., Laravel, Symfony) and leveraging newer language features.
  • Use Cases:
    • API-heavy applications (e.g., e-commerce, SaaS platforms).
    • Microservices with HTTP-based inter-service communication.
    • Legacy systems requiring test modernization.
    • New: Teams migrating to PHP 8.1+ or maintaining codebases already on PHP 8.1+.

When to Consider This Package

  • Adopt if:

    • Your team relies on PSR-18 HTTP clients (e.g., Guzzle, Symfony HTTP Client) and needs lightweight, maintainable mocks.
    • Tests frequently fail due to external API instability or rate limits.
    • You prioritize developer velocity over minimalist mocking libraries (e.g., Mockery or PHPUnit mocks).
    • Your stack includes Laravel/Symfony and you want PSR-compliant tooling.
    • New: Your project or team has PHP 8.1+ as a minimum requirement (or is willing to upgrade).
  • Look elsewhere if:

    • You need advanced mocking features (e.g., dynamic responses, request/response validation) beyond PSR-18 scope—consider Vcr or Pest plugins.
    • Your team lacks PHP/PSR familiarity; opt for language-agnostic tools (e.g., Postman Mock Servers).
    • Mocking requirements are trivial (e.g., simple in-memory stubs suffice).
    • New: You are stuck on PHP < 8.1 and cannot upgrade (e.g., legacy systems or hosting constraints).

How to Pitch It (Stakeholders)

Executives: "This package lets our dev team simulate HTTP calls (e.g., API payments, third-party integrations) without hitting real endpoints—cutting test flakiness by 50%+ and speeding up CI/CD. It’s a low-risk, MIT-licensed tool that aligns with our PHP stack, reduces dependency on external services during development, and now enforces PHP 8.1+ for better performance and modern features. Ideal for teams already on or upgrading to PHP 8.1."

Engineering: *"A lightweight PSR-18 mocking library to replace fragile curl/Guzzle stubs. Key benefits:

  • Faster tests: Isolate HTTP logic from network issues.
  • PSR-compliant: Works seamlessly with Laravel/Symfony HTTP clients.
  • Minimal setup: No complex configurations—just mock responses like HttpClient::mock()->withResponse(...).
  • PHP 8.1+: Leverages modern PHP features (e.g., named arguments, attributes) for cleaner syntax and performance. Tradeoff: Less feature-rich than Vcr, but ideal for 80% of HTTP mocking needs. Note: Requires PHP 8.1+—verify compatibility with your stack before adoption."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky