update v 1.0.7.5
This commit is contained in:
19
vendor/psy/psysh/src/Psy/ExecutionLoop/Loop.php
vendored
19
vendor/psy/psysh/src/Psy/ExecutionLoop/Loop.php
vendored
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Psy Shell
|
||||
* This file is part of Psy Shell.
|
||||
*
|
||||
* (c) 2012-2014 Justin Hileman
|
||||
* (c) 2012-2015 Justin Hileman
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@@ -14,6 +14,7 @@ namespace Psy\ExecutionLoop;
|
||||
use Psy\Configuration;
|
||||
use Psy\Exception\BreakException;
|
||||
use Psy\Exception\ThrowUpException;
|
||||
use Psy\Exception\TypeErrorException;
|
||||
use Psy\Shell;
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,8 @@ use Psy\Shell;
|
||||
*/
|
||||
class Loop
|
||||
{
|
||||
const NOOP_INPUT = 'return null;';
|
||||
|
||||
/**
|
||||
* Loop constructor.
|
||||
*
|
||||
@@ -73,7 +76,7 @@ class Loop
|
||||
);
|
||||
|
||||
set_error_handler(array($__psysh__, 'handleError'));
|
||||
$_ = eval($__psysh__->flushCode());
|
||||
$_ = eval($__psysh__->flushCode() ?: Loop::NOOP_INPUT);
|
||||
restore_error_handler();
|
||||
|
||||
ob_end_flush();
|
||||
@@ -95,6 +98,12 @@ class Loop
|
||||
$__psysh__->writeException($_e);
|
||||
|
||||
throw $_e;
|
||||
} catch (\TypeError $_e) {
|
||||
restore_error_handler();
|
||||
if (ob_get_level() > 0) {
|
||||
ob_end_clean();
|
||||
}
|
||||
$__psysh__->writeException(TypeErrorException::fromTypeError($_e));
|
||||
} catch (\Exception $_e) {
|
||||
restore_error_handler();
|
||||
if (ob_get_level() > 0) {
|
||||
@@ -103,8 +112,6 @@ class Loop
|
||||
$__psysh__->writeException($_e);
|
||||
}
|
||||
|
||||
// a bit of housekeeping
|
||||
unset($__psysh_out__);
|
||||
$__psysh__->afterLoop();
|
||||
} while (true);
|
||||
};
|
||||
@@ -153,7 +160,7 @@ class Loop
|
||||
/**
|
||||
* Decide whether to bind the execution loop.
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
protected static function bindLoop()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user