Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 1 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
||
| 1 | <?php |
| 2 | /** |
| 3 | * Source interface for XML import. |
| 4 | * |
| 5 | * Copyright © 2003,2005 Brooke Vibber <bvibber@wikimedia.org> |
| 6 | * https://www.mediawiki.org/ |
| 7 | * |
| 8 | * @license GPL-2.0-or-later |
| 9 | * @file |
| 10 | * @ingroup SpecialPage |
| 11 | */ |
| 12 | |
| 13 | namespace MediaWiki\Import; |
| 14 | |
| 15 | /** |
| 16 | * Source interface for XML import. |
| 17 | * |
| 18 | * @ingroup SpecialPage |
| 19 | */ |
| 20 | interface ImportSource { |
| 21 | |
| 22 | /** |
| 23 | * Indicates whether the end of the input has been reached. |
| 24 | * Will return true after a finite number of calls to readChunk. |
| 25 | * |
| 26 | * @return bool true if there is no more input, false otherwise. |
| 27 | */ |
| 28 | public function atEnd(); |
| 29 | |
| 30 | /** |
| 31 | * Return a chunk of the input, as a (possibly empty) string. |
| 32 | * When the end of input is reached, readChunk() returns false. |
| 33 | * If atEnd() returns false, readChunk() will return a string. |
| 34 | * If atEnd() returns true, readChunk() will return false. |
| 35 | * |
| 36 | * @return bool|string |
| 37 | */ |
| 38 | public function readChunk(); |
| 39 | |
| 40 | /** |
| 41 | * Check if the source is seekable and a call to self::seek is valid |
| 42 | * |
| 43 | * @return bool |
| 44 | */ |
| 45 | public function isSeekable(); |
| 46 | |
| 47 | /** |
| 48 | * Seek the input to the given offset. |
| 49 | * |
| 50 | * @param int $offset |
| 51 | * @return int |
| 52 | */ |
| 53 | public function seek( int $offset ); |
| 54 | } |
| 55 | |
| 56 | /** @deprecated class alias since 1.46 */ |
| 57 | class_alias( ImportSource::class, 'ImportSource' ); |