コード例 #1
0
ファイル: When.php プロジェクト: solleer/framework
 public function byday($bywdaylist, $delimiter = ",")
 {
     if (is_string($bywdaylist) && strpos($bywdaylist, $delimiter) !== false) {
         // remove any accidental delimiters
         $bywdaylist = trim($bywdaylist, $delimiter);
         $bywdaylist = explode($delimiter, $bywdaylist);
     } else {
         if (is_string($bywdaylist)) {
             // remove any accidental delimiters
             $bywdaylist = trim($bywdaylist, $delimiter);
             $bywdaylist = array($bywdaylist);
         }
     }
     if (is_array($bywdaylist) && Valid::daysList($bywdaylist)) {
         $this->bydays = self::createDaysList($bywdaylist);
         return $this;
     }
     throw new \InvalidArgumentException("bydays: Accepts (optional) positive and negative values between 1 and 53 followed by a valid week day");
 }