Skip to content

Commit

Permalink
use is_string instead to reduce chances for unexpected behavior.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Mancini committed May 21, 2015
1 parent 3f04d12 commit dca55fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Riak/Object.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function validateIndexNameAndValue($indexName, $value)
"'index. Expecting 'integer', value was '" . gettype($value) . "''");
}

if ($isStringIndex && is_int($value)) {
if ($isStringIndex && !is_string($value)) {
throw new \InvalidArgumentException("Invalid type for '" . $indexName .
"'index. Expecting 'string', value was '" . gettype($value) . "''");
}
Expand Down

0 comments on commit dca55fd

Please sign in to comment.