Passed
Pull Request — master (#1)
by Dark❶
03:30
created

ext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_enableable() 0 4 2
1
<?php
2
/**
3
 *
4
 * Reduce Search Index [RSI]. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2020, Dark❶, https://dark1.tech
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace dark1\reducesearchindex;
12
13
/**
14
 * @ignore
15
 */
16
use phpbb\extension\base;
17
18
/**
19
 * Reduce Search Index Extension base
20
 */
21
class ext extends base
22
{
23
	/** string Require phpBB v3.2.9 due to various reasons. */
24
	const RSI_PHPBB_MIN_VERSION = '3.2.9';
25
26
	/**
27
	 * {@inheritdoc}
28
	 */
29
	public function is_enableable()
30
	{
31
		$config = $this->container->get('config');
32
		return phpbb_version_compare($config['version'], self::RSI_PHPBB_MIN_VERSION, '>=') && phpbb_version_compare(PHPBB_VERSION, self::RSI_PHPBB_MIN_VERSION, '>=');
33
	}
34
35
}
36