public function normalize($data, $depth = 0) {
		$scalar = $this->normalizeScalar($data);
		if (!is_array($scalar)) {
			return $scalar;
		}
		$decisionArray = [
			'normalizeTraversable' => [$data, $depth],
			'normalizeDate'        => [$data],
			'normalizeObject'      => [$data, $depth],
			'normalizeResource'    => [$data],
		];

		foreach ($decisionArray as $functionName => $arguments) {
			$dataType = call_user_func_array([$this, $functionName], $arguments);
			if ($dataType !== null) {
				return $dataType;
			}
		}

		return '[unknown(' . gettype($data) . ')]';
	}
public function normalize($data, $depth = 0) {
		$scalar = $this->normalizeScalar($data);
		if (!is_array($scalar)) {
			return $scalar;
		}
		$decisionArray = [
			'normalizeTraversable' => [$data, $depth],
			'normalizeDate'        => [$data],
			'normalizeObject'      => [$data, $depth],
			'normalizeResource'    => [$data],
		];

		foreach ($decisionArray as $functionName => $arguments) {
			$dataType = call_user_func_array([$this, $functionName], $arguments);
			if ($dataType !== null) {
				return $dataType;
			}
		}

		return '[unknown(' . gettype($data) . ')]';
	}
public function normalize ( $ data , $ depth = 0 ) { $ scalar = $ this -> normalizeScalar ( $ data ) ; if ( ! is_array ( $ scalar ) ) { return $ scalar ; } $ decisionArray = [ 'normalizeTraversable' => [ $ data , $ depth ] , 'normalizeDate' => [ $ data ] , 'normalizeObject' => [ $ data , $ depth ] , 'normalizeResource' => [ $ data ] , ] ; foreach ( $ decisionArray as $ functionName => $ arguments ) { $ dataType = call_user_func_array ( [ $ this , $ functionName ] , $ arguments ) ; if ( $ dataType !== null ) { return $ dataType ; } } return '[unknown(' . gettype ( $ data ) . ')]' ; }
Converts Objects, Arrays, Dates and Exceptions to a String or an Array

@uses InterfaSys\LogNormalizer\Normalizer::normalizeTraversable
@uses InterfaSys\LogNormalizer\Normalizer::normalizeDate
@uses InterfaSys\LogNormalizer\Normalizer::normalizeObject
@uses InterfaSys\LogNormalizer\Normalizer::normalizeResource

@param $data
@param int $depth

@return string|array
Converts Objects Arrays Dates and Exceptions to a String or an Array