Refactor StoredObject normalization handling

Deprecate and remove specific context constants from StoredObjectNormalizer. Update object properties for better clarity and add permissions handling. Introduce related tests and adjust other files relying on the old context constants.
This commit is contained in:
2024-08-28 23:19:24 +02:00
parent 00cc3b7806
commit b6edbb3eed
7 changed files with 211 additions and 29 deletions

View File

@@ -12,7 +12,6 @@ declare(strict_types=1);
namespace Chill\DocStoreBundle\Form\DataTransformer;
use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\DocStoreBundle\Serializer\Normalizer\StoredObjectNormalizer;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Serializer\SerializerInterface;
@@ -30,11 +29,7 @@ class StoredObjectDataTransformer implements DataTransformerInterface
}
if ($value instanceof StoredObject) {
return $this->serializer->serialize($value, 'json', [
'groups' => [
StoredObjectNormalizer::ADD_DAV_EDIT_LINK_CONTEXT,
],
]);
return $this->serializer->serialize($value, 'json');
}
throw new UnexpectedTypeException($value, StoredObject::class);