diff --git a/src/Controller/Api/Assets/CollectionController.php b/src/Controller/Api/Assets/CollectionController.php index 680a5f733..b59d0f06e 100644 --- a/src/Controller/Api/Assets/CollectionController.php +++ b/src/Controller/Api/Assets/CollectionController.php @@ -56,7 +56,7 @@ final class CollectionController extends AbstractApiController public function __construct( SerializerInterface $serializer, private readonly AssetSearchServiceInterface $assetSearchService, - private readonly FilterServiceProviderInterface $filterServiceFactory + private readonly FilterServiceProviderInterface $filterServiceProvider ) { parent::__construct($serializer); } @@ -93,7 +93,7 @@ public function __construct( #[UnprocessableContentResponse] public function getAssets(#[MapQueryString] ElementParameters $parameters): JsonResponse { - $filterService = $this->filterServiceFactory->create(OpenSearchFilterInterface::SERVICE_TYPE); + $filterService = $this->filterServiceProvider->create(OpenSearchFilterInterface::SERVICE_TYPE); $assetQuery = $filterService->applyFilters( $parameters, diff --git a/src/Controller/Api/DataObjects/CollectionController.php b/src/Controller/Api/DataObjects/CollectionController.php index d4198babf..3adb65def 100644 --- a/src/Controller/Api/DataObjects/CollectionController.php +++ b/src/Controller/Api/DataObjects/CollectionController.php @@ -54,7 +54,7 @@ final class CollectionController extends AbstractApiController public function __construct( SerializerInterface $serializer, private readonly DataObjectSearchServiceInterface $dataObjectSearchService, - private readonly FilterServiceProviderInterface $filterServiceFactory + private readonly FilterServiceProviderInterface $filterServiceProvider ) { parent::__construct($serializer); } @@ -92,7 +92,7 @@ public function __construct( #[UnprocessableContentResponse] public function getDataObjects(#[MapQueryString] DataObjectParameters $parameters): JsonResponse { - $filterService = $this->filterServiceFactory->create(OpenSearchFilterInterface::SERVICE_TYPE); + $filterService = $this->filterServiceProvider->create(OpenSearchFilterInterface::SERVICE_TYPE); $dataObjectQuery = $filterService->applyFilters($parameters, 'dataObject'); diff --git a/src/Exception/AbstractApiException.php b/src/Exception/AbstractApiException.php index 1f326d5b8..d975a061b 100644 --- a/src/Exception/AbstractApiException.php +++ b/src/Exception/AbstractApiException.php @@ -18,6 +18,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException; -abstract class AbstractApiException extends HttpException implements ApiExceptionInterface +abstract class AbstractApiException extends HttpException { } diff --git a/src/Exception/ApiExceptionInterface.php b/src/Exception/ApiExceptionInterface.php deleted file mode 100644 index 49c23d4d2..000000000 --- a/src/Exception/ApiExceptionInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -serialize(new Collection($totalItems, $data), 'json'); + $serialized = $serializer->serialize(new Collection($totalItems, $items), 'json'); return new JsonResponse($serialized, 200, [self::HEADER_TOTAL_ITEMS => $totalItems], true); } diff --git a/src/Security/Trait/PublicTranslationTrait.php b/src/Util/Traits/PublicTranslationTrait.php similarity index 96% rename from src/Security/Trait/PublicTranslationTrait.php rename to src/Util/Traits/PublicTranslationTrait.php index 566dac245..47c44ee63 100644 --- a/src/Security/Trait/PublicTranslationTrait.php +++ b/src/Util/Traits/PublicTranslationTrait.php @@ -14,7 +14,7 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ -namespace Pimcore\Bundle\StudioApiBundle\Security\Trait; +namespace Pimcore\Bundle\StudioApiBundle\Util\Traits; use Pimcore\Bundle\StudioApiBundle\Exception\NonPublicTranslationException; use Pimcore\Bundle\StudioApiBundle\Util\Constants\PublicTranslations; diff --git a/src/Security/Trait/RequestTrait.php b/src/Util/Traits/RequestTrait.php similarity index 96% rename from src/Security/Trait/RequestTrait.php rename to src/Util/Traits/RequestTrait.php index 100d83b69..3128a9678 100644 --- a/src/Security/Trait/RequestTrait.php +++ b/src/Util/Traits/RequestTrait.php @@ -14,7 +14,7 @@ * @license http://www.pimcore.org/license GPLv3 and PCL */ -namespace Pimcore\Bundle\StudioApiBundle\Security\Trait; +namespace Pimcore\Bundle\StudioApiBundle\Util\Traits; use Pimcore\Bundle\StudioApiBundle\Exception\NoRequestException; use Pimcore\Bundle\StudioApiBundle\Exception\NotAuthorizedException;