Skip to content

Commit 97dbe42

Browse files
committed
Initialise repository
0 parents  commit 97dbe42

File tree

6 files changed

+129
-0
lines changed

6 files changed

+129
-0
lines changed

.gitattributes

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/templates export-ignore
2+
/tests export-ignore
3+
/.gitattributes export-ignore
4+
/.gitignore export-ignore
5+
/.scrutinizer.yml export-ignore
6+
/.travis.yml export-ignore
7+
/infection.json.dist export-ignore
8+
/phpcs.xml.dist export-ignore
9+
/phpstan.neon.dist export-ignore
10+
/phpunit.xml.dist export-ignore
11+
/README.md export-ignore

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
patreon: lcobucci

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/vendor/
2+
/composer.lock
3+
/.phpcs.cache
4+
/infection-log.txt
5+
/.phpunit.result.cache

LICENSE

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

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Error handling middleware
2+
3+
[![Total Downloads](https://img.shields.io/packagist/dt/lcobucci/error-handling-middleware.svg?style=flat-square)](https://packagist.org/packages/lcobucci/error-handling-middleware)
4+
[![Latest Stable Version](https://img.shields.io/packagist/v/lcobucci/error-handling-middleware.svg?style=flat-square)](https://packagist.org/packages/lcobucci/error-handling-middleware)
5+
[![Unstable Version](https://img.shields.io/packagist/vpre/lcobucci/error-handling-middleware.svg?style=flat-square)](https://packagist.org/packages/lcobucci/error-handling-middleware)
6+
7+
![Branch master](https://img.shields.io/badge/branch-master-brightgreen.svg?style=flat-square)
8+
[![Build Status](https://img.shields.io/travis/lcobucci/error-handling-middleware/master.svg?style=flat-square)](http://travis-ci.org/#!/lcobucci/error-handling-middleware)
9+
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/lcobucci/error-handling-middleware/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/error-handling-middleware/?branch=master)
10+
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/lcobucci/error-handling-middleware/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/lcobucci/error-handling-middleware/?branch=master)
11+
12+
## Motivation
13+
14+
There are many PHP implementations for the [RFC 7807](https://tools.ietf.org/html/rfc7807),
15+
even providing [PSR-15 middleware](https://www.php-fig.org/psr/psr-15/). However,
16+
most of them - if not all - mix content negotiation, logging, and formatting with
17+
error handling. Some even force you to throw specific types of exceptions in order
18+
for them to work.
19+
20+
I believe that those aren't the best design decisions and that we need more
21+
flexibility to solve this problem.
22+
23+
## Installation
24+
25+
This package is available on [Packagist](http://packagist.org/packages/lcobucci/error-handling-middleware),
26+
and we recommend you to install it using [Composer](http://getcomposer.org):
27+
28+
```shell
29+
composer require lcobucci/error-handling-middleware
30+
```
31+
32+
## Usage
33+
34+
TDB
35+
36+
## License
37+
38+
MIT, see [LICENSE file](LICENSE).
39+

composer.json

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "lcobucci/error-handling-middleware",
3+
"description": "A PSR-15 middleware compatible with RFC 7807",
4+
"type": "library",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Luís Cobucci",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"keywords": ["PSR-15", "RFC-7807", "error handling"],
13+
"require": {
14+
"php": "^7.3",
15+
"ext-json": "^1.7",
16+
"fig/http-message-util": "^1.1",
17+
"lcobucci/content-negotiation-middleware": "^2.0",
18+
"psr/http-factory": "^1.0",
19+
"psr/http-server-middleware": "^1.0",
20+
"psr/log": "^1.1"
21+
},
22+
"require-dev": {
23+
"infection/infection": "^0.13",
24+
"lcobucci/coding-standard": "^3.0",
25+
"phpstan/phpstan": "^0.11",
26+
"phpstan/phpstan-deprecation-rules": "^0.11",
27+
"phpstan/phpstan-phpunit": "^0.11",
28+
"phpstan/phpstan-strict-rules": "^0.11",
29+
"phpunit/phpunit": "^8.2",
30+
"squizlabs/php_codesniffer": "^3.4",
31+
"zendframework/zend-diactoros": "^2.0"
32+
},
33+
"autoload": {
34+
"psr-4": {
35+
"Lcobucci\\ErrorHandling\\": "src"
36+
}
37+
},
38+
"autoload-dev": {
39+
"psr-4": {
40+
"Lcobucci\\ErrorHandling\\Tests\\": "tests"
41+
}
42+
},
43+
"config": {
44+
"preferred-install": "dist",
45+
"sort-packages": true
46+
},
47+
"extra": {
48+
"branch-alias": {
49+
"dev-master": "0.1.x-dev"
50+
}
51+
}
52+
}

0 commit comments

Comments
 (0)