Completed
Push — master ( 6c3d25...3a69cb )
by Gabriel
02:16
created
src/Junty/TaskRunner/Runner/Runner.php 2 patches
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     /**
48 48
      * Registres a task
49 49
      *
50
-     * @param string|TaskInterface $task
50
+     * @param string $task
51 51
      * @param callable             $callback
52 52
      */
53 53
     public function task($task, callable $callback = null)
@@ -81,7 +81,6 @@  discard block
 block discarded – undo
81 81
      * Organize tasks and groups order
82 82
      * If this method is executed and a task and a group is not in this list, it won't be executed
83 83
      *
84
-     * @param string-variadic $tasks
85 84
      */
86 85
     public function order(string ...$names)
87 86
     {
@@ -101,7 +100,7 @@  discard block
 block discarded – undo
101 100
     /**
102 101
      * Returns all registred tasks
103 102
      *
104
-     * @return TasksCollection
103
+     * @return \Junty\TaskRunner\Task\TasksCollection
105 104
      */
106 105
     public function getTasks() : TasksCollection
107 106
     {
@@ -164,7 +163,7 @@  discard block
 block discarded – undo
164 163
     /**
165 164
      * Runs a group of tasks
166 165
      *
167
-     * @param string|GroupInterface $group
166
+     * @param string $group
168 167
      */
169 168
     public function runGroup($group)
170 169
     {
@@ -176,6 +175,9 @@  discard block
 block discarded – undo
176 175
         }
177 176
     }
178 177
 
178
+    /**
179
+     * @param string $name
180
+     */
179 181
     private function getFromOrderData($name)
180 182
     {
181 183
         $parts = explode('::', $name);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         }
42 42
 
43 43
         $this->groups->set($group, $tasks);
44
-        $this->order[] = 'group::' . $_name;
44
+        $this->order[] = 'group::'.$_name;
45 45
     }
46 46
 
47 47
     /**
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         }
60 60
 
61 61
         $this->tasks->set($task, $callback);
62
-        $this->order[] = 'task::' . $_name;
62
+        $this->order[] = 'task::'.$_name;
63 63
     }
64 64
 
65 65
     /**
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      */
71 71
     public function __set(string $task, $callback)
72 72
     {
73
-        if(!is_callable($callback) && !$callback instanceof TaskInterface) {
73
+        if (!is_callable($callback) && !$callback instanceof TaskInterface) {
74 74
             throw new \InvalidArgumentException('Task must be callable or instanceof TaskInterface.');
75 75
         }
76 76
 
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
     {
88 88
         foreach ($names as $key => $name) {
89 89
             if ($this->tasks->containsKey($name)) {
90
-                $names[$key] = 'task::' . $name;
90
+                $names[$key] = 'task::'.$name;
91 91
             } elseif ($this->groups->containsKey($name)) {
92
-                $names[$key] = 'group::' . $name;
92
+                $names[$key] = 'group::'.$name;
93 93
             } else {
94
-                throw new \Exception('\'' . $name . '\' is not registred as task or group.');
94
+                throw new \Exception('\''.$name.'\' is not registred as task or group.');
95 95
             }
96 96
         }
97 97
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         if (is_string($task)) {
154 154
             if (!isset($this->tasks[$task])) {
155
-                throw new \Exception('\'' . $task . '\' is not a registred task.');
155
+                throw new \Exception('\''.$task.'\' is not a registred task.');
156 156
             }
157 157
         }
158 158
 
Please login to merge, or discard this patch.