Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| DumpStringOutput | |
0.00% |
0 / 2 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| write | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __toString | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Stream outputter that buffers and returns data as a string. |
| 4 | * |
| 5 | * @license GPL-2.0-or-later |
| 6 | * @file |
| 7 | */ |
| 8 | |
| 9 | namespace MediaWiki\Export; |
| 10 | |
| 11 | use Stringable; |
| 12 | |
| 13 | /** |
| 14 | * @ingroup Dump |
| 15 | * @since 1.28 |
| 16 | */ |
| 17 | class DumpStringOutput extends DumpOutput implements Stringable { |
| 18 | /** @var string */ |
| 19 | private $output = ''; |
| 20 | |
| 21 | /** |
| 22 | * @param string $string |
| 23 | */ |
| 24 | public function write( $string ) { |
| 25 | $this->output .= $string; |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Get the string containing the output. |
| 30 | * |
| 31 | * @return string |
| 32 | */ |
| 33 | public function __toString() { |
| 34 | return $this->output; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | /** @deprecated class alias since 1.46 */ |
| 39 | class_alias( DumpStringOutput::class, 'DumpStringOutput' ); |