phpEZ v0.1.3

ObjAttribute
in package

Base class for property-level attributes in the PHPEz framework.

Provides a reusable foundation for declaring metadata attributes on object properties. Subclasses define behavior (e.g., OmitEmpty, DoNotSerialize) that affects serialization, deserialization, and validation of Obj instances.

This uses PHP 8 attributes applied to properties, enabling declarative behavior without modifying code logic.

Tags
subpackage

iface

Annotation
see
OmitEmpty
DoNotSerialize
DoNotDeserialize
Attributes
#[Attribute]
\Attribute::TARGET_PROPERTY

Table of Contents

Methods

of()  : static|false
Extract an attribute instance from a reflected property.

Methods

of()

Extract an attribute instance from a reflected property.

public static of(ReflectionProperty $field) : static|false

Searches the property's attributes for one matching this class name and instantiates it with the attribute's arguments.

Parameters
$field : ReflectionProperty

The property to inspect for attributes.

Return values
static|false

The attribute instance if found, false otherwise.

On this page

Search results