composer update
This commit is contained in:
14
vendor/psy/psysh/src/CodeCleaner/ListPass.php
vendored
14
vendor/psy/psysh/src/CodeCleaner/ListPass.php
vendored
@@ -17,7 +17,9 @@ use PhpParser\Node\Expr\Array_;
|
||||
use PhpParser\Node\Expr\ArrayDimFetch;
|
||||
use PhpParser\Node\Expr\ArrayItem;
|
||||
use PhpParser\Node\Expr\Assign;
|
||||
use PhpParser\Node\Expr\FuncCall;
|
||||
use PhpParser\Node\Expr\List_;
|
||||
use PhpParser\Node\Expr\MethodCall;
|
||||
use PhpParser\Node\Expr\PropertyFetch;
|
||||
use PhpParser\Node\Expr\Variable;
|
||||
use Psy\Exception\ParseErrorException;
|
||||
@@ -99,14 +101,12 @@ class ListPass extends CodeCleanerPass
|
||||
{
|
||||
$value = ($item instanceof ArrayItem) ? $item->value : $item;
|
||||
|
||||
if ($value instanceof Variable) {
|
||||
return true;
|
||||
while ($value instanceof ArrayDimFetch || $value instanceof PropertyFetch) {
|
||||
$value = $value->var;
|
||||
}
|
||||
|
||||
if ($value instanceof ArrayDimFetch || $value instanceof PropertyFetch) {
|
||||
return isset($value->var) && $value->var instanceof Variable;
|
||||
}
|
||||
|
||||
return false;
|
||||
// We just kind of give up if it's a method call. We can't tell if it's
|
||||
// valid via static analysis.
|
||||
return $value instanceof Variable || $value instanceof MethodCall || $value instanceof FuncCall;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ class ExecutionLoopClosure extends ExecutionClosure
|
||||
|
||||
try {
|
||||
// Pull in any new execution scope variables
|
||||
\extract($__psysh__->getScopeVariablesDiff(\get_defined_vars()));
|
||||
if ($__psysh__->getLastExecSuccess()) {
|
||||
\extract($__psysh__->getScopeVariablesDiff(\get_defined_vars()));
|
||||
}
|
||||
|
||||
// Buffer stdout; we'll need it later
|
||||
\ob_start([$__psysh__, 'writeStdout'], 1);
|
||||
|
||||
2
vendor/psy/psysh/src/Readline/Transient.php
vendored
2
vendor/psy/psysh/src/Readline/Transient.php
vendored
@@ -106,7 +106,7 @@ class Transient implements Readline
|
||||
{
|
||||
echo $prompt;
|
||||
|
||||
return \rtrim(\fgets($this->getStdin(), 1024));
|
||||
return \rtrim(\fgets($this->getStdin()), "\n\r");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
18
vendor/psy/psysh/src/Shell.php
vendored
18
vendor/psy/psysh/src/Shell.php
vendored
@@ -47,7 +47,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
*/
|
||||
class Shell extends Application
|
||||
{
|
||||
const VERSION = 'v0.9.8';
|
||||
const VERSION = 'v0.9.9';
|
||||
|
||||
const PROMPT = '>>> ';
|
||||
const BUFF_PROMPT = '... ';
|
||||
@@ -73,6 +73,7 @@ class Shell extends Application
|
||||
private $autoCompleter;
|
||||
private $matchers = [];
|
||||
private $commandsMatcher;
|
||||
private $lastExecSuccess = true;
|
||||
|
||||
/**
|
||||
* Create a new Psy Shell.
|
||||
@@ -963,6 +964,8 @@ class Shell extends Application
|
||||
*/
|
||||
public function writeReturnValue($ret)
|
||||
{
|
||||
$this->lastExecSuccess = true;
|
||||
|
||||
if ($ret instanceof NoReturnValue) {
|
||||
return;
|
||||
}
|
||||
@@ -986,11 +989,24 @@ class Shell extends Application
|
||||
*/
|
||||
public function writeException(\Exception $e)
|
||||
{
|
||||
$this->lastExecSuccess = false;
|
||||
$this->context->setLastException($e);
|
||||
$this->output->writeln($this->formatException($e));
|
||||
$this->resetCodeBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether the last exec was successful.
|
||||
*
|
||||
* Returns true if a return value was logged rather than an exception.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getLastExecSuccess()
|
||||
{
|
||||
return $this->lastExecSuccess;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper for formatting an exception for writeException().
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user