From 8300ed4aa41bcefd88718ae2ea6a38e83063fa95 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 11 May 2020 13:32:55 -0400 Subject: [PATCH] Implement fluent interface in ConsoleOutputTrait. --- .../src/VuFindConsole/ConsoleOutputTrait.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/module/VuFindConsole/src/VuFindConsole/ConsoleOutputTrait.php b/module/VuFindConsole/src/VuFindConsole/ConsoleOutputTrait.php index 880458c305a..761e4906bb2 100644 --- a/module/VuFindConsole/src/VuFindConsole/ConsoleOutputTrait.php +++ b/module/VuFindConsole/src/VuFindConsole/ConsoleOutputTrait.php @@ -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; } } -- GitLab