| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 11 |
| Ratio | 100 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace Chekote\NounStore; |
||
| 42 | 21 | View Code Duplication | public function keyExists($key, $index = null) |
|
|
|||
| 43 | { |
||
| 44 | 21 | list($key, $index) = $this->keyService->parse($key, $index); |
|
| 45 | |||
| 46 | 20 | if (!$this->store->keyExists($key, $index)) { |
|
| 47 | 5 | throw new OutOfBoundsException( |
|
| 48 | 5 | "Entry '" . $this->keyService->build($key, $index) . "' was not found in the store." |
|
| 49 | ); |
||
| 50 | } |
||
| 51 | |||
| 52 | 15 | return $this->store->get($key, $index); |
|
| 53 | } |
||
| 55 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.