Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
PageConfigFrame | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | declare( strict_types = 1 ); |
3 | |
4 | namespace Wikimedia\Parsoid\Wt2Html; |
5 | |
6 | use Wikimedia\Parsoid\Config\Env; |
7 | use Wikimedia\Parsoid\Config\PageConfig; |
8 | use Wikimedia\Parsoid\Config\SiteConfig; |
9 | use Wikimedia\Parsoid\Utils\Title; |
10 | |
11 | /** |
12 | * A special subclass of frame used for the topmost frame in the environment; |
13 | * gets most of its actual data from a PageConfig object. |
14 | */ |
15 | class PageConfigFrame extends Frame { |
16 | |
17 | /** |
18 | * Create a top-level frame. |
19 | * @param Env $env |
20 | * @param PageConfig $pageConfig |
21 | * @param SiteConfig $siteConfig |
22 | */ |
23 | public function __construct( |
24 | Env $env, PageConfig $pageConfig, SiteConfig $siteConfig |
25 | ) { |
26 | $rev = $pageConfig->getRevisionContent(); |
27 | $content = $rev ? $rev->getContent( 'main' ) : ''; |
28 | parent::__construct( |
29 | Title::newFromLinkTarget( $pageConfig->getLinkTarget(), $siteConfig ), |
30 | $env, |
31 | [], |
32 | $content, |
33 | null |
34 | ); |
35 | } |
36 | |
37 | // XXX: override getSrcText() to mirror $pageConfig, if the $pageConfig |
38 | // is mutable? |
39 | } |