Test Failed
Push — master ( b92529...75236f )
by genesos
32s
created

CommonModuleBaseService::__constuct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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_WRITE);
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
	protected function __constuct(string $connection_group_name)
26
	{
27
		$this->connection_group_name = $connection_group_name;
28
	}
29
}
30