Flow\JSONPath\Filters\IndexesFilter::filter PHP Method

filter() public method

public filter ( $collection ) : array
$collection
return array
    public function filter($collection)
    {
        $return = [];
        foreach ($this->token->value as $index) {
            if (AccessHelper::keyExists($collection, $index, $this->magicIsAllowed)) {
                $return[] = AccessHelper::getValue($collection, $index, $this->magicIsAllowed);
            }
        }
        return $return;
    }
IndexesFilter