src/Cronner/Tasks/Parser.php
private static function expandDaysRange(array $days) : array
	{
		static $dayNames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun',];
		$expandedValues = [];

		foreach ($days as $day) {
			if (Strings::match($day, '~^\w{3}\s*-\s*\w{3}$~u')) {
				list($begin, $end) = Strings::split($day, '~\s*-\s*~');
				$started = FALSE;
				foreach ($dayNames as $dayName) {
					if ($dayName === $begin) {
						$started = TRUE;
					}
					if ($started) {
						$expandedValues[] = $dayName;
					}
					if ($dayName === $end) {
						$started = FALSE;
					}
				}
			} else {
				$expandedValues[] = $day;
			}
		}

		return array_unique($expandedValues);
	}
private static function expandDaysRange(array $days) : array
	{
		static $dayNames = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun',];
		$expandedValues = [];

		foreach ($days as $day) {
			if (Strings::match($day, '~^\w{3}\s*-\s*\w{3}$~u')) {
				list($begin, $end) = Strings::split($day, '~\s*-\s*~');
				$started = FALSE;
				foreach ($dayNames as $dayName) {
					if ($dayName === $begin) {
						$started = TRUE;
					}
					if ($started) {
						$expandedValues[] = $dayName;
					}
					if ($dayName === $end) {
						$started = FALSE;
					}
				}
			} else {
				$expandedValues[] = $day;
			}
		}

		return array_unique($expandedValues);
	}
private static function expandDaysRange ( array $ days ) : array { static $ dayNames = [ 'Mon' , 'Tue' , 'Wed' , 'Thu' , 'Fri' , 'Sat' , 'Sun' , ] ; $ expandedValues = [ ] ; foreach ( $ days as $ day ) { if ( Strings :: match ( $ day , '~^\w{3}\s*-\s*\w{3}$~u' ) ) { list ( $ begin , $ end ) = Strings :: split ( $ day , '~\s*-\s*~' ) ; $ started = FALSE ; foreach ( $ dayNames as $ dayName ) { if ( $ dayName === $ begin ) { $ started = TRUE ; } if ( $ started ) { $ expandedValues [ ] = $ dayName ; } if ( $ dayName === $ end ) { $ started = FALSE ; } } } else { $ expandedValues [ ] = $ day ; } } return array_unique ( $ expandedValues ) ; }
Expands given day names and day ranges to day names only. The day range must be
in "Mon-Fri" format.

@param string[] $days
@return string[]
Expands given day names and day ranges to day names only . The day range must be in Mon - Fri format .