src/Hydra/Serializer/DocumentationNormalizer.php
private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resourceMetadata): array
    {
        $attributes = $resourceMetadata->getAttributes();
        $context = [];

        if (isset($attributes['normalization_context'][AbstractNormalizer::GROUPS])) {
            $context['serializer_groups'] = (array) $attributes['normalization_context'][AbstractNormalizer::GROUPS];
        }

        if (!isset($attributes['denormalization_context'][AbstractNormalizer::GROUPS])) {
            return $context;
        }

        if (isset($context['serializer_groups'])) {
            foreach ((array) $attributes['denormalization_context'][AbstractNormalizer::GROUPS] as $groupName) {
                $context['serializer_groups'][] = $groupName;
            }

            return $context;
        }

        $context['serializer_groups'] = (array) $attributes['denormalization_context'][AbstractNormalizer::GROUPS];

        return $context;
    }
private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resourceMetadata): array
    {
        $attributes = $resourceMetadata->getAttributes();
        $context = [];

        if (isset($attributes['normalization_context'][AbstractNormalizer::GROUPS])) {
            $context['serializer_groups'] = (array) $attributes['normalization_context'][AbstractNormalizer::GROUPS];
        }

        if (!isset($attributes['denormalization_context'][AbstractNormalizer::GROUPS])) {
            return $context;
        }

        if (isset($context['serializer_groups'])) {
            foreach ((array) $attributes['denormalization_context'][AbstractNormalizer::GROUPS] as $groupName) {
                $context['serializer_groups'][] = $groupName;
            }

            return $context;
        }

        $context['serializer_groups'] = (array) $attributes['denormalization_context'][AbstractNormalizer::GROUPS];

        return $context;
    }
private function getPropertyNameCollectionFactoryContext ( ResourceMetadata $ resourceMetadata ) : array { $ attributes = $ resourceMetadata -> getAttributes ( ) ; $ context = [ ] ; if ( isset ( $ attributes [ 'normalization_context' ] [ AbstractNormalizer :: GROUPS ] ) ) { $ context [ 'serializer_groups' ] = ( array ) $ attributes [ 'normalization_context' ] [ AbstractNormalizer :: GROUPS ] ; } if ( ! isset ( $ attributes [ 'denormalization_context' ] [ AbstractNormalizer :: GROUPS ] ) ) { return $ context ; } if ( isset ( $ context [ 'serializer_groups' ] ) ) { foreach ( ( array ) $ attributes [ 'denormalization_context' ] [ AbstractNormalizer :: GROUPS ] as $ groupName ) { $ context [ 'serializer_groups' ] [ ] = $ groupName ; } return $ context ; } $ context [ 'serializer_groups' ] = ( array ) $ attributes [ 'denormalization_context' ] [ AbstractNormalizer :: GROUPS ] ; return $ context ; }
Gets the context for the property name factory.
Gets the context for the property name factory .