\Symfony\Component\VarDumper\CasterCaster

Helper for filtering out properties in casters.

Summary

Methods
Properties
Constants
castObject()
filter()
castPhpIncompleteClass()
No public properties found
EXCLUDE_VERBOSE
EXCLUDE_VIRTUAL
EXCLUDE_DYNAMIC
EXCLUDE_PUBLIC
EXCLUDE_PROTECTED
EXCLUDE_PRIVATE
EXCLUDE_NULL
EXCLUDE_EMPTY
EXCLUDE_NOT_IMPORTANT
EXCLUDE_STRICT
PREFIX_VIRTUAL
PREFIX_DYNAMIC
PREFIX_PROTECTED
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Constants

EXCLUDE_VERBOSE

EXCLUDE_VERBOSE = 1

EXCLUDE_VIRTUAL

EXCLUDE_VIRTUAL = 2

EXCLUDE_DYNAMIC

EXCLUDE_DYNAMIC = 4

EXCLUDE_PUBLIC

EXCLUDE_PUBLIC = 8

EXCLUDE_PROTECTED

EXCLUDE_PROTECTED = 16

EXCLUDE_PRIVATE

EXCLUDE_PRIVATE = 32

EXCLUDE_NULL

EXCLUDE_NULL = 64

EXCLUDE_EMPTY

EXCLUDE_EMPTY = 128

EXCLUDE_NOT_IMPORTANT

EXCLUDE_NOT_IMPORTANT = 256

EXCLUDE_STRICT

EXCLUDE_STRICT = 512

PREFIX_VIRTUAL

PREFIX_VIRTUAL = "\x00~\x00"

PREFIX_DYNAMIC

PREFIX_DYNAMIC = "\x00+\x00"

PREFIX_PROTECTED

PREFIX_PROTECTED = "\x00*\x00"

Methods

castObject()

castObject(object  $obj, string  $class, bool  $hasDebugInfo = false, string  $debugClass = null) : array

Casts objects to arrays and adds the dynamic property prefix.

Parameters

object $obj

The object to cast

string $class
bool $hasDebugInfo

Whether the __debugInfo method exists on $obj or not

string $debugClass

Returns

array —

The array-cast of the object, with prefixed dynamic properties

filter()

filter(array  $a, int  $filter, string[]  $listedProperties = [], int  $count) : array

Filters out the specified properties.

By default, a single match in the $filter bit field filters properties out, following an "or" logic. When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.

Parameters

array $a

The array containing the properties to filter

int $filter

A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out

string[] $listedProperties

List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set

int $count

Set to the number of removed properties

Returns

array —

The filtered array

castPhpIncompleteClass()

castPhpIncompleteClass(\__PHP_Incomplete_Class  $c, array  $a, \Symfony\Component\VarDumper\Cloner\Stub  $stub, bool  $isNested) : array

Parameters

\__PHP_Incomplete_Class $c
array $a
\Symfony\Component\VarDumper\Cloner\Stub $stub
bool $isNested

Returns

array —