Passed
Push — master ( e8c113...51a84a )
by Dark❶
02:30
created

mas_0006_general::update_data()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 63
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 40
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 63
rs 9.28

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 *
4
 * Member Avatar & Status [MAS]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2018-2021, Dark❶ [dark1]
7
 * @license GNU General Public License, version 2 (GPL-2.0-only)
8
 *
9
 */
10
11
namespace dark1\memberavatarstatus\migrations;
12
13
class mas_0006_general extends \phpbb\db\migration\migration
14
{
15
	static public function depends_on()
16
	{
17
		return ['\dark1\memberavatarstatus\migrations\mas_0005_review'];
18
	}
19
20
	public function update_data()
21
	{
22
		return [
23
			// Config Add
24
			['config.add', ['dark1_mas_avatar', 0]],
25
			['config.add', ['dark1_mas_online', 0]],
26
			['config.add', ['dark1_mas_col_off', '000000']],
27
			['config.add', ['dark1_mas_col_on', '00FF00']],
28
29
			// Module Remove
30
			['module.remove', ['acp', 'ACP_MAS_TITLE', 'ACP_MAS_MODE_REVIEW']],
31
			['module.remove', ['acp', 'ACP_MAS_TITLE', 'ACP_MAS_MODE_SEARCH']],
32
			['module.remove', ['acp', 'ACP_MAS_TITLE', 'ACP_MAS_MODE_VIEWFORUM']],
33
			['module.remove', ['acp', 'ACP_MAS_TITLE', 'ACP_MAS_MODE_VIEWONLINE']],
34
			['module.remove', ['acp', 'ACP_MAS_TITLE', 'ACP_MAS_MODE_MEMBERLIST']],
35
36
			// Module Add
37
			['module.add', [
38
				'acp',
39
				'ACP_MAS_TITLE',
40
				[
41
					'module_basename'	=> '\dark1\memberavatarstatus\acp\general_module',
42
					'modes'				=> ['general'],
43
				],
44
			]],
45
			['module.add', [
46
				'acp',
47
				'ACP_MAS_TITLE',
48
				[
49
					'module_basename'	=> '\dark1\memberavatarstatus\acp\memberlist_module',
50
					'modes'				=> ['memberlist'],
51
				],
52
			]],
53
			['module.add', [
54
				'acp',
55
				'ACP_MAS_TITLE',
56
				[
57
					'module_basename'	=> '\dark1\memberavatarstatus\acp\viewonline_module',
58
					'modes'				=> ['viewonline'],
59
				],
60
			]],
61
			['module.add', [
62
				'acp',
63
				'ACP_MAS_TITLE',
64
				[
65
					'module_basename'	=> '\dark1\memberavatarstatus\acp\viewforum_module',
66
					'modes'				=> ['viewforum'],
67
				],
68
			]],
69
			['module.add', [
70
				'acp',
71
				'ACP_MAS_TITLE',
72
				[
73
					'module_basename'	=> '\dark1\memberavatarstatus\acp\search_module',
74
					'modes'				=> ['search'],
75
				],
76
			]],
77
			['module.add', [
78
				'acp',
79
				'ACP_MAS_TITLE',
80
				[
81
					'module_basename'	=> '\dark1\memberavatarstatus\acp\review_module',
82
					'modes'				=> ['review'],
83
				],
84
			]],
85
		];
86
	}
87
}
88