Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
ErrorCardWidget | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace GrowthExperiments\HomepageModules\SuggestedEditsComponents; |
4 | |
5 | use OOUI\Tag; |
6 | use OOUI\Widget; |
7 | |
8 | class ErrorCardWidget extends Widget { |
9 | |
10 | /** |
11 | * @param array $config Configuration options |
12 | * - MessageLocalizer $config['localizer'] |
13 | * - any option understood by Widget |
14 | */ |
15 | public function __construct( array $config = [] ) { |
16 | parent::__construct( $config ); |
17 | /** @var \MessageLocalizer $localizer */ |
18 | $localizer = $config['localizer']; |
19 | $this->appendContent( |
20 | ( new Tag( 'div' ) )->addClasses( [ 'se-card-error' ] ) |
21 | ->appendContent( |
22 | ( new Tag( 'h3' ) )->addClasses( [ 'se-card-title' ] ) |
23 | ->appendContent( |
24 | $localizer->msg( 'growthexperiments-homepage-suggestededits-error-title' )->text() |
25 | ), |
26 | ( new Tag( 'div' ) )->addClasses( [ 'se-card-image' ] ), |
27 | ( new Tag( 'p' ) )->addClasses( [ 'se-card-text' ] ) |
28 | ->appendContent( |
29 | $localizer->msg( 'growthexperiments-homepage-suggestededits-error-description' )->text() |
30 | ) |
31 | ) |
32 | ); |
33 | } |
34 | } |