VOOZH about

URL: https://deepwiki.com/hypervel/testbench/3.2-hyperf-and-hypervel-providers

⇱ Hyperf and Hypervel Providers | hypervel/testbench | DeepWiki


Loading...
Last indexed: 7 February 2026 (93289f)
Menu

Hyperf and Hypervel Providers

Purpose and Scope

This document catalogs the 45+ configuration providers managed by ConfigProviderRegister, breaking down their roles and functional domains. It distinguishes between the 20 Hyperf infrastructure providers (async runtime, HTTP server, database connections) and the 25 Hypervel application providers (Laravel-compatible APIs for auth, routing, validation, etc.).

For information about the ConfigProviderRegister API and methods for manipulating the provider registry, see ConfigProviderRegister API. For practical examples of adding, filtering, and removing providers in tests, see Dynamic Provider Management.

Sources: src/ConfigProviderRegister.php1-89


Provider Architecture Overview

The testbench system integrates two distinct layers of configuration providers:

  1. Hyperf Layer: Low-level infrastructure providers that establish the async runtime, coroutine management, HTTP server, database connections, and core framework services
  2. Hypervel Layer: High-level application providers that implement Laravel-compatible APIs on top of Hyperf's infrastructure

Provider Layer Architecture


Diagram: Provider layer architecture showing dependency relationships

The Hypervel layer builds on Hyperf's infrastructure. For example, Hypervel\Router\ConfigProvider depends on Hyperf\HttpServer\ConfigProvider for HTTP routing capabilities, while Hypervel\Queue\ConfigProvider and Hypervel\Cache\ConfigProvider both depend on Hyperf\Redis\ConfigProvider for their storage backends.

Sources: src/ConfigProviderRegister.php11-57


Hyperf Infrastructure Providers

The testbench includes 20 Hyperf providers that establish the foundational async runtime and core services. These providers are defined in src/ConfigProviderRegister.php12-31

Provider Taxonomy by Functional Domain


Diagram: Hyperf providers organized by functional domain

Hyperf Provider Reference Table

Provider ClassDomainPurpose
Hyperf\Command\ConfigProviderConsoleRegisters command-line interface components and console kernel
Hyperf\Database\SQLite\ConfigProviderDatabaseProvides SQLite driver and connection handling
Hyperf\DbConnection\ConfigProviderDatabaseManages database connection pooling and query builders
Hyperf\Di\ConfigProviderCoreConfigures dependency injection container and annotations
Hyperf\Dispatcher\ConfigProviderCoreHandles request/response dispatching and middleware
Hyperf\Engine\ConfigProviderCoreProvides coroutine engine and async runtime
Hyperf\Event\ConfigProviderEventsRegisters event dispatcher and listener management
Hyperf\ExceptionHandler\ConfigProviderError HandlingConfigures exception handlers and error reporting
Hyperf\Framework\ConfigProviderCoreProvides framework bootstrap and application lifecycle
Hyperf\HttpMessage\ConfigProviderHTTPImplements PSR-7 HTTP message interfaces
Hyperf\HttpServer\ConfigProviderHTTPConfigures HTTP server and request handling
Hyperf\Memory\ConfigProviderSystemManages memory limits and leak detection
Hyperf\ModelListener\ConfigProviderDatabaseHandles Eloquent model event listeners
Hyperf\Paginator\ConfigProviderDatabaseProvides pagination for database queries
Hyperf\Pool\ConfigProviderDatabaseManages connection pooling for databases and Redis
Hyperf\Process\ConfigProviderSystemHandles background processes and workers
Hyperf\Redis\ConfigProviderDatabaseConfigures Redis connections and pooling
Hyperf\Serializer\ConfigProviderDataHandles serialization/deserialization of objects
Hyperf\Server\ConfigProviderHTTPConfigures Swoole server and port bindings
Hyperf\Signal\ConfigProviderSystemManages system signal handling (SIGTERM, etc.)

Sources: src/ConfigProviderRegister.php12-31


Hypervel Application Providers

The testbench includes 25 Hypervel providers that implement Laravel-compatible APIs on top of Hyperf. These providers are defined in src/ConfigProviderRegister.php32-57

Provider Functional Categories


Diagram: Hypervel providers organized by functional category

Hypervel Provider Reference Table

Provider ClassCategoryPurpose
Hypervel\ConfigProviderCoreBase provider registering core Hypervel services
Hypervel\Auth\ConfigProviderSecurityAuthentication guards, providers, and middleware
Hypervel\Broadcasting\ConfigProviderCommunicationWebSocket broadcasting and event publishing
Hypervel\Bus\ConfigProviderJobsCommand bus for dispatching jobs and commands
Hypervel\Cache\ConfigProviderDataCache stores (Redis, array) and cache manager
Hypervel\Cookie\ConfigProviderSecurityCookie encryption, signing, and queue
Hypervel\Config\ConfigProviderCoreConfiguration repository and loaders
Hypervel\Console\ConfigProviderCoreArtisan-compatible console commands
Hypervel\Dispatcher\ConfigProviderCoreRequest lifecycle and middleware dispatcher
Hypervel\Encryption\ConfigProviderSecurityData encryption and decryption services
Hypervel\Event\ConfigProviderCoreEvent dispatcher with listener discovery
Hypervel\Foundation\ConfigProviderCoreApplication foundation and service providers
Hypervel\Hashing\ConfigProviderSecurityPassword hashing (Bcrypt, Argon2)
Hypervel\Http\ConfigProviderHTTPHTTP kernel, request/response handling
Hypervel\JWT\ConfigProviderSecurityJSON Web Token authentication
Hypervel\Log\ConfigProviderCoreLogging channels (Monolog integration)
Hypervel\Mail\ConfigProviderCommunicationEmail sending with multiple drivers
Hypervel\Notifications\ConfigProviderCommunicationMulti-channel notification system
Hypervel\ObjectPool\ConfigProviderDataObject pooling for resource management
Hypervel\Queue\ConfigProviderJobsQueue workers, connections, and failed jobs
Hypervel\Redis\ConfigProviderDataRedis facade and connection management
Hypervel\Router\ConfigProviderHTTPRoute registration and URL generation
Hypervel\Session\ConfigProviderSecuritySession management and storage
Hypervel\Translation\ConfigProviderLocalizationInternationalization and localization
Hypervel\Validation\ConfigProviderValidationRequest validation and rule engine

Sources: src/ConfigProviderRegister.php32-57


Optional Development Provider

The ConfigProviderRegister conditionally registers Hyperf\Devtool\ConfigProvider if the development tools package is installed. This provider adds debugging and development utilities.


Sources: src/ConfigProviderRegister.php59-66

The conditional check ensures the testbench works whether or not development tools are present, making it suitable for both development and CI/CD environments.


Provider Registration Flow

Registration Process Diagram


Diagram: Provider registration sequence during application creation

When TestCase::createApplication() executes, it retrieves the provider list from ConfigProviderRegister::get() and iterates through each provider class. Each provider's __invoke() method returns an array containing:

  • dependencies: Service bindings for the DI container
  • commands: Console command classes
  • listeners: Event listener mappings
  • annotations: Annotation scanner configuration
  • publish: Publishable assets and configuration

Sources: src/ConfigProviderRegister.php59-66


Provider Discovery and Resolution

Class Name Structure

All provider classes follow the fully-qualified class name pattern:

\{Vendor}\{Component}\ConfigProvider

Examples:

  • \Hyperf\Database\SQLite\ConfigProvider → Hyperf's SQLite component
  • \Hypervel\Auth\ConfigProvider → Hypervel's authentication component
  • \Hypervel\ConfigProvider → Hypervel's base provider (no component namespace)

Provider Array Storage

The providers are stored in a static array property $configProviders in src/ConfigProviderRegister.php11-57 This static property allows the registry to persist across test cases while still being modifiable via the add(), except(), and filter() methods.


Sources: src/ConfigProviderRegister.php11-57


Provider Dependencies and Load Order

Dependency Relationships


Diagram: Provider dependency graph showing which Hypervel providers require specific Hyperf infrastructure

The load order in ConfigProviderRegister::$configProviders is intentional:

  1. Hyperf providers first (lines 12-31): Establish infrastructure layer
  2. Hypervel providers second (lines 32-57): Build application layer on top

This ordering ensures that when Hypervel providers are instantiated, all required Hyperf services are already registered in the container.

Sources: src/ConfigProviderRegister.php11-57


Provider Count Summary

FrameworkProvider CountLines in Code
Hyperf20src/ConfigProviderRegister.php12-31
Hypervel25src/ConfigProviderRegister.php32-57
Optional (Devtool)1src/ConfigProviderRegister.php61-63
Total45-46N/A

The total provider count is 45 by default, or 46 when the optional Hyperf\Devtool\ConfigProvider is present in development environments.

Sources: src/ConfigProviderRegister.php11-66 composer.json22-29