private function normalizeObject($data, $depth) {
		if (is_object($data)) {
			if ($data instanceof \Exception) {
				return $this->normalizeException($data);
			}
			// We don't need to go too deep in the recursion
			$maxObjectRecursion = $this->maxRecursionDepth;
			$arrayObject = new \ArrayObject($data);
			$serializedObject = $arrayObject->getArrayCopy();
			if ($depth < $maxObjectRecursion) {
				$depth++;
				$response = $this->normalize($serializedObject, $depth);

				return [$this->getObjetName($data) => $response];
			}

			return $this->getObjetName($data);
		}

		return null;
	}
private function normalizeObject($data, $depth) {
		if (is_object($data)) {
			if ($data instanceof \Exception) {
				return $this->normalizeException($data);
			}
			// We don't need to go too deep in the recursion
			$maxObjectRecursion = $this->maxRecursionDepth;
			$arrayObject = new \ArrayObject($data);
			$serializedObject = $arrayObject->getArrayCopy();
			if ($depth < $maxObjectRecursion) {
				$depth++;
				$response = $this->normalize($serializedObject, $depth);

				return [$this->getObjetName($data) => $response];
			}

			return $this->getObjetName($data);
		}

		return null;
	}
private function normalizeObject ( $ data , $ depth ) { if ( is_object ( $ data ) ) { if ( $ data instanceof \ Exception ) { return $ this -> normalizeException ( $ data ) ; } // We don't need to go too deep in the recursion $ maxObjectRecursion = $ this -> maxRecursionDepth ; $ arrayObject = new \ ArrayObject ( $ data ) ; $ serializedObject = $ arrayObject -> getArrayCopy ( ) ; if ( $ depth < $ maxObjectRecursion ) { $ depth ++ ; $ response = $ this -> normalize ( $ serializedObject , $ depth ) ; return [ $ this -> getObjetName ( $ data ) => $ response ] ; } return $ this -> getObjetName ( $ data ) ; } return null ; }
Converts an Object to an Array

We don't convert to json here as we would double encode them

@used-by InterfaSys\LogNormalizer\Normalizer::normalize

@param mixed $data
@param int $depth

@return array|null
Converts an Object to an Array