Service2   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 3
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0
1
<?php
2
3
namespace Example;
4
5
use SlidesWorker\ServiceLocator\ServiceLocator;
6
7
class Service1
8
{
9
}
10
11
class Service2
12
{
13
}
14
15
16
// setup ServiceLocator
17
$serviceLocator = new ServiceLocator();
18
19
20
$serviceLocator->set('service1', new Service1());
21
$serviceLocator->set('service2', new Service2());
22
23
$service1 = $serviceLocator->get('service1');
24
$service2 = $serviceLocator->get('service2');
25