protected function setDayOfWeek($dayOfWeek)
    {
        if (!in_array($dayOfWeek, Days::toArray())) {
            throw new \InvalidArgumentException(sprintf('Invalid day of week "%s".', $dayOfWeek));
        }

        $this->dayOfWeek = $dayOfWeek;
    }
protected function setDayOfWeek($dayOfWeek)
    {
        if (!in_array($dayOfWeek, Days::toArray())) {
            throw new \InvalidArgumentException(sprintf('Invalid day of week "%s".', $dayOfWeek));
        }

        $this->dayOfWeek = $dayOfWeek;
    }
protected function setDayOfWeek ( $ dayOfWeek ) { if ( ! in_array ( $ dayOfWeek , Days :: toArray ( ) ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Invalid day of week "%s".' , $ dayOfWeek ) ) ; } $ this -> dayOfWeek = $ dayOfWeek ; }
Sets the day of week.

@param int $dayOfWeek

@throws \InvalidArgumentException If the given day is invalid
Sets the day of week .