Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 12 |
NonDocumentTypeChildNode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
72 | |
0.00% |
0 / 12 |
getNextElementSibling | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 6 |
|||
getPreviousElementSibling | |
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 6 |
<?php | |
declare( strict_types = 1 ); | |
// phpcs doesn't like @copyDoc, apparently: | |
// phpcs:disable MediaWiki.Commenting.FunctionAnnotations.UnrecognizedAnnotation | |
// phpcs:disable MediaWiki.Commenting.FunctionComment.MissingParamTag | |
// phpcs:disable MediaWiki.Commenting.FunctionComment.MissingReturn | |
namespace Wikimedia\Dodo; | |
/** | |
* NonDocumentTypeChildNode | |
* | |
* This is a mixin used by Element and CharacterData. | |
*/ | |
trait NonDocumentTypeChildNode /* implements \Wikimedia\IDLeDOM\NonDocumentTypeChildNode */ { | |
use \Wikimedia\IDLeDOM\Stub\NonDocumentTypeChildNode; | |
/** | |
* @copyDoc \Wikimedia\IDLeDOM\NonDocumentTypeChildNode::getNextElementSibling() | |
*/ | |
public function getNextElementSibling() { | |
'@phan-var Node $this'; // @var Node $this | |
if ( $this->_parentNode === null ) { | |
return null; | |
} | |
for ( $n = $this->getNextSibling(); $n !== null; $n = $n->getNextSibling() ) { | |
if ( $n->getNodeType() === Node::ELEMENT_NODE ) { | |
return $n; | |
} | |
} | |
return null; | |
} | |
/** | |
* @copyDoc \Wikimedia\IDLeDOM\NonDocumentTypeChildNode::getPreviousElementSibling() | |
*/ | |
public function getPreviousElementSibling() { | |
'@phan-var Node $this'; // @var Node $this | |
if ( $this->_parentNode === null ) { | |
return null; | |
} | |
for ( $n = $this->getPreviousSibling(); $n !== null; $n = $n->getPreviousSibling() ) { | |
if ( $n->getNodeType() === Node::ELEMENT_NODE ) { | |
return $n; | |
} | |
} | |
return null; | |
} | |
} |