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

CommonModuleBaseService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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