2017 © Pedro Peláez
 

library error-handling

Robust and extensible error handling system for PHP

image

wecodein/error-handling

Robust and extensible error handling system for PHP

  • Wednesday, November 8, 2017
  • by dutekvejin
  • Repository
  • 2 Watchers
  • 3 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

error-handling

![Build Status][ico-build] Code Quality Code Coverage Latest Version PDS Skeleton, (*1)

Installation

The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json:, (*2)

composer require wecodein/error-handling

Usage

use WeCodeIn\ErrorHandling\Handler\ExceptionHandler;
use WeCodeIn\ErrorHandling\Handler\FatalErrorHandler;
use WeCodeIn\ErrorHandling\Handler\HandlerAggregate;
use WeCodeIn\ErrorHandling\Handler\ThrowableErrorHandler;
use WeCodeIn\ErrorHandling\Processor\CallableProcessor;

require __DIR__ . '/../vendor/autoload.php';

ini_set('log_errors', 0);
ini_set('display_errors', 0);

error_reporting(E_ALL);

$processor = new CallableProcessor(function (Throwable $throwable) : Throwable {
    // log, render...
    return $throwable;
});

$handler = new HandlerAggregate(
    new ThrowableErrorHandler(),
    new ExceptionHandler($processor),
    new FatalErrorHandler(20, $processor)
);

$handler->register();

trigger_error('Error');

Credits

License

Released under MIT License - see the License File for details., (*3)

The Versions

08/11 2017

dev-master

9999999-dev

Robust and extensible error handling system for PHP

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

error-handling wecodein