GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

TbDetailView::init()   C
last analyzed

Complexity

Conditions 8
Paths 15

Size

Total Lines 31
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 72

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 31
ccs 0
cts 26
cp 0
rs 5.3846
cc 8
eloc 17
nc 15
nop 0
crap 72
1
<?php
2
/**
3
 *## TbDetailView class file.
4
 *
5
 *
6
 * @author Christoffer Niska <[email protected]>
7
 * @copyright Copyright &copy; Christoffer Niska 2011-
8
 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php)
9
 */
10
11
Yii::import('zii.widgets.CDetailView');
12
13
/**
14
 *## Bootstrap Zii detail view.
15
 *
16
 * @package booster.widgets.grouping
17
 */
18
class TbDetailView extends CDetailView
19
{
20
	// Table types.
21
	const TYPE_STRIPED = 'striped';
22
	const TYPE_BORDERED = 'bordered';
23
	const TYPE_CONDENSED = 'condensed';
24
25
	/**
26
	 * @var string|array the table type.
27
	 * Valid values are 'striped', 'bordered' and/or 'condensed'.
28
	 */
29
	public $type = array(self::TYPE_STRIPED, self::TYPE_CONDENSED);
30
31
	/**
32
	 * @var string the URL of the CSS file used by this detail view.
33
	 * Defaults to false, meaning that no CSS will be included.
34
	 */
35
	public $cssFile = false;
36
37
	/**
38
	 *### .init()
39
	 *
40
	 * Initializes the widget.
41
	 */
42
	public function init()
43
	{
44
		parent::init();
45
46
		$classes = array('table');
47
48
		if (isset($this->type)) {
49
			if (is_string($this->type)) {
50
				$this->type = explode(' ', $this->type);
51
			}
52
53
			$validTypes = array(self::TYPE_STRIPED, self::TYPE_BORDERED, self::TYPE_CONDENSED);
54
55
			if (!empty($this->type)) {
56
				foreach ($this->type as $type) {
57
					if (in_array($type, $validTypes)) {
58
						$classes[] = 'table-' . $type;
59
					}
60
				}
61
			}
62
		}
63
64
		if (!empty($classes)) {
65
			$classes = implode(' ', $classes);
66
			if (isset($this->htmlOptions['class'])) {
67
				$this->htmlOptions['class'] .= ' ' . $classes;
68
			} else {
69
				$this->htmlOptions['class'] = $classes;
70
			}
71
		}
72
	}
73
}
74