Completed
Push — master ( 783e4f...8995ac )
by Matt
01:30
created

ext   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_enableable() 0 14 2
1
<?php
2
/**
3
 *
4
 * Topic Image Preview. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017, Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\topicimagepreview;
12
13
class ext extends \phpbb\extension\base
14
{
15
	/**
16
	 * The minimum phpBB version required by this extension
17
	 */
18
	const PHPBB_MIN_VERSION = '3.2.1';
19
20
	/**
21
	 * {@inheritdoc}
22
	 */
23
	public function is_enableable()
24
	{
25
		// Require minimum phpBB version.
26
		$is_enableable = phpbb_version_compare(PHPBB_VERSION, self::PHPBB_MIN_VERSION, '>=');
27
28
		// If not enableable, add our custom install error language keys
29
		if (!$is_enableable)
30
		{
31
			$lang = $this->container->get('language');
32
			$lang->add_lang('tip_install', 'vse/topicimagepreview');
33
		}
34
35
		return $is_enableable;
36
	}
37
}
38