Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 5 |
IDLReflectedAttributeBoolean | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 5 |
get | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
set | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 4 |
<?php | |
declare( strict_types = 1 ); | |
namespace Wikimedia\Dodo; | |
/** | |
* Parent constructor in ReflectedAttribute is fine, no need to override | |
* ReflectedAttribute exposes two protected values, $element and $attributeName | |
*/ | |
class IDLReflectedAttributeBoolean extends ReflectedAttribute { | |
/** | |
* @return bool | |
*/ | |
public function get() { | |
return $this->element->hasAttribute( $this->attributeName ); | |
} | |
/** | |
* @param mixed $value | |
*/ | |
public function set( $value ) { | |
if ( $value ) { | |
$this->element->setAttribute( $this->attributeName, '' ); | |
} else { | |
$this->element->removeAttribute( $this->attributeName ); | |
} | |
} | |
} |