Conditions | 3 |
Paths | 6 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 2 | public function get($id) |
|
35 | { |
||
36 | 2 | $entry = null; |
|
37 | $metadata = [ |
||
38 | 'id' => $id |
||
39 | 2 | ]; |
|
40 | |||
41 | try { |
||
42 | 2 | $benchmark = $this->profiler->start('Container::get', $metadata, 'Container-Interop'); |
|
43 | 2 | $entry = $this->container->get($id); |
|
44 | 2 | } catch (\Exception $e) { |
|
45 | // exception needs to be catched and thrown after stopping the profiler |
||
46 | } |
||
47 | |||
48 | 2 | $this->profiler->stop($benchmark); |
|
49 | |||
50 | 2 | if (isset($e)) { |
|
51 | 1 | throw $e; |
|
52 | } |
||
53 | |||
54 | 1 | return $entry; |
|
55 | } |
||
56 | |||
73 |