Documentation

Instantiator
in package

FinalYes

A utility class to create objects without calling their constructor.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Methods

instantiate()  : T
Creates an object and sets its properties without calling its constructor nor any other methods.

Methods

instantiate()

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

public static instantiate(T> $class[, array<string, mixed> $properties = [] ][, array<class-string, array<string, mixed>> $scopedProperties = [] ]) : T
Parameters
$class : T>

The class of the instance to create

$properties : array<string, mixed> = []

The properties to set on the instance

$scopedProperties : array<class-string, array<string, mixed>> = []

The properties to set on the instance, keyed by their declaring class

Tags
see
Hydrator::hydrate()

for examples

template
throws
ExceptionInterface

When the instance cannot be created

Return values
T

        
On this page

Search results