ControleOnline /
api-platform-users
| 1 | <?php |
||
| 2 | |||
| 3 | namespace ControleOnline\Controller; |
||
| 4 | |||
| 5 | use Doctrine\ORM\EntityManagerInterface; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use ControleOnline\Service\HydratorService; |
||
|
0 ignored issues
–
show
The type
ControleOnline\Service\HydratorService was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | use Symfony\Component\HttpFoundation\JsonResponse; |
||
|
0 ignored issues
–
show
The type
Symfony\Component\HttpFoundation\JsonResponse was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 8 | use ControleOnline\Entity\User; |
||
| 9 | use ControleOnline\Service\UserService; |
||
| 10 | |||
| 11 | class ChangeApiKeyAction |
||
| 12 | { |
||
| 13 | |||
| 14 | public function __construct( |
||
| 15 | private EntityManagerInterface $manager, |
||
| 16 | private UserService $service, |
||
| 17 | private HydratorService $hydratorService |
||
| 18 | |||
| 19 | ) {} |
||
| 20 | |||
| 21 | public function __invoke(User $data) |
||
| 22 | { |
||
| 23 | |||
| 24 | try { |
||
| 25 | |||
| 26 | $user = $this->service->changeApiKey($data); |
||
| 27 | |||
| 28 | return new JsonResponse( |
||
| 29 | $this->hydratorService->item( |
||
| 30 | User::class, |
||
| 31 | $user->getId(), |
||
| 32 | "user:read" |
||
| 33 | ) |
||
| 34 | ); |
||
| 35 | } catch (\Exception $e) { |
||
| 36 | |||
| 37 | return new JsonResponse([ |
||
| 38 | 'response' => [ |
||
| 39 | 'data' => [], |
||
| 40 | 'count' => 0, |
||
| 41 | 'error' => $e->getMessage(), |
||
| 42 | 'success' => false, |
||
| 43 | ], |
||
| 44 | ], 500); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths