class ObjectShape (View source)

The attribute specifies possible object field names and their types.

If applied, an IDE will suggest the specified field names and infer the specified types.

Example:

#[ObjectShape(["age" => "int", "name" => "string"])]

This usage applied on an element effectively means that the object has 2 fields, the names are "age" and "name", and the corresponding types are "int" and "string".

Methods

__construct(array $shape)

No description

Details

__construct(array $shape)

No description

Parameters

array $shape