} elseif ( is_array( $contextNode ) ) {
// Node descriptor array
if ( count( $contextNode ) !== 2 ) {
- throw new MWException( __METHOD__.
+ throw new MWException( __METHOD__ .
': found an array where a node descriptor should be' );
}
list( $contextName, $contextChildren ) = $contextNode;
* @return string|bool
*/
public function getArgument( $index ) {
- if ( !isset( $this->args[$index] ) ) {
- return false;
- }
- return $this->args[$index];
+ return $this->args[$index] ?? false;
}
public function getArguments() {
$class = self::class;
}
} else {
- throw new MWException( __METHOD__.': invalid node descriptor' );
+ throw new MWException( __METHOD__ . ': invalid node descriptor' );
}
return new $class( $store, $index );
}
public function __construct( array $store, $index ) {
$descriptor = $store[$index];
if ( $descriptor[PPNode_Hash_Tree::NAME][0] !== '@' ) {
- throw new MWException( __METHOD__.': invalid name in attribute descriptor' );
+ throw new MWException( __METHOD__ . ': invalid name in attribute descriptor' );
}
$this->name = substr( $descriptor[PPNode_Hash_Tree::NAME], 1 );
$this->value = $descriptor[PPNode_Hash_Tree::CHILDREN][0];