comparison vendor/psy/psysh/src/Context.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
31 private $commandScopeVariables = []; 31 private $commandScopeVariables = [];
32 private $returnValue; 32 private $returnValue;
33 private $lastException; 33 private $lastException;
34 private $lastStdout; 34 private $lastStdout;
35 private $boundObject; 35 private $boundObject;
36 private $boundClass;
36 37
37 /** 38 /**
38 * Get a context variable. 39 * Get a context variable.
39 * 40 *
40 * @throws InvalidArgumentException If the variable is not found in the current context 41 * @throws InvalidArgumentException If the variable is not found in the current context
219 } 220 }
220 221
221 /** 222 /**
222 * Set the bound object ($this variable) for the interactive shell. 223 * Set the bound object ($this variable) for the interactive shell.
223 * 224 *
225 * Note that this unsets the bound class, if any exists.
226 *
224 * @param object|null $boundObject 227 * @param object|null $boundObject
225 */ 228 */
226 public function setBoundObject($boundObject) 229 public function setBoundObject($boundObject)
227 { 230 {
228 $this->boundObject = is_object($boundObject) ? $boundObject : null; 231 $this->boundObject = is_object($boundObject) ? $boundObject : null;
232 $this->boundClass = null;
229 } 233 }
230 234
231 /** 235 /**
232 * Get the bound object ($this variable) for the interactive shell. 236 * Get the bound object ($this variable) for the interactive shell.
233 * 237 *
234 * @return object|null 238 * @return object|null
235 */ 239 */
236 public function getBoundObject() 240 public function getBoundObject()
237 { 241 {
238 return $this->boundObject; 242 return $this->boundObject;
243 }
244
245 /**
246 * Set the bound class (self) for the interactive shell.
247 *
248 * Note that this unsets the bound object, if any exists.
249 *
250 * @param string|null $boundClass
251 */
252 public function setBoundClass($boundClass)
253 {
254 $this->boundClass = (is_string($boundClass) && $boundClass !== '') ? $boundClass : null;
255 $this->boundObject = null;
256 }
257
258 /**
259 * Get the bound class (self) for the interactive shell.
260 *
261 * @return string|null
262 */
263 public function getBoundClass()
264 {
265 return $this->boundClass;
239 } 266 }
240 267
241 /** 268 /**
242 * Set command-scope magic variables: $__class, $__file, etc. 269 * Set command-scope magic variables: $__class, $__file, etc.
243 * 270 *