Skip to content

Commit

Permalink
[DoctrineMongoDBBundle] removed some mostly unnecessary calls to json…
Browse files Browse the repository at this point in the history
…_encode from logger
  • Loading branch information
kriswallsmith authored and fabpot committed Sep 1, 2010
1 parent 2914c44 commit e71eec3
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -53,20 +53,20 @@ static protected function formatQuery(array $query)
}

if (is_scalar($value)) {
$formatted = json_encode($value);
$formatted = '"'.$value.'"';
} elseif (is_array($value)) {
$formatted = static::formatQuery($value);
} elseif ($value instanceof \MongoId) {
$formatted = 'ObjectId('.json_encode((string) $value).')';
$formatted = 'ObjectId("'.$value.'")';
} elseif ($value instanceof \MongoDate) {
$formatted = 'new Date('.date('r', $value->sec).')';
$formatted = 'new Date("'.date('r', $value->sec).'")';
} elseif ($value instanceof \MongoRegex) {
$formatted = 'new RegExp('.json_encode($value->regex).', '.json_encode($value->flags).')';
$formatted = 'new RegExp("'.$value->regex.'", "'.$value->flags.'")';
} else {
$formatted = (string) $value;
}

$parts[json_encode($key)] = $formatted;
$parts['"'.$key.'"'] = $formatted;
}

if (0 == count($parts)) {
Expand Down

0 comments on commit e71eec3

Please sign in to comment.