Skip to content

Commit

Permalink
Update code and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattamon committed Apr 8, 2024
1 parent 43585f9 commit db609d4
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 333 deletions.
2 changes: 1 addition & 1 deletion src/Controller/Api/AbstractApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(protected readonly SerializerInterface $serializer)

}

protected function jsonResponse(mixed $data, $headers = []): JsonResponse
protected function jsonResponse(mixed $data, array $headers = []): JsonResponse
{
return new JsonResponse($this->serializer->serialize($data, 'json'), 200, $headers, true);
}
Expand Down
1 change: 0 additions & 1 deletion src/Dto/Asset.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function getMimeType(): ?string
return $this->mimeType;
}

#[ApiProperty(genId: false)]
public function getMetadata(): array
{
return $this->metaData;
Expand Down
1 change: 0 additions & 1 deletion src/Dto/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public function isLocked(): bool
return $this->isLocked;
}

#[ApiProperty(genId: false)]
public function getPermissions(): Permissions
{
return $this->permissions;
Expand Down
2 changes: 2 additions & 0 deletions src/Dto/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

namespace Pimcore\Bundle\StudioApiBundle\Dto;

use Pimcore\Bundle\StudioApiBundle\Util\Constants\PublicTranslations;

/**
* @internal
*/
Expand Down
3 changes: 1 addition & 2 deletions src/Filter/AssetExcludeFolderFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

namespace Pimcore\Bundle\StudioApiBundle\Filter;

use ApiPlatform\Serializer\Filter\FilterInterface;
use Pimcore\Bundle\StudioApiBundle\Dto\Asset;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryContextTrait;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface;
use Symfony\Component\HttpFoundation\Request;

final class AssetExcludeFolderFilter implements FilterInterface
final class AssetExcludeFolderFilter
{
use AssetQueryContextTrait;

Expand Down
3 changes: 1 addition & 2 deletions src/Filter/AssetIdSearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

namespace Pimcore\Bundle\StudioApiBundle\Filter;

use ApiPlatform\Serializer\Filter\FilterInterface;
use Pimcore\Bundle\StudioApiBundle\Dto\Asset;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryContextTrait;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface;
use Symfony\Component\HttpFoundation\Request;

final class AssetIdSearchFilter implements FilterInterface
final class AssetIdSearchFilter
{
use AssetQueryContextTrait;

Expand Down
3 changes: 1 addition & 2 deletions src/Filter/AssetParentIdFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

namespace Pimcore\Bundle\StudioApiBundle\Filter;

use ApiPlatform\Serializer\Filter\FilterInterface;
use Pimcore\Bundle\StudioApiBundle\Dto\Asset;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryContextTrait;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface;
use Symfony\Component\HttpFoundation\Request;

final class AssetParentIdFilter implements FilterInterface
final class AssetParentIdFilter
{
use AssetQueryContextTrait;

Expand Down
3 changes: 1 addition & 2 deletions src/Filter/AssetPathFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

namespace Pimcore\Bundle\StudioApiBundle\Filter;

use ApiPlatform\Serializer\Filter\FilterInterface;
use Pimcore\Bundle\StudioApiBundle\Dto\Asset;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryContextTrait;
use Pimcore\Bundle\StudioApiBundle\Service\GenericData\V1\AssetQueryProviderInterface;
use Symfony\Component\HttpFoundation\Request;

final class AssetPathFilter implements FilterInterface
final class AssetPathFilter
{
use AssetQueryContextTrait;

Expand Down
2 changes: 1 addition & 1 deletion src/Service/SecurityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

namespace Pimcore\Bundle\StudioApiBundle\Service;

use ApiPlatform\Symfony\Security\Exception\AccessDeniedException;
use Pimcore\Bundle\StaticResolverBundle\Models\Tool\TmpStoreResolverInterface;
use Pimcore\Bundle\StudioApiBundle\Dto\Credentials;
use Pimcore\Security\User\UserProvider;
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;

Expand Down
115 changes: 0 additions & 115 deletions tests/Unit/State/Token/Create/ProcessorTest.php

This file was deleted.

106 changes: 0 additions & 106 deletions tests/Unit/State/Token/Refresh/ProcessorTest.php

This file was deleted.

Loading

0 comments on commit db609d4

Please sign in to comment.