src/Cronner/Tasks/Parser.php
private static function parseOneTime(string $time) : array
	{
		$time = static::translateToTimes($time);
		$parts = Strings::split($time, '/\s*-\s*/');
		if (!static::isValidTime($parts[0]) || (isset($parts[1]) && !static::isValidTime($parts[1]))) {
			throw new InvalidParameterException(
				"Times annotation is not in valid format. It must looks like 'hh:mm[ - hh:mm]' but '" . $time . "' was given."
			);
		}
		$times = [];
		if (static::isTimeOverMidnight($parts[0], isset($parts[1]) ? $parts[1] : NULL)) {
			$times[] = static::timePartsToArray('00:00', $parts[1]);
			$times[] = static::timePartsToArray($parts[0], '23:59');
		} else {
			$times[] = static::timePartsToArray($parts[0], isset($parts[1]) ? $parts[1] : NULL);
		}

		return $times;
	}
private static function parseOneTime(string $time) : array
	{
		$time = static::translateToTimes($time);
		$parts = Strings::split($time, '/\s*-\s*/');
		if (!static::isValidTime($parts[0]) || (isset($parts[1]) && !static::isValidTime($parts[1]))) {
			throw new InvalidParameterException(
				"Times annotation is not in valid format. It must looks like 'hh:mm[ - hh:mm]' but '" . $time . "' was given."
			);
		}
		$times = [];
		if (static::isTimeOverMidnight($parts[0], isset($parts[1]) ? $parts[1] : NULL)) {
			$times[] = static::timePartsToArray('00:00', $parts[1]);
			$times[] = static::timePartsToArray($parts[0], '23:59');
		} else {
			$times[] = static::timePartsToArray($parts[0], isset($parts[1]) ? $parts[1] : NULL);
		}

		return $times;
	}
private static function parseOneTime ( string $ time ) : array { $ time = static :: translateToTimes ( $ time ) ; $ parts = Strings :: split ( $ time , '/\s*-\s*/' ) ; if ( ! static :: isValidTime ( $ parts [ 0 ] ) || ( isset ( $ parts [ 1 ] ) && ! static :: isValidTime ( $ parts [ 1 ] ) ) ) { throw new InvalidParameterException ( "Times annotation is not in valid format. It must looks like 'hh:mm[ - hh:mm]' but '" . $ time . "' was given." ) ; } $ times = [ ] ; if ( static :: isTimeOverMidnight ( $ parts [ 0 ] , isset ( $ parts [ 1 ] ) ? $ parts [ 1 ] : NULL ) ) { $ times [ ] = static :: timePartsToArray ( '00:00' , $ parts [ 1 ] ) ; $ times [ ] = static :: timePartsToArray ( $ parts [ 0 ] , '23:59' ) ; } else { $ times [ ] = static :: timePartsToArray ( $ parts [ 0 ] , isset ( $ parts [ 1 ] ) ? $ parts [ 1 ] : NULL ) ; } return $ times ; }
Parses one time annotation. If it is invalid throws exception.

@param string $time
@return string[][]
@throws InvalidParameterException
Parses one time annotation . If it is invalid throws exception .