Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 11 |
Lines | 23 |
Ratio | 100 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function actionDefault($id) |
||
38 | { |
||
39 | if (isset($_GET['bcode'])) { |
||
40 | |||
41 | $this->businessman = $this->em->getRepository('\WebCMS\InvestformModule\Entity\Businessman')->findOneBy(array( |
||
42 | 'businessUrl' => $_GET['bcode'] |
||
43 | )); |
||
44 | |||
45 | if ($this->businessman) { |
||
46 | $this->businessmanSession = $this->getSession('businessman'); |
||
47 | $this->businessmanSession->id = $this->businessman->getId(); |
||
48 | |||
49 | $this->flashMessage('Your business code has been saved.', 'success'); |
||
50 | } else { |
||
51 | $this->flashMessage('Wrong business code.', 'error'); |
||
52 | } |
||
53 | |||
54 | } |
||
55 | |||
56 | |||
57 | |||
58 | $this->redirect(':Frontend:Homepage:'); |
||
59 | } |
||
60 | |||
62 |
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.