trait ValueExtractorTrait (View source)

Provides functionality to extract the value of a property or method from an object.

Methods

mixed
extractValue(object $object, string $propertyOrMethod)

Extracts the value of the given property or method from the object.

Details

protected mixed extractValue(object $object, string $propertyOrMethod)

Extracts the value of the given property or method from the object.

Parameters

object $object The object to extract the value from.
string $propertyOrMethod The property or method for which the value should be extracted.

Return Value

mixed the value extracted from the specified property or method.

Exceptions

ValueExtractionException if the method or property is not defined.