Completed
Pull Request — master (#115)
by Richard
03:18
created
src/Rule.php 1 patch
Braces   +15 added lines, -6 removed lines patch added patch discarded remove patch
@@ -42,23 +42,32 @@
 block discarded – undo
42 42
 	}
43 43
 
44 44
 	private function timeFrequency($frequency, $time = null) {
45
-		if ($time === null) $time = time();
45
+		if ($time === null) {
46
+			$time = time();
47
+		}
46 48
 		$num = (int) $frequency;
47 49
 		$unit = strtoupper(trim(str_replace($num, '', $frequency)));
48 50
 
49 51
 		$offset = $num * constant(self::class . '::' . $unit);
50 52
 
51
-		if ($time > $this->lastRun + $offset) return true;
52
-		else return false;
53
+		if ($time > $this->lastRun + $offset) {
54
+			return true;
55
+		} else {
56
+			return false;
57
+		}
53 58
 	}
54 59
 
55 60
 	public function shouldRun($time = null) {
56 61
 		if (isset($this->properties['update-frequency']) && $this->lastRun !== 0) {
57 62
 			$frequency = $this->properties['update-frequency'];
58 63
 			$static = ['always' => true, 'never' => false];
59
-			if (isset($static[$frequency])) return $static[$frequency];
60
-			else return $this->timeFrequency($frequency, $time);
64
+			if (isset($static[$frequency])) {
65
+				return $static[$frequency];
66
+			} else {
67
+				return $this->timeFrequency($frequency, $time);
68
+			}
69
+		} else {
70
+			return true;
61 71
 		}
62
-		else return true;
63 72
 	}
64 73
 }
Please login to merge, or discard this patch.