8000 [Process] fixed usage of constants in closure · helmer/symfony@1bef14a · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bef14a

Browse files
committed
[Process] fixed usage of constants in closure
1 parent 
8000
7581c3b commit 1bef14a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ public function run($callback = null)
9494
$this->stdout = '';
9595
$this->stderr = '';
9696
$that = $this;
97-
$callback = function ($type, $data) use ($that, $callback)
97+
$out = self::OUT;
98+
$err = self::ERR;
99+
$callback = function ($type, $data) use ($that, $callback, $out, $err)
98100
{
99-
if (self::OUT == $type) {
101+
if ($out == $type) {
100102
$that->addOutput($data);
101103
} else {
102104
$that->addErrorOutput($data);
@@ -159,7 +161,7 @@ public function run($callback = null)
159161
$type = array_search($pipe, $pipes);
160162
$data = fread($pipe, 8192);
161163
if (strlen($data) > 0) {
162-
call_user_func($callback, $type == 1 ? self::OUT : self::ERR, $data);
164+
call_user_func($callback, $type == 1 ? $out : $err, $data);
163165
}
164166
if (false === $data || feof($pipe)) {
165167
fclose($pipe);

0 commit comments

Comments
 (0)
0