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...
36
{
37
/**
38
* Implement nette smart magic
39
*/
40
1
use Nette\SmartObject;
41
42
/**
43
* @var Session\SwitchableSession
44
*/
45
private $session;
46
47
/**
48
* @param Session\SwitchableSession $session
49
*/
50
public function __construct(
51
Session\SwitchableSession $session
52
) {
53
$this->session = $session;
54
}
55
56
/**
57
* @param WebSocketsEntities\Clients\IClient $from
58
* @param WebSocketsHttp\IRequest $httpRequest
59
*
60
* @return void
61
*/
62
public function __invoke(WebSocketsEntities\Clients\IClient $from, WebSocketsHttp\IRequest $httpRequest)
63
{
64
if ($this->session instanceof Session\SwitchableSession) {
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.