Download the PHP package timefrontiers/php-instance-error without Composer
On this page you can find all versions of the php package timefrontiers/php-instance-error. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download timefrontiers/php-instance-error
More information about timefrontiers/php-instance-error
Files in timefrontiers/php-instance-error
Download timefrontiers/php-instance-error
More information about timefrontiers/php-instance-error
Files in timefrontiers/php-instance-error
Vendor timefrontiers
Package php-instance-error
Short Description PHP Instance Error handler with access-based filtering
License MIT
Homepage https://github.com/timefrontiers/php-instance-error
Package php-instance-error
Short Description PHP Instance Error handler with access-based filtering
License MIT
Homepage https://github.com/timefrontiers/php-instance-error
Please rate this library. Is it a good library?
Informations about the package php-instance-error
TimeFrontiers PHP Instance Error
Extract and filter errors from objects based on user access rank.
Installation
Overview
InstanceError extracts errors from any object that has:
- A
getErrors()method (recommended, used byHasErrorstrait), or - A public
$errorsproperty (legacy)
Errors are filtered based on the user's access rank, so sensitive system errors only appear to developers/admins.
Error Format
Errors must follow this format:
Where min_rank is the minimum AccessRank value required to see this error.
Usage
Basic Usage
Override Rank
Helper Methods
Logging Errors
If timefrontiers/php-error-log is installed:
Adding Errors
Rank Resolution
When no override is provided, rank is resolved in this order:
- Global
$session->access_rankproperty - Global
$session->access_rank()method - Default:
AccessRank::GUEST(0)
Integration with HasErrors Trait
Objects using the HasErrors trait work seamlessly:
Access Rank Levels
| Rank | Value | Typical Use |
|---|---|---|
| GUEST | 0 | Validation, user-facing errors |
| USER | 1 | Basic user errors |
| MODERATOR | 4 | Business logic errors |
| DEVELOPER | 7 | SQL, connection errors |
| SUPERADMIN | 8 | Sensitive debug info |
Dependencies
timefrontiers/php-core- ForAccessRankenumtimefrontiers/php-has-errors- For error handling trait
License
MIT
All versions of php-instance-error with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
timefrontiers/php-core Version ^1.0
timefrontiers/php-has-errors Version ^1.0
timefrontiers/php-core Version ^1.0
timefrontiers/php-has-errors Version ^1.0
The package timefrontiers/php-instance-error contains the following files
Loading the files please wait ...