These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the XiideaEasyAuditBundle package. |
||
5 | * |
||
6 | * (c) Xiidea <http://www.xiidea.net> |
||
7 | * |
||
8 | * This source file is subject to the MIT license that is bundled |
||
9 | * with this source code in the file LICENSE. |
||
10 | */ |
||
11 | |||
12 | namespace Xiidea\EasyAuditBundle\Resolver\UserEventCommand; |
||
13 | |||
14 | use FOS\UserBundle\Event\UserEvent; |
||
15 | |||
16 | class ImplicitLoginCommand extends ResolverCommand |
||
17 | { |
||
18 | /** |
||
19 | * @param UserEvent $event |
||
20 | * @param array $default |
||
21 | * @return mixed |
||
22 | */ |
||
23 | View Code Duplication | public function resolve($event, $default = array()) |
|
0 ignored issues
–
show
|
|||
24 | { |
||
25 | if( !($event instanceof UserEvent)) { |
||
26 | return $default; |
||
27 | } |
||
28 | |||
29 | return $this->getEventDetailsArray( |
||
30 | "User Logged in", |
||
31 | "User '%s' Logged in Successfully using remember me service", |
||
32 | $event->getUser()->getUsername() |
||
33 | ); |
||
34 | } |
||
35 | } |
||
36 |
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.