VOOZH about

URL: https://deepwiki.com/hypervel/api-client/4.2-package-dependencies

⇱ Package Dependencies | hypervel/api-client | DeepWiki


Loading...
Menu

Package Dependencies

This document provides a comprehensive reference of the external dependencies required by the hypervel/api-client package. It explains the role of each dependency, how they integrate with the API client architecture, and version compatibility requirements.

For information about the overall architecture and how these dependencies fit into the system design, see Architecture Overview. For details about the core components that utilize these dependencies, see sections ApiClient through ApiResource.


Dependency Overview

The hypervel/api-client package has minimal external dependencies, relying primarily on two sibling packages within the Hypervel ecosystem. This lean dependency structure ensures lightweight integration while providing powerful HTTP communication and utility capabilities.

Dependency List

DependencyVersionPurpose
php^8.2Platform requirement for language features
hypervel/support^0.3Utility library providing pipeline and helper functions
hypervel/http-client^0.3HTTP client library providing base request/response classes

Sources: composer.json23-26


PHP Platform Requirements

The package requires PHP 8.2 or higher. This requirement enables the use of modern PHP features including:

  • Readonly properties for immutable configuration
  • Type system enhancements including true, false, and null types
  • Improved generics support via PHPDoc annotations
  • Performance improvements in the PHP runtime

The PHP 8.2 requirement is specified in composer.json24


Core Dependencies

hypervel/support

The hypervel/support package provides utility classes and helper functions used throughout the Hypervel ecosystem. Within hypervel/api-client, its primary contribution is the Pipeline component.

Pipeline Component

The Pipeline class implements the chain-of-responsibility pattern used for middleware processing. It enables:

  • Sequential middleware execution for request and response transformation
  • Context passing between middleware stages
  • Short-circuit support for early pipeline termination
  • Error handling during middleware processing

Diagram: hypervel/support Integration

The PendingRequest class instantiates Pipeline objects to process request and response middleware arrays. The pipeline receives an array of middleware classes, instantiates each one, and executes them in sequence, passing the request or response object through each stage.

Version: ^0.3 (specified in composer.json25)

Sources: composer.json25 High-Level System Architecture Diagram 1, Diagram 4


hypervel/http-client

The hypervel/http-client package provides the foundational HTTP communication layer. It serves as the bridge between the API client's high-level abstractions and actual network operations.

Provided Classes

The package provides two primary base classes that hypervel/api-client extends:

ClassExtended ByPurpose
HttpClientRequestApiRequestBase class for HTTP request objects
HttpClientResponseApiResponseBase class for HTTP response objects

HTTP Execution

Beyond base classes, hypervel/http-client handles:

  • PSR-7 compatibility for request and response objects
  • HTTP client operations using Guzzle or other HTTP adapters
  • Connection management including timeouts and retries
  • Low-level protocol handling for HTTP/1.1 and HTTP/2

Diagram: hypervel/http-client Integration

The inheritance relationship allows ApiRequest and ApiResponse to add API-specific functionality (like context management via the HasContext trait) while retaining all base HTTP capabilities. Meanwhile, PendingRequest delegates actual HTTP execution to the HTTP client, separating concerns between request orchestration and network communication.

Version: ^0.3 (specified in composer.json26)

Sources: composer.json26 High-Level System Architecture Diagram 1, Diagram 3


Component Dependency Mapping

The following table maps each core component to its external dependencies:

ComponentUses hypervel/supportUses hypervel/http-client
ApiClientNoNo
PendingRequestYes (Pipeline)Yes (HTTP execution)
ApiRequestNoYes (extends HttpClientRequest)
ApiResponseNoYes (extends HttpClientResponse)
ApiResourceNoNo
HasContextNoNo

Sources: composer.json23-26 High-Level System Architecture Diagram 1


Ecosystem Position

The hypervel/api-client package is positioned as a mid-level component within the Hypervel ecosystem, building upon lower-level packages while providing specialized API client functionality.


Diagram: Hypervel Ecosystem Hierarchy

This hierarchy allows:

  • Modular usage: Each package can be used independently
  • Progressive enhancement: Higher-level abstractions build on lower-level capabilities
  • Framework integration: Optional Hyperf framework integration without hard dependencies
  • Ecosystem consistency: Shared utilities and patterns across Hypervel packages

Sources: composer.json23-26 High-Level System Architecture Diagram 1


Version Compatibility

All Hypervel packages use semantic versioning and maintain synchronized major version numbers for compatibility.

Version Ranges

The ^0.3 version constraint specifies:

  • Minimum version: 0.3.0
  • Maximum version: < 1.0.0 (next major version)
  • Allows: All 0.3.x and 0.x releases where x > 3

This constraint ensures:

  • Feature compatibility: New features added in 0.4, 0.5, etc. are automatically available
  • Breaking change protection: Major version 1.0 will require explicit upgrade
  • Development flexibility: Pre-1.0 versions can evolve rapidly while maintaining compatibility

Branch Aliases

The package defines a branch alias in composer.json34-36:


This allows development versions from the main branch to satisfy the ^0.3 version constraint during local development or when using development dependencies.

Sources: composer.json23-26 composer.json34-36


Autoloading Configuration

The package uses PSR-4 autoloading with the namespace Hypervel\ApiClient\ mapped to the src/ directory, as defined in composer.json28-31

This structure enables:

  • Automatic class loading without manual require statements
  • Namespace consistency across the Hypervel ecosystem
  • IDE support for autocomplete and navigation

All classes referenced in this documentation follow this namespace convention:

  • Hypervel\ApiClient\ApiClient
  • Hypervel\ApiClient\PendingRequest
  • Hypervel\ApiClient\ApiRequest
  • Hypervel\ApiClient\ApiResponse
  • Hypervel\ApiClient\ApiResource
  • Hypervel\ApiClient\Traits\HasContext

Sources: composer.json28-31


Installation Context

When installing via Composer, all dependencies are resolved automatically:


This command will:

  1. Install hypervel/api-client version 0.3.x
  2. Resolve and install hypervel/support ^0.3
  3. Resolve and install hypervel/http-client ^0.3
  4. Verify PHP version >= 8.2

For detailed installation instructions, see Installation.

Sources: composer.json2 composer.json23-26