assegaiphp / common
Shared HTTP, logging, path, exception, and queue primitives for AssegaiPHP packages.
Requires
- php: >=8.4
- assegaiphp/attributes: ^1.0
- guzzlehttp/guzzle: ^7.5
- psr/log: ^3.0
- symfony/console: ^8.0
Requires (Dev)
- pestphp/pest: ^4.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
AssegaiPHP Common
Shared HTTP, logging, path, exception, and queue primitives for AssegaiPHP packages.
assegaiphp/common contains the small contracts and implementations that need to remain consistent across the framework ecosystem. It is infrastructure for first-party packages, not the AssegaiPHP application framework itself.
The package currently provides:
- an injectable HTTP client
- PSR-3-compatible logging support
- shared framework and HTTP exceptions
- path helpers and terminal color enumerations
- queue interfaces, typed job encoding, job-type discovery, and process results used by the official queue transports
Requirements
- PHP 8.4 or newer
Installation
composer require 'assegaiphp/common:~0.11.0'
HTTP client
use Assegai\Common\Http\HttpClient; use GuzzleHttp\Client; $client = new HttpClient(new Client()); $response = $client->get('https://example.com/api/status');
Queue contracts
The queue contracts provide a transport-neutral boundary shared by packages such as assegaiphp/beanstalkd and assegaiphp/rabbitmq. JsonQueueJobCodec preserves a job's top-level class and JSON-safe state, while QueueJobTypeResolver discovers the domain type declared by a processor.
Applications normally consume these contracts through Core dependency injection and the official queue packages rather than constructing the transport boundary directly.
Contributing
For contribution and pull request conventions, see Commit and PR Guidelines.
License
This package is released under the MIT license.