Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
9cf920dc
Commit
9cf920dc
authored
Sep 12, 2013
by
Dorian Villet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message by giving the bad class type.
parent
66f6c1fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
library/Solarium/QueryType/Analysis/Query/Document.php
library/Solarium/QueryType/Analysis/Query/Document.php
+3
-3
No files found.
library/Solarium/QueryType/Analysis/Query/Document.php
View file @
9cf920dc
...
...
@@ -51,7 +51,7 @@ class Document extends Query
{
const
DOCUMENT_TYPE_HINT_EXCEPTION_MESSAGE
=
'The document argument must either implement
\Solarium\QueryType\Select\Result\DocumentInterface or
\Solarium\QueryType\Update\Query\Document\DocumentInterface.'
;
\Solarium\QueryType\Update\Query\Document\DocumentInterface
, instance of %s given
.'
;
/**
* Documents to analyze
...
...
@@ -112,7 +112,7 @@ class Document extends Query
public
function
addDocument
(
$document
)
{
if
(
!
(
$document
instanceof
SelectDocumentInterface
)
&&
!
(
$document
instanceof
UpdateDocumentInterface
))
{
throw
new
RuntimeException
(
s
tatic
::
DOCUMENT_TYPE_HINT_EXCEPTION_MESSAGE
);
throw
new
RuntimeException
(
s
printf
(
static
::
DOCUMENT_TYPE_HINT_EXCEPTION_MESSAGE
,
get_class
(
$document
))
);
}
$this
->
documents
[]
=
$document
;
...
...
@@ -132,7 +132,7 @@ class Document extends Query
{
foreach
(
$documents
as
$document
)
{
if
(
!
(
$document
instanceof
SelectDocumentInterface
)
&&
!
(
$document
instanceof
UpdateDocumentInterface
))
{
throw
new
RuntimeException
(
s
tatic
::
DOCUMENT_TYPE_HINT_EXCEPTION_MESSAGE
);
throw
new
RuntimeException
(
s
printf
(
static
::
DOCUMENT_TYPE_HINT_EXCEPTION_MESSAGE
,
get_class
(
$document
))
);
}
}
...
...
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