lib/Api/Plan.php
public function filterPlans(array $plans, array $filters): array
    {
        foreach ($filters as $key => $filter) {
            if (array_key_exists($key, current($plans))) {
                $plans = array_filter($plans, function ($element) use ($key, $filter) {
                    return $element[$key] == $filter;
                });
            }
        }

        return $plans;
    }
public function filterPlans(array $plans, array $filters): array
    {
        foreach ($filters as $key => $filter) {
            if (array_key_exists($key, current($plans))) {
                $plans = array_filter($plans, function ($element) use ($key, $filter) {
                    return $element[$key] == $filter;
                });
            }
        }

        return $plans;
    }
filter given plans with given filters.

@param array $plans
@param array $filters

@return array