X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FExecutionLoop.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FExecutionLoop.php;h=eacd1d3c4fba2735d76bbf96e3b1258c374cd417;hp=59f043723c9457bb87e5b80e004153f556ae3f37;hb=419f97be044f1aebd0713921ee604841127e9e84;hpb=052617e40b525f8b817d84c29b1c04951f427069 diff --git a/vendor/psy/psysh/src/ExecutionLoop.php b/vendor/psy/psysh/src/ExecutionLoop.php index 59f043723..eacd1d3c4 100644 --- a/vendor/psy/psysh/src/ExecutionLoop.php +++ b/vendor/psy/psysh/src/ExecutionLoop.php @@ -11,10 +11,7 @@ namespace Psy; -use Psy\Exception\BreakException; use Psy\Exception\ErrorException; -use Psy\Exception\ThrowUpException; -use Psy\Exception\TypeErrorException; /** * The Psy Shell execution loop. @@ -32,33 +29,8 @@ class ExecutionLoop { $this->loadIncludes($shell); - $closure = new ExecutionClosure($shell); - - do { - $shell->beforeLoop(); - - try { - $shell->getInput(); - $_ = $closure->execute(); - $shell->writeReturnValue($_); - } catch (BreakException $_e) { - $shell->writeException($_e); - - return; - } catch (ThrowUpException $_e) { - $shell->writeException($_e); - - throw $_e; - } catch (\TypeError $_e) { - $shell->writeException(TypeErrorException::fromTypeError($_e)); - } catch (\Error $_e) { - $shell->writeException(ErrorException::fromError($_e)); - } catch (\Exception $_e) { - $shell->writeException($_e); - } - - $shell->afterLoop(); - } while (true); + $closure = new ExecutionLoopClosure($shell); + $closure->execute(); } /**