forked from ecamp/ecamp3
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace App\State; | ||
|
||
use ApiPlatform\Metadata\HttpOperation; | ||
use ApiPlatform\Metadata\Operation; | ||
use ApiPlatform\Serializer\AbstractConstraintViolationListNormalizer; | ||
use ApiPlatform\State\ApiResource\Error; | ||
use ApiPlatform\State\ProviderInterface; | ||
use App\Serializer\Normalizer\Error\TranslationInfoOfConstraintViolation; | ||
use App\Service\TranslateToAllLocalesService; | ||
|
||
abstract class ErrorProvider implements ProviderInterface | ||
{ | ||
public function __construct( | ||
private readonly ProviderInterface $decorated, | ||
private readonly AbstractConstraintViolationListNormalizer $hydraNormalizer, | ||
private readonly AbstractConstraintViolationListNormalizer $problemNormalizer, | ||
private readonly TranslationInfoOfConstraintViolation $translationInfoOfConstraintViolation, | ||
private readonly TranslateToAllLocalesService $translateToAllLocalesService | ||
) {} | ||
|
||
public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null | ||
{ | ||
$error = $this->decorated->provide($operation, $uriVariables, $context); | ||
|
||
|
||
|
||
return $error; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters