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 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ParsedLine
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\Parsoid\Ext\Gallery;
5
6use Wikimedia\Parsoid\Core\DomSourceRange;
7use Wikimedia\Parsoid\DOM\Element;
8use Wikimedia\Parsoid\Ext\DOMUtils;
9
10class ParsedLine {
11
12    /**
13     * DOM node representing the thumbnail image.
14     * @var Element
15     */
16    public $thumb;
17
18    /**
19     * DOM node representing the caption (if any).
20     * @var ?Element
21     */
22    public $gallerytext;
23
24    /**
25     * The `typeof` the thumbnail image.
26     * @var string
27     */
28    public $rdfaType;
29
30    /**
31     * @var DomSourceRange
32     */
33    public $dsr;
34
35    public bool $hasError;
36
37    /**
38     * Construct a new ParsedLine object.
39     * @param Element $thumb
40     * @param ?Element $gallerytext
41     * @param string $rdfaType
42     * @param DomSourceRange $dsr
43     */
44    public function __construct(
45        Element $thumb, ?Element $gallerytext, string $rdfaType, DomSourceRange $dsr
46    ) {
47        $this->thumb = $thumb;
48        $this->gallerytext = $gallerytext;
49        $this->rdfaType = $rdfaType;
50        $this->dsr = $dsr;
51        $this->hasError = DOMUtils::hasTypeOf( $thumb, 'mw:Error' );
52    }
53}