From dbfe748d274f6843fc91a3071df7be45c4ab5b00 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 May 2020 15:22:25 +0000 Subject: composer updates --- vendor/sabre/event/lib/coroutine.php | 52 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'vendor/sabre/event/lib/coroutine.php') diff --git a/vendor/sabre/event/lib/coroutine.php b/vendor/sabre/event/lib/coroutine.php index 750e8ab52..a6a2baf41 100644 --- a/vendor/sabre/event/lib/coroutine.php +++ b/vendor/sabre/event/lib/coroutine.php @@ -1,4 +1,6 @@ -valid()) { - $yieldedValue = $generator->current(); if ($yieldedValue instanceof Promise) { $yieldedValue->then( - function($value) use ($generator, &$advanceGenerator, &$lastYieldResult) { + function ($value) use ($generator, &$advanceGenerator) { $generator->send($value); $advanceGenerator(); }, - function(Throwable $reason) use ($generator, $advanceGenerator) { + function (Throwable $reason) use ($generator, $advanceGenerator) { $generator->throw($reason); $advanceGenerator(); } - )->otherwise(function(Throwable $reason) use ($promise) { + )->otherwise(function (Throwable $reason) use ($promise) { // This error handler would be called, if something in the // generator throws an exception, and it's not caught // locally. @@ -87,31 +88,25 @@ function coroutine(callable $gen) : Promise { // If the value was not a promise, we'll just let it pass through. $generator->send($yieldedValue); } - } // If the generator is at the end, and we didn't run into an exception, // We're grabbing the "return" value and fulfilling our top-level // promise with its value. - if (!$generator->valid() && $promise->state === Promise::PENDING) { - $returnValue = $generator->getReturn(); - - // The return value is a promise. - if ($returnValue instanceof Promise) { - $returnValue->then(function($value) use ($promise) { - $promise->fulfill($value); - }, function(Throwable $reason) { - $promise->reject($reason); - }); - } else { - - $promise->fulfill($returnValue); - - } - - + if (!$generator->valid() && Promise::PENDING === $promise->state) { + $returnValue = $generator->getReturn(); + + // The return value is a promise. + if ($returnValue instanceof Promise) { + $returnValue->then(function ($value) use ($promise) { + $promise->fulfill($value); + }, function (Throwable $reason) use ($promise) { + $promise->reject($reason); + }); + } else { + $promise->fulfill($returnValue); + } } - }; try { @@ -121,5 +116,4 @@ function coroutine(callable $gen) : Promise { } return $promise; - } -- cgit v1.2.3 From fae70bf0a7f1b566d25e30064f60d58ab150951a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 May 2020 23:35:02 +0200 Subject: Revert "composer updates" This reverts commit dbfe748d274f6843fc91a3071df7be45c4ab5b00 --- vendor/sabre/event/lib/coroutine.php | 52 ++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'vendor/sabre/event/lib/coroutine.php') diff --git a/vendor/sabre/event/lib/coroutine.php b/vendor/sabre/event/lib/coroutine.php index a6a2baf41..750e8ab52 100644 --- a/vendor/sabre/event/lib/coroutine.php +++ b/vendor/sabre/event/lib/coroutine.php @@ -1,6 +1,4 @@ -valid()) { + $yieldedValue = $generator->current(); if ($yieldedValue instanceof Promise) { $yieldedValue->then( - function ($value) use ($generator, &$advanceGenerator) { + function($value) use ($generator, &$advanceGenerator, &$lastYieldResult) { $generator->send($value); $advanceGenerator(); }, - function (Throwable $reason) use ($generator, $advanceGenerator) { + function(Throwable $reason) use ($generator, $advanceGenerator) { $generator->throw($reason); $advanceGenerator(); } - )->otherwise(function (Throwable $reason) use ($promise) { + )->otherwise(function(Throwable $reason) use ($promise) { // This error handler would be called, if something in the // generator throws an exception, and it's not caught // locally. @@ -88,25 +87,31 @@ function coroutine(callable $gen): Promise // If the value was not a promise, we'll just let it pass through. $generator->send($yieldedValue); } + } // If the generator is at the end, and we didn't run into an exception, // We're grabbing the "return" value and fulfilling our top-level // promise with its value. - if (!$generator->valid() && Promise::PENDING === $promise->state) { - $returnValue = $generator->getReturn(); - - // The return value is a promise. - if ($returnValue instanceof Promise) { - $returnValue->then(function ($value) use ($promise) { - $promise->fulfill($value); - }, function (Throwable $reason) use ($promise) { - $promise->reject($reason); - }); - } else { - $promise->fulfill($returnValue); - } + if (!$generator->valid() && $promise->state === Promise::PENDING) { + $returnValue = $generator->getReturn(); + + // The return value is a promise. + if ($returnValue instanceof Promise) { + $returnValue->then(function($value) use ($promise) { + $promise->fulfill($value); + }, function(Throwable $reason) { + $promise->reject($reason); + }); + } else { + + $promise->fulfill($returnValue); + + } + + } + }; try { @@ -116,4 +121,5 @@ function coroutine(callable $gen): Promise } return $promise; + } -- cgit v1.2.3 From f132436af3c90cff8dcef852bd836546311036f3 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 May 2020 21:48:26 +0000 Subject: composer updates 2 --- vendor/sabre/event/lib/coroutine.php | 52 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'vendor/sabre/event/lib/coroutine.php') diff --git a/vendor/sabre/event/lib/coroutine.php b/vendor/sabre/event/lib/coroutine.php index 750e8ab52..a6a2baf41 100644 --- a/vendor/sabre/event/lib/coroutine.php +++ b/vendor/sabre/event/lib/coroutine.php @@ -1,4 +1,6 @@ -valid()) { - $yieldedValue = $generator->current(); if ($yieldedValue instanceof Promise) { $yieldedValue->then( - function($value) use ($generator, &$advanceGenerator, &$lastYieldResult) { + function ($value) use ($generator, &$advanceGenerator) { $generator->send($value); $advanceGenerator(); }, - function(Throwable $reason) use ($generator, $advanceGenerator) { + function (Throwable $reason) use ($generator, $advanceGenerator) { $generator->throw($reason); $advanceGenerator(); } - )->otherwise(function(Throwable $reason) use ($promise) { + )->otherwise(function (Throwable $reason) use ($promise) { // This error handler would be called, if something in the // generator throws an exception, and it's not caught // locally. @@ -87,31 +88,25 @@ function coroutine(callable $gen) : Promise { // If the value was not a promise, we'll just let it pass through. $generator->send($yieldedValue); } - } // If the generator is at the end, and we didn't run into an exception, // We're grabbing the "return" value and fulfilling our top-level // promise with its value. - if (!$generator->valid() && $promise->state === Promise::PENDING) { - $returnValue = $generator->getReturn(); - - // The return value is a promise. - if ($returnValue instanceof Promise) { - $returnValue->then(function($value) use ($promise) { - $promise->fulfill($value); - }, function(Throwable $reason) { - $promise->reject($reason); - }); - } else { - - $promise->fulfill($returnValue); - - } - - + if (!$generator->valid() && Promise::PENDING === $promise->state) { + $returnValue = $generator->getReturn(); + + // The return value is a promise. + if ($returnValue instanceof Promise) { + $returnValue->then(function ($value) use ($promise) { + $promise->fulfill($value); + }, function (Throwable $reason) use ($promise) { + $promise->reject($reason); + }); + } else { + $promise->fulfill($returnValue); + } } - }; try { @@ -121,5 +116,4 @@ function coroutine(callable $gen) : Promise { } return $promise; - } -- cgit v1.2.3