+ /**
+ * Set the most recent output from evaluated code.
+ *
+ * @param string $lastStdout
+ */
+ public function setLastStdout($lastStdout)
+ {
+ $this->lastStdout = $lastStdout;
+ }
+
+ /**
+ * Get the most recent output from evaluated code.
+ *
+ * @throws InvalidArgumentException If no output has happened yet
+ *
+ * @return null|string
+ */
+ public function getLastStdout()
+ {
+ if (!isset($this->lastStdout)) {
+ throw new \InvalidArgumentException('No most-recent output');
+ }
+
+ return $this->lastStdout;
+ }
+