Mercurial > hg > isophonics-drupal-site
diff vendor/psy/psysh/src/ExecutionClosure.php @ 16:c2387f117808
Routine composer update
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 15:07:59 +0100 |
parents | 5fb285c0d0e3 |
children | 129ea1e6d783 |
line wrap: on
line diff
--- a/vendor/psy/psysh/src/ExecutionClosure.php Thu Apr 26 11:26:54 2018 +0100 +++ b/vendor/psy/psysh/src/ExecutionClosure.php Tue Jul 10 15:07:59 2018 +0100 @@ -25,7 +25,7 @@ */ public function __construct(Shell $__psysh__) { - $exec = function () use ($__psysh__) { + $this->setClosure($__psysh__, function () use ($__psysh__) { try { // Restore execution scope variables extract($__psysh__->getScopeVariables(false)); @@ -66,20 +66,27 @@ $__psysh__->setScopeVariables(get_defined_vars()); return $_; - }; + }); + } + /** + * Set the closure instance. + * + * @param Shell $psysh + * @param \Closure $closure + */ + protected function setClosure(Shell $shell, \Closure $closure) + { if (self::shouldBindClosure()) { - $that = $__psysh__->getBoundObject(); + $that = $shell->getBoundObject(); if (is_object($that)) { - $this->closure = $exec->bindTo($that, get_class($that)); + $closure = $closure->bindTo($that, get_class($that)); } else { - $this->closure = $exec->bindTo(null, null); + $closure = $closure->bindTo(null, $shell->getBoundClass()); } - - return; } - $this->closure = $exec; + $this->closure = $closure; } /**