<commit_before># ErrorDumper

[![Coverage Status](https://coveralls.io/repos/github/awesomite/error-dumper/badge.svg?branch=master)](https://coveralls.io/github/awesomite/error-dumper?branch=master)
[![Build Status](https://travis-ci.org/awesomite/error-dumper.svg?branch=master)](https://travis-ci.org/awesomite/error-dumper)

Debugger integrated with PhpStorm.
[@See](https://awesomite.github.io/error-dumper/examples/exception.html) example.

## Table of contents

* [Installation](#installation)
* [How to use?](#how-to-use)
  * [Development environment](#development-environment)
  * [Production environment](#production-environment)
  * [Sandbox](#sandbox)
  * [Integration with PhpStorm](#integration-with-phpstorm)
* [Versioning](#versioning)
* [Examples](#examples)

`ErrorDumper` allows you to catch all kinds of uncaught errors in PHP, serialize and restore them later.

## Installation

```bash
composer require awesomite/error-dumper
```

## How to use?

### Development environment

```php
use Awesomite\ErrorDumper\DevErrorDumper;

$errorDumper = new DevErrorDumper();
$errorDumper->getErrorHandler()
    ->registerOnException() // uncaught exceptions
    ->registerOnError() // errors @see http://php.net/manual/en/function.trigger-error.php
    ->registerOnShutdown(); // @see http://php.net/manual/en/function.error-get-last.php
```

### Production environment

#### Register handlers

```php
use Awesomite\ErrorDumper\ErrorDumper;<commit_msg>Documentation<commit_after># ErrorDumper

[![Coverage Status](https://coveralls.io/repos/github/awesomite/error-dumper/badge.svg?branch=master)](https://coveralls.io/github/awesomite/error-dumper?branch=master)
[![Build Status](https://travis-ci.org/awesomite/error-dumper.svg?branch=master)](https://travis-ci.org/awesomite/error-dumper)

Debugger integrated with PhpStorm.
`ErrorDumper` allows you to catch all kinds of errors and exceptions in PHP.
You will be able to serialize, restore and display them later in readable form.
[@See](https://awesomite.github.io/error-dumper/examples/exception.html) example.

## Table of contents

* [Installation](#installation)
* [How to use?](#how-to-use)
  * [Development environment](#development-environment)
  * [Production environment](#production-environment)
  * [Sandbox](#sandbox)
  * [Integration with PhpStorm](#integration-with-phpstorm)
* [Versioning](#versioning)
* [Examples](#examples)

## Installation

```bash
composer require awesomite/error-dumper
```

## How to use?

### Development environment

```php
use Awesomite\ErrorDumper\DevErrorDumper;

$errorDumper = new DevErrorDumper();
$errorDumper->getErrorHandler()
    ->registerOnException() // uncaught exceptions
    ->registerOnError() // errors @see http://php.net/manual/en/function.trigger-error.php
    ->registerOnShutdown(); // @see http://php.net/manual/en/function.error-get-last.php
```

### Production environment

#### Register handlers

```php
use Awesomite\ErrorDumper\ErrorDumper;
{'fraction_non_alphanumeric': 0.15640766902119072, 'fraction_numerical': 0.0, 'mean_word_length': 5.6532438478747205, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3120437', 'n_tokens_mistral': 1005, 'n_tokens_neox': 944, 'n_words': 169}