Skip to content

Commit

Permalink
Apply php-cs-fixer changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig authored and github-actions[bot] committed Nov 27, 2024
1 parent 9d901bb commit 38fb602
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 14 deletions.
4 changes: 1 addition & 3 deletions src/Class/Controller/QuantityValue/ConvertAllController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@
use Pimcore\Bundle\StudioBackendBundle\Class\Attribute\Request\ConvertRequestBody;
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\ConvertAllParameters;
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\ConvertedQuantityValues;
use Pimcore\Bundle\StudioBackendBundle\Class\Schema\ConvertParameters;
use Pimcore\Bundle\StudioBackendBundle\Class\Service\QuantityValueServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\DatabaseException;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\NotFoundException;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\UserNotFoundException;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\Content\DataJson;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
Expand Down Expand Up @@ -79,7 +77,7 @@ public function __construct(
#[ConvertRequestBody(ConvertAllParameters::class)]
#[DefaultResponses([
HttpResponseCodes::UNAUTHORIZED,
HttpResponseCodes::NOT_FOUND
HttpResponseCodes::NOT_FOUND,
])]
public function get(#[MapRequestPayload] ConvertAllParameters $parameters): JsonResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/Class/Controller/QuantityValue/ConvertController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function __construct(
#[ConvertRequestBody]
#[DefaultResponses([
HttpResponseCodes::UNAUTHORIZED,
HttpResponseCodes::NOT_FOUND
HttpResponseCodes::NOT_FOUND,
])]
public function get(#[MapRequestPayload] ConvertParameters $parameters): JsonResponse
{
Expand Down
4 changes: 1 addition & 3 deletions src/Class/Controller/QuantityValue/UnitListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
use Pimcore\Bundle\StudioBackendBundle\Class\Attribute\Response\QuantityValueUnitsJson;
use Pimcore\Bundle\StudioBackendBundle\Class\Service\QuantityValueServiceInterface;
use Pimcore\Bundle\StudioBackendBundle\Controller\AbstractApiController;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\AccessDeniedException;
use Pimcore\Bundle\StudioBackendBundle\Exception\Api\UserNotFoundException;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\DefaultResponses;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Attribute\Response\SuccessResponse;
use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags;
Expand Down Expand Up @@ -66,7 +64,7 @@ public function __construct(
content: new QuantityValueUnitsJson()
)]
#[DefaultResponses([
HttpResponseCodes::UNAUTHORIZED
HttpResponseCodes::UNAUTHORIZED,
])]
public function listUnits(): JsonResponse
{
Expand Down
1 change: 0 additions & 1 deletion src/Class/Repository/QuantityValueRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

namespace Pimcore\Bundle\StudioBackendBundle\Class\Repository;


use Pimcore\Model\DataObject\QuantityValue\Unit;
use Pimcore\Model\DataObject\QuantityValue\Unit\Listing;

Expand Down
2 changes: 1 addition & 1 deletion src/Class/Schema/ConvertedQuantityValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
required: [
'originalValue',
'fromUnitId',
'convertedValues'
'convertedValues',
],
type: 'object'
)]
Expand Down
2 changes: 1 addition & 1 deletion src/Class/Schema/ConvertedQuantityValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
required: [
'originalValue',
'fromUnitId',
'convertedValues'
'convertedValues',
],
type: 'object'
)]
Expand Down
2 changes: 1 addition & 1 deletion src/Class/Schema/QuantityValueUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function __construct(
private readonly ?string $converter,
) {
}

public function getId(): ?string
{
return $this->id;
Expand Down
6 changes: 3 additions & 3 deletions src/Class/Service/QuantityValueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
use Pimcore\Model\DataObject\QuantityValue\Unit;
use Pimcore\Model\DataObject\QuantityValue\UnitConversionService;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use function sprintf;

/**
* @internal
Expand Down Expand Up @@ -80,7 +81,7 @@ public function listUnits(): array

/**
* @throws DatabaseException|NotFoundException
*/
*/
public function convertUnit(ConvertParameters $parameters): float|int
{
return $this->getConvertedValue(
Expand Down Expand Up @@ -140,7 +141,7 @@ private function getUnit(string $unitId): Unit
/**
* @throws DatabaseException
*/
private function getConvertedValue(Unit $fromUnit, Unit $toUnit, float|int $value ): float|int
private function getConvertedValue(Unit $fromUnit, Unit $toUnit, float|int $value): float|int
{
try {
$convertedValue = $this->unitConversionService->convert(
Expand All @@ -155,5 +156,4 @@ private function getConvertedValue(Unit $fromUnit, Unit $toUnit, float|int $valu

return $convertedValue->getValue();
}

}

0 comments on commit 38fb602

Please sign in to comment.