Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
BodyHandler
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 handle
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 firstChild
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 lastChild
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Html2Wt\DOMHandlers;
5
6use Wikimedia\Parsoid\DOM\Element;
7use Wikimedia\Parsoid\DOM\Node;
8use Wikimedia\Parsoid\Html2Wt\SerializerState;
9
10class BodyHandler extends DOMHandler {
11
12    public function __construct() {
13        parent::__construct( false );
14    }
15
16    /** @inheritDoc */
17    public function handle(
18        Element $node, SerializerState $state, bool $wrapperUnmodified = false
19    ): ?Node {
20        $state->serializeChildren( $node );
21        return $node->nextSibling;
22    }
23
24    /** @inheritDoc */
25    public function firstChild( Node $node, Node $otherNode, SerializerState $state ): array {
26        return [ 'min' => 0, 'max' => 1 ];
27    }
28
29    /** @inheritDoc */
30    public function lastChild( Node $node, Node $otherNode, SerializerState $state ): array {
31        return [ 'min' => 0, 'max' => 1 ];
32    }
33
34}