1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-30 04:39:01 +01:00

Use null for new scope

This commit is contained in:
Aaron Piotrowski 2017-07-20 23:36:53 -05:00
parent 1a6896b047
commit affe305e93
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB
2 changed files with 2 additions and 2 deletions

View File

@ -205,7 +205,7 @@ class Fork implements Process, Strand {
private function execute(Channel $channel): \Generator {
try {
if ($this->function instanceof \Closure) {
$result = call($this->function->bindTo($channel, Channel::class), ...$this->args);
$result = call($this->function->bindTo($channel, null), ...$this->args);
} else {
$result = call($this->function, ...$this->args);
}

View File

@ -121,7 +121,7 @@ class Thread extends \Thread {
private function execute(Channel $channel): \Generator {
try {
if ($this->function instanceof \Closure) {
$result = call($this->function->bindTo($channel, Channel::class), ...$this->args);
$result = call($this->function->bindTo($channel, null), ...$this->args);
} else {
$result = call($this->function, ...$this->args);
}