Skip to content
This repository was archived by the owner on Sep 14, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2 from pminnieur/patch-2
Browse files Browse the repository at this point in the history
Parameters may be null
  • Loading branch information
denderello committed Oct 9, 2012
2 parents 1acb0a1 + 2bf3ff6 commit f2ee47f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Analyzer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ public function getSimilarQueries()
return $this->filterIndistinctQueries($groupedQueries);
}

private function generateQueryKeyWithParameters($sql, array $parameters)
private function generateQueryKeyWithParameters($sql, $parameters)
{
return $this->generateQueryKeyWithoutParameters($sql) . ':' . sha1(serialize($parameters));
$key = $this->generateQueryKeyWithoutParameters($sql);
if (is_array($parameters)) {
$key .= ':' . sha1(serialize($parameters));
}

return $key;
}

private function generateQueryKeyWithoutParameters($sql)
Expand Down

0 comments on commit f2ee47f

Please sign in to comment.