Skip to content

Define Filters #2

@berbeflo

Description

@berbeflo

Allow the definition of filters that define, which properties should be displayed by var_dump. If no filters are defined, the default filter will be OnlyWithDumpAttribute, which reflects the current behavior.

Properties that have no Dump Attribute will use the Default Formatter

There needs to be a filter interface:

interface Filter
{
    public bool isAllowed(ReflectionProperty $property, object $context);
}

There also needs to be a new Attribute, which is repeatable. Usage:

#[UseFilter(NoPrivate::class)]
#[UseFilter(NoUninitialized::class)]
class Test
{
}

Filters that should be implemented:

  • OnlyWithDumpAttribute: exclude all that have no Dump Attribute
  • WithoutNoDumpAttribute: exclude all that have a NoDump Attribute (needs to be implemented)
  • NoPrivate: exclude private properties
  • NoProtected: exclude protected properties
  • NoUninitialized: exclude uninitialized properties
  • NoStatic: exclude static properties
  • NoPublic: exclude public properties
  • NoPassword: exclude properties with names like password, pw, pass

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions