Copied!

A utility class to create objects without calling their constructor.

CloneableFinalInstantiable
Methods
public static instantiate(string $class, array $properties = [], array $scopedProperties = []) : object
 

Creates an object and sets its properties without calling its constructor nor any other methods.

  • see \Hydrator::hydrate()for examples
  • template
  • 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
Methods
public static instantiate(string $class, array $properties = [], array $scopedProperties = []) : object
 

Creates an object and sets its properties without calling its constructor nor any other methods.

  • see \Hydrator::hydrate()for examples
  • template
  • 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
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration