Completed
Branch master (e048c0)
by Gabriel
02:40
created
src/Junty/TaskRunner/Runner/Runner.php 3 patches
Doc Comments   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,7 +66,6 @@  discard block
 block discarded – undo
66 66
      * Organize tasks and groups order
67 67
      * If this method is executed and a task and a group is not in this list, it won't be executed
68 68
      *
69
-     * @param string-variadic $tasks
70 69
      */
71 70
     public function order(string ...$names)
72 71
     {
@@ -86,7 +85,7 @@  discard block
 block discarded – undo
86 85
     /**
87 86
      * Returns all registred tasks
88 87
      *
89
-     * @return TasksCollection
88
+     * @return \Junty\TaskRunner\Task\TasksCollection
90 89
      */
91 90
     public function getTasks() : TasksCollection
92 91
     {
@@ -149,7 +148,7 @@  discard block
 block discarded – undo
149 148
     /**
150 149
      * Runs a group of tasks
151 150
      *
152
-     * @param string|GroupInterface $group
151
+     * @param string $group
153 152
      */
154 153
     public function runGroup($group)
155 154
     {
@@ -161,6 +160,9 @@  discard block
 block discarded – undo
161 160
         }
162 161
     }
163 162
 
163
+    /**
164
+     * @param string $name
165
+     */
164 166
     private function getFromOrderData($name)
165 167
     {
166 168
         $parts = explode('::', $name);
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Runner;
10 10
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 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
     /**
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
     {
73 73
         foreach ($names as $key => $name) {
74 74
             if ($this->tasks->containsKey($name)) {
75
-                $names[$key] = 'task::' . $name;
75
+                $names[$key] = 'task::'.$name;
76 76
             } elseif ($this->groups->containsKey($name)) {
77
-                $names[$key] = 'group::' . $name;
77
+                $names[$key] = 'group::'.$name;
78 78
             } else {
79
-                throw new \Exception('\'' . $name . '\' is not registred as task or group.');
79
+                throw new \Exception('\''.$name.'\' is not registred as task or group.');
80 80
             }
81 81
         }
82 82
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
         if (is_string($task)) {
139 139
             if (!isset($this->tasks[$task])) {
140
-                throw new \Exception('\'' . $task . '\' is not a registred task.');
140
+                throw new \Exception('\''.$task.'\' is not a registred task.');
141 141
             }
142 142
         }
143 143
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Console/Command/RunCommand.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
             if ($this->runner->getGroups()->containsKey($el)) {
44 44
                 $group = $this->runner->getGroups()->get($el);
45
-                $output->writeln('Executing group \'' . $group->getName() . '\'');
45
+                $output->writeln('Executing group \''.$group->getName().'\'');
46 46
 
47 47
                 $this->executeGroup($group, $output);
48 48
             } elseif ($this->runner->getTasks()->containsKey($el)) {
49 49
                 $task = $this->runner->getTasks()->get($el);
50
-                $output->writeln('Executing task \'' . $task->getName() . '\'');
50
+                $output->writeln('Executing task \''.$task->getName().'\'');
51 51
 
52 52
                 $this->runner->runTask($task);
53 53
             }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             foreach ($els as $el) {
60 60
                 $data = $this->getFromOrderData($el);
61 61
 
62
-                $output->writeln('Executing ' . $data['type'] . ' \'' . $data['name'] . '\'');
62
+                $output->writeln('Executing '.$data['type'].' \''.$data['name'].'\'');
63 63
 
64 64
                 try {
65 65
                     if ($data['type'] == 'group') {
@@ -70,24 +70,24 @@  discard block
 block discarded – undo
70 70
                         $this->runner->runTask($data['name']);
71 71
                     }
72 72
                 } catch (\Exception $e) {
73
-                    $output->writeln('Error on ' . $data['type'] . ' \'' . $data['name'] . '\': ' . $e->getMessage());
73
+                    $output->writeln('Error on '.$data['type'].' \''.$data['name'].'\': '.$e->getMessage());
74 74
                 }
75 75
             }
76 76
         }
77 77
 
78 78
         $time = round((microtime(true) - $_SERVER['REQUEST_TIME_FLOAT']) * 10000);
79
-        $output->writeln('Finished! Time: ' . $time . 'ms');
79
+        $output->writeln('Finished! Time: '.$time.'ms');
80 80
     }
81 81
 
82 82
     private function executeGroup(GroupInterface $group, OutputInterface $output)
83 83
     {
84 84
         foreach ($group->getTasks() as $task) {
85
-            $output->writeln('--Executing task \'' . $task->getName() . '\'');
85
+            $output->writeln('--Executing task \''.$task->getName().'\'');
86 86
 
87 87
             try {
88 88
                 $this->runner->runTask($task);
89 89
             } catch (\Exception $e) {
90
-                $output->writeln('--Error on task \'' . $task->getName() . '\': ' . $e->getMessage());
90
+                $output->writeln('--Error on task \''.$task->getName().'\': '.$e->getMessage());
91 91
             }
92 92
         }
93 93
     }
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/TaskInterface.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/AbstractTask.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/Group.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/GroupsCollection.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/GroupInterface.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/Task.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.
src/Junty/TaskRunner/Task/TasksCollection.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Junty
4
- *
5
- * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
- * @license MIT License
7
- */
3
+     * Junty
4
+     *
5
+     * @author Gabriel Jacinto aka. GabrielJMJ <[email protected]>
6
+     * @license MIT License
7
+     */
8 8
  
9 9
 namespace Junty\TaskRunner\Task;
10 10
 
Please login to merge, or discard this patch.