menu::get_depth_options()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
ccs 5
cts 5
cp 1
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 *
5
 * @package sitemaker
6
 * @copyright (c) 2013 Daniel A. (blitze)
7
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8
 *
9
 */
10
11
namespace blitze\sitemaker\blocks;
12
13
/**
14
 * Menu Block
15
 * @package phpBB Sitemaker Main Menu
16
 */
17
class menu extends links
18
{
19
	/** @var string */
20
	protected $title = 'MENU';
21
22
	/** @var bool */
23
	protected $is_navigation = true;
24
25
	/**
26
	 * {@inheritdoc}
27
	 */
28
	public function get_config(array $settings)
29
	{
30 1
		$depth_options = $this->get_depth_options();
31
32 1
		return array_merge(
33 1
			parent::get_config($settings),
34
			array(
35
				'expanded'		=> array('lang' => 'EXPANDED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'default' => 0, 'explain' => false),
36 1
				'max_depth'		=> array('lang' => 'MAX_DEPTH', 'validate' => 'int', 'type' => 'select', 'options' => $depth_options, 'default' => 3, 'explain' => false),
37 1
			)
38 1
		);
39 1
	}
40 1
41
	/**
42
	 * @return int[]
43
	 */
44
	protected function get_depth_options()
45
	{
46 1
		$options = array();
47
		for ($i = 3; $i < 10; $i++)
48 1
		{
49 1
			$options[$i] = $i;
50
		}
51 1
52 1
		return $options;
53
	}
54
}
55