release_0_2_0_data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A effectively_installed() 0 4 2
A update_data() 0 16 1
1
<?php
2
/**
3
*
4
* @package phpBB Extension - tas2580 Social Media Buttons
5
* @copyright (c) 2014 tas2580 (https://tas2580.net)
6
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
*
8
*/
9
10
namespace tas2580\socialbuttons\migrations;
11
12
class release_0_2_0_data extends \phpbb\db\migration\migration
13
{
14
	public function effectively_installed()
15
	{
16
		return isset($this->config['socialbuttons_version']) && version_compare($this->config['socialbuttons_version'], '0.2.0', '>=');
17
	}
18
19
	public function update_data()
20
	{
21
		return array(
22
			// Add configs
23
			array('config.add', array('socialbuttons_multiplicator', '3600')),
24
			array('config.add', array('socialbuttons_cachetime', '24')),
25
			array('config.add', array('socialbuttons_position', '2')),
26
			array('config.add', array('socialbuttons_facebook', '1')),
27
			array('config.add', array('socialbuttons_twitter', '1')),
28
			array('config.add', array('socialbuttons_google', '1')),
29
			array('config.add', array('socialbuttons_linkedin', '1')),
30
31
			// Keep track of version in the database
32
			array('config.add', array('socialbuttons_version', '0.2.0')),
33
		);
34
	}
35
}
36