예제 #1
0
 /**
  * Creates a time interval.
  *
  * @param Time $start
  * @param Time $end
  *
  * @throws \InvalidArgumentException If the opening time is not earlier than closing time
  */
 public function __construct(Time $start, Time $end)
 {
     $this->start = $start;
     $this->end = $end;
     if ($start->isAfterOrEqual($end)) {
         throw new \InvalidArgumentException(sprintf('The opening time "%s" must be before the closing time "%s".', $start->toString(), $end->toString()));
     }
 }
예제 #2
0
파일: TimeTest.php 프로젝트: seytar/psx
 public function testConstructorFull()
 {
     $time = new Time(13, 37, 12);
     $this->assertEquals('13:37:12', $time->toString());
 }