Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8ec2bf

Browse files
committed
minor #9407 [Process] Renamed flushOutput() and flushErrorOutput() to clearOutput() and clearErrorOutput() (bschussek)
This PR was merged into the master branch. Discussion ---------- [Process] Renamed flushOutput() and flushErrorOutput() to clearOutput() and clearErrorOutput() | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - I renamed `flushOutput()` and `flushErrorOutput()` to `clearOutput()` and `clearErrorOutput()` since I find the current naming unintuitive. When reading [the blog post about this feature](http://symfony.com/blog/new-in-symfony-2-4-flushing-stdout-and-stderr-on-a-process) I initially thought that the output would be flushed to the console (as in `ob_flush()`). Using "clear" on the other hand conforms well with [our conventions](http://symfony.com/doc/current/contributing/code/conventions.html). Commits ------- 1811367 [Process] Renamed flushOutput() and flushErrorOutput() to clearOutput() and clearErrorOutput()
2 parents 705384b + 1811367 commit b8ec2bf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Symfony/Component/Process/Process.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public function getIncrementalOutput()
408408
*
409409
* @return Process
410410
*/
411-
public function flushOutput()
411+
public function clearOutput()
412412
{
413413
$this->stdout = '';
414414
$this->incrementalOutputOffset = 0;
@@ -454,7 +454,7 @@ public function getIncrementalErrorOutput()
454454
*
455455
* @return Process
456456
*/
457-
public function flushErrorOutput()
457+
public function clearErrorOutput()
458458
{
459459
$this->stderr = '';
460460
$this->incrementalErrorOutputOffset = 0;

src/Symfony/Component/Process/Tests/AbstractProcessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public function testFlushErrorOutput()
174174
$p = new Process(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
175175

176176
$p->run();
177-
$p->flushErrorOutput();
177+
$p->clearErrorOutput();
178178
$this->assertEmpty($p->getErrorOutput());
179179
}
180180

@@ -202,7 +202,7 @@ public function testFlushOutput()
202202
$p = new Process(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++;}')));
203203

204204
$p->run();
205-
$p->flushOutput();
205+
$p->clearOutput();
206206
$this->assertEmpty($p->getOutput());
207207
}
208208

0 commit comments

Comments
 (0)