m3_acp_data   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 4
eloc 11
c 0
b 0
f 0
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 3 1
A update_data() 0 13 1
A effectively_installed() 0 3 2
1
<?php
2
/**
3
 *
4
 * Ideas extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ideas\migrations;
12
13
class m3_acp_data extends \phpbb\db\migration\migration
14
{
15
	public function effectively_installed()
16
	{
17
		return $this->config->offsetExists('ideas_forum_id') || $this->config->offsetExists('ideas_poster_id');
18
	}
19
20
	public static function depends_on()
21
	{
22
		return array('\phpbb\ideas\migrations\m1_initial_schema');
23
	}
24
25
	public function update_data()
26
	{
27
		return array(
28
			array('module.add', array('acp', 'ACP_CAT_DOT_MODS', 'ACP_PHPBB_IDEAS')),
29
			array('module.add', array(
30
				'acp', 'ACP_PHPBB_IDEAS', array(
31
					'module_basename'	=> '\phpbb\ideas\acp\ideas_module',
32
					'modes'				=> array('settings'),
33
				),
34
			)),
35
36
			array('config.add', array('ideas_forum_id', 0)),
37
			array('config.add', array('ideas_poster_id', 0)),
38
		);
39
	}
40
}
41