Completed
Push — 2.0 ( ee0168...76e968 )
by Marco
11:26
created
src/Shell/Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@
 block discarded – undo
200 200
 
201 201
             $commands = Spyc::YAMLLoad(EXTENDER_COMMANDS_CONFIG);
202 202
 
203
-            foreach ($commands as $command => $parameters) {
203
+            foreach ( $commands as $command => $parameters ) {
204 204
                 
205 205
                 $controller->add($command, $parameters["data"]);
206 206
 
Please login to merge, or discard this patch.
src/Extender.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -482,7 +482,7 @@
 block discarded – undo
482 482
                 )
483 483
             )) : 1;
484 484
 
485
-            while (true) {
485
+            while ( true ) {
486 486
 
487 487
                 $this->cycle();
488 488
 
Please login to merge, or discard this patch.
src/Comodojo/Extender/Extender.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     ) {
28 28
 
29 29
         // parsing configuration
30
-        $this->configuration = new Configuration( DefaultConfiguration::get() );
30
+        $this->configuration = new Configuration(DefaultConfiguration::get());
31 31
         $this->configuration->merge($configuration);
32 32
 
33 33
         // fix the daemon start time
Please login to merge, or discard this patch.
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/Jobs/Runner.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 
124 124
     public function run() {
125 125
 
126
-        foreach ($this->manager->queued() as $uid => $job) {
126
+        foreach ( $this->manager->queued() as $uid => $job ) {
127 127
 
128
-            $this->events->emit( new JobEvent('start', $job) );
129
-            $this->events->emit( new JobStatusEvent('start', $job) );
128
+            $this->events->emit(new JobEvent('start', $job));
129
+            $this->events->emit(new JobStatusEvent('start', $job));
130 130
 
131 131
             if ( $this->multithread === false ) {
132 132
 
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 
144 144
                 $this->manager->isCompleted($uid, $result->success, $result->result, $result->wid);
145 145
 
146
-                $this->events->emit( new JobEvent('stop', $job) );
147
-                $this->events->emit( new JobStatusEvent('stop', $job) );
146
+                $this->events->emit(new JobEvent('stop', $job));
147
+                $this->events->emit(new JobStatusEvent('stop', $job));
148 148
 
149 149
                 continue;
150 150
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
                 $this->manager->isAborted($uid, $e->getMessage());
160 160
 
161
-                $this->events->emit( new JobEvent('stop', $job) );
162
-                $this->events->emit( new JobStatusEvent('stop', $job) );
161
+                $this->events->emit(new JobEvent('stop', $job));
162
+                $this->events->emit(new JobStatusEvent('stop', $job));
163 163
 
164 164
                 continue;
165 165
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
             if ( $this->max_childs > 0 && count($this->manager->running()) >= $this->max_childs ) {
171 171
 
172
-                while( count($this->manager->running()) >= $this->max_childs ) {
172
+                while ( count($this->manager->running()) >= $this->max_childs ) {
173 173
 
174 174
                     $this->catcher();
175 175
 
@@ -342,8 +342,8 @@  discard block
 block discarded – undo
342 342
 
343 343
                 $this->logger->notice("Job ".$job->name."(id: ".$job->id.", uid: $uid) ends in $status");
344 344
 
345
-                $this->events->emit( new JobEvent('stop', $job) );
346
-                $this->events->emit( new JobStatusEvent('stop', $job) );
345
+                $this->events->emit(new JobEvent('stop', $job));
346
+                $this->events->emit(new JobStatusEvent('stop', $job));
347 347
 
348 348
             } else {
349 349
 
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
 
374 374
                     $this->logger->notice("Job ".$job->name."(id: ".$job->id.", uid: $uid) ends in error");
375 375
 
376
-                    $this->events->emit( new JobEvent('stop', $job) );
377
-                    $this->events->emit( new JobStatusEvent('stop', $job) );
376
+                    $this->events->emit(new JobEvent('stop', $job));
377
+                    $this->events->emit(new JobStatusEvent('stop', $job));
378 378
 
379 379
                 }
380 380
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
     private function abortQueued($message) {
388 388
 
389
-        foreach ($this->manager->queued() as $uid => $job) {
389
+        foreach ( $this->manager->queued() as $uid => $job ) {
390 390
 
391 391
             $this->manager->isAborted($uid, $message);
392 392
 
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/Runner.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
             $thetask = $this->table->get($task)->getInstance($name, $parameters);
90 90
 
91
-            $this->events->emit( new TaskEvent('start', $thetask) );
91
+            $this->events->emit(new TaskEvent('start', $thetask));
92 92
 
93 93
             $pid = $thetask->getPid();
94 94
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 $this->stopwatch->getStartTime()
102 102
             );
103 103
 
104
-            $this->events->emit( new TaskStatusEvent('start', $thetask) );
104
+            $this->events->emit(new TaskStatusEvent('start', $thetask));
105 105
 
106 106
             try {
107 107
 
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
 
124 124
             }
125 125
 
126
-            $this->events->emit( new TaskStatusEvent($status ? 'success' : 'error', $thetask) );
126
+            $this->events->emit(new TaskStatusEvent($status ? 'success' : 'error', $thetask));
127 127
 
128
-            $this->events->emit( new TaskStatusEvent('stop', $thetask) );
128
+            $this->events->emit(new TaskStatusEvent('stop', $thetask));
129 129
 
130
-            $this->events->emit( new TaskEvent('stop', $thetask) );
130
+            $this->events->emit(new TaskEvent('stop', $thetask));
131 131
 
132 132
             $this->stopwatch->stop();
133 133
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         }
145 145
 
146 146
         return new Result(
147
-            array (
147
+            array(
148 148
                 $pid,
149 149
                 $name,
150 150
                 $status,
Please login to merge, or discard this patch.