/** * Return statistics about this iteration collection. * * See self::$stats. * * TODO: Rename to getDistribution * * @return Distribution */ public function getStats() { if (null !== $this->errorStack) { throw new \RuntimeException(sprintf('Cannot retrieve stats when an exception was encountered ([%s] %s)', $this->errorStack->getTop()->getClass(), $this->errorStack->getTop()->getMessage())); } if (false === $this->computed) { throw new \RuntimeException('No statistics have yet been computed for this iteration set (::computeStats should be called)'); } return $this->stats; }