2017 © Pedro Peláez
 

library error-handler

Error Handler

image

ignaszak/error-handler

Error Handler

  • Monday, April 17, 2017
  • by ignaszak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

# ignaszak/error-handler

This package provides error handler interface, (*1)

Installation

"require" : {
    "ignaszak/error-handler" : "dev-master"
}

Requirements

  • PHP >= 7.0.0
  • PHPUnit >= 6.0.0

Usage

Development mode

<?php
/**
 * Created by PhpStorm.
 * User: tomek
 * Date: 02.09.16
 * Time: 14:45
 */

declare(strict_types=1);

use Ignaszak\ErrorHandler\Handler;
use Ignaszak\ErrorHandler\View\Dev\DevView;

include __DIR__ . '/vendor/autoload.php';
include 'included_file.php';

define('CONSTANT', 'demo');

// Start and register error handler with development interface
$handler = Handler::start(new DevView());
$handler->register();

// Make some errors for test

function test() {
    $func('test');
}

test();

try {
    throw new Exception();
} catch (Exception $e) {
    $handler->catch($e);
}

Cli mode

If You are running your app in console you can use CliView., (*2)

<?php

use Ignaszak\ErrorHandler\Handler;
use Ignaszak\ErrorHandler\View\Cli\CliView;

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

$handler = Handler::start(new CliView());
$handler->register();

The Versions

17/04 2017

dev-master

9999999-dev

Error Handler

  Sources   Download

MIT

The Requires

 

by Tomasz Ignaszak

exception error handler