m2_configs   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 3 1
A depends_on() 0 3 1
A update_data() 0 8 1
1
<?php
2
/**
3
 *
4
 * Akismet. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2018 Jakub Senko <[email protected]>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace senky\akismet\migrations\v10x;
12
13
class m2_configs extends \phpbb\db\migration\migration
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function effectively_installed()
19
	{
20
		return $this->config->offsetExists('senky_akismet_api_key');
21
	}
22
23
	/**
24
	 * {@inheritDoc}
25
	 */
26
	static public function depends_on()
27
	{
28
		return array('\senky\akismet\migrations\v10x\m1_acp_module');
29
	}
30
31
	/**
32
	 * {@inheritDoc}
33
	 */
34
	public function update_data()
35
	{
36
		return array(
37
			array('config.add', array('senky_akismet_api_key', '')),
38
			array('config.add', array('senky_akismet_check_registrations', 0)),
39
			array('config.add', array('senky_akismet_add_registering_spammers_to_group', 0)),
40
			array('config.add', array('senky_akismet_add_registering_blatant_spammers_to_group', 0)),
41
			array('config.add', array('senky_akismet_skip_check_after_n_posts', 0)),
42
		);
43
	}
44
}
45