Skip to content

Releases: Thavarshan/fetch-php

Release 3.5.1

06 Jun 06:31
3.5.1
c40593a

Choose a tag to compare

Changed

  • Pinned Duster to the known-compatible 3.3.0 release so tag builds do not drift onto stricter formatter rules without an intentional style migration.

Full Changelog: 3.5.0...3.5.1

Release 3.5.0

06 Jun 06:24
3.5.0
62ea485

Choose a tag to compare

Added

  • Introduced a custom VitePress home page and shared docs theme components for a clearer first-run documentation experience.
  • Added lucide-powered feature icons and refreshed documentation examples around the JavaScript-style Fetch PHP API.

Changed

  • Updated Matrix helper imports throughout the README and documentation to consistently use the Matrix\Support namespace.
  • Refined homepage copy and feature descriptions to better explain Fetch PHP's JavaScript-like request flow, async helpers, caching, retries, debugging, and testing utilities.
  • Pinned Duster to the known-compatible 3.3.0 release so tag builds do not drift onto stricter formatter rules without an intentional style migration.
  • Hardened the tag release workflow now that package versions are derived from Git tags instead of a version field in composer.json.
  • Expanded the tag release workflow setup to match package extension requirements and run the release test suite with NO_NETWORK=1.

Fixed

  • Corrected stale GitHub/support links in the installation guide and repository support metadata.
  • Removed a stale cache comment that referenced the old ManagesCache trait name.

Full Changelog: 3.4.1...3.5.0

v3.4.1

24 Dec 07:57

Choose a tag to compare

Added

  • Introduced CODE_MAP.md as an internal reference of every public helper, trait, interface, and subsystem so docs/tests can stay aligned with the codebase.
  • Added a FetchWatch-style “health monitor” example demonstrating retries, pooling, caching, async batching, and debug snapshots in docs/examples/api-integration.md.

Changed

  • Expanded the API docs for fetch(), ClientHandler, and Response to cover the full option surface (cache/debug/profiler/async) and newly exposed helpers (debug snapshots, pooling controls, cache methods).
  • Clarified retry monitoring guidance to rely on PSR-3 logs or explicit counters instead of the debug() array, and documented sync-only caching behaviour for async requests.

Fixed

  • Removed references to the non-existent Fetch\Exceptions\TimeoutException across guides and examples, explaining how timeouts bubble up via NetworkException or Matrix’s TimeoutException.
  • Updated error-handling documentation to disambiguate timeout handling and ensure users catch the correct exception classes.

v3.4.0

07 Dec 16:45

Choose a tag to compare

Added

  • RFC 7234 HTTP Caching Support with intelligent cache control:

    • MemoryCache for fast in-memory caching
    • FileCache for persistent disk-based caching with TTL support
    • CacheControl parser for RFC 7234 compliant cache directive handling
    • CacheKeyGenerator with collision-resistant SHA-256 hashing
    • CachedResponse wrapper with metadata and validation support
    • ManagesCache trait integrated into ClientHandler for transparent caching
    • Automatic cache revalidation with If-None-Match and If-Modified-Since headers
    • Support for Cache-Control, ETag, Last-Modified, Expires, Age, and Vary headers
    • Configurable cache TTL, stale responses, and revalidation strategies
    • 802 new test assertions for caching functionality
  • Connection Pooling & HTTP/2 Support for improved performance:

    • ConnectionPool for managing persistent connections across hosts
    • HostConnectionPool for per-host connection management with limits
    • DnsCache for caching DNS lookups to reduce resolution overhead
    • Connection class for tracking connection state and reuse
    • PoolConfiguration for customizable pool settings (max connections, idle timeout, TTL)
    • Http2Configuration for HTTP/2 multiplexing and push support
    • ManagesConnectionPool trait with connection pool lifecycle management
    • Automatic connection recycling and health monitoring
    • 558 new test assertions for connection pooling
  • Debugging & Profiling Tools for request analysis:

    • DebugInfo class capturing detailed request/response information
    • FetchProfiler for comprehensive performance metrics and bottleneck detection
    • ManagesDebugAndProfiling trait for debug mode support
    • Sensitive header redaction and sanitization methods (Authorization, API keys, tokens)
    • Timing breakdown: DNS lookup, connection, TLS handshake, TTFB, transfer times
    • Memory usage tracking and cURL transfer statistics
    • Debug mode with detailed logging and inspection capabilities
    • 570 new test assertions for debugging/profiling features
  • New interfaces for extensibility:

    • CacheableHandler for cache manager access
    • CacheableRequestHandler for cache operations
    • DebuggableHandler for debug/profiling support
    • PoolAwareHandler for connection pool management

Changed

  • Refactored ClientHandler interface to extend multiple focused interfaces for better separation of concerns
  • Enhanced PerformsHttpRequests trait with integrated caching support
  • Improved PHPDoc comments with detailed parameter types for better IDE support and static analysis
  • Updated method signatures in RequestConfigurator to return specific types instead of self
  • Streamlined pre-commit script to use Composer commands instead of shell commands
  • Enhanced type hints across CacheManager, ManagesDebugAndProfiling, ManagesRetries, and PerformsHttpRequests traits

Fixed

  • Fixed timing precision issues in delay tests on Windows (#72)
  • Fixed PHPStan type inference for ClientHandler method chaining
  • Improved TTL behavior consistency in cache implementations
  • Enhanced null handling and race condition prevention in cache operations
  • Fixed status code handling consistency across caching layer
  • Improved URI handling in connection pool exceptions
  • Corrected time-to-first-byte calculation in profiling metrics
  • Enhanced code style consistency: proper namespace imports, class element ordering, and PHPDoc cleanup

Full Changelog: v3.3.0...v3.4.0

v3.3.0

17 Nov 04:06

Choose a tag to compare

Added

  • Comprehensive Testing Utilities inspired by Laravel's HTTP client testing:
    • MockServer with URL pattern matching (wildcards, method-specific, callbacks)
    • MockResponse fluent builder with convenience methods for all HTTP status codes
    • MockResponseSequence for testing retry logic and flaky endpoints
    • Recorder for capturing and replaying request/response pairs
    • Comprehensive assertion helpers (assertSent(), assertNotSent(), assertSentCount(), assertNothingSent())
    • Request recording with JSON export/import for test fixtures
    • Stray request prevention with allowlist support
  • HandlesMocking trait integrated into ClientHandler for request interception
  • Request::createFromBase() method for PSR-7 request conversion
  • 117 new tests with 288 assertions for testing utilities
  • Comprehensive testing documentation in docs/guide/testing.md (617 lines)
  • Complete API reference in docs/api/testing.md (539 lines)
  • Testing utilities section in VitePress sidebar navigation

Changed

  • Updated PerformsHttpRequests to support mock request interception
  • Enhanced ClientHandler with HandlesMocking trait for testing support

Fixed

  • Fixed async helper function imports to use correct Matrix\Support\* namespace:
    • Updated imports in ManagesPromises trait (async, await, all, any, race, reject, resolve, timeout)
    • Updated imports in PerformsHttpRequests trait (async)
    • Updated imports in ManagesPromisesTest and AsyncRequestsTest
  • All 282 tests now passing with 841 assertions

Removed

  • Removed Dependabot configuration (dependabot.yml)
  • Removed Dependabot auto-merge workflow

Full Changelog: v3.2.3...v3.3.0

v3.2.3

24 May 20:25

Choose a tag to compare

Added

  • Comprehensive test coverage for array body handling in ConfiguresRequestsTest
  • Explicit option conflict prevention in request body configuration
  • Better error prevention for Guzzle HTTP client integration

Changed

  • ConfiguresRequests::withBody() method now ensures mutual exclusivity of body-related options
  • Request option handling now explicitly removes conflicting options (json, body, form_params, multipart)
  • Improved reliability of JSON array requests by preventing option conflicts

Fixed

  • BREAKING FIX: Resolved Guzzle InvalidArgumentException when sending POST requests with array bodies
  • Fixed issue where both json and body options were set simultaneously, causing Guzzle to reject requests
  • Eliminated "Passing in the 'body' request option as an array to send a request is not supported" error
  • Restored ability to send structured JSON data using PHP arrays in request bodies
  • Fixed helper functions (post(), put(), patch(), etc.) failing with array payloads

Full Changelog: 3.2.2...3.2.3

v3.2.2

19 May 13:43
637387b

Choose a tag to compare

Fixed

  • "Fatal error: Uncaught Error: Interface Psr\Log\LoggerAwareInterface not found" closes #21

Full Changelog: 3.2.1...3.2.2

v3.2.1

17 May 10:34

Choose a tag to compare

Changed

  • Updated documentation
  • Updated dependencies

Full Changelog: 3.2.0...3.2.1

v3.2.0

16 May 20:19

Choose a tag to compare

Added

  • Added tests for various HTTP methods (GET, POST, PUT, DELETE, PATCH, OPTIONS) with appropriate assertions.

Changed

  • Simplified ManagesRetriesTest by using a mock class for retry-logic testing.
  • Consolidated tests for retryable status codes and exceptions into a single method.
  • Updated PerformsHttpRequestsTest to use GuzzleHttp client mocks for more accurate request simulation.
  • Enhanced exception-handling tests to verify error messages and retry behaviour.
  • Removed unnecessary reflection methods and streamlined test setup.

Fixed

  • Improved back-off delay calculations in retry tests to ensure correct timing.

v3.1.1

16 May 16:19

Choose a tag to compare

Added

  • Implemented the missing finalizeRequest() method in the PerformsHttpRequests trait. This method centralizes request finalization logic, enabling internal shortcut methods like get(), post(), etc., to function correctly.

Changed

  • Internal shortcut HTTP methods (get(), post(), put(), etc.) in PerformsHttpRequests now route through the newly added finalizeRequest() method for consistent request handling.

Fixed

  • Fixed a fatal error caused by calling an undefined finalizeRequest() method in ClientHandler. The missing method has now been properly defined and implemented.