Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
33.33% |
2 / 6 |
CRAP | |
55.56% |
5 / 9 |
Comment | |
0.00% |
0 / 1 |
|
33.33% |
2 / 6 |
11.30 | |
55.56% |
5 / 9 |
__construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
|||
getNodeType | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
getNodeName | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
_subclass_cloneNodeShallow | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
|||
_subclass_isEqualNode | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
clone | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
<?php | |
declare( strict_types = 1 ); | |
// phpcs:disable Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps | |
namespace Wikimedia\Dodo; | |
/****************************************************************************** | |
* Comment.php | |
* ----------- | |
*/ | |
class Comment extends CharacterData implements \Wikimedia\IDLeDOM\Comment { | |
// Helper functions from IDLeDOM | |
use \Wikimedia\IDLeDOM\Helper\Comment; | |
/** | |
* Create a new Comment node. | |
* @param Document $doc | |
* @param string $data | |
*/ | |
public function __construct( Document $doc, $data ) { | |
parent::__construct(); | |
$this->_ownerDocument = $doc; | |
$this->_data = $data; | |
} | |
/** | |
* @inheritDoc | |
*/ | |
final public function getNodeType() : int { | |
return Node::COMMENT_NODE; | |
} | |
/** | |
* @inheritDoc | |
*/ | |
final public function getNodeName() : string { | |
return "#comment"; | |
} | |
/** @inheritDoc */ | |
public function _subclass_cloneNodeShallow(): ?Node { | |
return new Comment( $this->_ownerDocument, $this->_data ); | |
} | |
/** @inheritDoc */ | |
public function _subclass_isEqualNode( Node $node ): bool { | |
'@phan-var Comment $node'; /** @var Comment $node */ | |
return ( $this->_data === $node->_data ); | |
} | |
/** @inheritDoc */ | |
public function clone(): Comment { | |
/* | |
* TODO: Does this override directly? | |
* Or should we use _subclass_clone_shallow? | |
*/ | |
return new Comment( $this->_ownerDocument, $this->_data ); | |
} | |
} |