Updated from some -dev modules to alpha, beta or full releases
[yaffs-website] / vendor / psy / psysh / src / ExecutionLoop.php
index 59f043723c9457bb87e5b80e004153f556ae3f37..eacd1d3c4fba2735d76bbf96e3b1258c374cd417 100644 (file)
 
 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();
     }
 
     /**