Skip to content
Snippets Groups Projects
Commit 8300ed4a authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Implement fluent interface in ConsoleOutputTrait.

parent d3301f0c
No related merge requests found
......@@ -48,28 +48,30 @@ trait ConsoleOutputTrait
protected $outputInterface = null;
/**
* Set the output interface.
* Set the output interface. Implements a fluent interface.
*
* @param OutputInterface $output Output interface
*
* @return void
* @return mixed
*/
public function setOutputInterface(OutputInterface $output): void
public function setOutputInterface(OutputInterface $output)
{
$this->outputInterface = $output;
return $this;
}
/**
* Write a line to the output (if available).
* Write a line to the output (if available). Implements a fluent interface.
*
* @param string $output Line to output.
*
* @return void
* @return mixed
*/
public function writeln(string $output): void
public function writeln(string $output)
{
if ($this->outputInterface) {
$this->outputInterface->writeln($output);
}
return $this;
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment