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,11 +89,14 @@ class Add extends Command
*/
public function addDocuments($documents)
{
//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.');
}
}
}
//if we don't have documents so far, accept arrays or Traversable objects as-is
if (empty($this->documents)) {
......
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