ext   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 7
c 3
b 0
f 0
dl 0
loc 16
ccs 0
cts 2
cp 0
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_enableable() 0 4 2
1
<?php
2
/**
3
 *
4
 * Advertisement management. An extension for the phpBB Forum Software package.
5
 *
6
 * @copyright (c) 2017 phpBB Limited <https://www.phpbb.com>
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace phpbb\ads;
12
13
class ext extends \phpbb\extension\base
0 ignored issues
show
Bug introduced by
The type phpbb\extension\base was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
14
{
15
	public const DATE_FORMAT = 'Y-m-d';
16
	public const MAX_NAME_LENGTH = 255;
17
	public const DEFAULT_PRIORITY = 5;
18
	public const AD_BLOCK_MODES = [0, 1, 2];
19
20
	/**
21
	 * {@inheritdoc}
22
	 *
23
	 * Requires phpBB 3.3.2 due to using role_exists check in permission migration.
24
	 */
25
	public function is_enableable()
26
	{
27
		return phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')
0 ignored issues
show
Bug introduced by
The function phpbb_version_compare was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
		return /** @scrutinizer ignore-call */ phpbb_version_compare(PHPBB_VERSION, '3.3.2', '>=')
Loading history...
Bug introduced by
The constant phpbb\ads\PHPBB_VERSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
28
			&& phpbb_version_compare(PHPBB_VERSION, '4.0.0-dev', '<');
29
	}
30
}
31