ServiceProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
c 2
b 0
f 0
lcom 0
cbo 4
dl 0
loc 32
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 22 1
1
<?php
2
3
namespace Test;
4
5
use League\Container\ServiceProvider\AbstractServiceProvider;
6
7
/**
8
 * Description of ServiceProvider
9
 *
10
 * @author d.lanec
11
 */
12
class ServiceProvider extends AbstractServiceProvider {
13
	
14
	protected $provides = [
15
		'UserMapper',
16
		'UserGroupMapper',
17
		'UserGroupMapper',
18
		'CityMapper'
19
	];
20
	
21
	public function register() {
22
		
23
		$db = new \SimpleORM\Adapter\CodeigniterQueryBuilder(get_instance()->db);
24
		
25
		$this->getContainer()->add('UserMapper','Test\Domain\User\UserMapper')
26
				->withArgument($this->getContainer())
27
				->withArgument($db)
28
				->withArgument('test_db');
29
		
30
		$this->getContainer()->add('UserGroupMapper','Test\Domain\UserGroup\UserGroupMapper')
31
				->withArgument($this->getContainer())
32
				->withArgument($db)
33
				->withArgument('test_db');	
34
		$this->getContainer()->add('UserAddressMapper','Test\Domain\UserAddress\UserAddressMapper')
35
				->withArgument($this->getContainer())
36
				->withArgument($db)
37
				->withArgument('test_db');	
38
		$this->getContainer()->add('CityMapper','Test\Domain\City\CityMapper')
39
				->withArgument($this->getContainer())
40
				->withArgument($db)
41
				->withArgument('test_db');	
42
	}	
43
}
44