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:
parent
1a6896b047
commit
affe305e93
@ -205,7 +205,7 @@ class Fork implements Process, Strand {
|
|||||||
private function execute(Channel $channel): \Generator {
|
private function execute(Channel $channel): \Generator {
|
||||||
try {
|
try {
|
||||||
if ($this->function instanceof \Closure) {
|
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 {
|
} else {
|
||||||
$result = call($this->function, ...$this->args);
|
$result = call($this->function, ...$this->args);
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ class Thread extends \Thread {
|
|||||||
private function execute(Channel $channel): \Generator {
|
private function execute(Channel $channel): \Generator {
|
||||||
try {
|
try {
|
||||||
if ($this->function instanceof \Closure) {
|
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 {
|
} else {
|
||||||
$result = call($this->function, ...$this->args);
|
$result = call($this->function, ...$this->args);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user