Completed
Pull Request — master (#48)
by Marc
02:47
created

viglink_ask_admin_wait::effectively_installed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 *
4
 * VigLink 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\viglink\migrations;
12
13
/**
14
 * Migration to only ask admin once per day
15
 */
16
class viglink_ask_admin_wait extends \phpbb\db\migration\migration
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
	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...
19
	{
20
		return array('\phpbb\viglink\migrations\viglink_ask_admin');
21
	}
22
23
	public function effectively_installed()
24
	{
25
		return isset($this->config['viglink_ask_admin_last']);
26
	}
27
28
	public function update_data()
29
	{
30
		return array(
31
			array('if', array(
32
				(!$this->config->offsetExists('viglink_ask_admin_last')),
33
				array('config.add', array('viglink_ask_admin_last', '0')),
34
			)),
35
		);
36
	}
37
}
38