Skip to content

Commit 867c2d6

Browse files
committed
Initial upload files
0 parents  commit 867c2d6

18 files changed

+861
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_size = 4
6+
indent_style = space
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
phpunit.xml
2+
composer.phar
3+
composer.lock
4+
composer-test.lock
5+
vendor/
6+
build/artifacts/
7+
artifacts/
8+
docs/_build
9+
docs/*.pyc
10+
.git*/
11+
.idea
12+
.DS_STORE

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# CHANGELOG
2+
3+
## 1.0.0 - 2016-12-14
4+
* Added `Josantonius\ErrorHandler\ErrorHandler` class.
5+
* Added `Josantonius\ErrorHandler\ErrorHandler->__construct()` method.
6+
* Added `Josantonius\ErrorHandler\ErrorHandler->catchThrowable()` method.
7+
* Added `Josantonius\ErrorHandler\ErrorHandler->catchException()` method.
8+
* Added `Josantonius\ErrorHandler\ErrorHandler->catchError()` method.
9+
* Added `Josantonius\ErrorHandler\ErrorHandler->exception()` method.
10+
* Added `Josantonius\ErrorHandler\ErrorHandler->prepareException()` method.
11+
* Added `Josantonius\ErrorHandler\ErrorHandler->getErrorType()` method.
12+
* Added `Josantonius\ErrorHandler\ErrorHandler->show()` method.
13+
14+
## 1.0.0 - 2016-12-14
15+
* Added `Josantonius\ErrorHandler\Exception\ErrorHandlerException` class.
16+
* Added `Josantonius\ErrorHandler\Exception\Exceptions` abstract class.
17+
* Added `Josantonius\ErrorHandler\Exception\ErrorHandlerException->__construct()` method.
18+
19+
## 1.0.0 - 2016-12-14
20+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest` class.
21+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeException()` method.
22+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeWarning()` method.
23+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeNotice()` method.
24+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeUserError()` method.
25+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeUserNotice()` method.
26+
* Added `Josantonius\ErrorHandler\Tests\ErrorHandlerTest->testSProvokeUserWarning()` method.

CONDUCT.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct.
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
=====================
3+
4+
Copyright (c) `2016` `Josantonius, https://github.com/Josantonius <[email protected]>`
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
this software and associated documentation files (the "Software"), to deal in
8+
the Software without restriction, including without limitation the rights to
9+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
of the Software, and to permit persons to whom the Software is furnished to do
11+
so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

README-ES.md

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# PHP ErrorHandler library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/errorhandler/v/stable)](https://packagist.org/packages/josantonius/errorhandler) [![Total Downloads](https://poser.pugx.org/josantonius/errorhandler/downloads)](https://packagist.org/packages/josantonius/errorhandler) [![Latest Unstable Version](https://poser.pugx.org/josantonius/errorhandler/v/unstable)](https://packagist.org/packages/josantonius/errorhandler) [![License](https://poser.pugx.org/josantonius/errorhandler/license)](https://packagist.org/packages/josantonius/errorhandler)
4+
5+
[Spanish version](README-ES.md)
6+
7+
Librería PHP para manejar excepciones y errores.
8+
9+
---
10+
11+
- [Instalación](#instalación)
12+
- [Requisitos](#requisitos)
13+
- [Cómo empezar y ejemplos](#cómo-empezar-y-ejemplos)
14+
- [Métodos disponibles](#métodos-disponibles)
15+
- [Uso](#uso)
16+
- [Tests](#tests)
17+
- [Manejador de excepciones](#manejador-de-excepciones)
18+
- [Contribuir](#contribuir)
19+
- [Repositorio](#repositorio)
20+
- [Autor](#autor)
21+
- [Licencia](#licencia)
22+
23+
---
24+
25+
### Instalación
26+
27+
La mejor forma de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).
28+
29+
Para instalar PHP ErrorHandler library, simplemente escribe:
30+
31+
$ composer require Josantonius/ErrorHandler
32+
33+
### Requisitos
34+
35+
Esta ĺibrería es soportada por versiones de PHP 7.0 o superiores y es compatible con versiones de HHVM 3.0 o superiores.
36+
37+
Para utilizar esta librería en HHVM (HipHop Virtual Machine) tendrás que activar los tipos escalares. Añade la siguiente ĺínea "hhvm.php7.scalar_types = true" en tu "/etc/hhvm/php.ini".
38+
39+
### Cómo empezar y ejemplos
40+
41+
Para utilizar esta librería, simplemente:
42+
43+
```php
44+
require __DIR__ . '/vendor/autoload.php';
45+
46+
use Josantonius\ErrorHandler\ErrorHandler;
47+
```
48+
### Métodos disponibles
49+
50+
Métodos disponibles en esta librería:
51+
52+
```php
53+
ErrorHandler->catchThrowable();
54+
ErrorHandler->catchException();
55+
ErrorHandler->catchError();
56+
ErrorHandler->exception();
57+
ErrorHandler->prepareException();
58+
ErrorHandler->getErrorType();
59+
ErrorHandler->show();
60+
```
61+
### Uso
62+
63+
Ejemplo de uso para esta librería:
64+
65+
```php
66+
<?php
67+
require __DIR__ . '/vendor/autoload.php';
68+
69+
use Josantonius\ErrorHandler\ErrorHandler;
70+
71+
/* Se recomienda intanciar la clase en un archivo base como el index.php */
72+
73+
new ErrorHandler;
74+
```
75+
76+
### Tests
77+
78+
Para utilizar la clase de [pruebas](tests), simplemente:
79+
80+
```php
81+
<?php
82+
$loader = require __DIR__ . '/vendor/autoload.php';
83+
84+
$loader->addPsr4('Josantonius\\ErrorHandler\\Tests\\', __DIR__ . '/vendor/josantonius/errorhandler/tests');
85+
86+
use Josantonius\ErrorHandler\Tests\ErrorHandlerTest;
87+
```
88+
Métodos de prueba disponibles en esta librería:
89+
90+
```php
91+
ErrorHandlerTest->testSProvokeException();
92+
ErrorHandlerTest->testSProvokeWarning();
93+
ErrorHandlerTest->testSProvokeNotice();
94+
ErrorHandlerTest->testSProvokeUserError();
95+
ErrorHandlerTest->testSProvokeUserNotice();
96+
ErrorHandlerTest->testSProvokeUserWarning();
97+
```
98+
99+
### Manejador de excepciones
100+
101+
Esta librería utiliza [control de excepciones](src/Exception) que puedes personalizar a tu gusto.
102+
### Contribuir
103+
1. Comprobar si hay incidencias abiertas o abrir una nueva para iniciar una discusión en torno a un fallo o función.
104+
1. Bifurca la rama del repositorio en GitHub para iniciar la operación de ajuste.
105+
1. Escribe una o más pruebas para la nueva característica o expón el error.
106+
1. Haz cambios en el código para implementar la característica o reparar el fallo.
107+
1. Envía pull request para fusionar los cambios y que sean publicados.
108+
109+
Esto está pensado para proyectos grandes y de larga duración.
110+
111+
### Repositorio
112+
113+
Los archivos de este repositorio se crearon y subieron automáticamente con [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
114+
115+
### Autor
116+
117+
Mantenido por [Josantonius](https://github.com/Josantonius/).
118+
119+
### Licencia
120+
121+
Este proyecto está licenciado bajo la **licencia MIT**. Consulta el archivo [LICENSE](LICENSE) para más información.

README.md

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# PHP ErrorHandler library
2+
3+
[![Latest Stable Version](https://poser.pugx.org/josantonius/errorhandler/v/stable)](https://packagist.org/packages/josantonius/errorhandler) [![Total Downloads](https://poser.pugx.org/josantonius/errorhandler/downloads)](https://packagist.org/packages/josantonius/errorhandler) [![Latest Unstable Version](https://poser.pugx.org/josantonius/errorhandler/v/unstable)](https://packagist.org/packages/josantonius/errorhandler) [![License](https://poser.pugx.org/josantonius/errorhandler/license)](https://packagist.org/packages/josantonius/errorhandler)
4+
5+
[Spanish version](README-ES.md)
6+
7+
PHP library for handling exceptions and errors.
8+
9+
---
10+
11+
- [Installation](#installation)
12+
- [Requirements](#requirements)
13+
- [Quick Start and Examples](#quick-start-and-examples)
14+
- [Available Methods](#available-methods)
15+
- [Usage](#usage)
16+
- [Tests](#tests)
17+
- [Exception Handler](#exception-handler)
18+
- [Contribute](#contribute)
19+
- [Repository](#repository)
20+
- [Author](#author)
21+
- [Licensing](#licensing)
22+
23+
---
24+
25+
### Installation
26+
27+
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
28+
29+
To install PHP ErrorHandler library, simply:
30+
31+
$ composer require Josantonius/ErrorHandler
32+
33+
### Requirements
34+
35+
This library is supported by PHP versions 7.0 or higher and is compatible with HHVM versions 3.0 or higher.
36+
37+
To use this library in HHVM (HipHop Virtual Machine) you will have to activate the scalar types. Add the following line "hhvm.php7.scalar_types = true" in your "/etc/hhvm/php.ini".
38+
39+
### Quick Start and Examples
40+
41+
To use this class, simply:
42+
43+
```php
44+
require __DIR__ . '/vendor/autoload.php';
45+
46+
use Josantonius\ErrorHandler\ErrorHandler;
47+
```
48+
### Available Methods
49+
50+
Available methods in this library:
51+
52+
```php
53+
ErrorHandler->catchThrowable();
54+
ErrorHandler->catchException();
55+
ErrorHandler->catchError();
56+
ErrorHandler->exception();
57+
ErrorHandler->prepareException();
58+
ErrorHandler->getErrorType();
59+
ErrorHandler->show();
60+
```
61+
### Usage
62+
63+
Example of use for this library:
64+
65+
```php
66+
<?php
67+
require __DIR__ . '/vendor/autoload.php';
68+
69+
use Josantonius\ErrorHandler\ErrorHandler;
70+
71+
/* It is recommended to instantiate the class in a base file as the index.php */
72+
73+
new ErrorHandler;
74+
```
75+
76+
### Tests
77+
78+
To use the [test](tests) class, simply:
79+
80+
```php
81+
<?php
82+
$loader = require __DIR__ . '/vendor/autoload.php';
83+
84+
$loader->addPsr4('Josantonius\\ErrorHandler\\Tests\\', __DIR__ . '/vendor/josantonius/errorhandler/tests');
85+
86+
use Josantonius\ErrorHandler\Tests\ErrorHandlerTest;
87+
88+
```
89+
Available test methods in this library:
90+
91+
```php
92+
ErrorHandlerTest->testSProvokeException();
93+
ErrorHandlerTest->testSProvokeWarning();
94+
ErrorHandlerTest->testSProvokeNotice();
95+
ErrorHandlerTest->testSProvokeUserError();
96+
ErrorHandlerTest->testSProvokeUserNotice();
97+
ErrorHandlerTest->testSProvokeUserWarning();
98+
```
99+
100+
### Exception Handler
101+
102+
This library uses [exception handler](src/Exception) that you can customize.
103+
### Contribute
104+
1. Check for open issues or open a new issue to start a discussion around a bug or feature.
105+
1. Fork the repository on GitHub to start making your changes.
106+
1. Write one or more tests for the new feature or that expose the bug.
107+
1. Make code changes to implement the feature or fix the bug.
108+
1. Send a pull request to get your changes merged and published.
109+
110+
This is intended for large and long-lived objects.
111+
112+
### Repository
113+
114+
All files in this repository were created and uploaded automatically with [Reposgit Creator](https://github.com/Josantonius/BASH-Reposgit).
115+
116+
### Author
117+
118+
Maintained by [Josantonius](https://github.com/Josantonius/).
119+
120+
### Licensing
121+
122+
This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file for more info.

composer.json

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "josantonius/errorhandler",
3+
"version": "1.0.0",
4+
"type": "library",
5+
"description": "PHP library for handling exceptions and errors.",
6+
"keywords": [
7+
"Exception",
8+
"Exception handler",
9+
"Error handler",
10+
"throw",
11+
"Error",
12+
"Throwable",
13+
"HHVM",
14+
"PHP"
15+
],
16+
"license": "MIT",
17+
"authors": [
18+
{
19+
"name": "Josantonius",
20+
"email": "[email protected]",
21+
"homepage": "https://github.com/josantonius",
22+
"role": "Developer"
23+
}
24+
],
25+
"minimum-stability": "dev",
26+
"prefer-stable" : true,
27+
"require": {
28+
"php" : ">=7.0"
29+
},
30+
"autoload": {
31+
"psr-4": {
32+
"Josantonius\\ErrorHandler\\": "src/"
33+
}
34+
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"Josantonius\\ErrorHandler\\Tests\\": "tests/"
38+
}
39+
},
40+
"extra": {
41+
"branch-alias": {
42+
"dev-master": "1.0-dev"
43+
}
44+
}
45+
}

contributors.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Josantonius
Loading
102 KB
Loading
Loading
Loading

0 commit comments

Comments
 (0)