Permalink
Browse files

Fluent interface

  • Loading branch information...
1 parent 0bfa86c commit 46d358f34804cf93fb7370b29db4b9c0ff581d25 @Bilge Bilge committed with fabpot Sep 16, 2012
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/Symfony/Component/Process/Process.php
@@ -614,11 +614,15 @@ public function stop($timeout=10)
public function addOutput($line)
{
$this->stdout .= $line;
+
+ return $this;
}
public function addErrorOutput($line)
{
$this->stderr .= $line;
+
+ return $this;
}
public function getCommandLine()
@@ -629,6 +633,8 @@ public function getCommandLine()
public function setCommandLine($commandline)
{
$this->commandline = $commandline;
+
+ return $this;
}
public function getTimeout()
@@ -648,7 +654,7 @@ public function setTimeout($timeout)
if (null === $timeout) {
$this->timeout = null;
- return;
+ return $this;
}
$timeout = (integer) $timeout;
@@ -658,6 +664,8 @@ public function setTimeout($timeout)
}
$this->timeout = $timeout;
+
+ return $this;
}
public function getWorkingDirectory()
@@ -668,6 +676,8 @@ public function getWorkingDirectory()
public function setWorkingDirectory($cwd)
{
$this->cwd = $cwd;
+
+ return $this;
}
public function getEnv()
@@ -678,6 +688,8 @@ public function getEnv()
public function setEnv(array $env)
{
$this->env = $env;
+
+ return $this;
}
public function getStdin()
@@ -688,6 +700,8 @@ public function getStdin()
public function setStdin($stdin)
{
$this->stdin = $stdin;
+
+ return $this;
}
public function getOptions()
@@ -698,6 +712,8 @@ public function getOptions()
public function setOptions(array $options)
{
$this->options = $options;
+
+ return $this;
}
public function getEnhanceWindowsCompatibility()
@@ -708,6 +724,8 @@ public function getEnhanceWindowsCompatibility()
public function setEnhanceWindowsCompatibility($enhance)
{
$this->enhanceWindowsCompatibility = (Boolean) $enhance;
+
+ return $this;'
}
/**

0 comments on commit 46d358f

Please sign in to comment.