diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index bd0fb18572..3364e6c2b7 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -21,6 +21,9 @@ namespace Symfony\Component\Process; */ class Process { + const ERR = 'err'; + const OUT = 'out'; + private $commandline; private $cwd; private $env; @@ -93,7 +96,7 @@ class Process $that = $this; $callback = function ($type, $data) use ($that, $callback) { - if ('out' == $type) { + if (self::OUT == $type) { $that->addOutput($data); } else { $that->addErrorOutput($data); @@ -156,7 +159,7 @@ class Process $type = array_search($pipe, $pipes); $data = fread($pipe, 8192); if (strlen($data) > 0) { - call_user_func($callback, $type == 1 ? 'out' : 'err', $data); + call_user_func($callback, $type == 1 ? self::OUT : self::ERR, $data); } if (false === $data || feof($pipe)) { fclose($pipe);