add_date_config   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A depends_on() 0 4 1
A update_data() 0 6 1
A update_schema() 0 10 1
A revert_schema() 0 10 1
1
<?php
2
/**
3
 *
4
 * Ajax Shoutbox extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2014 Paul Sohier <http://www.ajax-shoutbox.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
namespace paul999\ajaxshoutbox\migrations;
11
12
class add_date_config extends \phpbb\db\migration\migration
13
{
14
	static public function depends_on()
0 ignored issues
show
Coding Style introduced by
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
15
	{
16
		return array();
17
	}
18
19
	public function update_data()
20
	{
21
		return array(
22
			array('config.add', array('ajaxshoutbox_date_format', 'd M Y H:i')),
23
		);
24
	}
25
26
	public function update_schema()
27
	{
28
		return array(
29
			'add_columns'        => array(
30
				$this->table_prefix . 'users'        => array(
31
					'user_ajaxshoutbox_format'    => array('VCHAR:30', 'd M Y H:i'),
32
				),
33
			),
34
		);
35
	}
36
37
	public function revert_schema()
38
	{
39
		return array(
40
			'drop_columns'        => array(
41
				$this->table_prefix . 'users'        => array(
42
					'user_ajaxshoutbox_format',
43
				),
44
			),
45
		);
46
	}
47
}
48