Skip to content

Commit e0a893c

Browse files
committed
refactor Validator to UserValidator
1 parent 4faa569 commit e0a893c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

hexlet

-12 KB
Binary file not shown.

public/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Slim\Factory\AppFactory;
1212
use Slim\Middleware\MethodOverrideMiddleware;
1313
use DI\Container;
14-
use App\Validator;
14+
use App\UserValidator;
1515

1616
// Старт PHP сессии
1717
session_start();
@@ -117,7 +117,7 @@ function filterUsersByName($users, $term)
117117
$users = getUsers($request);
118118
$userData = $request->getParsedBodyParam('user');
119119

120-
$validator = new Validator();
120+
$validator = new UserValidator();
121121
$errors = $validator->validate($userData);
122122

123123
if (count($errors) === 0) {
@@ -212,7 +212,7 @@ function filterUsersByName($users, $term)
212212
$user = $users[$id];
213213
$userData = $request->getParsedBodyParam('user');
214214

215-
$validator = new Validator();
215+
$validator = new UserValidator();
216216
$errors = $validator->validate($userData);
217217

218218
if (count($errors) === 0) {

src/Validator.php renamed to src/UserValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace App;
44

5-
class Validator
5+
class UserValidator
66
{
77
public function validate(array $user): array
88
{

0 commit comments

Comments
 (0)