Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 18
0.00% covered (danger)
0.00%
0 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
ContributeCard
0.00% covered (danger)
0.00%
0 / 18
0.00% covered (danger)
0.00%
0 / 10
110
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getIcon
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setIcon
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDescription
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setDescription
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAction
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 setAction
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 toArray
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2namespace MediaWiki\Specials\Contribute\Card;
3
4class ContributeCard {
5
6    /** @var string */
7    private $title;
8
9    /** @var string */
10    private $icon;
11
12    /** @var string */
13    private $description;
14
15    /** @var ContributeCardAction */
16    private $action;
17
18    public function __construct( string $title, string $description, string $icon, ContributeCardAction $action ) {
19        $this->title = $title;
20        $this->icon = $icon;
21        $this->description = $description;
22        $this->action = $action;
23    }
24
25    /**
26     * @return string
27     */
28    public function getTitle(): string {
29        return $this->title;
30    }
31
32    /**
33     * @param string $title
34     */
35    public function setTitle( string $title ): void {
36        $this->title = $title;
37    }
38
39    /**
40     * @return string
41     */
42    public function getIcon(): string {
43        return $this->icon;
44    }
45
46    /**
47     * @param string $icon
48     */
49    public function setIcon( string $icon ): void {
50        $this->icon = $icon;
51    }
52
53    /**
54     * @return string
55     */
56    public function getDescription(): string {
57        return $this->description;
58    }
59
60    /**
61     * @param string $description
62     */
63    public function setDescription( string $description ): void {
64        $this->description = $description;
65    }
66
67    /**
68     * @return ContributeCardAction
69     */
70    public function getAction(): ContributeCardAction {
71        return $this->action;
72    }
73
74    /**
75     * @param ContributeCardAction $action
76     */
77    public function setAction( ContributeCardAction $action ): void {
78        $this->action = $action;
79    }
80
81    /**
82     * @return array
83     */
84    public function toArray(): array {
85        return [
86            'title' => $this->title,
87            'icon' => $this->icon,
88            'description' => $this->description,
89            'action' => $this->action->toArray()
90        ];
91    }
92}