Passed
Push — master ( 68cce9...eb5e46 )
by Rick
02:35
created
src/RepeatableTask.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,9 @@
 block discarded – undo
49 49
 		{
50 50
 			$result = $this->childTask->run();
51 51
 
52
-			if ($result instanceof TaskInterface)
53
-				$this->childTask = $result;
52
+			if ($result instanceof TaskInterface) {
53
+							$this->childTask = $result;
54
+			}
54 55
 		}
55 56
 
56 57
 		$this->expiryTime = $this->getExpiryTime() + $this->getRepeatInterval();
Please login to merge, or discard this patch.
src/CallbackTask.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,9 @@
 block discarded – undo
44 44
 	{
45 45
 		$result = call_user_func_array($this->getCallback(), $this->getStoredArguments());
46 46
 
47
-		if (!($result instanceof TaskInterface))
48
-			return null;
47
+		if (!($result instanceof TaskInterface)) {
48
+					return null;
49
+		}
49 50
 
50 51
 		return $result;
51 52
 	}
Please login to merge, or discard this patch.
src/TaskController.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public function add(TaskInterface $task): bool
42 42
 	{
43
-		if ($this->exists($task))
44
-			return false;
43
+		if ($this->exists($task)) {
44
+					return false;
45
+		}
45 46
 
46 47
 		$this->tasks[] = $task;
47 48
 
@@ -55,8 +56,9 @@  discard block
 block discarded – undo
55 56
 	 */
56 57
 	public function remove(TaskInterface $task): bool
57 58
 	{
58
-		if (!$this->exists($task))
59
-			return false;
59
+		if (!$this->exists($task)) {
60
+					return false;
61
+		}
60 62
 
61 63
 		unset($this->tasks[array_search($task, $this->tasks)]);
62 64
 
@@ -77,16 +79,18 @@  discard block
 block discarded – undo
77 79
 	{
78 80
 		foreach ($this->tasks as $task)
79 81
 		{
80
-			if (time() < $task->getExpiryTime())
81
-				continue;
82
+			if (time() < $task->getExpiryTime()) {
83
+							continue;
84
+			}
82 85
 
83 86
 			$result = $task->run();
84 87
 
85 88
 			// It is removed first.
86 89
 			$this->remove($task);
87 90
 
88
-			if ($result instanceof TaskInterface)
89
-				$this->add($result);
91
+			if ($result instanceof TaskInterface) {
92
+							$this->add($result);
93
+			}
90 94
 		}
91 95
 	}
92 96
 }
93 97
\ No newline at end of file
Please login to merge, or discard this patch.