diff options
author | Olivier Paroz <github@oparoz.com> | 2015-01-10 00:00:20 +0300 |
---|---|---|
committer | Olivier Paroz <github@oparoz.com> | 2015-01-10 00:00:20 +0300 |
commit | b73f5cce23e875c99cb66e6bcbaa3249b1d255b6 (patch) | |
tree | 555b66ab2492c2eeb08745999590dec9b552a6aa /utility | |
parent | 0e9271b1424837b8de44c47eea14867ea2dce28d (diff) |
Some optimisations
Diffstat (limited to 'utility')
-rw-r--r-- | utility/normalizer.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/utility/normalizer.php b/utility/normalizer.php index 09dcaace..a5228756 100644 --- a/utility/normalizer.php +++ b/utility/normalizer.php @@ -31,23 +31,20 @@ class Normalizer { * @return string|array */ public function normalize($data, $depth = 0) { - $scalar = $this->normalizeScalar($data); + $traversable = $this->normalizeTraversable($data, $depth); + $object = $this->normalizeObject($data, $depth); + $resource = $this->normalizeResource($data); + if (!is_array($scalar)) { return $scalar; } - - $traversable = $this->normalizeTraversable($data, $depth); if ($traversable !== null) { return $traversable; } - - $object = $this->normalizeObject($data, $depth); if ($object !== null) { return $object; } - - $resource = $this->normalizeResource($data); if ($resource !== null) { return $resource; } |