Completed
Push — master ( 4c7c4d...1a22e3 )
by Akihito
02:56
created
src/Snidel/Fork/Container.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         if ($pid) {
144 144
             // owner
145
-            $this->log->info('pid: ' . getmypid());
145
+            $this->log->info('pid: '.getmypid());
146 146
 
147 147
             return $this->masterPid;
148 148
         } elseif ($pid === -1) {
@@ -150,15 +150,15 @@  discard block
 block discarded – undo
150 150
         } else {
151 151
             // master
152 152
             $taskQueue = new TaskQueue($this->ownerPid);
153
-            $this->log->info('pid: ' . $this->masterPid);
153
+            $this->log->info('pid: '.$this->masterPid);
154 154
 
155 155
             $log    = $this->log;
156 156
             $pcntl  = $this->pcntl;
157 157
             foreach ($this->signals as $sig) {
158
-                $this->pcntl->signal($sig, function ($sig) use ($log, $pcntl) {
159
-                    $log->info('received signal: ' . $sig);
158
+                $this->pcntl->signal($sig, function($sig) use ($log, $pcntl) {
159
+                    $log->info('received signal: '.$sig);
160 160
                     foreach (array_keys($this->workerPids) as $pid) {
161
-                        $log->info('------> sending signal to worker. signal: ' . $sig);
161
+                        $log->info('------> sending signal to worker. signal: '.$sig);
162 162
                         posix_kill($pid, $sig);
163 163
                         $log->info('<------ sent signal');
164 164
                         $status = null;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             }
170 170
 
171 171
             while ($task = $taskQueue->dequeue()) {
172
-                $this->log->info('dequeued task #' . $taskQueue->dequeuedCount());
172
+                $this->log->info('dequeued task #'.$taskQueue->dequeuedCount());
173 173
                 if (count($this->workerPids) >= $this->concurrency) {
174 174
                     $status = null;
175 175
                     $workerPid = $this->pcntl->waitpid(-1, $status);
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 
201 201
         if (getmypid() === $this->masterPid) {
202 202
             // master
203
-            $this->log->info('forked worker. pid: ' . $fork->getPid());
203
+            $this->log->info('forked worker. pid: '.$fork->getPid());
204 204
             return $fork->getPid();
205 205
         } else {
206 206
             // worker
207
-            $this->log->info('has forked. pid: ' . getmypid());
207
+            $this->log->info('has forked. pid: '.getmypid());
208 208
             // @codeCoverageIgnoreStart
209 209
 
210 210
             foreach ($this->signals as $sig) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 
214 214
             $resultQueue = new ResultQueue($this->ownerPid);
215 215
             $resultHasQueued = false;
216
-            register_shutdown_function(function () use (&$resultHasQueued, $fork, $task, $resultQueue) {
216
+            register_shutdown_function(function() use (&$resultHasQueued, $fork, $task, $resultQueue) {
217 217
                 if (!$resultHasQueued) {
218 218
                     $result = new Result();
219 219
                     $result->setError(error_get_last());
@@ -257,13 +257,13 @@  discard block
 block discarded – undo
257 257
      */
258 258
     public function sendSignalToMaster($sig = SIGTERM)
259 259
     {
260
-        $this->log->info('----> sending signal to master. signal: ' . $sig);
260
+        $this->log->info('----> sending signal to master. signal: '.$sig);
261 261
         posix_kill($this->masterPid, $sig);
262 262
         $this->log->info('<---- sent signal.');
263 263
 
264 264
         $status = null;
265 265
         $this->pcntl->waitpid($this->masterPid, $status);
266
-        $this->log->info('. status: ' . $status);
266
+        $this->log->info('. status: '.$status);
267 267
         $this->masterPid = null;
268 268
     }
269 269
 
Please login to merge, or discard this patch.