JiraRestApi\JiraClient::filterNullVariable PHP Метод

filterNullVariable() защищенный Метод

Serilize only not null field.
protected filterNullVariable ( array $haystack ) : array
$haystack array
Результат array
    protected function filterNullVariable($haystack)
    {
        foreach ($haystack as $key => $value) {
            if (is_array($value)) {
                $haystack[$key] = $this->filterNullVariable($haystack[$key]);
            } elseif (is_object($value)) {
                $haystack[$key] = $this->filterNullVariable(get_class_vars(get_class($value)));
            }
            if (is_null($haystack[$key]) || empty($haystack[$key])) {
                unset($haystack[$key]);
            }
        }
        return $haystack;
    }