Completed
Branch master (b1a112)
by Matt
01:21
created

m13_set_permissions   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 3 1
A depends_on() 0 6 1
A update_permissions() 0 4 1
A update_data() 0 4 1
1
<?php
2
/**
3
 *
4
 * Ideas extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ideas\migrations;
12
13
class m13_set_permissions extends \phpbb\db\migration\migration
1 ignored issue
show
Bug introduced by
The type phpbb\db\migration\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 static function depends_on()
19
	{
20
		return [
21
			'\phpbb\ideas\migrations\m1_initial_schema',
22
			'\phpbb\ideas\migrations\m3_acp_data',
23
			'\phpbb\ideas\migrations\m12_drop_base_url_config',
24
		];
25
	}
26
27
	/**
28
	 * {@inheritDoc}
29
	 */
30
	public function effectively_installed()
31
	{
32
		return $this->config['ideas_forum_id'] === 0;
33
	}
34
35
	/**
36
	 * @inheritDoc
37
	 */
38
	public function update_data()
39
	{
40
		return [
41
			['custom', [[$this, 'update_permissions']]],
42
		];
43
	}
44
45
	public function update_permissions()
46
	{
47
		$permission_helper = new \phpbb\ideas\factory\permission_helper($this->config, $this->db, $this->phpbb_root_path, $this->php_ext);
48
		$permission_helper->set_ideas_forum_permissions($this->config['ideas_forum_id']);
49
	}
50
}
51