Download the PHP package cmatosbc/hephaestus without Composer
On this page you can find all versions of the php package cmatosbc/hephaestus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cmatosbc/hephaestus
More information about cmatosbc/hephaestus
Files in cmatosbc/hephaestus
Package hephaestus
Short Description A PHP library for functional error handling
License GPL-3.0-or-later
Informations about the package hephaestus
Hephaestus
God-like error handling library for modern PHP programmers. Hephaestus provides a comprehensive set of tools for elegant error handling, combining functional programming concepts with robust exception management.
Features
- Option Type: Rust-inspired
Some/None
type for safe handling of nullable values - Enhanced Exceptions: Advanced error handling with state tracking and exception history
- Retry Mechanism: Built-in retry capabilities for transient failures
- Symfony Integration: Seamless integration with Symfony framework (optional)
- Type Safety: Full PHP 8.1+ type system support
Requirements
- PHP 8.1 or higher
- Symfony 7.1 or higher (optional, for bundle integration)
Installation
Basic Installation
Symfony Bundle Installation
- Install the package as shown above
-
Register the bundle in
config/bundles.php
: - Configure the bundle in
config/packages/hephaestus.yaml
:
Core Components
Option Type
The Option type provides a safe way to handle potentially null values:
Enhanced Exception Handling
The EnhancedException
class provides state tracking and exception history management:
Retry Mechanism
Built-in retry capabilities for handling transient failures:
Symfony Integration
Option Factory Service
The bundle provides an OptionFactory
service with built-in retry capabilities:
HTTP-Aware Exceptions
The SymfonyEnhancedException
class provides HTTP-specific error handling:
Key Benefits
- Type Safety: Leverage PHP 8.1+ type system for safer code
- Functional Approach: Chain operations with map, filter, and match
- Explicit Error Handling: Make potential failures visible in method signatures
- State Tracking: Capture and maintain error context and history
- Resilient Operations: Built-in retry mechanism for transient failures
- Framework Integration: Seamless Symfony integration when needed
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the GNU General Public License v3.0 or later - see the LICENSE file for details. This means you are free to use, modify, and distribute this software, but any modifications must also be released under the GPL-3.0-or-later license.