| Conditions | 8 |
| Paths | 8 |
| Total Lines | 27 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 8.0231 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | { |
||
| 45 | 45 | return $this->container->get($name); |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Check if service is registered. |
||
| 50 | * |
||
| 51 | * @param string $name |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | 3 | public function has($name): bool |
|
| 56 | { |
||
| 57 | try { |
||
| 58 | 3 | $this->container->get($name); |
|
| 59 | |||
| 60 | 2 | return true; |
|
| 61 | 1 | } catch (\Exception $e) { |
|
| 62 | 1 | return false; |
|
| 63 | } |
||
| 64 | } |
||
| 65 | } |
||
| 66 |