Commit 36b27d72 authored by Bas de Nooijer's avatar Bas de Nooijer

Merge branch 'shieldo-remove_document_check' into develop (PR #296)

parents a9d8a52b 3d2e8828
......@@ -89,9 +89,12 @@ class Add extends Command
*/
public function addDocuments($documents)
{
foreach ($documents as $document) {
if (!($document instanceof DocumentInterface)) {
throw new RuntimeException('Documents must implement DocumentInterface.');
//only check documents for type if in an array (iterating a Traversable may do unnecessary work)
if (is_array($documents)) {
foreach ($documents as $document) {
if (!($document instanceof DocumentInterface)) {
throw new RuntimeException('Documents must implement DocumentInterface.');
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment