Passed
Push — master ( 78e574...429ad5 )
by Jakub
03:25
created

m2_configs   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
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
 * Akismet notification type migrations.
4
 *
5
 * @package phpBB Extension - Gothick Akismet
6
 * @copyright (c) 2017 Matt Gibson Creative Ltd.
7
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
8
 *
9
 */
10
namespace senky\akismet\migrations\v10x;
11
12
class m2_configs extends \phpbb\db\migration\migration
13
{
14
	/**
15
	 * {@inheritDoc}
16
	 */
17
	public function effectively_installed()
18
	{
19
		return $this->config->offsetExists('senky_akismet_api_key');
20
	}
21
22
	/**
23
	 * {@inheritDoc}
24
	 */
25
	static public function depends_on()
26
	{
27
		return array('\senky\akismet\migrations\v10x\m1_acp_module');
28
	}
29
30
	/**
31
	 * {@inheritDoc}
32
	 */
33
	public function update_data()
34
	{
35
		return array(
36
			array('config.add', array('senky_akismet_api_key', '')),
37
			array('config.add', array('senky_akismet_check_registrations', 0)),
38
			array('config.add', array('senky_akismet_add_registering_spammers_to_group', 0)),
39
			array('config.add', array('senky_akismet_add_registering_blatant_spammers_to_group', 0)),
40
			array('config.add', array('senky_akismet_skip_check_after_n_posts', 0)),
41
		);
42
	}
43
}
44