Test Failed
Push — master ( ab2bba...f71f8b )
by
unknown
01:52
created

CommonModuleBaseService   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getMasterInstance() 0 6 1
A getDefaultInstance() 0 6 1
A __construct() 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
		$class_name = get_called_class();
14
15
		return new $class_name(PlatformConnectionGroup::COMMON_MODULE_READ_MASTER);
16
	}
17
18
	public static function getDefaultInstance()
19
	{
20
		$class_name = get_called_class();
21
22
		return new $class_name(PlatformConnectionGroup::COMMON_MODULE_READ);
23
	}
24
25
	public function __construct(string $connection_group_name)
26
	{
27
		$this->connection_group_name = $connection_group_name;
28
	}
29
}
30