/** * @param \Closure $closure * * @return mixed */ protected function ioDebug(\Closure $closure) { if (!$this->style->isDebug()) { return null; } return $this->ioInvoke($closure); }
/** * @param string $what * @param mixed ...$parameters * * @return mixed */ public function execute($what, ...$parameters) { if ($this->style instanceof Style) { ob_start(); } $method = $this->inspect->getMethod($what); $return = $method->invoke($this->style, ...$parameters); if (count($parameters) === 0) { if ($this->style instanceof Style) { ob_end_clean(); } return $return; } if ($this->style instanceof StyleAwareFixture) { $this->display = $this->style->getOutput()->output; $this->style->getOutput()->clear(); } elseif ($this->style instanceof Style) { $this->display = ob_get_flush(); ob_end_clean(); } return $this->display; }
public function invokeBoundMethod(StyleInterface $style) { return $style->getOutput()->doWrite('testStyleIoBound'); }