When\When::byhour PHP Method

byhour() public method

public byhour ( $hours, $delimiter = "," )
    public function byhour($hours, $delimiter = ",")
    {
        if ($this->byhours = self::prepareItemsList($hours, $delimiter, 'hour')) {
            return $this;
        }
        throw new \InvalidArgumentException("byhour: Accepts numeric values between 0 and 23");
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @expectedException InvalidArgumentException
  */
 public function testInvalidByHourTwo()
 {
     $test = new When();
     $test->byhour('-1, -2');
 }