From b52f334b3239edbb161f251bc8e7c5c338dda184 Mon Sep 17 00:00:00 2001 From: Bobby Allen Date: Thu, 14 Jan 2016 08:57:52 +0000 Subject: [PATCH] Enables method chaining on a few methods that would benefit from such a feature. Bumping Composer version to 1.1.0. --- composer.json | 2 +- src/ConsoleApplication.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index fb66877..56dabe0 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "ballen/clip", - "version": "1.0.0", + "version": "1.1.0", "description": "A package for speeding up development of PHP console (CLI) applications.", "type": "library", "keywords": ["cli", "commands", "command", "console"], diff --git a/src/ConsoleApplication.php b/src/ConsoleApplication.php index 660f476..79c4719 100644 --- a/src/ConsoleApplication.php +++ b/src/ConsoleApplication.php @@ -100,21 +100,25 @@ public function call($command) } /** - * Write to the CLI. + * Write to the console. * @param string $text The text to output. + * @return \Ballen\Clip\ConsoleApplication */ public function write($text = '') { fwrite(STDOUT, $text); + return $this; } /** * Write a line of characters (or an empty line) to the CLI. * @param string $text The text to output. + * @return \Ballen\Clip\ConsoleApplication */ public function writeln($text = '') { $this->write($text . PHP_EOL); + return $this; } /** @@ -156,11 +160,12 @@ public function input($question, $default = '', $options = []) /** * Writes an array to the CLI output * @param array $array The array of data to write to the console. - * @return void + * @return \Ballen\Clip\ConsoleApplication */ public function writearr($array = []) { print_r($array); + return $this; } /**