Пример #1
0
 /**
  * @param Range $range
  */
 public function setDays(Range $range)
 {
     $this->days = $range->serialize();
     return $this;
 }
Пример #2
0
 /**
  * @covers ::serialize
  * @covers ::unserialize
  */
 public function testSerializable()
 {
     $range = new Range(10, 32);
     $this->assertSame('10|32', $range->serialize());
     $range->unserialize('2|3');
     $this->assertEquals(new Range(2, 3), $range);
 }
Пример #3
0
 /**
  * Return a new Range object with added min and max values
  *
  * @param Range $range
  */
 public function add(Range $range)
 {
     return new Range($this->getMin() + $range->getMin(), $this->getMax() + $range->getMax(), $this->getFormat());
 }