We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 443bbbf commit 31299e9Copy full SHA for 31299e9
src/Operation/Count.php
@@ -91,11 +91,12 @@ public function execute(Server $server)
91
throw new RuntimeException(isset($result['errmsg']) ? $result['errmsg'] : 'Unknown error');
92
}
93
94
- if ( ! isset($result['n']) || ! is_integer($result['n'])) {
95
- throw new UnexpectedValueException('count command did not return an "n" integer');
+ // Older server versions may return a float
+ if ( ! isset($result['n']) || ! (is_integer($result['n']) || is_float($result['n']))) {
96
+ throw new UnexpectedValueException('count command did not return an "n" value');
97
98
- return $result['n'];
99
+ return (integer) $result['n'];
100
101
102
/**
0 commit comments