Passed
Push — master ( d021a5...a13070 )
by Sam
03:47 queued 12s
created

MPAARating   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
c 1
b 0
f 1
dl 0
loc 16
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 5 2
1
<?php
2
3
/**
4
 * Renders the MPAA rating for a media item
5
 *
6
 * @author Sam Stenvall <[email protected]>
7
 * @copyright Copyright &copy; Sam Stenvall 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
class MPAARating extends CWidget
11
{
12
13
	/**
14
	 * @var string the rating
15
	 */
16
	public $rating;
17
18
	/**
19
	 * Runs the widget
20
	 */
21
	public function run()
22
	{
23
		// MPAA rating is not always available
24
		if ($this->rating)
25
			echo '<p>'.Yii::t('Media', 'MPAA rating').': '.$this->rating.'</p>';
26
	}
27
28
}
29