Skip to content

Implement a whitelist filter #46

@rick-nu

Description

@rick-nu

What

In the filter, you might only want to result a specific set of data. A white list will allow you to specify what keys you want to have returned in the end.

What is expected

$f = new Filter;
$f->whiteList(['first_name']);

$result = $f->filter([
  'first_name' => 'john',
  'spam' => 'spam'
]);
/**
 * array(1) {
 *     ["first_namet"]=> string(4) "john"
 * } 
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions