Code Duplication    Length = 20-22 lines in 2 locations

includes/import/WikiImporter.php 1 location

@@ 510-529 (lines=20) @@
507
	 * @return string
508
	 * @access private
509
	 */
510
	public function nodeContents() {
511
		if ( $this->reader->isEmptyElement ) {
512
			return "";
513
		}
514
		$buffer = "";
515
		while ( $this->reader->read() ) {
516
			switch ( $this->reader->nodeType ) {
517
			case XMLReader::TEXT:
518
			case XMLReader::CDATA:
519
			case XMLReader::SIGNIFICANT_WHITESPACE:
520
				$buffer .= $this->reader->value;
521
				break;
522
			case XMLReader::END_ELEMENT:
523
				return $buffer;
524
			}
525
		}
526
527
		$this->reader->close();
528
		return '';
529
	}
530
531
	/**
532
	 * Primary entry point

maintenance/backupPrefetch.inc 1 location

@@ 185-206 (lines=22) @@
182
	 * @return string
183
	 * @access private
184
	 */
185
	function nodeContents() {
186
		if ( $this->atEnd ) {
187
			return null;
188
		}
189
		if ( $this->reader->isEmptyElement ) {
190
			return "";
191
		}
192
		$buffer = "";
193
		while ( $this->reader->read() ) {
194
			switch ( $this->reader->nodeType ) {
195
				case XMLReader::TEXT:
196
				// case XMLReader::WHITESPACE:
197
				case XMLReader::SIGNIFICANT_WHITESPACE:
198
					$buffer .= $this->reader->value;
199
					break;
200
				case XMLReader::END_ELEMENT:
201
					return $buffer;
202
			}
203
		}
204
205
		return $this->close();
206
	}
207
208
	/**
209
	 * @access private