protected function cleanup(array &$data)
    {
        foreach ($data as &$value) {
            if (\is_array($value)) {
                $this->cleanup($value);
            }
        }

        $data = array_filter($data, function ($value) {
            return null !== $value;
        });
    }
protected function cleanup(array &$data)
    {
        foreach ($data as &$value) {
            if (\is_array($value)) {
                $this->cleanup($value);
            }
        }

        $data = array_filter($data, function ($value) {
            return null !== $value;
        });
    }
protected function cleanup ( array & $ data ) { foreach ( $ data as & $ value ) { if ( \ is_array ( $ value ) ) { $ this -> cleanup ( $ value ) ; } } $ data = array_filter ( $ data , function ( $ value ) { return null !== $ value ; } ) ; }
Recursively filter an array, removing null and empty string values.

@param array &$data The data to filter.
Recursively filter an array removing null and empty string values .