Passed
Push — master ( cc20de...06f7cb )
by Fabio
06:28
created

TOutputWriter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 5
c 1
b 1
f 0
dl 0
loc 13
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A flush() 0 6 1
1
<?php
2
/**
3
 * TOutputWriter class file
4
 *
5
 * @author Brad Anderson <[email protected]>
6
 * @link https://github.com/pradosoft/prado
7
 * @license https://github.com/pradosoft/prado/blob/master/LICENSE
8
 * @package Prado\IO
9
 */
10
11
namespace Prado\IO;
12
13
/**
14
 * TOutputWriter class.
15
 *
16
 * TOutputWriter extends TTextWriter to fwrite the buffer to STDOUT
17
 * when {@link flush}ed.  This allows for testing of the Shell output.
18
 *
19
 * @author Brad Anderson <[email protected]>
20
 * @package Prado\IO
21
 * @since 4.2.0
22
 */
23
class TOutputWriter extends TTextWriter
24
{
25
26
	/**
27
	 * Flushes the content that has been written.
28
	 * @return string the content being flushed
29
	 */
30
	public function flush()
31
	{
32
		$str = parent::flush();
33
		fwrite(STDOUT, $str);
34
		flush();
35
		return $str;
36
	}
37
}
38