Skip to content

Commit

Permalink
dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Aug 22, 2023
1 parent 4b8a3ce commit 350bdc7
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Serializer/AbstractItemNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,7 @@ protected function getFactoryOptions(array $context): array
// This is a hot spot
if (isset($context['resource_class'])) {
// Note that the groups need to be read on the root operation
$operation = $context['root_operation'] ?? $context['operation'] ?? null;

if (!$operation && $this->resourceMetadataCollectionFactory && $this->resourceClassResolver->isResourceClass($context['resource_class'])) {
$resourceClass = $this->resourceClassResolver->getResourceClass(null, $context['resource_class']); // fix for abstract classes and interfaces
$operation = $this->resourceMetadataCollectionFactory->create($resourceClass)->getOperation(null);
}

if ($operation) {
if ($operation = ($context['root_operation'] ?? null)) {
$options['normalization_groups'] = $operation->getNormalizationContext()['groups'] ?? null;
$options['denormalization_groups'] = $operation->getDenormalizationContext()['groups'] ?? null;
$options['operation_name'] = $operation->getName();
Expand Down

0 comments on commit 350bdc7

Please sign in to comment.