src/Cronner/Tasks/Parser.php
public static function parseDays(string $annotation)
	{
		static $validValues = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun',];

		$days = NULL;
		$annotation = Strings::trim($annotation);
		if (Strings::length($annotation)) {
			$days = static::translateToDayNames($annotation);
			$days = static::expandDaysRange($days);
			foreach ($days as $day) {
				if (!in_array($day, $validValues)) {
					throw new InvalidParameterException(
						"Given day parameter '" . $day . "' must be one from " . implode(', ', $validValues) . "."
					);
				}
			}
			$days = array_values(array_intersect($validValues, $days));
		}

		return $days ?: NULL;
	}
public static function parseDays(string $annotation)
	{
		static $validValues = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun',];

		$days = NULL;
		$annotation = Strings::trim($annotation);
		if (Strings::length($annotation)) {
			$days = static::translateToDayNames($annotation);
			$days = static::expandDaysRange($days);
			foreach ($days as $day) {
				if (!in_array($day, $validValues)) {
					throw new InvalidParameterException(
						"Given day parameter '" . $day . "' must be one from " . implode(', ', $validValues) . "."
					);
				}
			}
			$days = array_values(array_intersect($validValues, $days));
		}

		return $days ?: NULL;
	}
public static function parseDays ( string $ annotation ) { static $ validValues = [ 'Mon' , 'Tue' , 'Wed' , 'Thu' , 'Fri' , 'Sat' , 'Sun' , ] ; $ days = NULL ; $ annotation = Strings :: trim ( $ annotation ) ; if ( Strings :: length ( $ annotation ) ) { $ days = static :: translateToDayNames ( $ annotation ) ; $ days = static :: expandDaysRange ( $ days ) ; foreach ( $ days as $ day ) { if ( ! in_array ( $ day , $ validValues ) ) { throw new InvalidParameterException ( "Given day parameter '" . $ day . "' must be one from " . implode ( ', ' , $ validValues ) . "." ) ; } } $ days = array_values ( array_intersect ( $ validValues , $ days ) ) ; } return $ days ? : NULL ; }
Parses allowed days for cron task. If annotation is invalid
throws exception.

@param string $annotation
@return string[]|null
@throws InvalidParameterException
Parses allowed days for cron task . If annotation is invalid throws exception .