Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
fb7cb1b6
Commit
fb7cb1b6
authored
Jun 17, 2015
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Older servers may return count "n" as a float
parent
c5a0964f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
Count.php
src/Operation/Count.php
+4
-3
No files found.
src/Operation/Count.php
View file @
fb7cb1b6
...
@@ -91,11 +91,12 @@ class Count implements Executable
...
@@ -91,11 +91,12 @@ class Count implements Executable
throw
new
RuntimeException
(
isset
(
$result
[
'errmsg'
])
?
$result
[
'errmsg'
]
:
'Unknown error'
);
throw
new
RuntimeException
(
isset
(
$result
[
'errmsg'
])
?
$result
[
'errmsg'
]
:
'Unknown error'
);
}
}
if
(
!
isset
(
$result
[
'n'
])
||
!
is_integer
(
$result
[
'n'
]))
{
// Older server versions may return a float
throw
new
UnexpectedValueException
(
'count command did not return an "n" integer'
);
if
(
!
isset
(
$result
[
'n'
])
||
!
(
is_integer
(
$result
[
'n'
])
||
is_float
(
$result
[
'n'
])))
{
throw
new
UnexpectedValueException
(
'count command did not return an "n" value'
);
}
}
return
$result
[
'n'
];
return
(
integer
)
$result
[
'n'
];
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment