platform/api/symfony/Component/VarExporter/Instantiator.yaml

74 lines
1.7 KiB
YAML
Raw Normal View History

2024-09-02 17:44:11 +00:00
name: Instantiator
class_comment: null
dependencies:
- name: ExceptionInterface
type: class
source: Symfony\Component\VarExporter\Exception\ExceptionInterface
- name: NotInstantiableTypeException
type: class
source: Symfony\Component\VarExporter\Exception\NotInstantiableTypeException
- name: Registry
type: class
source: Symfony\Component\VarExporter\Internal\Registry
properties: []
methods:
- name: instantiate
visibility: public
parameters:
- name: class
- name: properties
default: '[]'
- name: scopedProperties
default: '[]'
comment: '# * A utility class to create objects without calling their constructor.
# *
# * @author Nicolas Grekas <p@tchwork.com>
# */
# final class Instantiator
# {
# /**
# * Creates an object and sets its properties without calling its constructor
nor any other methods.
# *
# * @see Hydrator::hydrate() for examples
# *
# * @template T of object
# *
# * @param class-string<T> $class The class
of the instance to create
# * @param array<string, mixed> $properties The properties
to set on the instance
# * @param array<class-string, array<string, mixed>> $scopedProperties The properties
to set on the instance,
# * keyed by
their declaring class
# *
# * @return T
# *
# * @throws ExceptionInterface When the instance cannot be created'
traits:
- Symfony\Component\VarExporter\Exception\ExceptionInterface
- Symfony\Component\VarExporter\Exception\NotInstantiableTypeException
- Symfony\Component\VarExporter\Internal\Registry
interfaces: []