Completed
Pull Request — master (#16)
by Jakub
08:08
created

m6_hide_for_group::effectively_installed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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\migration
14
{
15
	/**
16
	* {@inheritDoc}
17
	*/
18
	public function effectively_installed()
19
	{
20
		return $config_text->get('phpbb_admanagement_hide_groups') !== null;
0 ignored issues
show
Bug introduced by
The variable $config_text does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
21
	}
22
23
	/**
24
	* {@inheritDoc}
25
	*/
26
	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...
27
	{
28
		return array('\phpbb\admanagement\migrations\v10x\m5_end_date');
29
	}
30
31
	/**
32
	* Add the ACP settings module
33
	*
34
	* @return array Array of data update instructions
35
	*/
36 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...
37
	{
38
		return array(
39
			array('config_text.add', array('phpbb_admanagement_hide_groups', '[]')),
40
41
			array('module.add', array(
42
				'acp',
43
				'ACP_ADMANAGEMENT_TITLE',
44
				array(
45
					'module_basename'	=> '\phpbb\admanagement\acp\main_module',
46
					'modes'				=> array('settings'),
47
				),
48
			)),
49
		);
50
	}
51
}
52