This class seems to be duplicated in your project.
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.
Loading history...
16
{
17
use SerializesModels;
18
/**
19
* @var Request
20
*/
21
protected $request;
22
/**
23
* @var UserModel
24
*/
25
protected $user;
26
27
/**
28
* CasUserLoginEvent constructor.
29
* @param Request $request
30
* @param UserModel $user
31
*/
32
1
public function __construct(Request $request, UserModel $user)
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
33
{
34
1
$this->request = $request;
35
1
$this->user = $user;
36
1
}
37
38
/**
39
* Get the channels the event should be broadcast on.
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.