m6_hide_for_group::update_data()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
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\ads\migrations\v10x;
12
13
class m6_hide_for_group extends \phpbb\db\migration\container_aware_migration
0 ignored issues
show
Bug introduced by
The type phpbb\db\migration\container_aware_migration was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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_ads_hide_groups') !== null;
23
	}
24
25
	/**
26
	 * {@inheritDoc}
27
	 */
28
	public static function depends_on()
29
	{
30
		return array(
31
			'\phpbb\ads\migrations\v10x\m1_initial_schema',
32
			'\phpbb\ads\migrations\v10x\m2_acp_module',
33
		);
34
	}
35
36
	/**
37
	 * Add the ACP settings module
38
	 *
39
	 * @return array Array of data update instructions
40
	 */
41
	public function update_data()
42
	{
43
		return array(
44
			array('config_text.add', array('phpbb_ads_hide_groups', '[]')),
45
46
			array('module.add', array(
47
				'acp',
48
				'ACP_PHPBB_ADS_TITLE',
49
				array(
50
					'module_basename'	=> '\phpbb\ads\acp\main_module',
51
					'modes'				=> array('settings'),
52
				),
53
			)),
54
		);
55
	}
56
}
57