[TASK] Superfluous comparison in CronCommand 37/25737/4
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 28 Nov 2013 20:42:36 +0000 (21:42 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Fri, 6 Dec 2013 22:19:46 +0000 (23:19 +0100)
Fix superfluous comparison against boolean in
CronCommand::dayMatchesCronCommand

Change-Id: Ia1d852ffbbc772dd89587d304b1234e11e372d2d
Resolves: #54050
Releases: 6.2
Reviewed-on: https://review.typo3.org/25737
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/scheduler/Classes/CronCommand/CronCommand.php

index f60c011..d613d5b 100644 (file)
@@ -171,8 +171,8 @@ class CronCommand {
                // If both fields are restricted (i.e., aren't  *),  the  command will be run when either field
                // matches the current time.  For example, `30 4 1,15 * 5' would cause
                // a command to be run at 4:30 am on the 1st and 15th of each month, plus every Friday.
-               $isDayOfMonthRestricted = (string) $this->cronCommandSections[2] === '*' ? FALSE : TRUE;
-               $isDayOfWeekRestricted = (string) $this->cronCommandSections[4] === '*' ? FALSE : TRUE;
+               $isDayOfMonthRestricted = (string)$this->cronCommandSections[2] !== '*';
+               $isDayOfWeekRestricted = (string)$this->cronCommandSections[4] !== '*';
                $commandMatch = FALSE;
                if ($isInMonth) {
                        if ($isInDayOfMonth && $isDayOfMonthRestricted || $isInDayOfWeek && $isDayOfWeekRestricted || $isInDayOfMonth && !$isDayOfMonthRestricted && $isInDayOfWeek && !$isDayOfWeekRestricted) {