Completed
Push — master ( 63e3ab...e4f0f6 )
by Michael
05:16 queued 02:40
created

ext   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A is_enableable() 0 4 2
A s9e_textformatter_installed() 0 4 1
A s9e_mediamebed_installed() 0 4 1
1
<?php
2
/**
3
 *
4
 * phpBB Media Embed PlugIn extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2016 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\mediaembed;
12
13
class ext extends \phpbb\extension\base
14
{
15
	/**
16
	 * {@inheritDoc}
17
	 */
18
	public function is_enableable()
19
	{
20
		return $this->s9e_textformatter_installed() && !$this->s9e_mediamebed_installed();
21
	}
22
23
	/**
24
	 * Check if s9e TextFormatter is installed (it must be
25
	 * to enable this extension).
26
	 *
27
	 * @return bool
28
	 */
29
	public function s9e_textformatter_installed()
30
	{
31
		return class_exists('\s9e\TextFormatter\Configurator');
32
	}
33
34
	/**
35
	 * Check if s9e MediaEmbed extension for phpBB is installed
36
	 * (it must NOT be to enable this extension).
37
	 *
38
	 * @return bool
39
	 */
40
	public function s9e_mediamebed_installed()
41
	{
42
		return class_exists('\s9e\mediaembed\ext');
43
	}
44
}
45