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

MPAARating::run()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 2
c 1
b 0
f 1
nc 2
nop 0
dl 0
loc 5
rs 10
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