averaging() public static method

The return type of this collector is float, regardless of the type of the stream elements.
public static averaging ( ) : phpstreams\Collector
return phpstreams\Collector
Example #1
0
 public function testAveraging()
 {
     $instance = Collectors::averaging();
     $instance->add("a", 6);
     $instance->add("b", 9);
     $instance->add("21", 4);
     $instance->add("foo", 21);
     $this->assertEquals(10, $instance->get());
 }