Total Complexity | 7 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class UpdateUserAvatar |
||
11 | { |
||
12 | private $userRepository; |
||
13 | |||
14 | public function __construct(UserRepository $userRepository) |
||
17 | } |
||
18 | |||
19 | public function execute(string $userId, array $picture) |
||
25 | } |
||
26 | |||
27 | private function validateData(array $picture): array |
||
28 | { |
||
29 | $rules = [ |
||
30 | 'mine_type' => 'nullable|in:image/jpeg,image/png,image/jpg' |
||
31 | ]; |
||
32 | $validator = Validator::make($picture, $rules); |
||
33 | $validator->validate(); |
||
34 | return $picture; |
||
35 | } |
||
36 | |||
37 | private function handlePicture(array $picture): array |
||
42 | } |
||
43 | } |
||
44 |