Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 4
CRAP
0.00% covered (danger)
0.00%
0 / 1
WTUtils
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 4
20
0.00% covered (danger)
0.00%
0 / 1
 isSealedFragmentOfType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 hasVisibleCaption
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 textContentFromCaption
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 fromEncapsulatedContent
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\Ext;
5
6use Wikimedia\Parsoid\DOM\Element;
7use Wikimedia\Parsoid\DOM\Node;
8use Wikimedia\Parsoid\Utils\WTUtils as WTU;
9
10/**
11 * This class provides helpers needed by extensions.
12 * These helpers help with extracting wikitext information from the DOM.
13 */
14class WTUtils {
15
16    /**
17     * Is $node a sealed DOMFragment of a specific extension?
18     */
19    public static function isSealedFragmentOfType( Node $node, string $name ): bool {
20        return WTU::isSealedFragmentOfType( $node, $name );
21    }
22
23    public static function hasVisibleCaption( Element $node ): bool {
24        return WTU::hasVisibleCaption( $node );
25    }
26
27    public static function textContentFromCaption( Node $node ): string {
28        return WTU::textContentFromCaption( $node );
29    }
30
31    public static function fromEncapsulatedContent( Node $node ): bool {
32        return WTU::fromEncapsulatedContent( $node );
33    }
34}