Skip to content

Commit 791416f

Browse files
committed
Update examples
1 parent c09f67c commit 791416f

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
55
[![Build Status](https://travis-ci.org/odan/validation.svg?branch=master)](https://travis-ci.org/odan/validation)
66
[![Quality Score](https://scrutinizer-ci.com/g/odan/validation/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/odan/validation/?branch=master)
7-
[![Total Downloads](https://img.shields.io/packagist/dt/odan/validation.svg)](https://packagist.org/packages/odan/validation)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/odan/validation.svg)](https://packagist.org/packages/odan/validation/stats)
88

99

1010
## Requirements
@@ -22,6 +22,8 @@ composer require odan/validation
2222
Login example:
2323

2424
```php
25+
use Odan\Validation\ValidationResult;
26+
2527
// Get all POST values
2628
$data = $request->getParsedBody();
2729

@@ -47,11 +49,13 @@ if ($validation->isFailed()) {
4749
}
4850
```
4951

50-
### Slim Middleware
52+
### Slim 3 Middleware
5153

5254
This validation middleware catches the `ValidationException` exception and converts it into a nice JSON response:
5355

5456
```php
57+
use Odan\Validation\ValidationException;
58+
5559
// Validation middleware
5660
$app->add(function (Request $request, Response $response, $next) {
5761
try{
@@ -65,10 +69,3 @@ $app->add(function (Request $request, Response $response, $next) {
6569
## License
6670

6771
The MIT License (MIT). Please see [License File](LICENSE) for more information.
68-
69-
70-
[PSR-1]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md
71-
[PSR-2]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md
72-
[PSR-4]: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md
73-
[Composer]: http://getcomposer.org/
74-
[PHPUnit]: http://phpunit.de/

0 commit comments

Comments
 (0)