| Conditions | 3 |
| Paths | 3 |
| Total Lines | 26 |
| Code Lines | 12 |
| Lines | 6 |
| Ratio | 23.08 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | public function indexAction() |
||
| 48 | { |
||
| 49 | /** @var string|null $id */ |
||
| 50 | $id = $this->params('id'); |
||
| 51 | $resume = $this->repository->find($id); |
||
| 52 | |||
| 53 | View Code Duplication | if (!$resume) { |
|
|
|
|||
| 54 | $this->getResponse()->setStatusCode(Response::STATUS_CODE_404); |
||
| 55 | return [ |
||
| 56 | 'message' => sprintf($this->translator->translate('Resume with id "%s" not found'), $id) |
||
| 57 | ]; |
||
| 58 | } |
||
| 59 | |||
| 60 | /* @todo REMOVE THIS |
||
| 61 | * @codeCoverageIgnoreStart */ |
||
| 62 | if (!$resume->getDateCreated()) { |
||
| 63 | $resume->setDateCreated(); |
||
| 64 | } |
||
| 65 | /* @codeCoverageIgnoreEnd */ |
||
| 66 | |||
| 67 | $this->acl($resume, 'view'); |
||
| 68 | |||
| 69 | return [ |
||
| 70 | 'resume' => $resume |
||
| 71 | ]; |
||
| 72 | } |
||
| 73 | |||
| 74 | } |
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.