Skip to content

Commit be2c045

Browse files
committed
Updated to version 1.1.3
1 parent 58ddcbe commit be2c045

File tree

6 files changed

+297
-119
lines changed

6 files changed

+297
-119
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 1.1.3 - 2017-05-15
4+
* Some files were excluded from download and comments and readme files were updated.
5+
6+
* Added `Josantonius\ErrorHandler\ErrorHandler->setParams()` method.
7+
* Added `Josantonius\ErrorHandler\ErrorHandler::setCustomMethod()` method.
8+
* Added `Josantonius\ErrorHandler\ErrorHandler->getCustomMethods()` method.
9+
10+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSetCustomMethod()` method.
11+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->_customMethodResponse()` method.
12+
313
## 1.1.2 - 2017-03-18
414
* Some files were excluded from download and comments and readme files were updated.
515

README-ES.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Librería PHP para manejar excepciones y errores.
1212
- [Requisitos](#requisitos)
1313
- [Cómo empezar y ejemplos](#cómo-empezar-y-ejemplos)
1414
- [Métodos disponibles](#métodos-disponibles)
15-
- [Imágenes](#imagenes)
1615
- [Uso](#uso)
1716
- [Tests](#tests)
1817
- [Manejador de excepciones](#manejador-de-excepciones)
18+
- [Imágenes](#imagenes)
1919
- [Contribuir](#contribuir)
2020
- [Repositorio](#repositorio)
2121
- [Licencia](#licencia)
@@ -57,19 +57,9 @@ use Josantonius\ErrorHandler\ErrorHandler;
5757
Métodos disponibles en esta librería:
5858

5959
```php
60-
ErrorHandler->error();
61-
ErrorHandler->exception();
62-
ErrorHandler->getErrorType();
63-
ErrorHandler->render();
64-
65-
### Imágenes
66-
67-
![image](resources/images/exception.png)
68-
![image](resources/images/error.png)
69-
![image](resources/images/notice.png)
70-
![image](resources/images/warning.png)
71-
60+
ErrorHandler::setCustomMethod();
7261
```
62+
7363
### Uso
7464

7565
Ejemplo de uso para esta librería:
@@ -83,6 +73,30 @@ use Josantonius\ErrorHandler\ErrorHandler;
8373
/* Se recomienda intanciar la clase en un archivo base como el index.php */
8474

8575
new ErrorHandler;
76+
77+
/**
78+
* Opcionalmente puedes introducir uno o más métodos para ejecutar en lugar de
79+
 * la vista predeterminada. El método indicado recibirá un array con los
80+
 * siguientes parámetros:
81+
*
82+
* [
83+
* 'type' => 'Error|Exception',
84+
* 'message' => 'exception|error mensaje',
85+
* 'file' => 'exception|error archivo',
86+
* 'line ' => 'exception|error línea',
87+
* 'code' => 'exception|error código de error',
88+
* 'http-code' => 'Código de estado de respuesta HTTP',
89+
* 'mode' => 'PHP|HHVM',
90+
* ];
91+
*
92+
*/
93+
$class = $this;
94+
95+
$method = 'customMethodResponse';
96+
97+
$times = 0; // Número de veces para repetir este método en caso de errores múltiples
98+
99+
ErrorHandler::SetCustomMethod($class, $method, $times);
86100
```
87101

88102
### Tests
@@ -111,6 +125,14 @@ ErrorHandlerTest->testSProvokeUserWarning();
111125
### Manejador de excepciones
112126

113127
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
128+
129+
### Imágenes
130+
131+
![image](resources/images/exception.png)
132+
![image](resources/images/error.png)
133+
![image](resources/images/notice.png)
134+
![image](resources/images/warning.png)
135+
114136
### Contribuir
115137
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
116138
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.

README.md

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ PHP library for handling exceptions and errors.
1212
- [Requirements](#requirements)
1313
- [Quick Start and Examples](#quick-start-and-examples)
1414
- [Available Methods](#available-methods)
15-
- [Images](#images)
1615
- [Usage](#usage)
1716
- [Tests](#tests)
1817
- [Exception Handler](#exception-handler)
18+
- [Images](#images)
1919
- [Contribute](#contribute)
2020
- [Repository](#repository)
2121
- [Licensing](#licensing)
@@ -57,17 +57,9 @@ use Josantonius\ErrorHandler\ErrorHandler;
5757
Available methods in this library:
5858

5959
```php
60-
ErrorHandler->error();
61-
ErrorHandler->exception();
60+
ErrorHandler::setCustomMethod();
6261
```
6362

64-
### Images
65-
66-
![image](resources/images/exception.png)
67-
![image](resources/images/error.png)
68-
![image](resources/images/notice.png)
69-
![image](resources/images/warning.png)
70-
7163
### Usage
7264

7365
Example of use for this library:
@@ -78,9 +70,34 @@ require __DIR__ . '/vendor/autoload.php';
7870

7971
use Josantonius\ErrorHandler\ErrorHandler;
8072

81-
/* It is recommended to instantiate the class in a base file as the index.php */
73+
/**
74+
* It is recommended to instantiate the class in a base file as the index.php */
8275

8376
new ErrorHandler;
77+
78+
/**
79+
* Optionally you can enter one or more methods to be executed instead the
80+
* default view. The indicated method will receive an array with the
81+
* following parameters:
82+
*
83+
* [
84+
* 'type' => 'Error|Exception',
85+
* 'message' => 'exception|error message',
86+
* 'file' => 'exception|error file',
87+
* 'line ' => 'exception|error line',
88+
* 'code' => 'exception|error code',
89+
* 'http-code' => 'HTTP response status code',
90+
* 'mode' => 'PHP|HHVM',
91+
* ];
92+
*
93+
*/
94+
$class = $this;
95+
96+
$method = 'customMethodResponse';
97+
98+
$times = 0; // Times number to repeat this method in case of multiple errors
99+
100+
ErrorHandler::SetCustomMethod($class, $method, $times);
84101
```
85102

86103
### Tests
@@ -99,6 +116,7 @@ use Josantonius\ErrorHandler\Tests\ErrorHandlerTest;
99116
Available test methods in this library:
100117

101118
```php
119+
ErrorHandlerTest->testSetCustomMethod();
102120
ErrorHandlerTest->testSProvokeException();
103121
ErrorHandlerTest->testSProvokeWarning();
104122
ErrorHandlerTest->testSProvokeNotice();
@@ -110,6 +128,14 @@ ErrorHandlerTest->testSProvokeUserWarning();
110128
### Exception Handler
111129

112130
This library uses [exception handler](src/Exception) that you can customize.
131+
132+
### Images
133+
134+
![image](resources/images/exception.png)
135+
![image](resources/images/error.png)
136+
![image](resources/images/notice.png)
137+
![image](resources/images/warning.png)
138+
113139
### Contribute
114140
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
115141
1. Fork the repository on GitHub to start making your changes.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "josantonius/errorhandler",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"type": "library",
55
"description": "PHP library for handling exceptions and errors.",
66
"keywords": [

0 commit comments

Comments
 (0)