m4_notification_data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 3 1
A revert_schema() 0 6 1
A update_schema() 0 6 1
1
<?php
2
/**
3
*
4
* Auto Groups extension for the phpBB Forum Software package.
5
*
6
* @copyright (c) 2014 phpBB Limited <https://www.phpbb.com>
7
* @license GNU General Public License, version 2 (GPL-2.0)
8
*
9
*/
10
11
namespace phpbb\autogroups\migrations\v10x;
12
13
/**
14
 * Migration stage 4: Notification data
15
 */
16
class m4_notification_data extends \phpbb\db\migration\migration
0 ignored issues
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...
17
{
18
	/**
19
	 * Assign migration file dependencies for this migration
20
	 *
21
	 * @return array Array of migration files
22
	 * @static
23
	 * @access public
24
	 */
25
	public static function depends_on()
26
	{
27
		return array('\phpbb\autogroups\migrations\v10x\m1_initial_schema');
28
	}
29
30
	/**
31
	 * Add table columns schema to the database:
32
	 *    auto groups:
33
	 *        autogroups_id
34
	 *
35
	 * @return array Array of table columns schema
36
	 * @access public
37
	 */
38
	public function update_schema()
39
	{
40
		return array(
41
			'add_columns'	=> array(
42
				$this->table_prefix . 'autogroups_rules'	=> array(
43
					'autogroups_notify'		=> array('BOOL', 0),
44
				),
45
			),
46
		);
47
	}
48
49
	/**
50
	 * Drop table columns schema from the database
51
	 *
52
	 * @return array Array of table columns schema
53
	 * @access public
54
	 */
55
	public function revert_schema()
56
	{
57
		return array(
58
			'drop_columns'	=> array(
59
				$this->table_prefix . 'autogroups_rules'	=> array(
60
					'autogroups_notify',
61
				),
62
			),
63
		);
64
	}
65
}
66