Download the PHP package timefrontiers/php-has-errors without Composer

On this page you can find all versions of the php package timefrontiers/php-has-errors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-has-errors

TimeFrontiers PHP Has Errors

Canonical, context-grouped error collection for PHP 8.5 and later. The package provides the HasErrors trait and a small public provider contract while keeping technical diagnostics separate from deliberately public messages.

Installation

Version 1.1 requires PHP 8.5 or later and timefrontiers/php-core:^1.1. timefrontiers/php-instance-error:^1.1.1 remains optional and provides rank-aware extraction and logging for consumers.

Canonical contract

Errors are grouped by a non-empty operation context. Every entry is exactly one five-element list:

Index Meaning Contract
0 Minimum access rank Integer from AccessRank::GUEST (0) through AccessRank::OWNER (14)
1 PHP error code Positive integer; helpers default to E_USER_ERROR
2 Message Non-empty string
3 Source file Optional internal string; path separators are normalized to /
4 Source line Non-negative integer; 0 means unavailable

File and line are trusted diagnostic metadata. Never include them in a guest or user response.

Provider contract

Make a provider explicit with TimeFrontiers\Contract\ErrorProvider. A class using the trait already has the required getErrors(): array method, but PHP requires the consuming class to declare the interface itself:

A callable public getErrors() method remains supported for 1.0 compatibility and is authoritative. If it throws or returns a non-array value, merging is a no-op; the extractor will not fall back to a property and accidentally bypass the provider contract.

Adding errors

The protected convenience methods assign these ranks:

Method Rank Intended content
_userError() Guest (0) Deliberately safe, actionable public text
_internalError() Moderator (4) Staff process diagnostics
_systemError() Developer (7) Redacted technical diagnostics
_debugError() Superadmin (8) Restricted debug diagnostics

Invalid local configuration—blank context/message, a rank outside 0..14, a non-positive code, or a negative line—throws InvalidArgumentException.

Public messages versus diagnostics

Rank filtering is not a data-safety classification. A rank-zero tuple imported from a legacy source might still contain SQL, credentials, tokens, personal data, a raw provider failure, or another technical detail.

Use the dedicated projection at a public response boundary:

These methods return only messages deliberately registered on that same object through _userError(). Generic _addError() entries and imported tuples are excluded even when their minimum rank is Guest. firstError() and errorMessages() remain diagnostic/rank-filtering compatibility APIs and do not establish that a message is safe for public output.

The package never sanitizes diagnostic content or writes logs. Send sensitive technical detail directly to an access-controlled, redacting logger; keep only a safe public message and an opaque internal correlation reference here.

Merging errors

Unscoped InstanceError::get() correctly remains grouped by context. Version 1.1 normalizes that grouped output and imports individual tuples, fixing the 1.0 empty-context corruption without changing InstanceError's contract.

Every imported collection and tuple is validated. Malformed contexts, nested lists, invalid ranks/codes, and invalid message/file/line types are rejected. Unsupported sources, inaccessible properties, throwing providers, and malformed providers are non-fatal no-ops. Repeating an identical merge does not append historical duplicates; newly observed canonical tuples are appended in source order.

The optional InstanceError adapter is used when available. Without it, the fallback can read only exact public legacy $errors or $_errors arrays. Protected and private members are never probed or read.

Reading and clearing

A null rank on firstError() or errorMessages() returns trusted diagnostic messages without filtering. Explicit ranks must be inside the AccessRank range. Clearing errors also clears the corresponding public-message projection.

Upgrading from 1.0

Development

The repository does not commit composer.lock. CI resolves both highest and lowest supported dependencies on PHP 8.5.

License

MIT


All versions of php-has-errors with dependencies

PHP Build Version
Package Version
Requires php Version >=8.5
timefrontiers/php-core Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package timefrontiers/php-has-errors contains the following files

Loading the files please wait ...