Пример #1
0
 /**
  * @param array $times
  * @param string $format
  * @return \WallaceMaxters\Timer\Collection
  */
 public static function collection(array $times = [], $format = self::DEFAULT_FORMAT)
 {
     return Collection::create($times)->setFormat($format);
 }
Пример #2
0
 public function testWithFloatValues()
 {
     $c = new Collection([2.5, 2.5, 1.5, 3.5]);
     $this->assertEquals(10, $c->sum()->getSeconds());
     $c->add(2.5);
     $this->assertEquals(12.5, $c->sum()->getSeconds());
     $this->assertEquals('00:00:12', $c->sum()->format());
 }