PhpBench\Model\ErrorStack::getTop PHP Метод

getTop() публичный Метод

public getTop ( )
    public function getTop()
    {
        return reset($this->errors);
    }

Usage Example

Пример #1
0
 /**
  * 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;
 }