api/symfony/Component/Serializer/Context/Normalizer/AbstractNormalizerContextBuilder.yaml
2024-09-26 02:03:21 -07:00

195 lines
5.8 KiB
YAML

name: AbstractNormalizerContextBuilder
class_comment: null
dependencies:
- name: ContextBuilderInterface
type: class
source: Symfony\Component\Serializer\Context\ContextBuilderInterface
- name: ContextBuilderTrait
type: class
source: Symfony\Component\Serializer\Context\ContextBuilderTrait
- name: InvalidArgumentException
type: class
source: Symfony\Component\Serializer\Exception\InvalidArgumentException
- name: AbstractNormalizer
type: class
source: Symfony\Component\Serializer\Normalizer\AbstractNormalizer
- name: ContextBuilderTrait
type: class
source: ContextBuilderTrait
properties: []
methods:
- name: withCircularReferenceLimit
visibility: public
parameters:
- name: circularReferenceLimit
comment: "# * A helper providing autocompletion for available AbstractNormalizer\
\ options.\n# *\n# * @author Mathias Arlaud <mathias.arlaud@gmail.com>\n# */\n\
# abstract class AbstractNormalizerContextBuilder implements ContextBuilderInterface\n\
# {\n# use ContextBuilderTrait;\n# \n# /**\n# * Configures how many loops of circular\
\ reference to allow while normalizing.\n# *\n# * The value 1 means that when\
\ we encounter the same object a\n# * second time, we consider that a circular\
\ reference.\n# *\n# * You can raise this value for special cases, e.g. in combination\
\ with the\n# * max depth setting of the object normalizer.\n# *\n# * Must be\
\ strictly positive.\n# *\n# * @param positive-int|null $circularReferenceLimit"
- name: withObjectToPopulate
visibility: public
parameters:
- name: objectToPopulate
comment: '# * Configures an object to be updated instead of creating a new instance.
# *
# * If you have a nested structure, child objects will be overwritten with
# * new instances unless you set AbstractObjectNormalizer::DEEP_OBJECT_TO_POPULATE
to true.'
- name: withGroups
visibility: public
parameters:
- name: groups
comment: '# * Configures groups containing attributes to (de)normalize.
# *
# * Eg: [''group1'', ''group2'']
# *
# * @param list<string>|string|null $groups'
- name: withAttributes
visibility: public
parameters:
- name: attributes
comment: '# * Configures attributes to (de)normalize.
# *
# * For nested structures, this list needs to reflect the object tree.
# *
# * Eg: [''foo'', ''bar'', ''object'' => [''baz'']]
# *
# * @param array<string|array>|null $attributes
# *
# * @throws InvalidArgumentException'
- name: withAllowExtraAttributes
visibility: public
parameters:
- name: allowExtraAttributes
comment: '# * If AbstractNormalizer::ATTRIBUTES are specified, and the source has
fields that are not part of that list,
# * configures whether to ignore those attributes or throw an ExtraAttributesException.'
- name: withDefaultContructorArguments
visibility: public
parameters:
- name: defaultContructorArguments
comment: '# * @deprecated since Symfony 7.1, use withDefaultConstructorArguments(?array
$defaultConstructorArguments)" instead
# *
# * @param array<class-string, array<string, mixed>>|null $defaultContructorArguments'
- name: withDefaultConstructorArguments
visibility: public
parameters:
- name: defaultConstructorArguments
comment: '# * Configures a hashmap of classes containing hashmaps of constructor
argument => default value.
# *
# * The names need to match the parameter names in the constructor arguments.
# *
# * Eg: [Foo::class => [''foo'' => true, ''bar'' => 0]]
# *
# * @param array<class-string, array<string, mixed>>|null $defaultConstructorArguments'
- name: withCallbacks
visibility: public
parameters:
- name: callbacks
comment: '# * Configures an hashmap of field name => callable to normalize this
field.
# *
# * The callable is called if the field is encountered with the arguments:
# *
# * - mixed $attributeValue value of this field
# * - object $object the whole object being normalized
# * - string $attributeName name of the attribute being normalized
# * - string $format the requested format
# * - array<string, mixed> $context the serialization context
# *
# * @param array<string, callable>|null $callbacks'
- name: withCircularReferenceHandler
visibility: public
parameters:
- name: circularReferenceHandler
comment: '# * Configures an handler to call when a circular reference has been detected.
# *
# * If no handler is specified, a CircularReferenceException is thrown.
# *
# * The method will be called with ($object, $format, $context) and its
# * return value is returned as the result of the normalize call.'
- name: withIgnoredAttributes
visibility: public
parameters:
- name: ignoredAttributes
comment: '# * Configures attributes to be skipped when normalizing an object tree.
# *
# * This list is applied to each element of nested structures.
# *
# * Eg: [''foo'', ''bar'']
# *
# * Note: The behaviour for nested structures is different from ATTRIBUTES
# * for historical reason. Aligning the behaviour would be a BC break.
# *
# * @param list<string>|null $ignoredAttributes'
- name: withRequireAllProperties
visibility: public
parameters:
- name: requireAllProperties
default: 'true'
comment: '# * Configures requiring all properties to be listed in the input instead
# * of falling back to null for nullable ones.'
traits:
- Symfony\Component\Serializer\Context\ContextBuilderInterface
- Symfony\Component\Serializer\Context\ContextBuilderTrait
- Symfony\Component\Serializer\Exception\InvalidArgumentException
- Symfony\Component\Serializer\Normalizer\AbstractNormalizer
- ContextBuilderTrait
interfaces:
- ContextBuilderInterface