Skip to content

Commit e34ab39

Browse files
committed
run pipes immediately
1 parent a1b2196 commit e34ab39

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Illuminate/Process/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ public function pool(callable $callback)
277277
* @param callable $callback
278278
* @return \Illuminate\Process\Pipe
279279
*/
280-
public function pipe(callable $callback)
280+
public function pipe(callable $callback, ?callable $output = null)
281281
{
282-
return new Pipe($this, $callback);
282+
return (new Pipe($this, $callback))->run(output: $output);
283283
}
284284

285285
/**

tests/Process/ProcessTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public function testProcessPipe()
512512
$pipe->command('grep -i "foo"');
513513
});
514514

515-
$this->assertSame("foo\n", $pipe->run()->output());
515+
$this->assertSame("foo\n", $pipe->output());
516516
}
517517

518518
public function testProcessPipeFailed()
@@ -531,7 +531,7 @@ public function testProcessPipeFailed()
531531
$pipe->command('grep -i "foo"');
532532
});
533533

534-
$this->assertTrue($pipe->run()->failed());
534+
$this->assertTrue($pipe->failed());
535535
}
536536

537537
public function testFakeInvokedProcessOutputWithLatestOutput()

0 commit comments

Comments
 (0)