Completed
Push — master ( bb1be4...cd866c )
by Matt
17s
created

m6_hide_for_group   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 36.59 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 15
loc 41
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 6 1
A depends_on() 0 4 1
A update_data() 15 15 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\admanagement\migrations\v10x;
12
13
class m6_hide_for_group extends \phpbb\db\migration\container_aware_migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		$config_text = $this->container->get('config_text');
21
22
		return $config_text->get('phpbb_admanagement_hide_groups') !== null;
23
	}
24
25
	/**
26
	* {@inheritDoc}
27
	*/
28
	static public function depends_on()
1 ignored issue
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
29
	{
30
		return array('\phpbb\admanagement\migrations\v10x\m5_end_date');
31
	}
32
33
	/**
34
	* Add the ACP settings module
35
	*
36
	* @return array Array of data update instructions
37
	*/
38 View Code Duplication
	public function update_data()
1 ignored issue
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
39
	{
40
		return array(
41
			array('config_text.add', array('phpbb_admanagement_hide_groups', '[]')),
42
43
			array('module.add', array(
44
				'acp',
45
				'ACP_ADMANAGEMENT_TITLE',
46
				array(
47
					'module_basename'	=> '\phpbb\admanagement\acp\main_module',
48
					'modes'				=> array('settings'),
49
				),
50
			)),
51
		);
52
	}
53
}
54