Completed
Push — 2.0 ( bcdb61...f02592 )
by Marco
02:29
created
src/Comodojo/Extender/Listeners/StopSummary.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@
 block discarded – undo
14 14
         $chars = 60;
15 15
 
16 16
         // show the header
17
-        $console->br()->border('-',$chars);
17
+        $console->br()->border('-', $chars);
18 18
         $console->bold()->flank('Extender execution summary');
19
-        $console->border('-',$chars);
19
+        $console->border('-', $chars);
20 20
         $console->out('Total run time: '.self::calculateRunTime($daemon->starttime));
21
-        $console->border('-',$chars);
21
+        $console->border('-', $chars);
22 22
         $padding = $console->padding(26);
23
-        $padding->label('Total processed jobs')->result($daemon->completedjobs+$daemon->failedjobs);
23
+        $padding->label('Total processed jobs')->result($daemon->completedjobs + $daemon->failedjobs);
24 24
         $padding = $console->padding(30);
25 25
         $padding->label('├─ Completed')->result('<light_green>'.$daemon->completedjobs.'</green>');
26 26
         $padding->label('└─ Failed')->result('<red>'.$daemon->failedjobs.'</red>');
27
-        $console->border('-',$chars);
27
+        $console->border('-', $chars);
28 28
 
29 29
     }
30 30
 
31 31
     private static function calculateRunTime($starttime) {
32 32
 
33
-        $start_formatted = sprintf("%06d",($starttime - floor($starttime)) * 1000000);
34
-        $start = new DateTime( date('Y-m-d H:i:s.'.$start_formatted, $starttime) );
33
+        $start_formatted = sprintf("%06d", ($starttime - floor($starttime)) * 1000000);
34
+        $start = new DateTime(date('Y-m-d H:i:s.'.$start_formatted, $starttime));
35 35
         $end = new DateTime();
36 36
 
37 37
         $diff = $end->diff($start);
Please login to merge, or discard this patch.
src/Comodojo/Extender/Listeners/LoopLimit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
         $daemon = $event->getDaemon();
11 11
 
12
-        if ( $daemon->looplimit === $daemon->loopcount) {
12
+        if ( $daemon->looplimit === $daemon->loopcount ) {
13 13
             $daemon->logger->info('Stopping daemon due to loop limit ('.$daemon->looplimit.') reached');
14 14
             // $daemon->stop();
15 15
             $daemon->loopactive = false;
Please login to merge, or discard this patch.
src/Comodojo/Extender/Listeners/LoopSummary.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@
 block discarded – undo
14 14
 
15 15
         if ( empty($jobs) ) return;
16 16
 
17
-        $console->border('-',30);
17
+        $console->border('-', 30);
18 18
         $console->bold()->green('Extender loop summary');
19 19
         $console->out("Loop duration: ".round($daemon->loopelapsed));
20
-        $console->border('-',30);
20
+        $console->border('-', 30);
21 21
         $console->out("Executed jobs: ");
22 22
         $console->table($jobs);
23 23
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Utils/Validator.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
 
56 56
             if ( $e_count == 5 ) $e_array[] = "*";
57 57
 
58
-        }
59
-        catch (Exception $e) {
58
+        } catch (Exception $e) {
60 59
 
61 60
             throw $e;
62 61
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Events/TaskStatusEvent.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -28,6 +28,9 @@
 block discarded – undo
28 28
 
29 29
     private $task;
30 30
 
31
+    /**
32
+     * @param string $status
33
+     */
31 34
     public function __construct($status, TaskInterface $task) {
32 35
 
33 36
         $name = $task->getName();
Please login to merge, or discard this patch.
src/Comodojo/Extender/Task/AbstractTask.php 1 patch
Doc Comments   +5 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,8 +67,7 @@  discard block
 block discarded – undo
67 67
     /**
68 68
      * Get niceness of a running process
69 69
      *
70
-     * @param int|null $pid The pid to query, or current process if null
71
-     * @return int
70
+     * @return string
72 71
      */
73 72
     public function getName() {
74 73
 
@@ -79,8 +78,7 @@  discard block
 block discarded – undo
79 78
     /**
80 79
      * Get niceness of a running process
81 80
      *
82
-     * @param int|null $pid The pid to query, or current process if null
83
-     * @return int
81
+     * @return TaskParameters
84 82
      */
85 83
     public function getParameters() {
86 84
 
@@ -91,8 +89,8 @@  discard block
 block discarded – undo
91 89
     /**
92 90
      * Get niceness of a running process
93 91
      *
94
-     * @param int|null $pid The pid to query, or current process if null
95
-     * @return int
92
+     * @param string $name
93
+     * @return AbstractTask
96 94
      */
97 95
     public function setName($name) {
98 96
 
@@ -105,8 +103,7 @@  discard block
 block discarded – undo
105 103
     /**
106 104
      * Get niceness of a running process
107 105
      *
108
-     * @param int|null $pid The pid to query, or current process if null
109
-     * @return int
106
+     * @return AbstractTask
110 107
      */
111 108
     public function setParameters(TaskParameters $parameters) {
112 109
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Task/Table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
137 137
 
138 138
         $result = [];
139 139
 
140
-        foreach($tasks as $task) {
140
+        foreach ( $tasks as $task ) {
141 141
 
142 142
             if ( empty($task['name']) || empty($task['class']) ) {
143 143
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Task/Result.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 
22
-class Result extends Model{
22
+class Result extends Model {
23 23
 
24 24
     protected $mode = self::READONLY;
25 25
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 
22
-class Result extends Model{
22
+class Result extends Model {
23 23
 
24 24
     protected $mode = self::READONLY;
25 25
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Utils/StopWatch.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -111,9 +111,9 @@
 block discarded – undo
111 111
 
112 112
         $t = microtime(true);
113 113
 
114
-        $micro = sprintf("%06d",($t - floor($t)) * 1000000);
114
+        $micro = sprintf("%06d", ($t - floor($t)) * 1000000);
115 115
 
116
-        return new DateTime( date('Y-m-d H:i:s.'.$micro, $t) );
116
+        return new DateTime(date('Y-m-d H:i:s.'.$micro, $t));
117 117
 
118 118
     }
119 119
 
Please login to merge, or discard this patch.