<?php
 namespace MongoDB;
 use IteratorAggregate;
 use stdClass;
 use Traversable;
 use function call_user_func;
 class MapReduceResult implements IteratorAggregate {
 private $getIterator;
 private $executionTimeMS;
 private $counts;
 private $timing;
 public function __construct(callable $getIterator, stdClass $result) {
 $this->getIterator = $getIterator;
 $this->executionTimeMS = (integer) $result->timeMillis;
 $this->counts = (array) $result->counts;
 $this->timing = isset($result->timing) ? (array) $result->timing : [];
 }
 public function getCounts() {
 return $this->counts;
 }
 public function getExecutionTimeMS() {
 return (integer) $this->executionTimeMS;
 }
 public function getIterator() {
 return call_user_func($this->getIterator);
 }
 public function getTiming() {
 return $this->timing;
 }
 }
 