Test Failed
Pull Request — master (#9)
by
unknown
01:48
created

CommonModuleBaseService   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMasterInstance() 0 4 1
A getDefaultInstance() 0 4 1
A __constuct() 0 4 1
1
<?php
2
namespace Ridibooks\Platform\Common\Base;
3
4
use Ridibooks\Platform\Common\Constant\PlatformConnectionGroup;
5
6
abstract class CommonModuleBaseService
7
{
8
	/** @var string */
9
	protected $connection_group_name;
10
11
	public static function getMasterInstance()
12
	{
13
		return new static(PlatformConnectionGroup::COMMON_MODULE_WRITE);
0 ignored issues
show
Unused Code introduced by
The call to CommonModuleBaseService::__construct() has too many arguments starting with \Ridibooks\Platform\Comm...up::COMMON_MODULE_WRITE.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
14
	}
15
16
	public static function getDefaultInstance()
17
	{
18
		return new static(PlatformConnectionGroup::COMMON_MODULE_READ);
0 ignored issues
show
Unused Code introduced by
The call to CommonModuleBaseService::__construct() has too many arguments starting with \Ridibooks\Platform\Comm...oup::COMMON_MODULE_READ.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
19
	}
20
21
	protected function __constuct(string $connection_group_name)
22
	{
23
		$this->connection_group_name = $connection_group_name;
24
	}
25
}
26