Trustly/Data/data.php
public function vacuum($data) {
		if(is_null($data)) {
			return NULL;
		} elseif(is_array($data)) {
			$ret = array();
			foreach($data as $k => $v) {
				$nv = $this->vacuum($v);
				if(isset($nv)) {
					$ret[$k] = $nv;
				}
			}
			if(count($ret)) {
				return $ret;
			}
			return NULL;
		} else {
			return $data;
		}
	}
public function vacuum($data) {
		if(is_null($data)) {
			return NULL;
		} elseif(is_array($data)) {
			$ret = array();
			foreach($data as $k => $v) {
				$nv = $this->vacuum($v);
				if(isset($nv)) {
					$ret[$k] = $nv;
				}
			}
			if(count($ret)) {
				return $ret;
			}
			return NULL;
		} else {
			return $data;
		}
	}
public function vacuum ( $ data ) { if ( is_null ( $ data ) ) { return NULL ; } elseif ( is_array ( $ data ) ) { $ ret = array ( ) ; foreach ( $ data as $ k => $ v ) { $ nv = $ this -> vacuum ( $ v ) ; if ( isset ( $ nv ) ) { $ ret [ $ k ] = $ nv ; } } if ( count ( $ ret ) ) { return $ ret ; } return NULL ; } else { return $ data ; } }
Utility function to vacuum the supplied data end remove unset
values. This is used to keep the requests cleaner rather then
supplying NULL values in the payload

@param array $data data to clean

@return array cleaned data
Utility function to vacuum the supplied data end remove unset values . This is used to keep the requests cleaner rather then supplying NULL values in the payload