1 <?php
2 /**
3 * Part of the Joomla Framework Application Package
4 *
5 * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
6 * @license GNU General Public License version 2 or later; see LICENSE
7 */
8
9 namespace Joomla\Application\Cli\Output;
10
11 use Joomla\Application\Cli\CliOutput;
12
13 /**
14 * Class Stdout.
15 *
16 * @since 1.0
17 */
18 class Stdout extends CliOutput
19 {
20 /**
21 * Write a string to standard output
22 *
23 * @param string $text The text to display.
24 * @param boolean $nl True (default) to append a new line at the end of the output string.
25 *
26 * @return Stdout Instance of $this to allow chaining.
27 *
28 * @codeCoverageIgnore
29 * @since 1.0
30 */
31 public function out($text = '', $nl = true)
32 {
33 fwrite(STDOUT, $this->getProcessor()->process($text) . ($nl ? "\n" : null));
34
35 return $this;
36 }
37 }
38