PhpBench\Math\Distribution::getStats PHP Method

getStats() public method

public getStats ( )
    public function getStats()
    {
        $stats = [];
        foreach (array_keys($this->closures) as $name) {
            $stats[$name] = $this->getStat($name);
        }
        return $stats;
    }

Usage Example

Example #1
0
 /**
  * It should return all the stats.
  */
 public function testReturnStats()
 {
     $distribution = new Distribution([10, 20]);
     $stats = $distribution->getStats();
     foreach (['min', 'max', 'sum', 'stdev', 'mean', 'mode', 'variance', 'rstdev'] as $key) {
         $this->assertArrayHasKey($key, $stats);
     }
     $this->assertEquals(10, $stats['min']);
     $this->assertEquals(20, $stats['max']);
 }